3 lines
1.5 MiB
Plaintext
3 lines
1.5 MiB
Plaintext
/*! For license information please see main.c8d4b79e.js.LICENSE.txt */
|
|
(()=>{var e={579:(e,t,n)=>{"use strict";e.exports=n(2799)},745:()=>{},2284:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},2799:(e,t)=>{"use strict";var n=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:i,ref:void 0!==t?t:null,props:r}}Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},4288:(e,t)=>{"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function m(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||d}function v(){}function w(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||d}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var y=w.prototype=new v;y.constructor=w,p(y,m.prototype),y.isPureReactComponent=!0;var b=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},x=Object.prototype.hasOwnProperty;function C(e,t,r,i,o,a){return r=a.ref,{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:a}}function F(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function S(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function k(){}function _(e,t,i,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var A,u,l=!1;if(null===e)l=!0;else switch(s){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0;break;case f:return _((l=e._init)(e._payload),t,i,o,a)}}if(l)return a=a(e),l=""===o?"."+S(e,0):o,b(a)?(i="",null!=l&&(i=l.replace(E,"$&/")+"/"),_(a,t,i,"",function(e){return e})):null!=a&&(F(a)&&(A=a,u=i+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(E,"$&/")+"/")+l,a=C(A.type,u,void 0,0,0,A.props)),t.push(a)),1;l=0;var c,d=""===o?".":o+":";if(b(e))for(var p=0;p<e.length;p++)l+=_(o=e[p],t,i,s=d+S(o,p),a);else if("function"===typeof(p=null===(c=e)||"object"!==typeof c?null:"function"===typeof(c=h&&c[h]||c["@@iterator"])?c:null))for(e=p.call(e),p=0;!(o=e.next()).done;)l+=_(o=o.value,t,i,s=d+S(o,p++),a);else if("object"===s){if("function"===typeof e.then)return _(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(k,k):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,i,o,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function I(e,t,n){if(null==e)return e;var r=[],i=0;return _(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var U="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function L(){}t.Children={map:I,forEach:function(e,t,n){I(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return I(e,function(){t++}),t},toArray:function(e){return I(e,function(e){return e})||[]},only:function(e){if(!F(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=i,t.Profiler=a,t.PureComponent=w,t.StrictMode=o,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return B.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var r=p({},e.props),i=e.key;if(null!=t)for(o in void 0!==t.ref&&void 0,void 0!==t.key&&(i=""+t.key),t)!x.call(t,o)||"key"===o||"__self"===o||"__source"===o||"ref"===o&&void 0===t.ref||(r[o]=t[o]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];r.children=a}return C(e.type,i,void 0,0,0,r)},t.createContext=function(e){return(e={$$typeof:A,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,n){var r,i={},o=null;if(null!=t)for(r in void 0!==t.key&&(o=""+t.key),t)x.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(i[r]=t[r]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var s=Array(a),A=0;A<a;A++)s[A]=arguments[A+2];i.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===i[r]&&(i[r]=a[r]);return C(e,o,void 0,0,0,i)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=F,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=B.T,n={};B.T=n;try{var r=e(),i=B.S;null!==i&&i(n,r),"object"===typeof r&&null!==r&&"function"===typeof r.then&&r.then(L,U)}catch(o){U(o)}finally{B.T=t}},t.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},t.use=function(e){return B.H.use(e)},t.useActionState=function(e,t,n){return B.H.useActionState(e,t,n)},t.useCallback=function(e,t){return B.H.useCallback(e,t)},t.useContext=function(e){return B.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return B.H.useDeferredValue(e,t)},t.useEffect=function(e,t,n){var r=B.H;if("function"===typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},t.useId=function(){return B.H.useId()},t.useImperativeHandle=function(e,t,n){return B.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return B.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return B.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return B.H.useMemo(e,t)},t.useOptimistic=function(e,t){return B.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return B.H.useReducer(e,t,n)},t.useRef=function(e){return B.H.useRef(e)},t.useState=function(e){return B.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return B.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return B.H.useTransition()},t.version="19.1.1"},4391:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(7004)},4980:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2284);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}function o(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},5043:(e,t,n)=>{"use strict";e.exports=n(4288)},5239:function(e){e.exports=function(){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{A(r.next(e))}catch(Tt){o(Tt)}}function s(e){try{A(r.throw(e))}catch(Tt){o(Tt)}}function A(e){e.done?n(e.value):i(e.value).then(a,s)}A((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return A([e,t])}}function A(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(Tt){o=[6,Tt],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function o(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||t)}for(var a=function(){function e(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r}return e.prototype.add=function(t,n,r,i){return new e(this.left+t,this.top+n,this.width+r,this.height+i)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var r=Array.from(n).find(function(e){return 0!==e.width});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),s=function(e,t){return a.fromClientRect(e,t.getBoundingClientRect())},A=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),i=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new a(0,0,r,i)},u=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320===(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t},l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,o="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push(55296+(a>>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"===typeof Uint8Array?[]:new Uint8Array(256),h=0;h<c.length;h++)f[c.charCodeAt(h)]=h;for(var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"===typeof Uint8Array?[]:new Uint8Array(256),g=0;g<d.length;g++)p[d.charCodeAt(g)]=g;for(var m=function(e){var t,n,r,i,o,a=.75*e.length,s=e.length,A=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint8Array.prototype.slice?new ArrayBuffer(a):new Array(a),l=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<s;t+=4)n=p[e.charCodeAt(t)],r=p[e.charCodeAt(t+1)],i=p[e.charCodeAt(t+2)],o=p[e.charCodeAt(t+3)],l[A++]=n<<2|r>>4,l[A++]=(15&r)<<4|i>>2,l[A++]=(3&i)<<6|63&o;return u},v=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},w=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},y=5,b=11,B=2,x=65536>>y,C=(1<<y)-1,F=x+(1024>>y)+32,E=65536>>b,S=(1<<b-y)-1,k=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},_=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},I=function(e,t){var n=m(e),r=Array.isArray(n)?w(n):new Uint32Array(n),i=Array.isArray(n)?v(n):new Uint16Array(n),o=24,a=k(i,o/2,r[4]/2),s=2===r[5]?k(i,(o+r[4])/2):_(r,Math.ceil((o+r[4])/4));return new N(r[0],r[1],r[2],r[3],a,s)},N=function(){function e(e,t,n,r,i,o){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=o}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>y])<<B)+(e&C),this.data[t];if(e<=65535)return t=((t=this.index[x+(e-55296>>y)])<<B)+(e&C),this.data[t];if(e<this.highStart)return t=F-E+(e>>b),t=this.index[t],t+=e>>y&S,t=((t=this.index[t])<<B)+(e&C),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Q=0;Q<U.length;Q++)L[U.charCodeAt(Q)]=Q;var D=50,R=1,T=2,P=3,O=4,M=5,H=7,j=8,z=9,K=10,W=11,V=12,G=13,q=14,X=15,Y=16,J=17,Z=18,$=19,ee=20,te=21,ne=22,re=23,ie=24,oe=25,ae=26,se=27,Ae=28,ue=29,le=30,ce=31,fe=32,he=33,de=34,pe=35,ge=36,me=37,ve=38,we=39,ye=40,be=41,Be=42,xe=43,Ce=[9001,65288],Fe="!",Ee="\xd7",Se="\xf7",ke=I("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),_e=[le,ge],Ie=[R,T,P,M],Ne=[K,j],Ue=[se,ae],Le=Ie.concat(Ne),Qe=[ve,we,ye,de,pe],De=[X,G],Re=function(e,t){void 0===t&&(t="strict");var n=[],r=[],i=[];return e.forEach(function(e,o){var a=ke.get(e);if(a>D?(i.push(!0),a-=D):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(o),n.push(Y);if(a===O||a===W){if(0===o)return r.push(o),n.push(le);var s=n[o-1];return-1===Le.indexOf(s)?(r.push(r[o-1]),n.push(s)):(r.push(o),n.push(le))}return r.push(o),a===ce?n.push("strict"===t?te:me):a===Be||a===ue?n.push(le):a===xe?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(me):n.push(le):void n.push(a)}),[r,n,i]},Te=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var o=n;o<=r.length;){if((A=r[++o])===t)return!0;if(A!==K)break}if(i===K)for(o=n;o>0;){var a=r[--o];if(Array.isArray(e)?-1!==e.indexOf(a):e===a)for(var s=n;s<=r.length;){var A;if((A=r[++s])===t)return!0;if(A!==K)break}if(a!==K)break}return!1},Pe=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r!==K)return r;n--}return 0},Oe=function(e,t,n,r,i){if(0===n[r])return Ee;var o=r-1;if(Array.isArray(i)&&!0===i[o])return Ee;var a=o-1,s=o+1,A=t[o],u=a>=0?t[a]:0,l=t[s];if(A===T&&l===P)return Ee;if(-1!==Ie.indexOf(A))return Fe;if(-1!==Ie.indexOf(l))return Ee;if(-1!==Ne.indexOf(l))return Ee;if(Pe(o,t)===j)return Se;if(ke.get(e[o])===W)return Ee;if((A===fe||A===he)&&ke.get(e[s])===W)return Ee;if(A===H||l===H)return Ee;if(A===z)return Ee;if(-1===[K,G,X].indexOf(A)&&l===z)return Ee;if(-1!==[J,Z,$,ie,Ae].indexOf(l))return Ee;if(Pe(o,t)===ne)return Ee;if(Te(re,ne,o,t))return Ee;if(Te([J,Z],te,o,t))return Ee;if(Te(V,V,o,t))return Ee;if(A===K)return Se;if(A===re||l===re)return Ee;if(l===Y||A===Y)return Se;if(-1!==[G,X,te].indexOf(l)||A===q)return Ee;if(u===ge&&-1!==De.indexOf(A))return Ee;if(A===Ae&&l===ge)return Ee;if(l===ee)return Ee;if(-1!==_e.indexOf(l)&&A===oe||-1!==_e.indexOf(A)&&l===oe)return Ee;if(A===se&&-1!==[me,fe,he].indexOf(l)||-1!==[me,fe,he].indexOf(A)&&l===ae)return Ee;if(-1!==_e.indexOf(A)&&-1!==Ue.indexOf(l)||-1!==Ue.indexOf(A)&&-1!==_e.indexOf(l))return Ee;if(-1!==[se,ae].indexOf(A)&&(l===oe||-1!==[ne,X].indexOf(l)&&t[s+1]===oe)||-1!==[ne,X].indexOf(A)&&l===oe||A===oe&&-1!==[oe,Ae,ie].indexOf(l))return Ee;if(-1!==[oe,Ae,ie,J,Z].indexOf(l))for(var c=o;c>=0;){if((f=t[c])===oe)return Ee;if(-1===[Ae,ie].indexOf(f))break;c--}if(-1!==[se,ae].indexOf(l))for(c=-1!==[J,Z].indexOf(A)?a:o;c>=0;){var f;if((f=t[c])===oe)return Ee;if(-1===[Ae,ie].indexOf(f))break;c--}if(ve===A&&-1!==[ve,we,de,pe].indexOf(l)||-1!==[we,de].indexOf(A)&&-1!==[we,ye].indexOf(l)||-1!==[ye,pe].indexOf(A)&&l===ye)return Ee;if(-1!==Qe.indexOf(A)&&-1!==[ee,ae].indexOf(l)||-1!==Qe.indexOf(l)&&A===se)return Ee;if(-1!==_e.indexOf(A)&&-1!==_e.indexOf(l))return Ee;if(A===ie&&-1!==_e.indexOf(l))return Ee;if(-1!==_e.concat(oe).indexOf(A)&&l===ne&&-1===Ce.indexOf(e[s])||-1!==_e.concat(oe).indexOf(l)&&A===Z)return Ee;if(A===be&&l===be){for(var h=n[o],d=1;h>0&&t[--h]===be;)d++;if(d%2!==0)return Ee}return A===fe&&l===he?Ee:Se},Me=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=Re(e,t.lineBreak),r=n[0],i=n[1],o=n[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map(function(e){return-1!==[oe,le,Be].indexOf(e)?me:e}));var a="keep-all"===t.wordBreak?o.map(function(t,n){return t&&e[n]>=19968&&e[n]<=40959}):void 0;return[r,i,a]},He=function(){function e(e,t,n,r){this.codePoints=e,this.required=t===Fe,this.start=n,this.end=r}return e.prototype.slice=function(){return l.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),je=function(e,t){var n=u(e),r=Me(n,t),i=r[0],o=r[1],a=r[2],s=n.length,A=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var e=Ee;l<s&&(e=Oe(n,o,i,++l,a))===Ee;);if(e!==Ee||l===s){var t=new He(n,e,A,l);return A=l,{value:t,done:!1}}return{done:!0,value:null}}}},ze=1,Ke=2,We=4,Ve=8,Ge=10,qe=47,Xe=92,Ye=9,Je=32,Ze=34,$e=61,et=35,tt=36,nt=37,rt=39,it=40,ot=41,at=95,st=45,At=33,ut=60,lt=62,ct=64,ft=91,ht=93,dt=61,pt=123,gt=63,mt=125,vt=124,wt=126,yt=128,bt=65533,Bt=42,xt=43,Ct=44,Ft=58,Et=59,St=46,kt=0,_t=8,It=11,Nt=14,Ut=31,Lt=127,Qt=-1,Dt=48,Rt=97,Tt=101,Pt=102,Ot=117,Mt=122,Ht=65,jt=69,zt=70,Kt=85,Wt=90,Vt=function(e){return e>=Dt&&e<=57},Gt=function(e){return e>=55296&&e<=57343},qt=function(e){return Vt(e)||e>=Ht&&e<=zt||e>=Rt&&e<=Pt},Xt=function(e){return e>=Rt&&e<=Mt},Yt=function(e){return e>=Ht&&e<=Wt},Jt=function(e){return Xt(e)||Yt(e)},Zt=function(e){return e>=yt},$t=function(e){return e===Ge||e===Ye||e===Je},en=function(e){return Jt(e)||Zt(e)||e===at},tn=function(e){return en(e)||Vt(e)||e===st},nn=function(e){return e>=kt&&e<=_t||e===It||e>=Nt&&e<=Ut||e===Lt},rn=function(e,t){return e===Xe&&t!==Ge},on=function(e,t,n){return e===st?en(t)||rn(t,n):!!en(e)||!(e!==Xe||!rn(e,t))},an=function(e,t,n){return e===xt||e===st?!!Vt(t)||t===St&&Vt(n):Vt(e===St?t:e)},sn=function(e){var t=0,n=1;e[t]!==xt&&e[t]!==st||(e[t]===st&&(n=-1),t++);for(var r=[];Vt(e[t]);)r.push(e[t++]);var i=r.length?parseInt(l.apply(void 0,r),10):0;e[t]===St&&t++;for(var o=[];Vt(e[t]);)o.push(e[t++]);var a=o.length,s=a?parseInt(l.apply(void 0,o),10):0;e[t]!==jt&&e[t]!==Tt||t++;var A=1;e[t]!==xt&&e[t]!==st||(e[t]===st&&(A=-1),t++);for(var u=[];Vt(e[t]);)u.push(e[t++]);var c=u.length?parseInt(l.apply(void 0,u),10):0;return n*(i+s*Math.pow(10,-a))*Math.pow(10,A*c)},An={type:2},un={type:3},ln={type:4},cn={type:13},fn={type:8},hn={type:21},dn={type:9},pn={type:10},gn={type:11},mn={type:12},vn={type:14},wn={type:23},yn={type:1},bn={type:25},Bn={type:24},xn={type:26},Cn={type:27},Fn={type:28},En={type:29},Sn={type:31},kn={type:32},_n=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(u(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==kn;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case Ze:return this.consumeStringToken(Ze);case et:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(tn(t)||rn(n,r)){var i=on(t,n,r)?Ke:ze;return{type:5,value:this.consumeName(),flags:i}}break;case tt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),cn;break;case rt:return this.consumeStringToken(rt);case it:return An;case ot:return un;case Bt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),vn;break;case xt:if(an(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ct:return ln;case st:var o=e,a=this.peekCodePoint(0),s=this.peekCodePoint(1);if(an(o,a,s))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(on(o,a,s))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(a===st&&s===lt)return this.consumeCodePoint(),this.consumeCodePoint(),Bn;break;case St:if(an(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case qe:if(this.peekCodePoint(0)===Bt)for(this.consumeCodePoint();;){var A=this.consumeCodePoint();if(A===Bt&&(A=this.consumeCodePoint())===qe)return this.consumeToken();if(A===Qt)return this.consumeToken()}break;case Ft:return xn;case Et:return Cn;case ut:if(this.peekCodePoint(0)===At&&this.peekCodePoint(1)===st&&this.peekCodePoint(2)===st)return this.consumeCodePoint(),this.consumeCodePoint(),bn;break;case ct:var u=this.peekCodePoint(0),c=this.peekCodePoint(1),f=this.peekCodePoint(2);if(on(u,c,f))return{type:7,value:this.consumeName()};break;case ft:return Fn;case Xe:if(rn(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case ht:return En;case dt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),fn;break;case pt:return gn;case mt:return mn;case Ot:case Kt:var h=this.peekCodePoint(0),d=this.peekCodePoint(1);return h!==xt||!qt(d)&&d!==gt||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case vt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),dn;if(this.peekCodePoint(0)===vt)return this.consumeCodePoint(),hn;break;case wt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),pn;break;case Qt:return kn}return $t(e)?(this.consumeWhiteSpace(),Sn):Vt(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):en(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:l(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return"undefined"===typeof e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();qt(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;t===gt&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n)return{type:30,start:parseInt(l.apply(void 0,e.map(function(e){return e===gt?Dt:e})),16),end:parseInt(l.apply(void 0,e.map(function(e){return e===gt?zt:e})),16)};var r=parseInt(l.apply(void 0,e),16);if(this.peekCodePoint(0)===st&&qt(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var i=[];qt(t)&&i.length<6;)i.push(t),t=this.consumeCodePoint();return{type:30,start:r,end:parseInt(l.apply(void 0,i),16)}}return{type:30,start:r,end:r}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===it?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===it?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Qt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===rt||t===Ze){var n=this.consumeStringToken(this.consumeCodePoint());return 0===n.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Qt||this.peekCodePoint(0)===ot)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),wn)}for(;;){var r=this.consumeCodePoint();if(r===Qt||r===ot)return{type:22,value:l.apply(void 0,e)};if($t(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Qt||this.peekCodePoint(0)===ot?(this.consumeCodePoint(),{type:22,value:l.apply(void 0,e)}):(this.consumeBadUrlRemnants(),wn);if(r===Ze||r===rt||r===it||nn(r))return this.consumeBadUrlRemnants(),wn;if(r===Xe){if(!rn(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),wn;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;$t(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===ot||e===Qt)return;rn(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,n="";e>0;){var r=Math.min(t,e);n+=l.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),n},e.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var r=this._value[n];if(r===Qt||void 0===r||r===e)return{type:0,value:t+=this.consumeStringSlice(n)};if(r===Ge)return this._value.splice(0,n),yn;if(r===Xe){var i=this._value[n+1];i!==Qt&&void 0!==i&&(i===Ge?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):rn(r,i)&&(t+=this.consumeStringSlice(n),t+=l(this.consumeEscapedCodePoint()),n=-1))}n++}},e.prototype.consumeNumber=function(){var e=[],t=We,n=this.peekCodePoint(0);for(n!==xt&&n!==st||e.push(this.consumeCodePoint());Vt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(n===St&&Vt(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ve;Vt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((n===jt||n===Tt)&&((r===xt||r===st)&&Vt(i)||Vt(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ve;Vt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[sn(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),o=this.peekCodePoint(2);return on(r,i,o)?{type:15,number:t,flags:n,unit:this.consumeName()}:r===nt?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(qt(e)){for(var t=l(e);qt(this.peekCodePoint(0))&&t.length<6;)t+=l(this.consumeCodePoint());$t(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||Gt(n)||n>1114111?bt:n}return e===Qt?bt:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(tn(t))e+=l(t);else{if(!rn(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=l(this.consumeEscapedCodePoint())}}},e}(),In=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new _n;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(32===n.type||On(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(32===n.type||3===n.type)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return"undefined"===typeof e?kn:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Nn=function(e){return 15===e.type},Un=function(e){return 17===e.type},Ln=function(e){return 20===e.type},Qn=function(e){return 0===e.type},Dn=function(e,t){return Ln(e)&&e.value===t},Rn=function(e){return 31!==e.type},Tn=function(e){return 31!==e.type&&4!==e.type},Pn=function(e){var t=[],n=[];return e.forEach(function(e){if(4===e.type){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}31!==e.type&&n.push(e)}),n.length&&t.push(n),t},On=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},Mn=function(e){return 17===e.type||15===e.type},Hn=function(e){return 16===e.type||Mn(e)},jn=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},zn={type:17,number:0,flags:We},Kn={type:16,number:50,flags:We},Wn={type:16,number:100,flags:We},Vn=function(e,t,n){var r=e[0],i=e[1];return[Gn(r,t),Gn("undefined"!==typeof i?i:r,n)]},Gn=function(e,t){if(16===e.type)return e.number/100*t;if(Nn(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},qn="deg",Xn="grad",Yn="rad",Jn="turn",Zn={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case qn:return Math.PI*t.number/180;case Xn:return Math.PI/200*t.number;case Yn:return t.number;case Jn:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},$n=function(e){return 15===e.type&&(e.unit===qn||e.unit===Xn||e.unit===Yn||e.unit===Jn)},er=function(e){switch(e.filter(Ln).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[zn,zn];case"to top":case"bottom":return tr(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[zn,Wn];case"to right":case"left":return tr(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Wn,Wn];case"to bottom":case"top":return tr(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Wn,zn];case"to left":case"right":return tr(270)}return 0},tr=function(e){return Math.PI*e/180},nr={name:"color",parse:function(e,t){if(18===t.type){var n=lr[t.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return n(e,t.values)}if(5===t.type){if(3===t.value.length){var r=t.value.substring(0,1),i=t.value.substring(1,2),o=t.value.substring(2,3);return or(parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16),1)}if(4===t.value.length){r=t.value.substring(0,1),i=t.value.substring(1,2),o=t.value.substring(2,3);var a=t.value.substring(3,4);return or(parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16),parseInt(a+a,16)/255)}if(6===t.value.length)return r=t.value.substring(0,2),i=t.value.substring(2,4),o=t.value.substring(4,6),or(parseInt(r,16),parseInt(i,16),parseInt(o,16),1);if(8===t.value.length)return r=t.value.substring(0,2),i=t.value.substring(2,4),o=t.value.substring(4,6),a=t.value.substring(6,8),or(parseInt(r,16),parseInt(i,16),parseInt(o,16),parseInt(a,16)/255)}if(20===t.type){var s=fr[t.value.toUpperCase()];if("undefined"!==typeof s)return s}return fr.TRANSPARENT}},rr=function(e){return 0===(255&e)},ir=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},or=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(255*r))>>>0},ar=function(e,t){if(17===e.type)return e.number;if(16===e.type){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},sr=function(e,t){var n=t.filter(Tn);if(3===n.length){var r=n.map(ar),i=r[0],o=r[1],a=r[2];return or(i,o,a,1)}if(4===n.length){var s=n.map(ar),A=(i=s[0],o=s[1],a=s[2],s[3]);return or(i,o,a,A)}return 0};function Ar(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var ur=function(e,t){var n=t.filter(Tn),r=n[0],i=n[1],o=n[2],a=n[3],s=(17===r.type?tr(r.number):Zn.parse(e,r))/(2*Math.PI),A=Hn(i)?i.number/100:0,u=Hn(o)?o.number/100:0,l="undefined"!==typeof a&&Hn(a)?Gn(a,1):1;if(0===A)return or(255*u,255*u,255*u,1);var c=u<=.5?u*(A+1):u+A-u*A,f=2*u-c,h=Ar(f,c,s+1/3),d=Ar(f,c,s),p=Ar(f,c,s-1/3);return or(255*h,255*d,255*p,l)},lr={hsl:ur,hsla:ur,rgb:sr,rgba:sr},cr=function(e,t){return nr.parse(e,In.create(t).parseComponentValue())},fr={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},hr={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ln(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},dr={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pr=function(e,t){var n=nr.parse(e,t[0]),r=t[1];return r&&Hn(r)?{color:n,stop:r}:{color:n,stop:null}},gr=function(e,t){var n=e[0],r=e[e.length-1];null===n.stop&&(n.stop=zn),null===r.stop&&(r.stop=Wn);for(var i=[],o=0,a=0;a<e.length;a++){var s=e[a].stop;if(null!==s){var A=Gn(s,t);A>o?i.push(A):i.push(o),o=A}else i.push(null)}var u=null;for(a=0;a<i.length;a++){var l=i[a];if(null===l)null===u&&(u=a);else if(null!==u){for(var c=a-u,f=(l-i[u-1])/(c+1),h=1;h<=c;h++)i[u+h-1]=f*h;u=null}}return e.map(function(e,n){return{color:e.color,stop:Math.max(Math.min(1,i[n]/t),0)}})},mr=function(e,t,n){var r=t/2,i=n/2,o=Gn(e[0],t)-r,a=i-Gn(e[1],n);return(Math.atan2(a,o)+2*Math.PI)%(2*Math.PI)},vr=function(e,t,n){var r="number"===typeof e?e:mr(e,t,n),i=Math.abs(t*Math.sin(r))+Math.abs(n*Math.cos(r)),o=t/2,a=n/2,s=i/2,A=Math.sin(r-Math.PI/2)*s,u=Math.cos(r-Math.PI/2)*s;return[i,o-u,o+u,a-A,a+A]},wr=function(e,t){return Math.sqrt(e*e+t*t)},yr=function(e,t,n,r,i){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var o=t[0],a=t[1],s=wr(n-o,r-a);return(i?s<e.optimumDistance:s>e.optimumDistance)?{optimumCorner:t,optimumDistance:s}:e},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},br=function(e,t,n,r,i){var o=0,a=0;switch(e.size){case 0:0===e.shape?o=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):1===e.shape&&(o=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(0===e.shape)o=a=Math.min(wr(t,n),wr(t,n-i),wr(t-r,n),wr(t-r,n-i));else if(1===e.shape){var s=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),A=yr(r,i,t,n,!0),u=A[0],l=A[1];a=s*(o=wr(u-t,(l-n)/s))}break;case 1:0===e.shape?o=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):1===e.shape&&(o=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(0===e.shape)o=a=Math.max(wr(t,n),wr(t,n-i),wr(t-r,n),wr(t-r,n-i));else if(1===e.shape){s=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r));var c=yr(r,i,t,n,!1);u=c[0],l=c[1],a=s*(o=wr(u-t,(l-n)/s))}}return Array.isArray(e.size)&&(o=Gn(e.size[0],r),a=2===e.size.length?Gn(e.size[1],i):o),[o,a]},Br=function(e,t){var n=tr(180),r=[];return Pn(t).forEach(function(t,i){if(0===i){var o=t[0];if(20===o.type&&-1!==["top","left","right","bottom"].indexOf(o.value))return void(n=er(t));if($n(o))return void(n=(Zn.parse(e,o)+tr(270))%tr(360))}var a=pr(e,t);r.push(a)}),{angle:n,stops:r,type:1}},xr="closest-side",Cr="farthest-side",Fr="closest-corner",Er="farthest-corner",Sr="circle",kr="ellipse",_r="cover",Ir="contain",Nr=function(e,t){var n=0,r=3,i=[],o=[];return Pn(t).forEach(function(t,a){var s=!0;if(0===a?s=t.reduce(function(e,t){if(Ln(t))switch(t.value){case"center":return o.push(Kn),!1;case"top":case"left":return o.push(zn),!1;case"right":case"bottom":return o.push(Wn),!1}else if(Hn(t)||Mn(t))return o.push(t),!1;return e},s):1===a&&(s=t.reduce(function(e,t){if(Ln(t))switch(t.value){case Sr:return n=0,!1;case kr:return n=1,!1;case Ir:case xr:return r=0,!1;case Cr:return r=1,!1;case Fr:return r=2,!1;case _r:case Er:return r=3,!1}else if(Mn(t)||Hn(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)),s){var A=pr(e,t);i.push(A)}}),{size:r,shape:n,stops:i,position:o,type:2}},Ur=function(e){return 1===e.type},Lr=function(e){return 2===e.type},Qr={name:"image",parse:function(e,t){if(22===t.type){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(18===t.type){var r=Tr[t.name];if("undefined"===typeof r)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Dr(e){return!(20===e.type&&"none"===e.value)&&(18!==e.type||!!Tr[e.name])}var Rr,Tr={"linear-gradient":function(e,t){var n=tr(180),r=[];return Pn(t).forEach(function(t,i){if(0===i){var o=t[0];if(20===o.type&&"to"===o.value)return void(n=er(t));if($n(o))return void(n=Zn.parse(e,o))}var a=pr(e,t);r.push(a)}),{angle:n,stops:r,type:1}},"-moz-linear-gradient":Br,"-ms-linear-gradient":Br,"-o-linear-gradient":Br,"-webkit-linear-gradient":Br,"radial-gradient":function(e,t){var n=0,r=3,i=[],o=[];return Pn(t).forEach(function(t,a){var s=!0;if(0===a){var A=!1;s=t.reduce(function(e,t){if(A)if(Ln(t))switch(t.value){case"center":return o.push(Kn),e;case"top":case"left":return o.push(zn),e;case"right":case"bottom":return o.push(Wn),e}else(Hn(t)||Mn(t))&&o.push(t);else if(Ln(t))switch(t.value){case Sr:return n=0,!1;case kr:return n=1,!1;case"at":return A=!0,!1;case xr:return r=0,!1;case _r:case Cr:return r=1,!1;case Ir:case Fr:return r=2,!1;case Er:return r=3,!1}else if(Mn(t)||Hn(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)}if(s){var u=pr(e,t);i.push(u)}}),{size:r,shape:n,stops:i,position:o,type:2}},"-moz-radial-gradient":Nr,"-ms-radial-gradient":Nr,"-o-radial-gradient":Nr,"-webkit-radial-gradient":Nr,"-webkit-gradient":function(e,t){var n=tr(180),r=[],i=1,o=0,a=3,s=[];return Pn(t).forEach(function(t,n){var o=t[0];if(0===n){if(Ln(o)&&"linear"===o.value)return void(i=1);if(Ln(o)&&"radial"===o.value)return void(i=2)}if(18===o.type)if("from"===o.name){var a=nr.parse(e,o.values[0]);r.push({stop:zn,color:a})}else if("to"===o.name)a=nr.parse(e,o.values[0]),r.push({stop:Wn,color:a});else if("color-stop"===o.name){var s=o.values.filter(Tn);if(2===s.length){a=nr.parse(e,s[1]);var A=s[0];Un(A)&&r.push({stop:{type:16,number:100*A.number,flags:A.flags},color:a})}}}),1===i?{angle:(n+tr(180))%tr(360),stops:r,type:i}:{size:a,shape:o,stops:r,position:s,type:i}}},Pr={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var n=t[0];return 20===n.type&&"none"===n.value?[]:t.filter(function(e){return Tn(e)&&Dr(e)}).map(function(t){return Qr.parse(e,t)})}},Or={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ln(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Mr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Pn(t).map(function(e){return e.filter(Hn)}).map(jn)}},Hr={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Pn(t).map(function(e){return e.filter(Ln).map(function(e){return e.value}).join(" ")}).map(jr)}},jr=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Rr||(Rr={}));var zr,Kr={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Pn(t).map(function(e){return e.filter(Wr)})}},Wr=function(e){return Ln(e)||Hn(e)},Vr=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Gr=Vr("top"),qr=Vr("right"),Xr=Vr("bottom"),Yr=Vr("left"),Jr=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return jn(t.filter(Hn))}}},Zr=Jr("top-left"),$r=Jr("top-right"),ei=Jr("bottom-right"),ti=Jr("bottom-left"),ni=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ri=ni("top"),ii=ni("right"),oi=ni("bottom"),ai=ni("left"),si=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Nn(t)?t.number:0}}},Ai=si("top"),ui=si("right"),li=si("bottom"),ci=si("left"),fi={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},hi={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},di={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Ln).reduce(function(e,t){return e|pi(t.value)},0)}},pi=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},gi={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},mi={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(zr||(zr={}));var vi,wi={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?zr.STRICT:zr.NORMAL}},yi={name:"line-height",initialValue:"normal",prefix:!1,type:4},bi=function(e,t){return Ln(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Hn(e)?Gn(e,t):t},Bi={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Qr.parse(e,t)}},xi={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Ci={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Fi=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Ei=Fi("top"),Si=Fi("right"),ki=Fi("bottom"),_i=Fi("left"),Ii={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Ln).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Ni={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Ui=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Li=Ui("top"),Qi=Ui("right"),Di=Ui("bottom"),Ri=Ui("left"),Ti={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Pi={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Oi={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Dn(t[0],"none")?[]:Pn(t).map(function(t){for(var n={color:fr.TRANSPARENT,offsetX:zn,offsetY:zn,blur:zn},r=0,i=0;i<t.length;i++){var o=t[i];Mn(o)?(0===r?n.offsetX=o:1===r?n.offsetY=o:n.blur=o,r++):n.color=nr.parse(e,o)}return n})}},Mi={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Hi={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var n=ji[t.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return n(t.values)}return null}},ji={matrix:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},matrix3d:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),n=t[0],r=t[1];t[2],t[3];var i=t[4],o=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var a=t[12],s=t[13];return t[14],t[15],16===t.length?[n,r,i,o,a,s]:null}},zi={type:16,number:50,flags:We},Ki=[zi,zi],Wi={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var n=t.filter(Hn);return 2!==n.length?Ki:[n[0],n[1]]}},Vi={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(vi||(vi={}));for(var Gi={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return vi.BREAK_ALL;case"keep-all":return vi.KEEP_ALL;default:return vi.NORMAL}}},qi={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(Un(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},Xi={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},Yi={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Un(t)?t.number:1}},Ji={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Zi={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(Ln).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},$i={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var n=[],r=[];return t.forEach(function(e){switch(e.type){case 20:case 0:n.push(e.value);break;case 17:n.push(e.number.toString());break;case 4:r.push(n.join(" ")),n.length=0}}),n.length&&r.push(n.join(" ")),r.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},eo={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},to={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return Un(t)?t.number:Ln(t)&&"bold"===t.value?700:400}},no={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(Ln).map(function(e){return e.value})}},ro={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},io=function(e,t){return 0!==(e&t)},oo={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var n=t[0];return 20===n.type&&"none"===n.value?[]:t}},ao={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var n=t[0];if(20===n.type&&"none"===n.value)return null;for(var r=[],i=t.filter(Rn),o=0;o<i.length;o++){var a=i[o],s=i[o+1];if(20===a.type){var A=s&&Un(s)?s.number:1;r.push({counter:a.value,increment:A})}}return r}},so={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var n=[],r=t.filter(Rn),i=0;i<r.length;i++){var o=r[i],a=r[i+1];if(Ln(o)&&"none"!==o.value){var s=a&&Un(a)?a.number:0;n.push({counter:o.value,reset:s})}}return n}},Ao={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(Nn).map(function(t){return Xi.parse(e,t)})}},uo={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var n=t[0];if(20===n.type&&"none"===n.value)return null;var r=[],i=t.filter(Qn);if(i.length%2!==0)return null;for(var o=0;o<i.length;o+=2){var a=i[o].value,s=i[o+1].value;r.push({open:a,close:s})}return r}},lo=function(e,t,n){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?n?r.open:r.close:""},co={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Dn(t[0],"none")?[]:Pn(t).map(function(t){for(var n={color:255,offsetX:zn,offsetY:zn,blur:zn,spread:zn,inset:!1},r=0,i=0;i<t.length;i++){var o=t[i];Dn(o,"inset")?n.inset=!0:Mn(o)?(0===r?n.offsetX=o:1===r?n.offsetY=o:2===r?n.blur=o:n.spread=o,r++):n.color=nr.parse(e,o)}return n})}},fo={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var n=[0,1,2],r=[];return t.filter(Ln).forEach(function(e){switch(e.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2)}}),n.forEach(function(e){-1===r.indexOf(e)&&r.push(e)}),r}},ho={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},po={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Nn(t)?t.number:0}},go=function(){function e(e,t){var n,r;this.animationDuration=wo(e,Ao,t.animationDuration),this.backgroundClip=wo(e,hr,t.backgroundClip),this.backgroundColor=wo(e,dr,t.backgroundColor),this.backgroundImage=wo(e,Pr,t.backgroundImage),this.backgroundOrigin=wo(e,Or,t.backgroundOrigin),this.backgroundPosition=wo(e,Mr,t.backgroundPosition),this.backgroundRepeat=wo(e,Hr,t.backgroundRepeat),this.backgroundSize=wo(e,Kr,t.backgroundSize),this.borderTopColor=wo(e,Gr,t.borderTopColor),this.borderRightColor=wo(e,qr,t.borderRightColor),this.borderBottomColor=wo(e,Xr,t.borderBottomColor),this.borderLeftColor=wo(e,Yr,t.borderLeftColor),this.borderTopLeftRadius=wo(e,Zr,t.borderTopLeftRadius),this.borderTopRightRadius=wo(e,$r,t.borderTopRightRadius),this.borderBottomRightRadius=wo(e,ei,t.borderBottomRightRadius),this.borderBottomLeftRadius=wo(e,ti,t.borderBottomLeftRadius),this.borderTopStyle=wo(e,ri,t.borderTopStyle),this.borderRightStyle=wo(e,ii,t.borderRightStyle),this.borderBottomStyle=wo(e,oi,t.borderBottomStyle),this.borderLeftStyle=wo(e,ai,t.borderLeftStyle),this.borderTopWidth=wo(e,Ai,t.borderTopWidth),this.borderRightWidth=wo(e,ui,t.borderRightWidth),this.borderBottomWidth=wo(e,li,t.borderBottomWidth),this.borderLeftWidth=wo(e,ci,t.borderLeftWidth),this.boxShadow=wo(e,co,t.boxShadow),this.color=wo(e,fi,t.color),this.direction=wo(e,hi,t.direction),this.display=wo(e,di,t.display),this.float=wo(e,gi,t.cssFloat),this.fontFamily=wo(e,$i,t.fontFamily),this.fontSize=wo(e,eo,t.fontSize),this.fontStyle=wo(e,ro,t.fontStyle),this.fontVariant=wo(e,no,t.fontVariant),this.fontWeight=wo(e,to,t.fontWeight),this.letterSpacing=wo(e,mi,t.letterSpacing),this.lineBreak=wo(e,wi,t.lineBreak),this.lineHeight=wo(e,yi,t.lineHeight),this.listStyleImage=wo(e,Bi,t.listStyleImage),this.listStylePosition=wo(e,xi,t.listStylePosition),this.listStyleType=wo(e,Ci,t.listStyleType),this.marginTop=wo(e,Ei,t.marginTop),this.marginRight=wo(e,Si,t.marginRight),this.marginBottom=wo(e,ki,t.marginBottom),this.marginLeft=wo(e,_i,t.marginLeft),this.opacity=wo(e,Yi,t.opacity);var i=wo(e,Ii,t.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=wo(e,Ni,t.overflowWrap),this.paddingTop=wo(e,Li,t.paddingTop),this.paddingRight=wo(e,Qi,t.paddingRight),this.paddingBottom=wo(e,Di,t.paddingBottom),this.paddingLeft=wo(e,Ri,t.paddingLeft),this.paintOrder=wo(e,fo,t.paintOrder),this.position=wo(e,Pi,t.position),this.textAlign=wo(e,Ti,t.textAlign),this.textDecorationColor=wo(e,Ji,null!==(n=t.textDecorationColor)&&void 0!==n?n:t.color),this.textDecorationLine=wo(e,Zi,null!==(r=t.textDecorationLine)&&void 0!==r?r:t.textDecoration),this.textShadow=wo(e,Oi,t.textShadow),this.textTransform=wo(e,Mi,t.textTransform),this.transform=wo(e,Hi,t.transform),this.transformOrigin=wo(e,Wi,t.transformOrigin),this.visibility=wo(e,Vi,t.visibility),this.webkitTextStrokeColor=wo(e,ho,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=wo(e,po,t.webkitTextStrokeWidth),this.wordBreak=wo(e,Gi,t.wordBreak),this.zIndex=wo(e,qi,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return rr(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return io(this.display,4)||io(this.display,33554432)||io(this.display,268435456)||io(this.display,536870912)||io(this.display,67108864)||io(this.display,134217728)},e}(),mo=function(){function e(e,t){this.content=wo(e,oo,t.content),this.quotes=wo(e,uo,t.quotes)}return e}(),vo=function(){function e(e,t){this.counterIncrement=wo(e,ao,t.counterIncrement),this.counterReset=wo(e,so,t.counterReset)}return e}(),wo=function(e,t,n){var r=new _n,i=null!==n&&"undefined"!==typeof n?n.toString():t.initialValue;r.write(i);var o=new In(r.read());switch(t.type){case 2:var a=o.parseComponentValue();return t.parse(e,Ln(a)?a.value:t.initialValue);case 0:return t.parse(e,o.parseComponentValue());case 1:return t.parse(e,o.parseComponentValues());case 4:return o.parseComponentValue();case 3:switch(t.format){case"angle":return Zn.parse(e,o.parseComponentValue());case"color":return nr.parse(e,o.parseComponentValue());case"image":return Qr.parse(e,o.parseComponentValue());case"length":var s=o.parseComponentValue();return Mn(s)?s:zn;case"length-percentage":var A=o.parseComponentValue();return Hn(A)?A:zn;case"time":return Xi.parse(e,o.parseComponentValue())}}},yo="data-html2canvas-debug",bo=function(e){switch(e.getAttribute(yo)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Bo=function(e,t){var n=bo(e);return 1===n||t===n},xo=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Bo(t,3),this.styles=new go(e,window.getComputedStyle(t,null)),ls(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=s(this.context,t),Bo(t,4)&&(this.flags|=16)}return e}(),Co="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Eo="undefined"===typeof Uint8Array?[]:new Uint8Array(256),So=0;So<Fo.length;So++)Eo[Fo.charCodeAt(So)]=So;for(var ko=function(e){var t,n,r,i,o,a=.75*e.length,s=e.length,A=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint8Array.prototype.slice?new ArrayBuffer(a):new Array(a),l=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<s;t+=4)n=Eo[e.charCodeAt(t)],r=Eo[e.charCodeAt(t+1)],i=Eo[e.charCodeAt(t+2)],o=Eo[e.charCodeAt(t+3)],l[A++]=n<<2|r>>4,l[A++]=(15&r)<<4|i>>2,l[A++]=(3&i)<<6|63&o;return u},_o=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},Io=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},No=5,Uo=11,Lo=2,Qo=65536>>No,Do=(1<<No)-1,Ro=Qo+(1024>>No)+32,To=65536>>Uo,Po=(1<<Uo-No)-1,Oo=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},Mo=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},Ho=function(e,t){var n=ko(e),r=Array.isArray(n)?Io(n):new Uint32Array(n),i=Array.isArray(n)?_o(n):new Uint16Array(n),o=24,a=Oo(i,o/2,r[4]/2),s=2===r[5]?Oo(i,(o+r[4])/2):Mo(r,Math.ceil((o+r[4])/4));return new jo(r[0],r[1],r[2],r[3],a,s)},jo=function(){function e(e,t,n,r,i,o){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=o}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>No])<<Lo)+(e&Do),this.data[t];if(e<=65535)return t=((t=this.index[Qo+(e-55296>>No)])<<Lo)+(e&Do),this.data[t];if(e<this.highStart)return t=Ro-To+(e>>Uo),t=this.index[t],t+=e>>No&Po,t=((t=this.index[t])<<Lo)+(e&Do),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),zo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ko="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Wo=0;Wo<zo.length;Wo++)Ko[zo.charCodeAt(Wo)]=Wo;var Vo,Go=1,qo=2,Xo=3,Yo=4,Jo=5,Zo=7,$o=8,ea=9,ta=10,na=11,ra=12,ia=13,oa=14,aa=15,sa=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320===(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t},Aa=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,o="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push(55296+(a>>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},ua=Ho(Co),la="\xd7",ca="\xf7",fa=function(e){return ua.get(e)},ha=function(e,t,n){var r=n-2,i=t[r],o=t[n-1],a=t[n];if(o===qo&&a===Xo)return la;if(o===qo||o===Xo||o===Yo)return ca;if(a===qo||a===Xo||a===Yo)return ca;if(o===$o&&-1!==[$o,ea,na,ra].indexOf(a))return la;if((o===na||o===ea)&&(a===ea||a===ta))return la;if((o===ra||o===ta)&&a===ta)return la;if(a===ia||a===Jo)return la;if(a===Zo)return la;if(o===Go)return la;if(o===ia&&a===oa){for(;i===Jo;)i=t[--r];if(i===oa)return la}if(o===aa&&a===aa){for(var s=0;i===aa;)s++,i=t[--r];if(s%2===0)return la}return ca},da=function(e){var t=sa(e),n=t.length,r=0,i=0,o=t.map(fa);return{next:function(){if(r>=n)return{done:!0,value:null};for(var e=la;r<n&&(e=ha(t,o,++r))===la;);if(e!==la||r===n){var a=Aa.apply(null,t.slice(i,r));return i=r,{value:a,done:!1}}return{done:!0,value:null}}}},pa=function(e){for(var t,n=da(e),r=[];!(t=n.next()).done;)t.value&&r.push(t.value.slice());return r},ga=function(e){var t=123;if(e.createRange){var n=e.createRange();if(n.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=t+"px",r.style.display="block",e.body.appendChild(r),n.selectNode(r);var i=n.getBoundingClientRect(),o=Math.round(i.height);if(e.body.removeChild(r),o===t)return!0}}return!1},ma=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var n=e.createRange();t.innerHTML="function"===typeof"".repeat?"👨".repeat(10):"";var r=t.firstChild,i=u(r.data).map(function(e){return l(e)}),o=0,a={},s=i.every(function(e,t){n.setStart(r,o),n.setEnd(r,o+e.length);var i=n.getBoundingClientRect();o+=e.length;var s=i.x>a.x||i.y>a.y;return a=i,0===t||s});return e.body.removeChild(t),s},va=function(){return"undefined"!==typeof(new Image).crossOrigin},wa=function(){return"string"===typeof(new XMLHttpRequest).responseType},ya=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),n.toDataURL()}catch(Tt){return!1}return!0},ba=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Ba=function(e){var t=e.createElement("canvas"),n=100;t.width=n,t.height=n;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,o=t.toDataURL();i.src=o;var a=xa(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),Ca(a).then(function(t){r.drawImage(t,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var a=e.createElement("div");return a.style.backgroundImage="url("+o+")",a.style.height=n+"px",ba(i)?Ca(xa(n,n,0,0,a)):Promise.reject(!1)}).then(function(e){return r.drawImage(e,0,0),ba(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},xa=function(e,t,n,r,i){var o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),s=document.createElementNS(o,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.setAttributeNS(null,"x",n.toString()),s.setAttributeNS(null,"y",r.toString()),s.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(s),s.appendChild(i),a},Ca=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},Fa={get SUPPORT_RANGE_BOUNDS(){var e=ga(document);return Object.defineProperty(Fa,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Fa.SUPPORT_RANGE_BOUNDS&&ma(document);return Object.defineProperty(Fa,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=ya(document);return Object.defineProperty(Fa,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"===typeof Array.from&&"function"===typeof window.fetch?Ba(document):Promise.resolve(!1);return Object.defineProperty(Fa,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=va();return Object.defineProperty(Fa,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=wa();return Object.defineProperty(Fa,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Fa,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"===typeof Intl||!Intl.Segmenter);return Object.defineProperty(Fa,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Ea=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),Sa=function(e,t,n,r){var i=Ua(t,n),o=[],s=0;return i.forEach(function(t){if(n.textDecorationLine.length||t.trim().length>0)if(Fa.SUPPORT_RANGE_BOUNDS){var i=_a(r,s,t.length).getClientRects();if(i.length>1){var A=Ia(t),u=0;A.forEach(function(t){o.push(new Ea(t,a.fromDOMRectList(e,_a(r,u+s,t.length).getClientRects()))),u+=t.length})}else o.push(new Ea(t,a.fromDOMRectList(e,i)))}else{var l=r.splitText(t.length);o.push(new Ea(t,ka(e,r))),r=l}else Fa.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));s+=t.length}),o},ka=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var o=s(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),o}}return a.EMPTY},_a=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},Ia=function(e){if(Fa.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return pa(e)},Na=function(e,t){if(Fa.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(e)).map(function(e){return e.segment})}return Qa(e,t)},Ua=function(e,t){return 0!==t.letterSpacing?Ia(e):Na(e,t)},La=[32,160,4961,65792,65793,4153,4241],Qa=function(e,t){for(var n,r=je(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),i=[],o=function(){if(n.value){var e=n.value.slice(),t=u(e),r="";t.forEach(function(e){-1===La.indexOf(e)?r+=l(e):(r.length&&i.push(r),i.push(l(e)),r="")}),r.length&&i.push(r)}};!(n=r.next()).done;)o();return i},Da=function(){function e(e,t,n){this.text=Ra(t.data,n.textTransform),this.textBounds=Sa(e,this.text,n,t)}return e}(),Ra=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(Ta,Pa);case 2:return e.toUpperCase();default:return e}},Ta=/(^|\s|:|-|\(|\))([a-z])/g,Pa=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Oa=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return t(n,e),n}(xo),Ma=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return t(n,e),n}(xo),Ha=function(e){function n(t,n){var r=e.call(this,t,n)||this,i=new XMLSerializer,o=s(t,n);return n.setAttribute("width",o.width+"px"),n.setAttribute("height",o.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t(n,e),n}(xo),ja=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.value=n.value,r}return t(n,e),n}(xo),za=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.start=n.start,r.reversed="boolean"===typeof n.reversed&&!0===n.reversed,r}return t(n,e),n}(xo),Ka=[{type:15,flags:0,unit:"px",number:3}],Wa=[{type:16,flags:0,number:50}],Va=function(e){return e.width>e.height?new a(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new a(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},Ga=function(e){var t=e.type===Ya?new Array(e.value.length+1).join("\u2022"):e.value;return 0===t.length?e.placeholder||"":t},qa="checkbox",Xa="radio",Ya="password",Ja=707406591,Za=function(e){function n(t,n){var r=e.call(this,t,n)||this;switch(r.type=n.type.toLowerCase(),r.checked=n.checked,r.value=Ga(n),r.type!==qa&&r.type!==Xa||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=Va(r.bounds)),r.type){case qa:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Ka;break;case Xa:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Wa}return r}return t(n,e),n}(xo),$a=function(e){function n(t,n){var r=e.call(this,t,n)||this,i=n.options[n.selectedIndex||0];return r.value=i&&i.text||"",r}return t(n,e),n}(xo),es=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.value=n.value,r}return t(n,e),n}(xo),ts=function(e){function n(t,n){var r=e.call(this,t,n)||this;r.src=n.src,r.width=parseInt(n.width,10)||0,r.height=parseInt(n.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){r.tree=os(t,n.contentWindow.document.documentElement);var i=n.contentWindow.document.documentElement?cr(t,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):fr.TRANSPARENT,o=n.contentWindow.document.body?cr(t,getComputedStyle(n.contentWindow.document.body).backgroundColor):fr.TRANSPARENT;r.backgroundColor=rr(i)?rr(o)?r.styles.backgroundColor:o:i}}catch(Tt){}return r}return t(n,e),n}(xo),ns=["OL","UL","MENU"],rs=function(e,t,n,r){for(var i=t.firstChild,o=void 0;i;i=o)if(o=i.nextSibling,As(i)&&i.data.trim().length>0)n.textNodes.push(new Da(e,i,n.styles));else if(us(i))if(Es(i)&&i.assignedNodes)i.assignedNodes().forEach(function(t){return rs(e,t,n,r)});else{var a=is(e,i);a.styles.isVisible()&&(as(i,a,r)?a.flags|=4:ss(a.styles)&&(a.flags|=2),-1!==ns.indexOf(i.tagName)&&(a.flags|=8),n.elements.push(a),i.slot,i.shadowRoot?rs(e,i.shadowRoot,a,r):Cs(i)||gs(i)||Fs(i)||rs(e,i,a,r))}},is=function(e,t){return ys(t)?new Oa(e,t):vs(t)?new Ma(e,t):gs(t)?new Ha(e,t):fs(t)?new ja(e,t):hs(t)?new za(e,t):ds(t)?new Za(e,t):Fs(t)?new $a(e,t):Cs(t)?new es(e,t):bs(t)?new ts(e,t):new xo(e,t)},os=function(e,t){var n=is(e,t);return n.flags|=4,rs(e,t,n,n),n},as=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ms(e)&&n.styles.isTransparent()},ss=function(e){return e.isPositioned()||e.isFloating()},As=function(e){return e.nodeType===Node.TEXT_NODE},us=function(e){return e.nodeType===Node.ELEMENT_NODE},ls=function(e){return us(e)&&"undefined"!==typeof e.style&&!cs(e)},cs=function(e){return"object"===typeof e.className},fs=function(e){return"LI"===e.tagName},hs=function(e){return"OL"===e.tagName},ds=function(e){return"INPUT"===e.tagName},ps=function(e){return"HTML"===e.tagName},gs=function(e){return"svg"===e.tagName},ms=function(e){return"BODY"===e.tagName},vs=function(e){return"CANVAS"===e.tagName},ws=function(e){return"VIDEO"===e.tagName},ys=function(e){return"IMG"===e.tagName},bs=function(e){return"IFRAME"===e.tagName},Bs=function(e){return"STYLE"===e.tagName},xs=function(e){return"SCRIPT"===e.tagName},Cs=function(e){return"TEXTAREA"===e.tagName},Fs=function(e){return"SELECT"===e.tagName},Es=function(e){return"SLOT"===e.tagName},Ss=function(e){return e.tagName.indexOf("-")>0},ks=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;null!==n&&n.forEach(function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=e.increment)});var o=[];return i&&r.forEach(function(e){var n=t.counters[e.counter];o.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)}),o},e}(),_s={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Is={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054f","\u054e","\u054d","\u054c","\u054b","\u054a","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053f","\u053e","\u053d","\u053c","\u053b","\u053a","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},Ns={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05d9\u05f3","\u05d8\u05f3","\u05d7\u05f3","\u05d6\u05f3","\u05d5\u05f3","\u05d4\u05f3","\u05d3\u05f3","\u05d2\u05f3","\u05d1\u05f3","\u05d0\u05f3","\u05ea","\u05e9","\u05e8","\u05e7","\u05e6","\u05e4","\u05e2","\u05e1","\u05e0","\u05de","\u05dc","\u05db","\u05d9\u05d8","\u05d9\u05d7","\u05d9\u05d6","\u05d8\u05d6","\u05d8\u05d5","\u05d9","\u05d8","\u05d7","\u05d6","\u05d5","\u05d4","\u05d3","\u05d2","\u05d1","\u05d0"]},Us={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10f5","\u10f0","\u10ef","\u10f4","\u10ee","\u10ed","\u10ec","\u10eb","\u10ea","\u10e9","\u10e8","\u10e7","\u10e6","\u10e5","\u10e4","\u10f3","\u10e2","\u10e1","\u10e0","\u10df","\u10de","\u10dd","\u10f2","\u10dc","\u10db","\u10da","\u10d9","\u10d8","\u10d7","\u10f1","\u10d6","\u10d5","\u10d4","\u10d3","\u10d2","\u10d1","\u10d0"]},Ls=function(e,t,n,r,i,o){return e<t||e>n?Vs(e,i,o.length>0):r.integers.reduce(function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t},"")+o},Qs=function(e,t,n,r){var i="";do{n||e--,i=r(e)+i,e/=t}while(e*t>=t);return i},Ds=function(e,t,n,r,i){var o=n-t+1;return(e<0?"-":"")+(Qs(Math.abs(e),o,r,function(e){return l(Math.floor(e%o)+t)})+i)},Rs=function(e,t,n){void 0===n&&(n=". ");var r=t.length;return Qs(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+n},Ts=1,Ps=2,Os=4,Ms=8,Hs=function(e,t,n,r,i,o){if(e<-9999||e>9999)return Vs(e,4,i.length>0);var a=Math.abs(e),s=i;if(0===a)return t[0]+s;for(var A=0;a>0&&A<=4;A++){var u=a%10;0===u&&io(o,Ts)&&""!==s?s=t[u]+s:u>1||1===u&&0===A||1===u&&1===A&&io(o,Ps)||1===u&&1===A&&io(o,Os)&&e>100||1===u&&A>1&&io(o,Ms)?s=t[u]+(A>0?n[A-1]:"")+s:1===u&&A>0&&(s=n[A-1]+s),a=Math.floor(a/10)}return(e<0?r:"")+s},js="\u5341\u767e\u5343\u842c",zs="\u62fe\u4f70\u4edf\u842c",Ks="\u30de\u30a4\u30ca\u30b9",Ws="\ub9c8\uc774\ub108\uc2a4",Vs=function(e,t,n){var r=n?". ":"",i=n?"\u3001":"",o=n?", ":"",a=n?" ":"";switch(t){case 0:return"\u2022"+a;case 1:return"\u25e6"+a;case 2:return"\u25fe"+a;case 5:var s=Ds(e,48,57,!0,r);return s.length<4?"0"+s:s;case 4:return Rs(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",i);case 6:return Ls(e,1,3999,_s,3,r).toLowerCase();case 7:return Ls(e,1,3999,_s,3,r);case 8:return Ds(e,945,969,!1,r);case 9:return Ds(e,97,122,!1,r);case 10:return Ds(e,65,90,!1,r);case 11:return Ds(e,1632,1641,!0,r);case 12:case 49:return Ls(e,1,9999,Is,3,r);case 35:return Ls(e,1,9999,Is,3,r).toLowerCase();case 13:return Ds(e,2534,2543,!0,r);case 14:case 30:return Ds(e,6112,6121,!0,r);case 15:return Rs(e,"\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5",i);case 16:return Rs(e,"\u7532\u4e59\u4e19\u4e01\u620a\u5df1\u5e9a\u8f9b\u58ec\u7678",i);case 17:case 48:return Hs(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",js,"\u8ca0",i,Ps|Os|Ms);case 47:return Hs(e,"\u96f6\u58f9\u8cb3\u53c3\u8086\u4f0d\u9678\u67d2\u634c\u7396",zs,"\u8ca0",i,Ts|Ps|Os|Ms);case 42:return Hs(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",js,"\u8d1f",i,Ps|Os|Ms);case 41:return Hs(e,"\u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396",zs,"\u8d1f",i,Ts|Ps|Os|Ms);case 26:return Hs(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u4e07",Ks,i,0);case 25:return Hs(e,"\u96f6\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343\u4e07",Ks,i,Ts|Ps|Os);case 31:return Hs(e,"\uc601\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c","\uc2ed\ubc31\ucc9c\ub9cc",Ws,o,Ts|Ps|Os);case 33:return Hs(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c",Ws,o,0);case 32:return Hs(e,"\u96f6\u58f9\u8cb3\u53c3\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343",Ws,o,Ts|Ps|Os);case 18:return Ds(e,2406,2415,!0,r);case 20:return Ls(e,1,19999,Us,3,r);case 21:return Ds(e,2790,2799,!0,r);case 22:return Ds(e,2662,2671,!0,r);case 22:return Ls(e,1,10999,Ns,3,r);case 23:return Rs(e,"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3090\u3091\u3092\u3093");case 24:return Rs(e,"\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081\u307f\u3057\u3091\u3072\u3082\u305b\u3059");case 27:return Ds(e,3302,3311,!0,r);case 28:return Rs(e,"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f0\u30f1\u30f2\u30f3",i);case 29:return Rs(e,"\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9",i);case 34:return Ds(e,3792,3801,!0,r);case 37:return Ds(e,6160,6169,!0,r);case 38:return Ds(e,4160,4169,!0,r);case 39:return Ds(e,2918,2927,!0,r);case 40:return Ds(e,1776,1785,!0,r);case 43:return Ds(e,3046,3055,!0,r);case 44:return Ds(e,3174,3183,!0,r);case 45:return Ds(e,3664,3673,!0,r);case 46:return Ds(e,3872,3881,!0,r);default:return Ds(e,48,57,!0,r)}},Gs="data-html2canvas-ignore",qs=function(){function e(e,t,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=t,this.counters=new ks,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var n=this,o=Ys(e,t);if(!o.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,A=o.contentWindow,u=A.document,l=$s(o).then(function(){return r(n,void 0,void 0,function(){var e,n;return i(this,function(r){switch(r.label){case 0:return this.scrolledElements.forEach(iA),A&&(A.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||A.scrollY===t.top&&A.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(A.scrollX-t.left,A.scrollY-t.top,0,0))),e=this.options.onclone,"undefined"===typeof(n=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:u.fonts&&u.fonts.ready?[4,u.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Zs(u)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"===typeof e?[2,Promise.resolve().then(function(){return e(u,n)}).then(function(){return o})]:[2,o]}})})});return u.open(),u.write(nA(document.doctype)+"<html></html>"),rA(this.referenceElement.ownerDocument,a,s),u.replaceChild(u.adoptNode(this.documentElement),u.documentElement),u.close(),l},e.prototype.createElementClone=function(e){if(Bo(e,2),vs(e))return this.createCanvasClone(e);if(ws(e))return this.createVideoClone(e);if(Bs(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return ys(t)&&(ys(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),Ss(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return tA(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"===typeof t.cssText?e+t.cssText:e},""),r=e.cloneNode(!1);return r.textContent=n,r}}catch(Tt){if(this.context.logger.error("Unable to access cssRules property",Tt),"SecurityError"!==Tt.name)throw Tt}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch(Tt){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext("2d"),o=r.getContext("2d");if(o)if(!this.options.allowTaint&&i)o.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var a=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(a){var s=a.getContextAttributes();!1===(null===s||void 0===s?void 0:s.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}o.drawImage(e,0,0)}return r}catch(Tt){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var n=t.getContext("2d");try{return n&&(n.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||n.getImageData(0,0,t.width,t.height)),t}catch(Tt){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,n){us(t)&&(xs(t)||t.hasAttribute(Gs)||"function"===typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&us(t)&&Bs(t)||e.appendChild(this.cloneNode(t,n))},e.prototype.cloneChildNodes=function(e,t,n){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(us(i)&&Es(i)&&"function"===typeof i.assignedNodes){var o=i.assignedNodes();o.length&&o.forEach(function(e){return r.appendChildNode(t,e,n)})}else this.appendChildNode(t,i,n)},e.prototype.cloneNode=function(e,t){if(As(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&us(e)&&(ls(e)||cs(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var i=n.getComputedStyle(e),o=n.getComputedStyle(e,":before"),a=n.getComputedStyle(e,":after");this.referenceElement===e&&ls(r)&&(this.clonedReferenceElement=r),ms(r)&&lA(r);var s=this.counters.parse(new vo(this.context,i)),A=this.resolvePseudoContent(e,r,o,Vo.BEFORE);Ss(e)&&(t=!0),ws(e)||this.cloneChildNodes(e,r,t),A&&r.insertBefore(A,r.firstChild);var u=this.resolvePseudoContent(e,r,a,Vo.AFTER);return u&&r.appendChild(u),this.counters.pop(s),(i&&(this.options.copyStyles||cs(e))&&!bs(e)||t)&&tA(i,r),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(Cs(e)||Fs(e))&&(Cs(r)||Fs(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var o=n.content,a=t.ownerDocument;if(a&&o&&"none"!==o&&"-moz-alt-content"!==o&&"none"!==n.display){this.counters.parse(new vo(this.context,n));var s=new mo(this.context,n),A=a.createElement("html2canvaspseudoelement");tA(n,A),s.content.forEach(function(t){if(0===t.type)A.appendChild(a.createTextNode(t.value));else if(22===t.type){var n=a.createElement("img");n.src=t.value,n.style.opacity="1",A.appendChild(n)}else if(18===t.type){if("attr"===t.name){var r=t.values.filter(Ln);r.length&&A.appendChild(a.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var o=t.values.filter(Tn),u=o[0],l=o[1];if(u&&Ln(u)){var c=i.counters.getCounterValue(u.value),f=l&&Ln(l)?Ci.parse(i.context,l.value):3;A.appendChild(a.createTextNode(Vs(c,f,!1)))}}else if("counters"===t.name){var h=t.values.filter(Tn),d=(u=h[0],h[1]);if(l=h[2],u&&Ln(u)){var p=i.counters.getCounterValues(u.value),g=l&&Ln(l)?Ci.parse(i.context,l.value):3,m=d&&0===d.type?d.value:"",v=p.map(function(e){return Vs(e,g,!1)}).join(m);A.appendChild(a.createTextNode(v))}}}else if(20===t.type)switch(t.value){case"open-quote":A.appendChild(a.createTextNode(lo(s.quotes,i.quoteDepth++,!0)));break;case"close-quote":A.appendChild(a.createTextNode(lo(s.quotes,--i.quoteDepth,!1)));break;default:A.appendChild(a.createTextNode(t.value))}}),A.className=sA+" "+AA;var u=r===Vo.BEFORE?" "+sA:" "+AA;return cs(t)?t.className.baseValue+=u:t.className+=u,A}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Vo||(Vo={}));var Xs,Ys=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(Gs,"true"),e.body.appendChild(n),n},Js=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},Zs=function(e){return Promise.all([].slice.call(e.images,0).map(Js))},$s=function(e){return new Promise(function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval(function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),t(e))},50)}})},eA=["all","d","content"],tA=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);-1===eA.indexOf(r)&&t.style.setProperty(r,e.getPropertyValue(r))}return t},nA=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},rA=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},iA=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},oA=":before",aA=":after",sA="___html2canvas___pseudoelement_before",AA="___html2canvas___pseudoelement_after",uA='{\n content: "" !important;\n display: none !important;\n}',lA=function(e){cA(e,"."+sA+oA+uA+"\n ."+AA+aA+uA)},cA=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}},fA=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),hA=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:yA(e)||mA(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,o,a=this;return i(this,function(i){switch(i.label){case 0:return t=fA.isSameOrigin(e),n=!vA(e)&&!0===this._options.useCORS&&Fa.SUPPORT_CORS_IMAGES&&!t,r=!vA(e)&&!t&&!yA(e)&&"string"===typeof this._options.proxy&&Fa.SUPPORT_CORS_XHR&&!n,t||!1!==this._options.allowTaint||vA(e)||yA(e)||r||n?(o=e,r?[4,this.proxy(o)]:[3,2]):[2];case 1:o=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(wA(o)||n)&&(r.crossOrigin="anonymous"),r.src=o,!0===r.complete&&setTimeout(function(){return e(r)},500),a._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(e){return"undefined"!==typeof this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(i,o){var a=Fa.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(200===s.status)if("text"===a)i(s.response);else{var e=new FileReader;e.addEventListener("load",function(){return i(e.result)},!1),e.addEventListener("error",function(e){return o(e)},!1),e.readAsDataURL(s.response)}else o("Failed to proxy resource "+r+" with status code "+s.status)},s.onerror=o;var A=n.indexOf("?")>-1?"&":"?";if(s.open("GET",""+n+A+"url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&s instanceof XMLHttpRequest&&(s.responseType=a),t._options.imageTimeout){var u=t._options.imageTimeout;s.timeout=u,s.ontimeout=function(){return o("Timed out ("+u+"ms) proxying "+r)}}s.send()})},e}(),dA=/^data:image\/svg\+xml/i,pA=/^data:image\/.*;base64,/i,gA=/^data:image\/.*/i,mA=function(e){return Fa.SUPPORT_SVG_DRAWING||!bA(e)},vA=function(e){return gA.test(e)},wA=function(e){return pA.test(e)},yA=function(e){return"blob"===e.substr(0,4)},bA=function(e){return"svg"===e.substr(-3).toLowerCase()||dA.test(e)},BA=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),xA=function(e,t,n){return new BA(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},CA=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=xA(this.start,this.startControl,t),i=xA(this.startControl,this.endControl,t),o=xA(this.endControl,this.end,t),a=xA(r,i,t),s=xA(i,o,t),A=xA(a,s,t);return n?new e(this.start,r,a,A):new e(A,s,o,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),FA=function(e){return 1===e.type},EA=function(){function e(e){var t=e.styles,n=e.bounds,r=Vn(t.borderTopLeftRadius,n.width,n.height),i=r[0],o=r[1],a=Vn(t.borderTopRightRadius,n.width,n.height),s=a[0],A=a[1],u=Vn(t.borderBottomRightRadius,n.width,n.height),l=u[0],c=u[1],f=Vn(t.borderBottomLeftRadius,n.width,n.height),h=f[0],d=f[1],p=[];p.push((i+s)/n.width),p.push((h+l)/n.width),p.push((o+d)/n.height),p.push((A+c)/n.height);var g=Math.max.apply(Math,p);g>1&&(i/=g,o/=g,s/=g,A/=g,l/=g,c/=g,h/=g,d/=g);var m=n.width-s,v=n.height-c,w=n.width-l,y=n.height-d,b=t.borderTopWidth,B=t.borderRightWidth,x=t.borderBottomWidth,C=t.borderLeftWidth,F=Gn(t.paddingTop,e.bounds.width),E=Gn(t.paddingRight,e.bounds.width),S=Gn(t.paddingBottom,e.bounds.width),k=Gn(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||o>0?SA(n.left+C/3,n.top+b/3,i-C/3,o-b/3,Xs.TOP_LEFT):new BA(n.left+C/3,n.top+b/3),this.topRightBorderDoubleOuterBox=i>0||o>0?SA(n.left+m,n.top+b/3,s-B/3,A-b/3,Xs.TOP_RIGHT):new BA(n.left+n.width-B/3,n.top+b/3),this.bottomRightBorderDoubleOuterBox=l>0||c>0?SA(n.left+w,n.top+v,l-B/3,c-x/3,Xs.BOTTOM_RIGHT):new BA(n.left+n.width-B/3,n.top+n.height-x/3),this.bottomLeftBorderDoubleOuterBox=h>0||d>0?SA(n.left+C/3,n.top+y,h-C/3,d-x/3,Xs.BOTTOM_LEFT):new BA(n.left+C/3,n.top+n.height-x/3),this.topLeftBorderDoubleInnerBox=i>0||o>0?SA(n.left+2*C/3,n.top+2*b/3,i-2*C/3,o-2*b/3,Xs.TOP_LEFT):new BA(n.left+2*C/3,n.top+2*b/3),this.topRightBorderDoubleInnerBox=i>0||o>0?SA(n.left+m,n.top+2*b/3,s-2*B/3,A-2*b/3,Xs.TOP_RIGHT):new BA(n.left+n.width-2*B/3,n.top+2*b/3),this.bottomRightBorderDoubleInnerBox=l>0||c>0?SA(n.left+w,n.top+v,l-2*B/3,c-2*x/3,Xs.BOTTOM_RIGHT):new BA(n.left+n.width-2*B/3,n.top+n.height-2*x/3),this.bottomLeftBorderDoubleInnerBox=h>0||d>0?SA(n.left+2*C/3,n.top+y,h-2*C/3,d-2*x/3,Xs.BOTTOM_LEFT):new BA(n.left+2*C/3,n.top+n.height-2*x/3),this.topLeftBorderStroke=i>0||o>0?SA(n.left+C/2,n.top+b/2,i-C/2,o-b/2,Xs.TOP_LEFT):new BA(n.left+C/2,n.top+b/2),this.topRightBorderStroke=i>0||o>0?SA(n.left+m,n.top+b/2,s-B/2,A-b/2,Xs.TOP_RIGHT):new BA(n.left+n.width-B/2,n.top+b/2),this.bottomRightBorderStroke=l>0||c>0?SA(n.left+w,n.top+v,l-B/2,c-x/2,Xs.BOTTOM_RIGHT):new BA(n.left+n.width-B/2,n.top+n.height-x/2),this.bottomLeftBorderStroke=h>0||d>0?SA(n.left+C/2,n.top+y,h-C/2,d-x/2,Xs.BOTTOM_LEFT):new BA(n.left+C/2,n.top+n.height-x/2),this.topLeftBorderBox=i>0||o>0?SA(n.left,n.top,i,o,Xs.TOP_LEFT):new BA(n.left,n.top),this.topRightBorderBox=s>0||A>0?SA(n.left+m,n.top,s,A,Xs.TOP_RIGHT):new BA(n.left+n.width,n.top),this.bottomRightBorderBox=l>0||c>0?SA(n.left+w,n.top+v,l,c,Xs.BOTTOM_RIGHT):new BA(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=h>0||d>0?SA(n.left,n.top+y,h,d,Xs.BOTTOM_LEFT):new BA(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||o>0?SA(n.left+C,n.top+b,Math.max(0,i-C),Math.max(0,o-b),Xs.TOP_LEFT):new BA(n.left+C,n.top+b),this.topRightPaddingBox=s>0||A>0?SA(n.left+Math.min(m,n.width-B),n.top+b,m>n.width+B?0:Math.max(0,s-B),Math.max(0,A-b),Xs.TOP_RIGHT):new BA(n.left+n.width-B,n.top+b),this.bottomRightPaddingBox=l>0||c>0?SA(n.left+Math.min(w,n.width-C),n.top+Math.min(v,n.height-x),Math.max(0,l-B),Math.max(0,c-x),Xs.BOTTOM_RIGHT):new BA(n.left+n.width-B,n.top+n.height-x),this.bottomLeftPaddingBox=h>0||d>0?SA(n.left+C,n.top+Math.min(y,n.height-x),Math.max(0,h-C),Math.max(0,d-x),Xs.BOTTOM_LEFT):new BA(n.left+C,n.top+n.height-x),this.topLeftContentBox=i>0||o>0?SA(n.left+C+k,n.top+b+F,Math.max(0,i-(C+k)),Math.max(0,o-(b+F)),Xs.TOP_LEFT):new BA(n.left+C+k,n.top+b+F),this.topRightContentBox=s>0||A>0?SA(n.left+Math.min(m,n.width+C+k),n.top+b+F,m>n.width+C+k?0:s-C+k,A-(b+F),Xs.TOP_RIGHT):new BA(n.left+n.width-(B+E),n.top+b+F),this.bottomRightContentBox=l>0||c>0?SA(n.left+Math.min(w,n.width-(C+k)),n.top+Math.min(v,n.height+b+F),Math.max(0,l-(B+E)),c-(x+S),Xs.BOTTOM_RIGHT):new BA(n.left+n.width-(B+E),n.top+n.height-(x+S)),this.bottomLeftContentBox=h>0||d>0?SA(n.left+C+k,n.top+y,Math.max(0,h-(C+k)),d-(x+S),Xs.BOTTOM_LEFT):new BA(n.left+C+k,n.top+n.height-(x+S))}return e}();!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Xs||(Xs={}));var SA=function(e,t,n,r,i){var o=(Math.sqrt(2)-1)/3*4,a=n*o,s=r*o,A=e+n,u=t+r;switch(i){case Xs.TOP_LEFT:return new CA(new BA(e,u),new BA(e,u-s),new BA(A-a,t),new BA(A,t));case Xs.TOP_RIGHT:return new CA(new BA(e,t),new BA(e+a,t),new BA(A,u-s),new BA(A,u));case Xs.BOTTOM_RIGHT:return new CA(new BA(A,t),new BA(A,t+s),new BA(e+a,u),new BA(e,u));case Xs.BOTTOM_LEFT:default:return new CA(new BA(A,u),new BA(A-a,u),new BA(e,t+s),new BA(e,t))}},kA=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},_A=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},IA=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},NA=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),UA=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),LA=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),QA=function(e){return 0===e.type},DA=function(e){return 1===e.type},RA=function(e){return 2===e.type},TA=function(e,t){return e.length===t.length&&e.some(function(e,n){return e===t[n]})},PA=function(e,t,n,r,i){return e.map(function(e,o){switch(o){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},OA=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),MA=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new EA(this.container),this.container.styles.opacity<1&&this.effects.push(new LA(this.container.styles.opacity)),null!==this.container.styles.transform){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new NA(n,r,i))}if(0!==this.container.styles.overflowX){var o=kA(this.curves),a=IA(this.curves);TA(o,a)?this.effects.push(new UA(o,6)):(this.effects.push(new UA(o,2)),this.effects.push(new UA(a,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!DA(e)});if(t||0!==n.container.styles.position||!n.parent){if(r.unshift.apply(r,i),t=-1===[2,3].indexOf(n.container.styles.position),0!==n.container.styles.overflowX){var o=kA(n.curves),a=IA(n.curves);TA(o,a)||r.unshift(new UA(a,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return io(t.target,e)})},e}(),HA=function(e,t,n,r){e.container.elements.forEach(function(i){var o=io(i.flags,4),a=io(i.flags,2),s=new MA(i,e);io(i.styles.display,2048)&&r.push(s);var A=io(i.flags,8)?[]:r;if(o||a){var u=o||i.styles.isPositioned()?n:t,l=new OA(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var c=i.styles.zIndex.order;if(c<0){var f=0;u.negativeZIndex.some(function(e,t){return c>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),u.negativeZIndex.splice(f,0,l)}else if(c>0){var h=0;u.positiveZIndex.some(function(e,t){return c>=e.element.container.styles.zIndex.order?(h=t+1,!1):h>0}),u.positiveZIndex.splice(h,0,l)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else i.styles.isFloating()?u.nonPositionedFloats.push(l):u.nonPositionedInlineLevel.push(l);HA(s,l,o?l:n,A)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),HA(s,t,n,A);io(i.flags,8)&&jA(i,A)})},jA=function(e,t){for(var n=e instanceof za?e.start:1,r=e instanceof za&&e.reversed,i=0;i<t.length;i++){var o=t[i];o.container instanceof ja&&"number"===typeof o.container.value&&0!==o.container.value&&(n=o.container.value),o.listValue=Vs(n,o.container.styles.listStyleType,!0),n+=r?-1:1}},zA=function(e){var t=new MA(e,null),n=new OA(t),r=[];return HA(t,n,n,r),jA(t.container,r),n},KA=function(e,t){switch(t){case 0:return XA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return XA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return XA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return XA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},WA=function(e,t){switch(t){case 0:return XA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return XA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return XA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return XA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},VA=function(e,t){switch(t){case 0:return XA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return XA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return XA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return XA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},GA=function(e,t){switch(t){case 0:return qA(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return qA(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return qA(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return qA(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},qA=function(e,t){var n=[];return FA(e)?n.push(e.subdivide(.5,!1)):n.push(e),FA(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},XA=function(e,t,n,r){var i=[];return FA(e)?i.push(e.subdivide(.5,!1)):i.push(e),FA(n)?i.push(n.subdivide(.5,!0)):i.push(n),FA(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),FA(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},YA=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},JA=function(e){var t=e.styles,n=e.bounds,r=Gn(t.paddingLeft,n.width),i=Gn(t.paddingRight,n.width),o=Gn(t.paddingTop,n.width),a=Gn(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,o+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+o+a))},ZA=function(e,t){return 0===e?t.bounds:2===e?JA(t):YA(t)},$A=function(e,t){return 0===e?t.bounds:2===e?JA(t):YA(t)},eu=function(e,t,n){var r=ZA(iu(e.styles.backgroundOrigin,t),e),i=$A(iu(e.styles.backgroundClip,t),e),o=ru(iu(e.styles.backgroundSize,t),n,r),a=o[0],s=o[1],A=Vn(iu(e.styles.backgroundPosition,t),r.width-a,r.height-s);return[ou(iu(e.styles.backgroundRepeat,t),A,o,r,i),Math.round(r.left+A[0]),Math.round(r.top+A[1]),a,s]},tu=function(e){return Ln(e)&&e.value===Rr.AUTO},nu=function(e){return"number"===typeof e},ru=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1];if(!a)return[0,0];if(Hn(a)&&s&&Hn(s))return[Gn(a,n.width),Gn(s,n.height)];var A=nu(o);if(Ln(a)&&(a.value===Rr.CONTAIN||a.value===Rr.COVER))return nu(o)?n.width/n.height<o!==(a.value===Rr.COVER)?[n.width,n.width/o]:[n.height*o,n.height]:[n.width,n.height];var u=nu(r),l=nu(i),c=u||l;if(tu(a)&&(!s||tu(s)))return u&&l?[r,i]:A||c?c&&A?[u?r:i*o,l?i:r/o]:[u?r:n.width,l?i:n.height]:[n.width,n.height];if(A){var f=0,h=0;return Hn(a)?f=Gn(a,n.width):Hn(s)&&(h=Gn(s,n.height)),tu(a)?f=h*o:s&&!tu(s)||(h=f/o),[f,h]}var d=null,p=null;if(Hn(a)?d=Gn(a,n.width):s&&Hn(s)&&(p=Gn(s,n.height)),null===d||s&&!tu(s)||(p=u&&l?d/r*i:n.height),null!==p&&tu(a)&&(d=u&&l?p/i*r:n.width),null!==d&&null!==p)return[d,p];throw new Error("Unable to calculate background-size for element")},iu=function(e,t){var n=e[t];return"undefined"===typeof n?e[0]:n},ou=function(e,t,n,r,i){var o=t[0],a=t[1],s=n[0],A=n[1];switch(e){case 2:return[new BA(Math.round(r.left),Math.round(r.top+a)),new BA(Math.round(r.left+r.width),Math.round(r.top+a)),new BA(Math.round(r.left+r.width),Math.round(A+r.top+a)),new BA(Math.round(r.left),Math.round(A+r.top+a))];case 3:return[new BA(Math.round(r.left+o),Math.round(r.top)),new BA(Math.round(r.left+o+s),Math.round(r.top)),new BA(Math.round(r.left+o+s),Math.round(r.height+r.top)),new BA(Math.round(r.left+o),Math.round(r.height+r.top))];case 1:return[new BA(Math.round(r.left+o),Math.round(r.top+a)),new BA(Math.round(r.left+o+s),Math.round(r.top+a)),new BA(Math.round(r.left+o+s),Math.round(r.top+a+A)),new BA(Math.round(r.left+o),Math.round(r.top+a+A))];default:return[new BA(Math.round(i.left),Math.round(i.top)),new BA(Math.round(i.left+i.width),Math.round(i.top)),new BA(Math.round(i.left+i.width),Math.round(i.height+i.top)),new BA(Math.round(i.left),Math.round(i.height+i.top))]}},au="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",su="Hidden Text",Au=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var n=this._document.createElement("div"),r=this._document.createElement("img"),i=this._document.createElement("span"),o=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",o.appendChild(n),r.src=au,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(su)),n.appendChild(i),n.appendChild(r);var a=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(su)),n.style.lineHeight="normal",r.style.verticalAlign="super";var s=r.offsetTop-n.offsetTop+2;return o.removeChild(n),{baseline:a,middle:s}},e.prototype.getMetrics=function(e,t){var n=e+" "+t;return"undefined"===typeof this._data[n]&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},e}(),uu=function(){function e(e,t){this.context=e,this.options=t}return e}(),lu=1e4,cu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px"),r.fontMetrics=new Au(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),r}return t(n,e),n.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},n.prototype.applyEffect=function(e){this.ctx.save(),RA(e)&&(this.ctx.globalAlpha=e.opacity),QA(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),DA(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},n.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return io(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},n.prototype.renderTextWithLetterSpacing=function(e,t,n){var r=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n):Ia(e.text).reduce(function(t,i){return r.ctx.fillText(i,t,e.bounds.top+n),t+r.ctx.measureText(i).width},e.bounds.left)},n.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),n=gu(e.fontFamily).join(", "),r=Nn(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,r,n].join(" "),n,r]},n.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var n,r,o,a,s,A,u,l,c=this;return i(this,function(i){return n=this.createFontStyle(t),r=n[0],o=n[1],a=n[2],this.ctx.font=r,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(o,a),A=s.baseline,u=s.middle,l=t.paintOrder,e.textBounds.forEach(function(e){l.forEach(function(n){switch(n){case 0:c.ctx.fillStyle=ir(t.color),c.renderTextWithLetterSpacing(e,t.letterSpacing,A);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(n){c.ctx.shadowColor=ir(n.color),c.ctx.shadowOffsetX=n.offsetX.number*c.options.scale,c.ctx.shadowOffsetY=n.offsetY.number*c.options.scale,c.ctx.shadowBlur=n.blur.number,c.renderTextWithLetterSpacing(e,t.letterSpacing,A)}),c.ctx.shadowColor="",c.ctx.shadowOffsetX=0,c.ctx.shadowOffsetY=0,c.ctx.shadowBlur=0),t.textDecorationLine.length&&(c.ctx.fillStyle=ir(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:c.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+A),e.bounds.width,1);break;case 2:c.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:c.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+u),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(c.ctx.strokeStyle=ir(t.webkitTextStrokeColor),c.ctx.lineWidth=t.webkitTextStrokeWidth,c.ctx.lineJoin=window.chrome?"miter":"round",c.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+A)),c.ctx.strokeStyle="",c.ctx.lineWidth=0,c.ctx.lineJoin="miter"}})}),[2]})})},n.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=JA(e),i=IA(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,o,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b;return i(this,function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,o=t.styles,s=0,A=t.textNodes,i.label=1;case 1:return s<A.length?(u=A[s],[4,this.renderTextNode(u,o)]):[3,4];case 2:i.sent(),i.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof Oa))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return v=i.sent(),this.renderReplacedElement(t,r,v),[3,8];case 7:return i.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Ma&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof Ha))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return v=i.sent(),this.renderReplacedElement(t,r,v),[3,12];case 11:return i.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof ts&&t.tree?[4,new n(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:l=i.sent(),t.width&&t.height&&this.ctx.drawImage(l,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),i.label=14;case 14:if(t instanceof Za&&(c=Math.min(t.bounds.width,t.bounds.height),t.type===qa?t.checked&&(this.ctx.save(),this.path([new BA(t.bounds.left+.39363*c,t.bounds.top+.79*c),new BA(t.bounds.left+.16*c,t.bounds.top+.5549*c),new BA(t.bounds.left+.27347*c,t.bounds.top+.44071*c),new BA(t.bounds.left+.39694*c,t.bounds.top+.5649*c),new BA(t.bounds.left+.72983*c,t.bounds.top+.23*c),new BA(t.bounds.left+.84*c,t.bounds.top+.34085*c),new BA(t.bounds.left+.39363*c,t.bounds.top+.79*c)]),this.ctx.fillStyle=ir(Ja),this.ctx.fill(),this.ctx.restore()):t.type===Xa&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+c/2,t.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=ir(Ja),this.ctx.fill(),this.ctx.restore())),fu(t)&&t.value.length){switch(f=this.createFontStyle(o),y=f[0],h=f[1],d=this.fontMetrics.getMetrics(y,h).baseline,this.ctx.font=y,this.ctx.fillStyle=ir(o.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=du(t.styles.textAlign),b=JA(t),p=0,t.styles.textAlign){case 1:p+=b.width/2;break;case 2:p+=b.width}g=b.add(p,0,0,-b.height/2+1),this.ctx.save(),this.path([new BA(b.left,b.top),new BA(b.left+b.width,b.top),new BA(b.left+b.width,b.top+b.height),new BA(b.left,b.top+b.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ea(t.value,g),o.letterSpacing,d),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!io(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];v=void 0,w=m.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(w)];case 16:return v=i.sent(),this.ctx.drawImage(v,t.bounds.left-(v.width+10),t.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error("Error loading list-style-image "+w),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(y=this.createFontStyle(o)[0],this.ctx.font=y,this.ctx.fillStyle=ir(o.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",b=new a(t.bounds.left,t.bounds.top+Gn(t.styles.paddingTop,t.bounds.width),t.bounds.width,bi(o.lineHeight,o.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ea(e.listValue,b),o.letterSpacing,bi(o.lineHeight,o.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),i.label=20;case 20:return[2]}})})},n.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,n,r,o,a,s,A,u,l,c,f,h,d,p,g;return i(this,function(i){switch(i.label){case 0:return io(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:i.sent(),t=0,n=e.negativeZIndex,i.label=2;case 2:return t<n.length?(g=n[t],[4,this.renderStack(g)]):[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:i.sent(),r=0,o=e.nonInlineLevel,i.label=7;case 7:return r<o.length?(g=o[r],[4,this.renderNode(g)]):[3,10];case 8:i.sent(),i.label=9;case 9:return r++,[3,7];case 10:a=0,s=e.nonPositionedFloats,i.label=11;case 11:return a<s.length?(g=s[a],[4,this.renderStack(g)]):[3,14];case 12:i.sent(),i.label=13;case 13:return a++,[3,11];case 14:A=0,u=e.nonPositionedInlineLevel,i.label=15;case 15:return A<u.length?(g=u[A],[4,this.renderStack(g)]):[3,18];case 16:i.sent(),i.label=17;case 17:return A++,[3,15];case 18:l=0,c=e.inlineLevel,i.label=19;case 19:return l<c.length?(g=c[l],[4,this.renderNode(g)]):[3,22];case 20:i.sent(),i.label=21;case 21:return l++,[3,19];case 22:f=0,h=e.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return f<h.length?(g=h[f],[4,this.renderStack(g)]):[3,26];case 24:i.sent(),i.label=25;case 25:return f++,[3,23];case 26:d=0,p=e.positiveZIndex,i.label=27;case 27:return d<p.length?(g=p[d],[4,this.renderStack(g)]):[3,30];case 28:i.sent(),i.label=29;case 29:return d++,[3,27];case 30:return[2]}})})},n.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},n.prototype.formatPath=function(e){var t=this;e.forEach(function(e,n){var r=FA(e)?e.start:e;0===n?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),FA(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},n.prototype.renderRepeat=function(e,t,n,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},n.prototype.resizeImage=function(e,t,n){var r;if(e.width===t&&e.height===n)return e;var i=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return i.width=Math.max(1,t),i.height=Math.max(1,n),i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,n),i},n.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,o,a,s;return i(this,function(A){switch(A.label){case 0:t=e.styles.backgroundImage.length-1,n=function(n){var o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E,S,k,_,I,N,U,L,Q,D;return i(this,function(i){switch(i.label){case 0:if(0!==n.type)return[3,5];o=void 0,a=n.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.context.cache.match(a)];case 2:return o=i.sent(),[3,4];case 3:return i.sent(),r.context.logger.error("Error loading background-image "+a),[3,4];case 4:return o&&(s=eu(e,t,[o.width,o.height,o.width/o.height]),y=s[0],E=s[1],S=s[2],x=s[3],C=s[4],v=r.ctx.createPattern(r.resizeImage(o,x,C),"repeat"),r.renderRepeat(y,v,E,S)),[3,6];case 5:Ur(n)?(A=eu(e,t,[null,null,null]),y=A[0],E=A[1],S=A[2],x=A[3],C=A[4],u=vr(n.angle,x,C),l=u[0],c=u[1],f=u[2],h=u[3],d=u[4],(p=document.createElement("canvas")).width=x,p.height=C,g=p.getContext("2d"),m=g.createLinearGradient(c,h,f,d),gr(n.stops,l).forEach(function(e){return m.addColorStop(e.stop,ir(e.color))}),g.fillStyle=m,g.fillRect(0,0,x,C),x>0&&C>0&&(v=r.ctx.createPattern(p,"repeat"),r.renderRepeat(y,v,E,S))):Lr(n)&&(w=eu(e,t,[null,null,null]),y=w[0],b=w[1],B=w[2],x=w[3],C=w[4],F=0===n.position.length?[Kn]:n.position,E=Gn(F[0],x),S=Gn(F[F.length-1],C),k=br(n,E,S,x,C),_=k[0],I=k[1],_>0&&I>0&&(N=r.ctx.createRadialGradient(b+E,B+S,0,b+E,B+S,_),gr(n.stops,2*_).forEach(function(e){return N.addColorStop(e.stop,ir(e.color))}),r.path(y),r.ctx.fillStyle=N,_!==I?(U=e.bounds.left+.5*e.bounds.width,L=e.bounds.top+.5*e.bounds.height,D=1/(Q=I/_),r.ctx.save(),r.ctx.translate(U,L),r.ctx.transform(1,0,0,Q,0,0),r.ctx.translate(-U,-L),r.ctx.fillRect(b,D*(B-L)+L,x,C*D),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return t--,[2]}})},r=this,o=0,a=e.styles.backgroundImage.slice(0).reverse(),A.label=1;case 1:return o<a.length?(s=a[o],[5,n(s)]):[3,4];case 2:A.sent(),A.label=3;case 3:return o++,[3,1];case 4:return[2]}})})},n.prototype.renderSolidBorder=function(e,t,n){return r(this,void 0,void 0,function(){return i(this,function(r){return this.path(KA(n,t)),this.ctx.fillStyle=ir(e),this.ctx.fill(),[2]})})},n.prototype.renderDoubleBorder=function(e,t,n,o){return r(this,void 0,void 0,function(){var r,a;return i(this,function(i){switch(i.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,o)]:[3,2];case 1:return i.sent(),[2];case 2:return r=WA(o,n),this.path(r),this.ctx.fillStyle=ir(e),this.ctx.fill(),a=VA(o,n),this.path(a),this.ctx.fill(),[2]}})})},n.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,n,r,o,a,s,A,u,l=this;return i(this,function(i){switch(i.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!rr(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],o=hu(iu(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(o),this.ctx.clip(),rr(t.backgroundColor)||(this.ctx.fillStyle=ir(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){l.ctx.save();var n=kA(e.curves),r=t.inset?0:lu,i=PA(n,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(l.path(n),l.ctx.clip(),l.mask(i)):(l.mask(n),l.ctx.clip(),l.path(i)),l.ctx.shadowOffsetX=t.offsetX.number+r,l.ctx.shadowOffsetY=t.offsetY.number,l.ctx.shadowColor=ir(t.color),l.ctx.shadowBlur=t.blur.number,l.ctx.fillStyle=t.inset?ir(t.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),i.label=2;case 2:a=0,s=0,A=r,i.label=3;case 3:return s<A.length?0!==(u=A[s]).style&&!rr(u.color)&&u.width>0?2!==u.style?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,a,e.curves,2)]:[3,11]:[3,13];case 4:return i.sent(),[3,11];case 5:return 3!==u.style?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,a,e.curves,3)];case 6:return i.sent(),[3,11];case 7:return 4!==u.style?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,a,e.curves)];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,a,e.curves)];case 10:i.sent(),i.label=11;case 11:a++,i.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},n.prototype.renderDashedDottedBorder=function(e,t,n,o,a){return r(this,void 0,void 0,function(){var r,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b;return i(this,function(i){return this.ctx.save(),r=GA(o,n),s=KA(o,n),2===a&&(this.path(s),this.ctx.clip()),FA(s[0])?(A=s[0].start.x,u=s[0].start.y):(A=s[0].x,u=s[0].y),FA(s[1])?(l=s[1].end.x,c=s[1].end.y):(l=s[1].x,c=s[1].y),f=0===n||2===n?Math.abs(A-l):Math.abs(u-c),this.ctx.beginPath(),3===a?this.formatPath(r):this.formatPath(s.slice(0,2)),h=t<3?3*t:2*t,d=t<3?2*t:t,3===a&&(h=t,d=t),p=!0,f<=2*h?p=!1:f<=2*h+d?(h*=g=f/(2*h+d),d*=g):(m=Math.floor((f+d)/(h+d)),v=(f-m*h)/(m-1),d=(w=(f-(m+1)*h)/m)<=0||Math.abs(d-v)<Math.abs(d-w)?v:w),p&&(3===a?this.ctx.setLineDash([0,h+d]):this.ctx.setLineDash([h,d])),3===a?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=ir(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===a&&(FA(s[0])&&(y=s[3],b=s[0],this.ctx.beginPath(),this.formatPath([new BA(y.end.x,y.end.y),new BA(b.start.x,b.start.y)]),this.ctx.stroke()),FA(s[1])&&(y=s[1],b=s[2],this.ctx.beginPath(),this.formatPath([new BA(y.end.x,y.end.y),new BA(b.start.x,b.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ir(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=zA(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},n}(uu),fu=function(e){return e instanceof es||e instanceof $a||e instanceof Za&&e.type!==Xa&&e.type!==qa},hu=function(e,t){switch(e){case 0:return kA(t);case 2:return _A(t);default:return IA(t)}},du=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},pu=["-apple-system","system-ui"],gu=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===pu.indexOf(e)}):e},mu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),r}return t(n,e),n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return t=xa(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,vu(t)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ir(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},n}(uu),vu=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},wu=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!==typeof window&&window.console&&"function"===typeof console.debug?console.debug.apply(console,o([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!==typeof window&&window.console&&"function"===typeof console.info&&console.info.apply(console,o([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!==typeof window&&window.console&&"function"===typeof console.warn?console.warn.apply(console,o([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!==typeof window&&window.console&&"function"===typeof console.error?console.error.apply(console,o([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),yu=function(){function e(t,n){var r;this.windowBounds=n,this.instanceName="#"+e.instanceCount++,this.logger=new wu({id:this.instanceName,enabled:t.logging}),this.cache=null!==(r=t.cache)&&void 0!==r?r:new hA(this,t)}return e.instanceCount=1,e}(),bu=function(e,t){return void 0===t&&(t={}),Bu(e,t)};"undefined"!==typeof window&&fA.setContext(window);var Bu=function(e,t){return r(void 0,void 0,void 0,function(){var r,o,u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E,S,k,_,I,N,U,L,Q,D,R,T,P,O,M,H,j,z,K;return i(this,function(i){switch(i.label){case 0:if(!e||"object"!==typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(r=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(o=r.defaultView))throw new Error("Document is not attached to a Window");return u={allowTaint:null!==(k=t.allowTaint)&&void 0!==k&&k,imageTimeout:null!==(_=t.imageTimeout)&&void 0!==_?_:15e3,proxy:t.proxy,useCORS:null!==(I=t.useCORS)&&void 0!==I&&I},l=n({logging:null===(N=t.logging)||void 0===N||N,cache:t.cache},u),c={windowWidth:null!==(U=t.windowWidth)&&void 0!==U?U:o.innerWidth,windowHeight:null!==(L=t.windowHeight)&&void 0!==L?L:o.innerHeight,scrollX:null!==(Q=t.scrollX)&&void 0!==Q?Q:o.pageXOffset,scrollY:null!==(D=t.scrollY)&&void 0!==D?D:o.pageYOffset},f=new a(c.scrollX,c.scrollY,c.windowWidth,c.windowHeight),h=new yu(l,f),d=null!==(R=t.foreignObjectRendering)&&void 0!==R&&R,p={allowTaint:null!==(T=t.allowTaint)&&void 0!==T&&T,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:d,copyStyles:d},h.logger.debug("Starting document clone with size "+f.width+"x"+f.height+" scrolled to "+-f.left+","+-f.top),g=new qs(h,e,p),(m=g.clonedReferenceElement)?[4,g.toIFrame(r,f)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return v=i.sent(),w=ms(m)||ps(m)?A(m.ownerDocument):s(h,m),y=w.width,b=w.height,B=w.left,x=w.top,C=xu(h,m,t.backgroundColor),F={canvas:t.canvas,backgroundColor:C,scale:null!==(O=null!==(P=t.scale)&&void 0!==P?P:o.devicePixelRatio)&&void 0!==O?O:1,x:(null!==(M=t.x)&&void 0!==M?M:0)+B,y:(null!==(H=t.y)&&void 0!==H?H:0)+x,width:null!==(j=t.width)&&void 0!==j?j:Math.ceil(y),height:null!==(z=t.height)&&void 0!==z?z:Math.ceil(b)},d?(h.logger.debug("Document cloned, using foreign object rendering"),[4,new mu(h,F).render(m)]):[3,3];case 2:return E=i.sent(),[3,5];case 3:return h.logger.debug("Document cloned, element located at "+B+","+x+" with size "+y+"x"+b+" using computed rendering"),h.logger.debug("Starting DOM parsing"),S=os(h,m),C===S.styles.backgroundColor&&(S.styles.backgroundColor=fr.TRANSPARENT),h.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),[4,new cu(h,F).render(S)];case 4:E=i.sent(),i.label=5;case 5:return(null===(K=t.removeContainer)||void 0===K||K)&&(qs.destroy(v)||h.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),h.logger.debug("Finished rendering"),[2,E]}})})},xu=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?cr(e,getComputedStyle(r.documentElement).backgroundColor):fr.TRANSPARENT,o=r.body?cr(e,getComputedStyle(r.body).backgroundColor):fr.TRANSPARENT,a="string"===typeof n?cr(e,n):null===n?fr.TRANSPARENT:4294967295;return t===r.documentElement?rr(i)?rr(o)?a:o:i:a};return bu}()},5896:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,A=e[s],u=s+1,l=e[u];if(0>o(A,n))u<i&&0>o(l,A)?(e[r]=l,e[u]=n,r=u):(e[r]=A,e[s]=n,r=s);else{if(!(u<i&&0>o(l,n)))break e;e[r]=l,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,A=s.now();t.unstable_now=function(){return s.now()-A}}var u=[],l=[],c=1,f=null,h=3,d=!1,p=!1,g=!1,m=!1,v="function"===typeof setTimeout?setTimeout:null,w="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=r(l);null!==t;){if(null===t.callback)i(l);else{if(!(t.startTime<=e))break;i(l),t.sortIndex=t.expirationTime,n(u,t)}t=r(l)}}function B(e){if(g=!1,b(e),!p)if(null!==r(u))p=!0,C||(C=!0,x());else{var t=r(l);null!==t&&U(B,t.startTime-e)}}var x,C=!1,F=-1,E=5,S=-1;function k(){return!!m||!(t.unstable_now()-S<E)}function _(){if(m=!1,C){var e=t.unstable_now();S=e;var n=!0;try{e:{p=!1,g&&(g=!1,w(F),F=-1),d=!0;var o=h;try{t:{for(b(e),f=r(u);null!==f&&!(f.expirationTime>e&&k());){var a=f.callback;if("function"===typeof a){f.callback=null,h=f.priorityLevel;var s=a(f.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof s){f.callback=s,b(e),n=!0;break t}f===r(u)&&i(u),b(e)}else i(u);f=r(u)}if(null!==f)n=!0;else{var A=r(l);null!==A&&U(B,A.startTime-e),n=!1}}break e}finally{f=null,h=o,d=!1}n=void 0}}finally{n?x():C=!1}}}if("function"===typeof y)x=function(){y(_)};else if("undefined"!==typeof MessageChannel){var I=new MessageChannel,N=I.port2;I.port1.onmessage=_,x=function(){N.postMessage(null)}}else x=function(){v(_,0)};function U(e,n){F=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_requestPaint=function(){m=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,i,o){var a=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?a+o:a:o=a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:c++,callback:i,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(e.sortIndex=o,n(l,e),null===r(u)&&e===r(l)&&(g?(w(F),F=-1):g=!0,U(B,o-a))):(e.sortIndex=s,n(u,e),p||d||(p=!0,C||(C=!0,x()))),e},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},6159:(e,t,n)=>{e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var A=new Error("Cannot find module '"+a+"'");throw A.code="MODULE_NOT_FOUND",A}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){return i(t[a][1][e]||e)},u,u.exports,e,t,n,r)}return n[a].exports}for(var o=void 0,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";var r=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,i,a,s,A,u,l=[],c=0,f=e.length,h=f,d="string"!==r.getTypeOf(e);c<e.length;)h=f-c,i=d?(t=e[c++],n=c<f?e[c++]:0,c<f?e[c++]:0):(t=e.charCodeAt(c++),n=c<f?e.charCodeAt(c++):0,c<f?e.charCodeAt(c++):0),a=t>>2,s=(3&t)<<4|n>>4,A=1<h?(15&n)<<2|i>>6:64,u=2<h?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(A)+o.charAt(u));return l.join("")},n.decode=function(e){var t,n,r,a,s,A,u=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");var f,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=i.uint8array?new Uint8Array(0|h):new Array(0|h);u<e.length;)t=o.indexOf(e.charAt(u++))<<2|(a=o.indexOf(e.charAt(u++)))>>4,n=(15&a)<<4|(s=o.indexOf(e.charAt(u++)))>>2,r=(3&s)<<6|(A=o.indexOf(e.charAt(u++))),f[l++]=t,64!==s&&(f[l++]=n),64!==A&&(f[l++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var o=i,a=r+n;e^=-1;for(var s=r;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var o=i,a=r+n;e^=-1;for(var s=r;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=r?"uint8array":"array";function A(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(A,a),A.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},A.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},A.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},A.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new A("Deflate",e)},n.uncompressWorker=function(){return new A("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,a,l){var c,f,h=e.file,d=e.compression,p=l!==s.utf8encode,g=o.transformTo("string",l(h.name)),m=o.transformTo("string",s.utf8encode(h.name)),v=h.comment,w=o.transformTo("string",l(v)),y=o.transformTo("string",s.utf8encode(v)),b=m.length!==h.name.length,B=y.length!==v.length,x="",C="",F="",E=h.dir,S=h.date,k={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(k.crc32=e.crc32,k.compressedSize=e.compressedSize,k.uncompressedSize=e.uncompressedSize);var _=0;t&&(_|=8),p||!b&&!B||(_|=2048);var I=0,N=0;E&&(I|=16),"UNIX"===a?(N=798,I|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(h.unixPermissions,E)):(N=20,I|=function(e){return 63&(e||0)}(h.dosPermissions)),c=S.getUTCHours(),c<<=6,c|=S.getUTCMinutes(),c<<=5,c|=S.getUTCSeconds()/2,f=S.getUTCFullYear()-1980,f<<=4,f|=S.getUTCMonth()+1,f<<=5,f|=S.getUTCDate(),b&&(C=r(1,1)+r(A(g),4)+m,x+="up"+r(C.length,2)+C),B&&(F=r(1,1)+r(A(w),4)+y,x+="uc"+r(F.length,2)+F);var U="";return U+="\n\0",U+=r(_,2),U+=d.magic,U+=r(c,2),U+=r(f,2),U+=r(k.crc32,4),U+=r(k.compressedSize,4),U+=r(k.uncompressedSize,4),U+=r(g.length,2),U+=r(x.length,2),{fileRecord:u.LOCAL_FILE_HEADER+U+g+x,dirRecord:u.CENTRAL_FILE_HEADER+r(N,2)+U+r(w.length,2)+"\0\0\0\0"+r(I,4)+r(i,4)+g+x+w}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),A=e("../crc32"),u=e("../signature");function l(e,t,n,r){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,a),l.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,a){var s=o.transformTo("string",a(i));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var r=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var o=new i(t.streamFiles,n,t.platform,t.encodeFileName),a=0;try{e.forEach(function(e,n){a++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},A=n.dir,u=n.date;n._compressWorker(i,s).withStreamInfo("file",{name:e,dir:A,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)}),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.1",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=e("./external"),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){"use strict";var r=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),A=e("./nodejsUtils");function u(e){return new i.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on("error",function(e){n(e)}).on("end",function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),A.isNode&&A.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new a(t);return n.load(e),n}).then(function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var o=0;o<r.length;o++)n.push(u(r[o]));return i.Promise.all(n)}).then(function(e){for(var i=e.shift(),o=i.files,a=0;a<o.length;a++){var s=o[a],A=s.fileNameStr,u=r.resolve(s.fileNameStr);n.file(u,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(u).unsafeOriginalName=A)}return i.zipComment.length&&(n.comment=i.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){"use strict";var r=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){"use strict";var r=e("readable-stream").Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on("data",function(e,t){i.push(e)||i._helper.pause(),n&&n(t)}).on("error",function(e){i.emit("error",e)}).on("end",function(){i.push(null)})}e("../utils").inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){"use strict";function r(e,t,n){var r,i=o.getTypeOf(t),s=o.extend(n||{},A);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=p(e)),s.createFolders&&(r=d(e))&&g.call(this,r,!0);var c="string"===i&&!1===s.binary&&!1===s.base64;n&&void 0!==n.binary||(s.binary=!c),(t instanceof u&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var m=null;m=t instanceof u||t instanceof a?t:f.isNode&&f.isStream(t)?new h(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new l(e,m,s);this.files[e]=v}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),A=e("./defaults"),u=e("./compressedObject"),l=e("./zipObject"),c=e("./generate"),f=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),d=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},p=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:A.createFolders,e=p(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,r.call(this,e,t,n),this;if(m(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(m(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var r=n.comment||this.comment||"";t=c.generateWorker(this,n,r)}catch(e){(t=new a("error")).error(e)}return new s(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=v},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){"use strict";var r=e("./DataReader");function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&n===o[1]&&r===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){"use strict";var r=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),A=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new A(r.transformTo("uint8array",e)):new o(r.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK\x03\x04",n.CENTRAL_FILE_HEADER="PK\x01\x02",n.CENTRAL_DIRECTORY_END="PK\x05\x06",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,t,n){"use strict";var r=e("./GenericWorker"),i=e("../utils");function o(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,r),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e("./GenericWorker"),i=e("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,r),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),A=e("../external"),u=null;if(s.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t){return new A.Promise(function(n,i){var o=[],s=e._internalType,A=e._outputType,u=e._mimeType;e.on("data",function(e,n){o.push(e),t&&t(n)}).on("error",function(e){o=[],i(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(A,function(e,t){var n,r=0,i=null,o=0;for(n=0;n<t.length;n++)o+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),u);n(e)}catch(e){i(e)}o=[]}).resume()})}function c(e,t,n){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=n,r.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){r.delay(t,arguments,n)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=0===new Blob([r],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=0===i.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),A=0;A<256;A++)s[A]=252<=A?6:248<=A?5:240<=A?4:224<=A?3:192<=A?2:1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,n.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,n,r,o,a,s=e.length,A=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),A+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(A):new Array(A),o=a=0;a<A;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,o,a=e.length,A=new Array(2*a);for(t=n=0;t<a;)if((i=e[t++])<128)A[n++]=i;else if(4<(o=s[i]))A[n++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?A[n++]=65533:i<65536?A[n++]=i:(i-=65536,A[n++]=55296|i>>10&1023,A[n++]=56320|1023&i)}return A.length!==n&&(A.subarray?A=A.subarray(0,n):A.length=n),r.applyFromCharCode(A)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(u,a),u.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),A=t;a!==t.length&&(i.uint8array?(A=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(A=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:n.utf8decode(A),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,r.inherits(l,a),l.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("./external");function s(e){return e}function A(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(t,r){n.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(t),i.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,n){var r=[],i=0,o=e.length;if(o<=n)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,o)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,o)))),i+=n;return r.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=u.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return u.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function c(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=l;var f={};f.string={string:s,array:function(e){return A(e,new Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return A(e,new Uint8Array(e.length))},nodebuffer:function(e){return A(e,o.allocBuffer(e.length))}},f.array={string:l,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},f.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return o.newBufferFrom(e)}},f.nodebuffer={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return f[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],r=0;r<t.length;r++){var i=t[r];"."===i||""===i&&0!==r&&r!==t.length-1||(".."===i?n.pop():n.push(i))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":r.nodebuffer&&o.isBuffer(e)?"nodebuffer":r.uint8array&&e instanceof Uint8Array?"uint8array":r.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,o,s,u){return a.Promise.resolve(t).then(function(e){return r.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new a.Promise(function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)}):e}).then(function(t){var l=n.getTypeOf(t);return l?("arraybuffer"===l?t=n.transformTo("uint8array",t):"string"===l&&(u?t=i.decode(t):o&&!0!==s&&(t=function(e){return A(e,r.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):a.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){"use strict";var r=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=e("./support");function A(e){this.files=[],this.loadOptions=e}A.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=A},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){"use strict";var r=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),A=e("./compressions"),u=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)&&A[t].magic===e)return A[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){"use strict";function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),A=e("./stream/GenericWorker");r.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&r&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new A("error")).error(e)}return new i(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof A?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<u.length;c++)r.prototype[u[c]]=l;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){"use strict";var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(l),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var A=new e.MessageChannel;A.port1.onmessage=l,n=function(){A.port2.postMessage(0)}}var u=[];function l(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||n()}}).call(this,"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){"use strict";var r=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],A=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=A,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function l(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function c(e,t,n){r(function(){var r;try{r=t(n)}catch(r){return o.reject(e,r)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)})}function f(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}var a=d(function(){t(i,r)});"error"===a.status&&r(a.value)}function d(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=u).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(i);return this.state!==A?c(n,this.state===s?e:t,this.outcome):this.queue.push(new l(n,e,t)),n},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=d(f,t);if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)h(e,r);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},u.reject=function(e){var t=new this(i);return o.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,A=-1,u=new this(i);++A<n;)l(e[A],A);return u;function l(e,i){t.resolve(e).then(function(e){a[i]=e,++s!==n||r||(r=!0,o.resolve(u,a))},function(e){r||(r=!0,o.reject(u,e))})}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a,s=-1,A=new this(i);++s<n;)a=e[s],t.resolve(a).then(function(e){r||(r=!0,o.resolve(A,e))},function(e){r||(r=!0,o.reject(A,e))});return A}},{immediate:36}],38:[function(e,t,n){"use strict";var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";var r=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),A=Object.prototype.toString,u=0,l=-1,c=0,f=8;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:l,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==u)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===A.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,d))!==u)throw new Error(a[n]);this._dict_set=!0}}function d(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(e,t){var n,a,s=this.strm,l=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===A.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(l),s.next_out=0,s.avail_out=l),1!==(n=r.deflate(s,a))&&n!==u)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u):2!==a||(this.onEnd(u),!(s.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=h,n.deflate=d,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),A=e("./zlib/zstream"),u=e("./zlib/gzheader"),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new c(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}c.prototype.push=function(e,t){var n,s,A,u,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(n=r.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(f="string"==typeof p?o.string2buf(p):"[object ArrayBuffer]"===l.call(p)?new Uint8Array(p):p,n=r.inflateSetDictionary(this.strm,f)),n===a.Z_BUF_ERROR&&!0===g&&(n=a.Z_OK,g=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&n!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(A=o.utf8border(h.output,h.next_out),u=h.next_out-A,c=o.buf2string(h.output,A),h.next_out=u,h.avail_out=d-u,u&&i.arraySet(h.output,h.output,A,u,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((0<h.avail_in||0===h.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(h.avail_out=0))},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=c,n.inflate=f,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],42:[function(e,t,n){"use strict";var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function A(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,a,s=e.length,A=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),A+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(A),o=a=0;a<A;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t},n.buf2binstring=function(e){return A(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,s=t||e.length,u=new Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)u[r++]=i;else if(4<(o=a[i]))u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&n<s;)i=i<<6|63&e[n++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return A(u,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e,o=e>>>16&65535,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16}},{}],44:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),A=e("./messages"),u=0,l=4,c=0,f=-2,h=-1,d=4,p=2,g=8,m=9,v=286,w=30,y=19,b=2*v+1,B=15,x=3,C=258,F=C+x+1,E=42,S=113,k=1,_=2,I=3,N=4;function U(e,t){return e.msg=A[t],t}function L(e){return(e<<1)-(4<e?9:0)}function Q(e){for(var t=e.length;0<=--t;)e[t]=0}function D(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function R(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,D(e.strm)}function T(e,t){e.pending_buf[e.pending++]=t}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function O(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,A=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,u=e.window,l=e.w_mask,c=e.prev,f=e.strstart+C,h=u[o+a-1],d=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(n=t)+a]===d&&u[n+a-1]===h&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f);if(r=C-(f-o),o=f-C,a<r){if(e.match_start=t,s<=(a=r))break;h=u[o+a-1],d=u[o+a]}}}while((t=c[t&l])>A&&0!=--i);return a<=e.lookahead?a:e.lookahead}function M(e){var t,n,r,o,A,u,l,c,f,h,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-F)){for(i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=n=e.hash_size;r=e.head[--t],e.head[t]=d<=r?r-d:0,--n;);for(t=n=d;r=e.prev[--t],e.prev[t]=d<=r?r-d:0,--n;);o+=d}if(0===e.strm.avail_in)break;if(u=e.strm,l=e.window,c=e.strstart+e.lookahead,h=void 0,(f=o)<(h=u.avail_in)&&(h=f),n=0===h?0:(u.avail_in-=h,i.arraySet(l,u.input,u.next_in,h,c),1===u.state.wrap?u.adler=a(u.adler,l,h,c):2===u.state.wrap&&(u.adler=s(u.adler,l,h,c)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=n,e.lookahead+e.insert>=x)for(A=e.strstart-e.insert,e.ins_h=e.window[A],e.ins_h=(e.ins_h<<e.hash_shift^e.window[A+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[A+x-1])&e.hash_mask,e.prev[A&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=A,A++,e.insert--,!(e.lookahead+e.insert<x)););}while(e.lookahead<F&&0!==e.strm.avail_in)}function H(e,t){for(var n,r;;){if(e.lookahead<F){if(M(e),e.lookahead<F&&t===u)return k;if(0===e.lookahead)break}if(n=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-F&&(e.match_length=O(e,n)),e.match_length>=x)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(R(e,!1),0===e.strm.avail_out))return k}return e.insert=e.strstart<x-1?e.strstart:x-1,t===l?(R(e,!0),0===e.strm.avail_out?I:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?k:_}function j(e,t){for(var n,r,i;;){if(e.lookahead<F){if(M(e),e.lookahead<F&&t===u)return k;if(0===e.lookahead)break}if(n=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=x-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-F&&(e.match_length=O(e,n),e.match_length<=5&&(1===e.strategy||e.match_length===x&&4096<e.strstart-e.match_start)&&(e.match_length=x-1)),e.prev_length>=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=x-1,e.strstart++,r&&(R(e,!1),0===e.strm.avail_out))return k}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&R(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return k}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<x-1?e.strstart:x-1,t===l?(R(e,!0),0===e.strm.avail_out?I:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?k:_}function z(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function K(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*b),this.dyn_dtree=new i.Buf16(2*(2*w+1)),this.bl_tree=new i.Buf16(2*(2*y+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(B+1),this.heap=new i.Buf16(2*v+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=p,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:S,e.adler=2===t.wrap?0:1,t.last_flush=u,o._tr_init(t),c):U(e,f)}function V(e){var t=W(e);return t===c&&function(e){e.window_size=2*e.w_size,Q(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=x-1,e.match_available=0,e.ins_h=0}(e.state),t}function G(e,t,n,r,o,a){if(!e)return f;var s=1;if(t===h&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),o<1||m<o||n!==g||r<8||15<r||t<0||9<t||a<0||d<a)return U(e,f);8===r&&(r=9);var A=new K;return(e.state=A).strm=e,A.wrap=s,A.gzhead=null,A.w_bits=r,A.w_size=1<<A.w_bits,A.w_mask=A.w_size-1,A.hash_bits=o+7,A.hash_size=1<<A.hash_bits,A.hash_mask=A.hash_size-1,A.hash_shift=~~((A.hash_bits+x-1)/x),A.window=new i.Buf8(2*A.w_size),A.head=new i.Buf16(A.hash_size),A.prev=new i.Buf16(A.w_size),A.lit_bufsize=1<<o+6,A.pending_buf_size=4*A.lit_bufsize,A.pending_buf=new i.Buf8(A.pending_buf_size),A.d_buf=1*A.lit_bufsize,A.l_buf=3*A.lit_bufsize,A.level=t,A.strategy=a,A.method=n,V(e)}r=[new z(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(M(e),0===e.lookahead&&t===u)return k;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,R(e,!1),0===e.strm.avail_out))return k;if(e.strstart-e.block_start>=e.w_size-F&&(R(e,!1),0===e.strm.avail_out))return k}return e.insert=0,t===l?(R(e,!0),0===e.strm.avail_out?I:N):(e.strstart>e.block_start&&(R(e,!1),e.strm.avail_out),k)}),new z(4,4,8,4,H),new z(4,5,16,8,H),new z(4,6,32,32,H),new z(4,4,16,16,j),new z(8,16,32,32,j),new z(8,16,128,128,j),new z(8,32,128,256,j),new z(32,128,258,1024,j),new z(32,258,258,4096,j)],n.deflateInit=function(e,t){return G(e,t,g,15,8,0)},n.deflateInit2=G,n.deflateReset=V,n.deflateResetKeep=W,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?f:(e.state.gzhead=t,c):f},n.deflate=function(e,t){var n,i,a,A;if(!e||!e.state||5<t||t<0)return e?U(e,f):f;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==l)return U(e,0===e.avail_out?-5:f);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,T(i,31),T(i,139),T(i,8),i.gzhead?(T(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),T(i,255&i.gzhead.time),T(i,i.gzhead.time>>8&255),T(i,i.gzhead.time>>16&255),T(i,i.gzhead.time>>24&255),T(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),T(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(T(i,255&i.gzhead.extra.length),T(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(T(i,0),T(i,0),T(i,0),T(i,0),T(i,0),T(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),T(i,3),i.status=S);else{var h=g+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=S,P(i,h),0!==i.strstart&&(P(i,e.adler>>>16),P(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending!==i.pending_buf_size));)T(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){A=1;break}A=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,T(i,A)}while(0!==A);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===A&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){A=1;break}A=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,T(i,A)}while(0!==A);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===A&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&D(e),i.pending+2<=i.pending_buf_size&&(T(i,255&e.adler),T(i,e.adler>>8&255),e.adler=0,i.status=S)):i.status=S),0!==i.pending){if(D(e),0===e.avail_out)return i.last_flush=-1,c}else if(0===e.avail_in&&L(t)<=L(n)&&t!==l)return U(e,-5);if(666===i.status&&0!==e.avail_in)return U(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==u&&666!==i.status){var d=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(M(e),0===e.lookahead)){if(t===u)return k;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(R(e,!1),0===e.strm.avail_out))return k}return e.insert=0,t===l?(R(e,!0),0===e.strm.avail_out?I:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?k:_}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=C){if(M(e),e.lookahead<=C&&t===u)return k;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+C;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=C-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(n=o._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(R(e,!1),0===e.strm.avail_out))return k}return e.insert=0,t===l?(R(e,!0),0===e.strm.avail_out?I:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?k:_}(i,t):r[i.level].func(i,t);if(d!==I&&d!==N||(i.status=666),d===k||d===I)return 0===e.avail_out&&(i.last_flush=-1),c;if(d===_&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),D(e),0===e.avail_out))return i.last_flush=-1,c}return t!==l?c:i.wrap<=0?1:(2===i.wrap?(T(i,255&e.adler),T(i,e.adler>>8&255),T(i,e.adler>>16&255),T(i,e.adler>>24&255),T(i,255&e.total_in),T(i,e.total_in>>8&255),T(i,e.total_in>>16&255),T(i,e.total_in>>24&255)):(P(i,e.adler>>>16),P(i,65535&e.adler)),D(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?c:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&103!==t&&t!==S&&666!==t?U(e,f):(e.state=null,t===S?U(e,-3):c):f},n.deflateSetDictionary=function(e,t){var n,r,o,s,A,u,l,h,d=t.length;if(!e||!e.state)return f;if(2===(s=(n=e.state).wrap)||1===s&&n.status!==E||n.lookahead)return f;for(1===s&&(e.adler=a(e.adler,t,d,0)),n.wrap=0,d>=n.w_size&&(0===s&&(Q(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new i.Buf8(n.w_size),i.arraySet(h,t,d-n.w_size,n.w_size,0),t=h,d=n.w_size),A=e.avail_in,u=e.next_in,l=e.input,e.avail_in=d,e.next_in=0,e.input=t,M(n);n.lookahead>=x;){for(r=n.strstart,o=n.lookahead-(x-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+x-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--o;);n.strstart=r,n.lookahead=x-1,M(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=x-1,n.match_available=0,e.next_in=u,e.input=l,e.avail_in=A,n.wrap=s,c},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){"use strict";t.exports=function(e,t){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E;n=e.state,r=e.next_in,F=e.input,i=r+(e.avail_in-5),o=e.next_out,E=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),A=n.dmax,u=n.wsize,l=n.whave,c=n.wnext,f=n.window,h=n.hold,d=n.bits,p=n.lencode,g=n.distcode,m=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{d<15&&(h+=F[r++]<<d,d+=8,h+=F[r++]<<d,d+=8),w=p[h&m];t:for(;;){if(h>>>=y=w>>>24,d-=y,0===(y=w>>>16&255))E[o++]=65535&w;else{if(!(16&y)){if(0==(64&y)){w=p[(65535&w)+(h&(1<<y)-1)];continue t}if(32&y){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}b=65535&w,(y&=15)&&(d<y&&(h+=F[r++]<<d,d+=8),b+=h&(1<<y)-1,h>>>=y,d-=y),d<15&&(h+=F[r++]<<d,d+=8,h+=F[r++]<<d,d+=8),w=g[h&v];n:for(;;){if(h>>>=y=w>>>24,d-=y,!(16&(y=w>>>16&255))){if(0==(64&y)){w=g[(65535&w)+(h&(1<<y)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(B=65535&w,d<(y&=15)&&(h+=F[r++]<<d,(d+=8)<y&&(h+=F[r++]<<d,d+=8)),A<(B+=h&(1<<y)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(h>>>=y,d-=y,(y=o-a)<B){if(l<(y=B-y)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(C=f,(x=0)===c){if(x+=u-y,y<b){for(b-=y;E[o++]=f[x++],--y;);x=o-B,C=E}}else if(c<y){if(x+=u+c-y,(y-=c)<b){for(b-=y;E[o++]=f[x++],--y;);if(x=0,c<b){for(b-=y=c;E[o++]=f[x++],--y;);x=o-B,C=E}}}else if(x+=c-y,y<b){for(b-=y;E[o++]=f[x++],--y;);x=o-B,C=E}for(;2<b;)E[o++]=C[x++],E[o++]=C[x++],E[o++]=C[x++],b-=3;b&&(E[o++]=C[x++],1<b&&(E[o++]=C[x++]))}else{for(x=o-B;E[o++]=E[x++],E[o++]=E[x++],E[o++]=E[x++],2<(b-=3););b&&(E[o++]=E[x++],1<b&&(E[o++]=E[x++]))}break}}break}}while(r<i&&o<s);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=h,n.bits=d}},{}],49:[function(e,t,n){"use strict";var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),A=1,u=2,l=0,c=-2,f=1,h=852,d=592;function p(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(h),t.distcode=t.distdyn=new r.Buf32(d),t.sane=1,t.back=-1,l):c}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,m(e)):c}function w(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?c:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):c}function y(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=w(e,t))!==l&&(e.state=null),n):c}var b,B,x=!0;function C(e){if(x){var t;for(b=new r.Buf32(512),B=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(A,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(u,e.lens,0,32,B,0,e.work,{bits:5}),x=!1}e.lencode=b,e.lenbits=9,e.distcode=B,e.distbits=5}function F(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=v,n.inflateReset2=w,n.inflateResetKeep=m,n.inflateInit=function(e){return y(e,15)},n.inflateInit2=y,n.inflate=function(e,t){var n,h,d,g,m,v,w,y,b,B,x,E,S,k,_,I,N,U,L,Q,D,R,T,P,O=0,M=new r.Buf8(4),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;12===(n=e.state).mode&&(n.mode=13),m=e.next_out,d=e.output,w=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,y=n.hold,b=n.bits,B=v,x=w,R=l;e:for(;;)switch(n.mode){case f:if(0===n.wrap){n.mode=13;break}for(;b<16;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(2&n.wrap&&35615===y){M[n.check=0]=255&y,M[1]=y>>>8&255,n.check=o(n.check,M,2,0),b=y=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&y)){e.msg="unknown compression method",n.mode=30;break}if(b-=4,D=8+(15&(y>>>=4)),0===n.wbits)n.wbits=D;else if(D>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<D,e.adler=n.check=1,n.mode=512&y?10:12,b=y=0;break;case 2:for(;b<16;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(n.flags=y,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=y>>8&1),512&n.flags&&(M[0]=255&y,M[1]=y>>>8&255,n.check=o(n.check,M,2,0)),b=y=0,n.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.head&&(n.head.time=y),512&n.flags&&(M[0]=255&y,M[1]=y>>>8&255,M[2]=y>>>16&255,M[3]=y>>>24&255,n.check=o(n.check,M,4,0)),b=y=0,n.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.head&&(n.head.xflags=255&y,n.head.os=y>>8),512&n.flags&&(M[0]=255&y,M[1]=y>>>8&255,n.check=o(n.check,M,2,0)),b=y=0,n.mode=5;case 5:if(1024&n.flags){for(;b<16;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.length=y,n.head&&(n.head.extra_len=y),512&n.flags&&(M[0]=255&y,M[1]=y>>>8&255,n.check=o(n.check,M,2,0)),b=y=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(D=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,h,g,E,D)),512&n.flags&&(n.check=o(n.check,h,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===v)break e;for(E=0;D=h[g+E++],n.head&&D&&n.length<65536&&(n.head.name+=String.fromCharCode(D)),D&&E<v;);if(512&n.flags&&(n.check=o(n.check,h,E,g)),v-=E,g+=E,D)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===v)break e;for(E=0;D=h[g+E++],n.head&&D&&n.length<65536&&(n.head.comment+=String.fromCharCode(D)),D&&E<v;);if(512&n.flags&&(n.check=o(n.check,h,E,g)),v-=E,g+=E,D)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;b<16;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(y!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}b=y=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;b<32;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}e.adler=n.check=p(y),b=y=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=m,e.avail_out=w,e.next_in=g,e.avail_in=v,n.hold=y,n.bits=b,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){y>>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}switch(n.last=1&y,b-=1,3&(y>>>=1)){case 0:n.mode=14;break;case 1:if(C(n),n.mode=20,6!==t)break;y>>>=2,b-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&y,b=y=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v<E&&(E=v),w<E&&(E=w),0===E)break e;r.arraySet(d,h,g,E,m),v-=E,g+=E,w-=E,m+=E,n.length-=E;break}n.mode=12;break;case 17:for(;b<14;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(n.nlen=257+(31&y),y>>>=5,b-=5,n.ndist=1+(31&y),y>>>=5,b-=5,n.ncode=4+(15&y),y>>>=4,b-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;b<3;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.lens[H[n.have++]]=7&y,y>>>=3,b-=3}for(;n.have<19;)n.lens[H[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},R=s(0,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,R){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;I=(O=n.lencode[y&(1<<n.lenbits)-1])>>>16&255,N=65535&O,!((_=O>>>24)<=b);){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(N<16)y>>>=_,b-=_,n.lens[n.have++]=N;else{if(16===N){for(P=_+2;b<P;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(y>>>=_,b-=_,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}D=n.lens[n.have-1],E=3+(3&y),y>>>=2,b-=2}else if(17===N){for(P=_+3;b<P;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}b-=_,D=0,E=3+(7&(y>>>=_)),y>>>=3,b-=3}else{for(P=_+7;b<P;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}b-=_,D=0,E=11+(127&(y>>>=_)),y>>>=7,b-=7}if(n.have+E>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;E--;)n.lens[n.have++]=D}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,T={bits:n.lenbits},R=s(A,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,R){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},R=s(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,R){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=w){e.next_out=m,e.avail_out=w,e.next_in=g,e.avail_in=v,n.hold=y,n.bits=b,a(e,x),m=e.next_out,d=e.output,w=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,y=n.hold,b=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;I=(O=n.lencode[y&(1<<n.lenbits)-1])>>>16&255,N=65535&O,!((_=O>>>24)<=b);){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(I&&0==(240&I)){for(U=_,L=I,Q=N;I=(O=n.lencode[Q+((y&(1<<U+L)-1)>>U)])>>>16&255,N=65535&O,!(U+(_=O>>>24)<=b);){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}y>>>=U,b-=U,n.back+=U}if(y>>>=_,b-=_,n.back+=_,n.length=N,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(P=n.extra;b<P;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.length+=y&(1<<n.extra)-1,y>>>=n.extra,b-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;I=(O=n.distcode[y&(1<<n.distbits)-1])>>>16&255,N=65535&O,!((_=O>>>24)<=b);){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(0==(240&I)){for(U=_,L=I,Q=N;I=(O=n.distcode[Q+((y&(1<<U+L)-1)>>U)])>>>16&255,N=65535&O,!(U+(_=O>>>24)<=b);){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}y>>>=U,b-=U,n.back+=U}if(y>>>=_,b-=_,n.back+=_,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=N,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(P=n.extra;b<P;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}n.offset+=y&(1<<n.extra)-1,y>>>=n.extra,b-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===w)break e;if(E=x-w,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}S=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),k=n.window}else k=d,S=m-n.offset,E=n.length;for(w<E&&(E=w),w-=E,n.length-=E;d[m++]=k[S++],--E;);0===n.length&&(n.mode=21);break;case 26:if(0===w)break e;d[m++]=n.length,w--,n.mode=21;break;case 27:if(n.wrap){for(;b<32;){if(0===v)break e;v--,y|=h[g++]<<b,b+=8}if(x-=w,e.total_out+=x,n.total+=x,x&&(e.adler=n.check=n.flags?o(n.check,d,x,m-x):i(n.check,d,x,m-x)),x=w,(n.flags?y:p(y))!==n.check){e.msg="incorrect data check",n.mode=30;break}b=y=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;b<32;){if(0===v)break e;v--,y+=h[g++]<<b,b+=8}if(y!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}b=y=0}n.mode=29;case 29:R=1;break e;case 30:R=-3;break e;case 31:return-4;default:return c}return e.next_out=m,e.avail_out=w,e.next_in=g,e.avail_in=v,n.hold=y,n.bits=b,(n.wsize||x!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&F(e,e.output,e.next_out,x-e.avail_out)?(n.mode=31,-4):(B-=e.avail_in,x-=e.avail_out,e.total_in+=B,e.total_out+=x,n.total+=x,n.wrap&&x&&(e.adler=n.check=n.flags?o(n.check,d,x,e.next_out-x):i(n.check,d,x,e.next_out-x)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==B&&0===x||4===t)&&R===l&&(R=-5),R)},n.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,l},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?c:((n.head=t).done=!1,l):c},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?c:11===n.mode&&i(1,t,r,0)!==n.check?-3:F(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,l):c},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){"use strict";var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,A,u,l,c,f){var h,d,p,g,m,v,w,y,b,B=f.bits,x=0,C=0,F=0,E=0,S=0,k=0,_=0,I=0,N=0,U=0,L=null,Q=0,D=new r.Buf16(16),R=new r.Buf16(16),T=null,P=0;for(x=0;x<=15;x++)D[x]=0;for(C=0;C<A;C++)D[t[n+C]]++;for(S=B,E=15;1<=E&&0===D[E];E--);if(E<S&&(S=E),0===E)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(F=1;F<E&&0===D[F];F++);for(S<F&&(S=F),x=I=1;x<=15;x++)if(I<<=1,(I-=D[x])<0)return-1;if(0<I&&(0===e||1!==E))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+D[x];for(C=0;C<A;C++)0!==t[n+C]&&(c[R[t[n+C]]++]=C);if(v=0===e?(L=T=c,19):1===e?(L=i,Q-=257,T=o,P-=257,256):(L=a,T=s,-1),x=F,m=l,_=C=U=0,p=-1,g=(N=1<<(k=S))-1,1===e&&852<N||2===e&&592<N)return 1;for(;;){for(w=x-_,b=c[C]<v?(y=0,c[C]):c[C]>v?(y=T[P+c[C]],L[Q+c[C]]):(y=96,0),h=1<<x-_,F=d=1<<k;u[m+(U>>_)+(d-=h)]=w<<24|y<<16|b,0!==d;);for(h=1<<x-1;U&h;)h>>=1;if(0!==h?(U&=h-1,U+=h):U=0,C++,0==--D[x]){if(x===E)break;x=t[n+c[C]]}if(S<x&&(U&g)!==p){for(0===_&&(_=S),m+=F,I=1<<(k=x-_);k+_<E&&!((I-=D[k+_])<=0);)k++,I<<=1;if(N+=1<<k,1===e&&852<N||2===e&&592<N)return 1;u[p=U&g]=S<<24|k<<16|m-l}}return 0!==U&&(u[m+U]=x-_<<24|64<<16),f.bits=S,0}},{"../utils/common":41}],51:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";var r=e("../utils/common"),i=0,o=1;function a(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,A=29,u=256,l=u+1+A,c=30,f=19,h=2*l+1,d=15,p=16,g=7,m=256,v=16,w=17,y=18,b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],B=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(l+2));a(F);var E=new Array(2*c);a(E);var S=new Array(512);a(S);var k=new Array(256);a(k);var _=new Array(A);a(_);var I,N,U,L=new Array(c);function Q(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function R(e){return e<256?S[e]:S[256+(e>>>7)]}function T(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,n){e.bi_valid>p-n?(e.bi_buf|=t<<e.bi_valid&65535,T(e,e.bi_buf),e.bi_buf=t>>p-e.bi_valid,e.bi_valid+=n-p):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function O(e,t,n){P(e,n[2*t],n[2*t+1])}function M(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function H(e,t,n){var r,i,o=new Array(d+1),a=0;for(r=1;r<=d;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=M(o[s]++,s))}}function j(e){var t;for(t=0;t<l;t++)e.dyn_ltree[2*t]=0;for(t=0;t<c;t++)e.dyn_dtree[2*t]=0;for(t=0;t<f;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*m]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function z(e){8<e.bi_valid?T(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function K(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function W(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&K(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!K(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function V(e,t,n){var r,i,o,a,s=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?O(e,i,t):(O(e,(o=k[i])+u+1,t),0!==(a=b[o])&&P(e,i-=_[o],a),O(e,o=R(--r),n),0!==(a=B[o])&&P(e,r-=L[o],a)),s<e.last_lit;);O(e,m,t)}function G(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,A=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=h,n=0;n<A;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)W(e,o,n);for(i=A;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],W(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,W(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,A=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,c=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,g=t.stat_desc.max_length,m=0;for(o=0;o<=d;o++)e.bl_count[o]=0;for(A[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<h;n++)g<(o=A[2*A[2*(r=e.heap[n])+1]+1]+1)&&(o=g,m++),A[2*r+1]=o,u<r||(e.bl_count[o]++,a=0,p<=r&&(a=f[r-p]),s=A[2*r],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(l[2*r+1]+a)));if(0!==m){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,m-=2}while(0<m);for(o=g;0!==o;o--)for(r=e.bl_count[o];0!==r;)u<(i=e.heap[--n])||(A[2*i+1]!==o&&(e.opt_len+=(o-A[2*i+1])*A[2*i],A[2*i+1]=o),r--)}}(e,t),H(o,u,e.bl_count)}function q(e,t,n){var r,i,o=-1,a=t[1],s=0,A=7,u=4;for(0===a&&(A=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<A&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*v]++):s<=10?e.bl_tree[2*w]++:e.bl_tree[2*y]++,o=i,u=(s=0)===a?(A=138,3):i===a?(A=6,3):(A=7,4))}function X(e,t,n){var r,i,o=-1,a=t[1],s=0,A=7,u=4;for(0===a&&(A=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<A&&i===a)){if(s<u)for(;O(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(O(e,i,e.bl_tree),s--),O(e,v,e.bl_tree),P(e,s-3,2)):s<=10?(O(e,w,e.bl_tree),P(e,s-3,3)):(O(e,y,e.bl_tree),P(e,s-11,7));o=i,u=(s=0)===a?(A=138,3):i===a?(A=6,3):(A=7,4)}}a(L);var Y=!1;function J(e,t,n,i){P(e,(s<<1)+(i?1:0),3),function(e,t,n,i){z(e),i&&(T(e,n),T(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){Y||(function(){var e,t,n,r,i,o=new Array(d+1);for(r=n=0;r<A-1;r++)for(_[r]=n,e=0;e<1<<b[r];e++)k[n++]=r;for(k[n-1]=r,r=i=0;r<16;r++)for(L[r]=i,e=0;e<1<<B[r];e++)S[i++]=r;for(i>>=7;r<c;r++)for(L[r]=i<<7,e=0;e<1<<B[r]-7;e++)S[256+i++]=r;for(t=0;t<=d;t++)o[t]=0;for(e=0;e<=143;)F[2*e+1]=8,e++,o[8]++;for(;e<=255;)F[2*e+1]=9,e++,o[9]++;for(;e<=279;)F[2*e+1]=7,e++,o[7]++;for(;e<=287;)F[2*e+1]=8,e++,o[8]++;for(H(F,l+1,o),e=0;e<c;e++)E[2*e+1]=5,E[2*e]=M(e,5);I=new Q(F,b,u+1,l,d),N=new Q(E,B,0,c,d),U=new Q(new Array(0),x,0,f,g)}(),Y=!0),e.l_desc=new D(e.dyn_ltree,I),e.d_desc=new D(e.dyn_dtree,N),e.bl_desc=new D(e.bl_tree,U),e.bi_buf=0,e.bi_valid=0,j(e)},n._tr_stored_block=J,n._tr_flush_block=function(e,t,n,r){var a,s,A=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<u;t++)if(0!==e.dyn_ltree[2*t])return o;return i}(e)),G(e,e.l_desc),G(e,e.d_desc),A=function(e){var t;for(q(e,e.dyn_ltree,e.l_desc.max_code),q(e,e.dyn_dtree,e.d_desc.max_code),G(e,e.bl_desc),t=f-1;3<=t&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=n+5,n+4<=a&&-1!==t?J(e,t,n,r):4===e.strategy||s===a?(P(e,2+(r?1:0),3),V(e,F,E)):(P(e,4+(r?1:0),3),function(e,t,n,r){var i;for(P(e,t-257,5),P(e,n-1,5),P(e,r-4,4),i=0;i<r;i++)P(e,e.bl_tree[2*C[i]+1],3);X(e,e.dyn_ltree,t-1),X(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,A+1),V(e,e.dyn_ltree,e.dyn_dtree)),j(e),r&&z(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(k[n]+u+1)]++,e.dyn_dtree[2*R(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){P(e,2,3),O(e,m,F),function(e){16===e.bi_valid?(T(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var n,r,i,o,a=1,s={},A=!1,u=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",h,!1):e.attachEvent("onmessage",h),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return s[a]=i,n(a),a++},l.clearImmediate=c}function c(e){delete s[e]}function f(e){if(A)setTimeout(f,0,e);else{var n=s[e];if(n){A=!0;try{!function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}}(n)}finally{c(e),A=!1}}}}function h(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&f(+t.data.slice(o.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},6672:(e,t,n)=>{"use strict";var r=n(5043);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var a={d:{f:o,r:function(){throw Error(i(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},s=Symbol.for("react.portal");var A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(i(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=A.T,n=a.p;try{if(A.T=null,a.p=2,e)return e()}finally{A.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,a.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&a.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var n=t.as,r=u(n,t.crossOrigin),i="string"===typeof t.integrity?t.integrity:void 0,o="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?a.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):"script"===n&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=u(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&a.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var n=t.as,r=u(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var n=u(t.as,t.crossOrigin);a.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return A.H.useFormState(e,t,n)},t.useFormStatus=function(){return A.H.useHostTransitionStatus()},t.version="19.1.1"},7004:(e,t,n)=>{"use strict";var r=n(8853),i=n(5043),o=n(7950);function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function A(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function u(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function l(e){if(A(e)!==e)throw Error(a(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),d=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),y=Symbol.for("react.consumer"),b=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),E=Symbol.for("react.lazy");Symbol.for("react.scope");var S=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var k=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var _=Symbol.iterator;function I(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=_&&e[_]||e["@@iterator"])?e:null}var N=Symbol.for("react.client.reference");function U(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===N?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case g:return"Fragment";case v:return"Profiler";case m:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList";case S:return"Activity"}if("object"===typeof e)switch(e.$$typeof){case p:return"Portal";case b:return(e.displayName||"Context")+".Provider";case y:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case F:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return U(e(t))}catch(n){}}return null}var L=Array.isArray,Q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},T=[],P=-1;function O(e){return{current:e}}function M(e){0>P||(e.current=T[P],T[P]=null,P--)}function H(e,t){P++,T[P]=e.current,e.current=t}var j=O(null),z=O(null),K=O(null),W=O(null);function V(e,t){switch(H(K,t),H(z,e),H(j,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ic(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=oc(t=ic(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(j),H(j,e)}function G(){M(j),M(z),M(K)}function q(e){null!==e.memoizedState&&H(W,e);var t=j.current,n=oc(t,e.type);t!==n&&(H(z,e),H(j,n))}function X(e){z.current===e&&(M(j),M(z)),W.current===e&&(M(W),qc._currentValue=R)}var Y=Object.prototype.hasOwnProperty,J=r.unstable_scheduleCallback,Z=r.unstable_cancelCallback,$=r.unstable_shouldYield,ee=r.unstable_requestPaint,te=r.unstable_now,ne=r.unstable_getCurrentPriorityLevel,re=r.unstable_ImmediatePriority,ie=r.unstable_UserBlockingPriority,oe=r.unstable_NormalPriority,ae=r.unstable_LowPriority,se=r.unstable_IdlePriority,Ae=r.log,ue=r.unstable_setDisableYieldValue,le=null,ce=null;function fe(e){if("function"===typeof Ae&&ue(e),ce&&"function"===typeof ce.setStrictMode)try{ce.setStrictMode(le,e)}catch(t){}}var he=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(de(e)/pe|0)|0},de=Math.log,pe=Math.LN2;var ge=256,me=4194304;function ve(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function we(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,o=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~o)?i=ve(r):0!==(a&=s)?i=ve(a):n||0!==(n=s&~e)&&(i=ve(n)):0!==(s=r&~o)?i=ve(s):0!==a?i=ve(a):n||0!==(n=r&~e)&&(i=ve(n)),0===i?0:0!==t&&t!==i&&0===(t&o)&&((o=i&-i)>=(n=t&-t)||32===o&&0!==(4194048&n))?t:i}function ye(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function be(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Be(){var e=ge;return 0===(4194048&(ge<<=1))&&(ge=256),e}function xe(){var e=me;return 0===(62914560&(me<<=1))&&(me=4194304),e}function Ce(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fe(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ee(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-he(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194090&n}function Se(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-he(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ke(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _e(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function Ie(){var e=D.p;return 0!==e?e:void 0===(e=window.event)?32:lf(e.type)}var Ne=Math.random().toString(36).slice(2),Ue="__reactFiber$"+Ne,Le="__reactProps$"+Ne,Qe="__reactContainer$"+Ne,De="__reactEvents$"+Ne,Re="__reactListeners$"+Ne,Te="__reactHandles$"+Ne,Pe="__reactResources$"+Ne,Oe="__reactMarker$"+Ne;function Me(e){delete e[Ue],delete e[Le],delete e[De],delete e[Re],delete e[Te]}function He(e){var t=e[Ue];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qe]||n[Ue]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=wc(e);null!==e;){if(n=e[Ue])return n;e=wc(e)}return t}n=(e=n).parentNode}return null}function je(e){if(e=e[Ue]||e[Qe]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function ze(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(a(33))}function Ke(e){var t=e[Pe];return t||(t=e[Pe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[Oe]=!0}var Ve=new Set,Ge={};function qe(e,t){Xe(e,t),Xe(e+"Capture",t)}function Xe(e,t){for(Ge[e]=t,e=0;e<t.length;e++)Ve.add(t[e])}var Ye,Je,Ze=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$e={},et={};function tt(e,t,n){if(i=t,Y.call(et,i)||!Y.call($e,i)&&(Ze.test(i)?et[i]=!0:($e[i]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var i}function nt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function rt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function it(e){if(void 0===Ye)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ye=t&&t[1]||"",Je=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+Ye+e+Je}var ot=!1;function at(e,t){if(!e||ot)return"";ot=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(i){var r=i}Reflect.construct(e,[],n)}else{try{n.call()}catch(o){r=o}e.call(n.prototype)}}else{try{throw Error()}catch(a){r=a}(n=e())&&"function"===typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"===typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var A=a.split("\n"),u=s.split("\n");for(i=r=0;r<A.length&&!A[r].includes("DetermineComponentFrameRoot");)r++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(r===A.length||i===u.length)for(r=A.length-1,i=u.length-1;1<=r&&0<=i&&A[r]!==u[i];)i--;for(;1<=r&&0<=i;r--,i--)if(A[r]!==u[i]){if(1!==r||1!==i)do{if(r--,0>--i||A[r]!==u[i]){var l="\n"+A[r].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=r&&0<=i);break}}}finally{ot=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?it(n):""}function st(e){switch(e.tag){case 26:case 27:case 5:return it(e.type);case 16:return it("Lazy");case 13:return it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return it("Activity");default:return""}}function At(e){try{var t="";do{t+=st(e),e=e.return}while(e);return t}catch(n){return"\nError generating stack: "+n.message+"\n"+n.stack}}function ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ct(e){e._valueTracker||(e._valueTracker=function(e){var t=lt(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lt(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ht(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var dt=/[\n"\\]/g;function pt(e){return e.replace(dt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gt(e,t,n,r,i,o,a,s){e.name="",null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ut(t)):e.value!==""+ut(t)&&(e.value=""+ut(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?vt(e,a,ut(t)):null!=n?vt(e,a,ut(n)):null!=r&&e.removeAttribute("value"),null==i&&null!=o&&(e.defaultChecked=!!o),null!=i&&(e.checked=i&&"function"!==typeof i&&"symbol"!==typeof i),null!=s&&"function"!==typeof s&&"symbol"!==typeof s&&"boolean"!==typeof s?e.name=""+ut(s):e.removeAttribute("name")}function mt(e,t,n,r,i,o,a,s){if(null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o&&(e.type=o),null!=t||null!=n){if(!("submit"!==o&&"reset"!==o||void 0!==t&&null!==t))return;n=null!=n?""+ut(n):"",t=null!=t?""+ut(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!==typeof(r=null!=r?r:i)&&"symbol"!==typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(e.name=a)}function vt(e,t,n){"number"===t&&ht(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ut(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function yt(e,t,n){null==t||((t=""+ut(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+ut(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function bt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(a(92));if(L(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=ut(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var xt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ct(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"===typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!==typeof n||0===n||xt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ft(e,t,n){if(null!=t&&"object"!==typeof t)throw Error(a(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Ct(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Ct(e,o,t[o])}function Et(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var St=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _t(e){return kt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var It=null;function Nt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ut=null,Lt=null;function Qt(e){var t=je(e);if(t&&(e=t.stateNode)){var n=e[Le]||null;e:switch(e=t.stateNode,t.type){case"input":if(gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+pt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Le]||null;if(!i)throw Error(a(90));gt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&ft(r)}break e;case"textarea":yt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&wt(e,!!n.multiple,t,!1)}}}var Dt=!1;function Rt(e,t,n){if(Dt)return e(t,n);Dt=!0;try{return e(t)}finally{if(Dt=!1,(null!==Ut||null!==Lt)&&(Hu(),Ut&&(t=Ut,e=Lt,Lt=Ut=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function Tt(e,t){var n=e.stateNode;if(null===n)return null;var r=n[Le]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Pt=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Ot=!1;if(Pt)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){Ot=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch(Qf){Ot=!1}var Ht=null,jt=null,zt=null;function Kt(){if(zt)return zt;var e,t,n=jt,r=n.length,i="value"in Ht?Ht.value:Ht.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return zt=i.slice(e,1<t?1-t:void 0)}function Wt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Vt(){return!0}function Gt(){return!1}function qt(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Vt:Gt,this.isPropagationStopped=Gt,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Vt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Vt)},persist:function(){},isPersistent:Vt}),t}var Xt,Yt,Jt,Zt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$t=qt(Zt),en=f({},Zt,{view:0,detail:0}),tn=qt(en),nn=f({},en,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jt&&(Jt&&"mousemove"===e.type?(Xt=e.screenX-Jt.screenX,Yt=e.screenY-Jt.screenY):Yt=Xt=0,Jt=e),Xt)},movementY:function(e){return"movementY"in e?e.movementY:Yt}}),rn=qt(nn),on=qt(f({},nn,{dataTransfer:0})),an=qt(f({},en,{relatedTarget:0})),sn=qt(f({},Zt,{animationName:0,elapsedTime:0,pseudoElement:0})),An=qt(f({},Zt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),un=qt(f({},Zt,{data:0})),ln={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=fn[e])&&!!t[e]}function dn(){return hn}var pn=qt(f({},en,{key:function(e){if(e.key){var t=ln[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Wt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dn,charCode:function(e){return"keypress"===e.type?Wt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Wt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),gn=qt(f({},nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mn=qt(f({},en,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dn})),vn=qt(f({},Zt,{propertyName:0,elapsedTime:0,pseudoElement:0})),wn=qt(f({},nn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),yn=qt(f({},Zt,{newState:0,oldState:0})),bn=[9,13,27,32],Bn=Pt&&"CompositionEvent"in window,xn=null;Pt&&"documentMode"in document&&(xn=document.documentMode);var Cn=Pt&&"TextEvent"in window&&!xn,Fn=Pt&&(!Bn||xn&&8<xn&&11>=xn),En=String.fromCharCode(32),Sn=!1;function kn(e,t){switch(e){case"keyup":return-1!==bn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _n(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var In=!1;var Nn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Nn[e.type]:"textarea"===t}function Ln(e,t,n,r){Ut?Lt?Lt.push(r):Lt=[r]:Ut=r,0<(t=Kl(t,"onChange")).length&&(n=new $t("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qn=null,Dn=null;function Rn(e){Rl(e,0)}function Tn(e){if(ft(ze(e)))return e}function Pn(e,t){if("change"===e)return t}var On=!1;if(Pt){var Mn;if(Pt){var Hn="oninput"in document;if(!Hn){var jn=document.createElement("div");jn.setAttribute("oninput","return;"),Hn="function"===typeof jn.oninput}Mn=Hn}else Mn=!1;On=Mn&&(!document.documentMode||9<document.documentMode)}function zn(){Qn&&(Qn.detachEvent("onpropertychange",Kn),Dn=Qn=null)}function Kn(e){if("value"===e.propertyName&&Tn(Dn)){var t=[];Ln(t,Dn,e,Nt(e)),Rt(Rn,t)}}function Wn(e,t,n){"focusin"===e?(zn(),Dn=n,(Qn=t).attachEvent("onpropertychange",Kn)):"focusout"===e&&zn()}function Vn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Tn(Dn)}function Gn(e,t){if("click"===e)return Tn(t)}function qn(e,t){if("input"===e||"change"===e)return Tn(t)}var Xn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function Yn(e,t){if(Xn(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Y.call(t,i)||!Xn(e[i],t[i]))return!1}return!0}function Jn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zn(e,t){var n,r=Jn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function $n(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?$n(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function er(e){for(var t=ht((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=ht((e=t.contentWindow).document)}return t}function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nr=Pt&&"documentMode"in document&&11>=document.documentMode,rr=null,ir=null,or=null,ar=!1;function sr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ar||null==rr||rr!==ht(r)||("selectionStart"in(r=rr)&&tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},or&&Yn(or,r)||(or=r,0<(r=Kl(ir,"onSelect")).length&&(t=new $t("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ur={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionrun:Ar("Transition","TransitionRun"),transitionstart:Ar("Transition","TransitionStart"),transitioncancel:Ar("Transition","TransitionCancel"),transitionend:Ar("Transition","TransitionEnd")},lr={},cr={};function fr(e){if(lr[e])return lr[e];if(!ur[e])return e;var t,n=ur[e];for(t in n)if(n.hasOwnProperty(t)&&t in cr)return lr[e]=n[t];return e}Pt&&(cr=document.createElement("div").style,"AnimationEvent"in window||(delete ur.animationend.animation,delete ur.animationiteration.animation,delete ur.animationstart.animation),"TransitionEvent"in window||delete ur.transitionend.transition);var hr=fr("animationend"),dr=fr("animationiteration"),pr=fr("animationstart"),gr=fr("transitionrun"),mr=fr("transitionstart"),vr=fr("transitioncancel"),wr=fr("transitionend"),yr=new Map,br="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Br(e,t){yr.set(e,t),qe(t,[e])}br.push("scrollEnd");var xr=new WeakMap;function Cr(e,t){if("object"===typeof e&&null!==e){var n=xr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:At(t)},xr.set(e,t),t)}return{value:e,source:t,stack:At(t)}}var Fr=[],Er=0,Sr=0;function kr(){for(var e=Er,t=Sr=Er=0;t<e;){var n=Fr[t];Fr[t++]=null;var r=Fr[t];Fr[t++]=null;var i=Fr[t];Fr[t++]=null;var o=Fr[t];if(Fr[t++]=null,null!==r&&null!==i){var a=r.pending;null===a?i.next=i:(i.next=a.next,a.next=i),r.pending=i}0!==o&&Ur(n,i,o)}}function _r(e,t,n,r){Fr[Er++]=e,Fr[Er++]=t,Fr[Er++]=n,Fr[Er++]=r,Sr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Ir(e,t,n,r){return _r(e,t,n,r),Lr(e)}function Nr(e,t){return _r(e,null,null,t),Lr(e)}function Ur(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var i=!1,o=e.return;null!==o;)o.childLanes|=n,null!==(r=o.alternate)&&(r.childLanes|=n),22===o.tag&&(null===(e=o.stateNode)||1&e._visibility||(i=!0)),e=o,o=o.return;return 3===e.tag?(o=e.stateNode,i&&null!==t&&(i=31-he(n),null===(r=(e=o.hiddenUpdates)[i])?e[i]=[t]:r.push(t),t.lane=536870912|n),o):null}function Lr(e){if(50<Uu)throw Uu=0,Lu=null,Error(a(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Qr={};function Dr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rr(e,t,n,r){return new Dr(e,t,n,r)}function Tr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Pr(e,t){var n=e.alternate;return null===n?((n=Rr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Or(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mr(e,t,n,r,i,o){var s=0;if(r=e,"function"===typeof e)Tr(e)&&(s=1);else if("string"===typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,n,j.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case S:return(e=Rr(31,n,t,i)).elementType=S,e.lanes=o,e;case g:return Hr(n.children,i,o,t);case m:s=8,i|=24;break;case v:return(e=Rr(12,n,t,2|i)).elementType=v,e.lanes=o,e;case x:return(e=Rr(13,n,t,i)).elementType=x,e.lanes=o,e;case C:return(e=Rr(19,n,t,i)).elementType=C,e.lanes=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case w:case b:s=10;break e;case y:s=9;break e;case B:s=11;break e;case F:s=14;break e;case E:s=16,r=null;break e}s=29,n=Error(a(130,null===e?"null":typeof e,"")),r=null}return(t=Rr(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Hr(e,t,n,r){return(e=Rr(7,e,r,t)).lanes=n,e}function jr(e,t,n){return(e=Rr(6,e,null,t)).lanes=n,e}function zr(e,t,n){return(t=Rr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kr=[],Wr=0,Vr=null,Gr=0,qr=[],Xr=0,Yr=null,Jr=1,Zr="";function $r(e,t){Kr[Wr++]=Gr,Kr[Wr++]=Vr,Vr=e,Gr=t}function ei(e,t,n){qr[Xr++]=Jr,qr[Xr++]=Zr,qr[Xr++]=Yr,Yr=e;var r=Jr;e=Zr;var i=32-he(r)-1;r&=~(1<<i),n+=1;var o=32-he(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Jr=1<<32-he(t)+i|n<<i|r,Zr=o+e}else Jr=1<<o|n<<i|r,Zr=e}function ti(e){null!==e.return&&($r(e,1),ei(e,1,0))}function ni(e){for(;e===Vr;)Vr=Kr[--Wr],Kr[Wr]=null,Gr=Kr[--Wr],Kr[Wr]=null;for(;e===Yr;)Yr=qr[--Xr],qr[Xr]=null,Zr=qr[--Xr],qr[Xr]=null,Jr=qr[--Xr],qr[Xr]=null}var ri=null,ii=null,oi=!1,ai=null,si=!1,Ai=Error(a(519));function ui(e){throw pi(Cr(Error(a(418,"")),e)),Ai}function li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ue]=e,t[Le]=r,n){case"dialog":Tl("cancel",t),Tl("close",t);break;case"iframe":case"object":case"embed":Tl("load",t);break;case"video":case"audio":for(n=0;n<Ql.length;n++)Tl(Ql[n],t);break;case"source":Tl("error",t);break;case"img":case"image":case"link":Tl("error",t),Tl("load",t);break;case"details":Tl("toggle",t);break;case"input":Tl("invalid",t),mt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),ct(t);break;case"select":Tl("invalid",t);break;case"textarea":Tl("invalid",t),bt(t,r.value,r.defaultValue,r.children),ct(t)}"string"!==typeof(n=r.children)&&"number"!==typeof n&&"bigint"!==typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||Yl(t.textContent,n)?(null!=r.popover&&(Tl("beforetoggle",t),Tl("toggle",t)),null!=r.onScroll&&Tl("scroll",t),null!=r.onScrollEnd&&Tl("scrollend",t),null!=r.onClick&&(t.onclick=Jl),t=!0):t=!1,t||ui(e)}function ci(e){for(ri=e.return;ri;)switch(ri.tag){case 5:case 13:return void(si=!1);case 27:case 3:return void(si=!0);default:ri=ri.return}}function fi(e){if(e!==ri)return!1;if(!oi)return ci(e),oi=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||ac(e.type,e.memoizedProps)),t=!t),t&&ii&&ui(e),ci(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){ii=mc(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}ii=null}}else 27===n?(n=ii,hc(e.type)?(e=vc,vc=null,ii=e):ii=n):ii=ri?mc(e.stateNode.nextSibling):null;return!0}function hi(){ii=ri=null,oi=!1}function di(){var e=ai;return null!==e&&(null===wu?wu=e:wu.push.apply(wu,e),ai=null),e}function pi(e){null===ai?ai=[e]:ai.push(e)}var gi=O(null),mi=null,vi=null;function wi(e,t,n){H(gi,t._currentValue),t._currentValue=n}function yi(e){e._currentValue=gi.current,M(gi)}function bi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bi(e,t,n,r){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var o=i.dependencies;if(null!==o){var s=i.child;o=o.firstContext;e:for(;null!==o;){var A=o;o=i;for(var u=0;u<t.length;u++)if(A.context===t[u]){o.lanes|=n,null!==(A=o.alternate)&&(A.lanes|=n),bi(o.return,n,e),r||(s=null);break e}o=A.next}}else if(18===i.tag){if(null===(s=i.return))throw Error(a(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),bi(s,n,e),s=null}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===e){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}}function xi(e,t,n,r){e=null;for(var i=t,o=!1;null!==i;){if(!o)if(0!==(524288&i.flags))o=!0;else if(0!==(262144&i.flags))break;if(10===i.tag){var s=i.alternate;if(null===s)throw Error(a(387));if(null!==(s=s.memoizedProps)){var A=i.type;Xn(i.pendingProps.value,s.value)||(null!==e?e.push(A):e=[A])}}else if(i===W.current){if(null===(s=i.alternate))throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(qc):e=[qc])}i=i.return}null!==e&&Bi(t,e,n,r),t.flags|=262144}function Ci(e){for(e=e.firstContext;null!==e;){if(!Xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fi(e){mi=e,vi=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Ei(e){return ki(mi,e)}function Si(e,t){return null===mi&&Fi(e),ki(e,t)}function ki(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===vi){if(null===e)throw Error(a(308));vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vi=vi.next=t;return n}var _i="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ii=r.unstable_scheduleCallback,Ni=r.unstable_NormalPriority,Ui={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Li(){return{controller:new _i,data:new Map,refCount:0}}function Qi(e){e.refCount--,0===e.refCount&&Ii(Ni,function(){e.controller.abort()})}var Di=null,Ri=0,Ti=0,Pi=null;function Oi(){if(0===--Ri&&null!==Di){null!==Pi&&(Pi.status="fulfilled");var e=Di;Di=null,Ti=0,Pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Mi=Q.S;Q.S=function(e,t){"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===Di){var n=Di=[];Ri=0,Ti=_l(),Pi={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ri++,t.then(Oi,Oi)}(0,t),null!==Mi&&Mi(e,t)};var Hi=O(null);function ji(){var e=Hi.current;return null!==e?e:ru.pooledCache}function zi(e,t){H(Hi,null===t?Hi.current:t.pool)}function Ki(){var e=ji();return null===e?null:{parent:Ui._currentValue,pool:e}}var Wi=Error(a(460)),Vi=Error(a(474)),Gi=Error(a(542)),qi={then:function(){}};function Xi(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Yi(){}function Ji(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Yi,Yi),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw eo(e=t.reason),e;default:if("string"===typeof t.status)t.then(Yi,Yi);else{if(null!==(e=ru)&&100<e.shellSuspendCounter)throw Error(a(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw eo(e=t.reason),e}throw Zi=t,Wi}}var Zi=null;function $i(){if(null===Zi)throw Error(a(459));var e=Zi;return Zi=null,e}function eo(e){if(e===Wi||e===Gi)throw Error(a(483))}var to=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ro(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function io(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&nu)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Lr(e),Ur(e,null,n),t}return _r(e,r,t,n),Lr(e)}function ao(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194048&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Se(e,n)}}function so(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ao=!1;function uo(){if(Ao){if(null!==Pi)throw Pi}}function lo(e,t,n,r){Ao=!1;var i=e.updateQueue;to=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var A=s,u=A.next;A.next=null,null===a?o=u:a.next=u,a=A;var l=e.alternate;null!==l&&((s=(l=l.updateQueue).lastBaseUpdate)!==a&&(null===s?l.firstBaseUpdate=u:s.next=u,l.lastBaseUpdate=A))}if(null!==o){var c=i.baseState;for(a=0,l=u=A=null,s=o;;){var h=-536870913&s.lane,d=h!==s.lane;if(d?(ou&h)===h:(r&h)===h){0!==h&&h===Ti&&(Ao=!0),null!==l&&(l=l.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var p=e,g=s;h=t;var m=n;switch(g.tag){case 1:if("function"===typeof(p=g.payload)){c=p.call(m,c,h);break e}c=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(h="function"===typeof(p=g.payload)?p.call(m,c,h):p)||void 0===h)break e;c=f({},c,h);break e;case 2:to=!0}}null!==(h=s.callback)&&(e.flags|=64,d&&(e.flags|=8192),null===(d=i.callbacks)?i.callbacks=[h]:d.push(h))}else d={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===l?(u=l=d,A=c):l=l.next=d,a|=h;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(d=s).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}null===l&&(A=c),i.baseState=A,i.firstBaseUpdate=u,i.lastBaseUpdate=l,null===o&&(i.shared.lanes=0),hu|=a,e.lanes=a,e.memoizedState=c}}function co(e,t){if("function"!==typeof e)throw Error(a(191,e));e.call(t)}function fo(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)co(n[e],t)}var ho=O(null),po=O(0);function go(e,t){H(po,e=cu),H(ho,t),cu=e|t.baseLanes}function mo(){H(po,cu),H(ho,ho.current)}function vo(){cu=po.current,M(ho),M(po)}var wo=0,yo=null,bo=null,Bo=null,xo=!1,Co=!1,Fo=!1,Eo=0,So=0,ko=null,_o=0;function Io(){throw Error(a(321))}function No(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Xn(e[n],t[n]))return!1;return!0}function Uo(e,t,n,r,i,o){return wo=o,yo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Q.H=null===e||null===e.memoizedState?Va:Ga,Fo=!1,o=n(r,i),Fo=!1,Co&&(o=Qo(t,n,r,i)),Lo(e),o}function Lo(e){Q.H=Wa;var t=null!==bo&&null!==bo.next;if(wo=0,Bo=bo=yo=null,xo=!1,So=0,ko=null,t)throw Error(a(300));null===e||Ss||null!==(e=e.dependencies)&&Ci(e)&&(Ss=!0)}function Qo(e,t,n,r){yo=e;var i=0;do{if(Co&&(ko=null),So=0,Co=!1,25<=i)throw Error(a(301));if(i+=1,Bo=bo=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}Q.H=qa,o=t(n,r)}while(Co);return o}function Do(){var e=Q.H,t=e.useState()[0];return t="function"===typeof t.then?Ho(t):t,e=e.useState()[0],(null!==bo?bo.memoizedState:null)!==e&&(yo.flags|=1024),t}function Ro(){var e=0!==Eo;return Eo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Po(e){if(xo){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}xo=!1}wo=0,Bo=bo=yo=null,Co=!1,So=Eo=0,ko=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Bo?yo.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function Mo(){if(null===bo){var e=yo.alternate;e=null!==e?e.memoizedState:null}else e=bo.next;var t=null===Bo?yo.memoizedState:Bo.next;if(null!==t)Bo=t,bo=e;else{if(null===e){if(null===yo.alternate)throw Error(a(467));throw Error(a(310))}e={memoizedState:(bo=e).memoizedState,baseState:bo.baseState,baseQueue:bo.baseQueue,queue:bo.queue,next:null},null===Bo?yo.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function Ho(e){var t=So;return So+=1,null===ko&&(ko=[]),e=Ji(ko,e,t),t=yo,null===(null===Bo?t.memoizedState:Bo.next)&&(t=t.alternate,Q.H=null===t||null===t.memoizedState?Va:Ga),e}function jo(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return Ho(e);if(e.$$typeof===b)return Ei(e)}throw Error(a(438,String(e)))}function zo(e){var t=null,n=yo.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=yo.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},yo.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Ko(e,t){return"function"===typeof t?t(e):t}function Wo(e){return Vo(Mo(),bo,e)}function Vo(e,t,n){var r=e.queue;if(null===r)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,null===i)e.memoizedState=o;else{var A=s=null,u=null,l=t=i.next,c=!1;do{var f=-536870913&l.lane;if(f!==l.lane?(ou&f)===f:(wo&f)===f){var h=l.revertLane;if(0===h)null!==u&&(u=u.next={lane:0,revertLane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),f===Ti&&(c=!0);else{if((wo&h)===h){l=l.next,h===Ti&&(c=!0);continue}f={lane:0,revertLane:l.revertLane,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},null===u?(A=u=f,s=o):u=u.next=f,yo.lanes|=h,hu|=h}f=l.action,Fo&&n(o,f),o=l.hasEagerState?l.eagerState:n(o,f)}else h={lane:f,revertLane:l.revertLane,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null},null===u?(A=u=h,s=o):u=u.next=h,yo.lanes|=f,hu|=f;l=l.next}while(null!==l&&l!==t);if(null===u?s=o:u.next=A,!Xn(o,e.memoizedState)&&(Ss=!0,c&&null!==(n=Pi)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=u,r.lastRenderedState=o}return null===i&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Go(e){var t=Mo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);Xn(o,t.memoizedState)||(Ss=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function qo(e,t,n){var r=yo,i=Mo(),o=oi;if(o){if(void 0===n)throw Error(a(407));n=n()}else n=t();var s=!Xn((bo||i).memoizedState,n);if(s&&(i.memoizedState=n,Ss=!0),i=i.queue,ma(2048,8,Jo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||null!==Bo&&1&Bo.memoizedState.tag){if(r.flags|=2048,da(9,{destroy:void 0,resource:void 0},Yo.bind(null,r,i,n,t),null),null===ru)throw Error(a(349));o||0!==(124&wo)||Xo(r,t,n)}return n}function Xo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=yo.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},yo.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Yo(e,t,n,r){t.value=n,t.getSnapshot=r,Zo(t)&&$o(e)}function Jo(e,t,n){return n(function(){Zo(t)&&$o(e)})}function Zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xn(e,n)}catch(r){return!0}}function $o(e){var t=Nr(e,2);null!==t&&Ru(t,e,2)}function ea(e){var t=Oo();if("function"===typeof e){var n=e;if(e=n(),Fo){fe(!0);try{n()}finally{fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:e},t}function ta(e,t,n,r){return e.baseState=n,Vo(e,bo,"function"===typeof r?r:Ko)}function na(e,t,n,r,i){if(ja(e))throw Error(a(485));if(null!==(e=t.action)){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==Q.T?n(!0):o.isTransition=!1,r(o),null===(n=t.pending)?(o.next=t.pending=o,ra(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ra(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var o=Q.T,a={};Q.T=a;try{var s=n(i,r),A=Q.S;null!==A&&A(a,s),ia(e,t,s)}catch(u){aa(e,t,u)}finally{Q.T=o}}else try{ia(e,t,o=n(i,r))}catch(l){aa(e,t,l)}}function ia(e,t,n){null!==n&&"object"===typeof n&&"function"===typeof n.then?n.then(function(n){oa(e,t,n)},function(n){return aa(e,t,n)}):oa(e,t,n)}function oa(e,t,n){t.status="fulfilled",t.value=n,sa(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ra(e,n)))}function aa(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,sa(t),t=t.next}while(t!==r)}e.action=null}function sa(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Aa(e,t){return t}function ua(e,t){if(oi){var n=ru.formState;if(null!==n){e:{var r=yo;if(oi){if(ii){t:{for(var i=ii,o=si;8!==i.nodeType;){if(!o){i=null;break t}if(null===(i=mc(i.nextSibling))){i=null;break t}}i="F!"===(o=i.data)||"F"===o?i:null}if(i){ii=mc(i.nextSibling),r="F!"===i.data;break e}}ui(r)}r=!1}r&&(t=n[0])}}return(n=Oo()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:t},n.queue=r,n=Oa.bind(null,yo,r),r.dispatch=n,r=ea(!1),o=Ha.bind(null,yo,!1,r.queue),i={state:t,dispatch:null,action:e,pending:null},(r=Oo()).queue=i,n=na.bind(null,yo,i,o,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function la(e){return ca(Mo(),bo,e)}function ca(e,t,n){if(t=Vo(e,t,Aa)[0],e=Wo(Ko)[0],"object"===typeof t&&null!==t&&"function"===typeof t.then)try{var r=Ho(t)}catch(a){if(a===Wi)throw Gi;throw a}else r=t;var i=(t=Mo()).queue,o=i.dispatch;return n!==t.memoizedState&&(yo.flags|=2048,da(9,{destroy:void 0,resource:void 0},fa.bind(null,i,n),null)),[r,o,e]}function fa(e,t){e.action=t}function ha(e){var t=Mo(),n=bo;if(null!==n)return ca(t,n,e);Mo(),t=t.memoizedState;var r=(n=Mo()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function da(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=yo.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},yo.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function pa(){return Mo().memoizedState}function ga(e,t,n,r){var i=Oo();r=void 0===r?null:r,yo.flags|=e,i.memoizedState=da(1|t,{destroy:void 0,resource:void 0},n,r)}function ma(e,t,n,r){var i=Mo();r=void 0===r?null:r;var o=i.memoizedState.inst;null!==bo&&null!==r&&No(r,bo.memoizedState.deps)?i.memoizedState=da(t,o,n,r):(yo.flags|=e,i.memoizedState=da(1|t,o,n,r))}function va(e,t){ga(8390656,8,e,t)}function wa(e,t){ma(2048,8,e,t)}function ya(e,t){return ma(4,2,e,t)}function ba(e,t){return ma(4,4,e,t)}function Ba(e,t){if("function"===typeof t){e=e();var n=t(e);return function(){"function"===typeof n?n():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function xa(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,ma(4,4,Ba.bind(null,t,e),n)}function Ca(){}function Fa(e,t){var n=Mo();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&No(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ea(e,t){var n=Mo();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&No(t,r[1]))return r[0];if(r=e(),Fo){fe(!0);try{e()}finally{fe(!1)}}return n.memoizedState=[r,t],r}function Sa(e,t,n){return void 0===n||0!==(1073741824&wo)?e.memoizedState=t:(e.memoizedState=n,e=Du(),yo.lanes|=e,hu|=e,n)}function ka(e,t,n,r){return Xn(n,t)?n:null!==ho.current?(e=Sa(e,n,r),Xn(e,t)||(Ss=!0),e):0===(42&wo)?(Ss=!0,e.memoizedState=n):(e=Du(),yo.lanes|=e,hu|=e,t)}function _a(e,t,n,r,i){var o=D.p;D.p=0!==o&&8>o?o:8;var a=Q.T,s={};Q.T=s,Ha(e,!1,t,n);try{var A=i(),u=Q.S;if(null!==u&&u(s,A),null!==A&&"object"===typeof A&&"function"===typeof A.then)Ma(e,t,function(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status="rejected",r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}(A,r),Qu());else Ma(e,t,r,Qu())}catch(l){Ma(e,t,{then:function(){},status:"rejected",reason:l},Qu())}finally{D.p=o,Q.T=a}}function Ia(){}function Na(e,t,n,r){if(5!==e.tag)throw Error(a(476));var i=Ua(e).queue;_a(e,i,t,R,null===n?Ia:function(){return La(e),n(r)})}function Ua(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:R},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function La(e){Ma(e,Ua(e).next.queue,{},Qu())}function Qa(){return Ei(qc)}function Da(){return Mo().memoizedState}function Ra(){return Mo().memoizedState}function Ta(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Qu(),r=oo(t,e=io(n),n);return null!==r&&(Ru(r,t,n),ao(r,t,n)),t={cache:Li()},void(e.payload=t)}t=t.return}}function Pa(e,t,n){var r=Qu();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},ja(e)?za(t,n):null!==(n=Ir(e,t,n,r))&&(Ru(n,e,r),Ka(n,t,r))}function Oa(e,t,n){Ma(e,t,n,Qu())}function Ma(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(ja(e))za(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Xn(s,a))return _r(e,t,i,0),null===ru&&kr(),!1}catch(A){}if(null!==(n=Ir(e,t,i,r)))return Ru(n,e,r),Ka(n,t,r),!0}return!1}function Ha(e,t,n,r){if(r={lane:2,revertLane:_l(),action:r,hasEagerState:!1,eagerState:null,next:null},ja(e)){if(t)throw Error(a(479))}else null!==(t=Ir(e,n,r,2))&&Ru(t,e,2)}function ja(e){var t=e.alternate;return e===yo||null!==t&&t===yo}function za(e,t){Co=xo=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ka(e,t,n){if(0!==(4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Se(e,n)}}var Wa={readContext:Ei,use:jo,useCallback:Io,useContext:Io,useEffect:Io,useImperativeHandle:Io,useLayoutEffect:Io,useInsertionEffect:Io,useMemo:Io,useReducer:Io,useRef:Io,useState:Io,useDebugValue:Io,useDeferredValue:Io,useTransition:Io,useSyncExternalStore:Io,useId:Io,useHostTransitionStatus:Io,useFormState:Io,useActionState:Io,useOptimistic:Io,useMemoCache:Io,useCacheRefresh:Io},Va={readContext:Ei,use:jo,useCallback:function(e,t){return Oo().memoizedState=[e,void 0===t?null:t],e},useContext:Ei,useEffect:va,useImperativeHandle:function(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,ga(4194308,4,Ba.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ga(4194308,4,e,t)},useInsertionEffect:function(e,t){ga(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=void 0===t?null:t;var r=e();if(Fo){fe(!0);try{e()}finally{fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(void 0!==n){var i=n(t);if(Fo){fe(!0);try{n(t)}finally{fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Pa.bind(null,yo,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Oo().memoizedState=e},useState:function(e){var t=(e=ea(e)).queue,n=Oa.bind(null,yo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ca,useDeferredValue:function(e,t){return Sa(Oo(),e,t)},useTransition:function(){var e=ea(!1);return e=_a.bind(null,yo,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=yo,i=Oo();if(oi){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===ru)throw Error(a(349));0!==(124&ou)||Xo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,va(Jo.bind(null,r,o,e),[e]),r.flags|=2048,da(9,{destroy:void 0,resource:void 0},Yo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=ru.identifierPrefix;if(oi){var n=Zr;t="\xab"+t+"R"+(n=(Jr&~(1<<32-he(Jr)-1)).toString(32)+n),0<(n=Eo++)&&(t+="H"+n.toString(32)),t+="\xbb"}else t="\xab"+t+"r"+(n=_o++).toString(32)+"\xbb";return e.memoizedState=t},useHostTransitionStatus:Qa,useFormState:ua,useActionState:ua,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ha.bind(null,yo,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Oo().memoizedState=Ta.bind(null,yo)}},Ga={readContext:Ei,use:jo,useCallback:Fa,useContext:Ei,useEffect:wa,useImperativeHandle:xa,useInsertionEffect:ya,useLayoutEffect:ba,useMemo:Ea,useReducer:Wo,useRef:pa,useState:function(){return Wo(Ko)},useDebugValue:Ca,useDeferredValue:function(e,t){return ka(Mo(),bo.memoizedState,e,t)},useTransition:function(){var e=Wo(Ko)[0],t=Mo().memoizedState;return["boolean"===typeof e?e:Ho(e),t]},useSyncExternalStore:qo,useId:Da,useHostTransitionStatus:Qa,useFormState:la,useActionState:la,useOptimistic:function(e,t){return ta(Mo(),0,e,t)},useMemoCache:zo,useCacheRefresh:Ra},qa={readContext:Ei,use:jo,useCallback:Fa,useContext:Ei,useEffect:wa,useImperativeHandle:xa,useInsertionEffect:ya,useLayoutEffect:ba,useMemo:Ea,useReducer:Go,useRef:pa,useState:function(){return Go(Ko)},useDebugValue:Ca,useDeferredValue:function(e,t){var n=Mo();return null===bo?Sa(n,e,t):ka(n,bo.memoizedState,e,t)},useTransition:function(){var e=Go(Ko)[0],t=Mo().memoizedState;return["boolean"===typeof e?e:Ho(e),t]},useSyncExternalStore:qo,useId:Da,useHostTransitionStatus:Qa,useFormState:ha,useActionState:ha,useOptimistic:function(e,t){var n=Mo();return null!==bo?ta(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:zo,useCacheRefresh:Ra},Xa=null,Ya=0;function Ja(e){var t=Ya;return Ya+=1,null===Xa&&(Xa=[]),Ji(Xa,e,t)}function Za(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function $a(e,t){if(t.$$typeof===h)throw Error(a(525));throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function es(e){return(0,e._init)(e._payload)}function ts(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=Pr(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function A(e,t,n,r){return null===t||6!==t.tag?((t=jr(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===g?c(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===E&&es(o)===t.type)?(Za(t=i(t,n.props),n),t.return=e,t):(Za(t=Mr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=zr(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function c(e,t,n,r,o){return null===t||7!==t.tag?((t=Hr(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=jr(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case d:return Za(n=Mr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case p:return(t=zr(t,e.mode,n)).return=e,t;case E:return f(e,t=(0,t._init)(t._payload),n)}if(L(t)||I(t))return(t=Hr(t,e.mode,n,null)).return=e,t;if("function"===typeof t.then)return f(e,Ja(t),n);if(t.$$typeof===b)return f(e,Si(e,t),n);$a(e,t)}return null}function h(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return null!==i?null:A(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case d:return n.key===i?u(e,t,n,r):null;case p:return n.key===i?l(e,t,n,r):null;case E:return h(e,t,n=(i=n._init)(n._payload),r)}if(L(n)||I(n))return null!==i?null:c(e,t,n,r,null);if("function"===typeof n.then)return h(e,t,Ja(n),r);if(n.$$typeof===b)return h(e,t,Si(e,n),r);$a(e,n)}return null}function m(e,t,n,r,i){if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return A(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case d:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case p:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case E:return m(e,t,n,r=(0,r._init)(r._payload),i)}if(L(r)||I(r))return c(t,e=e.get(n)||null,r,i,null);if("function"===typeof r.then)return m(e,t,n,Ja(r),i);if(r.$$typeof===b)return m(e,t,n,Si(t,r),i);$a(t,r)}return null}function v(A,u,l,c){if("object"===typeof l&&null!==l&&l.type===g&&null===l.key&&(l=l.props.children),"object"===typeof l&&null!==l){switch(l.$$typeof){case d:e:{for(var w=l.key;null!==u;){if(u.key===w){if((w=l.type)===g){if(7===u.tag){n(A,u.sibling),(c=i(u,l.props.children)).return=A,A=c;break e}}else if(u.elementType===w||"object"===typeof w&&null!==w&&w.$$typeof===E&&es(w)===u.type){n(A,u.sibling),Za(c=i(u,l.props),l),c.return=A,A=c;break e}n(A,u);break}t(A,u),u=u.sibling}l.type===g?((c=Hr(l.props.children,A.mode,c,l.key)).return=A,A=c):(Za(c=Mr(l.type,l.key,l.props,null,A.mode,c),l),c.return=A,A=c)}return s(A);case p:e:{for(w=l.key;null!==u;){if(u.key===w){if(4===u.tag&&u.stateNode.containerInfo===l.containerInfo&&u.stateNode.implementation===l.implementation){n(A,u.sibling),(c=i(u,l.children||[])).return=A,A=c;break e}n(A,u);break}t(A,u),u=u.sibling}(c=zr(l,A.mode,c)).return=A,A=c}return s(A);case E:return v(A,u,l=(w=l._init)(l._payload),c)}if(L(l))return function(i,a,s,A){for(var u=null,l=null,c=a,d=a=0,p=null;null!==c&&d<s.length;d++){c.index>d?(p=c,c=null):p=c.sibling;var g=h(i,c,s[d],A);if(null===g){null===c&&(c=p);break}e&&c&&null===g.alternate&&t(i,c),a=o(g,a,d),null===l?u=g:l.sibling=g,l=g,c=p}if(d===s.length)return n(i,c),oi&&$r(i,d),u;if(null===c){for(;d<s.length;d++)null!==(c=f(i,s[d],A))&&(a=o(c,a,d),null===l?u=c:l.sibling=c,l=c);return oi&&$r(i,d),u}for(c=r(c);d<s.length;d++)null!==(p=m(c,i,d,s[d],A))&&(e&&null!==p.alternate&&c.delete(null===p.key?d:p.key),a=o(p,a,d),null===l?u=p:l.sibling=p,l=p);return e&&c.forEach(function(e){return t(i,e)}),oi&&$r(i,d),u}(A,u,l,c);if(I(l)){if("function"!==typeof(w=I(l)))throw Error(a(150));return function(i,s,A,u){if(null==A)throw Error(a(151));for(var l=null,c=null,d=s,p=s=0,g=null,v=A.next();null!==d&&!v.done;p++,v=A.next()){d.index>p?(g=d,d=null):g=d.sibling;var w=h(i,d,v.value,u);if(null===w){null===d&&(d=g);break}e&&d&&null===w.alternate&&t(i,d),s=o(w,s,p),null===c?l=w:c.sibling=w,c=w,d=g}if(v.done)return n(i,d),oi&&$r(i,p),l;if(null===d){for(;!v.done;p++,v=A.next())null!==(v=f(i,v.value,u))&&(s=o(v,s,p),null===c?l=v:c.sibling=v,c=v);return oi&&$r(i,p),l}for(d=r(d);!v.done;p++,v=A.next())null!==(v=m(d,i,p,v.value,u))&&(e&&null!==v.alternate&&d.delete(null===v.key?p:v.key),s=o(v,s,p),null===c?l=v:c.sibling=v,c=v);return e&&d.forEach(function(e){return t(i,e)}),oi&&$r(i,p),l}(A,u,l=w.call(l),c)}if("function"===typeof l.then)return v(A,u,Ja(l),c);if(l.$$typeof===b)return v(A,u,Si(A,l),c);$a(A,l)}return"string"===typeof l&&""!==l||"number"===typeof l||"bigint"===typeof l?(l=""+l,null!==u&&6===u.tag?(n(A,u.sibling),(c=i(u,l)).return=A,A=c):(n(A,u),(c=jr(l,A.mode,c)).return=A,A=c),s(A)):n(A,u)}return function(e,t,n,r){try{Ya=0;var i=v(e,t,n,r);return Xa=null,i}catch(a){if(a===Wi||a===Gi)throw a;var o=Rr(29,a,null,e.mode);return o.lanes=r,o.return=e,o}}}var ns=ts(!0),rs=ts(!1),is=O(null),os=null;function as(e){var t=e.alternate;H(ls,1&ls.current),H(is,e),null===os&&(null===t||null!==ho.current||null!==t.memoizedState)&&(os=e)}function ss(e){if(22===e.tag){if(H(ls,ls.current),H(is,e),null===os){var t=e.alternate;null!==t&&null!==t.memoizedState&&(os=e)}}else As()}function As(){H(ls,ls.current),H(is,is.current)}function us(e){M(is),os===e&&(os=null),M(ls)}var ls=O(0);function cs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||gc(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function fs(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:f({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qu(),i=io(r);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=oo(e,i,r))&&(Ru(t,e,r),ao(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qu(),i=io(r);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=oo(e,i,r))&&(Ru(t,e,r),ao(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qu(),r=io(n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=oo(e,r,n))&&(Ru(t,e,n),ao(t,e,n))}};function ds(e,t,n,r,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!Yn(n,r)||!Yn(i,o))}function ps(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hs.enqueueReplaceState(t,t.state,null)}function gs(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)void 0===n[i]&&(n[i]=e[i]);return n}var ms="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function vs(e){ms(e)}function ws(e){console.error(e)}function ys(e){ms(e)}function bs(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Bs(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function xs(e,t,n){return(n=io(n)).tag=3,n.payload={element:null},n.callback=function(){bs(e,t)},n}function Cs(e){return(e=io(e)).tag=3,e}function Fs(e,t,n,r){var i=n.type.getDerivedStateFromError;if("function"===typeof i){var o=r.value;e.payload=function(){return i(o)},e.callback=function(){Bs(t,n,r)}}var a=n.stateNode;null!==a&&"function"===typeof a.componentDidCatch&&(e.callback=function(){Bs(t,n,r),"function"!==typeof i&&(null===Cu?Cu=new Set([this]):Cu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Es=Error(a(461)),Ss=!1;function ks(e,t,n,r){t.child=null===e?rs(t,null,n,r):ns(t,e.child,n,r)}function _s(e,t,n,r,i){n=n.render;var o=t.ref;if("ref"in r){var a={};for(var s in r)"ref"!==s&&(a[s]=r[s])}else a=r;return Fi(t),r=Uo(e,t,n,a,o,i),s=Ro(),null===e||Ss?(oi&&s&&ti(t),t.flags|=1,ks(e,t,r,i),t.child):(To(e,t,i),Xs(e,t,i))}function Is(e,t,n,r,i){if(null===e){var o=n.type;return"function"!==typeof o||Tr(o)||void 0!==o.defaultProps||null!==n.compare?((e=Mr(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ns(e,t,o,r,i))}if(o=e.child,!Ys(e,i)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:Yn)(a,r)&&e.ref===t.ref)return Xs(e,t,i)}return t.flags|=1,(e=Pr(o,r)).ref=t.ref,e.return=t,t.child=e}function Ns(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(Yn(o,r)&&e.ref===t.ref){if(Ss=!1,t.pendingProps=r=o,!Ys(e,i))return t.lanes=e.lanes,Xs(e,t,i);0!==(131072&e.flags)&&(Ss=!0)}}return Ds(e,t,n,r,i)}function Us(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0!==(128&t.flags)){if(r=null!==o?o.baseLanes|n:n,null!==e){for(i=t.child=e.child,o=0;null!==i;)o=o|i.lanes|i.childLanes,i=i.sibling;t.childLanes=o&~r}else t.childLanes=0,t.child=null;return Ls(e,t,r,n)}if(0===(536870912&n))return t.lanes=t.childLanes=536870912,Ls(e,t,null!==o?o.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&zi(0,null!==o?o.cachePool:null),null!==o?go(t,o):mo(),ss(t)}else null!==o?(zi(0,o.cachePool),go(t,o),As(),t.memoizedState=null):(null!==e&&zi(0,null),mo(),As());return ks(e,t,i,n),t.child}function Ls(e,t,n,r){var i=ji();return i=null===i?null:{parent:Ui._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},null!==e&&zi(0,null),mo(),ss(t),null!==e&&xi(e,t,r,!0),null}function Qs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!==typeof n&&"object"!==typeof n)throw Error(a(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Ds(e,t,n,r,i){return Fi(t),n=Uo(e,t,n,r,void 0,i),r=Ro(),null===e||Ss?(oi&&r&&ti(t),t.flags|=1,ks(e,t,n,i),t.child):(To(e,t,i),Xs(e,t,i))}function Rs(e,t,n,r,i,o){return Fi(t),t.updateQueue=null,n=Qo(t,r,n,i),Lo(e),r=Ro(),null===e||Ss?(oi&&r&&ti(t),t.flags|=1,ks(e,t,n,o),t.child):(To(e,t,o),Xs(e,t,o))}function Ts(e,t,n,r,i){if(Fi(t),null===t.stateNode){var o=Qr,a=n.contextType;"object"===typeof a&&null!==a&&(o=Ei(a)),o=new n(r,o),t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,o.updater=hs,t.stateNode=o,o._reactInternals=t,(o=t.stateNode).props=r,o.state=t.memoizedState,o.refs={},no(t),a=n.contextType,o.context="object"===typeof a&&null!==a?Ei(a):Qr,o.state=t.memoizedState,"function"===typeof(a=n.getDerivedStateFromProps)&&(fs(t,n,a,r),o.state=t.memoizedState),"function"===typeof n.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(a=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),a!==o.state&&hs.enqueueReplaceState(o,o.state,null),lo(t,r,o,i),uo(),o.state=t.memoizedState),"function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){o=t.stateNode;var s=t.memoizedProps,A=gs(n,s);o.props=A;var u=o.context,l=n.contextType;a=Qr,"object"===typeof l&&null!==l&&(a=Ei(l));var c=n.getDerivedStateFromProps;l="function"===typeof c||"function"===typeof o.getSnapshotBeforeUpdate,s=t.pendingProps!==s,l||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s||u!==a)&&ps(t,o,r,a),to=!1;var f=t.memoizedState;o.state=f,lo(t,r,o,i),uo(),u=t.memoizedState,s||f!==u||to?("function"===typeof c&&(fs(t,n,c,r),u=t.memoizedState),(A=to||ds(t,n,A,r,f,u,a))?(l||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=a,r=A):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ro(e,t),l=gs(n,a=t.memoizedProps),o.props=l,c=t.pendingProps,f=o.context,u=n.contextType,A=Qr,"object"===typeof u&&null!==u&&(A=Ei(u)),(u="function"===typeof(s=n.getDerivedStateFromProps)||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(a!==c||f!==A)&&ps(t,o,r,A),to=!1,f=t.memoizedState,o.state=f,lo(t,r,o,i),uo();var h=t.memoizedState;a!==c||f!==h||to||null!==e&&null!==e.dependencies&&Ci(e.dependencies)?("function"===typeof s&&(fs(t,n,s,r),h=t.memoizedState),(l=to||ds(t,n,l,r,f,h,A)||null!==e&&null!==e.dependencies&&Ci(e.dependencies))?(u||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,h,A),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,h,A)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=A,r=l):("function"!==typeof o.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,Qs(e,t),r=0!==(128&t.flags),o||r?(o=t.stateNode,n=r&&"function"!==typeof n.getDerivedStateFromError?null:o.render(),t.flags|=1,null!==e&&r?(t.child=ns(t,e.child,null,i),t.child=ns(t,null,n,i)):ks(e,t,n,i),t.memoizedState=o.state,e=t.child):e=Xs(e,t,i),e}function Ps(e,t,n,r){return hi(),t.flags|=256,ks(e,t,n,r),t.child}var Os={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ms(e){return{baseLanes:e,cachePool:Ki()}}function Hs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=gu),e}function js(e,t,n){var r,i=t.pendingProps,o=!1,s=0!==(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&0!==(2&ls.current)),r&&(o=!0,t.flags&=-129),r=0!==(32&t.flags),t.flags&=-33,null===e){if(oi){if(o?as(t):As(),oi){var A,u=ii;if(A=u){e:{for(A=u,u=si;8!==A.nodeType;){if(!u){u=null;break e}if(null===(A=mc(A.nextSibling))){u=null;break e}}u=A}null!==u?(t.memoizedState={dehydrated:u,treeContext:null!==Yr?{id:Jr,overflow:Zr}:null,retryLane:536870912,hydrationErrors:null},(A=Rr(18,null,null,0)).stateNode=u,A.return=t,t.child=A,ri=t,ii=null,A=!0):A=!1}A||ui(t)}if(null!==(u=t.memoizedState)&&null!==(u=u.dehydrated))return gc(u)?t.lanes=32:t.lanes=536870912,null;us(t)}return u=i.children,i=i.fallback,o?(As(),u=Ks({mode:"hidden",children:u},o=t.mode),i=Hr(i,o,n,null),u.return=t,i.return=t,u.sibling=i,t.child=u,(o=t.child).memoizedState=Ms(n),o.childLanes=Hs(e,r,n),t.memoizedState=Os,i):(as(t),zs(t,u))}if(null!==(A=e.memoizedState)&&null!==(u=A.dehydrated)){if(s)256&t.flags?(as(t),t.flags&=-257,t=Ws(e,t,n)):null!==t.memoizedState?(As(),t.child=e.child,t.flags|=128,t=null):(As(),o=i.fallback,u=t.mode,i=Ks({mode:"visible",children:i.children},u),(o=Hr(o,u,n,null)).flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,ns(t,e.child,null,n),(i=t.child).memoizedState=Ms(n),i.childLanes=Hs(e,r,n),t.memoizedState=Os,t=o);else if(as(t),gc(u)){if(r=u.nextSibling&&u.nextSibling.dataset)var l=r.dgst;r=l,(i=Error(a(419))).stack="",i.digest=r,pi({value:i,source:null,stack:null}),t=Ws(e,t,n)}else if(Ss||xi(e,t,n,!1),r=0!==(n&e.childLanes),Ss||r){if(null!==(r=ru)&&(0!==(i=0!==((i=0!==(42&(i=n&-n))?1:ke(i))&(r.suspendedLanes|n))?0:i)&&i!==A.retryLane))throw A.retryLane=i,Nr(e,i),Ru(r,e,i),Es;"$?"===u.data||Gu(),t=Ws(e,t,n)}else"$?"===u.data?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,ii=mc(u.nextSibling),ri=t,oi=!0,ai=null,si=!1,null!==e&&(qr[Xr++]=Jr,qr[Xr++]=Zr,qr[Xr++]=Yr,Jr=e.id,Zr=e.overflow,Yr=t),(t=zs(t,i.children)).flags|=4096);return t}return o?(As(),o=i.fallback,u=t.mode,l=(A=e.child).sibling,(i=Pr(A,{mode:"hidden",children:i.children})).subtreeFlags=65011712&A.subtreeFlags,null!==l?o=Pr(l,o):(o=Hr(o,u,n,null)).flags|=2,o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,null===(u=e.child.memoizedState)?u=Ms(n):(null!==(A=u.cachePool)?(l=Ui._currentValue,A=A.parent!==l?{parent:l,pool:l}:A):A=Ki(),u={baseLanes:u.baseLanes|n,cachePool:A}),o.memoizedState=u,o.childLanes=Hs(e,r,n),t.memoizedState=Os,i):(as(t),e=(n=e.child).sibling,(n=Pr(n,{mode:"visible",children:i.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function zs(e,t){return(t=Ks({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Ks(e,t){return(e=Rr(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Ws(e,t,n){return ns(t,e.child,null,n),(e=zs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Vs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),bi(e.return,t,n)}function Gs(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function qs(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(ks(e,t,r.children,n),0!==(2&(r=ls.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vs(e,n,t);else if(19===e.tag)Vs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(H(ls,r),i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===cs(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Gs(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===cs(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Gs(t,!0,n,null,o);break;case"together":Gs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),hu|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(xi(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Pr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Pr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ys(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Ci(e))}function Js(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Ss=!0;else{if(!Ys(e,n)&&0===(128&t.flags))return Ss=!1,function(e,t,n){switch(t.tag){case 3:V(t,t.stateNode.containerInfo),wi(0,Ui,e.memoizedState.cache),hi();break;case 27:case 5:q(t);break;case 4:V(t,t.stateNode.containerInfo);break;case 10:wi(0,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(as(t),t.flags|=128,null):0!==(n&t.child.childLanes)?js(e,t,n):(as(t),null!==(e=Xs(e,t,n))?e.sibling:null);as(t);break;case 19:var i=0!==(128&e.flags);if((r=0!==(n&t.childLanes))||(xi(e,t,n,!1),r=0!==(n&t.childLanes)),i){if(r)return qs(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),H(ls,ls.current),r)break;return null;case 22:case 23:return t.lanes=0,Us(e,t,n);case 24:wi(0,Ui,e.memoizedState.cache)}return Xs(e,t,n)}(e,t,n);Ss=0!==(131072&e.flags)}else Ss=!1,oi&&0!==(1048576&t.flags)&&ei(t,Gr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,i=r._init;if(r=i(r._payload),t.type=r,"function"!==typeof r){if(void 0!==r&&null!==r){if((i=r.$$typeof)===B){t.tag=11,t=_s(null,t,r,e,n);break e}if(i===F){t.tag=14,t=Is(null,t,r,e,n);break e}}throw t=U(r)||r,Error(a(306,t,""))}Tr(r)?(e=gs(r,e),t.tag=1,t=Ts(null,t,r,e,n)):(t.tag=0,t=Ds(null,t,r,e,n))}return t;case 0:return Ds(e,t,t.type,t.pendingProps,n);case 1:return Ts(e,t,r=t.type,i=gs(r,t.pendingProps),n);case 3:e:{if(V(t,t.stateNode.containerInfo),null===e)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,ro(e,t),lo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,wi(0,Ui,r),r!==o.cache&&Bi(t,[Ui],n,!0),uo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ps(e,t,r,n);break e}if(r!==i){pi(i=Cr(Error(a(424)),t)),t=Ps(e,t,r,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(ii=mc(e.firstChild),ri=t,oi=!0,ai=null,si=!0,n=rs(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(hi(),r===i){t=Xs(e,t,n);break e}ks(e,t,r,n)}t=t.child}return t;case 26:return Qs(e,t),null===e?(n=kc(t.type,null,t.pendingProps,null))?t.memoizedState=n:oi||(n=t.type,e=t.pendingProps,(r=rc(K.current).createElement(n))[Ue]=t,r[Le]=e,ec(r,n,e),We(r),t.stateNode=r):t.memoizedState=kc(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return q(t),null===e&&oi&&(r=t.stateNode=yc(t.type,t.pendingProps,K.current),ri=t,si=!0,i=ii,hc(t.type)?(vc=i,ii=mc(r.firstChild)):ii=i),ks(e,t,t.pendingProps.children,n),Qs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&oi&&((i=r=ii)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Oe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(null==i.href||""===i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===o)return e}if(null===(e=mc(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,si))?(t.stateNode=r,ri=t,ii=mc(r.firstChild),si=!1,i=!0):i=!1),i||ui(t)),q(t),i=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,r=o.children,ac(i,o)?r=null:null!==s&&ac(i,s)&&(t.flags|=32),null!==t.memoizedState&&(i=Uo(e,t,Do,null,null,n),qc._currentValue=i),Qs(e,t),ks(e,t,r,n),t.child;case 6:return null===e&&oi&&((e=n=ii)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=mc(e.nextSibling)))return null}return e}(n,t.pendingProps,si))?(t.stateNode=n,ri=t,ii=null,e=!0):e=!1),e||ui(t)),null;case 13:return js(e,t,n);case 4:return V(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ns(t,null,r,n):ks(e,t,r,n),t.child;case 11:return _s(e,t,t.type,t.pendingProps,n);case 7:return ks(e,t,t.pendingProps,n),t.child;case 8:case 12:return ks(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,wi(0,t.type,r.value),ks(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Fi(t),r=r(i=Ei(i)),t.flags|=1,ks(e,t,r,n),t.child;case 14:return Is(e,t,t.type,t.pendingProps,n);case 15:return Ns(e,t,t.type,t.pendingProps,n);case 19:return qs(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},null===e?((n=Ks(r,n)).ref=t.ref,t.child=n,n.return=t,t=n):((n=Pr(e.child,r)).ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Us(e,t,n);case 24:return Fi(t),r=Ei(Ui),null===e?(null===(i=ji())&&(i=ru,o=Li(),i.pooledCache=o,o.refCount++,null!==o&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},no(t),wi(0,Ui,i)):(0!==(e.lanes&n)&&(ro(e,t),lo(t,null,null,n),uo()),i=e.memoizedState,o=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),wi(0,Ui,r)):(r=o.cache,wi(0,Ui,r),r!==i.cache&&Bi(t,[Ui],n,!0))),ks(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Zs(e){e.flags|=4}function $s(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!Hc(t)){if(null!==(t=is.current)&&((4194048&ou)===ou?null!==os:(62914560&ou)!==ou&&0===(536870912&ou)||t!==os))throw Zi=qi,Vi;e.flags|=8192}}function eA(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?xe():536870912,e.lanes|=t,mu|=t)}function tA(e,t){if(!oi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function nA(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=65011712&i.subtreeFlags,r|=65011712&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function rA(e,t,n){var r=t.pendingProps;switch(ni(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return nA(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),yi(Ui),G(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(fi(t)?Zs(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,di())),nA(t),null;case 26:return n=t.memoizedState,null===e?(Zs(t),null!==n?(nA(t),$s(t,n)):(nA(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Zs(t),nA(t),$s(t,n)):(nA(t),t.flags&=-16777217):(e.memoizedProps!==r&&Zs(t),nA(t),t.flags&=-16777217),null;case 27:X(t),n=K.current;var i=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(a(166));return nA(t),null}e=j.current,fi(t)?li(t):(e=yc(i,r,n),t.stateNode=e,Zs(t))}return nA(t),null;case 5:if(X(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(a(166));return nA(t),null}if(e=j.current,fi(t))li(t);else{switch(i=rc(K.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof r.is?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"===typeof r.is?i.createElement(n,{is:r.is}):i.createElement(n)}}e[Ue]=t,e[Le]=r;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(ec(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Zs(t)}}return nA(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));if(e=K.current,fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=ri))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ue]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||Yl(e.nodeValue,n)))||ui(t)}else(e=rc(e).createTextNode(r))[Ue]=t,t.stateNode=e}return nA(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=fi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(a(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(a(317));i[Ue]=t}else hi(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;nA(t),i=!1}else i=di(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(us(t),t):(us(t),null)}if(us(t),0!==(128&t.flags))return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool);var o=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),eA(t,t.updateQueue),nA(t),null;case 4:return G(),null===e&&Ml(t.stateNode.containerInfo),nA(t),null;case 10:return yi(t.type),nA(t),null;case 19:if(M(ls),null===(i=t.memoizedState))return nA(t),null;if(r=0!==(128&t.flags),null===(o=i.rendering))if(r)tA(i,!1);else{if(0!==fu||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(o=cs(e))){for(t.flags|=128,tA(i,!1),e=o.updateQueue,t.updateQueue=e,eA(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Or(n,e),n=n.sibling;return H(ls,1&ls.current|2),t.child}e=e.sibling}null!==i.tail&&te()>Bu&&(t.flags|=128,r=!0,tA(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=cs(o))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,eA(t,e),tA(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate&&!oi)return nA(t),null}else 2*te()-i.renderingStartTime>Bu&&536870912!==n&&(t.flags|=128,r=!0,tA(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=te(),t.sibling=null,e=ls.current,H(ls,r?1&e|2:1&e),t):(nA(t),null);case 22:case 23:return us(t),vo(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!==(536870912&n)&&0===(128&t.flags)&&(nA(t),6&t.subtreeFlags&&(t.flags|=8192)):nA(t),null!==(n=t.updateQueue)&&eA(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&M(Hi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),yi(Ui),nA(t),null;case 25:case 30:return null}throw Error(a(156,t.tag))}function iA(e,t){switch(ni(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return yi(Ui),G(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return X(t),null;case 13:if(us(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));hi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return M(ls),null;case 4:return G(),null;case 10:return yi(t.type),null;case 22:case 23:return us(t),vo(),null!==e&&M(Hi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return yi(Ui),null;default:return null}}function oA(e,t){switch(ni(t),t.tag){case 3:yi(Ui),G();break;case 26:case 27:case 5:X(t);break;case 4:G();break;case 13:us(t);break;case 19:M(ls);break;case 10:yi(t.type);break;case 22:case 23:us(t),vo(),null!==e&&M(Hi);break;case 24:yi(Ui)}}function aA(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,a=n.inst;r=o(),a.destroy=r}n=n.next}while(n!==i)}}catch(s){ll(t,t.return,s)}}function sA(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var o=i.next;r=o;do{if((r.tag&e)===e){var a=r.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,i=t;var A=n,u=s;try{u()}catch(l){ll(i,A,l)}}}r=r.next}while(r!==o)}}catch(l){ll(t,t.return,l)}}function AA(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{fo(t,n)}catch(r){ll(e,e.return,r)}}}function uA(e,t,n){n.props=gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ll(e,t,r)}}function lA(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"===typeof n?e.refCleanup=n(r):n.current=r}}catch(i){ll(e,t,i)}}function cA(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"===typeof r)try{r()}catch(i){ll(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof n)try{n(null)}catch(o){ll(e,t,o)}else n.current=null}function fA(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){ll(e,e.return,i)}}function hA(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,o=null,s=null,A=null,u=null,l=null,c=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&null!=f)switch(d){case"checked":case"value":break;case"defaultValue":u=f;default:r.hasOwnProperty(d)||Zl(e,t,d,null,r,f)}}for(var h in r){var d=r[h];if(f=n[h],r.hasOwnProperty(h)&&(null!=d||null!=f))switch(h){case"type":o=d;break;case"name":i=d;break;case"checked":l=d;break;case"defaultChecked":c=d;break;case"value":s=d;break;case"defaultValue":A=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(a(137,t));break;default:d!==f&&Zl(e,t,h,d,r,f)}}return void gt(e,s,A,u,l,c,o,i);case"select":for(o in d=s=A=h=null,n)if(u=n[o],n.hasOwnProperty(o)&&null!=u)switch(o){case"value":break;case"multiple":d=u;default:r.hasOwnProperty(o)||Zl(e,t,o,null,r,u)}for(i in r)if(o=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=o||null!=u))switch(i){case"value":h=o;break;case"defaultValue":A=o;break;case"multiple":s=o;default:o!==u&&Zl(e,t,i,o,r,u)}return t=A,n=s,r=d,void(null!=h?wt(e,!!n,h,!1):!!r!==!!n&&(null!=t?wt(e,!!n,t,!0):wt(e,!!n,n?[]:"",!1)));case"textarea":for(A in d=h=null,n)if(i=n[A],n.hasOwnProperty(A)&&null!=i&&!r.hasOwnProperty(A))switch(A){case"value":case"children":break;default:Zl(e,t,A,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(null!=i||null!=o))switch(s){case"value":h=i;break;case"defaultValue":d=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(a(91));break;default:i!==o&&Zl(e,t,s,i,r,o)}return void yt(e,h,d);case"option":for(var p in n)if(h=n[p],n.hasOwnProperty(p)&&null!=h&&!r.hasOwnProperty(p))if("selected"===p)e.selected=!1;else Zl(e,t,p,null,r,h);for(u in r)if(h=r[u],d=n[u],r.hasOwnProperty(u)&&h!==d&&(null!=h||null!=d))if("selected"===u)e.selected=h&&"function"!==typeof h&&"symbol"!==typeof h;else Zl(e,t,u,h,r,d);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)h=n[g],n.hasOwnProperty(g)&&null!=h&&!r.hasOwnProperty(g)&&Zl(e,t,g,null,r,h);for(l in r)if(h=r[l],d=n[l],r.hasOwnProperty(l)&&h!==d&&(null!=h||null!=d))switch(l){case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(a(137,t));break;default:Zl(e,t,l,h,r,d)}return;default:if(Et(t)){for(var m in n)h=n[m],n.hasOwnProperty(m)&&void 0!==h&&!r.hasOwnProperty(m)&&$l(e,t,m,void 0,r,h);for(c in r)h=r[c],d=n[c],!r.hasOwnProperty(c)||h===d||void 0===h&&void 0===d||$l(e,t,c,h,r,d);return}}for(var v in n)h=n[v],n.hasOwnProperty(v)&&null!=h&&!r.hasOwnProperty(v)&&Zl(e,t,v,null,r,h);for(f in r)h=r[f],d=n[f],!r.hasOwnProperty(f)||h===d||null==h&&null==d||Zl(e,t,f,h,r,d)}(r,e.type,n,t),r[Le]=t}catch(i){ll(e,e.return,i)}}function dA(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&hc(e.type)||4===e.tag}function pA(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||dA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&hc(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function gA(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Jl));else if(4!==r&&(27===r&&hc(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(gA(e,t,n),e=e.sibling;null!==e;)gA(e,t,n),e=e.sibling}function mA(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&hc(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(mA(e,t,n),e=e.sibling;null!==e;)mA(e,t,n),e=e.sibling}function vA(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ec(t,r,n),t[Ue]=e,t[Le]=n}catch(o){ll(e,e.return,o)}}var wA=!1,yA=!1,bA=!1,BA="function"===typeof WeakSet?WeakSet:Set,xA=null;function CA(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:TA(e,n),4&r&&aA(5,n);break;case 1:if(TA(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(a){ll(n,n.return,a)}else{var i=gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){ll(n,n.return,s)}}64&r&&AA(n),512&r&&lA(n,n.return);break;case 3:if(TA(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{fo(e,t)}catch(a){ll(n,n.return,a)}}break;case 27:null===t&&4&r&&vA(n);case 26:case 5:TA(e,n),null===t&&4&r&&fA(n),512&r&&lA(n,n.return);break;case 12:TA(e,n);break;case 13:TA(e,n),4&r&&IA(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$?"!==e.data||"complete"===n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=dl.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||wA)){t=null!==t&&null!==t.memoizedState||yA,i=wA;var o=yA;wA=r,(yA=t)&&!o?OA(e,n,0!==(8772&n.subtreeFlags)):TA(e,n),wA=i,yA=o}break;case 30:break;default:TA(e,n)}}function FA(e){var t=e.alternate;null!==t&&(e.alternate=null,FA(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Me(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var EA=null,SA=!1;function kA(e,t,n){for(n=n.child;null!==n;)_A(e,t,n),n=n.sibling}function _A(e,t,n){if(ce&&"function"===typeof ce.onCommitFiberUnmount)try{ce.onCommitFiberUnmount(le,n)}catch(o){}switch(n.tag){case 26:yA||cA(n,t),kA(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:yA||cA(n,t);var r=EA,i=SA;hc(n.type)&&(EA=n.stateNode,SA=!1),kA(e,t,n),bc(n.stateNode),EA=r,SA=i;break;case 5:yA||cA(n,t);case 6:if(r=EA,i=SA,EA=null,kA(e,t,n),SA=i,null!==(EA=r))if(SA)try{(9===EA.nodeType?EA.body:"HTML"===EA.nodeName?EA.ownerDocument.body:EA).removeChild(n.stateNode)}catch(a){ll(n,t,a)}else try{EA.removeChild(n.stateNode)}catch(a){ll(n,t,a)}break;case 18:null!==EA&&(SA?(dc(9===(e=EA).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),kf(e)):dc(EA,n.stateNode));break;case 4:r=EA,i=SA,EA=n.stateNode.containerInfo,SA=!0,kA(e,t,n),EA=r,SA=i;break;case 0:case 11:case 14:case 15:yA||sA(2,n,t),yA||sA(4,n,t),kA(e,t,n);break;case 1:yA||(cA(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount&&uA(n,t,r)),kA(e,t,n);break;case 21:kA(e,t,n);break;case 22:yA=(r=yA)||null!==n.memoizedState,kA(e,t,n),yA=r;break;default:kA(e,t,n)}}function IA(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{kf(e)}catch(n){ll(t,t.return,n)}}function NA(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new BA),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new BA),t;default:throw Error(a(435,e.tag))}}(e);t.forEach(function(t){var r=pl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}function UA(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,A=s;e:for(;null!==A;){switch(A.tag){case 27:if(hc(A.type)){EA=A.stateNode,SA=!1;break e}break;case 5:EA=A.stateNode,SA=!1;break e;case 3:case 4:EA=A.stateNode.containerInfo,SA=!0;break e}A=A.return}if(null===EA)throw Error(a(160));_A(o,s,i),EA=null,SA=!1,null!==(o=i.alternate)&&(o.return=null),i.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)QA(t,e),t=t.sibling}var LA=null;function QA(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:UA(t,e),DA(e),4&r&&(sA(3,e,e.return),aA(3,e),sA(5,e,e.return));break;case 1:UA(t,e),DA(e),512&r&&(yA||null===n||cA(n,n.return)),64&r&&wA&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var i=LA;if(UA(t,e),DA(e),512&r&&(yA||null===n||cA(n,n.return)),4&r){var o=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":(!(o=i.getElementsByTagName("title")[0])||o[Oe]||o[Ue]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector("head > title"))),ec(o,r,n),o[Ue]=e,We(o),r=o;break e;case"link":var s=Oc("link","href",i).get(r+(n.href||""));if(s)for(var A=0;A<s.length;A++)if((o=s[A]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(A,1);break t}ec(o=i.createElement(r),r,n),i.head.appendChild(o);break;case"meta":if(s=Oc("meta","content",i).get(r+(n.content||"")))for(A=0;A<s.length;A++)if((o=s[A]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(A,1);break t}ec(o=i.createElement(r),r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[Ue]=e,We(o),r=o}e.stateNode=r}else Mc(i,e.type,e.stateNode);else e.stateNode=Qc(i,r,e.memoizedProps);else o!==r?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===r?Mc(i,e.type,e.stateNode):Qc(i,r,e.memoizedProps)):null===r&&null!==e.stateNode&&hA(e,e.memoizedProps,n.memoizedProps)}break;case 27:UA(t,e),DA(e),512&r&&(yA||null===n||cA(n,n.return)),null!==n&&4&r&&hA(e,e.memoizedProps,n.memoizedProps);break;case 5:if(UA(t,e),DA(e),512&r&&(yA||null===n||cA(n,n.return)),32&e.flags){i=e.stateNode;try{Bt(i,"")}catch(d){ll(e,e.return,d)}}4&r&&null!=e.stateNode&&hA(e,i=e.memoizedProps,null!==n?n.memoizedProps:i),1024&r&&(bA=!0);break;case 6:if(UA(t,e),DA(e),4&r){if(null===e.stateNode)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(d){ll(e,e.return,d)}}break;case 3:if(Pc=null,i=LA,LA=Cc(t.containerInfo),UA(t,e),LA=i,DA(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{kf(t.containerInfo)}catch(d){ll(e,e.return,d)}bA&&(bA=!1,RA(e));break;case 4:r=LA,LA=Cc(e.stateNode.containerInfo),UA(t,e),DA(e),LA=r;break;case 12:default:UA(t,e),DA(e);break;case 13:UA(t,e),DA(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==n&&null!==n.memoizedState)&&(bu=te()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,NA(e,r)));break;case 22:i=null!==e.memoizedState;var u=null!==n&&null!==n.memoizedState,l=wA,c=yA;if(wA=l||i,yA=c||u,UA(t,e),yA=c,wA=l,DA(e),8192&r)e:for(t=e.stateNode,t._visibility=i?-2&t._visibility:1|t._visibility,i&&(null===n||u||wA||yA||PA(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){u=n=t;try{if(o=u.stateNode,i)"function"===typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{A=u.stateNode;var f=u.memoizedProps.style,h=void 0!==f&&null!==f&&f.hasOwnProperty("display")?f.display:null;A.style.display=null==h||"boolean"===typeof h?"":(""+h).trim()}}catch(d){ll(u,u.return,d)}}}else if(6===t.tag){if(null===n){u=t;try{u.stateNode.nodeValue=i?"":u.memoizedProps}catch(d){ll(u,u.return,d)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,NA(e,n))));break;case 19:UA(t,e),DA(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,NA(e,r)));case 30:case 21:}}function DA(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(dA(r)){n=r;break}r=r.return}if(null==n)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;mA(e,pA(e),i);break;case 5:var o=n.stateNode;32&n.flags&&(Bt(o,""),n.flags&=-33),mA(e,pA(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;gA(e,pA(e),s);break;default:throw Error(a(161))}}catch(A){ll(e,e.return,A)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function RA(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;RA(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function TA(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)CA(e,t.alternate,t),t=t.sibling}function PA(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:sA(4,t,t.return),PA(t);break;case 1:cA(t,t.return);var n=t.stateNode;"function"===typeof n.componentWillUnmount&&uA(t,t.return,n),PA(t);break;case 27:bc(t.stateNode);case 26:case 5:cA(t,t.return),PA(t);break;case 22:null===t.memoizedState&&PA(t);break;default:PA(t)}e=e.sibling}}function OA(e,t,n){for(n=n&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,i=e,o=t,a=o.flags;switch(o.tag){case 0:case 11:case 15:OA(i,o,n),aA(4,o);break;case 1:if(OA(i,o,n),"function"===typeof(i=(r=o).stateNode).componentDidMount)try{i.componentDidMount()}catch(u){ll(r,r.return,u)}if(null!==(i=(r=o).updateQueue)){var s=r.stateNode;try{var A=i.shared.hiddenCallbacks;if(null!==A)for(i.shared.hiddenCallbacks=null,i=0;i<A.length;i++)co(A[i],s)}catch(u){ll(r,r.return,u)}}n&&64&a&&AA(o),lA(o,o.return);break;case 27:vA(o);case 26:case 5:OA(i,o,n),n&&null===r&&4&a&&fA(o),lA(o,o.return);break;case 12:OA(i,o,n);break;case 13:OA(i,o,n),n&&4&a&&IA(i,o);break;case 22:null===o.memoizedState&&OA(i,o,n),lA(o,o.return);break;case 30:break;default:OA(i,o,n)}t=t.sibling}}function MA(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Qi(n))}function HA(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Qi(e))}function jA(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)zA(e,t,n,r),t=t.sibling}function zA(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jA(e,t,n,r),2048&i&&aA(9,t);break;case 1:case 13:default:jA(e,t,n,r);break;case 3:jA(e,t,n,r),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Qi(e)));break;case 12:if(2048&i){jA(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,a=o.id,s=o.onPostCommit;"function"===typeof s&&s(a,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(A){ll(t,t.return,A)}}else jA(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,a=t.alternate,null!==t.memoizedState?2&o._visibility?jA(e,t,n,r):WA(e,t):2&o._visibility?jA(e,t,n,r):(o._visibility|=2,KA(e,t,n,r,0!==(10256&t.subtreeFlags))),2048&i&&MA(a,t);break;case 24:jA(e,t,n,r),2048&i&&HA(t.alternate,t)}}function KA(e,t,n,r,i){for(i=i&&0!==(10256&t.subtreeFlags),t=t.child;null!==t;){var o=e,a=t,s=n,A=r,u=a.flags;switch(a.tag){case 0:case 11:case 15:KA(o,a,s,A,i),aA(8,a);break;case 23:break;case 22:var l=a.stateNode;null!==a.memoizedState?2&l._visibility?KA(o,a,s,A,i):WA(o,a):(l._visibility|=2,KA(o,a,s,A,i)),i&&2048&u&&MA(a.alternate,a);break;case 24:KA(o,a,s,A,i),i&&2048&u&&HA(a.alternate,a);break;default:KA(o,a,s,A,i)}t=t.sibling}}function WA(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:WA(n,r),2048&i&&MA(r.alternate,r);break;case 24:WA(n,r),2048&i&&HA(r.alternate,r);break;default:WA(n,r)}t=t.sibling}}var VA=8192;function GA(e){if(e.subtreeFlags&VA)for(e=e.child;null!==e;)qA(e),e=e.sibling}function qA(e){switch(e.tag){case 26:GA(e),e.flags&VA&&null!==e.memoizedState&&function(e,t,n){if(null===jc)throw Error(a(475));var r=jc;if("stylesheet"===t.type&&("string"!==typeof n.media||!1!==matchMedia(n.media).matches)&&0===(4&t.state.loading)){if(null===t.instance){var i=_c(n.href),o=e.querySelector(Ic(i));if(o)return null!==(e=o._p)&&"object"===typeof e&&"function"===typeof e.then&&(r.count++,r=Kc.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=o,void We(o);o=e.ownerDocument||e,n=Nc(n),(i=Bc.get(i))&&Rc(n,i),We(o=o.createElement("link"));var s=o;s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ec(o,"link",n),t.instance=o}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&0===(3&t.state.loading)&&(r.count++,t=Kc.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(LA,e.memoizedState,e.memoizedProps);break;case 5:default:GA(e);break;case 3:case 4:var t=LA;LA=Cc(e.stateNode.containerInfo),GA(e),LA=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=VA,VA=16777216,GA(e),VA=t):GA(e))}}function XA(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function YA(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];xA=r,$A(r,e)}XA(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)JA(e),e=e.sibling}function JA(e){switch(e.tag){case 0:case 11:case 15:YA(e),2048&e.flags&&sA(9,e,e.return);break;case 3:case 12:default:YA(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,ZA(e)):YA(e)}}function ZA(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];xA=r,$A(r,e)}XA(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:sA(8,t,t.return),ZA(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,ZA(t));break;default:ZA(t)}e=e.sibling}}function $A(e,t){for(;null!==xA;){var n=xA;switch(n.tag){case 0:case 11:case 15:sA(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Qi(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,xA=r;else e:for(n=e;null!==xA;){var i=(r=xA).sibling,o=r.return;if(FA(r),r===n){xA=null;break e}if(null!==i){i.return=o,xA=i;break e}xA=o}}}var eu={getCacheForType:function(e){var t=Ei(Ui),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},tu="function"===typeof WeakMap?WeakMap:Map,nu=0,ru=null,iu=null,ou=0,au=0,su=null,Au=!1,uu=!1,lu=!1,cu=0,fu=0,hu=0,du=0,pu=0,gu=0,mu=0,vu=null,wu=null,yu=!1,bu=0,Bu=1/0,xu=null,Cu=null,Fu=0,Eu=null,Su=null,ku=0,_u=0,Iu=null,Nu=null,Uu=0,Lu=null;function Qu(){if(0!==(2&nu)&&0!==ou)return ou&-ou;if(null!==Q.T){return 0!==Ti?Ti:_l()}return Ie()}function Du(){0===gu&&(gu=0===(536870912&ou)||oi?Be():536870912);var e=is.current;return null!==e&&(e.flags|=32),gu}function Ru(e,t,n){(e!==ru||2!==au&&9!==au)&&null===e.cancelPendingCommit||(zu(e,0),Mu(e,ou,gu,!1)),Fe(e,n),0!==(2&nu)&&e===ru||(e===ru&&(0===(2&nu)&&(du|=n),4===fu&&Mu(e,ou,gu,!1)),Bl(e))}function Tu(e,t,n){if(0!==(6&nu))throw Error(a(327));for(var r=!n&&0===(124&t)&&0===(t&e.expiredLanes)||ye(e,t),i=r?function(e,t){var n=nu;nu|=2;var r=Wu(),i=Vu();ru!==e||ou!==t?(xu=null,Bu=te()+500,zu(e,t)):uu=ye(e,t);e:for(;;)try{if(0!==au&&null!==iu){t=iu;var o=su;t:switch(au){case 1:au=0,su=null,$u(e,t,o,1);break;case 2:case 9:if(Xi(o)){au=0,su=null,Zu(t);break}t=function(){2!==au&&9!==au||ru!==e||(au=7),Bl(e)},o.then(t,t);break e;case 3:au=7;break e;case 4:au=5;break e;case 7:Xi(o)?(au=0,su=null,Zu(t)):(au=0,su=null,$u(e,t,o,7));break;case 5:var s=null;switch(iu.tag){case 26:s=iu.memoizedState;case 5:case 27:var A=iu;if(!s||Hc(s)){au=0,su=null;var u=A.sibling;if(null!==u)iu=u;else{var l=A.return;null!==l?(iu=l,el(l)):iu=null}break t}}au=0,su=null,$u(e,t,o,5);break;case 6:au=0,su=null,$u(e,t,o,6);break;case 8:ju(),fu=6;break e;default:throw Error(a(462))}}Yu();break}catch(c){Ku(e,c)}return vi=mi=null,Q.H=r,Q.A=i,nu=n,null!==iu?0:(ru=null,ou=0,kr(),fu)}(e,t):qu(e,t,!0),o=r;;){if(0===i){uu&&!r&&Mu(e,t,0,!1);break}if(n=e.current.alternate,!o||Ou(n)){if(2===i){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var A=e;i=vu;var u=A.current.memoizedState.isDehydrated;if(u&&(zu(A,s).flags|=256),2!==(s=qu(A,s,!1))){if(lu&&!u){A.errorRecoveryDisabledLanes|=o,du|=o,i=4;break e}o=wu,wu=i,null!==o&&(null===wu?wu=o:wu.push.apply(wu,o))}i=s}if(o=!1,2!==i)continue}}if(1===i){zu(e,0),Mu(e,t,0,!0);break}e:{switch(r=e,o=i){case 0:case 1:throw Error(a(345));case 4:if((4194048&t)!==t)break;case 6:Mu(r,t,gu,!Au);break e;case 2:wu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((62914560&t)===t&&10<(i=bu+300-te())){if(Mu(r,t,gu,!Au),0!==we(r,0,!0))break e;r.timeoutHandle=Ac(Pu.bind(null,r,n,wu,xu,yu,t,gu,du,mu,Au,o,2,-0,0),i)}else Pu(r,n,wu,xu,yu,t,gu,du,mu,Au,o,0,-0,0)}break}i=qu(e,t,!1),o=!1}Bl(e)}function Pu(e,t,n,r,i,o,s,A,u,l,c,f,h,d){if(e.timeoutHandle=-1,(8192&(f=t.subtreeFlags)||16785408===(16785408&f))&&(jc={stylesheets:null,count:0,unsuspend:zc},qA(t),null!==(f=function(){if(null===jc)throw Error(a(475));var e=jc;return e.stylesheets&&0===e.count&&Vc(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Vc(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=f(nl.bind(null,e,t,o,n,r,i,s,A,u,c,1,h,d)),void Mu(e,o,s,!l);nl(e,t,o,n,r,i,s,A,u)}function Ou(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Xn(o(),i))return!1}catch(a){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mu(e,t,n,r){t&=~pu,t&=~du,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var o=31-he(i),a=1<<o;r[o]=-1,i&=~a}0!==n&&Ee(e,n,t)}function Hu(){return 0!==(6&nu)||(xl(0,!1),!1)}function ju(){if(null!==iu){if(0===au)var e=iu.return;else vi=mi=null,Po(e=iu),Xa=null,Ya=0,e=iu;for(;null!==e;)oA(e.alternate,e),e=e.return;iu=null}}function zu(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,uc(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),ju(),ru=e,iu=n=Pr(e.current,null),ou=t,au=0,su=null,Au=!1,uu=ye(e,t),lu=!1,mu=gu=pu=du=hu=fu=0,wu=vu=null,yu=!1,0!==(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var i=31-he(r),o=1<<i;t|=e[i],r&=~o}return cu=t,kr(),n}function Ku(e,t){yo=null,Q.H=Wa,t===Wi||t===Gi?(t=$i(),au=3):t===Vi?(t=$i(),au=4):au=t===Es?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,su=t,null===iu&&(fu=1,bs(e,Cr(t,e.current)))}function Wu(){var e=Q.H;return Q.H=Wa,null===e?Wa:e}function Vu(){var e=Q.A;return Q.A=eu,e}function Gu(){fu=4,Au||(4194048&ou)!==ou&&null!==is.current||(uu=!0),0===(134217727&hu)&&0===(134217727&du)||null===ru||Mu(ru,ou,gu,!1)}function qu(e,t,n){var r=nu;nu|=2;var i=Wu(),o=Vu();ru===e&&ou===t||(xu=null,zu(e,t)),t=!1;var a=fu;e:for(;;)try{if(0!==au&&null!==iu){var s=iu,A=su;switch(au){case 8:ju(),a=6;break e;case 3:case 2:case 9:case 6:null===is.current&&(t=!0);var u=au;if(au=0,su=null,$u(e,s,A,u),n&&uu){a=0;break e}break;default:u=au,au=0,su=null,$u(e,s,A,u)}}Xu(),a=fu;break}catch(l){Ku(e,l)}return t&&e.shellSuspendCounter++,vi=mi=null,nu=r,Q.H=i,Q.A=o,null===iu&&(ru=null,ou=0,kr()),a}function Xu(){for(;null!==iu;)Ju(iu)}function Yu(){for(;null!==iu&&!$();)Ju(iu)}function Ju(e){var t=Js(e.alternate,e,cu);e.memoizedProps=e.pendingProps,null===t?el(e):iu=t}function Zu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Rs(n,t,t.pendingProps,t.type,void 0,ou);break;case 11:t=Rs(n,t,t.pendingProps,t.type.render,t.ref,ou);break;case 5:Po(t);default:oA(n,t),t=Js(n,t=iu=Or(t,cu),cu)}e.memoizedProps=e.pendingProps,null===t?el(e):iu=t}function $u(e,t,n,r){vi=mi=null,Po(t),Xa=null,Ya=0;var i=t.return;try{if(function(e,t,n,r,i){if(n.flags|=32768,null!==r&&"object"===typeof r&&"function"===typeof r.then){if(null!==(t=n.alternate)&&xi(t,n,i,!0),null!==(n=is.current)){switch(n.tag){case 13:return null===os?Gu():null===n.alternate&&0===fu&&(fu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===qi?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),cl(e,r,i)),!1;case 22:return n.flags|=65536,r===qi?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),cl(e,r,i)),!1}throw Error(a(435,n.tag))}return cl(e,r,i),Gu(),!1}if(oi)return null!==(t=is.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ai&&pi(Cr(e=Error(a(422),{cause:r}),n))):(r!==Ai&&pi(Cr(t=Error(a(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,r=Cr(r,n),so(e,i=xs(e.stateNode,r,i)),4!==fu&&(fu=2)),!1;var o=Error(a(520),{cause:r});if(o=Cr(o,n),null===vu?vu=[o]:vu.push(o),4!==fu&&(fu=2),null===t)return!0;r=Cr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,so(n,e=xs(n.stateNode,r,e)),!1;case 1:if(t=n.type,o=n.stateNode,0===(128&n.flags)&&("function"===typeof t.getDerivedStateFromError||null!==o&&"function"===typeof o.componentDidCatch&&(null===Cu||!Cu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,Fs(i=Cs(i),e,n,r),so(n,i),!1}n=n.return}while(null!==n);return!1}(e,i,t,n,ou))return fu=1,bs(e,Cr(n,e.current)),void(iu=null)}catch(o){if(null!==i)throw iu=i,o;return fu=1,bs(e,Cr(n,e.current)),void(iu=null)}32768&t.flags?(oi||1===r?e=!0:uu||0!==(536870912&ou)?e=!1:(Au=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=is.current)&&13===r.tag&&(r.flags|=16384))),tl(t,e)):el(t)}function el(e){var t=e;do{if(0!==(32768&t.flags))return void tl(t,Au);e=t.return;var n=rA(t.alternate,t,cu);if(null!==n)return void(iu=n);if(null!==(t=t.sibling))return void(iu=t);iu=t=e}while(null!==t);0===fu&&(fu=5)}function tl(e,t){do{var n=iA(e.alternate,e);if(null!==n)return n.flags&=32767,void(iu=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(iu=e);iu=e=n}while(null!==e);fu=6,iu=null}function nl(e,t,n,r,i,o,s,A,u){e.cancelPendingCommit=null;do{sl()}while(0!==Fu);if(0!==(6&nu))throw Error(a(327));if(null!==t){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,function(e,t,n,r,i,o){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,A=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0<n;){var l=31-he(n),c=1<<l;s[l]=0,A[l]=-1;var f=u[l];if(null!==f)for(u[l]=null,l=0;l<f.length;l++){var h=f[l];null!==h&&(h.lane&=-536870913)}n&=~c}0!==r&&Ee(e,r,0),0!==o&&0===i&&0!==e.tag&&(e.suspendedLanes|=o&~(a&~t))}(e,n,o|=Sr,s,A,u),e===ru&&(iu=ru=null,ou=0),Su=t,Eu=e,ku=n,_u=o,Iu=i,Nu=r,0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,J(oe,function(){return Al(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!==(13878&t.flags),0!==(13878&t.subtreeFlags)||r){r=Q.T,Q.T=null,i=D.p,D.p=2,s=nu,nu|=4;try{!function(e,t){if(e=e.containerInfo,tc=nf,tr(e=er(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(g){n=null;break e}var s=0,A=-1,u=-1,l=0,c=0,f=e,h=null;t:for(;;){for(var d;f!==n||0!==i&&3!==f.nodeType||(A=s+i),f!==o||0!==r&&3!==f.nodeType||(u=s+r),3===f.nodeType&&(s+=f.nodeValue.length),null!==(d=f.firstChild);)h=f,f=d;for(;;){if(f===e)break t;if(h===n&&++l===i&&(A=s),h===o&&++c===r&&(u=s),null!==(d=f.nextSibling))break;h=(f=h).parentNode}f=d}n=-1===A||-1===u?null:{start:A,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(nc={focusedElem:e,selectionRange:n},nf=!1,xA=t;null!==xA;)if(e=(t=xA).child,0!==(1024&t.subtreeFlags)&&null!==e)e.return=t,xA=e;else for(;null!==xA;){switch(o=(t=xA).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==o){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var p=gs(n.type,i,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(p,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){ll(n,n.return,m)}}break;case 3:if(0!==(1024&e))if(9===(n=(e=t.stateNode.containerInfo).nodeType))pc(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pc(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(a(163))}if(null!==(e=t.sibling)){e.return=t.return,xA=e;break}xA=t.return}}(e,t)}finally{nu=s,D.p=i,Q.T=r}}Fu=1,rl(),il(),ol()}}function rl(){if(1===Fu){Fu=0;var e=Eu,t=Su,n=0!==(13878&t.flags);if(0!==(13878&t.subtreeFlags)||n){n=Q.T,Q.T=null;var r=D.p;D.p=2;var i=nu;nu|=4;try{QA(t,e);var o=nc,a=er(e.containerInfo),s=o.focusedElem,A=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&$n(s.ownerDocument.documentElement,s)){if(null!==A&&tr(s)){var u=A.start,l=A.end;if(void 0===l&&(l=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(l,s.value.length);else{var c=s.ownerDocument||document,f=c&&c.defaultView||window;if(f.getSelection){var h=f.getSelection(),d=s.textContent.length,p=Math.min(A.start,d),g=void 0===A.end?p:Math.min(A.end,d);!h.extend&&p>g&&(a=g,g=p,p=a);var m=Zn(s,p),v=Zn(s,g);if(m&&v&&(1!==h.rangeCount||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var w=c.createRange();w.setStart(m.node,m.offset),h.removeAllRanges(),p>g?(h.addRange(w),h.extend(v.node,v.offset)):(w.setEnd(v.node,v.offset),h.addRange(w))}}}}for(c=[],h=s;h=h.parentNode;)1===h.nodeType&&c.push({element:h,left:h.scrollLeft,top:h.scrollTop});for("function"===typeof s.focus&&s.focus(),s=0;s<c.length;s++){var y=c[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}nf=!!tc,nc=tc=null}finally{nu=i,D.p=r,Q.T=n}}e.current=t,Fu=2}}function il(){if(2===Fu){Fu=0;var e=Eu,t=Su,n=0!==(8772&t.flags);if(0!==(8772&t.subtreeFlags)||n){n=Q.T,Q.T=null;var r=D.p;D.p=2;var i=nu;nu|=4;try{CA(e,t.alternate,t)}finally{nu=i,D.p=r,Q.T=n}}Fu=3}}function ol(){if(4===Fu||3===Fu){Fu=0,ee();var e=Eu,t=Su,n=ku,r=Nu;0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?Fu=5:(Fu=0,Su=Eu=null,al(e,e.pendingLanes));var i=e.pendingLanes;if(0===i&&(Cu=null),_e(n),t=t.stateNode,ce&&"function"===typeof ce.onCommitFiberRoot)try{ce.onCommitFiberRoot(le,t,void 0,128===(128&t.current.flags))}catch(A){}if(null!==r){t=Q.T,i=D.p,D.p=2,Q.T=null;try{for(var o=e.onRecoverableError,a=0;a<r.length;a++){var s=r[a];o(s.value,{componentStack:s.stack})}}finally{Q.T=t,D.p=i}}0!==(3&ku)&&sl(),Bl(e),i=e.pendingLanes,0!==(4194090&n)&&0!==(42&i)?e===Lu?Uu++:(Uu=0,Lu=e):Uu=0,xl(0,!1)}}function al(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Qi(t)))}function sl(e){return rl(),il(),ol(),Al()}function Al(){if(5!==Fu)return!1;var e=Eu,t=_u;_u=0;var n=_e(ku),r=Q.T,i=D.p;try{D.p=32>n?32:n,Q.T=null,n=Iu,Iu=null;var o=Eu,s=ku;if(Fu=0,Su=Eu=null,ku=0,0!==(6&nu))throw Error(a(331));var A=nu;if(nu|=4,JA(o.current),zA(o,o.current,s,n),nu=A,xl(0,!1),ce&&"function"===typeof ce.onPostCommitFiberRoot)try{ce.onPostCommitFiberRoot(le,o)}catch(u){}return!0}finally{D.p=i,Q.T=r,al(e,t)}}function ul(e,t,n){t=Cr(n,t),null!==(e=oo(e,t=xs(e.stateNode,t,2),2))&&(Fe(e,2),Bl(e))}function ll(e,t,n){if(3===e.tag)ul(e,e,n);else for(;null!==t;){if(3===t.tag){ul(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Cu||!Cu.has(r))){e=Cr(n,e),null!==(r=oo(t,n=Cs(2),2))&&(Fs(n,r,t,e),Fe(r,2),Bl(r));break}}t=t.return}}function cl(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new tu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(lu=!0,i.add(n),e=fl.bind(null,e,t,n),t.then(e,e))}function fl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ru===e&&(ou&n)===n&&(4===fu||3===fu&&(62914560&ou)===ou&&300>te()-bu?0===(2&nu)&&zu(e,0):pu|=n,mu===ou&&(mu=0)),Bl(e)}function hl(e,t){0===t&&(t=xe()),null!==(e=Nr(e,t))&&(Fe(e,t),Bl(e))}function dl(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),hl(e,n)}function pl(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==r&&r.delete(t),hl(e,n)}var gl=null,ml=null,vl=!1,wl=!1,yl=!1,bl=0;function Bl(e){e!==ml&&null===e.next&&(null===ml?gl=ml=e:ml=ml.next=e),wl=!0,vl||(vl=!0,cc(function(){0!==(6&nu)?J(re,Cl):Fl()}))}function xl(e,t){if(!yl&&wl){yl=!0;do{for(var n=!1,r=gl;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var o=0;else{var a=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-he(42|e)+1)-1,o=201326741&(o&=i&~(a&~s))?201326741&o|1:o?2|o:0}0!==o&&(n=!0,kl(r,o))}else o=ou,0===(3&(o=we(r,r===ru?o:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||ye(r,o)||(n=!0,kl(r,o));r=r.next}}while(n);yl=!1}}function Cl(){Fl()}function Fl(){wl=vl=!1;var e=0;0!==bl&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==sc&&(sc=e,!0);return sc=null,!1}()&&(e=bl),bl=0);for(var t=te(),n=null,r=gl;null!==r;){var i=r.next,o=El(r,t);0===o?(r.next=null,null===n?gl=i:n.next=i,null===i&&(ml=n)):(n=r,(0!==e||0!==(3&o))&&(wl=!0)),r=i}xl(e,!1)}function El(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=-62914561&e.pendingLanes;0<o;){var a=31-he(o),s=1<<a,A=i[a];-1===A?0!==(s&n)&&0===(s&r)||(i[a]=be(s,t)):A<=t&&(e.expiredLanes|=s),o&=~s}if(n=ou,n=we(e,e===(t=ru)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===au||9===au)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&Z(r),e.callbackNode=null,e.callbackPriority=0;if(0===(3&n)||ye(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&Z(r),_e(n)){case 2:case 8:n=ie;break;case 32:default:n=oe;break;case 268435456:n=se}return r=Sl.bind(null,e),n=J(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&Z(r),e.callbackPriority=2,e.callbackNode=null,2}function Sl(e,t){if(0!==Fu&&5!==Fu)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(sl()&&e.callbackNode!==n)return null;var r=ou;return 0===(r=we(e,e===ru?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Tu(e,r,t),El(e,te()),null!=e.callbackNode&&e.callbackNode===n?Sl.bind(null,e):null)}function kl(e,t){if(sl())return null;Tu(e,t,!0)}function _l(){return 0===bl&&(bl=Be()),bl}function Il(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:_t(""+e)}function Nl(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Ul=0;Ul<br.length;Ul++){var Ll=br[Ul];Br(Ll.toLowerCase(),"on"+(Ll[0].toUpperCase()+Ll.slice(1)))}Br(hr,"onAnimationEnd"),Br(dr,"onAnimationIteration"),Br(pr,"onAnimationStart"),Br("dblclick","onDoubleClick"),Br("focusin","onFocus"),Br("focusout","onBlur"),Br(gr,"onTransitionRun"),Br(mr,"onTransitionStart"),Br(vr,"onTransitionCancel"),Br(wr,"onTransitionEnd"),Xe("onMouseEnter",["mouseout","mouseover"]),Xe("onMouseLeave",["mouseout","mouseover"]),Xe("onPointerEnter",["pointerout","pointerover"]),Xe("onPointerLeave",["pointerout","pointerover"]),qe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qe("onBeforeInput",["compositionend","keypress","textInput","paste"]),qe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dl=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ql));function Rl(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],A=s.instance,u=s.currentTarget;if(s=s.listener,A!==o&&i.isPropagationStopped())break e;o=s,i.currentTarget=u;try{o(i)}catch(l){ms(l)}i.currentTarget=null,o=A}else for(a=0;a<r.length;a++){if(A=(s=r[a]).instance,u=s.currentTarget,s=s.listener,A!==o&&i.isPropagationStopped())break e;o=s,i.currentTarget=u;try{o(i)}catch(l){ms(l)}i.currentTarget=null,o=A}}}}function Tl(e,t){var n=t[De];void 0===n&&(n=t[De]=new Set);var r=e+"__bubble";n.has(r)||(Hl(t,e,2,!1),n.add(r))}function Pl(e,t,n){var r=0;t&&(r|=4),Hl(n,e,r,t)}var Ol="_reactListening"+Math.random().toString(36).slice(2);function Ml(e){if(!e[Ol]){e[Ol]=!0,Ve.forEach(function(t){"selectionchange"!==t&&(Dl.has(t)||Pl(t,!1,e),Pl(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ol]||(t[Ol]=!0,Pl("selectionchange",!1,t))}}function Hl(e,t,n,r){switch(lf(t)){case 2:var i=rf;break;case 8:i=of;break;default:i=af}n=i.bind(null,t,n,e),i=void 0,!Ot||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jl(e,t,n,r,i){var o=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i)break;if(4===a)for(a=r.return;null!==a;){var u=a.tag;if((3===u||4===u)&&a.stateNode.containerInfo===i)return;a=a.return}for(;null!==s;){if(null===(a=He(s)))return;if(5===(u=a.tag)||6===u||26===u||27===u){r=o=a;continue e}s=s.parentNode}}r=r.return}Rt(function(){var r=o,i=Nt(n),a=[];e:{var s=yr.get(e);if(void 0!==s){var u=$t,l=e;switch(e){case"keypress":if(0===Wt(n))break e;case"keydown":case"keyup":u=pn;break;case"focusin":l="focus",u=an;break;case"focusout":l="blur",u=an;break;case"beforeblur":case"afterblur":u=an;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=rn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=on;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=mn;break;case hr:case dr:case pr:u=sn;break;case wr:u=vn;break;case"scroll":case"scrollend":u=tn;break;case"wheel":u=wn;break;case"copy":case"cut":case"paste":u=An;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=gn;break;case"toggle":case"beforetoggle":u=yn}var c=0!==(4&t),f=!c&&("scroll"===e||"scrollend"===e),h=c?null!==s?s+"Capture":null:s;c=[];for(var d,p=r;null!==p;){var g=p;if(d=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===d||null===h||null!=(g=Tt(p,h))&&c.push(zl(p,g,d)),f)break;p=p.return}0<c.length&&(s=new u(s,l,null,n,i),a.push({event:s,listeners:c}))}}if(0===(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===It||!(l=n.relatedTarget||n.fromElement)||!He(l)&&!l[Qe])&&(u||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(l=(l=n.relatedTarget||n.toElement)?He(l):null)&&(f=A(l),c=l.tag,l!==f||5!==c&&27!==c&&6!==c)&&(l=null)):(u=null,l=r),u!==l)){if(c=rn,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=gn,g="onPointerLeave",h="onPointerEnter",p="pointer"),f=null==u?s:ze(u),d=null==l?s:ze(l),(s=new c(g,p+"leave",u,n,i)).target=f,s.relatedTarget=d,g=null,He(i)===r&&((c=new c(h,p+"enter",l,n,i)).target=d,c.relatedTarget=f,g=c),f=g,u&&l)e:{for(h=l,p=0,d=c=u;d;d=Wl(d))p++;for(d=0,g=h;g;g=Wl(g))d++;for(;0<p-d;)c=Wl(c),p--;for(;0<d-p;)h=Wl(h),d--;for(;p--;){if(c===h||null!==h&&c===h.alternate)break e;c=Wl(c),h=Wl(h)}c=null}else c=null;null!==u&&Vl(a,s,u,c,!1),null!==l&&null!==f&&Vl(a,f,l,c,!0)}if("select"===(u=(s=r?ze(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var m=Pn;else if(Un(s))if(On)m=qn;else{m=Vn;var v=Wn}else!(u=s.nodeName)||"input"!==u.toLowerCase()||"checkbox"!==s.type&&"radio"!==s.type?r&&Et(r.elementType)&&(m=Pn):m=Gn;switch(m&&(m=m(e,r))?Ln(a,m,n,i):(v&&v(e,s,r),"focusout"===e&&r&&"number"===s.type&&null!=r.memoizedProps.value&&vt(s,"number",s.value)),v=r?ze(r):window,e){case"focusin":(Un(v)||"true"===v.contentEditable)&&(rr=v,ir=r,or=null);break;case"focusout":or=ir=rr=null;break;case"mousedown":ar=!0;break;case"contextmenu":case"mouseup":case"dragend":ar=!1,sr(a,n,i);break;case"selectionchange":if(nr)break;case"keydown":case"keyup":sr(a,n,i)}var w;if(Bn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else In?kn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(Fn&&"ko"!==n.locale&&(In||"onCompositionStart"!==y?"onCompositionEnd"===y&&In&&(w=Kt()):(jt="value"in(Ht=i)?Ht.value:Ht.textContent,In=!0)),0<(v=Kl(r,y)).length&&(y=new un(y,e,null,n,i),a.push({event:y,listeners:v}),w?y.data=w:null!==(w=_n(n))&&(y.data=w))),(w=Cn?function(e,t){switch(e){case"compositionend":return _n(t);case"keypress":return 32!==t.which?null:(Sn=!0,En);case"textInput":return(e=t.data)===En&&Sn?null:e;default:return null}}(e,n):function(e,t){if(In)return"compositionend"===e||!Bn&&kn(e,t)?(e=Kt(),zt=jt=Ht=null,In=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(y=Kl(r,"onBeforeInput")).length&&(v=new un("onBeforeInput","beforeinput",null,n,i),a.push({event:v,listeners:y}),v.data=w)),function(e,t,n,r,i){if("submit"===t&&n&&n.stateNode===i){var o=Il((i[Le]||null).action),a=r.submitter;a&&null!==(t=(t=a[Le]||null)?Il(t.formAction):a.getAttribute("formAction"))&&(o=t,a=null);var s=new $t("action","action",null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==bl){var e=a?Nl(i,a):new FormData(i);Na(n,{pending:!0,data:e,method:i.method,action:o},null,e)}}else"function"===typeof o&&(s.preventDefault(),e=a?Nl(i,a):new FormData(i),Na(n,{pending:!0,data:e,method:i.method,action:o},o,e))},currentTarget:i}]})}}(a,e,r,n,i)}Rl(a,t)})}function zl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kl(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;if(5!==(i=i.tag)&&26!==i&&27!==i||null===o||(null!=(i=Tt(e,n))&&r.unshift(zl(e,i,o)),null!=(i=Tt(e,t))&&r.push(zl(e,i,o))),3===e.tag)return r;e=e.return}return[]}function Wl(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Vl(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,A=s.alternate,u=s.stateNode;if(s=s.tag,null!==A&&A===r)break;5!==s&&26!==s&&27!==s||null===u||(A=u,i?null!=(u=Tt(n,o))&&a.unshift(zl(n,u,A)):i||null!=(u=Tt(n,o))&&a.push(zl(n,u,A))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Gl=/\r\n?/g,ql=/\u0000|\uFFFD/g;function Xl(e){return("string"===typeof e?e:""+e).replace(Gl,"\n").replace(ql,"")}function Yl(e,t){return t=Xl(t),Xl(e)===t}function Jl(){}function Zl(e,t,n,r,i,o){switch(n){case"children":"string"===typeof r?"body"===t||"textarea"===t&&""===r||Bt(e,r):("number"===typeof r||"bigint"===typeof r)&&"body"!==t&&Bt(e,""+r);break;case"className":nt(e,"class",r);break;case"tabIndex":nt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":nt(e,n,r);break;case"style":Ft(e,r,o);break;case"data":if("object"!==t){nt(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"===typeof r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=_t(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"===typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof o&&("formAction"===n?("input"!==t&&Zl(e,t,"name",i.name,i,null),Zl(e,t,"formEncType",i.formEncType,i,null),Zl(e,t,"formMethod",i.formMethod,i,null),Zl(e,t,"formTarget",i.formTarget,i,null)):(Zl(e,t,"encType",i.encType,i,null),Zl(e,t,"method",i.method,i,null),Zl(e,t,"target",i.target,i,null))),null==r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=_t(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Jl);break;case"onScroll":null!=r&&Tl("scroll",e);break;case"onScrollEnd":null!=r&&Tl("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(a(61));if(null!=(n=r.__html)){if(null!=i.children)throw Error(a(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"muted":e.muted=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"===typeof r||"boolean"===typeof r||"symbol"===typeof r){e.removeAttribute("xlink:href");break}n=_t(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!==typeof r&&"symbol"!==typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"===typeof r||"symbol"===typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Tl("beforetoggle",e),Tl("toggle",e),tt(e,"popover",r);break;case"xlinkActuate":rt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":rt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":rt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":rt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":rt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":rt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":rt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":rt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":rt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":tt(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&tt(e,n=St.get(n)||n,r)}}function $l(e,t,n,r,i,o){switch(n){case"style":Ft(e,r,o);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(a(61));if(null!=(n=r.__html)){if(null!=i.children)throw Error(a(60));e.innerHTML=n}}break;case"children":"string"===typeof r?Bt(e,r):("number"===typeof r||"bigint"===typeof r)&&Bt(e,""+r);break;case"onScroll":null!=r&&Tl("scroll",e);break;case"onScrollEnd":null!=r&&Tl("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Jl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ge.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),"function"===typeof(o=null!=(o=e[Le]||null)?o[n]:null)&&e.removeEventListener(t,o,i),"function"!==typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):tt(e,n,r):("function"!==typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i)))}}function ec(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tl("error",e),Tl("load",e);var r,i=!1,o=!1;for(r in n)if(n.hasOwnProperty(r)){var s=n[r];if(null!=s)switch(r){case"src":i=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Zl(e,t,r,s,n,null)}}return o&&Zl(e,t,"srcSet",n.srcSet,n,null),void(i&&Zl(e,t,"src",n.src,n,null));case"input":Tl("invalid",e);var A=r=s=o=null,u=null,l=null;for(i in n)if(n.hasOwnProperty(i)){var c=n[i];if(null!=c)switch(i){case"name":o=c;break;case"type":s=c;break;case"checked":u=c;break;case"defaultChecked":l=c;break;case"value":r=c;break;case"defaultValue":A=c;break;case"children":case"dangerouslySetInnerHTML":if(null!=c)throw Error(a(137,t));break;default:Zl(e,t,i,c,n,null)}}return mt(e,r,A,u,l,s,o,!1),void ct(e);case"select":for(o in Tl("invalid",e),i=s=r=null,n)if(n.hasOwnProperty(o)&&null!=(A=n[o]))switch(o){case"value":r=A;break;case"defaultValue":s=A;break;case"multiple":i=A;default:Zl(e,t,o,A,n,null)}return t=r,n=s,e.multiple=!!i,void(null!=t?wt(e,!!i,t,!1):null!=n&&wt(e,!!i,n,!0));case"textarea":for(s in Tl("invalid",e),r=o=i=null,n)if(n.hasOwnProperty(s)&&null!=(A=n[s]))switch(s){case"value":i=A;break;case"defaultValue":o=A;break;case"children":r=A;break;case"dangerouslySetInnerHTML":if(null!=A)throw Error(a(91));break;default:Zl(e,t,s,A,n,null)}return bt(e,i,o,r),void ct(e);case"option":for(u in n)if(n.hasOwnProperty(u)&&null!=(i=n[u]))if("selected"===u)e.selected=i&&"function"!==typeof i&&"symbol"!==typeof i;else Zl(e,t,u,i,n,null);return;case"dialog":Tl("beforetoggle",e),Tl("toggle",e),Tl("cancel",e),Tl("close",e);break;case"iframe":case"object":Tl("load",e);break;case"video":case"audio":for(i=0;i<Ql.length;i++)Tl(Ql[i],e);break;case"image":Tl("error",e),Tl("load",e);break;case"details":Tl("toggle",e);break;case"embed":case"source":case"link":Tl("error",e),Tl("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(l in n)if(n.hasOwnProperty(l)&&null!=(i=n[l]))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Zl(e,t,l,i,n,null)}return;default:if(Et(t)){for(c in n)n.hasOwnProperty(c)&&(void 0!==(i=n[c])&&$l(e,t,c,i,n,void 0));return}}for(A in n)n.hasOwnProperty(A)&&(null!=(i=n[A])&&Zl(e,t,A,i,n,null))}var tc=null,nc=null;function rc(e){return 9===e.nodeType?e:e.ownerDocument}function ic(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function oc(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function ac(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var sc=null;var Ac="function"===typeof setTimeout?setTimeout:void 0,uc="function"===typeof clearTimeout?clearTimeout:void 0,lc="function"===typeof Promise?Promise:void 0,cc="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof lc?function(e){return lc.resolve(null).then(e).catch(fc)}:Ac;function fc(e){setTimeout(function(){throw e})}function hc(e){return"head"===e}function dc(e,t){var n=t,r=0,i=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0<r&&8>r){n=r;var a=e.ownerDocument;if(1&n&&bc(a.documentElement),2&n&&bc(a.body),4&n)for(bc(n=a.head),a=n.firstChild;a;){var s=a.nextSibling,A=a.nodeName;a[Oe]||"SCRIPT"===A||"STYLE"===A||"LINK"===A&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=s}}if(0===i)return e.removeChild(o),void kf(t);i--}else"$"===n||"$?"===n||"$!"===n?i++:r=n.charCodeAt(0)-48;else r=0;n=o}while(n);kf(t)}function pc(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":pc(n),Me(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function gc(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function mc(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var vc=null;function wc(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function yc(e,t,n){switch(t=rc(n),e){case"html":if(!(e=t.documentElement))throw Error(a(452));return e;case"head":if(!(e=t.head))throw Error(a(453));return e;case"body":if(!(e=t.body))throw Error(a(454));return e;default:throw Error(a(451))}}function bc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Me(e)}var Bc=new Map,xc=new Set;function Cc(e){return"function"===typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Fc=D.d;D.d={f:function(){var e=Fc.f(),t=Hu();return e||t},r:function(e){var t=je(e);null!==t&&5===t.tag&&"form"===t.type?La(t):Fc.r(e)},D:function(e){Fc.D(e),Sc("dns-prefetch",e,null)},C:function(e,t){Fc.C(e,t),Sc("preconnect",e,t)},L:function(e,t,n){Fc.L(e,t,n);var r=Ec;if(r&&e&&t){var i='link[rel="preload"][as="'+pt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(i+='[imagesrcset="'+pt(n.imageSrcSet)+'"]',"string"===typeof n.imageSizes&&(i+='[imagesizes="'+pt(n.imageSizes)+'"]')):i+='[href="'+pt(e)+'"]';var o=i;switch(t){case"style":o=_c(e);break;case"script":o=Uc(e)}Bc.has(o)||(e=f({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Bc.set(o,e),null!==r.querySelector(i)||"style"===t&&r.querySelector(Ic(o))||"script"===t&&r.querySelector(Lc(o))||(ec(t=r.createElement("link"),"link",e),We(t),r.head.appendChild(t)))}},m:function(e,t){Fc.m(e,t);var n=Ec;if(n&&e){var r=t&&"string"===typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+pt(r)+'"][href="'+pt(e)+'"]',o=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Uc(e)}if(!Bc.has(o)&&(e=f({rel:"modulepreload",href:e},t),Bc.set(o,e),null===n.querySelector(i))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Lc(o)))return}ec(r=n.createElement("link"),"link",e),We(r),n.head.appendChild(r)}}},X:function(e,t){Fc.X(e,t);var n=Ec;if(n&&e){var r=Ke(n).hoistableScripts,i=Uc(e),o=r.get(i);o||((o=n.querySelector(Lc(i)))||(e=f({src:e,async:!0},t),(t=Bc.get(i))&&Tc(e,t),We(o=n.createElement("script")),ec(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}},S:function(e,t,n){Fc.S(e,t,n);var r=Ec;if(r&&e){var i=Ke(r).hoistableStyles,o=_c(e);t=t||"default";var a=i.get(o);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Ic(o)))s.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bc.get(o))&&Rc(e,n);var A=a=r.createElement("link");We(A),ec(A,"link",e),A._p=new Promise(function(e,t){A.onload=e,A.onerror=t}),A.addEventListener("load",function(){s.loading|=1}),A.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Dc(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:s},i.set(o,a)}}},M:function(e,t){Fc.M(e,t);var n=Ec;if(n&&e){var r=Ke(n).hoistableScripts,i=Uc(e),o=r.get(i);o||((o=n.querySelector(Lc(i)))||(e=f({src:e,async:!0,type:"module"},t),(t=Bc.get(i))&&Tc(e,t),We(o=n.createElement("script")),ec(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}};var Ec="undefined"===typeof document?null:document;function Sc(e,t,n){var r=Ec;if(r&&"string"===typeof t&&t){var i=pt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"===typeof n&&(i+='[crossorigin="'+n+'"]'),xc.has(i)||(xc.add(i),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(i)&&(ec(t=r.createElement("link"),"link",e),We(t),r.head.appendChild(t)))}}function kc(e,t,n,r){var i,o,s,A,u=(u=K.current)?Cc(u):null;if(!u)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof n.precedence&&"string"===typeof n.href?(t=_c(n.href),(r=(n=Ke(u).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"===typeof n.href&&"string"===typeof n.precedence){e=_c(n.href);var l=Ke(u).hoistableStyles,c=l.get(e);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,c),(l=u.querySelector(Ic(e)))&&!l._p&&(c.instance=l,c.state.loading=5),Bc.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bc.set(e,n),l||(i=u,o=e,s=n,A=c.state,i.querySelector('link[rel="preload"][as="style"]['+o+"]")?A.loading=1:(o=i.createElement("link"),A.preload=o,o.addEventListener("load",function(){return A.loading|=1}),o.addEventListener("error",function(){return A.loading|=2}),ec(o,"link",s),We(o),i.head.appendChild(o))))),t&&null===r)throw Error(a(528,""));return c}if(t&&null!==r)throw Error(a(529,""));return null;case"script":return t=n.async,"string"===typeof(n=n.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=Uc(n),(r=(n=Ke(u).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function _c(e){return'href="'+pt(e)+'"'}function Ic(e){return'link[rel="stylesheet"]['+e+"]"}function Nc(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Uc(e){return'[src="'+pt(e)+'"]'}function Lc(e){return"script[async]"+e}function Qc(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+pt(n.href)+'"]');if(r)return t.instance=r,We(r),r;var i=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return We(r=(e.ownerDocument||e).createElement("style")),ec(r,"style",i),Dc(r,n.precedence,e),t.instance=r;case"stylesheet":i=_c(n.href);var o=e.querySelector(Ic(i));if(o)return t.state.loading|=4,t.instance=o,We(o),o;r=Nc(n),(i=Bc.get(i))&&Rc(r,i),We(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ec(o,"link",r),t.state.loading|=4,Dc(o,n.precedence,e),t.instance=o;case"script":return o=Uc(n.src),(i=e.querySelector(Lc(o)))?(t.instance=i,We(i),i):(r=n,(i=Bc.get(o))&&Tc(r=f({},n),i),We(i=(e=e.ownerDocument||e).createElement("script")),ec(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(a(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Dc(r,n.precedence,e));return t.instance}function Dc(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,o=i,a=0;a<r.length;a++){var s=r[a];if(s.dataset.precedence===t)o=s;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Rc(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Tc(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Pc=null;function Oc(e,t,n){if(null===Pc){var r=new Map,i=Pc=new Map;i.set(n,r)}else(r=(i=Pc).get(n))||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Oe]||o[Ue]||"link"===e&&"stylesheet"===o.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==o.namespaceURI){var a=o.getAttribute(t)||"";a=e+a;var s=r.get(a);s?s.push(o):r.set(a,[o])}}return r}function Mc(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function Hc(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var jc=null;function zc(){}function Kc(){if(this.count--,0===this.count)if(this.stylesheets)Vc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Wc=null;function Vc(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Wc=new Map,t.forEach(Gc,e),Wc=null,Kc.call(e))}function Gc(e,t){if(!(4&t.state.loading)){var n=Wc.get(e);if(n)var r=n.get(null);else{n=new Map,Wc.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var a=i[o];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}a=(i=t.instance).getAttribute("data-precedence"),(o=n.get(a)||r)===r&&n.set(null,i),n.set(a,i),this.count++,r=Kc.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),o?o.parentNode.insertBefore(i,o.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var qc={$$typeof:b,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function Xc(e,t,n,r,i,o,a,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ce(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ce(0),this.hiddenUpdates=Ce(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function Yc(e,t,n,r,i,o,a,s,A,u,l,c){return e=new Xc(e,t,n,a,s,A,u,c),t=1,!0===o&&(t|=24),o=Rr(3,null,null,t),e.current=o,o.stateNode=e,(t=Li()).refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},no(o),e}function Jc(e){return e?e=Qr:Qr}function Zc(e,t,n,r,i,o){i=Jc(i),null===r.context?r.context=i:r.pendingContext=i,(r=io(t)).payload={element:n},null!==(o=void 0===o?null:o)&&(r.callback=o),null!==(n=oo(e,r,t))&&(Ru(n,0,t),ao(n,e,t))}function $c(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ef(e,t){$c(e,t),(e=e.alternate)&&$c(e,t)}function tf(e){if(13===e.tag){var t=Nr(e,67108864);null!==t&&Ru(t,0,67108864),ef(e,67108864)}}var nf=!0;function rf(e,t,n,r){var i=Q.T;Q.T=null;var o=D.p;try{D.p=2,af(e,t,n,r)}finally{D.p=o,Q.T=i}}function of(e,t,n,r){var i=Q.T;Q.T=null;var o=D.p;try{D.p=8,af(e,t,n,r)}finally{D.p=o,Q.T=i}}function af(e,t,n,r){if(nf){var i=sf(r);if(null===i)jl(e,t,r,Af,n),wf(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return ff=yf(ff,e,t,n,r,i),!0;case"dragenter":return hf=yf(hf,e,t,n,r,i),!0;case"mouseover":return df=yf(df,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return pf.set(o,yf(pf.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,gf.set(o,yf(gf.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(wf(e,r),4&t&&-1<vf.indexOf(e)){for(;null!==i;){var o=je(i);if(null!==o)switch(o.tag){case 3:if((o=o.stateNode).current.memoizedState.isDehydrated){var a=ve(o.pendingLanes);if(0!==a){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var A=1<<31-he(a);s.entanglements[1]|=A,a&=~A}Bl(o),0===(6&nu)&&(Bu=te()+500,xl(0,!1))}}break;case 13:null!==(s=Nr(o,2))&&Ru(s,0,2),Hu(),ef(o,2)}if(null===(o=sf(r))&&jl(e,t,r,Af,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else jl(e,t,r,null,n)}}function sf(e){return uf(e=Nt(e))}var Af=null;function uf(e){if(Af=null,null!==(e=He(e))){var t=A(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=u(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Af=e,null}function lf(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ne()){case re:return 2;case ie:return 8;case oe:case ae:return 32;case se:return 268435456;default:return 32}default:return 32}}var cf=!1,ff=null,hf=null,df=null,pf=new Map,gf=new Map,mf=[],vf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function wf(e,t){switch(e){case"focusin":case"focusout":ff=null;break;case"dragenter":case"dragleave":hf=null;break;case"mouseover":case"mouseout":df=null;break;case"pointerover":case"pointerout":pf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gf.delete(t.pointerId)}}function yf(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=je(t))&&tf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function bf(e){var t=He(e.target);if(null!==t){var n=A(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=u(n)))return e.blockedOn=t,void function(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}(e.priority,function(){if(13===n.tag){var e=Qu();e=ke(e);var t=Nr(n,e);null!==t&&Ru(t,0,e),ef(n,e)}})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=sf(e.nativeEvent);if(null!==n)return null!==(t=je(n))&&tf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);It=r,n.target.dispatchEvent(r),It=null,t.shift()}return!0}function xf(e,t,n){Bf(e)&&n.delete(t)}function Cf(){cf=!1,null!==ff&&Bf(ff)&&(ff=null),null!==hf&&Bf(hf)&&(hf=null),null!==df&&Bf(df)&&(df=null),pf.forEach(xf),gf.forEach(xf)}function Ff(e,t){e.blockedOn===t&&(e.blockedOn=null,cf||(cf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Cf)))}var Ef=null;function Sf(e){Ef!==e&&(Ef=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Ef===e&&(Ef=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if("function"!==typeof r){if(null===uf(r||n))continue;break}var o=je(n);null!==o&&(e.splice(t,3),t-=3,Na(o,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function kf(e){function t(t){return Ff(t,e)}null!==ff&&Ff(ff,e),null!==hf&&Ff(hf,e),null!==df&&Ff(df,e),pf.forEach(t),gf.forEach(t);for(var n=0;n<mf.length;n++){var r=mf[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<mf.length&&null===(n=mf[0]).blockedOn;)bf(n),null===n.blockedOn&&mf.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var i=n[r],o=n[r+1],a=i[Le]||null;if("function"===typeof o)a||Sf(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(i=o,a=o[Le]||null)s=a.formAction;else if(null!==uf(i))continue}else s=a.action;"function"===typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Sf(n)}}}function _f(e){this._internalRoot=e}function If(e){this._internalRoot=e}If.prototype.render=_f.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Zc(t.current,Qu(),e,t,null,null)},If.prototype.unmount=_f.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zc(e.current,2,null,e,null,null),Hu(),t[Qe]=null}},If.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ie();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mf.length&&0!==t&&t<mf[n].priority;n++);mf.splice(n,0,e),0===n&&bf(e)}};var Nf=i.version;if("19.1.1"!==Nf)throw Error(a(527,Nf,"19.1.1"));D.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=A(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return l(i),e;if(o===r)return l(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?c(e):null)?null:e.stateNode};var Uf={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.1.1"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Lf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lf.isDisabled&&Lf.supportsFiber)try{le=Lf.inject(Uf),ce=Lf}catch(Df){}}t.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r="",i=vs,o=ws,A=ys;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(i=t.onUncaughtError),void 0!==t.onCaughtError&&(o=t.onCaughtError),void 0!==t.onRecoverableError&&(A=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=Yc(e,1,!1,null,0,n,r,i,o,A,0,null),e[Qe]=t.current,Ml(e),new _f(t)},t.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i="",o=vs,A=ws,u=ys,l=null;return null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onUncaughtError&&(o=n.onUncaughtError),void 0!==n.onCaughtError&&(A=n.onCaughtError),void 0!==n.onRecoverableError&&(u=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(l=n.formState)),(t=Yc(e,1,!0,t,0,r,i,o,A,u,0,l)).context=Jc(null),n=t.current,(i=io(r=ke(r=Qu()))).callback=null,oo(n,i,r),n=r,t.current.lanes=n,Fe(t,n),Bl(t),e[Qe]=t.current,Ml(e),new If(t)},t.version="19.1.1"},7318:()=>{},7950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(6672)},8082:()=>{},8853:(e,t,n)=>{"use strict";e.exports=n(5896)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,i){if(1&i&&(r=this(r)),8&i)return r;if("object"===typeof r&&r){if(4&i&&r.__esModule)return r;if(16&i&&"function"===typeof r.then)return r}var o=Object.create(null);n.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>r[e]);return a.default=()=>r,n.d(o,a),o}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>"static/js/"+e+"."+{455:"8da17214",977:"2e3d5464"}[e]+".chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="client:";n.l=(r,i,o,a)=>{if(e[r])e[r].push(i);else{var s,A;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var c=u[l];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==t+o){s=c;break}}s||(A=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+o),s.src=r),e[r]=[i];var f=(t,n)=>{s.onerror=s.onload=null,clearTimeout(h);var i=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach(e=>e(n)),t)return t(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),A&&document.head.appendChild(s)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/elixifyskinanalyser/",(()=>{var e={792:0};n.f.j=(t,r)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var o=new Promise((n,r)=>i=e[t]=[n,r]);r.push(i[2]=o);var a=n.p+n.u(t),s=new Error;n.l(a,r=>{if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,i[1](s)}},"chunk-"+t,t)}};var t=(t,r)=>{var i,o,a=r[0],s=r[1],A=r[2],u=0;if(a.some(t=>0!==e[t])){for(i in s)n.o(s,i)&&(n.m[i]=s[i]);if(A)A(n)}for(t&&t(r);u<a.length;u++)o=a[u],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkclient=self.webpackChunkclient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),(()=>{"use strict";var e=n(5043),t=n(4391),r=n(6159),i=n.n(r),o={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=e.createContext&&e.createContext(o),s=["attr","size","title"];function A(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(t){return t&&t.map((t,n)=>e.createElement(t.tag,c({key:n},t.attr),h(t.child)))}function d(t){return n=>e.createElement(p,u({attr:c({},t.attr)},n),h(t.child))}function p(t){var n=n=>{var r,{attr:i,size:o,title:a}=t,l=A(t,s),f=o||n.size||"1em";return n.className&&(r=n.className),t.className&&(r=(r?r+" ":"")+t.className),e.createElement("svg",u({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,l,{className:r,style:c(c({color:t.color||n.color},n.style),t.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),a&&e.createElement("title",null,a),t.children)};return void 0!==a?e.createElement(a.Consumer,null,e=>n(e)):n(o)}function g(e){return d({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C132.288 32 32 132.288 32 256s100.288 224 224 224 224-100.288 224-224S379.712 32 256 32zm135.765 359.765C355.5 428.028 307.285 448 256 448s-99.5-19.972-135.765-56.235C83.972 355.5 64 307.285 64 256s19.972-99.5 56.235-135.765C156.5 83.972 204.715 64 256 64s99.5 19.972 135.765 56.235C428.028 156.5 448 204.715 448 256s-19.972 99.5-56.235 135.765z"},child:[]},{tag:"path",attr:{d:"M200.043 106.067c-40.631 15.171-73.434 46.382-90.717 85.933H256l-55.957-85.933zM412.797 288A160.723 160.723 0 0 0 416 256c0-36.624-12.314-70.367-33.016-97.334L311 288h101.797zM359.973 134.395C332.007 110.461 295.694 96 256 96c-7.966 0-15.794.591-23.448 1.715L310.852 224l49.121-89.605zM99.204 224A160.65 160.65 0 0 0 96 256c0 36.639 12.324 70.394 33.041 97.366L201 224H99.204zM311.959 405.932c40.631-15.171 73.433-46.382 90.715-85.932H256l55.959 85.932zM152.046 377.621C180.009 401.545 216.314 416 256 416c7.969 0 15.799-.592 23.456-1.716L201.164 288l-49.118 89.621z"},child:[]}]})(e)}const m="https://digifox.studio";var v=function(e,t){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e,t){function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function y(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{A(r.next(e))}catch(e){o(e)}}function s(e){try{A(r.throw(e))}catch(e){o(e)}}function A(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}A((r=r.apply(e,t||[])).next())})}function b(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var B=function(){function e(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return e.prototype.setPlatform=function(e,t){null!=this.platform&&console.warn("Platform "+this.platformName+" has already been set. Overwriting the platform with "+t+"."),this.platformName=e,this.platform=t},e.prototype.registerFlag=function(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){var r=this.urlFlags[e];console.warn("Setting feature override from URL "+e+": "+r+"."),this.set(e,r)}},e.prototype.get=function(e){return e in this.flags||(this.flags[e]=this.evaluateFlag(e)),this.flags[e]},e.prototype.getNumber=function(e){return this.get(e)},e.prototype.getBool=function(e){return this.get(e)},e.prototype.getFlags=function(){return this.flags},Object.defineProperty(e.prototype,"features",{get:function(){return this.flags},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t){if(null==this.flagRegistry[e])throw new Error("Cannot set flag "+e+" as it has not been registered.");this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)},e.prototype.evaluateFlag=function(e){if(null==this.flagRegistry[e])throw new Error("Cannot evaluate flag '"+e+"': no evaluation function found.");return this.flagRegistry[e].evaluationFn()},e.prototype.setFlags=function(e){this.flags=Object.assign({},e)},e.prototype.reset=function(){this.flags={},this.urlFlags={},this.populateURLFlags()},e.prototype.populateURLFlags=function(){var e=this;if(void 0!==this.global&&void 0!==this.global.location&&void 0!==this.global.location.search){var t,n,r=(t=this.global.location.search,n={},t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(n,t[0],t[1]),t.join("=")}),n);"tfjsflags"in r&&r.tfjsflags.split(",").forEach(function(t){var n=t.split(":"),r=n[0],i=n[1];e.urlFlags[r]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error("Could not parse value flag value "+t+" for flag "+e+".")}(r,i)})}},e}();function x(){return C}var C=null,F=new Map,E=new Map;function S(e,t){var n=N(e,t);return F.get(n)}function k(e){for(var t=F.entries(),n=[];;){var r=t.next(),i=r.done,o=r.value;if(i)break;var a=o[0],s=o[1];a.split("_")[0]===e&&n.push(s)}return n}function _(e){var t=e.kernelName,n=e.backendName,r=N(t,n);if(F.has(r))throw new Error("The kernel '"+t+"' for backend '"+n+"' is already registered");F.set(r,e)}function I(e){var t=e.kernelName;E.has(t)&&console.warn("Overriding the gradient for '"+t+"'"),E.set(t,e)}function N(e,t){return t+"_"+e}function U(e){for(var t=e.length,n=0,r=0;t>0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function L(e,t,n){return Math.max(e,Math.min(t,n))}function Q(e){return e%2==0?e:e+1}function D(e){for(var t=0,n=0;n<e.length;n++)t+=e[n];return t}function R(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function T(e,t,n){void 0===n&&(n=""),R(H(e,t),function(){return n+" Shapes "+e+" and "+t+" must match"})}function P(e){R(null!=e,function(){return"The input to the tensor constructor must be a non-null value."})}function O(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=!1),null==t&&(t=[]),Array.isArray(e)||te(e)&&!n)for(var r=0;r<e.length;++r)O(e[r],t,n);else t.push(e);return t}function M(e){if(0===e.length)return 1;for(var t=e[0],n=1;n<e.length;n++)t*=e[n];return t}function H(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function j(e){return e%1==0}function z(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;var t=Math.exp(2*e);return(t-1)/(t+1)}function K(e){var t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function W(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function V(e,t,n){return void 0===t&&(t=function(e){return 0}),new Promise(function(r,i){var o=0,a=function(){if(e())r();else{o++;var s=t(o);null!=n&&o>=n?i():setTimeout(a,s)}};a()})}function G(e,t){for(var n=1,r=-1,i=0;i<e.length;++i)if(e[i]>=0)n*=e[i];else if(-1===e[i]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found -1 at dim "+r+" and dim "+i);r=i}else if(e[i]<0)throw Error("Shapes can not be < 0. Found "+e[i]+" at dim "+i);if(-1===r){if(t>0&&t!==n)throw Error("Size("+t+") must match the product of shape "+e);return e}if(0===n)throw Error("Cannot infer the missing size in ["+e+"] when there are 0 elements");if(t%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+t+" / "+n);var o=e.slice();return o[r]=t/n,o}function q(e,t){var n=t.length;return R((e=null==e?t.map(function(e,t){return t}):[].concat(e)).every(function(e){return e>=-n&&e<n}),function(){return"All values in axis param must be in range [-"+n+", "+n+") but got axis "+e}),R(e.every(function(e){return j(e)}),function(){return"All values in axis param must be integers but got axis "+e}),e.map(function(e){return e<0?n+e:e})}function X(e,t){for(var n=[],r=[],i=null!=t&&Array.isArray(t)&&0===t.length,o=null==t||i?null:q(t,e).sort(),a=0,s=0;s<e.length;++s){if(null!=o){if(o[a]===s&&1!==e[s])throw new Error("Can't squeeze axis "+s+" since its dim '"+e[s]+"' is not 1");(null==o[a]||o[a]>s)&&1===e[s]&&(n.push(e[s]),r.push(s)),o[a]<=s&&a++}1!==e[s]&&(n.push(e[s]),r.push(s))}return{newShape:n,keptDims:r}}function Y(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error("Unknown data type "+e);n=new Uint8Array(t)}return n}function J(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error("Unknown data type "+e);n=new Array(t)}return n}function Z(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type "+t+" being uploaded contains "+r+".")}}function $(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function ee(e,t){return"complex64"!==t&&("float32"!==t||"complex64"===e)&&("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)}function te(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array}function ne(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error("Unknown dtype "+e)}function re(e){if(null==e)return 0;var t=0;return e.forEach(function(e){return t+=e.length}),t}function ie(e){return"string"==typeof e||e instanceof String}function oe(e){return"boolean"==typeof e}function ae(e){return"number"==typeof e}function se(e){return Array.isArray(e)?se(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":ae(e)?"float32":ie(e)?"string":oe(e)?"bool":"float32"}function Ae(e){return!!(e&&e.constructor&&e.call&&e.apply)}function ue(e,t){for(var n=t;n<e;++n)if(e%n==0)return n;return e}function le(e){var t=e.length;if(t<2)return[];var n=new Array(t-1);n[t-2]=e[t-1];for(var r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function ce(e,t,n){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=O(e)),n&&Z(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){for(var r=new Uint8Array(e.length),i=0;i<r.length;++i)0!==Math.round(e[i])&&(r[i]=1);return r}throw new Error("Unknown data type "+t)}function fe(e,t){if(0===e.length)return t[0];var n=e.reduce(function(e,t){return e*t});if(0===n)return[];if(n!==t.length)throw new Error("["+e+"] does not match the input size.");return function e(t,n,r){var i=new Array;if(1===n.length)for(var o=n[0],a=0;a<o;a++)i[a]=r[t+a];else{o=n[0];var s=n.slice(1),A=s.reduce(function(e,t){return e*t});for(a=0;a<o;a++)i[a]=e(t+a*A,s,r)}return i}(0,e,t)}function he(e,t){for(var n=de(e,t),r=0;r<n.length;r++)n[r]=1;return n}function de(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error("Unknown data type "+t)}function pe(){return x().platform.now()}function ge(e){e.forEach(function(t){R(Number.isInteger(t)&&t>=0,function(){return"Tensor must have a shape comprised of positive integers but got shape ["+e+"]."})})}function me(e,t){return void 0===t&&(t="utf-8"),t=t||"utf-8",x().platform.encode(e,t)}function ve(e,t){return void 0===t&&(t="utf-8"),t=t||"utf-8",x().platform.decode(e,t)}function we(e,t,n){if(0===t)return 0;if(1===t)return e[0];for(var r=e[e.length-1],i=0;i<e.length-1;++i)r+=n[i]*e[i];return r}function ye(e,t,n){if(0===t)return[];if(1===t)return[e];for(var r=new Array(t),i=0;i<r.length-1;++i)r[i]=Math.floor(e/n[i]),e-=r[i]*n[i];return r[r.length-1]=e,r}Object.freeze({shuffle:U,clamp:L,nearestLargerEven:Q,sum:D,randUniform:function(e,t){var n=Math.random();return t*n+(1-n)*e},distSquared:function(e,t){for(var n=0,r=0;r<e.length;r++){var i=Number(e[r])-Number(t[r]);n+=i*i}return n},assert:R,assertShapesMatch:T,assertNonNull:P,flatten:O,sizeFromShape:M,isScalarShape:function(e){return 0===e.length},arraysEqual:H,isInt:j,tanh:z,sizeToSquarishShape:K,createShuffledIndices:function(e){for(var t=new Uint32Array(e),n=0;n<e;++n)t[n]=n;return U(t),t},rightPad:W,repeatedTry:V,inferFromImplicitShape:G,parseAxisParam:q,squeezeShape:X,getTypedArrayFromDType:Y,getArrayFromDType:J,checkConversionForErrors:Z,isValidDtype:$,hasEncodingLoss:ee,isTypedArray:te,bytesPerElement:ne,bytesFromStringArray:re,isString:ie,isBoolean:oe,isNumber:ae,inferDtype:se,isFunction:Ae,nearestDivisor:ue,computeStrides:le,toTypedArray:ce,toNestedArray:fe,makeOnesTypedArray:he,makeZerosTypedArray:de,now:pe,assertNonNegativeIntegerDimensions:ge,fetch:function(e,t){return x().platform.fetch(e,t)},encodeString:me,decodeString:ve,locToIndex:we,indexToLoc:ye});var be=function(){function e(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new Be)}return e.prototype.profileKernel=function(e,t,n){var r,i=this,o=this.backendTimer.time(function(){r=n()});return r.forEach(function(n){n.data().then(function(r){!function(e,t,n){if("float32"!==t)return!1;for(var r=0;r<e.length;r++){var i=e[r];if(isNaN(i)||!isFinite(i))return console.warn("Found "+i+" in the result of '"+n+"'"),!0}}(r,n.dtype,e),o.then(function(o){var a="";null!=o.getExtraProfileInfo&&(a=o.getExtraProfileInfo()),i.logger.logKernelProfile(e,n,r,o.kernelMs,t,a)})})}),r},e}(),Be=function(){function e(){}return e.prototype.logKernelProfile=function(e,t,n,r,i,o){var a="number"==typeof r?W(r+"ms",9):r.error,s=W(e,25),A=t.rank,u=t.size,l=W(t.shape.toString(),14),c="";for(var f in i){var h=i[f].shape||t.shape,d=h.length;c+=f+": "+d+"D "+(d>0?h:"")+" "}console.log("%c"+s+"\t%c"+a+"\t%c"+A+"D "+l+"\t%c"+u+"\t%c"+c+"\t%c"+o,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")},e}();function xe(e,t,n){return W(Array.isArray(e)?parseFloat(e[0].toFixed(7))+" + "+parseFloat(e[1].toFixed(7))+"j":ie(e)?"'"+e+"'":"bool"===n?Ce(e):parseFloat(e.toFixed(7)).toString(),t)}function Ce(e){return 0===e?"false":"true"}function Fe(e){for(var t=[],n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var Ee=function(){function e(e,t,n){var r=this;if(this.dtype=t,this.shape=e.slice(),this.size=M(e),null!=n){var i=n.length;R(i===this.size,function(){return"Length of values '"+i+"' does not match the size inferred by the shape '"+r.size+"'."})}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||J(t,this.size),this.strides=le(e)}return e.prototype.set=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];0===n.length&&(n=[0]),R(n.length===this.rank,function(){return"The number of provided coordinates ("+n.length+") must match the rank ("+t.rank+")"});var i=this.locToIndex(n);this.values[i]=e},e.prototype.get=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];0===e.length&&(e=[0]);for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];if(o<0||o>=this.shape[n]){var a="Requested out of range element at "+e+". Buffer shape="+this.shape;throw new Error(a)}n++}for(var s=e[e.length-1],A=0;A<e.length-1;++A)s+=this.strides[A]*e[A];return this.values[s]},e.prototype.locToIndex=function(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];for(var t=e[e.length-1],n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t},e.prototype.indexToLoc=function(e){if(0===this.rank)return[];if(1===this.rank)return[e];for(var t=new Array(this.shape.length),n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t},Object.defineProperty(e.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),e.prototype.toTensor=function(){return Se().makeTensor(this.values,this.shape,this.dtype)},e}(),Se=null,ke=null,_e=null,Ie=function(){function e(e,t,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=M(e),this.strides=le(e),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}return e.prototype.flatten=function(){return this.throwIfDisposed(),this.as1D()},e.prototype.asScalar=function(){return this.throwIfDisposed(),R(1===this.size,function(){return"The array must have only 1 element."}),this.reshape([])},e.prototype.as1D=function(){return this.throwIfDisposed(),this.reshape([this.size])},e.prototype.as2D=function(e,t){return this.throwIfDisposed(),this.reshape([e,t])},e.prototype.as3D=function(e,t,n){return this.throwIfDisposed(),this.reshape([e,t,n])},e.prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),this.reshape([e,t,n,r])},e.prototype.as5D=function(e,t,n,r,i){return this.throwIfDisposed(),this.reshape([e,t,n,r,i])},e.prototype.asType=function(e){return this.throwIfDisposed(),ke.cast(this,e)},Object.defineProperty(e.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),e.prototype.buffer=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,ke.buffer(this.shape,this.dtype,e)]}})})},e.prototype.bufferSync=function(){return ke.buffer(this.shape,this.dtype,this.dataSync())},e.prototype.array=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,fe(this.shape,e)]}})})},e.prototype.arraySync=function(){return fe(this.shape,this.dataSync())},e.prototype.data=function(){return y(this,void 0,void 0,function(){var e,t;return b(this,function(n){switch(n.label){case 0:return this.throwIfDisposed(),e=Se().read(this.dataId),"string"!==this.dtype?[3,2]:[4,e];case 1:t=n.sent();try{return[2,t.map(function(e){return ve(e)})]}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}case 2:return[2,e]}})})},e.prototype.dataSync=function(){this.throwIfDisposed();var e=Se().readSync(this.dataId);if("string"===this.dtype)try{return e.map(function(e){return ve(e)})}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e},e.prototype.bytes=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return this.throwIfDisposed(),[4,Se().read(this.dataId)];case 1:return e=t.sent(),"string"===this.dtype?[2,e]:[2,new Uint8Array(e.buffer)]}})})},e.prototype.dispose=function(){this.isDisposed||(Se().disposeTensor(this),this.isDisposedInternal=!0)},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.isDisposedInternal},enumerable:!0,configurable:!0}),e.prototype.throwIfDisposed=function(){if(this.isDisposed)throw new Error("Tensor is disposed.")},e.prototype.toFloat=function(){return this.asType("float32")},e.prototype.toInt=function(){return this.asType("int32")},e.prototype.toBool=function(){return this.asType("bool")},e.prototype.print=function(e){return void 0===e&&(e=!1),ke.print(this,e)},e.prototype.reshape=function(e){return this.throwIfDisposed(),ke.reshape(this,e)},e.prototype.reshapeAs=function(e){return this.throwIfDisposed(),this.reshape(e.shape)},e.prototype.expandDims=function(e){return void 0===e&&(e=0),ke.expandDims(this,e)},e.prototype.cumsum=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=!1),void 0===n&&(n=!1),ke.cumsum(this,e,t,n)},e.prototype.squeeze=function(e){return this.throwIfDisposed(),ke.squeeze(this,e)},e.prototype.clone=function(){return this.throwIfDisposed(),ke.clone(this)},e.prototype.oneHot=function(e,t,n){return this.throwIfDisposed(),ke.oneHot(this,e,t,n)},e.prototype.toString=function(e){return void 0===e&&(e=!1),function(e,t,n,r){var i=le(t),o=function(e,t,n,r){var i=M(t),o=r[r.length-1],a=new Array(o).fill(0),s=t.length,A="complex64"===n?Fe(e):e;if(s>1)for(var u=0;u<i/o;u++)for(var l=u*o,c=0;c<o;c++)a[c]=Math.max(a[c],xe(A[l+c],0,n).length);return a}(e,t,n,i),a=t.length,s=function e(t,n,r,i,o,a){void 0===a&&(a=!0);var s="complex64"===r?2:1,A=n[0],u=n.length;if(0===u)return"complex64"===r?[xe(Fe(t)[0],0,r)]:"bool"===r?[Ce(t[0])]:[t[0].toString()];if(1===u){if(A>20){var l=3*s,c=Array.from(t.slice(0,l)),f=Array.from(t.slice((A-3)*s,A*s));return"complex64"===r&&(c=Fe(c),f=Fe(f)),["["+c.map(function(e,t){return xe(e,o[t],r)}).join(", ")+", ..., "+f.map(function(e,t){return xe(e,o[A-3+t],r)}).join(", ")+"]"]}return["["+("complex64"===r?Fe(t):Array.from(t)).map(function(e,t){return xe(e,o[t],r)}).join(", ")+"]"]}var h=n.slice(1),d=i.slice(1),p=i[0]*s,g=[];if(A>20){for(var m=0;m<3;m++){var v=(w=m*p)+p;g.push.apply(g,e(t.slice(w,v),h,r,d,o,!1))}for(g.push("..."),m=A-3;m<A;m++)v=(w=m*p)+p,g.push.apply(g,e(t.slice(w,v),h,r,d,o,m===A-1))}else for(m=0;m<A;m++){var w;v=(w=m*p)+p,g.push.apply(g,e(t.slice(w,v),h,r,d,o,m===A-1))}var y=2===u?",":"";for(g[0]="["+g[0]+y,m=1;m<g.length-1;m++)g[m]=" "+g[m]+y;var b=",\n";for(m=2;m<u;m++)b+="\n";return g[g.length-1]=" "+g[g.length-1]+"]"+(a?"":b),g}(e,t,n,i,o),A=["Tensor"];return r&&(A.push(" dtype: "+n),A.push(" rank: "+a),A.push(" shape: ["+t+"]"),A.push(" values:")),A.push(s.map(function(e){return" "+e}).join("\n")),A.join("\n")}(this.dataSync(),this.shape,this.dtype,e)},e.prototype.tile=function(e){return this.throwIfDisposed(),ke.tile(this,e)},e.prototype.gather=function(e,t){return void 0===t&&(t=0),this.throwIfDisposed(),ke.gather(this,e,t)},e.prototype.matMul=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!1),this.throwIfDisposed(),ke.matMul(this,e,t,n)},e.prototype.dot=function(e){return this.throwIfDisposed(),ke.dot(this,e)},e.prototype.norm=function(e,t,n){return void 0===e&&(e="euclidean"),void 0===t&&(t=null),void 0===n&&(n=!1),this.throwIfDisposed(),ke.norm(this,e,t,n)},e.prototype.slice=function(e,t){return this.throwIfDisposed(),ke.slice(this,e,t)},e.prototype.reverse=function(e){return this.throwIfDisposed(),ke.reverse(this,e)},e.prototype.concat=function(t,n){return void 0===n&&(n=0),this.throwIfDisposed(),t instanceof e&&(t=[t]),ke.concat([this].concat(t),n)},e.prototype.split=function(e,t){return void 0===t&&(t=0),this.throwIfDisposed(),ke.split(this,e,t)},e.prototype.stack=function(e,t){return void 0===t&&(t=0),ke.stack([this,e],t)},e.prototype.unstack=function(e){return void 0===e&&(e=0),ke.unstack(this,e)},e.prototype.pad=function(e,t){return void 0===t&&(t=0),ke.pad(this,e,t)},e.prototype.batchNormalization=function(e,t,n,r,i){return void 0===n&&(n=.001),_e("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon"),this.batchNorm(e,t,i,r,n)},e.prototype.batchNorm=function(e,t,n,r,i){return void 0===i&&(i=.001),this.throwIfDisposed(),ke.batchNorm(this,e,t,n,r,i)},e.prototype.all=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.all(this,e,t)},e.prototype.any=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.any(this,e,t)},e.prototype.logSumExp=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.logSumExp(this,e,t)},e.prototype.sum=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.sum(this,e,t)},e.prototype.prod=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.prod(this,e,t)},e.prototype.mean=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.mean(this,e,t)},e.prototype.min=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.min(this,e,t)},e.prototype.max=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),ke.max(this,e,t)},e.prototype.argMin=function(e){return void 0===e&&(e=null),this.throwIfDisposed(),ke.argMin(this,e)},e.prototype.argMax=function(e){return void 0===e&&(e=null),this.throwIfDisposed(),ke.argMax(this,e)},e.prototype.cast=function(e){return this.throwIfDisposed(),ke.cast(this,e)},e.prototype.add=function(e){return this.throwIfDisposed(),ke.add(this,e)},e.prototype.addStrict=function(e){return this.throwIfDisposed(),ke.addStrict(this,e)},e.prototype.atan2=function(e){return this.throwIfDisposed(),ke.atan2(this,e)},e.prototype.sub=function(e){return this.throwIfDisposed(),ke.sub(this,e)},e.prototype.subStrict=function(e){return this.throwIfDisposed(),ke.subStrict(this,e)},e.prototype.pow=function(e){return this.throwIfDisposed(),ke.pow(this,e)},e.prototype.powStrict=function(e){return this.throwIfDisposed(),ke.powStrict(this,e)},e.prototype.mul=function(e){return this.throwIfDisposed(),ke.mul(this,e)},e.prototype.mulStrict=function(e){return this.throwIfDisposed(),ke.mulStrict(this,e)},e.prototype.div=function(e){return this.throwIfDisposed(),ke.div(this,e)},e.prototype.divNoNan=function(e){return this.throwIfDisposed(),ke.divNoNan(this,e)},e.prototype.floorDiv=function(e){return this.throwIfDisposed(),ke.floorDiv(this,e)},e.prototype.divStrict=function(e){return this.throwIfDisposed(),ke.divStrict(this,e)},e.prototype.minimum=function(e){return this.throwIfDisposed(),ke.minimum(this,e)},e.prototype.minimumStrict=function(e){return this.throwIfDisposed(),ke.minimumStrict(this,e)},e.prototype.maximum=function(e){return this.throwIfDisposed(),ke.maximum(this,e)},e.prototype.maximumStrict=function(e){return this.throwIfDisposed(),ke.maximumStrict(this,e)},e.prototype.mod=function(e){return this.throwIfDisposed(),ke.mod(this,e)},e.prototype.modStrict=function(e){return this.throwIfDisposed(),ke.modStrict(this,e)},e.prototype.squaredDifferenceStrict=function(e){return this.throwIfDisposed(),ke.squaredDifferenceStrict(this,e)},e.prototype.transpose=function(e){return this.throwIfDisposed(),ke.transpose(this,e)},e.prototype.notEqual=function(e){return this.throwIfDisposed(),ke.notEqual(this,e)},e.prototype.notEqualStrict=function(e){return this.throwIfDisposed(),ke.notEqualStrict(this,e)},e.prototype.less=function(e){return this.throwIfDisposed(),ke.less(this,e)},e.prototype.lessStrict=function(e){return this.throwIfDisposed(),ke.lessStrict(this,e)},e.prototype.equal=function(e){return this.throwIfDisposed(),ke.equal(this,e)},e.prototype.equalStrict=function(e){return this.throwIfDisposed(),ke.equalStrict(this,e)},e.prototype.lessEqual=function(e){return this.throwIfDisposed(),ke.lessEqual(this,e)},e.prototype.lessEqualStrict=function(e){return this.throwIfDisposed(),ke.lessEqualStrict(this,e)},e.prototype.greater=function(e){return this.throwIfDisposed(),ke.greater(this,e)},e.prototype.greaterStrict=function(e){return this.throwIfDisposed(),ke.greaterStrict(this,e)},e.prototype.greaterEqual=function(e){return this.throwIfDisposed(),ke.greaterEqual(this,e)},e.prototype.greaterEqualStrict=function(e){return this.throwIfDisposed(),ke.greaterEqualStrict(this,e)},e.prototype.logicalAnd=function(e){return this.throwIfDisposed(),ke.logicalAnd(this,e)},e.prototype.logicalOr=function(e){return this.throwIfDisposed(),ke.logicalOr(this,e)},e.prototype.logicalNot=function(){return this.throwIfDisposed(),ke.logicalNot(this)},e.prototype.logicalXor=function(e){return this.throwIfDisposed(),ke.logicalXor(this,e)},e.prototype.where=function(e,t){return this.throwIfDisposed(),ke.where(e,this,t)},e.prototype.neg=function(){return this.throwIfDisposed(),ke.neg(this)},e.prototype.ceil=function(){return this.throwIfDisposed(),ke.ceil(this)},e.prototype.floor=function(){return this.throwIfDisposed(),ke.floor(this)},e.prototype.sign=function(){return this.throwIfDisposed(),ke.sign(this)},e.prototype.isNaN=function(){return this.throwIfDisposed(),ke.isNaN(this)},e.prototype.isInf=function(){return this.throwIfDisposed(),ke.isInf(this)},e.prototype.isFinite=function(){return this.throwIfDisposed(),ke.isFinite(this)},e.prototype.exp=function(){return this.throwIfDisposed(),ke.exp(this)},e.prototype.expm1=function(){return this.throwIfDisposed(),ke.expm1(this)},e.prototype.log=function(){return this.throwIfDisposed(),ke.log(this)},e.prototype.log1p=function(){return this.throwIfDisposed(),ke.log1p(this)},e.prototype.sqrt=function(){return this.throwIfDisposed(),ke.sqrt(this)},e.prototype.rsqrt=function(){return this.throwIfDisposed(),ke.rsqrt(this)},e.prototype.square=function(){return this.throwIfDisposed(),ke.square(this)},e.prototype.reciprocal=function(){return this.throwIfDisposed(),ke.reciprocal(this)},e.prototype.abs=function(){return this.throwIfDisposed(),ke.abs(this)},e.prototype.clipByValue=function(e,t){return this.throwIfDisposed(),ke.clipByValue(this,e,t)},e.prototype.relu=function(){return this.throwIfDisposed(),ke.relu(this)},e.prototype.relu6=function(){return this.throwIfDisposed(),ke.relu6(this)},e.prototype.elu=function(){return this.throwIfDisposed(),ke.elu(this)},e.prototype.selu=function(){return this.throwIfDisposed(),ke.selu(this)},e.prototype.leakyRelu=function(e){return void 0===e&&(e=.2),this.throwIfDisposed(),ke.leakyRelu(this,e)},e.prototype.prelu=function(e){return this.throwIfDisposed(),ke.prelu(this,e)},e.prototype.sigmoid=function(){return this.throwIfDisposed(),ke.sigmoid(this)},e.prototype.logSigmoid=function(){return this.throwIfDisposed(),ke.logSigmoid(this)},e.prototype.softplus=function(){return this.throwIfDisposed(),ke.softplus(this)},e.prototype.zerosLike=function(){return this.throwIfDisposed(),ke.zerosLike(this)},e.prototype.onesLike=function(){return this.throwIfDisposed(),ke.onesLike(this)},e.prototype.sin=function(){return this.throwIfDisposed(),ke.sin(this)},e.prototype.cos=function(){return this.throwIfDisposed(),ke.cos(this)},e.prototype.tan=function(){return this.throwIfDisposed(),ke.tan(this)},e.prototype.asin=function(){return this.throwIfDisposed(),ke.asin(this)},e.prototype.acos=function(){return this.throwIfDisposed(),ke.acos(this)},e.prototype.atan=function(){return this.throwIfDisposed(),ke.atan(this)},e.prototype.sinh=function(){return this.throwIfDisposed(),ke.sinh(this)},e.prototype.cosh=function(){return this.throwIfDisposed(),ke.cosh(this)},e.prototype.tanh=function(){return this.throwIfDisposed(),ke.tanh(this)},e.prototype.asinh=function(){return this.throwIfDisposed(),ke.asinh(this)},e.prototype.acosh=function(){return this.throwIfDisposed(),ke.acosh(this)},e.prototype.atanh=function(){return this.throwIfDisposed(),ke.atanh(this)},e.prototype.erf=function(){return this.throwIfDisposed(),ke.erf(this)},e.prototype.round=function(){return this.throwIfDisposed(),ke.round(this)},e.prototype.step=function(e){return void 0===e&&(e=0),this.throwIfDisposed(),ke.step(this,e)},e.prototype.softmax=function(e){return void 0===e&&(e=-1),this.throwIfDisposed(),ke.softmax(this,e)},e.prototype.logSoftmax=function(e){return void 0===e&&(e=-1),this.throwIfDisposed(),ke.logSoftmax(this,e)},e.prototype.resizeBilinear=function(e,t){return void 0===t&&(t=!1),this.throwIfDisposed(),ke.image.resizeBilinear(this,e,t)},e.prototype.resizeNearestNeighbor=function(e,t){return void 0===t&&(t=!1),this.throwIfDisposed(),ke.image.resizeNearestNeighbor(this,e,t)},e.prototype.conv1d=function(e,t,n,r,i,o){return void 0===r&&(r="NWC"),void 0===i&&(i=1),this.throwIfDisposed(),ke.conv1d(this,e,t,n,r,i,o)},e.prototype.conv2d=function(e,t,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),ke.conv2d(this,e,t,n,r,i,o)},e.prototype.conv2dTranspose=function(e,t,n,r,i){return this.throwIfDisposed(),ke.conv2dTranspose(this,e,t,n,r,i)},e.prototype.depthwiseConv2D=function(e,t,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),ke.depthwiseConv2d(this,e,t,n,r,i,o)},e.prototype.separableConv2d=function(e,t,n,r,i,o){return void 0===i&&(i=[1,1]),void 0===o&&(o="NHWC"),this.throwIfDisposed(),ke.separableConv2d(this,e,t,n,r,i,o)},e.prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),ke.avgPool(this,e,t,n,r)},e.prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),ke.maxPool(this,e,t,n,r)},e.prototype.localResponseNormalization=function(e,t,n,r){return void 0===e&&(e=5),void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=.5),ke.localResponseNormalization(this,e,t,n,r)},e.prototype.pool=function(e,t,n,r,i){return this.throwIfDisposed(),ke.pool(this,e,t,n,r,i)},e.prototype.variable=function(e,t,n){return void 0===e&&(e=!0),this.throwIfDisposed(),Se().makeVariable(this,e,t,n)},e.prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),ke.unsortedSegmentSum(this,e,t)},e.prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),ke.batchToSpaceND(this,e,t)},e.prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),ke.spaceToBatchND(this,e,t)},e.prototype.topk=function(e,t){return void 0===e&&(e=1),void 0===t&&(t=!0),this.throwIfDisposed(),ke.topk(this,e,t)},e.prototype.stridedSlice=function(e,t,n,r,i,o,a,s){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),this.throwIfDisposed(),ke.stridedSlice(this,e,t,n,r,i,o,a,s)},e.prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),ke.depthToSpace(this,e,t)},e.prototype.fft=function(){return this.throwIfDisposed(),ke.spectral.fft(this)},e.prototype.ifft=function(){return this.throwIfDisposed(),ke.spectral.ifft(this)},e.prototype.rfft=function(){return this.throwIfDisposed(),ke.spectral.rfft(this)},e.prototype.irfft=function(){return this.throwIfDisposed(),ke.spectral.irfft(this)},e}();Object.defineProperty(Ie,Symbol.hasInstance,{value:function(e){return!!e&&null!=e.dataId&&null!=e.shape&&null!=e.dtype}});var Ne,Ue,Le,Qe,De,Re=function(e){function t(t,n,r,i){var o=e.call(this,t.shape,t.dtype,t.dataId,i)||this;return o.trainable=n,o.name=r,o}return w(t,e),t.prototype.assign=function(e){if(e.dtype!==this.dtype)throw new Error("dtype of the new value ("+e.dtype+") and previous value ("+this.dtype+") must match");if(!H(e.shape,this.shape))throw new Error("shape of the new value ("+e.shape+") and previous value ("+this.shape+") must match");Se().disposeTensor(this),this.dataId=e.dataId,Se().incRef(this,null)},t.prototype.dispose=function(){Se().disposeVariable(this),this.isDisposedInternal=!0},t}(Ie);Object.defineProperty(Re,Symbol.hasInstance,{value:function(e){return e instanceof Ie&&null!=e.assign&&e.assign instanceof Function}}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(Ne||(Ne={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(Ue||(Ue={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Le||(Le={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(Qe||(Qe={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(De||(De={}));var Te={float32:Qe,int32:Ue,bool:Le,complex64:De};function Pe(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error("Can not upcast "+e+" with "+t)}return Te[e][t]}function Oe(e){return Pe(e,"int32")}function Me(e,t){if(e.dtype===t.dtype)return[e,t];var n=Pe(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function He(e,t){R(e.dtype===t.dtype,function(){return"The dtypes of the first("+e.dtype+") and second("+t.dtype+") input must match"})}function je(e){var t=[];return function e(t,n,r){if(null!=t)if(t instanceof Ie)n.push(t);else if(i=t,Array.isArray(i)||"object"==typeof i){var i,o=t;for(var a in o){var s=o[a];r.has(s)||(r.add(s),e(s,n,r))}}}(e,t,new Set),t}Object.freeze({makeTypesMatch:Me,assertTypesMatch:He,isTensorInList:function(e,t){return t.some(function(t){return t.id===e.id})},getTensorsInContainer:je});var ze,Ke=function(){function e(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null}}return e.prototype.dispose=function(){for(var e in this.registeredVariables)this.registeredVariables[e].dispose()},e}(),We=function(){function e(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Ke}return e.prototype.ready=function(){return y(this,void 0,void 0,function(){var e,t,n;return b(this,function(r){switch(r.label){case 0:if(null!=this.pendingBackendInit)return[2,this.pendingBackendInit.then(function(){})];if(null!=this.backendInstance)return[2];e=this.getSortedBackends(),t=0,r.label=1;case 1:return t<e.length?(n=e[t],[4,this.initializeBackend(n).success]):[3,5];case 2:return r.sent()?[4,this.setBackend(n)]:[3,4];case 3:return r.sent(),[2];case 4:return t++,[3,1];case 5:throw new Error("Could not initialize any backends, all backend initializations failed.")}})})},Object.defineProperty(e.prototype,"backend",{get:function(){if(null!=this.pendingBackendInit)throw new Error("Backend '"+this.backendName+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");if(null==this.backendInstance){var e=this.initializeBackendsAndReturnBest(),t=e.name;if(e.asyncInit)throw new Error("The highest priority backend '"+t+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(t)}return this.backendInstance},enumerable:!0,configurable:!0}),e.prototype.backendNames=function(){return Object.keys(this.registryFactory)},e.prototype.findBackend=function(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;if(this.initializeBackend(e).asyncInit)return null}return this.registry[e]},e.prototype.findBackendFactory=function(e){return e in this.registryFactory?this.registryFactory[e].factory:null},e.prototype.registerBackend=function(e,t,n){return void 0===n&&(n=1),e in this.registryFactory?(console.warn(e+" backend was already registered. Reusing existing backend factory."),!1):(this.registryFactory[e]={factory:t,priority:n},!0)},e.prototype.setBackend=function(e){return y(this,void 0,void 0,function(){var t,n,r;return b(this,function(i){switch(i.label){case 0:if(null==this.registryFactory[e])throw new Error("Backend name '"+e+"' not found in registry");return this.backendName=e,null!=this.registry[e]?[3,4]:(this.backendInstance=null,t=this.initializeBackend(e),n=t.success,t.asyncInit?[4,n]:[3,2]);case 1:return r=i.sent(),[3,3];case 2:r=n,i.label=3;case 3:if(!r)return[2,!1];i.label=4;case 4:return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new be(this.backendInstance),[2,!0]}})})},e.prototype.setupRegisteredKernels=function(){var e=this;k(this.backendName).forEach(function(t){null!=t.setupFunc&&t.setupFunc(e.backendInstance)})},e.prototype.disposeRegisteredKernels=function(e){var t=this;k(e).forEach(function(n){null!=n.disposeFunc&&n.disposeFunc(t.registry[e])})},e.prototype.initializeBackend=function(e){var t=this,n=this.registryFactory[e];if(null==n)throw new Error("Cannot initialize backend "+e+", no registration found.");try{var r=n.factory();if(Promise.resolve(r)===r){var i=++this.pendingBackendInitId,o=r.then(function(n){return!(i<t.pendingBackendInitId)&&(t.registry[e]=n,t.pendingBackendInit=null,!0)}).catch(function(n){return!(i<t.pendingBackendInitId)&&(t.pendingBackendInit=null,console.warn("Initialization of backend "+e+" failed"),console.warn(n.stack||n.message),!1)});return this.pendingBackendInit=o,{success:o,asyncInit:!0}}return this.registry[e]=r,{success:!0,asyncInit:!1}}catch(t){return console.warn("Initialization of backend "+e+" failed"),console.warn(t.stack||t.message),{success:!1,asyncInit:!1}}},e.prototype.removeBackend=function(e){if(!(e in this.registryFactory))throw new Error(e+" backend not found in registry");this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)},e.prototype.getSortedBackends=function(){var e=this;if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(function(t,n){return e.registryFactory[n].priority-e.registryFactory[t].priority})},e.prototype.initializeBackendsAndReturnBest=function(){for(var e=this.getSortedBackends(),t=0;t<e.length;t++){var n=e[t],r=this.initializeBackend(n),i=r.success,o=r.asyncInit;if(o||i)return{name:n,asyncInit:o}}throw new Error("Could not initialize any backends, all backend initializations failed.")},e.prototype.moveData=function(e,t){var n=this.state.tensorInfo.get(t),r=n.backend,i=this.readSync(t);r.disposeData(t),n.backend=e,e.move(t,i,n.shape,n.dtype),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++},e.prototype.tidy=function(e,t){var n,r=this,i=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");i=e}return this.scopedRun(function(){return r.startScope(i)},function(){return r.endScope(n)},function(){return(n=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n})},e.prototype.scopedRun=function(e,t,n){e();try{var r=n();return t(),r}catch(e){throw t(),e}},e.prototype.nextTensorId=function(){return e.nextTensorId++},e.prototype.nextVariableId=function(){return e.nextVariableId++},e.prototype.clone=function(e){var t=this.makeTensorFromDataId(e.dataId,e.shape,e.dtype),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],function(e){return{x:function(){return e.toFloat()}}},[]),t},e.prototype.runKernel=function(e,t,n,r,i){return this.runKernelFunc(null,t,null,e,n,r,i)},e.prototype.shouldCheckForMemLeaks=function(){return this.ENV.getBool("IS_TEST")},e.prototype.checkKernelForMemLeak=function(e,t,n){var r=this.backend.numDataIds(),i=0;n.forEach(function(e){i+="complex64"===e.dtype?3:1});var o=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=r-t-i-o;if(a>0)throw new Error("Backend '"+this.backendName+"' has an internal memory leak ("+a+" data ids) after running '"+e+"'")},e.prototype.runKernelFunc=function(e,t,n,r,i,o,a){var s,A=this;void 0===o&&(o=[]),void 0===a&&(a=[]);var u=[],l=this.isTapeOn();null==r&&(r=null!=this.state.activeScope?this.state.activeScope.name:"");var c,f=function(e){l&&(u=e.map(function(e){return A.keep(A.clone(e))}))},h=this.state.numBytes,d=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);var p,g=S(r,this.backendName);return c=null!=g?function(){var e=A.backend.numDataIds();p=g.kernelFunc({inputs:t,attrs:i,backend:A.backend});var n=Array.isArray(p)?p:[p];A.shouldCheckForMemLeaks()&&A.checkKernelForMemLeak(r,e,n);var s=n.map(function(e){var t=e.dataId,n=e.shape,r=e.dtype;return A.makeTensorFromDataId(t,n,r)}),u=s.filter(function(e,t){return a[t]});return f((o||[]).slice().concat(u)),s}:function(){var t=A.backend.numDataIds();p=A.tidy(function(){return e(A.backend,f)});var n=Array.isArray(p)?p:[p];return A.shouldCheckForMemLeaks()&&A.checkKernelForMemLeak(r,t,n),n},this.scopedRun(function(){return A.state.kernelDepth++},function(){return A.state.kernelDepth--},function(){s=A.ENV.getBool("DEBUG")?A.profiler.profileKernel(r,t,function(){return c()}):c()}),l&&this.addTapeNode(r,t,s,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:r,bytesAdded:this.state.numBytes-h,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-d,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(t).map(function(e){return t[e].shape}),outputShapes:s.map(function(e){return e.shape})}),Array.isArray(p)?s:s[0]},e.prototype.makeTensor=function(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;var i=e;"string"===n&&ie(e[0])&&(i=e.map(function(e){return me(e)}));var o=r.write(i,t,n),a=new Ie(t,n,o,this.nextTensorId());if(this.incRef(a,r),"string"===n){var s=this.state.tensorInfo.get(o),A=re(i);this.state.numBytes+=A-s.bytes,s.bytes=A}return a},e.prototype.makeTensorFromDataId=function(e,t,n,r){var i=new Ie(t,n=n||"float32",e,this.nextTensorId());return this.incRef(i,r),i},e.prototype.makeVariable=function(e,t,n,r){void 0===t&&(t=!0),n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.asType(r));var i=new Re(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error("Variable with name "+i.name+" was already registered");return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i},e.prototype.incRef=function(e,t){var n=this.state.tensorInfo.has(e.dataId)?this.state.tensorInfo.get(e.dataId).refCount:0;if(this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++,0===n){this.state.numDataBuffers++;var r=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(r=e.size*ne(e.dtype)),this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:r,refCount:0}),this.state.numBytes+=r}this.state.tensorInfo.get(e.dataId).refCount++,e instanceof Re||this.track(e)},e.prototype.disposeTensor=function(e){if(this.state.tensorInfo.has(e.dataId)){this.state.numTensors--,"string"===e.dtype&&this.state.numStringTensors--;var t=this.state.tensorInfo.get(e.dataId);t.refCount<=1?("complex64"!==e.dtype&&(this.state.numBytes-=t.bytes),this.state.numDataBuffers--,t.backend.disposeData(e.dataId),this.state.tensorInfo.delete(e.dataId)):this.state.tensorInfo.get(e.dataId).refCount--}},e.prototype.disposeVariables=function(){for(var e in this.state.registeredVariables){var t=this.state.registeredVariables[e];this.disposeVariable(t)}},e.prototype.disposeVariable=function(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]},e.prototype.memory=function(){var e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e},e.prototype.profile=function(e){return y(this,void 0,void 0,function(){var t,n;return b(this,function(r){return this.state.profiling=!0,t=this.state.numBytes,n=this.state.numTensors,this.state.activeProfile.kernels=[],this.state.activeProfile.result=e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,this.state.activeProfile.kernels.map(function(e){return e.totalBytesSnapshot})),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n,[2,this.state.activeProfile]})})},e.prototype.isTapeOn=function(){return this.state.gradientDepth>0&&0===this.state.kernelDepth},e.prototype.addTapeNode=function(e,t,n,r,i){var o=this,a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:i},s=function(e){return E.get(e)}(e);null!=s&&(r=s.gradFunc),null!=r&&(a.gradient=function(e){return e=e.map(function(e,t){if(null==e){var r=n[t],i=de(r.size,r.dtype);return o.makeTensor(i,r.shape,r.dtype)}return e}),r(e.length>1?e:e[0],i)}),this.state.activeTape.push(a)},e.prototype.keep=function(e){return e.kept=!0,e},e.prototype.startTape=function(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++},e.prototype.endTape=function(){this.state.gradientDepth--},e.prototype.startScope=function(e){var t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t},e.prototype.endScope=function(e){for(var t=this,n=je(e),r=new Set(n.map(function(e){return e.id})),i=0;i<this.state.activeScope.track.length;i++){var o=this.state.activeScope.track[i];o.kept||r.has(o.id)||o.dispose()}var a=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],n.forEach(function(e){e.kept||e.scopeId!==a.id||t.track(e)})},e.prototype.gradients=function(e,t,n,r){var i=this;if(void 0===r&&(r=!1),R(t.length>0,function(){return"gradients() received an empty list of xs."}),null!=n&&"float32"!==n.dtype)throw new Error("dy must have 'float32' dtype, but has '"+n.dtype+"'");var o=this.scopedRun(function(){return i.startTape()},function(){return i.endTape()},function(){return i.tidy("forward",e)});R(o instanceof Ie,function(){return"The result y returned by f() must be a tensor."});var a=function(e,t,n){for(var r={},i={},o=0;o<t.length;o++)r[t[o].id]=!0;for(o=0;o<e.length;o++){var a=(d=e[o]).inputs;for(var s in a){for(var A=a[s],u=!1,l=0;l<t.length;l++)if(r[A.id]){d.outputs.forEach(function(e){return r[e.id]=!0}),u=!0,i[d.id]=!0;break}if(u)break}}var c={};c[n.id]=!0;var f={};for(o=e.length-1;o>=0;o--)for(a=(d=e[o]).inputs,l=0;l<d.outputs.length;l++)if(c[d.outputs[l].id]){for(var s in a)c[a[s].id]=!0,f[d.id]=!0;break}var h=[];for(o=0;o<e.length;o++){var d;if(i[(d=e[o]).id]&&f[d.id]){var p={};for(var s in d.inputs){var g=d.inputs[s];r[g.id]&&(p[s]=g)}var m=Object.assign({},d);m.inputs=p,m.outputs=d.outputs,h.push(m)}}return h}(this.state.activeTape,t,o);if(!r&&0===a.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",function(){var e,r,s={};s[o.id]=null==n?(r=he(M(e=o.shape),"float32"),Ve.makeTensor(r,e,"float32")):n,function(e,t,n){for(var r=function(r){var i=t[r],o=[];if(i.outputs.forEach(function(t){var n=e[t.id];null!=n?o.push(n):o.push(null)}),null==i.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+i.kernelName+".");var a=i.gradient(o),s=function(t){if(!(t in a))throw new Error("Cannot backprop through input "+t+". Available gradients found: "+Object.keys(a)+".");var r=n(function(){return a[t]()});if("float32"!==r.dtype)throw new Error("Error in gradient for op "+i.kernelName+". The gradient of input "+t+" must have 'float32' dtype, but has '"+r.dtype+"'");var o=i.inputs[t];if(!H(r.shape,o.shape))throw new Error("Error in gradient for op "+i.kernelName+". The gradient of input '"+t+"' has shape '"+r.shape+"', which does not match the shape of the input '"+o.shape+"'");if(null==e[o.id])e[o.id]=r;else{var s=e[o.id];e[o.id]=s.add(r),s.dispose()}};for(var A in i.inputs)s(A)},i=t.length-1;i>=0;i--)r(i)}(s,a,function(e){return i.tidy(e)});var A=t.map(function(e){return s[e.id]});return 0===i.state.gradientDepth&&(i.state.activeTape.forEach(function(e){for(var t=0,n=e.saved;t<n.length;t++)n[t].dispose()}),i.state.activeTape=null),{value:o,grads:A}})},e.prototype.customGrad=function(e){var t=this;return R(Ae(e),function(){return"The f passed in customGrad(f) must be a function."}),function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];R(r.every(function(e){return e instanceof Ie}),function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"});var o={};return r.forEach(function(e,t){o[t]=e}),t.runKernelFunc(function(t,i){return R((n=e.apply(void 0,r.concat([i]))).value instanceof Ie,function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"}),R(Ae(n.gradFunc),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."}),n.value},o,function(e,t){var i=n.gradFunc(e,t),o=Array.isArray(i)?i:[i];R(o.length===r.length,function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."}),R(o.every(function(e){return e instanceof Ie}),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."});var a={};return o.forEach(function(e,t){a[t]=function(){return e}}),a})}},e.prototype.readSync=function(e){return this.state.tensorInfo.get(e).backend.readSync(e)},e.prototype.read=function(e){return this.state.tensorInfo.get(e).backend.read(e)},e.prototype.time=function(e){return y(this,void 0,void 0,function(){var t,n;return b(this,function(r){switch(r.label){case 0:return t=pe(),[4,this.backend.time(e)];case 1:return(n=r.sent()).wallMs=pe()-t,[2,n]}})})},e.prototype.track=function(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e},Object.defineProperty(e.prototype,"registeredVariables",{get:function(){return this.state.registeredVariables},enumerable:!0,configurable:!0}),e.prototype.reset=function(){for(var e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Ke,this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null},e.nextTensorId=0,e.nextVariableId=0,e}(),Ve=function(){var e=function(){if(null==ze){var e=void 0;if("undefined"!=typeof window)e=window;else if("undefined"!=typeof n.g)e=n.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}ze=e}return ze}();if(null==e._tfengine){var t=new B(e);e._tfengine=new We(t)}return function(e){C=e}(e._tfengine.ENV),Se=function(){return e._tfengine},e._tfengine}();function Ge(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}var qe=x();qe.registerFlag("DEBUG",function(){return!1},function(e){e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),qe.registerFlag("IS_BROWSER",function(){return Ge()}),qe.registerFlag("IS_NODE",function(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}),qe.registerFlag("IS_CHROME",function(){return"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}),qe.registerFlag("PROD",function(){return!1}),qe.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",function(){return qe.getBool("DEBUG")}),qe.registerFlag("DEPRECATION_WARNINGS_ENABLED",function(){return!0}),qe.registerFlag("IS_TEST",function(){return!1});var Xe,Ye,Je,Ze={},$e={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function et(e,t){Ze[e]=t}function tt(e){e in Ze||(Ze[e]=function(e){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var t=function(e){if("undefined"!=typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(e);return t.addEventListener("webglcontextlost",function(t){t.preventDefault(),delete Ze[e]},!1),1===e?t.getContext("webgl",$e)||t.getContext("experimental-webgl",$e):t.getContext("webgl2",$e)}(e));var t=Ze[e];return t.isContextLost()?(delete Ze[e],tt(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),Ze[e])}function nt(e,t){return[t,e]}function rt(e){var t=M(e);return K(Math.ceil(t/4))}function it(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function ot(e,t){var n,r,i,o,a,s,A,u,l,c=e;return 2===x().getNumber("WEBGL_VERSION")?(n=c.R32F,r=c.R16F,i=c.RGBA16F,o=c.RGBA32F,a=c.RED,s=4,A=1,u=c.HALF_FLOAT,l=c.FLOAT):(n=e.RGBA,r=e.RGBA,i=e.RGBA,o=c.RGBA,a=e.RGBA,s=4,A=4,u=null!=t?t.HALF_FLOAT_OES:null,l=e.FLOAT),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:s,defaultNumChannels:A,textureTypeHalfFloat:u,textureTypeFloat:l}}function at(e,t,n){var r=n();return t&&function(e){var t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+At(e,t))}(e),r}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(Xe||(Xe={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(Ye||(Ye={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(Je||(Je={}));function st(e){return!!(x().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8<Math.abs(e)&&Math.abs(e)<65504)}function At(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"Unknown error code "+t}}function ut(e,t,n){return Ut(e,t,function(){return e.getExtension(n)},'Extension "'+n+'" not supported on this browser.')}function lt(e,t,n){var r=Ut(e,t,function(){return e.createShader(e.VERTEX_SHADER)},"Unable to create vertex WebGLShader.");if(at(e,t,function(){return e.shaderSource(r,n)}),at(e,t,function(){return e.compileShader(r)}),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(r)),new Error("Failed to compile vertex shader.");return r}function ct(e,t,n){var r=Ut(e,t,function(){return e.createShader(e.FRAGMENT_SHADER)},"Unable to create fragment WebGLShader.");if(at(e,t,function(){return e.shaderSource(r,n)}),at(e,t,function(){return e.compileShader(r)}),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw function(e,t){var n=dt.exec(t);if(null==n)return console.log("Couldn't parse line number in error: "+t),void console.log(e);for(var r=+n[1],i=e.split("\n"),o=i.length.toString().length+2,a=i.map(function(e,t){return W((t+1).toString(),o)+e}),s=0,A=0;A<a.length;A++)s=Math.max(a[A].length,s);var u=a.slice(0,r-1),l=a.slice(r-1,r),c=a.slice(r);console.log(u.join("\n")),console.log(t.split("\n")[0]),console.log("%c "+W(l[0],s),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(c.join("\n"))}(n,e.getShaderInfoLog(r)),new Error("Failed to compile fragment shader.");return r}var ft,ht,dt=/ERROR: [0-9]+:([0-9]+):/g;function pt(e,t){return Ut(e,t,function(){return e.createProgram()},"Unable to create WebGLProgram.")}function gt(e,t,n){if(at(e,t,function(){return e.linkProgram(n)}),!1===e.getProgramParameter(n,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(n)),new Error("Failed to link vertex and fragment shaders.")}function mt(e,t,n){if(at(e,t,function(){return e.validateProgram(n)}),!1===e.getProgramParameter(n,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(n)),new Error("Shader program validation failed.")}function vt(e,t,n){var r=Ut(e,t,function(){return e.createBuffer()},"Unable to create WebGLBuffer");return at(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),at(e,t,function(){return e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)}),r}function wt(e,t,n){var r=Ut(e,t,function(){return e.createBuffer()},"Unable to create WebGLBuffer");return at(e,t,function(){return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r)}),at(e,t,function(){return e.bufferData(e.ELEMENT_ARRAY_BUFFER,n,e.STATIC_DRAW)}),r}function yt(e,t){return Ut(e,t,function(){return e.createTexture()},"Unable to create WebGLTexture.")}function bt(e,t){var n=x().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){var r="["+e+"x"+t+"]";throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n)throw r="["+e+"x"+t+"]",new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU ["+n+"x"+n+"].")}function Bt(e,t){return Ut(e,t,function(){return e.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function xt(e,t,n,r,i,o,a,s){var A=e.getAttribLocation(n,r);return-1!==A&&(at(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,i)}),at(e,t,function(){return e.vertexAttribPointer(A,o,e.FLOAT,!1,a,s)}),at(e,t,function(){return e.enableVertexAttribArray(A)}),!0)}function Ct(e,t,n,r){Lt(e,r),at(e,t,function(){return e.activeTexture(e.TEXTURE0+r)}),at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)})}function Ft(e,t,n,r){return Ut(e,t,function(){return e.getUniformLocation(n,r)},'uniform "'+r+'" not present in program.')}function Et(e,t,n){return e.getUniformLocation(t,n)}function St(e,t,n,r,i,o){at(e,t,function(){return Ct(e,t,r,o)}),at(e,t,function(){return e.uniform1i(i,o)})}function kt(e,t,n,r){at(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,r)}),at(e,t,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)})}function _t(e,t,n){at(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)}),at(e,t,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function It(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Nt(e,t))}function Nt(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+t}}function Ut(e,t,n,r){var i=at(e,t,function(){return n()});if(null==i)throw new Error(r);return i}function Lt(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(r<e.TEXTURE0||r>n)throw new Error("textureUnit must be in [gl.TEXTURE0, gl.TEXTURE"+n+"].")}function Qt(e,t){return void 0===t&&(t=2),M(e.slice(0,e.length-t))}function Dt(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function Rt(e){var t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[Qt(e)].concat(Dt(e))),t}function Tt(e,t){var n;void 0===t&&(t=!1);var r=x().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(r*=2,1===(e=e.map(function(t,n){return n>=e.length-2?Q(e[n]):e[n]})).length&&(e=[2,e[0]])),2!==e.length){var i=X(e);e=i.newShape}var o=M(e);if(e.length<=1&&o<=r)return[1,o];if(2===e.length&&e[0]<=r&&e[1]<=r)return e;if(3===e.length&&e[0]*e[1]<=r&&e[2]<=r)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=r&&e[1]*e[2]<=r)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=r&&e[3]<=r)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=r&&e[1]*e[2]*e[3]<=r)return[e[0],e[1]*e[2]*e[3]];if(t){var a=Qt(e),s=2,A=2;return e.length&&(s=(n=Dt(e))[0],A=n[1]),K(o=a*(s/2)*(A/2)).map(function(e){return 2*e})}return K(o)}function Pt(e){return e%2==0}function Ot(e,t){if(H(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){var n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r)return!0;if(Pt(n)&&Pt(r)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&Pt(e[0])&&Pt(t[0])}function Mt(e){if(null==ft){var t=tt(e);ft=t.getParameter(t.MAX_TEXTURE_SIZE)}return ft}function Ht(e){if(null==ht){var t=tt(e);ht=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ht)}function jt(e){if(0===e)return 0;var t=tt(e);return zt(t,"EXT_disjoint_timer_query_webgl2")&&2===e?2:zt(t,"EXT_disjoint_timer_query")?1:0}function zt(e,t){return null!=e.getExtension(t)}function Kt(e){try{if(null!=tt(e))return!0}catch(e){return!1}return!1}function Wt(e){if(0===e)return!1;var t=tt(e);if(1===e){if(!zt(t,"OES_texture_float"))return!1}else if(!zt(t,"EXT_color_buffer_float"))return!1;return Gt(t)}function Vt(e){if(0===e)return!1;var t=tt(e);if(1!==e){if(zt(t,"EXT_color_buffer_float"))return Gt(t);if(zt(t,"EXT_color_buffer_half_float")){var n=t.getExtension("EXT_color_buffer_half_float");return function(e,t){var n=ot(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);var i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(i),o}(t,n)}return!1}return!!zt(t,"OES_texture_float")&&!!zt(t,"WEBGL_color_buffer_float")&&Gt(t)}function Gt(e){var t=ot(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);var r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);var i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(r),i}function qt(e){return 2===e&&null!=tt(e).fenceSync}var Xt=Object.freeze({callAndCheck:at,canBeRepresented:st,getWebGLErrorMessage:At,getExtensionOrThrow:ut,createVertexShader:lt,createFragmentShader:ct,createProgram:pt,linkProgram:gt,validateProgram:mt,createStaticVertexBuffer:vt,createStaticIndexBuffer:wt,getNumChannels:function(){return 2===x().getNumber("WEBGL_VERSION")?1:4},createTexture:yt,validateTextureSize:bt,createFramebuffer:Bt,bindVertexBufferToProgramAttribute:xt,bindTextureUnit:Ct,unbindTextureUnit:function(e,t,n){Lt(e,n),at(e,t,function(){return e.activeTexture(e.TEXTURE0+n)}),at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})},getProgramUniformLocationOrThrow:Ft,getProgramUniformLocation:Et,bindTextureToProgramUniformSampler:St,bindCanvasToFramebuffer:function(e,t){at(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),at(e,t,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),at(e,t,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})},bindColorTextureToFramebuffer:kt,unbindColorTextureFromFramebuffer:_t,validateFramebuffer:It,getFramebufferErrorMessage:Nt,getBatchDim:Qt,getRowsCols:Dt,getShapeAs3D:Rt,getTextureShapeFromLogicalShape:Tt,isReshapeFree:Ot,getWebGLMaxTextureSize:Mt,resetMaxTextureSize:function(){ft=null},resetMaxTexturesInShader:function(){ht=null},getMaxTexturesInShader:Ht,getWebGLDisjointQueryTimerVersion:jt,hasExtension:zt,isWebGLVersionEnabled:Kt,isCapableOfRenderingToFloatTexture:Wt,isDownloadFloatTextureEnabled:Vt,isWebGLFenceEnabled:qt}),Yt=x();function Jt(e){x().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Zt(e,t){return Ve.tidy(e,t)}function $t(e){je(e).forEach(function(e){return e.dispose()})}function en(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];x().getBool("IS_TEST")||console.warn.apply(console,e)}function tn(e,t){var n=e;if(te(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];for(var r=[];Array.isArray(n)||te(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&x().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function e(t,n,r){if(r=r||[],Array.isArray(t)||te(t)){R(n.length>0,function(){return"Element arr["+r.join("][")+"] should be a primitive, but is an array of "+t.length+" elements"}),R(t.length===n[0],function(){return"Element arr["+r.join("][")+"] should have "+n[0]+" elements, but has "+t.length+" elements"});for(var i=n.slice(1),o=0;o<t.length;++o)e(t[o],i,r.concat(o))}else R(0===n.length,function(){return"Element arr["+r.join("][")+"] is a primitive, but should be an array/TypedArray of "+n[0]+" elements"})}(e,r,[]),r}function nn(e,t,n,r){if(null!=e&&("numeric"!==e&&e!==t||"numeric"===e&&"string"===t))throw new Error("Argument '"+n+"' passed to '"+r+"' must be "+e+" tensor, but got "+t+" tensor")}function rn(e,t,n,r){if(void 0===r&&(r="numeric"),e instanceof Ie)return nn(r,e.dtype,t,n),e;var i=se(e);if("string"!==i&&["bool","int32","float32"].indexOf(r)>=0&&(i=r),nn(r,i,t,n),null==e||!te(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){var o=null==e?"null":e.constructor.name;throw new Error("Argument '"+t+"' passed to '"+n+"' must be a Tensor or TensorLike, but got '"+o+"'")}var a=tn(e,i);te(e)||Array.isArray(e)||(e=[e]);var s="string"!==i?ce(e,i,x().getBool("DEBUG")):O(e,[],!0);return Ve.makeTensor(s,a,i)}function on(e,t,n,r){if(void 0===r&&(r="numeric"),!Array.isArray(e))throw new Error("Argument "+t+" passed to "+n+" must be a `Tensor[]` or `TensorLike[]`");return e.map(function(e,r){return rn(e,t+"["+r+"]",n)},r)}function an(e,t){for(var n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function sn(e,t,n){for(var r=e.length+t.length,i=[],o=0,a=0,s=0;s<r;s++)-1===n.indexOf(s)?i.push(e[o++]):i.push(t[a++]);return i}function An(e,t){for(var n=[],r=e.length,i=0;i<r;i++)-1===t.indexOf(i)&&n.push(e[i]);return[n,t.map(function(t){return e[t]})]}function un(e,t){return sn(e,t.map(function(e){return 1}),t)}function ln(e,t,n){R(an(t,n),function(){return e+" supports only inner-most axes for now. Got axes "+t+" and rank-"+n+" input."})}function cn(e,t){if(an(e,t))return null;for(var n=[],r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach(function(e){return n.push(e)}),n}function fn(e){return e.map(function(e,t){return[t,e]}).sort(function(e,t){return e[1]-t[1]}).map(function(e){return e[0]})}function hn(e,t){for(var n=[],r=t-e;r<t;++r)n.push(r);return n}function dn(e,t){var n=e[0].length;e.forEach(function(e,t){R(e.length===n,function(){return"Error in concat"+n+"D: rank of tensors["+t+"] must be the same as the rank of the rest ("+n+")"})}),R(t>=0&&t<n,function(){return"Error in concat"+n+"D: axis must be between 0 and "+(n-1)+"."});var r=e[0];e.forEach(function(e,i){for(var o=0;o<n;o++)R(o===t||e[o]===r[o],function(){return"Error in concat"+n+"D: Shape of tensors["+i+"] ("+e+") does not match the shape of the rest ("+r+") along the non-concatenated axis "+i+"."})})}function pn(e,t){for(var n=e[0].slice(),r=1;r<e.length;r++)n[t]+=e[r][t];return n}function gn(e){var t=Object.keys(e);if(1!==t.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+t.length+" keys.");var n=t[0],r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));var i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ve.startScope(n);try{var i=r.apply(void 0,e);return i instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),Ve.endScope(i),i}catch(e){throw Ve.endScope(null),e}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}Yt.registerFlag("HAS_WEBGL",function(){return Yt.getNumber("WEBGL_VERSION")>0}),Yt.registerFlag("WEBGL_VERSION",function(){return Kt(2)?2:Kt(1)?1:0}),Yt.registerFlag("WEBGL_BUFFER_SUPPORTED",function(){return 2===Yt.get("WEBGL_VERSION")}),Yt.registerFlag("WEBGL_CPU_FORWARD",function(){return!0}),Yt.registerFlag("WEBGL_FORCE_F16_TEXTURES",function(){return!1}),Yt.registerFlag("WEBGL_PACK",function(){return Yt.getBool("HAS_WEBGL")}),Yt.registerFlag("WEBGL_PACK_NORMALIZATION",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_CLIP",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_DEPTHWISECONV",function(){return!1}),Yt.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_PACK_REDUCE",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_LAZILY_UNPACK",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_CONV_IM2COL",function(){return Yt.getBool("WEBGL_PACK")}),Yt.registerFlag("WEBGL_MAX_TEXTURE_SIZE",function(){return Mt(Yt.getNumber("WEBGL_VERSION"))}),Yt.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",function(){return Ht(Yt.getNumber("WEBGL_VERSION"))}),Yt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",function(){var e=Yt.getNumber("WEBGL_VERSION");return 0===e?0:jt(e)}),Yt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",function(){return Yt.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&(e=navigator.userAgent||navigator.vendor||window.opera,!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))));var e}),Yt.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",function(){return Wt(Yt.getNumber("WEBGL_VERSION"))}),Yt.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",function(){return!Yt.getBool("WEBGL_FORCE_F16_TEXTURES")&&Yt.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")}),Yt.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",function(){return Vt(Yt.getNumber("WEBGL_VERSION"))}),Yt.registerFlag("WEBGL_FENCE_API_ENABLED",function(){return qt(Yt.getNumber("WEBGL_VERSION"))}),Yt.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",function(){return Yt.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0}),_e=Jt;var mn=gn({complex_:function(e,t){var n=rn(e,"real","complex"),r=rn(t,"imag","complex");return T(n.shape,r.shape,"real and imag shapes, "+n.shape+" and "+r.shape+", must match in call to tf.complex()."),Ve.runKernelFunc(function(e){return e.complex(n,r)},{$real:n,$imag:r})}}),vn=gn({real_:function(e){var t=rn(e,"input","real");return Ve.runKernelFunc(function(e){return e.real(t)},{$input:t})}}),wn=gn({imag_:function(e){var t=rn(e,"input","imag");return Ve.runKernelFunc(function(e){return e.imag(t)},{$input:t})}});function yn(e,t,n){return bn(e,t,tn(e,n),n)}function bn(e,t,n,r){if(null==r&&(r=se(e)),"complex64"===r)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!te(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){ge(t);var i=M(t),o=M(n);R(i===o,function(){return"Based on the provided shape, ["+t+"], the tensor should have "+i+" values but has "+o});for(var a=0;a<n.length;++a){var s=n[a],A=a!==n.length-1||s!==M(t.slice(a));R(n[a]===t[a]||!A,function(){return"Error creating a new Tensor. Inferred shape ("+n+") does not match the provided shape ("+t+"). "})}}return te(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==r?ce(e,r,x().getBool("DEBUG")):O(e,[],!0),Ve.makeTensor(e,t,r)}function Bn(e,t){if((te(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&te(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return bn(e,[],[],t)}function xn(e,t){P(e);var n=tn(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return bn(e,null,n,t)}function Cn(e,t,n){if(P(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");var r=tn(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return bn(e,t,r,n)}function Fn(e,t,n){if(P(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");var r=tn(e,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return bn(e,t,r,n)}function En(e,t,n){if(P(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");var r=tn(e,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return bn(e,t,r,n)}function Sn(e,t){if(void 0===t&&(t="float32"),"complex64"===t){var n=Sn(e,"float32"),r=kn(e,"float32");return mn(n,r)}var i=he(M(e),t);return Ve.makeTensor(i,e,t)}function kn(e,t){if(void 0===t&&(t="float32"),"complex64"===t){var n=kn(e,"float32"),r=kn(e,"float32");return mn(n,r)}var i=de(M(e),t);return Ve.makeTensor(i,e,t)}function _n(e,t,n){return Ve.runKernelFunc(function(r){return r.fill(e,t,n)},{})}function In(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r="float32"),0===n)throw new Error("Cannot have a step of zero");if(e===t||e<t&&n<0||t<e&&n>1)return kn([0],r);var i=de(Math.abs(Math.ceil((t-e)/n)),r);t<e&&1===n&&(n=-1),i[0]=e;for(var o=1;o<i.length;o++)i[o]=i[o-1]+n;return xn(i,r)}var Nn=gn({onesLike_:function(e){var t=rn(e,"x","onesLike");if("complex64"===t.dtype){var n=Nn(vn(t)),r=Un(wn(t));return mn(n,r)}return Ve.runKernelFunc(function(e){return e.onesLike(t)},{$x:t},function(e,t){return{$x:function(){return Un(e)}}})}}),Un=gn({zerosLike_:function(e){var t=rn(e,"x","zerosLike");return Ve.runKernelFunc(function(e){return e.zerosLike(t)},{$x:t},function(e,t){return{$x:function(){return Un(e)}}})}}),Ln=gn({concat_:function(e,t){void 0===t&&(t=0),R(e.length>=1,function(){return"Pass at least one tensor to concat"});var n=on(e,"tensors","concat");"complex64"===n[0].dtype&&n.forEach(function(e){if("complex64"!==e.dtype)throw new Error("Cannot concatenate complex64 tensors with a tensor\n with dtype "+e.dtype+". ")}),t=q(t,n[0].shape)[0];var r=pn(n.map(function(e){return e.shape}),t);if(0===M(r))return yn([],r);if(1===(n=n.filter(function(e){return e.size>0})).length)return n[0];var i=n.map(function(e){return e.shape});dn(i,t);var o=n,a={axis:t};return Ve.runKernelFunc(function(e){return e.concat(n,t)},o,function(e){var n=i.map(function(e){return e[t]});return Pn(e,n,t).map(function(e){return function(){return e}})},"Concat",a)}}),Qn=gn({concat1d_:function(e){return Ln(e,0)}}),Dn=gn({concat2d_:function(e,t){return Ln(e,t)}}),Rn=gn({concat3d_:function(e,t){return Ln(e,t)}}),Tn=gn({concat4d_:function(e,t){return Ln(e,t)}}),Pn=gn({split_:function(e,t,n){void 0===n&&(n=0);var r,i=rn(e,"x","split");return n=q(n,i.shape)[0],"number"==typeof t?(R(i.shape[n]%t==0,function(){return"Number of splits must evenly divide the axis."}),r=new Array(t).fill(i.shape[n]/t)):(R(i.shape[n]===t.reduce(function(e,t){return e+t}),function(){return"The sum of sizes must match the size of the axis dimension."}),r=t),Ve.runKernelFunc(function(e){return e.split(i,r,n)},{$x:i},function(e){return{$x:function(){return Ln(e,n)}}})}});function On(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self&&self;var Mn=On(function(e){!function(e,t){function n(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function r(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var i=new n(e),o=t&&t.state,a=i.next;return a.int32=function(){return 4294967296*i.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,o&&("object"==typeof o&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.alea=i}(0,e)}),Hn=On(function(e){!function(e,t){function n(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function i(e,t){var i=new n(e),o=t&&t.state,a=function(){return(i.next()>>>0)/4294967296};return a.double=function(){do{var e=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=i.next,a.quick=a,o&&("object"==typeof o&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.xor128=i}(0,e)}),jn=On(function(e){!function(e,t){function n(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var i=new n(e),o=t&&t.state,a=function(){return(i.next()>>>0)/4294967296};return a.double=function(){do{var e=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=i.next,a.quick=a,o&&("object"==typeof o&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.xorwow=i}(0,e)}),zn=On(function(e){!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function i(e,t){null==e&&(e=+new Date);var i=new n(e),o=t&&t.state,a=function(){return(i.next()>>>0)/4294967296};return a.double=function(){do{var e=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=i.next,a.quick=a,o&&(o.x&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.xorshift7=i}(0,e)}),Kn=On(function(e){!function(e,t){function n(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,a,s=[],A=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,A=Math.max(A,t.length)),i=0,o=-32;o<A;++o)t&&(r^=t.charCodeAt((o+32)%t.length)),0===o&&(a=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=s[127&o]^=r+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;e.w=a,e.X=s,e.i=i}(t,e)}function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var i=new n(e),o=t&&t.state,a=function(){return(i.next()>>>0)/4294967296};return a.double=function(){do{var e=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=i.next,a.quick=a,o&&(o.X&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.xor4096=i}(0,e)}),Wn=On(function(e){!function(e,t){function n(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function i(e,t){var i=new n(e),o=t&&t.state,a=function(){return(i.next()>>>0)/4294967296};return a.double=function(){do{var e=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=i.next,a.quick=a,o&&("object"==typeof o&&r(o,i),a.state=function(){return r(i,{})}),a}t&&t.exports?t.exports=i:this.tychei=i}(0,e)}),Vn=On(function(e){!function(t,r){var i,o=this,a=256,s="random",A=r.pow(a,6),u=r.pow(2,52),l=2*u,c=255;function f(e,n,c){var f=[],m=p(function e(t,n){var r,i=[],o=typeof t;if(n&&"object"==o)for(r in t)try{i.push(e(t[r],n-1))}catch(e){}return i.length?i:"string"==o?t:t+"\0"}((n=1==n?{entropy:!0}:n||{}).entropy?[e,g(t)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),g(e)}catch(e){var n=o.navigator,r=n&&n.plugins;return[+new Date,o,r,o.screen,g(t)]}}():e,3),f),v=new h(f),w=function(){for(var e=v.g(6),t=A,n=0;e<u;)e=(e+n)*a,t*=a,n=v.g(1);for(;e>=l;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|v.g(4)},w.quick=function(){return v.g(4)/4294967296},w.double=w,p(g(v.S),t),(n.pass||c||function(e,t,n,i){return i&&(i.S&&d(i,v),e.state=function(){return d(v,{})}),n?(r[s]=e,t):e})(w,m,"global"in n?n.global:this==r,n.state)}function h(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);i<a;)s[i]=i++;for(i=0;i<a;i++)s[i]=s[o=c&o+e[i%n]+(t=s[i])],s[o]=t;(r.g=function(e){for(var t,n=0,i=r.i,o=r.j,s=r.S;e--;)t=s[i=c&i+1],n=n*a+s[c&(s[i]=s[o=c&o+t])+(s[o]=t)];return r.i=i,r.j=o,n})(a)}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function p(e,t){for(var n,r=e+"",i=0;i<r.length;)t[c&i]=c&(n^=19*t[c&i])+r.charCodeAt(i++);return g(t)}function g(e){return String.fromCharCode.apply(0,e)}if(r["seed"+s]=f,p(r.random(),t),e.exports){e.exports=f;try{i=n(8082)}catch(e){}}}([],Math)});Vn.alea=Mn,Vn.xor128=Hn,Vn.xorwow=jn,Vn.xorshift7=zn,Vn.xor4096=Kn,Vn.tychei=Wn;var Gn=Vn.alea,qn=function(){function e(e,t,n,r,i){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var o=i||Math.random();this.random=Gn(o.toString())}return e.prototype.nextValue=function(){if(!isNaN(this.nextVal)){var e=this.nextVal;return this.nextVal=NaN,e}for(var t,n,r=!1;!r;){var i=void 0,o=void 0,a=void 0;do{a=(i=2*this.random()-1)*i+(o=2*this.random()-1)*o}while(a>=1||0===a);var s=Math.sqrt(-2*Math.log(a)/a);t=this.mean+this.stdDev*i*s,n=this.mean+this.stdDev*o*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}(),Xn=function(){function e(e,t,n,r){this.alpha=e,this.beta=1/t,this.dtype=n;var i=r||Math.random();this.randu=Gn(i.toString()),this.randn=new qn(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}return e.prototype.nextValue=function(){for(var e,t,n,r,i,o;;){do{r=this.randn.nextValue(),o=1+this.c*r}while(o<=0);if(o*=o*o,t=1-.331*(e=r*r)*e,n=.5*e+this.d*(1-o+Math.log(o)),(i=this.randu())<t||Math.log(i)<n)break}return o=1/this.beta*this.d*o,this.alpha<1&&(o*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(o)},e.prototype.convertValue=function(e){return"float32"===this.dtype?e:Math.round(e)},e}(),Yn=function(){function e(e,t,n,r){var i=this;if(void 0===e&&(e=0),void 0===t&&(t=1),this.canReturnFloat=function(){return null==i.dtype||"float32"===i.dtype},this.min=e,this.range=t-e,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between "+e+" - "+t+" <= 1 and dtype is not float");this.random=Gn(r)}return e.prototype.convertValue=function(e){return this.canReturnFloat()?e:Math.round(e)},e.prototype.nextValue=function(){return this.convertValue(this.min+this.range*this.random())},e}();function Jn(e,t,n){return void 0===t&&(t="float32"),t=t||"float32",ge(e),new Ee(e,t,n)}var Zn=gn({batchToSpaceND_:function(e,t,n){var r=rn(e,"x","batchToSpaceND"),i=t.reduce(function(e,t){return e*t});return R(r.rank>=1+t.length,function(){return"input rank is "+r.rank+" but should be > than blockShape.length "+t.length}),R(n.length===t.length,function(){return"crops.length is "+n.length+" but should be equal to blockShape.length "+t.length}),R(r.shape[0]%i==0,function(){return"input tensor batch is "+r.shape[0]+" but is not divisible by the product of the elements of blockShape "+t.join(" * ")+" === "+i}),Ve.runKernelFunc(function(e){return e.batchToSpaceND(r,t,n)},{$x:r},function(e){return{$x:function(){return e.spaceToBatchND(t,n)}}})}}),$n=gn({broadcastTo_:function(e,t){var n=rn(e,"broadcastTo","x"),r=n.shape;if(t.some(function(e){return!(e>0)||e%1!=0}))throw new Error("broadcastTo(): Invalid broadcast shape ["+t+"].");if(t.length<n.rank)throw new Error("broadcastTo(): shape.length="+t.length+" < input.rank="+n.rank+".");if(t.length>n.rank){for(var i=n.shape.slice();i.length<t.length;)i.unshift(1);n=n.reshape(i)}for(var o=Array.from(t),a=t.length-1;a>=0;a--)if(n.shape[a]===t[a])o[a]=1;else if(1!==n.shape[a])throw new Error("broadcastTo(): ["+r+"] cannot be broadcast to ["+t+"].");var s=o.map(function(e,t){return e>1?t:-1}).filter(function(e){return e>=0});return 0===s.length?n.clone():Ve.runKernelFunc(function(e){return e.tile(n,o)},{input:n},function(e){return{input:function(){return e.sum(s,!0)}}})}}),er=gn({cast_:function(e,t){var n=rn(e,"x","cast");if(!$(t))throw new Error("Failed to cast to unknown dtype "+t);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");var r={dtype:t};return Ve.runKernelFunc(function(e){return e.cast(n,t)},{x:n},function(e){return{x:function(){return e.clone()}}},"Cast",r)}}),tr=gn({clone_:function(e){var t=rn(e,"x","clone",null);return Ve.runKernelFunc(function(){return Ve.makeTensorFromDataId(t.dataId,t.shape,t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}}),nr=gn({cumsum_:function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=!1),void 0===r&&(r=!1);var i=rn(e,"x","cumsum"),o=cn([t|=0],i.rank),a=i;null!=o&&(a=i.transpose(o));var s=hn(1,i.rank)[0],A=Ve.runKernelFunc(function(e){return e.cumsum(a,s,n,r)},{permutedX:a},function(e){return{permutedX:function(){return e.cumsum(t,n,!r)}}});return null!=o&&(A=A.transpose(o)),A}}),rr=gn({depthToSpace_:function(e,t,n){void 0===n&&(n="NHWC");var r=rn(e,"x","depthToSpace"),i="NHWC"===n?r.shape[1]:r.shape[2],o="NHWC"===n?r.shape[2]:r.shape[3],a="NHWC"===n?r.shape[3]:r.shape[1];return R(i*t>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+i+" and "+t+" for depthToSpace with input shape\n "+r.shape}),R(o*t>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+o+" and "+t+" for depthToSpace with input shape\n "+r.shape}),R(a%(t*t)==0,function(){return"Dimension size must be evenly divisible by "+t*t+" but is "+a+" for depthToSpace with input shape "+r.shape}),Ve.runKernelFunc(function(e){return e.depthToSpace(r,t,n)},{$x:r})}}),ir=gn({expandDims_:function(e,t){void 0===t&&(t=0);var n=rn(e,"x","expandDims",null);R(t<=n.rank,function(){return"Axis must be <= rank of the tensor"});var r=n.shape.slice();return t<0&&(R(-(n.rank+1)<=t,function(){return"Axis must be in the interval ["+-(n.rank+1)+", "+n.rank+"]"}),t=n.rank+t+1),r.splice(t,0,1),mr(n,r)}}),or=gn({eye_:function(e,t,n,r){void 0===r&&(r="float32"),null==t&&(t=e);for(var i=Jn([e,t],r),o=e<=t?e:t,a=0;a<o;++a)i.set(1,a,a);var s=i.toTensor().as2D(e,t);if(null==n)return s;if(1===n.length)return br(ir(s,0),[n[0],1,1]);if(2===n.length)return br(ir(ir(s,0),0),[n[0],n[1],1,1]);if(3===n.length)return br(ir(ir(ir(s,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error("eye() currently supports only 1D and 2D batchShapes, but received "+n.length+"D.")}}),ar=gn({multinomial_:function(e,t,n,r){void 0===r&&(r=!1);var i=rn(e,"logits","multinomial"),o=i.size,a=i.rank;if(o<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+o+".");if(a>2)throw new Error("Rank of probabilities must be 1 or 2, but is "+a);n=n||Math.random();var s=1===a?i.as2D(1,-1):i,A=Ve.runKernelFunc(function(e){return e.multinomial(s,r,t,n)},{logits2D:s});return 1===a?A.as1D():A}}),sr=gn({oneHot_:function(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r=0),t<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+t);var i=rn(e,"indices","oneHot","int32"),o=i.shape.concat([t]);return i=i.flatten(),Ve.runKernelFunc(function(e){return e.oneHot(i,t,n,r)},{$indices:i},function(e){return{$indices:function(){return kn(i.shape,"float32")}}}).reshape(o)}}),Ar=gn({pad_:function(e,t,n){void 0===n&&(n=0);var r=rn(e,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var i={paddings:t,constantValue:n};return Ve.runKernelFunc(function(e){return e.pad(r,t,n)},{x:r},function(e){var n=t.map(function(e){return e[0]});return{x:function(){return e.slice(n,r.shape)}}},"PadV2",i)}}),ur=gn({pad1d_:function(e,t,n){return void 0===n&&(n=0),R(2===t.length,function(){return"Invalid number of paddings. Must be length of 2."}),Ar(e,[t],n)}}),lr=gn({pad2d_:function(e,t,n){return void 0===n&&(n=0),R(2===t.length&&2===t[0].length&&2===t[1].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),Ar(e,t,n)}}),cr=gn({pad3d_:function(e,t,n){return void 0===n&&(n=0),R(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),Ar(e,t,n)}}),fr=gn({pad4d_:function(e,t,n){return void 0===n&&(n=0),R(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),Ar(e,t,n)}}),hr=gn({rand_:function(e,t,n){var r=M(e),i=null;if(null==n||"float32"===n)i=new Float32Array(r);else if("int32"===n)i=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type "+n);i=new Uint8Array(r)}for(var o=0;o<r;o++)i[o]=t();return Ve.makeTensor(i,e,n)}}),dr=gn({randomNormal_:function(e,t,n,r,i){if(void 0===t&&(t=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new qn(t,n,r,!1,i),a=Jn(e,r),s=0;s<a.values.length;s++)a.values[s]=o.nextValue();return a.toTensor()}}),pr=gn({randomGamma_:function(e,t,n,r,i){if(void 0===n&&(n=1),void 0===r&&(r="float32"),null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error("Unsupported data type "+r);for(var o=new Xn(t,n,r,i),a=Jn(e,r),s=0;s<a.values.length;s++)a.values[s]=o.nextValue();return a.toTensor()}}),gr=gn({randomUniform_:function(e,t,n,r,i){void 0===t&&(t=0),void 0===n&&(n=1),void 0===r&&(r="float32");for(var o=Jn(e,r),a=new Yn(t,n,null,i),s=0;s<o.values.length;s++)o.values[s]=a.nextValue();return o.toTensor()}}),mr=gn({reshape_:function(e,t){var n=rn(e,"x","reshape",null);t=G(t,n.size),R(n.size===M(t),function(){return"new shape and old shape must have the same number of elements."});var r={shape:t};return Ve.runKernelFunc(function(e){return e.reshape(n,t)},{x:n},function(e){return{x:function(){return e.reshape(n.shape)}}},"Reshape",r)}}),vr=gn({spaceToBatchND_:function(e,t,n){var r=rn(e,"x","spaceToBatchND");return R(r.rank>=1+t.length,function(){return"input rank "+r.rank+" should be > than [blockShape] "+t.length}),R(n.length===t.length,function(){return"paddings.shape[0] "+n.length+" must be equal to [blockShape] "+t.length}),R(r.shape.reduce(function(e,r,i){return i>0&&i<=t.length?e&&(r+n[i-1][0]+n[i-1][1])%t[i-1]==0:e},!0),function(){return"input spatial dimensions "+r.shape.slice(1)+" with paddings "+n.toString()+" must be divisible by blockShapes "+t.toString()}),Ve.runKernelFunc(function(e){return e.spaceToBatchND(r,t,n)},{$x:r},function(e){return{$x:function(){return e.batchToSpaceND(t,n)}}})}}),wr=gn({squeeze_:function(e,t){var n=rn(e,"x","squeeze");return mr(n,X(n.shape,t).newShape)}}),yr=gn({stack_:function(e,t){void 0===t&&(t=0);var n=on(e,"tensors","stack");if(R(n.length>=1,function(){return"Pass at least one tensor to tf.stack"}),1===n.length)return n[0].expandDims(t);var r=n[0].rank,i=n[0].shape,o=n[0].dtype;R(t<=r,function(){return"Axis must be <= rank of the tensor"}),n.forEach(function(e){T(i,e.shape,"All tensors passed to stack must have matching shapes")}),n.forEach(function(e){R(o===e.dtype,function(){return"All tensors passed to stack must have matching dtypes"})});var a=n.map(function(e){return e.expandDims(t)});return Ln(a,t)}}),br=gn({tile_:function(e,t){var n=rn(e,"x","tile",null);R(n.rank===t.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of reps "+t+"."});var r=[n],i={reps:t};return Ve.runKernelFunc(function(e,r){var i=e.tile(n,t);return r([n]),i},{x:n},function(e,n){var r=n[0];return{x:function(){var n=Un(r);if(1===r.rank)for(var i=0;i<t[0];++i)n=n.add(e.slice([i*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(i=0;i<t[0];++i)for(var o=0;o<t[1];++o)n=n.add(e.slice([i*r.shape[0],o*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(i=0;i<t[0];++i)for(o=0;o<t[1];++o)for(var a=0;a<t[2];++a)n=n.add(e.slice([i*r.shape[0],o*r.shape[1],a*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error("Gradient for tile operation is not implemented for rank-"+r.rank+" tensors yet.");for(i=0;i<t[0];++i)for(o=0;o<t[1];++o)for(a=0;a<t[2];++a)for(var s=0;s<t[3];++s)n=n.add(e.slice([i*r.shape[0],o*r.shape[1],a*r.shape[2],s*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return n}}},"Tile",i,r)}}),Br=gn({truncatedNormal_:function(e,t,n,r,i){if(void 0===t&&(t=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new qn(t,n,r,!0,i),a=Jn(e,r),s=0;s<a.values.length;s++)a.values[s]=o.nextValue();return a.toTensor()}}),xr=gn({unstack_:function(e,t){void 0===t&&(t=0),t=t||0;var n=rn(e,"x","unstack");R(t>=-n.shape.length&&t<n.shape.length,function(){return"Axis = "+t+" is not in [-"+n.shape.length+", "+n.shape.length+")"}),t<0&&(t+=n.shape.length);var r={axis:t};return Ve.runKernelFunc(function(e){return e.unstack(n,t)},{x:n},function(e){return{x:function(){return yr(e,t)}}},"Unpack",r)}});function Cr(e,t,n,r){void 0===r&&(r=!0);var i=[];if(r)(i=i.concat(t.slice(0))).push(e[0]/n),i=i.concat(e.slice(1));else{i=i.concat(e[0]);for(var o=t.length,a=0;a<o;++a)i=i.concat([e[a+1]/t[a],t[a]]);i=i.concat(e.slice(o+1))}return i}function Fr(e,t,n){void 0===n&&(n=!0);var r=[];if(n){r.push(t);for(var i=t+1;i<e;++i)i<=2*t?(r.push(i),r.push(i-(t+1))):r.push(i)}else{var o=[],a=[];for(i=1;i<e;++i)i>=2*t+1||i%2==1?a.push(i):o.push(i);r.push.apply(r,o),r.push(0),r.push.apply(r,a)}return r}function Er(e,t,n,r){void 0===r&&(r=!0);var i=[];r?i.push(e[0]/n):i.push(e[0]*n);for(var o=1;o<e.length;++o)o<=t.length?r?i.push(t[o-1]*e[o]):i.push(e[o]/t[o-1]):i.push(e[o]);return i}function Sr(e,t){for(var n=[0],r=0;r<t;++r)n.push(e[r][0]);return n}function kr(e,t,n){for(var r=e.slice(0,1),i=0;i<n;++i)r.push(e[i+1]-t[i][0]-t[i][1]);return r}function _r(e,t){if(e.rank<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher, but the rank was "+e.rank+".");if(t.rank<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher, but the rank was "+t.rank+".");if("int32"!==t.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type, but the dtype was "+t.dtype+".");if(t.shape[t.rank-1]>e.rank)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+t.shape[t.rank-1]+" vs. "+e.rank);if(0===e.size)throw new Error("Requested more than 0 entries, but input is empty. Input shape: "+e.shape+".");for(var n=t.shape,r=n[n.length-1],i=1,o=0;o<n.length-1;++o)i*=n[o];var a=e.shape,s=n.slice();s.pop();var A=1;for(o=r;o<e.rank;++o)A*=a[o],s.push(a[o]);var u=le(e.shape).map(function(e){return e/A}).concat([1]).slice(0,r);return[s,i,A,u]}Object.freeze({prepareAndValidate:_r});function Ir(e){return e<=30?e:ue(e,Math.floor(Math.sqrt(e)))}function Nr(e,t,n){var r=t.rank>1?t.shape[t.rank-1]:1,i=t.rank>1?t.rank-1:1,o="Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: "+n.shape+", indices.shape: "+t.shape+", shape: "+e+", sliceDim: "+r+", and batchDim: "+i+".";if(n.rank<i)throw new Error(o+" update.rank < "+i+". ");if(e.length<r+(n.rank-i))throw new Error(o+" Output shape length < "+(r+(n.rank-i)));if(n.rank!==i+e.length-r)throw new Error(o+" update.rank != "+(i+e.length-r));for(var a=0;a<i;++a)if(n.shape[a]!==t.shape[a])throw new Error(o+" updates.shape["+a+"] ("+n.shape[a]+") != indices.shape["+a+"] ("+t.shape[a]+").");for(a=0;a<n.rank-i;++a)if(n.shape[a+i]!==e[a+r])throw new Error(o+" updates.shape["+(a+i)+"] ("+n.shape[a+i]+") != shape["+(a+i)+"] ("+e[a+i]+")")}function Ur(e,t,n){if(t.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher, but the rank was "+t.rank+".");if(e.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher, but the rank was "+e.rank+".");if("int32"!==t.dtype)throw new Error("The dtype of 'indices' should be int32, but got dtype: "+t.dtype);if(n.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: "+n);if(0===n.length){if(0===t.size)throw new Error("Indices specified for empty output. indices shape: "+t.shape);if(0===e.size)throw new Error("Updates specified for empty output. updates shape: "+e.shape)}Nr(n,t,e)}function Lr(e,t,n){for(var r=t.shape.length,i=r>1?t.shape[r-1]:1,o=n.length,a=1,s=i;s<o;++s)a*=n[s];var A=i<1?1:i;return{sliceRank:i,numUpdates:M(t.shape)/A,sliceSize:a,strides:le(n.slice(0,i)).concat([1]),outputSize:M(n)}}Object.freeze({validateUpdateShape:Nr,validateInput:Ur,calculateShapes:Lr});function Qr(e,t,n){R(e.rank===t.length,function(){return"Error in slice"+e.rank+"D: Length of begin "+t+" must match the rank of the array ("+e.rank+")."}),R(e.rank===n.length,function(){return"Error in slice"+e.rank+"D: Length of size "+n+" must match the rank of the array ("+e.rank+")."});for(var r=function(r){R(t[r]+n[r]<=e.shape[r],function(){return"Error in slice"+e.rank+"D: begin["+r+"] + size["+r+"] ("+(t[r]+n[r])+") would overflow input.shape["+r+"] ("+e.shape[r]+")"})},i=0;i<e.rank;++i)r(i)}function Dr(e){for(var t=[],n=0;e>0;)1&e&&t.push(n),e/=2,n++;return t}function Rr(e,t,n){for(var r=[],i=0;i<e.length;i++)r[i]=Math.ceil((t[i]-e[i])/n[i]);return r}function Tr(e,t,n,r,i){var o=t[i],a=n[i]||1;(e&1<<i||null==o)&&(o=a>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var s=r[i];return o<0&&(o+=s),L(0,o,s-1)}function Pr(e,t,n,r,i){var o=t[i],a=n[i]||1;(e&1<<i||null==o)&&(o=a>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var s=r[i];return o<0&&(o+=s),a>0?L(0,o,s):L(-1,o,s-1)}function Or(e,t,n){for(var r=n.length,i=0;i<n.length;i++)if(n[i]>1){r=i;break}for(i=r+1;i<n.length;i++)if(t[i]>0||n[i]!==e[i])return!1;return!0}function Mr(e,t){for(var n=e.length>0?e[e.length-1]:1,r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}Object.freeze({assertParamsValid:Qr,maskToAxes:Dr,computeOutShape:Rr,startForAxis:Tr,stopForAxis:Pr,isSliceContinous:Or,computeFlatOffset:Mr});function Hr(e){return Ve.customGrad(e)}var jr=gn({softmax_:function(e,t){void 0===t&&(t=-1);var n=rn(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and dim was "+t);return Ve.runKernelFunc(function(e,r){var i=e.softmax(n,t);return r([i]),i},{logits:n},function(e,n){var r=n[0],i=e.mul(r);return{logits:function(){return i.sub(i.sum([t],!0).mul(r))}}},"Softmax",{dim:t},[],[!0])}}),zr=gn({logSoftmax_:function(e,t){void 0===t&&(t=-1);var n=rn(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and axis was "+t);return Hr(function(e,n){var r=e.max(t,!0),i=e.sub(r),o=i.toFloat().sub(i.exp().sum(t,!0).log());return n([o]),{value:o,gradFunc:function(e,n){var r=n[0].exp();return e.sub(e.sum(t,!0).mul(r))}}})(n)}}),Kr=function(){function e(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}return e.prototype.get=function(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)},e.prototype.set=function(e,t){this.dataIdsCount++,this.data.set(e,t)},e.prototype.has=function(e){return this.data.has(e)},e.prototype.delete=function(e){return this.dataIdsCount--,this.data.delete(e)},e.prototype.numDataIds=function(){return this.dataIdsCount},e}(),Wr=function(){function e(){}return e.prototype.time=function(e){return Vr("time")},e.prototype.read=function(e){return Vr("read")},e.prototype.readSync=function(e){return Vr("readSync")},e.prototype.numDataIds=function(){return Vr("numDataIds")},e.prototype.disposeData=function(e){return Vr("disposeData")},e.prototype.write=function(e,t,n){return Vr("write")},e.prototype.move=function(e,t,n,r){return Vr("move")},e.prototype.memory=function(){return Vr("memory")},e.prototype.floatPrecision=function(){return Vr("floatPrecision")},e.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},e.prototype.batchMatMul=function(e,t,n,r){return Vr("batchMatMul")},e.prototype.fusedBatchMatMul=function(e){return e.a,e.b,e.transposeA,e.transposeB,e.bias,e.activation,e.preluActivationWeights,Vr("fusedBatchMatMul")},e.prototype.slice=function(e,t,n){return Vr("slice")},e.prototype.stridedSlice=function(e,t,n,r){return Vr("stridedSlice")},e.prototype.unstack=function(e,t){return Vr("unstack")},e.prototype.reverse=function(e,t){return Vr("reverse")},e.prototype.concat=function(e,t){return Vr("concat")},e.prototype.neg=function(e){return Vr("neg")},e.prototype.add=function(e,t){return Vr("add")},e.prototype.addN=function(e){return Vr("addN")},e.prototype.subtract=function(e,t){return Vr("subtract")},e.prototype.multiply=function(e,t){return Vr("multiply")},e.prototype.realDivide=function(e,t){return Vr("realDivide")},e.prototype.floorDiv=function(e,t){return Vr("floorDiv")},e.prototype.sum=function(e,t){return Vr("sum")},e.prototype.prod=function(e,t){return Vr("prod")},e.prototype.unsortedSegmentSum=function(e,t,n){return Vr("unsortedSegmentSum")},e.prototype.argMin=function(e,t){return Vr("argMin")},e.prototype.argMax=function(e,t){return Vr("argMax")},e.prototype.equal=function(e,t){return Vr("equal")},e.prototype.notEqual=function(e,t){return Vr("notEqual")},e.prototype.less=function(e,t){return Vr("less")},e.prototype.lessEqual=function(e,t){return Vr("lessEqual")},e.prototype.greater=function(e,t){return Vr("greater")},e.prototype.greaterEqual=function(e,t){return Vr("greaterEqual")},e.prototype.logicalNot=function(e){return Vr("logicalNot")},e.prototype.logicalAnd=function(e,t){return Vr("logicalAnd")},e.prototype.logicalOr=function(e,t){return Vr("logicalOr")},e.prototype.where=function(e){return Vr("where")},e.prototype.select=function(e,t,n){return Vr("select")},e.prototype.topk=function(e,t,n){return Vr("topk")},e.prototype.min=function(e,t){return Vr("min")},e.prototype.minimum=function(e,t){return Vr("minimum")},e.prototype.mod=function(e,t){return Vr("mod")},e.prototype.max=function(e,t){return Vr("max")},e.prototype.maximum=function(e,t){return Vr("maximum")},e.prototype.all=function(e,t){return Vr("all")},e.prototype.any=function(e,t){return Vr("any")},e.prototype.squaredDifference=function(e,t){return Vr("squaredDifference")},e.prototype.ceil=function(e){return Vr("ceil")},e.prototype.floor=function(e){return Vr("floor")},e.prototype.round=function(e){return Vr("round")},e.prototype.sign=function(e){return Vr("sign")},e.prototype.isNaN=function(e){return Vr("isNaN")},e.prototype.isInf=function(e){return Vr("isInf")},e.prototype.isFinite=function(e){return Vr("isFinite")},e.prototype.pow=function(e,t){return Vr("pow")},e.prototype.exp=function(e){return Vr("exp")},e.prototype.expm1=function(e){return Vr("expm1")},e.prototype.softmax=function(e,t){return Vr("softmax")},e.prototype.log=function(e){return Vr("log")},e.prototype.log1p=function(e){return Vr("log1p")},e.prototype.sqrt=function(e){return Vr("sqrt")},e.prototype.rsqrt=function(e){return Vr("rsqrt")},e.prototype.square=function(e){return Vr("square")},e.prototype.reciprocal=function(e){return Vr("reciprocal")},e.prototype.relu=function(e){return Vr("relu")},e.prototype.relu6=function(e){return Vr("relu6")},e.prototype.prelu=function(e,t){return Vr("prelu")},e.prototype.elu=function(e){return Vr("elu")},e.prototype.eluDer=function(e,t){return Vr("eluDer")},e.prototype.selu=function(e){return Vr("selu")},e.prototype.int=function(e){return Vr("int")},e.prototype.clip=function(e,t,n){return Vr("clip")},e.prototype.abs=function(e){return Vr("abs")},e.prototype.complexAbs=function(e){return Vr("complexAbs")},e.prototype.sigmoid=function(e){return Vr("sigmoid")},e.prototype.softplus=function(e){return Vr("softplus")},e.prototype.sin=function(e){return Vr("sin")},e.prototype.cos=function(e){return Vr("cos")},e.prototype.tan=function(e){return Vr("tan")},e.prototype.asin=function(e){return Vr("asin")},e.prototype.acos=function(e){return Vr("acos")},e.prototype.atan=function(e){return Vr("atan")},e.prototype.atan2=function(e,t){return Vr("atan2")},e.prototype.sinh=function(e){return Vr("sinh")},e.prototype.cosh=function(e){return Vr("cosh")},e.prototype.tanh=function(e){return Vr("tanh")},e.prototype.asinh=function(e){return Vr("asinh")},e.prototype.acosh=function(e){return Vr("acosh")},e.prototype.atanh=function(e){return Vr("atanh")},e.prototype.erf=function(e){return Vr("erf")},e.prototype.step=function(e,t){return Vr("step")},e.prototype.fusedConv2d=function(e){return e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights,Vr("fusedConv2d")},e.prototype.conv2d=function(e,t,n){return Vr("conv2d")},e.prototype.conv2dDerInput=function(e,t,n){return Vr("conv2dDerInput")},e.prototype.conv2dDerFilter=function(e,t,n){return Vr("conv2dDerFilter")},e.prototype.fusedDepthwiseConv2D=function(e){return e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights,Vr("fusedDepthwiseConv2D")},e.prototype.depthwiseConv2D=function(e,t,n){return Vr("depthwiseConv2D")},e.prototype.depthwiseConv2DDerInput=function(e,t,n){return Vr("depthwiseConv2DDerInput")},e.prototype.depthwiseConv2DDerFilter=function(e,t,n){return Vr("depthwiseConv2DDerFilter")},e.prototype.conv3d=function(e,t,n){return Vr("conv3d")},e.prototype.conv3dDerInput=function(e,t,n){return Vr("conv3dDerInput")},e.prototype.conv3dDerFilter=function(e,t,n){return Vr("conv3dDerFilter")},e.prototype.maxPool=function(e,t){return Vr("maxPool")},e.prototype.maxPoolBackprop=function(e,t,n,r){return Vr("maxPoolBackprop")},e.prototype.avgPool=function(e,t){return Vr("avgPool")},e.prototype.avgPoolBackprop=function(e,t,n){return Vr("avgPoolBackprop")},e.prototype.avgPool3d=function(e,t){return Vr("avgPool3d")},e.prototype.avgPool3dBackprop=function(e,t,n){return Vr("avgPool3dBackprop")},e.prototype.maxPool3d=function(e,t){return Vr("maxPool3d")},e.prototype.maxPool3dBackprop=function(e,t,n,r){return Vr("maxPool3dBackprop")},e.prototype.reshape=function(e,t){return Vr("reshape")},e.prototype.cast=function(e,t){return Vr("cast")},e.prototype.tile=function(e,t){return Vr("tile")},e.prototype.pad=function(e,t,n){return Vr("pad")},e.prototype.transpose=function(e,t){return Vr("transpose")},e.prototype.gather=function(e,t,n){return Vr("gather")},e.prototype.gatherND=function(e,t){return Vr("gatherND")},e.prototype.scatterND=function(e,t,n){return Vr("scatterND")},e.prototype.batchToSpaceND=function(e,t,n){return Vr("batchToSpaceND")},e.prototype.spaceToBatchND=function(e,t,n){return Vr("spaceToBatchND")},e.prototype.resizeBilinear=function(e,t,n,r){return Vr("resizeBilinear")},e.prototype.resizeBilinearBackprop=function(e,t,n){return Vr("resizeBilinearBackprop")},e.prototype.resizeNearestNeighbor=function(e,t,n,r){return Vr("resizeNearestNeighbor")},e.prototype.resizeNearestNeighborBackprop=function(e,t,n){return Vr("resizeNearestNeighborBackprop")},e.prototype.batchNormalization=function(e,t,n,r,i,o){return Vr("batchNormalization")},e.prototype.localResponseNormalization4D=function(e,t,n,r,i){return Vr("localResponseNormalization4D")},e.prototype.LRNGrad=function(e,t,n,r,i,o,a){return Vr("LRNGrad")},e.prototype.multinomial=function(e,t,n,r){return Vr("multinomial")},e.prototype.oneHot=function(e,t,n,r){return Vr("oneHot")},e.prototype.cumsum=function(e,t,n,r){return Vr("cumsum")},e.prototype.nonMaxSuppression=function(e,t,n,r,i){return Vr("nonMaxSuppression")},e.prototype.fft=function(e){return Vr("fft")},e.prototype.ifft=function(e){return Vr("ifft")},e.prototype.complex=function(e,t){return Vr("complex")},e.prototype.real=function(e){return Vr("real")},e.prototype.imag=function(e){return Vr("imag")},e.prototype.cropAndResize=function(e,t,n,r,i,o){return Vr("cropAndResize")},e.prototype.depthToSpace=function(e,t,n){return Vr("depthToSpace")},e.prototype.split=function(e,t,n){return Vr("split")},e.prototype.sparseToDense=function(e,t,n,r){return Vr("sparseToDense")},e.prototype.diag=function(e){return Vr("diag")},e.prototype.fill=function(e,t,n){return Vr("fill")},e.prototype.onesLike=function(e){return Vr("onesLike")},e.prototype.zerosLike=function(e){return Vr("zerosLike")},e.prototype.linspace=function(e,t,n){return Vr("linspace")},e.prototype.dispose=function(){return Vr("dispose")},e}();function Vr(e){throw new Error("'"+e+"' not yet implemented or not found in the registry. Did you forget to import the kernel?")}function Gr(e,t){for(var n=e.length,r=[],i=0;i<n;i++){var o=n-1-i,a=e[o]||1;(t[t.length-1-i]||1)>1&&1===a&&r.unshift(o)}return r}function qr(e,t){for(var n=[],r=0;r<t.length;r++){var i=e[e.length-r-1],o=t.length-r-1,a=t[o];(null==i||1===i&&a>1)&&n.unshift(o)}return n}function Xr(e,t){for(var n=[],r=Math.max(e.length,t.length),i=0;i<r;i++){var o=e[e.length-i-1];null==o&&(o=1);var a=t[t.length-i-1];if(null==a&&(a=1),1===o)n.unshift(a);else if(1===a)n.unshift(o);else{if(o!==a)throw Error("Operands could not be broadcast together with shapes "+e+" and "+t+".");n.unshift(o)}}return n}function Yr(e,t,n,r,i,o,a){void 0===a&&(a="channelsLast");var s,A=ti(t),u=A[0],l=A[1];if("channelsLast"===a)s=[u,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error("Unknown dataFormat "+a);s=[u,l,e[1],e[1]]}return Zr(e,s,n,r,i,o,!1,a)}function Jr(e,t,n,r,i,o,a){void 0===a&&(a="NDHWC");var s,A,u=ni(t),l=u[0],c=u[1],f=u[2];if("NDHWC"===a)A="channelsLast",s=[l,c,f,e[4],e[4]];else{if("NCDHW"!==a)throw new Error("Unknown dataFormat "+a);A="channelsFirst",s=[l,c,f,e[1],e[1]]}return $r(e,s,n,r,i,!1,A,o)}function Zr(e,t,n,r,i,o,a,s){void 0===a&&(a=!1),void 0===s&&(s="channelsLast");var A=[-1,-1,-1,-1],u=A[0],l=A[1],c=A[2],f=A[3];if("channelsLast"===s)u=e[0],l=e[1],c=e[2],f=e[3];else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat "+s);u=e[0],f=e[1],l=e[2],c=e[3]}var h,d=t[0],p=t[1],g=t[3],m=ti(n),v=m[0],w=m[1],y=ti(r),b=y[0],B=y[1],x=ri(d,b),C=ri(p,B),F=function(e,t,n,r,i,o,a,s){var A,u,l;if("number"==typeof e){A={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};var c=function(e,t,n,r,i){null==r&&(r=ei(e,t,n));var o=e[1],a=ii((e[0]-t+2*r)/n+1,i);R(j(a),function(){return"The output # of rows ("+a+") must be an integer. Change the stride and/or zero pad parameters"});var s=ii((o-t+2*r)/n+1,i);return R(j(s),function(){return"The output # of columns ("+s+") must be an integer. Change the stride and/or zero pad parameters"}),[a,s]}([t,n],o,r,e,s);u=c[0],l=c[1]}else if("same"===e){u=Math.ceil(t/r),l=Math.ceil(n/i);var f=Math.max(0,(u-1)*r+o-t),h=Math.max(0,(l-1)*i+a-n),d=Math.floor(f/2),p=f-d,g=Math.floor(h/2);A={top:d,bottom:p,left:g,right:h-g,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: "+e);A={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-o+1)/r),l=Math.ceil((n-a+1)/i)}return{padInfo:A,outHeight:u,outWidth:l}}(i,l,c,v,w,x,C,o),E=F.padInfo,S=F.outHeight,k=F.outWidth,_=a?g*f:g;return"channelsFirst"===s?h=[u,_,S,k]:"channelsLast"===s&&(h=[u,S,k,_]),{batchSize:u,dataFormat:s,inHeight:l,inWidth:c,inChannels:f,outHeight:S,outWidth:k,outChannels:_,padInfo:E,strideHeight:v,strideWidth:w,filterHeight:d,filterWidth:p,effectiveFilterHeight:x,effectiveFilterWidth:C,dilationHeight:b,dilationWidth:B,inShape:e,outShape:h,filterShape:t}}function $r(e,t,n,r,i,o,a,s){void 0===o&&(o=!1),void 0===a&&(a="channelsLast");var A=[-1,-1,-1,-1,-1],u=A[0],l=A[1],c=A[2],f=A[3],h=A[4];if("channelsLast"===a)u=e[0],l=e[1],c=e[2],f=e[3],h=e[4];else{if("channelsFirst"!==a)throw new Error("Unknown dataFormat "+a);u=e[0],h=e[1],l=e[2],c=e[3],f=e[4]}var d,p=t[0],g=t[1],m=t[2],v=t[4],w=ni(n),y=w[0],b=w[1],B=w[2],x=ni(r),C=x[0],F=x[1],E=x[2],S=ri(p,C),k=ri(g,F),_=ri(m,E),I=function(e,t,n,r,i,o,a,s,A,u,l){var c,f,h,d;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};var p=function(e,t,n,r,i,o){null==i&&(i=ei(e,t,r));var a=e[1],s=e[2],A=ii((e[0]-t+2*i)/r+1,o);R(j(A),function(){return"The output # of depths ("+A+") must be an integer. Change the stride and/or zero pad parameters"});var u=ii((a-t+2*i)/r+1,o);R(j(u),function(){return"The output # of rows ("+u+") must be an integer. Change the stride and/or zero pad parameters"});var l=ii((s-t+2*i)/r+1,o);return R(j(l),function(){return"The output # of columns ("+l+") must be an integer. Change the stride and/or zero pad parameters"}),[A,u,l,1]}([t,n,r,1],s,0,i,e,l);f=p[0],h=p[1],d=p[2]}else if("same"===e){var g=((f=Math.ceil(t/i))-1)*i+s-t,m=((h=Math.ceil(n/o))-1)*o+A-n,v=((d=Math.ceil(r/a))-1)*a+u-r,w=Math.floor(g/2),y=g-w,b=Math.floor(m/2),B=m-b,x=Math.floor(v/2);c={top:b,bottom:B,left:x,right:v-x,front:w,back:y,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: "+e);c={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},f=Math.ceil((t-s+1)/i),h=Math.ceil((n-A+1)/o),d=Math.ceil((r-u+1)/a)}return{padInfo:c,outDepth:f,outHeight:h,outWidth:d}}(i,l,c,f,y,b,B,S,k,_,s),N=I.padInfo,U=I.outDepth,L=I.outHeight,Q=I.outWidth,D=o?v*h:v;return"channelsFirst"===a?d=[u,D,U,L,Q]:"channelsLast"===a&&(d=[u,U,L,Q,D]),{batchSize:u,dataFormat:a,inDepth:l,inHeight:c,inWidth:f,inChannels:h,outDepth:U,outHeight:L,outWidth:Q,outChannels:D,padInfo:N,strideDepth:y,strideHeight:b,strideWidth:B,filterDepth:p,filterHeight:g,filterWidth:m,effectiveFilterDepth:S,effectiveFilterHeight:k,effectiveFilterWidth:_,dilationDepth:C,dilationHeight:F,dilationWidth:E,inShape:e,outShape:d,filterShape:t}}function ei(e,t,n,r){void 0===r&&(r=1);var i=ri(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)}function ti(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function ni(e){return"number"==typeof e?[e,e,e]:e}function ri(e,t){return t<=1?e:e+(e-1)*(t-1)}function ii(e,t){if(!t)return e;switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error("Unknown roundingMode "+t)}}function oi(e){var t=ti(e),n=t[0],r=t[1],i=t[2];return 1===n&&1===r&&1===i}function ai(e,t){return oi(e)||oi(t)}function si(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error("Unknown dataFormat "+e)}function Ai(e,t,n){if("complex64"===t){if("complex64"===e.dtype)return e.clone();var r=kn(e.shape),i=e.toFloat(),o=n.complex(i,r);return r.dispose(),i.dispose(),o}if(!ee(e.dtype,t))return Ve.makeTensorFromDataId(e.dataId,e.shape,t);if("complex64"===e.dtype){var a=n.real(e);return o=a.cast(t),a.dispose(),o}if("int32"===t)return n.int(e);if("bool"===t){var s=Bn(0,e.dtype);return o=n.notEqual(e,s),s.dispose(),o}throw new Error("Error in Cast: failed to cast "+e.dtype+" to "+t)}function ui(e,t){return Ve.makeTensorFromDataId(e.dataId,t,e.dtype)}function li(e,t,n){var r=(t-e)/(n-1),i=de(n,"float32");i[0]=e;for(var o=1;o<i.length;o++)i[o]=i[o-1]+r;return xn(i,"float32")}Object.freeze({castTensor:Ai,reshapeTensor:ui,linspaceImpl:li,upcastType:Pe,axesAreInnerMostDims:an,combineLocations:sn,computeOutAndReduceShapes:An,expandShapeToKeepDim:un,assertAxesAreInnerMostDims:ln,getAxesPermutation:cn,getUndoAxesPermutation:fn,getInnerMostAxes:hn,getBroadcastDims:Gr,getReductionAxes:qr,assertAndGetBroadcastShape:Xr,assertParamsConsistent:dn,computeOutShape:pn,computePool2DInfo:Yr,computePool3DInfo:Jr,computeConv2DInfo:Zr,computeConv3DInfo:$r,computeDefaultPad:ei,tupleValuesAreOne:oi,eitherStridesOrDilationsAreOne:ai,convertConv2DDataFormat:si,PARALLELIZE_THRESHOLD:30,computeOptimalWindowSize:Ir});function ci(e,t){if(e.length!==t.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+e.length+", imag: "+t.length+".");for(var n=new Float32Array(2*e.length),r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function fi(e,t){return{real:e[2*t],imag:e[2*t+1]}}function hi(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function di(e,t,n){var r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}function pi(e,t,n){var r=function(e,t,n){return function(e,t,n){for(var r=0,i=e.length,o=0,a=!1;r<i;){var s=n(t,e[o=r+(i-r>>>1)]);s>0?r=o+1:(i=o,a=!s)}return a?r:-r-1}(e,t,n||gi)}(e,t,n),i=r<0?-(r+1):r;e.splice(i,0,t)}function gi(e,t){return e>t?1:e<t?-1:0}function mi(e,t,n,r,i){return wi(e,t,n,r,i,0).selectedIndices}function vi(e,t,n,r,i,o){var a=wi(e,t,n,r,i,o,!0);return a.numValidOutputs.dispose(),{selectedIndices:a.selectedIndices,selectedScores:a.selectedScores}}function wi(e,t,n,r,i,o,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);for(var A=Array.from(t).map(function(e,t){return{score:e,boxIndex:t,suppressBeginIndex:0}}).filter(function(e){return e.score>i}).sort(Bi),u=o>0?-.5/o:0,l=[],c=[];l.length<n&&A.length>0;){var f=A.pop(),h=f.score,d=f.boxIndex,p=f.suppressBeginIndex;if(h<i)break;for(var g=!1,m=l.length-1;m>=p;--m){var v=yi(e,d,l[m]);if(v>=r){g=!0;break}if(f.score=f.score*bi(r,u,v),f.score<=i)break}f.suppressBeginIndex=l.length,g||(f.score===h?(l.push(d),c.push(f.score)):f.score>i&&pi(A,f,Bi))}var w=l.length;return s&&(l.fill(0,w),c.fill(0,w)),{selectedIndices:xn(l,"int32"),selectedScores:xn(c,"float32"),numValidOutputs:Bn(w,"int32")}}function yi(e,t,n){var r=e.subarray(4*t,4*t+4),i=e.subarray(4*n,4*n+4),o=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),A=Math.max(r[1],r[3]),u=Math.min(i[0],i[2]),l=Math.min(i[1],i[3]),c=Math.max(i[0],i[2]),f=Math.max(i[1],i[3]),h=(s-o)*(A-a),d=(c-u)*(f-l);if(h<=0||d<=0)return 0;var p=Math.max(o,u),g=Math.max(a,l),m=Math.min(s,c),v=Math.min(A,f),w=Math.max(m-p,0)*Math.max(v-g,0);return w/(h+d-w)}function bi(e,t,n){var r=Math.exp(t*n*n);return n<=e?r:0}function Bi(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}function xi(e,t,n){var r=new Array(e.rank).fill(0),i=e.shape.slice();return t.map(function(t){i[n]=t;var o=e.slice(r,i);return r[n]+=t,o})}function Ci(e,t){for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[r]*t[r];var i=Jn(n,e.dtype);for(r=0;r<i.values.length;++r){for(var o=i.indexToLoc(r),a=new Array(e.rank),s=0;s<a.length;s++)a[s]=o[s]%e.shape[s];var A=e.locToIndex(a);i.values[r]=e.values[A]}return i.toTensor()}function Fi(e,t,n,r,i){for(var o=t[t.length-1],a=[e.length/o,o],s=a[0],A=a[1],u=Y(n,s*r),l=Y("int32",s*r),c=0;c<s;c++){for(var f=c*A,h=e.subarray(f,f+A),d=[],p=0;p<h.length;p++)d.push({value:h[p],index:p});d.sort(function(e,t){return t.value-e.value});var g=c*r,m=u.subarray(g,g+r),v=l.subarray(g,g+r);for(p=0;p<r;p++)m[p]=d[p].value,v[p]=d[p].index}var w=t.slice();return w[w.length-1]=r,[yn(u,w,n),yn(l,w,"int32")]}function Ei(e,t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(r);var i=Jn(e,"int32"),o=Jn([n.length,e.length],"int32");for(r=0;r<n.length;r++){var a=i.indexToLoc(n[r]),s=r*e.length;o.values.set(a,s)}return o.toTensor()}var Si=function(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(function(e,t){return"T"+t});var n=[];this.variableNames.forEach(function(e){n.push("float v"+e+" = get"+e+"AtOutCoords();")});var r=this.variableNames.map(function(e){return"v"+e}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n float result = "+r+";\n setOutput(result);\n }\n "},ki=function(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(function(e,t){return"T"+t});var n=[];this.variableNames.forEach(function(e){n.push("vec4 v"+e+" = get"+e+"AtOutCoords();")});var r=this.variableNames.map(function(e){return"v"+e}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n vec4 result = "+r+";\n setOutput(result);\n }\n "},_i=function(e,t,n){this.variableNames=["A"];var r=e.windowSize,i=e.batchSize,o=e.inSize,a=Math.ceil(o/r);n||this.variableNames.push("bestIndicesA"),this.outputShape=[i,a];var s="max"===t?">":"<",A=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < "+r+"; i++) {\n int inIdx = "+A+";\n float candidate = getA(batch, inIdx);\n if (candidate "+s+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "};function Ii(e,t){return["x","y","z","w","u","v"].slice(0,t).map(function(t){return e+"."+t})}function Ni(e,t){return 1===t?[e]:Ii(e,t)}function Ui(){var e,t,n,r,i,o,a,s,A,u;return 2===x().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",r="in",i="texture",o="outputColor",a="out vec4 outputColor;",s="\n bool isnan_custom(float val) {\n return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ",A="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",r="varying",i="texture2D",o="gl_FragColor",a="",s="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",A="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:i,output:o,defineOutput:a,defineSpecialNaN:s,defineSpecialInf:A,defineRound:u}}function Li(e,t,n){void 0===n&&(n="index");var r=le(t);return r.map(function(t,i){return"int "+e[i]+" = "+n+" / "+t+"; "+(i===r.length-1?"int "+e[i+1]+" = "+n+" - "+e[i]+" * "+t:"index -= "+e[i]+" * "+t)+";"}).join("")}function Qi(e){var t=le(e).map(function(e){return e.toString()});return"\n int getFlatIndex(ivec3 coords) {\n return coords.x * "+t[0]+" + coords.y * "+t[1]+" + coords.z;\n }\n"}var Di="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n";function Ri(e,t,n,r){var i=[];e.forEach(function(e){var t=M(e.shapeInfo.logicalShape);e.shapeInfo.isUniform?i.push("uniform float "+e.name+(t>1?"["+t+"]":"")+";"):(i.push("uniform sampler2D "+e.name+";"),i.push("uniform int offset"+e.name+";"))});var o,a,s=i.join("\n"),A=e.map(function(e){return function(e,t,n){void 0===n&&(n=!1);var r="";r+=n?Pi(e):Ti(e);var i=e.shapeInfo.logicalShape,o=t.logicalShape;return i.length<=o.length&&(r+=n?function(e,t){var n,r=e.name,i=r.charAt(0).toUpperCase()+r.slice(1),o="get"+i+"AtOutCoords",a=e.shapeInfo.logicalShape.length,s=t.logicalShape.length,A=Gr(e.shapeInfo.logicalShape,t.logicalShape),u=Wi(s),l=s-a,c=["x","y","z","w","u","v"];n=0===a?"":s<2&&A.length>=1?"coords = 0;":A.map(function(e){return"coords."+c[e+l]+" = 0;"}).join("\n");var f;f=s<2&&a>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords."+c[t+l]}).join(", ");var h="return outputValue;",d=1===M(e.shapeInfo.logicalShape),p=1===M(t.logicalShape);if(1!==a||d||p){if(d&&!p)h=1===s?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(A.length){var g=a-2,m=a-1;A.indexOf(g)>-1&&A.indexOf(m)>-1?h="return vec4(outputValue.x);":A.indexOf(g)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":A.indexOf(m)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}}else h="\n return vec4(outputValue.xy, outputValue.xy);\n ";return"\n vec4 "+o+"() {\n "+u+" coords = getOutputCoords();\n "+n+"\n vec4 outputValue = get"+i+"("+f+");\n "+h+"\n }\n "}(e,t):function(e,t){var n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=t.texShape,a=e.shapeInfo.texShape,s=e.shapeInfo.logicalShape.length,A=t.logicalShape.length;if(!e.shapeInfo.isUniform&&s===A&&null==e.shapeInfo.flatOffset&&H(a,o))return"\n float "+i+"() {\n return sampleTexture("+n+", resultUV);\n }\n ";var u,l=Wi(A),c=Gr(e.shapeInfo.logicalShape,t.logicalShape),f=A-s,h=["x","y","z","w","u","v"];u=0===s?"":A<2&&c.length>=1?"coords = 0;":c.map(function(e){return"coords."+h[e+f]+" = 0;"}).join("\n");var d;return d=A<2&&s>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords."+h[t+f]}).join(", "),"\n float "+i+"() {\n "+l+" coords = getOutputCoords();\n "+u+"\n return get"+r+"("+d+");\n }\n "}(e,t)),r}(e,t,r)}).join("\n"),u=t.texShape,l=Ui(),c=function(e){return"\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return "+e.texture2D+"(textureSampler, uv).r;\n }\n "}(l),f=function(e){return e.version+"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n "+e.varyingFs+" vec2 resultUV;\n "+e.defineOutput+"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n "+e.defineSpecialNaN+"\n "+e.defineSpecialInf+"\n "+e.defineRound+"\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n "+Oi+"\n "+Mi+"\n "+Hi+"\n "}(l);return t.isPacked?(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return 1===n[0]?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * "+n[1]+".0);\n }\n ":1===n[1]?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * "+n[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n return 2 * (resTexRC.x * "+n[1]+" + resTexRC.y);\n }\n "}(0,t);case 2:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(H(e,t))return"\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2("+n[0]+", "+n[1]+"));\n }\n ";var r=Math.ceil(e[1]/2);return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec2(r, c);\n }\n "}(e,t);case 3:return n=e,r=t,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],a=(o=Math.ceil(n[2]/2))*Math.ceil(n[1]/2),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+i[0]+", "+i[1]+"));\n int index = resTexRC.x * "+i[1]+" + resTexRC.y;\n\n int b = index / "+a+";\n index -= b * "+a+";\n\n int r = 2 * (index / "+o+");\n int c = imod(index, "+o+") * 2;\n\n return ivec3(b, r, c);\n }\n ";default:return function(e,t){for(var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),i=r*Math.ceil(e[e.length-2]/2),o=i,a="",s="b, r, c",A=2;A<e.length-1;A++)a="\n int b"+A+" = index / "+(o*=e[e.length-A-1])+";\n index -= b"+A+" * "+o+";\n "+a,s="b"+A+", "+s;return"\n ivec"+e.length+" getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n\n "+a+"\n\n int b = index / "+i+";\n index -= b * "+i+";\n\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec"+e.length+"("+s+");\n }\n "}(e,t)}var n,r,i,o,a}(t.logicalShape,u),a=function(e){return"\n void setOutput(vec4 val) {\n "+e.output+" = val;\n }\n "}(l)):(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){return 1===t[0]?"\n int getOutputCoords() {\n return int(resultUV.x * "+t[1]+".0);\n }\n ":1===t[1]?"\n int getOutputCoords() {\n return int(resultUV.y * "+t[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n return resTexRC.x * "+t[1]+" + resTexRC.y;\n }\n "}(0,t);case 2:return function(e,t){return H(e,t)?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+t[0]+", "+t[1]+"));\n }\n ":1===e[1]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ":1===e[0]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+e[1]+";\n int c = index - r * "+e[1]+";\n return ivec2(r, c);\n }\n "}(e,t);case 3:return n=t,r=Li(["r","c","d"],e),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n "+r+"\n return ivec3(r, c, d);\n }\n ";case 4:return function(e,t){var n=Li(["r","c","d","d2"],e);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n "+n+"\n return ivec4(r, c, d, d2);\n }\n "}(e,t);case 5:return function(e,t){var n=Li(["r","c","d","d2","d3"],e);return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2("+t[0]+",\n "+t[1]+"));\n\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}(e,t);case 6:return function(e,t){var n=Li(["r","c","d","d2","d3","d4"],e);return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}(e,t);default:throw new Error(e.length+"-D output sampling is not yet supported")}var n,r}(t.logicalShape,u),a=function(e){return"\n void setOutput(float val) {\n "+e.output+" = vec4(val, 0, 0, 0);\n }\n "}(l)),r&&(f+=ji),[f,c,a,s,o,A,n].join("\n")}function Ti(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"float "+n+"() {return "+t+";}";var r=e.shapeInfo.texShape,i=r[0],o=r[1];if(1===i&&1===o)return"\n float "+n+"() {\n return sampleTexture("+t+", halfCR);\n }\n ";var a=e.shapeInfo.texShape;return"\n float "+n+"() {\n vec2 uv = uvFromFlat("+a[0]+", "+a[1]+", "+zi(t)+");\n return sampleTexture("+t+", uv);\n }\n "}(e);case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"\n float "+n+"(int index) {\n "+Ki(e)+"\n }\n ";var r=e.shapeInfo.texShape,i=r[0],o=r[1];if(1===o&&1===i)return"\n float "+n+"(int index) {\n return sampleTexture("+t+", halfCR);\n }\n ";var a=zi(t);return 1===o?"\n float "+n+"(int index) {\n vec2 uv = vec2(0.5, (float(index + "+a+") + 0.5) / "+i+".0);\n return sampleTexture("+t+", uv);\n }\n ":1===i?"\n float "+n+"(int index) {\n vec2 uv = vec2((float(index + "+a+") + 0.5) / "+o+".0, 0.5);\n return sampleTexture("+t+", uv);\n }\n ":"\n float "+n+"(int index) {\n vec2 uv = uvFromFlat("+i+", "+o+", index + "+a+");\n return sampleTexture("+t+", uv);\n }\n "}(e);case 2:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape;if(null!=i&&H(t,i)){var o=i[0];return"\n float "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+i[1]+".0, "+o+".0);\n return sampleTexture("+n+", uv);\n }\n "}var a=X(t),s=a.newShape,A=a.keptDims,u=s;if(u.length<t.length)return"\n "+Ti(Vi(e,u))+"\n float "+r+"(int row, int col) {\n return "+r+"("+Gi(["row","col"],A)+");\n }\n ";if(e.shapeInfo.isUniform)return"\n float "+r+"(int row, int col) {\n int index = round(dot(vec2(row, col), vec2("+t[1]+", 1)));\n "+Ki(e)+"\n }\n ";var l=i[0],c=i[1],f=zi(n);return 1===c?"\n float "+r+"(int row, int col) {\n float index = dot(vec3(row, col, "+f+"), vec3("+t[1]+", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / "+l+".0);\n return sampleTexture("+n+", uv);\n }\n ":1===l?"\n float "+r+"(int row, int col) {\n float index = dot(vec3(row, col, "+f+"), vec3("+t[1]+", 1, 1));\n vec2 uv = vec2((index + 0.5) / "+c+".0, 0.5);\n return sampleTexture("+n+", uv);\n }\n ":"\n float "+r+"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+t[1]+" + col + "+f+";\n vec2 uv = uvFromFlat("+l+", "+c+", index);\n return sampleTexture("+n+", uv);\n }\n"}(e);case 3:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[1]*t[2],o=t[2],a=X(t),s=a.newShape,A=a.keptDims,u=s;if(u.length<t.length)return"\n "+Ti(Vi(e,u))+"\n float "+r+"(int row, int col, int depth) {\n return "+r+"("+Gi(["row","col","depth"],A)+");\n }\n ";if(e.shapeInfo.isUniform)return"\n float "+r+"(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3("+i+", "+o+", 1)));\n "+Ki(e)+"\n }\n ";var l=e.shapeInfo.texShape,c=l[0],f=l[1],h=e.shapeInfo.flatOffset;return f===i&&null==h?"\n float "+r+"(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2("+o+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+f+".0, "+c+".0);\n return sampleTexture("+n+", uv);\n }\n ":f===o&&null==h?"\n float "+r+"(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2("+t[1]+", 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+f+".0, "+c+".0);\n return sampleTexture("+n+", uv);\n }\n ":"\n float "+r+"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+i+" + col * "+o+" + depth + "+zi(n)+";\n vec2 uv = uvFromFlat("+c+", "+f+", index);\n return sampleTexture("+n+", uv);\n }\n "}(e);case 4:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[3],o=t[2]*i,a=t[1]*o,s=X(t),A=s.newShape,u=s.keptDims;if(A.length<t.length)return"\n "+Ti(Vi(e,A))+"\n float "+r+"(int row, int col, int depth, int depth2) {\n return "+r+"("+Gi(["row","col","depth","depth2"],u)+");\n }\n ";if(e.shapeInfo.isUniform)return"\n float "+r+"(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4("+a+", "+o+", "+i+", 1)));\n "+Ki(e)+"\n }\n ";var l=e.shapeInfo.flatOffset,c=e.shapeInfo.texShape,f=c[0],h=c[1];return h===a&&null==l?"\n float "+r+"(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3("+o+", "+i+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+h+".0, "+f+".0);\n return sampleTexture("+n+", uv);\n }\n ":h===i&&null==l?"\n float "+r+"(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3("+t[1]*t[2]+", "+t[2]+", 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+h+".0, "+f+".0);\n return sampleTexture("+n+", uv);\n }\n ":"\n float "+r+"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+a+" + col * "+o+" +\n depth * "+i+" + depth2;\n vec2 uv = uvFromFlat("+f+", "+h+", index + "+zi(n)+");\n return sampleTexture("+n+", uv);\n }\n "}(e);case 5:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[4],o=t[3]*i,a=t[2]*o,s=t[1]*a,A=X(t),u=A.newShape,l=A.keptDims;if(u.length<t.length)return"\n "+Ti(Vi(e,u))+"\n float "+r+"(int row, int col, int depth, int depth2, int depth3) {\n return "+r+"("+Gi(["row","col","depth","depth2","depth3"],l)+");\n }\n ";if(e.shapeInfo.isUniform)return"\n float "+r+"(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4("+s+", "+a+", "+o+", "+i+")) +\n depth3;\n "+Ki(e)+"\n }\n ";var c=e.shapeInfo.flatOffset,f=e.shapeInfo.texShape,h=f[0],d=f[1];return d===s&&null==c?"\n float "+r+"(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+a+", "+o+", "+i+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+d+".0, "+h+".0);\n return sampleTexture("+n+", uv);\n }\n ":d===i&&null==c?"\n float "+r+"(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4("+t[1]*t[2]*t[3]+",\n "+t[2]*t[3]+", "+t[3]+", 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+d+".0, "+h+".0);\n return sampleTexture("+n+", uv);\n }\n ":"\n float "+r+"(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+s+" + col * "+a+" + depth * "+o+" +\n depth2 * "+i+" + depth3 + "+zi(n)+";\n vec2 uv = uvFromFlat("+h+", "+d+", index);\n return sampleTexture("+n+", uv);\n }\n "}(e);case 6:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=X(t),o=i.newShape,a=i.keptDims;if(o.length<t.length)return"\n "+Ti(Vi(e,o))+"\n float "+r+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return "+r+"("+Gi(["row","col","depth","depth2","depth3","depth4"],a)+");\n }\n ";var s=t[5],A=t[4]*s,u=t[3]*A,l=t[2]*u,c=t[1]*l;if(e.shapeInfo.isUniform)return"\n float "+r+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4("+c+", "+l+", "+u+", "+A+")) +\n dot(\n vec2(depth3, depth4),\n vec2("+s+", 1)));\n "+Ki(e)+"\n }\n ";var f=e.shapeInfo.flatOffset,h=e.shapeInfo.texShape,d=h[0],p=h[1];return p===c&&null==f?"\n float "+r+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+l+", "+u+", "+A+", "+s+")) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+p+".0, "+d+".0);\n return sampleTexture("+n+", uv);\n }\n ":p===s&&null==f?"\n float "+r+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4("+t[1]*t[2]*t[3]*t[4]+",\n "+t[2]*t[3]*t[4]+",\n "+t[3]*t[4]+",\n "+t[4]+")) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+p+".0, "+d+".0);\n return sampleTexture("+n+", uv);\n }\n ":"\n float "+r+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+c+" + col * "+l+" + depth * "+u+" +\n depth2 * "+A+" + depth3 * "+s+" + depth4 + "+zi(n)+";\n vec2 uv = uvFromFlat("+d+", "+p+", index);\n return sampleTexture("+n+", uv);\n }\n "}(e);default:throw new Error(t.length+"-D input sampling is not yet supported")}}function Pi(e){var t;switch(e.shapeInfo.logicalShape.length){case 0:return"\n vec4 "+("get"+(t=e.name).charAt(0).toUpperCase()+t.slice(1))+"() {\n return "+Ui().texture2D+"("+t+", halfCR);\n }\n ";case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),r=e.shapeInfo.texShape,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],o=Ui();return"\n vec4 "+n+"(int index) {\n vec2 uv = packedUVfrom1D(\n "+i[0]+", "+i[1]+", index);\n return "+o.texture2D+"("+t+", uv);\n }\n "}(e);case 2:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=i[0],a=i[1],s=Ui();if(null!=i&&H(t,i))return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+a+".0, "+o+".0);\n\n return "+s.texture2D+"("+n+", uv);\n }\n ";var A=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = packedUVfrom2D("+Math.ceil(t[1]/2)+", "+A[0]+", "+A[1]+", row, col);\n return "+s.texture2D+"("+n+", uv);\n }\n "}(e);case 3:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];if(1===t[0])return"\n "+Pi(Vi(e,t.slice(1)))+"\n vec4 "+r+"(int b, int row, int col) {\n return "+r+"("+Gi(["b","row","col"],[1,2])+");\n }\n ";var a=o[0],s=o[1],A=Math.ceil(t[2]/2);return"\n vec4 "+r+"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n "+a+", "+s+", "+A*Math.ceil(t[1]/2)+", "+A+", b, row, col);\n return "+Ui().texture2D+"("+n+", uv);\n }\n "}(e);default:return function(e){for(var t=e.shapeInfo.logicalShape,n=t.length,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape,a=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],s=a[0],A=a[1],u=Math.ceil(t[n-1]/2),l=u*Math.ceil(t[n-2]/2),c="int b, int row, int col",f="b * "+l+" + (row / 2) * "+u+" + (col / 2)",h=2;h<n-1;h++)c="int b"+h+", "+c,f="b"+h+" * "+(l*=t[n-h-1])+" + "+f;return"\n vec4 "+i+"("+c+") {\n int index = "+f+";\n int texR = index / "+A+";\n int texC = index - texR * "+A+";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+A+", "+s+");\n return "+Ui().texture2D+"("+r+", uv);\n }\n "}(e)}}var Oi="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Mi="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Hi="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",ji="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function zi(e){return"offset"+e}function Ki(e){var t=e.name,n=M(e.shapeInfo.logicalShape);return n<2?"return "+t+";":"\n for (int i = 0; i < "+n+"; i++) {\n if (i == index) {\n return "+t+"[i];\n }\n }\n "}function Wi(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error("GPU for rank "+e+" is not yet supported")}function Vi(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Gi(e,t){return t.map(function(t){return e[t]}).join(", ")}var qi=function(e,t,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,R(e.length>2,function(){return"Packed arg"+(n.charAt(0).toUpperCase()+n.slice(1))+" supports only inputs with rank above 2."});var i=e[e.length-1],o=Math.ceil(i/t);this.outputShape=e.slice(0,-1),o>1&&this.outputShape.push(o),r||this.variableNames.push("bestIndicesA");var a,s,A=this.outputShape,u=A.length,l=Wi(u),c=Ni("coords",u);if(1===o){var f=Wi(s=u+1);a="\n "+f+" sourceLocR = "+f+"("+c.join()+", 0);\n ++"+c[u-1]+";\n "+f+" sourceLocG = "+f+"("+c.join()+", 0);\n ++"+c[u-2]+";\n "+f+" sourceLocA = "+f+"("+c.join()+", 0);\n --"+c[u-1]+";\n "+f+" sourceLocB = "+f+"("+c.join()+", 0);\n --"+c[u-2]+";"}else s=u,a="\n "+l+" sourceLocR = coords;\n ++"+c[u-1]+";\n "+l+" sourceLocG = coords;\n ++"+c[u-2]+";\n "+l+" sourceLocA = coords;\n --"+c[u-1]+";\n "+l+" sourceLocB = coords;\n --"+c[u-2]+";";var h=["x","y","z","w","u","v"].slice(0,s),d="."+h[s-1],p=h.map(function(e){return"int "+e}),g=Ni("sourceLocR",s-1).concat("inIdx.r"),m=Ni("sourceLocG",s-1).concat("inIdx.g"),v=Ni("sourceLocB",s-1).concat("inIdx.b"),w=Ni("sourceLocA",s-1).concat("inIdx.a"),y="max"===n?"greaterThan":"lessThan",b=r?"":"\n inIdx = round(vec4(getBestIndicesAChannel("+g.join()+"),\n getBestIndicesAChannel("+m.join()+"),\n getBestIndicesAChannel("+v.join()+"),\n getBestIndicesAChannel("+w.join()+")));",B="vec4(\n getAChannel("+g.join()+"),\n hasNextCol ? getAChannel("+m.join()+") : 0.,\n hasNextRow ? getAChannel("+v.join()+") : 0.,\n hasNextRow && hasNextCol ? getAChannel("+w.join()+") : 0.)",x=r?"":"\n float getBestIndicesAChannel("+p.join()+") {\n return getChannel(getBestIndicesA("+h.join()+"),\n vec2("+h.slice(-2).join()+"));\n }";this.userCode="\n float getAChannel("+p.join()+") {\n return getChannel(getA("+h.join()+"),\n vec2("+h.slice(-2).join()+"));\n }\n "+x+"\n void main() {\n "+l+" coords = getOutputCoords();\n bool hasNextCol = "+c[u-1]+" < "+(A[u-1]-1)+";\n bool hasNextRow = "+c[u-2]+" < "+(A[u-2]-1)+";\n "+a+"\n ivec4 srcIdx = ivec4(sourceLocR"+d+", sourceLocG"+d+",\n sourceLocB"+d+", sourceLocA"+d+") * "+t+";\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = "+B+";\n\n for (int i = 0; i < "+t+"; i++) {\n inIdx = srcIdx;\n "+b+"\n vec4 candidate = "+B+";\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4("+y+"(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n "},Xi=function(e){this.variableNames=["dy"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o=e.dilationHeight,a=e.dilationWidth,s=e.effectiveFilterHeight,A=e.effectiveFilterWidth,u=s-1-e.padInfo.top,l=A-1-e.padInfo.left,c=1/(t*n);this.userCode="\n const ivec2 pads = ivec2("+u+", "+l+");\n const float avgMultiplier = float("+c+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+s+";\n wR += "+o+") {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+A+";\n wC+= "+a+") {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "},Yi=function(e){this.variableNames=["dy"],this.outputShape=e.inShape;var t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,A=e.dilationHeight,u=e.dilationWidth,l=e.effectiveFilterDepth,c=e.effectiveFilterHeight,f=e.effectiveFilterWidth,h=l-1-e.padInfo.front,d=c-1-e.padInfo.top,p=f-1-e.padInfo.left,g=1/(t*n*r);this.userCode="\n const ivec3 pads = ivec3("+h+", "+d+", "+p+");\n const float avgMultiplier = float("+g+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < "+l+";\n wD += "+s+") {\n float dyD = float(dyDCorner + wD) / "+i+".0;\n\n if (dyD < 0.0 || dyD >= "+e.outDepth+".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < "+c+";\n wR += "+A+") {\n float dyR = float(dyRCorner + wR) / "+o+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+f+";\n wC += "+u+") {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n "},Ji=function(e,t,n,r,i,o){this.outputShape=[],this.variableNames=["x","mean","variance"],Xr(e,t),Xr(e,n);var a="0.0";null!=r&&(Xr(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");var s="1.0";null!=i&&(Xr(e,i),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+a+";\n float scale = "+s+";\n float inv = scale * inversesqrt(variance + float("+o+"));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n "},Zi=function(e,t,n,r,i,o){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Xr(e,t),Xr(e,n);var a="vec4(0.0)";null!=r&&(Xr(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");var s="vec4(1.0)";null!=i&&(Xr(e,i),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n vec4 offset = "+a+";\n vec4 scale = "+s+";\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4("+o+"));\n\n setOutput((x - mean) * inv + offset);\n }\n "},$i=function(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=Xr(t,n),this.userCode="\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n "+e+"\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n "},eo="return a + b;",to="return a - b;",no="return a * b;",ro="return (a < 0.) ? b * a : a;",io=function(e,t,n){this.variableNames=["A","B"],this.outputShape=Xr(t,n),this.userCode="\n float binaryOperation(float a, float b) {\n "+e+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "},oo="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",ao=function(e,t,n,r){void 0===r&&(r=!1),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Xr(t,n);var i=this.outputShape.length,o="";if(r)if(0===i||1===M(this.outputShape))o="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else if(o="\n "+Wi(i)+" coords = getOutputCoords();\n ",1===i)o+="\n result.y = (coords + 1) >= "+this.outputShape[0]+" ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ";else{var a=Ni("coords",i);o+="\n bool nextRowOutOfBounds =\n ("+a[i-2]+" + 1) >= "+this.outputShape[i-2]+";\n bool nextColOutOfBounds =\n ("+a[i-1]+" + 1) >= "+this.outputShape[i-1]+";\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n "}this.userCode="\n vec4 binaryOperation(vec4 a, vec4 b) {\n "+e+"\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n "+o+"\n\n setOutput(result);\n }\n "},so=function(){function e(e){this.variableNames=["A"],this.outputShape=e,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}return e.prototype.getCustomSetupFunc=function(e,t){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(i,"maxVal")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}},e}(),Ao=function(){function e(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}return e.prototype.getCustomSetupFunc=function(e,t){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(i,"maxVal")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}},e}(),uo=function(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "},lo=function(e){this.outputShape=[],this.outputShape=pn(e,1),this.variableNames=e.map(function(e,t){return"T"+t});var t=new Array(e.length-1);t[0]=e[0][1];for(var n=1;n<t.length;n++)t[n]=t[n-1]+e[n][1];var r=["if (yC < "+t[0]+") setOutput(getT0(yR, yC));"];for(n=1;n<t.length;n++){var i=t[n-1];r.push("else if (yC < "+t[n]+") setOutput(getT"+n+"(yR, yC-"+i+"));")}var o=t.length,a=t[t.length-1];r.push("else setOutput(getT"+o+"(yR, yC-"+a+"));"),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n "+r.join("\n ")+"\n }\n "},co=function(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=pn(e,t);var n=this.outputShape,r=n.length,i=Wi(r),o=Ni("coords",r),a=["x","y","z","w","u","v"].slice(0,r);this.variableNames=e.map(function(e,t){return"T"+t});var s=new Array(e.length-1);s[0]=e[0][t];for(var A=1;A<s.length;A++)s[A]=s[A-1]+e[A][t];var u=a[t],l=a.slice(-2),c=a.join(),f="if ("+u+" < "+s[0]+") {\n return getChannel(\n getT0("+c+"), vec2("+l.join()+"));\n }";for(A=1;A<s.length;A++){var h=s[A-1];f+="\n if ("+u+" < "+s[A]+" && "+u+" >= "+s[A-1]+") {\n return getChannel(\n getT"+A+"("+fo(a,u,h)+"),\n vec2("+fo(l,u,h)+"));\n }"}var d=s.length,p=s[s.length-1];f+="\n return getChannel(\n getT"+d+"("+fo(a,u,p)+"),\n vec2("+fo(l,u,p)+"));",this.userCode="\n float getValue("+a.map(function(e){return"int "+e})+") {\n "+f+"\n }\n\n void main() {\n "+i+" coords = getOutputCoords();\n vec4 result = vec4(getValue("+o+"), 0., 0., 0.);\n\n "+o[r-1]+" = "+o[r-1]+" + 1;\n if ("+o[r-1]+" < "+n[r-1]+") {\n result.g = getValue("+o+");\n }\n\n "+o[r-2]+" = "+o[r-2]+" + 1;\n if ("+o[r-2]+" < "+n[r-2]+") {\n result.a = getValue("+o+");\n }\n\n "+o[r-1]+" = "+o[r-1]+" - 1;\n if ("+o[r-2]+" < "+n[r-2]+" &&\n "+o[r-1]+" < "+n[r-1]+") {\n result.b = getValue("+o+");\n }\n setOutput(result);\n }\n "};function fo(e,t,n){var r=e.indexOf(t);return e.map(function(e,t){return t===r?e+" - "+n:e}).join()}var ho=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,i=e.padInfo.left,o="channelsLast"===e.dataFormat;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+r+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n if ("+o+") {\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n } else {\n float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n "},po=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,s=n-1-e.padInfo.left,A=o?1:2,u=o?2:3,l=o?3:1;this.userCode="\n const ivec2 pads = ivec2("+a+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords["+l+"];\n\n ivec2 dyCorner = ivec2(coords["+A+"], coords["+u+"]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n\n if ("+o+") {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n "},go=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,i=e.padInfo.front,o=e.padInfo.top,a=e.padInfo.left;this.userCode="\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yF = 0; yF < "+e.outDepth+"; yF++) {\n int xF = wF + yF * "+t+" - "+i+";\n\n if (xF < 0 || xF >= "+e.inDepth+") {\n continue;\n }\n\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+n+" - "+o+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+r+" - "+a+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},mo=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=t-1-e.padInfo.front,A=n-1-e.padInfo.top,u=r-1-e.padInfo.left;this.userCode="\n const ivec3 pads = ivec3("+s+", "+A+", "+u+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < "+t+"; wF++) {\n float dyF = float(dyFCorner + wF) / "+i+".0;\n\n if (dyF < 0.0 || dyF >= "+e.outDepth+".0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = "+t+" - 1 - wF;\n\n for (int wR = 0; wR < "+n+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+o+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+n+" - 1 - wR;\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+r+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},vo=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,i=e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+o+" + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+r+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "},wo=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode="\n const ivec2 pads = ivec2("+o+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < "+s+"; dm++) {\n int d2 = d1 * "+s+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "},yo=function(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.outputShape=e.outShape;var i=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,s=e.strideWidth,A=e.dilationHeight,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,f=4*Math.floor(e.inChannels/4),h=e.inChannels%4,d="channelsLast"===e.dataFormat,p=d?1:2,g=d?2:3,m=d?3:1,v="",w="";n&&(v=r?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"\n float activation(float x) {\n "+n+"\n }\n ",w="result = activation(result);");var y=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+v+"\n\n const ivec2 strides = ivec2("+a+", "+s+");\n const ivec2 pads = ivec2("+i+", "+o+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords["+m+"];\n\n ivec2 xRCCorner =\n ivec2(coords["+p+"], coords["+g+"]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+l+"; wR++) {\n int xR = xRCorner + wR * "+A+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+c+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+f+"; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if ("+d+") {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if ("+(1===h)+") {\n\n if ("+d+") {\n dotProd +=\n getX(batch, xR, xC, "+f+") *\n getW(wR, wC, "+f+", d2);\n } else {\n dotProd +=\n getX(batch, "+f+", xR, xC) *\n getW(wR, wC, "+f+", d2);\n }\n\n } else if ("+(2===h)+") {\n vec2 wValues = vec2(\n getW(wR, wC, "+f+", d2),\n getW(wR, wC, "+f+" + 1, d2)\n );\n\n if ("+d+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+f+"),\n getX(batch, xR, xC, "+f+" + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, "+f+", xR, xC),\n getX(batch, "+f+" + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if ("+(3===h)+") {\n vec3 wValues = vec3(\n getW(wR, wC, "+f+", d2),\n getW(wR, wC, "+f+" + 1, d2),\n getW(wR, wC, "+f+" + 2, d2)\n );\n\n if ("+d+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+f+"),\n getX(batch, xR, xC, "+f+" + 1),\n getX(batch, xR, xC, "+f+" + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, "+f+", xR, xC),\n getX(batch, "+f+" + 1, xR, xC),\n getX(batch, "+f+" + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n "+y+"\n "+w+"\n setOutput(result);\n }\n "},bo=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.padInfo.front,n=e.padInfo.top,r=e.padInfo.left,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,A=e.dilationHeight,u=e.dilationWidth,l=e.filterDepth,c=e.filterHeight,f=e.filterWidth,h=4*Math.floor(e.inChannels/4),d=e.inChannels%4;this.userCode="\n const ivec3 strides = ivec3("+i+", "+o+", "+a+");\n const ivec3 pads = ivec3("+t+", "+n+", "+r+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < "+l+"; wF++) {\n int xF = xFCorner + wF * "+s+";\n\n if (xF < 0 || xF >= "+e.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+c+"; wR++) {\n int xR = xRCorner + wR * "+A+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+f+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+h+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===d)+") {\n dotProd +=\n getX(batch, xF, xR, xC, "+h+") *\n getW(wF, wR, wC, "+h+", d2);\n } else if ("+(2===d)+") {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, "+h+"),\n getX(batch, xF, xR, xC, "+h+" + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, "+h+", d2),\n getW(wF, wR, wC, "+h+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===d)+") {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, "+h+"),\n getX(batch, xF, xR, xC, "+h+" + 1),\n getX(batch, xF, xR, xC, "+h+" + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, "+h+", d2),\n getW(wF, wR, wC, "+h+" + 1, d2),\n getW(wF, wR, wC, "+h+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},Bo=function(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.outputShape=e.outShape;var i=e.inHeight,o=e.inWidth,a=e.padInfo.top,s=e.padInfo.left,A=e.strideHeight,u=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,f=e.filterHeight,h=e.filterWidth,d=e.outChannels/e.inChannels,p="",g="";n&&(p=r?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"\n float activation(float x) {\n "+n+"\n }\n ",g="result = activation(result);");var m=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+p+"\n\n const ivec2 strides = ivec2("+A+", "+u+");\n const ivec2 pads = ivec2("+a+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+d+";\n int q = d2 - d1 * "+d+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+f+"; wR++) {\n int xR = xRCorner + wR * "+l+";\n\n if (xR < 0 || xR >= "+i+") {\n continue;\n }\n\n for (int wC = 0; wC < "+h+"; wC++) {\n int xC = xCCorner + wC * "+c+";\n\n if (xC < 0 || xC >= "+o+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n "+m+"\n "+g+"\n setOutput(result);\n }\n "},xo=function(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;for(var i=e.inHeight,o=e.inWidth,a=e.padInfo.top,s=e.padInfo.left,A=e.strideHeight,u=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,f=e.filterHeight,h=e.filterWidth,d=h,p="int xR; int xC; int xCOffset;",g=0;g<f;g++)for(var m=0;m<h;m++)p+="\n vec4 xTexelR"+g+"C"+2*m+" = vec4(0.);\n vec4 wR"+g+"C"+m+" = vec4(0.);\n vec4 xR"+g+"C"+m+" = vec4(0.);";for(g=0;g<f;g++)for(var v=0;v<d;v++){if(p+="\n xR = xRCorner + "+g*l+";\n xC = xCCorner + "+(m=2*v)*c+";\n ",1===u){if(m<h&&(p+=s%2==1?"\n xCOffset = xC + 1;\n if(xR >= 0 && xR < "+i+" && xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+m+" = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= "+o+") {\n xTexelR"+g+"C"+m+".zw = vec2(0.);\n }\n } else {\n xTexelR"+g+"C"+m+" = vec4(0.);\n }\n\n xCOffset = xC + 1 - 2;\n if(xR >= 0 && xR < "+i+" && xCOffset >= 0 && xCOffset < "+o+") {\n vec4 previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= "+o+") {\n previous.zw = vec2(0.);\n }\n\n xR"+g+"C"+m+" = vec4(previous.zw, xTexelR"+g+"C"+m+".xy);\n } else {\n xR"+g+"C"+m+" = vec4(0, 0, xTexelR"+g+"C"+m+".xy);\n }\n ":"\n if(xR >= 0 && xR < "+i+" && xC >= 0 && xC < "+o+") {\n xTexelR"+g+"C"+m+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+g+"C"+m+" = vec4(0.);\n }\n\n xR"+g+"C"+m+" = xTexelR"+g+"C"+m+";\n ",m+1<h)){var w=s%2==0?Q(c):c;c%2==0&&s%2==1||c%2!=0&&s%2!=1?(p+="\n xCOffset = xC + "+s%2+" + "+w+";\n\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+(m+2)+" = getX(batch, xR, xCOffset, d1);\n }\n ",c>1&&(p+="\n xCOffset -= 2;\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+m+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+g+"C"+m+" = vec4(0.);\n }\n "),p+="\n xR"+g+"C"+(m+1)+" = vec4(\n xTexelR"+g+"C"+m+".zw, xTexelR"+g+"C"+(m+2)+".xy);\n "):p+="\n xCOffset = xC + "+w+";\n\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+(m+2)+" = getX(batch, xR, xCOffset, d1);\n }\n\n xR"+g+"C"+(m+1)+" = xTexelR"+g+"C"+(m+2)+";\n "}}else m<h&&(p+="\n if(xR >= 0 && xR < "+i+") {\n ",s%2==1?(p+="\n xCOffset = xC + 1 - "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+m+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+g+"C"+m+" = vec4(0.);\n }\n\n if(xC + 1 >= 0 && xC + 1 < "+o+") {\n xTexelR"+g+"C"+(m+2)+" = getX(batch, xR, xC + 1, d1);\n } else {\n xTexelR"+g+"C"+(m+2)+" = vec4(0.);\n }\n\n xR"+g+"C"+m+" = vec4(\n xTexelR"+g+"C"+m+".zw, xTexelR"+g+"C"+(m+2)+".zw);\n ",m+1<h&&(p+="\n vec4 final = vec4(0.);\n xCOffset = xC + 1 + "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n final = getX(batch, xR, xCOffset, d1);\n }\n xR"+g+"C"+(m+1)+" = vec4(xTexelR"+g+"C"+(m+2)+".xy, final.xy);\n ")):(p+="\n if(xC >= 0 && xC < "+o+") {\n xTexelR"+g+"C"+m+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+g+"C"+m+" = vec4(0.);\n }\n\n xCOffset = xC + "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+g+"C"+(m+2)+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+g+"C"+(m+2)+" = vec4(0.);\n }\n\n xR"+g+"C"+m+" = vec4(\n xTexelR"+g+"C"+m+".xy, xTexelR"+g+"C"+(m+2)+".xy);\n ",m+1<h&&(p+="\n xR"+g+"C"+(m+1)+" = vec4(\n xTexelR"+g+"C"+m+".zw, xTexelR"+g+"C"+(m+2)+".zw);\n ")),p+="}");m<h&&(p+="\n vec4 wTexelR"+g+"C"+m+" = getW("+g+", "+m+", d1, q);\n wR"+g+"C"+m+" = vec4(wTexelR"+g+"C"+m+".xz, wTexelR"+g+"C"+m+".xz);\n ",m+1<h&&(p+="\n vec4 wTexelR"+g+"C"+(m+1)+" = getW("+g+", "+(m+1)+", d1, q);\n wR"+g+"C"+(m+1)+" =\n vec4(wTexelR"+g+"C"+(m+1)+".xz, wTexelR"+g+"C"+(m+1)+".xz);"))}for(g=0;g<f;g++)for(m=0;m<h;m++)p+="dotProd += xR"+g+"C"+m+" * wR"+g+"C"+m+";";var y="",b="";n&&(y=r?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"vec4 activation(vec4 x) {\n "+n+"\n }",b="result = activation(result);");var B=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+y+"\n\n const ivec2 strides = ivec2("+A+", "+u+");\n const ivec2 pads = ivec2("+a+", "+s+");\n\n void main() {\n\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2;\n int q = 0;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n vec4 dotProd = vec4(0.);\n\n "+p+"\n\n vec4 result = dotProd;\n "+B+"\n "+b+"\n setOutput(result);\n }\n "},Co=function(e,t,n,r,i){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];var o=e[0],a=e[1],s=e[2],A=e[3],u=t[0],l=n[0],c=n[1];this.outputShape=[u,l,c,A];var f="bilinear"===r?1:0,h=[a-1+".0",s-1+".0"],d=h[0],p=h[1],g=l>1?[""+(a-1)/(l-1),"(y2-y1) * height_ratio","y1*"+d+" + float(y)*(height_scale)"]:["0.0","0.0","0.5 * (y1+y2) * "+d],m=g[0],v=g[1],w=g[2],y=c>1?[""+(s-1)/(c-1),"(x2-x1) * width_ratio","x1*"+p+" + float(x)*(width_scale)"]:["0.0","0.0","0.5 * (x1+x2) * "+p],b=y[0],B=y[1],x=y[2];this.userCode="\n const float height_ratio = float("+m+");\n const float width_ratio = float("+b+");\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= "+o+") {\n return;\n }\n\n float height_scale = "+v+";\n float width_scale = "+B+";\n\n float in_y = "+w+";\n if( in_y < 0.0 || in_y > "+d+" ) {\n setOutput(float("+i+"));\n return;\n }\n float in_x = "+x+";\n if( in_x < 0.0 || in_x > "+p+" ) {\n setOutput(float("+i+"));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if("+f+" == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n "},Fo=function(e,t,n){this.variableNames=["x"],this.outputShape=e;var r=e.length,i=e[e.length-1],o=n?"<":">";this.userCode="\n int getIndex(int i) {\n "+(n?"return "+i+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+Wi(r)+" coords = getOutputCoords();\n int end = "+Eo(r,"coords")+";\n float val = 0.0;\n for (int i = "+i+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+o+" end) {\n continue;\n }\n if (idx == end && "+t+") {\n continue;\n }\n "+Eo(r,"coords")+" = idx;\n val += getX("+function(e,t){if(1===e)return""+t;if(2===e)return t+".x, "+t+".y";if(3===e)return t+".x, "+t+".y, "+t+".z";if(4===e)return t+".x, "+t+".y, "+t+".z, "+t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}(r,"coords")+");\n }\n setOutput(val);\n }\n "};function Eo(e,t){if(1===e)return""+t;if(2===e)return t+".y";if(3===e)return t+".z";if(4===e)return t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}var So=function(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Xe.DENSE;var t=rt(e),n=Ui();this.outputShape=e,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n "+Li(["r","c","d"],e)+"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = 4 * (resTexRC.x * "+t[1]+" + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n "+n.output+" = result;\n }\n "},ko=function(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Xe.DENSE;var t=rt(e),n=Ui();this.outputShape=e,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n "+Li(["r","c","d"],e)+"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = 4 * (resTexRC.x * "+t[1]+" + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n "+n.output+" = result;\n }\n "},_o=function(){function e(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = "+this.getHeightCoordString()+";\n int w = "+this.getWidthCoordString()+";\n int d = "+this.getDepthCoordString()+";\n\n int in_h = h / "+t+";\n int offset_h = imod(h, "+t+");\n int in_w = w / "+t+";\n int offset_w = imod(w, "+t+");\n int offset_d = (offset_h * "+t+" + offset_w) *\n "+this.getOutputDepthSize()+";\n int in_d = d + offset_d;\n\n float result = "+this.getInputSamplingString()+";\n setOutput(result);\n }\n "}return e.prototype.getHeightCoordString=function(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"},e.prototype.getWidthCoordString=function(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"},e.prototype.getDepthCoordString=function(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"},e.prototype.getOutputDepthSize=function(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]},e.prototype.getInputSamplingString=function(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"},e}(),Io=function(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "},No=function(e){this.variableNames=["A"],this.outTexUsage=Ye.DOWNLOAD;var t=Ui();this.outputShape=e,this.userCode="\n "+Di+"\n\n void main() {\n float x = getAAtOutCoords();\n "+t.output+" = encode_float(x);\n }\n "},Uo=function(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Ye.DOWNLOAD;var t=Ui();this.outputShape=e,this.userCode="\n "+Di+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n "+t.output+" = encode_float(x);\n }\n "},Lo=function(e,t,n){void 0===n&&(n=!1),this.variableNames=["A"];var r=Ui(),i=t[0],o=t[1];this.outputShape=e;var a="result";n&&(a="floor(result * 255. + 0.5)"),this.userCode="\n "+Qi(e)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n \n int r = flatIndex / "+o+";\n int c = imod(flatIndex, "+o+");\n vec2 uv = (vec2(c, r) + halfCR) / vec2("+o+".0, "+i+".0);\n vec4 values = "+r.texture2D+"(A, uv);\n\n float result;\n\n if(offset == 0) {\n result = values[0];\n } else if(offset == 1) {\n result = values[1];\n } else if(offset == 2) {\n result = values[2];\n } else {\n result = values[3];\n }\n\n "+r.output+" = vec4("+a+", 0., 0., 0.);\n }\n "},Qo=function(e,t,n){void 0===n&&(n=!1),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var r=Ui(),i=t[0],o=t[1];this.outputShape=e;var a="",s="result";n&&(s="floor(result * 255. + 0.5)");for(var A=0;A<=1;A++)for(var u=0;u<=1;u++){var l=2*A+u;a+="\n localCoords = coords;\n if(localCoords[2] + "+u+" < "+e[2]+") {\n localCoords[2] += "+u+";\n if(localCoords[1] + "+A+" < "+e[1]+") {\n localCoords[1] += "+A+";\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n r = flatIndex / "+o+";\n c = imod(flatIndex, "+o+");\n uv = (vec2(c, r) + halfCR) / vec2("+o+".0, "+i+".0);\n values = "+r.texture2D+"(A, uv);\n\n if(offset == 0) {\n result["+l+"] = values[0];\n } else if(offset == 1) {\n result["+l+"] = values[1];\n } else if(offset == 2) {\n result["+l+"] = values[2];\n } else {\n result["+l+"] = values[3];\n }\n }\n }\n "}this.userCode="\n "+Qi(e)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n\n "+a+"\n\n "+r.output+" = "+s+";\n }\n "},Do=function(e,t,n){this.variableNames=["real","imag"];var r=t[1];this.outputShape=t;var i=n?"2.0 * "+Math.PI:"-2.0 * "+Math.PI,o=n?r+".0":"1.0";this.userCode="\n const float exponentMultiplier = "+i+";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n "+e+"\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float("+r+");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < "+r+"; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / "+o+";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n "},Ro=function(){function e(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode="\n uniform float value;\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.valueLoc&&(t.valueLoc=n.getUniformLocationNoThrow(r,"value")),n.gl.uniform1f(t.valueLoc,e)}},e}(),To=function(e,t,n){this.variableNames=["A","indices"];var r=e.slice();r[n]=t,this.outputShape=r,this.rank=r.length;var i=Wi(this.rank),o=function(e,t){var n=e.length;if(n>4)throw Error("Gather for rank "+n+" is not yet supported");if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],o=0;o<e.length;o++)o===t?i.push("int(getIndices("+r[o]+"))"):i.push(""+r[o]);return i.join()}(e,n);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Po=function(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;var r=Wi(t.length),i=Wi(n.length),o=this.sliceDim>1?"strides[j]":"strides";this.userCode="\n "+r+" strides = "+r+"("+this.strides+");\n void main() {\n "+i+" coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < "+this.sliceDim+"; j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * "+o+";\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n "};function Oo(e,t){var n=Ui();return lt(e,t,n.version+"\n precision highp float;\n "+n.attribute+" vec3 clipSpacePos;\n "+n.attribute+" vec2 uv;\n "+n.varyingVs+" vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function Mo(e,t){return vt(e,t,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Ho(e,t){return wt(e,t,new Uint16Array([0,1,2,2,1,3]))}function jo(e,t,n,r,i,o,a){bt(n,r);var s=yt(e,t),A=e.TEXTURE_2D;return at(e,t,function(){return e.bindTexture(A,s)}),at(e,t,function(){return e.texParameteri(A,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),at(e,t,function(){return e.texParameteri(A,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),at(e,t,function(){return e.texParameteri(A,e.TEXTURE_MIN_FILTER,e.NEAREST)}),at(e,t,function(){return e.texParameteri(A,e.TEXTURE_MAG_FILTER,e.NEAREST)}),at(e,t,function(){return e.texImage2D(A,0,i,n,r,0,o,a,null)}),at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)}),s}function zo(e,t,n,r,i){var o=nt(n,r);return jo(e,t,o[0],o[1],i.internalFormatFloat,i.textureFormatFloat,e.FLOAT)}function Ko(e,t,n,r,i){var o=nt(n,r);return jo(e,t,o[0],o[1],i.internalFormatHalfFloat,i.textureFormatFloat,i.textureTypeHalfFloat)}function Wo(e,t,n,r,i){var o=nt(n,r);return jo(e,t,o[0],o[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function Vo(e,t,n,r,i){var o=it(n,r);return jo(e,t,o[0],o[1],i.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function Go(e,t,n,r,i){var o=it(n,r);return jo(e,t,o[0],o[1],i.internalFormatPackedHalfFloat,e.RGBA,i.textureTypeHalfFloat)}function qo(e,t,n,r){return at(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),xt(e,t,n,"clipSpacePos",r,3,20,0)&&xt(e,t,n,"uv",r,2,20,12)}function Xo(e,t,n,r,i,o,a){var s,A,u;at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)}),o instanceof Uint8Array?(s=new Uint8Array(r*i*4),A=e.UNSIGNED_BYTE,u=e.RGBA):(s=new Float32Array(r*i*4),A=e.FLOAT,u=a.internalFormatPackedFloat),s.set(o),at(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,u,r,i,0,e.RGBA,A,s)}),at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function Yo(e,t,n,r){at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)}),r.data instanceof Uint8Array?at(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.width,r.height,0,e.RGBA,e.UNSIGNED_BYTE,r.data)}):at(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r)}),at(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function Jo(e,t,n,r,i){var o=e.createBuffer();at(e,t,function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,o)});var a=16*n*r;return at(e,t,function(){return e.bufferData(e.PIXEL_PACK_BUFFER,a,e.STREAM_READ)}),at(e,t,function(){return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,0)}),at(e,t,function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}),o}function Zo(e,t,n){var r=e,i=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,i),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),i}function $o(e,t,n,r,i){var o=nt(n,r),a=o[0],s=o[1],A=new Uint8Array(n*r*4);return at(e,t,function(){return e.readPixels(0,0,a,s,i.downloadTextureFormat,e.UNSIGNED_BYTE,A)}),new Float32Array(A.buffer)}function ea(e,t,n,r,i,o,a,s){var A=e,u=new Float32Array(function(e,t){var n=it(e,t);return n[0]*n[1]*4}(o,a));return A.bindBuffer(A.PIXEL_PACK_BUFFER,t),A.getBufferSubData(A.PIXEL_PACK_BUFFER,0,u),A.bindBuffer(A.PIXEL_PACK_BUFFER,null),u}function ta(e,t,n,r){var i=new Float32Array(n*r*4);return at(e,t,function(){return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,i)}),i}var na=Object.freeze({createVertexShader:Oo,createVertexBuffer:Mo,createIndexBuffer:Ho,createFloat32MatrixTexture:zo,createFloat16MatrixTexture:Ko,createUnsignedBytesMatrixTexture:Wo,createPackedMatrixTexture:Vo,createFloat16PackedMatrixTexture:Go,bindVertexProgramAttributeStreams:qo,uploadDenseMatrixToTexture:Xo,uploadPixelDataToTexture:Yo,createBufferFromOutputTexture:Jo,downloadFloat32MatrixFromBuffer:Zo,downloadByteEncodedFloatMatrixFromOutputTexture:$o,downloadPackedMatrixFromBuffer:ea,downloadMatrixFromPackedOutputTexture:ta}),ra=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var t=x().getNumber("WEBGL_VERSION");null!=e?(this.gl=e,et(t,e)):this.gl=tt(t);var n="WEBGL_color_buffer_float";if(1===x().getNumber("WEBGL_VERSION")){if(this.textureFloatExtension=ut(this.gl,this.debug,"OES_texture_float"),zt(this.gl,"OES_texture_half_float"))this.textureHalfFloatExtension=ut(this.gl,this.debug,"OES_texture_half_float");else if(x().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),zt(this.gl,"EXT_color_buffer_half_float"))this.colorBufferHalfFloatExtension=ut(this.gl,this.debug,"EXT_color_buffer_half_float");else if(x().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",zt(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!zt(this.gl,"EXT_color_buffer_half_float"))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float")}this.vertexBuffer=Mo(this.gl,this.debug),this.indexBuffer=Ho(this.gl,this.debug),this.framebuffer=Bt(this.gl,this.debug),this.textureConfig=ot(this.gl,this.textureHalfFloatExtension)}return Object.defineProperty(e.prototype,"debug",{get:function(){return x().getBool("DEBUG")},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;at(t,this.debug,function(){return t.finish()}),at(t,this.debug,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),at(t,this.debug,function(){return t.deleteFramebuffer(e.framebuffer)}),at(t,this.debug,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),at(t,this.debug,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),at(t,this.debug,function(){return t.deleteBuffer(e.indexBuffer)}),this.disposed=!0}},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),zo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),Ko(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),Wo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),Yo(this.gl,this.debug,e,t)},e.prototype.uploadDenseMatrixToTexture=function(e,t,n,r){this.throwIfDisposed(),Xo(this.gl,this.debug,e,t,n,r,this.textureConfig)},e.prototype.createFloat16PackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Go(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Vo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(_t(this.gl,this.debug,this.framebuffer),this.outputTexture=null),at(this.gl,this.debug,function(){return t.gl.deleteTexture(e)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return $o(r.gl,r.debug,t,n,r.textureConfig)})},e.prototype.downloadPackedMatrixFromBuffer=function(e,t,n,r,i,o){return ea(this.gl,e,0,0,0,i,o,this.textureConfig)},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t){return Zo(this.gl,e,t)},e.prototype.createBufferFromTexture=function(e,t,n){this.bindTextureToFrameBuffer(e);var r=Jo(this.gl,this.debug,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);return this.pollFence(e)},e.prototype.createFence=function(e){var t,n,r=this;if(x().getBool("WEBGL_FENCE_API_ENABLED")){var i=e,o=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=i.clientWaitSync(o,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=o}else x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:t,isFencePassed:n}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return ta(r.gl,r.debug,t,n)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,n=ct(t,this.debug,e),r=Oo(t,this.debug),i=pt(t,this.debug);return at(t,this.debug,function(){return t.attachShader(i,r)}),at(t,this.debug,function(){return t.attachShader(i,n)}),gt(t,this.debug,i),this.debug&&mt(t,this.debug,i),this.vertexAttrsAreBound||(this.setProgram(i),this.vertexAttrsAreBound=qo(t,this.debug,this.program,this.vertexBuffer)),i},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&at(this.gl,this.debug,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&mt(this.gl,this.debug,this.program),at(this.gl,this.debug,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?Ft(this.gl,this.debug,e,t):Et(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var n=this;return this.throwIfDisposed(),at(this.gl,this.debug,function(){return n.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),St(this.gl,this.debug,this.program,e,t,n)},e.prototype.setOutputMatrixTexture=function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,n){this.throwIfDisposed();var r=it(t,n),i=r[0],o=r[1];this.setOutputMatrixTextureDriver(e,i,o)},e.prototype.setOutputMatrixWriteRegion=function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},e.prototype.debugValidate=function(){null!=this.program&&mt(this.gl,this.debug,this.program),It(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.debug&&this.debugValidate(),at(e,this.debug,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),at(this.gl,this.debug,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=ut(this.gl,this.debug,2===x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),i=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,i),i},e.prototype.endQuery=function(){if(2!==x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return y(this,void 0,void 0,function(){var t=this;return b(this,function(n){switch(n.label){case 0:return[4,V(function(){return t.disposed||t.isQueryAvailable(e,x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return n.sent(),[2,this.getQueryTime(e,x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),i=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint}return i=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT),null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(n){t.addItemToPoll(function(){return e.isFencePassed()},function(){return n()})})},e.prototype.pollItems=function(){for(var e=function(e){for(var t=0;t<e.length&&e[t]();++t);return t-1}(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t)(0,this.itemsToPoll[t].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||V(function(){return n.pollItems(),0===n.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),kt(this.gl,this.debug,e,this.framebuffer),this.debug&&It(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(kt(this.gl,this.debug,this.outputTexture,this.framebuffer),this.debug&&It(this.gl)):_t(this.gl,this.debug,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n},e.prototype.setOutputMatrixTextureDriver=function(e,t,n){this.throwIfDisposed();var r=this.gl;kt(r,this.debug,e,this.framebuffer),this.debug&&It(r),this.outputTexture=e,at(r,this.debug,function(){return r.viewport(0,0,t,n)}),at(r,this.debug,function(){return r.scissor(0,0,t,n)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,n,r){var i=this;this.throwIfDisposed(),at(this.gl,this.debug,function(){return i.gl.scissor(e,t,n,r)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},e}();function ia(e,t){if(e.length!==t.length)throw Error("Binary was compiled with "+e.length+" inputs, but was executed with "+t.length+" inputs");e.forEach(function(e,n){var r=e.logicalShape,i=t[n],o=i.shape;if(!H(r,o))throw Error("Binary was compiled with different shapes than the current args. Shapes "+r+" and "+o+" must match");if(!e.isUniform||!i.isUniform){var a=e.texShape,s=i.isUniform?null:i.texData.texShape;if(!H(a,s))throw Error("Binary was compiled with different texture shapes than the current args. Shape "+a+" and "+s+" must match")}})}var oa=function(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;for(var r=n.filterWidth,i=n.inChannels,o=n.strideWidth,a=n.strideHeight,s=n.padInfo,A=n.outWidth,u=n.dilationWidth,l=n.dilationHeight,c=n.dataFormat,f=s.left,h=s.top,d=i*r,p=Ui(),g="channelsLast"===c,m=g?0:1,v=g?1:2,w="",y=0;y<=1;y++)for(var b=0;b<=1;b++)w+="\n blockIndex = rc.y + "+b+";\n pos = rc.x + "+y+";\n\n if(blockIndex < "+e[1]+" && pos < "+e[0]+") {\n offsetY = int(blockIndex / ("+A+")) * "+a+" - "+h+";\n d0 = offsetY + "+l+" * (pos / "+d+");\n\n if(d0 < "+t[m]+" && d0 >= 0) {\n\n offsetX = int(mod(float(blockIndex), "+A+".) * "+o+". - "+f+".);\n d1 = offsetX + "+u+" * (int(mod(float(pos), "+d+".) / "+i+".));\n\n if(d1 < "+t[v]+" && d1 >= 0) {\n\n ch = int(mod(float(pos), "+i+".));\n\n if ("+g+") {\n innerDims = vec2(d1, ch);\n result["+(2*y+b)+"] = getChannel(\n getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result["+(2*y+b)+"] = getChannel(\n getA(ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n ";this.userCode="\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n "+w+"\n\n "+p.output+" = result;\n }\n "},aa=function(e,t,n,r,i){this.variableNames=["x"],this.outputShape=[];var o,a=t,s=e[3]-1;this.outputShape=e;var A="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+A+")":1===i?"1.0/("+A+")":"exp(log("+A+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -"+a+"; j <= "+a+"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= "+s+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+o+";\n setOutput(val);\n }\n "},sa=function(e,t,n,r,i){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=i,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+t+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+t+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+r+") * norm + float("+n+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+r+")\n * float("+i+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+i+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "},Aa=function(e,t,n,r,i){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;var o,a=t,s=e[3]-1;this.outputShape=e;var A="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+A+")":1===i?"1.0/("+A+")":"exp(log("+A+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < "+this.outputShape[3]+";\n bool hasNextRow = c < "+this.outputShape[2]+";\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - "+a+";\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - "+a+"; j <= "+a+"; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2("+s+"));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * "+o+";\n setOutput(result);\n }\n "},ua=function(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;var t=e.strideHeight,n=e.strideWidth,r=e.dilationHeight,i=e.effectiveFilterHeight,o=e.effectiveFilterWidth,a=i-1-e.padInfo.top,s=o-1-e.padInfo.left,A=i*o-1;this.userCode="\n const ivec2 pads = ivec2("+a+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+i+";\n wR += "+r+") {\n float dyR = float(dyRCorner + wR) / "+t+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+o+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+n+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+A+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+o+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "},la=function(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;var t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,i=e.dilationDepth,o=e.dilationHeight,a=e.dilationWidth,s=e.effectiveFilterDepth,A=e.effectiveFilterHeight,u=e.effectiveFilterWidth,l=s-1-e.padInfo.front,c=A-1-e.padInfo.top,f=u-1-e.padInfo.left,h=s*A*u-1;this.userCode="\n const ivec3 pads = ivec3("+l+", "+c+", "+f+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < "+s+";\n wD += "+i+") {\n float dyD = float(dyDCorner + wD) / "+t+".0;\n\n if (dyD < 0.0 || dyD >= "+e.outDepth+".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < "+A+";\n wR += "+o+") {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+u+";\n wC += "+a+") {\n float dyC = float(dyCCorner + wC) / "+r+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = "+h+" -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * "+A+" * "+u+" +\n wR * "+u+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n "},ca=function(e,t,n,r,i,o,a){void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=null),void 0===a&&(a=!1),this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;var s=n?e[1]:e[2],A=Math.ceil(s/2),u=n?"i * 2, rc.y":"rc.y, i * 2",l=r?"rc.z, i * 2":"i * 2, rc.z",c=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],h="",d="";o&&(h=a?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n "+o+"\n }":"vec4 activation(vec4 x) {\n "+o+"\n }",d="result = activation(result);");var p=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+h+"\n\n const float sharedDimension = "+A+".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < "+A+"; i++) {\n vec4 a = getMatrixA(rc.x, "+u+");\n vec4 b = getMatrixB(rc.x, "+l+");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += ("+c[0]+" * "+f[0]+");\n result += ("+c[1]+" * "+f[1]+");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n "+p+"\n\n "+d+"\n\n setOutput(result);\n }\n "},fa=function(){function e(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(t-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(t-1)+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(t.seedLoc,e)}},e}(),ha=function(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+r+"), float("+n+"),\n float(index == coords.y)));\n }\n "},da=function(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e;var t=e.length;if(0===t)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{var n=Ni("rc",t),r=Wi(t),i=function(e,t,n){if(1===e)return"rc > "+t[0];for(var r="",i=e-2;i<e;i++)r+=n[i]+" >= "+t[i],i<e-1&&(r+="||");return r}(t,e,n),o=function(e,t,n,r){if(1===e)return"";var i=r.slice(-2);return"\n int r = "+i[0]+";\n int c = "+i[1]+";\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= "+t+";\n bool rEdge = rp1 >= "+n+";\n "}(t,e[e.length-1],e[e.length-2],n),a=function(e,t){var n=e.length,r=function(e,t){for(var n=[],r=0;r<=1;r++)for(var i=0;i<=1;i++){for(var o=(0===r?"r":"rp1")+", "+(0===i?"c":"cp1"),a=2;a<e;a++)o=t[t.length-1-a]+","+o;n.push(o)}return n}(n,t);return 1===n?"getA(rc),\n rc + 1 >= "+e[0]+" ? 0. : getA(rc + 1),\n 0, 0":"getA("+r[0]+"),\n cEdge ? 0. : getA("+r[1]+"),\n rEdge ? 0. : getA("+r[2]+"),\n rEdge || cEdge ? 0. : getA("+r[3]+")"}(e,n);this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n\n if("+i+") {\n setOutput(vec4(0));\n } else {\n "+o+"\n\n setOutput(vec4("+a+"));\n }\n }\n "}},pa=function(e,t,n){this.variableNames=["x"],this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});var r=e.length,i=Wi(r),o=t.map(function(e){return e[0]}).join(","),a=t.map(function(t,n){return t[0]+e[n]}).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?"\n "+i+" start = "+i+"("+o+");\n "+i+" end = "+i+"("+a+");\n\n void main() {\n "+i+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+n+"));\n } else {\n "+i+" coords = outC - start;\n setOutput(getX("+s+"));\n }\n }\n ":"\n int start = "+o+";\n int end = "+a+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+n+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "},ga=function(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});for(var r=e.length,i=Wi(r),o=t.map(function(e){return e[0]}).join(","),a=t.map(function(t,n){return t[0]+e[n]}).join(","),s=Ni("rc",r),A=Ni("source",r),u=s[r-1]+" < "+this.outputShape[r-1],l=1===r?"source":"vec2("+A.slice(-2).join()+")",c=[i+" rc = outputLoc;",s[r-1]+" += 1;\n if("+u+") {\n ",1===r?"":"}\n rc = outputLoc;\n "+s[r-2]+" += 1;\n if("+s[r-2]+" < "+this.outputShape[r-2]+") {",1===r?"":" "+s[r-1]+" += 1;\n if("+u+") {"],f=1===r?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="",d=0,p=1===r?2:4;d<p;d++)h+="\n "+c[d]+"\n if ("+f+") {\n result["+d+"] = float("+n+");\n } else {\n "+i+" source = rc - start;\n result["+d+"] = getChannel(getX("+A.join()+"), "+l+");\n }\n ";h+=1===r?"} ":"}}",this.userCode="\n const "+i+" start = "+i+"("+o+");\n const "+i+" end = "+i+"("+a+");\n\n void main() {\n "+i+" outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n "+h+"\n setOutput(result);\n }\n "},ma=function(e,t,n){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");var r=e.filterWidth,i=e.strideHeight,o=e.strideWidth,a=e.dilationHeight,s=e.dilationWidth,A=e.effectiveFilterHeight,u=e.effectiveFilterWidth,l=e.padInfo.top,c=e.padInfo.left;this.outputShape=e.outShape;var f="avg"===t,h="0.0";if(f||(h="-1.0 / 1e-20"),n)this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+l+", "+c+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+A+";\n wR += "+a+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+u+";\n wC += "+s+") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+u+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var d=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===t&&(d="avgValue / count");var p=4*Math.floor(r/4),g=r%4,m="\n if ("+f+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+l+", "+c+");\n const float initializationValue = "+h+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+e.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+h+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+A+";\n wR += "+a+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+p+"; wC += 4) {\n int xC = xCCorner + wC * "+s+";\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n getValue(batch, xR, xC + 2 * "+s+", d),\n getValue(batch, xR, xC + 3 * "+s+", d)\n );\n\n "+m+"\n }\n\n int xC = xCCorner + "+p+";\n if ("+(1===g)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+m+"\n } else if ("+(2===g)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n initializationValue,\n initializationValue\n );\n\n "+m+"\n } else if ("+(3===g)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n getValue(batch, xR, xC + 2 * "+s+", d),\n initializationValue\n );\n\n "+m+"\n }\n }\n setOutput("+d+");\n }\n "}},va=function(e,t,n){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");var r=e.filterWidth,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,A=e.dilationHeight,u=e.dilationWidth,l=e.effectiveFilterDepth,c=e.effectiveFilterHeight,f=e.effectiveFilterWidth,h=e.padInfo.front,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;var g="avg"===t,m="0.0";if(g||(m="-1.0 / 1e-20"),n)this.userCode="\n const ivec3 strides =\n ivec3("+i+", "+o+", "+a+");\n const ivec3 pads = ivec3("+h+", "+d+", "+p+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < "+l+";\n wD += "+s+") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= "+e.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+c+";\n wR += "+A+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+f+";\n wC += "+u+") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition =\n wD * "+c+" * "+f+" +\n wR * "+f+" + wC;;\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var v=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===t&&(v="avgValue / count");var w=4*Math.floor(r/4),y=r%4,b="\n if ("+g+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec3 strides =\n ivec3("+i+", "+o+", "+a+");\n const ivec3 pads = ivec3("+h+", "+d+", "+p+");\n const float initializationValue = "+m+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= "+e.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4("+m+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < "+l+";\n wD += "+s+") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= "+e.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+c+";\n wR += "+A+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+w+"; wC += 4) {\n int xC = xCCorner + wC * "+u+";\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n getValue(batch, xD, xR, xC + 2 * "+u+", ch),\n getValue(batch, xD, xR, xC + 3 * "+u+", ch)\n );\n\n "+b+"\n }\n\n int xC = xCCorner + "+w+";\n if ("+(1===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+b+"\n } else if ("+(2===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n initializationValue,\n initializationValue\n );\n\n "+b+"\n } else if ("+(3===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n getValue(batch, xD, xR, xC + 2 * "+u+", ch),\n initializationValue\n );\n\n "+b+"\n }\n }\n setOutput("+v+");\n }\n }\n "}},wa=function(e,t){this.variableNames=["x"];var n=e.windowSize,r=e.batchSize,i=e.inSize,o=Math.ceil(i/n);this.outputShape=[r,o];var a="0.0",s="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",s="min"):"max"===t&&(a="-1.0 / 1e-20",s="max");var A=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===t?A="sumValue":"prod"===t?A="prodValue":"all"===t?A="allValue":"any"===t&&(A="anyValue");var u=4*Math.floor(n/4),l=n%4,c="\n if ("+("sum"===t)+") {\n sumValue += dot(values, ones);\n } else if ("+("prod"===t)+") {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = "+s+"(values, minMaxValue);\n }\n ",f="vec4";"all"===t?(a="1.0",c="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",f="bvec4"):"any"===t&&(a="0.0",c="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",f="bvec4");var h="";i%n>0&&(h="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+a+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+h+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n vec4 minMaxValue = vec4("+a+");\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+u+"; i += 4) {\n int inIdx = inOffset + i;\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+c+"\n }\n\n int inIdx = inOffset + "+u+";\n if ("+(1===l)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+c+"\n } else if ("+(2===l)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+c+"\n } else if ("+(3===l)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+c+"\n }\n setOutput("+A+");\n }\n "},ya=function(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;for(var n="",r=0;r<4;r++){var i="thisRC = rc;";r%2==1&&(i+="thisRC.z += 1;"),r>1&&(i+="thisRC.y += 1;"),n+="\n "+i+"\n "+(r>0?"if(thisRC.y < rows && thisRC.z < cols){":"")+"\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result["+r+"] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n "+(r>0?"}":"")+"\n "}this.userCode="\n \n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n "+Li(["r","c","d"],t)+"\n return ivec3(r, c, d);\n }\n \n "+Qi(e)+"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = "+e[1]+";\n int cols = "+e[2]+";\n\n "+n+"\n\n setOutput(result);\n }\n "},ba=function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,i=r[1],o=r[2],a=e.shape,s=a[1],A=a[2],u=[n&&s>1?i-1:i,n&&A>1?o-1:o],l=[n&&s>1?s-1:s,n&&A>1?A-1:A],c=u[0]/l[0],f=u[1]/l[1],h=1/c,d=1/f,p=2*Math.ceil(h)+2,g=2*Math.ceil(d)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+c+");\n const float widthScale = float("+f+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+d+");\n\n const int winHeight = int("+p+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+A+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(i-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(o-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},Ba=function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var A=[r&&t>1?o-1:o,r&&n>1?a-1:a],u=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+A[0]/u[0]+",\n "+A[1]/u[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+a+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "},xa=function(e,t,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var A=[r&&t>1?o-1:o,r&&n>1?a-1:a],u=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n "+A[0]/u[0]+",\n "+A[1]/u[1]+",\n "+A[1]/u[1]+");\n const vec3 inputShapeRC = vec3("+o+".0, "+a+".0,\n "+a+".0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = vec3(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(sourceFracIndexRC);\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < "+(s-1)+";\n bool hasNextRow = coords.z < "+(n-1)+";\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n "},Ca=function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,i=r[1],o=r[2],a=e.shape,s=a[1],A=a[2],u=[n&&s>1?i-1:i,n&&A>1?o-1:o],l=[n&&s>1?s-1:s,n&&A>1?A-1:A],c=u[0]/l[0],f=u[1]/l[1],h=1/c,d=1/f,p=2*Math.ceil(h)+2,g=2*Math.ceil(d)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+c+");\n const float widthScale = float("+f+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+d+");\n\n const int winHeight = int("+p+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+A+") {\n continue;\n }\n\n float sourceFracRow =\n float("+u[0]+") *\n (float(dyR) / float("+l[0]+"));\n\n float sourceFracCol =\n float("+u[1]+") *\n (float(dyC) / float("+l[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+i+") - 1),\n "+n+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+o+") - 1),\n "+n+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},Fa=function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var A=[r&&t>1?o-1:o,r&&n>1?a-1:a],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],l=r?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+A[0]/u[0]+",\n "+A[1]/u[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+a+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+l+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "},Ea=function(e,t){this.variableNames=["x"];var n=e.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");if(this.outputShape=e,1!==n){var r=e.map(function(n,r){return function(n){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+" - coords["+n+"] - 1":"coords["+n+"]"}(r)}).join(","),i=Wi(n);this.userCode="\n void main() {\n "+i+" coords = getOutputCoords();\n setOutput(getX("+r+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+e[0]+" - coord - 1));\n }\n "},Sa=function(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;var n=e.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");this.outputShape=e;var r=Ni("rc",n),i=r[n-1]+" + 1 < "+this.outputShape[n-1],o=r[n-2]+" + 1 < "+this.outputShape[n-2],a=Wi(n);function s(n){var r=e.map(function(r,i){return function(n,r){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+" - "+r[n]+" - 1":""+r[n]}(i,n)});return"getChannel(getX("+r.join(",")+"), vec2("+r.slice(-2).join(",")+"))"}this.userCode=1===n?"\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX("+e[0]+" - rc - 1),\n "+e[0]+" - rc - 1);\n if("+i+"){\n result.g = getChannel(getX("+e[0]+" - (rc + 1) - 1),\n "+e[0]+" - (rc + 1) - 1);\n }\n setOutput(result);\n }\n ":"\n void main() {\n "+a+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = "+function(e){return s(e)}(r.slice())+";\n if("+i+"){\n result.g = "+function(e){return e[n-1]="("+e[n-1]+" + 1)",s(e)}(r.slice())+";\n }\n if("+o+") {\n result.b = "+function(e){return e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())+";\n if("+i+") {\n result.a = "+function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())+";\n }\n }\n setOutput(result);\n }\n "},ka=function(e,t,n,r,i,o,a){void 0===a&&(a=!0),this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;var s=Wi(i.length),A=Wi(o.length),u="";1===n?u="i":2===n&&(u="i, j");var l="getIndices("+u+")",c="";1===r?c="i":2===r&&(c="i, coords[1]");var f="getUpdates("+c+")",h=t>1?"strides[j]":"strides";this.userCode="\n "+s+" strides = "+s+"("+i+");\n\n void main() {\n "+A+" coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < "+e+"; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < "+t+"; j++) {\n int index = round("+l+");\n flattenedIndex += index * "+h+";\n }\n if (flattenedIndex == coords[0]) {\n sum += "+f+";\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n "},_a=function(e,t){this.variableNames=["x","segmentIds"];var n=e.windowSize,r=e.batchSize,i=e.inSize,o=e.numSegments,a=o*Math.ceil(i/n);this.outputShape=[r,a];var s=4*Math.floor(n/4),A=n%4,u="\n sumValue += dot(values, segFilter);\n ",l="";i%n>0&&(l="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n ");var c="";i%n>0&&(c="\n if (inIdx < 0 || inIdx >= "+i+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+l+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+c+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+o+")) * float("+n+"));\n int currentSeg = int(mod(float(outIdx), float("+o+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+s+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+u+"\n }\n\n int inIdx = inOffset + "+s+";\n if ("+(1===A)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+u+"\n } else if ("+(2===A)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+u+"\n } else if ("+(3===A)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+u+"\n }\n setOutput(sumValue);\n }\n "},Ia=function(e,t,n){var r,i;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error("Where for rank "+n+" is not yet supported");if(1===n)i="resRC",r="resRC";else{for(var o=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],s=[],A=0;A<t.length;A++)s.push(""+o[A]),A<e&&a.push(""+o[A]);r=a.join(),i=s.join()}var u=Wi(n);this.userCode="\n void main() {\n "+u+" resRC = getOutputCoords();\n float cVal = getC("+r+");\n if (cVal >= 1.0) {\n setOutput(getA("+i+"));\n } else {\n setOutput(getB("+i+"));\n }\n }\n "},Na=function(){function e(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;var t,n=Wi(this.rank),r="uniform int start["+this.rank+"];",i=function(e){if(1===e)return"sourceLoc";if(e<=6)return Ua.slice(0,e).map(function(e){return"sourceLoc."+e}).join(",");throw Error("Slicing for rank "+e+" is not yet supported")}(this.rank);t="\n "+n+" sourceLoc;\n "+n+" coords = getOutputCoords();\n "+e.map(function(e,t){return"sourceLoc."+Ua[t]+" = start["+t+"] + coords."+Ua[t]+";"}).join("\n")+"\n ",this.userCode="\n "+r+"\n void main() {\n "+t+"\n setOutput(getSource("+i+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}},e}(),Ua=["x","y","z","w","u","v"],La=function(){function e(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;var t=Wi(this.rank),n=Ni("coords",this.rank),r=Ni("sourceLoc",this.rank),i=1===this.rank?"sourceLoc":"vec2("+r.slice(-2).join()+")",o="getChannel(getSource("+r.join()+"), "+i+")",a="\n result.x = "+o+";\n if (++"+n[this.rank-1]+" < "+e[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.y = "+o+";\n --"+r[this.rank-1]+";\n }\n ",s=1===this.rank?"":"\n --"+n[this.rank-1]+";\n if (++"+n[this.rank-2]+" < "+e[this.rank-2]+") {\n ++"+r[this.rank-2]+";\n result.z = "+o+";\n if (++"+n[this.rank-1]+" < "+e[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.w = "+o+";\n }\n }\n ",A=this.rank<=4?"sourceLoc = coords +\n "+t+"("+e.map(function(e,t){return"start["+t+"]"}).join()+");":e.map(function(e,t){return r[t]+" = "+n[t]+" + start["+t+"];"}).join("\n");this.userCode="\n uniform int start["+this.rank+"];\n void main() {\n "+t+" coords = getOutputCoords();\n "+t+" sourceLoc;\n "+A+"\n vec4 result = vec4(0.);\n "+a+"\n "+s+"\n setOutput(result);\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}},e}(),Qa=function(e,t,n){this.variableNames=["x"],this.outputShape=n;var r=n.length,i=Wi(n.length),o=Wi(n.length),a="";if(1===r)a="coords * strides + begin";else{var s=0;a=n.map(function(e,t){return s++,1===n.length?"coords * strides["+t+"] + begin["+t+"]":"coords["+(s-1)+"] * strides["+t+"] + begin["+t+"]"}).join(",")}this.userCode="\n "+i+" begin = "+i+"("+e+");\n "+i+" strides = "+i+"("+t+");\n\n void main() {\n "+o+" coords = getOutputCoords();\n setOutput(getX("+a+"));\n }\n "},Da=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t,n){var r,i=Ra(t,n),o=Ta(e,i,n);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),i===Je.PACKED_2X2_FLOAT32?r=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===Je.PACKED_2X2_FLOAT16?r=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===Je.UNPACKED_FLOAT32?r=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===Je.UNPACKED_FLOAT16?r=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===Je.PACKED_4X1_UNSIGNED_BYTE&&(r=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(r),r},e.prototype.releaseTexture=function(e,t,n,r){if(null!=this.freeTextures){var i=Ta(t,Ra(n,r),r);i in this.freeTextures||(this.freeTextures[i]=[]),this.freeTextures[i].push(e),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[i],a=o.indexOf(e);if(a<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a,1),this.log()}},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+e+")")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function Ra(e,t){if(e===Ye.UPLOAD)return Je.PACKED_2X2_FLOAT32;if(e===Ye.RENDER||null==e)return function(e){return x().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Je.PACKED_2X2_FLOAT32:Je.UNPACKED_FLOAT32:e?Je.PACKED_2X2_FLOAT16:Je.UNPACKED_FLOAT16}(t);if(e===Ye.DOWNLOAD||e===Ye.PIXELS)return Je.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type "+e)}function Ta(e,t,n){return e[0]+"_"+e[1]+"_"+t+"_"+n}var Pa=function(e,t){this.variableNames=["A"];for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[r]*t[r];this.outputShape=n,this.rank=n.length;var i=Wi(this.rank),o=function(e){var t=e.length;if(t>5)throw Error("Tile for rank "+t+" is not yet supported");if(1===t)return"imod(resRC, "+e[0]+")";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],i=0;i<e.length;i++)r.push("imod("+n[i]+", "+e[i]+")");return r.join()}(e);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Oa=function(e,t){this.variableNames=["A"];for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[t[r]];this.outputShape=n,this.rank=n.length;var i=Wi(this.rank),o=function(e){var t=e.length;if(t>6)throw Error("Transpose for rank "+t+" is not yet supported");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t),i=0;i<e.length;i++)r[e[i]]=n[i];return r.join()}(t);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Ma=function(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[t[r]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error("Packed transpose for rank "+this.rank+" is not yet supported.");var i=Wi(this.rank),o=Ii("rc",this.rank),a=new Array(this.rank);for(r=0;r<t.length;r++)a[t[r]]=o[r];var s="vec2("+a.slice(-2).join()+")",A="++"+o[this.rank-1]+" < "+n[this.rank-1],u="getChannel(getA("+a.join()+"), "+s+")";this.userCode="\n void main() {\n "+i+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = "+u+";\n if("+A+") {\n result[1] = "+u+";\n }\n --"+o[this.rank-1]+";\n if(++"+o[this.rank-2]+" < "+n[this.rank-2]+") {\n result[2] = "+u+";\n if("+A+") {\n result[3] = "+u+";\n }\n }\n setOutput(result);\n }\n "},Ha=1.7580993408473768,ja=1.0507009873554805,za=function(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode="\n float unaryOperation(float x) {\n "+t+"\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "},Ka="if (isnan(x)) return x;",Wa="return abs(x);",Va=Ka+"\n return (x < 0.0) ? 0.0 : x;\n",Ga=Ka+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",qa="return (x >= 0.0) ? x : (exp(x) - 1.0);",Xa="\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = "+Ha+";\n float scale = "+ja+";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n",Ya="return -x;",Ja="return ceil(x);",Za="return floor(x);",$a="return exp(x);",es="return exp(x) - 1.0;",ts=Ka+"\n return sin(x);\n",ns=Ka+"\n return cos(x);\n",rs=Ka+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n",is=Ka+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n",os=Ka+"\n return atan(x);\n",as=Ka+"return log(x + sqrt(x * x + 1.0));",ss=Ka+"\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));",As=Ka+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;",us="return x;",ls="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cs="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",fs="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",hs=function(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode="\n vec4 unaryOperation(vec4 x) {\n "+t+"\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n "},ds=function(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;var t=e.length,n=Ni("rc",t),r=Wi(t),i=function(e,t){if(1===e)return"rc";for(var n="",r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(t,n),o=n.slice(-2),a=t<=1?"rc":"vec2("+o.join(",")+")";this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n vec4 packedInput = getA("+i+");\n\n setOutput(getChannel(packedInput, "+a+"));\n }\n "},ps={};function gs(e,t){if(void 0===t&&(t=!1),"linear"===e)return"return x;";if("relu"===e)return t?ls:Va;if("elu"===e)return t?fs:qa;if("relu6"===e)return t?cs:Ga;if("prelu"===e)return t?oo:ro;throw new Error("Activation "+e+" has not been implemented for the WebGL backend.")}var ms=function(e){function t(t){var n,r=e.call(this)||this;if(r.pendingRead=new WeakMap,r.pendingDisposal=new WeakSet,r.dataRefCount=new WeakMap,r.numBytesInGPU=0,r.uploadWaitMs=0,r.downloadWaitMs=0,r.warnedAboutMemory=!1,r.pendingDeletes=0,r.disposed=!1,!x().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==t){var i=tt(x().getNumber("WEBGL_VERSION"));r.binaryCache=((n=x().getNumber("WEBGL_VERSION"))in ps||(ps[n]={}),ps[n]),r.gpgpu=new ra(i),r.canvas=i.canvas,r.gpgpuCreatedLocally=!0}else r.gpgpu=t,r.binaryCache={},r.gpgpuCreatedLocally=!1,r.canvas=t.gl.canvas;return r.textureManager=new Da(r.gpgpu),r.numMBBeforeWarning=null==x().global.screen?1024:x().global.screen.height*x().global.screen.width*window.devicePixelRatio*600/1024/1024,r.texData=new Kr(r,Ve),r}return w(t,e),t.prototype.numDataIds=function(){return this.texData.numDataIds()+(this.cpuBackend?this.cpuBackend.numDataIds():0)-this.pendingDeletes},t.prototype.write=function(e,t,n){if(x().getBool("DEBUG")&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");var r={};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:Ye.UPLOAD}),r},t.prototype.move=function(e,t,n,r){if(x().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:Ye.UPLOAD})},t.prototype.readSync=function(e){var t=this.texData.get(e),n=t.values,r=t.dtype,i=t.complexTensors,o=t.slice,a=t.shape,s=t.isPacked;if(null!=o){var A;A=s?new hs(a,us):new za(a,us);var u=this.runWebGLProgram(A,[{dataId:e,shape:a,dtype:r}],r),l=this.readSync(u.dataId);return this.disposeData(u.dataId),l}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===r)return n;var c,f,h=null!=this.activeTimers;return h&&(c=pe()),f="complex64"===r?ci(i.real.dataSync(),i.imag.dataSync()):this.getValuesFromTexture(e),h&&(this.downloadWaitMs+=pe()-c),this.convertAndCacheOnCPU(e,f)},t.prototype.read=function(e){return y(this,void 0,void 0,function(){var t,n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,B,C;return b(this,function(b){switch(b.label){case 0:if(this.pendingRead.has(e))return t=this.pendingRead.get(e),[2,new Promise(function(e){return t.push(e)})];if(n=this.texData.get(e),r=n.values,i=n.shape,o=n.slice,a=n.dtype,s=n.complexTensors,A=n.isPacked,null!=o)return void 0,u=A?new hs(i,us):new za(i,us),l=this.runWebGLProgram(u,[{dataId:e,shape:i,dtype:a}],a),c=this.read(l.dataId),this.disposeData(l.dataId),[2,c];if(null!=r)return[2,this.convertAndCacheOnCPU(e)];if(!x().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===x().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");return f=null,"complex64"!==a&&x().get("WEBGL_BUFFER_SUPPORTED")&&(h=this.decode(e),d=this.texData.get(h.dataId),f=(C=this.gpgpu).createBufferFromTexture.apply(C,[d.texture].concat(rt(i)))),this.pendingRead.set(e,[]),"complex64"===a?[3,2]:[4,this.gpgpu.createAndWaitForFence()];case 1:b.sent(),b.label=2;case 2:return"complex64"!==a?[3,4]:[4,Promise.all([s.real.data(),s.imag.data()])];case 3:return g=b.sent(),m=g[0],v=g[1],p=ci(m,v),[3,5];case 4:null==f?p=this.getValuesFromTexture(e):(w=M(i),p=this.gpgpu.downloadFloat32MatrixFromBuffer(f,w)),b.label=5;case 5:return null!=h&&this.disposeData(h.dataId),y=this.convertAndCacheOnCPU(e,p),B=this.pendingRead.get(e),this.pendingRead.delete(e),B.forEach(function(e){return e(y)}),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e),this.pendingDeletes--),[2,y]}})})},t.prototype.checkNumericalProblems=function(e){if(null!=e)for(var t=0;t<e.length;t++){var n=e[t];if(!st(n)){if(x().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error("The value "+n+" cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'");throw Error("The value "+n+" cannot be represented on this device.")}}},t.prototype.getValuesFromTexture=function(e){var t,n=this.texData.get(e),r=n.shape,i=n.dtype,o=n.isPacked,a=M(r);if(x().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){var s=this.decode(e),A=this.texData.get(s.dataId),u=(t=this.gpgpu).downloadMatrixFromPackedTexture.apply(t,[A.texture].concat(rt(r))).subarray(0,a);return this.disposeData(s.dataId),u}var l=x().getBool("WEBGL_PACK")&&!0===o,c=l?Rt(r):r,f=l?new Uo(c):new No(c),h=this.runWebGLProgram(f,[{shape:c,dtype:i,dataId:e}],"float32"),d=this.texData.get(h.dataId),p=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(d.texture,d.texShape[0],d.texShape[1]).subarray(0,a);return this.disposeData(h.dataId),p},t.prototype.time=function(e){return y(this,void 0,void 0,function(){var t,n,r,i,o,a,s;return b(this,function(A){switch(A.label){case 0:return t=this.activeTimers,n=[],r=!1,null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,e(),i=O(this.activeTimers.map(function(e){return e.query})).filter(function(e){return null!=e}),o=O(this.activeTimers.map(function(e){return e.name})).filter(function(e){return null!=e}),this.activeTimers=t,r&&(this.programTimersStack=null),a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[4,Promise.all(i)]:[3,2];case 1:return s=A.sent(),a.kernelMs=D(s),a.getExtraProfileInfo=function(){return s.map(function(e,t){return{name:o[t],ms:e}}).map(function(e){return e.name+": "+e.ms}).join(", ")},[3,3];case 2:a.kernelMs={error:"WebGL query timers are not supported in this environment."},A.label=3;case 3:return this.uploadWaitMs=0,this.downloadWaitMs=0,[2,a]}})})},t.prototype.memory=function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU}},t.prototype.startTimer=function(){return x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:pe(),endMs:null}},t.prototype.endTimer=function(e){return x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=pe(),e)},t.prototype.getQueryTime=function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){return x().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},t.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e)){if(this.pendingRead.has(e))return this.pendingDisposal.add(e),void this.pendingDeletes++;if(this.texData.has(e)){this.releaseGPUData(e);var t=this.texData.get(e).complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.texData.delete(e)}}},t.prototype.releaseGPUData=function(e){var t=this.texData.get(e),n=t.texture,r=t.dtype,i=t.texShape,o=t.usage,a=t.isPacked,s=t.slice,A=s&&s.origDataId||e,u=this.dataRefCount.get(A);u>1?this.dataRefCount.set(A,u-1):(this.dataRefCount.delete(A),null!=n&&(this.numBytesInGPU-=this.computeBytes(i,r),this.textureManager.releaseTexture(n,i,o,a)));var l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null},t.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},t.prototype.getDataInfo=function(e){return this.texData.get(e)},t.prototype.getCPUBackend=function(){return x().getBool("WEBGL_CPU_FORWARD")?(null==this.cpuBackend&&(this.cpuBackend=Ve.findBackend("cpu")),this.cpuBackend):null},t.prototype.shouldExecuteOnCPU=function(e,t){var n=this;return void 0===t&&(t=128),null!=this.getCPUBackend()&&e.every(function(e){return null==n.texData.get(e.dataId).texture&&e.size<t})},t.prototype.getGPGPUContext=function(){return this.gpgpu},t.prototype.complex=function(e,t){var n=this.makeOutput(e.shape,"complex64");return this.texData.get(n.dataId).complexTensors={real:Ve.keep(e.clone()),imag:Ve.keep(t.clone())},n},t.prototype.real=function(e){return this.texData.get(e.dataId).complexTensors.real.clone()},t.prototype.imag=function(e){return this.texData.get(e.dataId).complexTensors.imag.clone()},t.prototype.slice=function(e,t,n){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.slice(e,t,n);if(0===M(n))return yn([],n,e.dtype);var r=this.texData.get(e.dataId).isPacked,i=Or(e.shape,t,n);if(r||!i){var o=x().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new La(n):new Na(n),a=o.getCustomSetupFunc(t);return this.compileAndRun(o,[e],null,a)}return this.uploadToGPU(e.dataId),this.shallowSlice(e,t,n)},t.prototype.shallowSlice=function(e,t,n){var r=this.texData.get(e.dataId),i=this.makeOutput(n,e.dtype),o=this.texData.get(i.dataId);Object.assign(o,r),o.shape=n,o.dtype=e.dtype;var a=Mr(t,e.strides);r.slice&&(a+=r.slice.flatOffset),o.slice={flatOffset:a,origDataId:r.slice&&r.slice.origDataId||e.dataId};var s=this.dataRefCount.get(o.slice.origDataId)||1;return this.dataRefCount.set(o.slice.origDataId,s+1),i},t.prototype.stridedSlice=function(e,t,n,r){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.stridedSlice(e,t,n,r);var i=Rr(t,n,r);if(i.some(function(e){return 0===e}))return yn([],i);var o=new Qa(t,r,i);return this.compileAndRun(o,[e])},t.prototype.reverse=function(e,t){var n=x().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Sa(e.shape,t):new Ea(e.shape,t);return this.compileAndRun(n,[e])},t.prototype.concat=function(e,t){if("complex64"===e[0].dtype){var n=e.map(function(e){return vn(e)}),r=e.map(function(e){return wn(e)});return mn(this.concat(n,t),this.concat(r,t))}if(this.shouldExecuteOnCPU(e))return this.cpuBackend.concat(e,t);if(1===e.length)return e[0];if(e.length>x().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var i=Math.floor(e.length/2),o=this.concat(e.slice(0,i),t),a=this.concat(e.slice(i),t);return this.concat([o,a],t)}if(x().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].rank>1){var s=new co(e.map(function(e){return e.shape}),t);return this.compileAndRun(s,e)}var A=pn(e.map(function(e){return e.shape}),t),u=e.map(function(e){return e.as2D(-1,M(e.shape.slice(t)))}),l=new lo(u.map(function(e){return e.shape}));return this.compileAndRun(l,u).reshape(A)},t.prototype.neg=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.neg(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,Ya,e.dtype);var t=new za(e.shape,Ya);return this.compileAndRun(t,[e])},t.prototype.batchMatMul=function(e,t,n,r){var i=n?e.shape[2]:e.shape[1],o=r?t.shape[1]:t.shape[2],a=n?e.shape[1]:e.shape[2],s=e.shape[0];if((1===i||1===o)&&a>1e3){n&&(e=e.transpose([0,2,1])),r&&(t=t.transpose([0,2,1]));var A=1===o?e:e.as3D(s,a,1),u=1===o?2:1,l=1===o?t.as3D(s,1,a):t;return this.multiply(A,l).sum(u,!0)}var c=Pe(e.dtype,t.dtype),f=new ca(e.shape,[s,i,o],n,r);return this.compileAndRun(f,[e,t],c)},t.prototype.fusedBatchMatMul=function(e){var t=e.a,n=e.b,r=e.transposeA,i=e.transposeB,o=e.bias,a=e.activation,s=e.preluActivationWeights,A=r?t.shape[2]:t.shape[1],u=i?n.shape[1]:n.shape[2],l=t.shape[0],c=Pe(t.dtype,n.dtype),f=null!=o,h=null!=s,d=a?gs(a,!0):null,p=new ca(t.shape,[l,A,u],r,i,f,d,h),g=[t,n];return o&&g.push(o),s&&g.push(s),this.compileAndRun(p,g,c)},t.prototype.multiply=function(e,t){if("complex64"===e.dtype){var n=this.texData.get(e.dataId),r=this.texData.get(t.dataId),i=new $i("return areal * breal - aimag * bimag;",e.shape,t.shape),o=new $i("return areal * bimag + aimag * breal;",e.shape,t.shape),a=[this.makeComplexComponentTensorInfo(e,n.complexTensors.real),this.makeComplexComponentTensorInfo(e,n.complexTensors.imag),this.makeComplexComponentTensorInfo(t,r.complexTensors.real),this.makeComplexComponentTensorInfo(t,r.complexTensors.imag)],s=this.compileAndRun(i,a),A=this.compileAndRun(o,a),u=this.complex(s,A);return s.dispose(),A.dispose(),u}if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.multiply(e,t);if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,no,e.dtype);var l=new io(no,e.shape,t.shape);return this.compileAndRun(l,[e,t],e.dtype)},t.prototype.batchNormalization=function(e,t,n,r,i,o){var a=[e,t,n],s=null;null!=o&&(s=o.shape,a.push(o));var A=null;if(null!=i&&(A=i.shape,a.push(i)),x().getBool("WEBGL_PACK_NORMALIZATION")){var u=new Zi(e.shape,t.shape,n.shape,s,A,r);return this.compileAndRun(u,a)}var l=new Ji(e.shape,t.shape,n.shape,s,A,r);return this.compileAndRun(l,a)},t.prototype.localResponseNormalization4D=function(e,t,n,r,i){var o=x().getBool("WEBGL_PACK_NORMALIZATION")?new Aa(e.shape,t,n,r,i):new aa(e.shape,t,n,r,i);return this.compileAndRun(o,[e])},t.prototype.LRNGrad=function(e,t,n,r,i,o,a){var s=new sa(t.shape,r,i,o,a);return this.compileAndRun(s,[t,n,e])},t.prototype.tile=function(e,t){if("string"===e.dtype){var n=this.readSync(e.dataId).map(function(e){return ve(e)});return Ci(Jn(e.shape,e.dtype,n),t)}var r=new Pa(e.shape,t);return this.compileAndRun(r,[e])},t.prototype.pad=function(e,t,n){var r=x().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new ga(e.shape,t,n):new pa(e.shape,t,n);return this.compileAndRun(r,[e])},t.prototype.transpose=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.transpose(e,t);var n=x().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ma(e.shape,t):new Oa(e.shape,t);return this.compileAndRun(n,[e])},t.prototype.gather=function(e,t,n){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.gather(e,t,n);var r=new To(e.shape,t.size,n);return this.compileAndRun(r,[e,t])},t.prototype.batchToSpaceND=function(e,t,n){R(e.rank<=4,function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"});var r=t.reduce(function(e,t){return e*t}),i=Cr(e.shape,t,r),o=Fr(i.length,t.length),a=Er(e.shape,t,r),s=Sr(n,t.length),A=kr(a,n,t.length);return e.reshape(i).transpose(o).reshape(a).slice(s,A)},t.prototype.spaceToBatchND=function(e,t,n){R(e.rank<=4,function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"});var r=t.reduce(function(e,t){return e*t}),i=[[0,0]];i.push.apply(i,n);for(var o=1+t.length;o<e.shape.length;++o)i.push([0,0]);var a=e.pad(i),s=Cr(a.shape,t,r,!1),A=Fr(s.length,t.length,!1),u=Er(a.shape,t,r,!1);return a.reshape(s).transpose(A).reshape(u)},t.prototype.reduce=function(e,t,n){var r=e.shape[0],i=e.shape[1],o=Ir(i),a=new wa({windowSize:o,inSize:i,batchSize:r},t),s=this.compileAndRun(a,[e],n);return 1===s.shape[1]?s:this.reduce(s,t,n)},t.prototype.argReduce=function(e,t,n){void 0===n&&(n=null);var r=e.shape[0],i=e.shape[1];null!=n&&(r=n.shape[0],i=n.shape[1]);var o=Ir(i),a=new _i({windowSize:o,inSize:i,batchSize:r},t,null==n),s=[e];null!=n&&s.push(n);var A=this.compileAndRun(a,s,"int32");return 1===A.shape[1]?A:this.argReduce(e,t,A)},t.prototype.argReducePacked=function(e,t,n){void 0===n&&(n=null);var r=null!=n?n.shape:e.shape,i=Ir(r[r.length-1]),o=new qi(r,i,t,null==n),a=null==n?[e]:[e,n],s=this.compileAndRun(o,a,"int32");return s.rank===e.rank?this.argReducePacked(e,t,s):s},t.prototype.sum=function(e,t){ln("sum",t,e.rank);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i),a=Oe(e.dtype);return this.reduce(o,"sum",a).reshape(r)},t.prototype.prod=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.prod(e,t);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i),a=Oe(e.dtype);return this.reduce(o,"prod",a).reshape(r)},t.prototype.unsortedSegmentSum=function(e,t,n){var r=0,i=cn([r],e.rank),o=e;null!=i&&(o=e.transpose(i),r=hn(1,e.rank)[0]);var a=function(e,t,n){for(var r=[],i=e.length,o=0;o<i;o++)o!==t?r.push(e[o]):r.push(n);return r}(o.shape,r,n),s=M([o.shape[r]]),A=o.as2D(-1,s),u=Oe(e.dtype),l=this.segOpCompute(A,"unsortedSegmentSum",t,u,n).reshape(a);return null!=i&&(l=l.transpose(fn(i))),l},t.prototype.segOpCompute=function(e,t,n,r,i){var o=e.shape[0],a=e.shape[1],s=function(e,t){var n,r=!1;for(e<=30?(n=e,r=!0):n=ue(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=ue(e,n+1);return n}(a,i),A=new _a({windowSize:s,inSize:a,batchSize:o,numSegments:i},t),u=this.compileAndRun(A,[e,n],r);return u.shape[1]===i?u:(n=In(0,i).tile([a/s]),this.segOpCompute(u,t,n,r,i))},t.prototype.argMinMaxReduce=function(e,t,n){var r=[t];if(ln("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,e.rank),!x().getBool("WEBGL_PACK_REDUCE")||e.rank<=2){var i=An(e.shape,r),o=i[0],a=M(i[1]),s=e.as2D(-1,a);return this.argReduce(s,n).reshape(o)}return this.argReducePacked(e,n)},t.prototype.argMin=function(e,t){return this.argMinMaxReduce(e,t,"min")},t.prototype.argMax=function(e,t){return this.argMinMaxReduce(e,t,"max")},t.prototype.cumsum=function(e,t,n,r){if(t!==e.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis="+(e.rank-1)+" but got axis="+t);var i=new Fo(e.shape,n,r);return this.compileAndRun(i,[e])},t.prototype.equal=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(equal(a, b));\n","bool");var n=new io("return float(a == b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.notEqual=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(notEqual(a, b));\n","bool");var n=new io("return float(a != b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.less=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.less(e,t);if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThan(a, b));\n","bool");var n=new io("return float(a < b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.lessEqual=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThanEqual(a, b));\n","bool");var n=new io("return float(a <= b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.greater=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.greater(e,t);if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThan(a, b));\n","bool");var n=new io("return float(a > b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.greaterEqual=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThanEqual(a, b));\n","bool");var n=new io("return float(a >= b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.logicalNot=function(e){var t=new za(e.shape,"return float(!(x >= 1.0));");return this.compileAndRun(t,[e])},t.prototype.logicalAnd=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n","bool");var n=new io("return float(a >= 1.0 && b >= 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.logicalOr=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n","bool");var n=new io("return float(a >= 1.0 || b >= 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")},t.prototype.select=function(e,t,n){var r=new Ia(e.rank,t.shape,t.rank);return this.compileAndRun(r,[e,t,n],Pe(t.dtype,n.dtype))},t.prototype.where=function(e){en("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var t=e.dataSync();return Ei(e.shape,t)},t.prototype.topk=function(e,t,n){return Fi(e.dataSync(),e.shape,e.dtype,t)},t.prototype.min=function(e,t){ln("min",t,e.rank);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i);return this.reduce(o,"min",o.dtype).reshape(r)},t.prototype.minimum=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.minimum(e,t);var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n vec4 result = vec4(min(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new io("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.mod=function(e,t){var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n vec4 result = mod(a, b);\n vec4 isNaN = vec4(equal(b, vec4(0.0)));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new io("if (b == 0.0) return NAN;\n return mod(a, b);",e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.max=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.max(e,t);ln("max",t,e.rank);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i);return this.reduce(o,"max",o.dtype).reshape(r)},t.prototype.maximum=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.maximum(e,t);var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n vec4 result = vec4(max(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new io("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.all=function(e,t){ln("all",t,e.rank);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i);return this.reduce(o,"all",o.dtype).reshape(r)},t.prototype.any=function(e,t){ln("any",t,e.rank);var n=An(e.shape,t),r=n[0],i=M(n[1]),o=e.as2D(-1,i);return this.reduce(o,"any",o.dtype).reshape(r)},t.prototype.realDivide=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n","float32",!0);var n=new io("\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",e.shape,t.shape);return this.compileAndRun(n,[e,t],"float32")},t.prototype.floorDiv=function(e,t){if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n","int32");var n=new io("\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",e.shape,t.shape);return this.compileAndRun(n,[e,t],"int32")},t.prototype.add=function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,eo);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.add(e,t);var n=Pe(e.dtype,t.dtype);if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,eo,n);var r=new io(eo,e.shape,t.shape);return this.compileAndRun(r,[e,t],n)},t.prototype.packedUnaryOp=function(e,t,n){var r=new hs(e.shape,t);return this.compileAndRun(r,[e],n)},t.prototype.packedBinaryOp=function(e,t,n,r,i){void 0===i&&(i=!1);var o=new ao(n,e.shape,t.shape,i);return this.compileAndRun(o,[e,t],r)},t.prototype.complexSeparableBinaryOp=function(e,t,n){var r=this,i=this.texData.get(e.dataId),o=this.texData.get(t.dataId),a=[[i.complexTensors.real,o.complexTensors.real],[i.complexTensors.imag,o.complexTensors.imag]].map(function(i){var o=i[0],a=i[1],s=r.makeComplexComponentTensorInfo(e,o),A=r.makeComplexComponentTensorInfo(t,a),u=new io(n,e.shape,t.shape);return r.compileAndRun(u,[s,A],Pe(o.dtype,a.dtype))}),s=a[0],A=a[1],u=this.complex(s,A);return s.dispose(),A.dispose(),u},t.prototype.makeComplexComponentTensorInfo=function(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}},t.prototype.addN=function(e){if(1===e.length)return e[0];if(e.length>x().get("WEBGL_MAX_TEXTURES_IN_SHADER")){var t=Math.floor(e.length/2),n=this.addN(e.slice(0,t)),r=this.addN(e.slice(t));return this.addN([n,r])}var i=e.map(function(e){return e.dtype}).reduce(function(e,t){return Pe(e,t)}),o=e.map(function(e){return e.shape}),a=x().getBool("WEBGL_PACK")?new ki(e[0].shape,o):new Si(e[0].shape,o);return this.compileAndRun(a,e,i)},t.prototype.subtract=function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,to);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.subtract(e,t);var n=Pe(e.dtype,t.dtype);if(x().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,to,e.dtype);var r=new io(to,e.shape,t.shape);return this.compileAndRun(r,[e,t],n)},t.prototype.pow=function(e,t){var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new io("\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nif (b == 0.0) {\n return 1.0;\n}\nreturn (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",e.shape,t.shape),r=Pe(e.dtype,t.dtype);return this.compileAndRun(n,[e,t],r)},t.prototype.ceil=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.ceil(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,Ja,e.dtype);var t=new za(e.shape,Ja);return this.compileAndRun(t,[e])},t.prototype.floor=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.floor(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,Za,e.dtype);var t=new za(e.shape,Za);return this.compileAndRun(t,[e])},t.prototype.sign=function(e){var t=new za(e.shape,"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n");return this.compileAndRun(t,[e])},t.prototype.isNaN=function(e){var t=new za(e.shape,"return float(isnan(x));");return this.compileAndRun(t,[e],"bool")},t.prototype.isInf=function(e){var t=new za(e.shape,"return float(isinf(x));");return this.compileAndRun(t,[e],"bool")},t.prototype.isFinite=function(e){var t=new za(e.shape,"return float(!isnan(x) && !isinf(x));");return this.compileAndRun(t,[e],"bool")},t.prototype.round=function(e){var t=new za(e.shape,"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n");return this.compileAndRun(t,[e])},t.prototype.exp=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.exp(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,$a,e.dtype);var t=new za(e.shape,$a);return this.compileAndRun(t,[e])},t.prototype.expm1=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.expm1(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,es,e.dtype);var t=new za(e.shape,es);return this.compileAndRun(t,[e])},t.prototype.softmax=function(e,t){var n=q([t],e.shape),r=this.max(e,n),i=un(r.shape,n),o=this.subtract(e,r.reshape(i)),a=this.exp(o),s=this.sum(a,n).reshape(i);return this.realDivide(a,s)},t.prototype.log=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.log(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,"\n vec4 result = log(x);\n vec4 isNaN = vec4(lessThan(x, vec4(0.0)));\n result.r = isNaN.r == 1.0 ? NAN : result.r;\n result.g = isNaN.g == 1.0 ? NAN : result.g;\n result.b = isNaN.b == 1.0 ? NAN : result.b;\n result.a = isNaN.a == 1.0 ? NAN : result.a;\n\n return result;\n",e.dtype);var t=new za(e.shape,"if (x < 0.0) return NAN;\n return log(x);");return this.compileAndRun(t,[e])},t.prototype.log1p=function(e){var t=new za(e.shape,"return log(1.0 + x);");return this.compileAndRun(t,[e])},t.prototype.sqrt=function(e){var t=new za(e.shape,"return sqrt(x);");return this.compileAndRun(t,[e])},t.prototype.rsqrt=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.rsqrt(e);var t=new za(e.shape,"return inversesqrt(x);");return this.compileAndRun(t,[e])},t.prototype.reciprocal=function(e){var t=new za(e.shape,"return 1.0 / x;");return this.compileAndRun(t,[e])},t.prototype.relu=function(e){var t;return t=x().getBool("WEBGL_PACK")?new hs(e.shape,ls):new za(e.shape,Va),this.compileAndRun(t,[e])},t.prototype.relu6=function(e){var t;return t=x().getBool("WEBGL_PACK")?new hs(e.shape,cs):new za(e.shape,Ga),this.compileAndRun(t,[e])},t.prototype.prelu=function(e,t){var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao(oo,e.shape,t.shape):new io(ro,e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.elu=function(e){if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,fs,e.dtype);var t=new za(e.shape,qa);return this.compileAndRun(t,[e])},t.prototype.eluDer=function(e,t){var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",e.shape,t.shape):new io("return (b >= 1.0) ? a : a * (b + 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.selu=function(e){var t=new za(e.shape,Xa);return this.compileAndRun(t,[e])},t.prototype.int=function(e){var t=new za(e.shape,"return float(int(x));");return this.compileAndRun(t,[e],"int32")},t.prototype.clip=function(e,t,n){var r,i=(r=x().getBool("WEBGL_PACK_CLIP")?new Ao(e.shape):new so(e.shape)).getCustomSetupFunc(t,n);return this.compileAndRun(r,[e],null,i)},t.prototype.abs=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.abs(e);if(x().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,Wa,e.dtype);var t=new za(e.shape,Wa);return this.compileAndRun(t,[e])},t.prototype.complexAbs=function(e){var t=this.texData.get(e.dataId),n=new uo(e.shape),r=[this.makeComplexComponentTensorInfo(e,t.complexTensors.real),this.makeComplexComponentTensorInfo(e,t.complexTensors.imag)];return this.compileAndRun(n,r)},t.prototype.sigmoid=function(e){var t=new za(e.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(t,[e])},t.prototype.softplus=function(e){var t=new za(e.shape,"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n");return this.compileAndRun(t,[e])},t.prototype.sin=function(e){var t=new za(e.shape,ts);return this.compileAndRun(t,[e])},t.prototype.cos=function(e){var t=new za(e.shape,ns);return this.compileAndRun(t,[e])},t.prototype.tan=function(e){var t=new za(e.shape,"return tan(x);");return this.compileAndRun(t,[e])},t.prototype.asin=function(e){var t=new za(e.shape,rs);return this.compileAndRun(t,[e])},t.prototype.acos=function(e){var t=new za(e.shape,is);return this.compileAndRun(t,[e])},t.prototype.atan=function(e){var t=new za(e.shape,os);return this.compileAndRun(t,[e])},t.prototype.atan2=function(e,t){var n=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new io("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},t.prototype.sinh=function(e){var t=new za(e.shape,"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])},t.prototype.cosh=function(e){var t=new za(e.shape,"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])},t.prototype.tanh=function(e){var t=new za(e.shape,"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n");return this.compileAndRun(t,[e])},t.prototype.asinh=function(e){var t=new za(e.shape,as);return this.compileAndRun(t,[e])},t.prototype.acosh=function(e){var t=new za(e.shape,ss);return this.compileAndRun(t,[e])},t.prototype.atanh=function(e){var t=new za(e.shape,As);return this.compileAndRun(t,[e])},t.prototype.erf=function(e){var t=new za(e.shape,'\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = 0.3275911;\n float a1 = 0.254829592;\n float a2 = -0.284496736;\n float a3 = 1.421413741;\n float a4 = -1.453152027;\n float a5 = 1.061405429;\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n');return this.compileAndRun(t,[e])},t.prototype.step=function(e,t){var n=new za(e.shape,function(e){return void 0===e&&(e=0),Ka+"\n return x > 0.0 ? 1.0 : float("+e+");\n "}(t));return this.compileAndRun(n,[e])},t.prototype.conv2dByMatMul=function(e,t,n,r,i,o){var a=e.shape,s=this.texData.get(e.dataId),A=n.inChannels,u=a[0]*a[1]*a[2],l=n.outChannels,c="channelsLast"===n.dataFormat,f=(1===u||1===l)&&A>1e3,h=a[2]%2!=0&&!!s.isPacked;if(f||!x().getBool("WEBGL_LAZILY_UNPACK")||!x().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!h){var d=c?a[0]*a[1]*a[2]:a[0]*a[2]*a[3],p=this.reshape(e,[1,d,n.inChannels]),g=this.reshape(t,[1,n.inChannels,n.outChannels]);return this.reshape(this.fusedBatchMatMul({a:p,b:g,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),n.outShape)}var m=c?a[0]*a[1]*(a[2]+1):a[0]*a[2]*(a[3]+1),v={dataId:e.dataId,shape:[1,m,n.inChannels],dtype:e.dtype},w=s.shape;s.shape=s.shape.slice(),s.shape[s.shape.length-2]++,R(Ot(s.shape,v.shape),function(){return"packed reshape "+s.shape+" to "+v.shape+" isn't free"});var y=this.reshape(t,[1,n.inChannels,n.outChannels]),b=this.fusedBatchMatMul({a:v,b:y,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),B=this.texData.get(b.dataId);return R(B.isPacked,function(){return"batchMatMul result is expected to be packed"}),s.shape=w,B.shape=n.outShape,Ve.makeTensorFromDataId(b.dataId,n.outShape,b.dtype)},t.prototype.conv2dWithIm2Row=function(e,t,n,r,i,o){var a=n.filterWidth,s=n.filterHeight,A=n.inChannels,u=n.outWidth,l=n.outHeight,c="channelsLast"===n.dataFormat,f=a*s*A,h=l*u,d=[f,h],p=e.squeeze([0]),g=t.reshape([1,f,-1]),m=new oa(d,p.shape,n),v=this.compileAndRun(m,[p]).reshape([1,d[0],d[1]]),w=null!=r,y=null!=o,b=i?gs(i,!0):null,B=new ca(v.shape,[1,h,n.outChannels],!0,!1,w,b,y),x=[v,g];r&&x.push(r),y&&x.push(o);var C=this.compileAndRun(B,x);return c?C.reshape([1,l,u,n.outChannels]):C.reshape([1,n.outChannels,l,u])},t.prototype.fusedConv2d=function(e){var t=e.input,n=e.filter,r=e.convInfo,i=e.bias,o=e.activation,a=e.preluActivationWeights;if(1===r.filterHeight&&1===r.filterWidth&&1===r.dilationHeight&&1===r.dilationWidth&&1===r.strideHeight&&1===r.strideWidth&&("SAME"===r.padInfo.type||"VALID"===r.padInfo.type))return this.conv2dByMatMul(t,n,r,i,o,a);if(x().getBool("WEBGL_CONV_IM2COL")&&1===t.shape[0])return this.conv2dWithIm2Row(t,n,r,i,o,a);var s=null!=i,A=null!=a,u=o?gs(o,!1):null,l=new yo(r,s,u,A),c=[t,n];return i&&c.push(i),a&&c.push(a),this.compileAndRun(l,c)},t.prototype.conv2d=function(e,t,n){if(1===n.filterHeight&&1===n.filterWidth&&1===n.dilationHeight&&1===n.dilationWidth&&1===n.strideHeight&&1===n.strideWidth&&("SAME"===n.padInfo.type||"VALID"===n.padInfo.type))return this.conv2dByMatMul(e,t,n);if(x().getBool("WEBGL_CONV_IM2COL")&&1===e.shape[0])return this.conv2dWithIm2Row(e,t,n);var r=new yo(n);return this.compileAndRun(r,[e,t])},t.prototype.conv2dDerInput=function(e,t,n){var r=new po(n);return this.compileAndRun(r,[e,t])},t.prototype.conv2dDerFilter=function(e,t,n){var r=new ho(n);return this.compileAndRun(r,[e,t])},t.prototype.fusedDepthwiseConv2D=function(e){var t,n=e.input,r=e.filter,i=e.convInfo,o=e.bias,a=e.activation,s=e.preluActivationWeights,A=x().getBool("WEBGL_PACK_DEPTHWISECONV")&&i.strideWidth<=2&&i.outChannels/i.inChannels==1,u=a?gs(a,A):null,l=[n,r],c=null!=o,f=null!=s;return c&&l.push(o),f&&l.push(s),A?(t=new xo(i,c,u,f),this.compileAndRun(t,l)):(t=new Bo(i,c,u,f),this.compileAndRun(t,l))},t.prototype.depthwiseConv2D=function(e,t,n){var r;return x().getBool("WEBGL_PACK_DEPTHWISECONV")&&n.strideWidth<=2&&n.outChannels/n.inChannels==1?(r=new xo(n),this.compileAndRun(r,[e,t])):(r=new Bo(n),this.compileAndRun(r,[e,t]))},t.prototype.depthwiseConv2DDerInput=function(e,t,n){var r=new wo(n);return this.compileAndRun(r,[e,t])},t.prototype.depthwiseConv2DDerFilter=function(e,t,n){var r=new vo(n);return this.compileAndRun(r,[e,t])},t.prototype.conv3d=function(e,t,n){var r=new bo(n);return this.compileAndRun(r,[e,t])},t.prototype.conv3dDerInput=function(e,t,n){var r=new mo(n);return this.compileAndRun(r,[e,t])},t.prototype.conv3dDerFilter=function(e,t,n){var r=new go(n);return this.compileAndRun(r,[e,t])},t.prototype.maxPool=function(e,t){var n=new ma(t,"max",!1);return this.compileAndRun(n,[e])},t.prototype.avgPool=function(e,t){var n=new ma(t,"avg",!1);return this.compileAndRun(n,[e],"float32")},t.prototype.maxPoolBackprop=function(e,t,n,r){var i=new ma(r,"max",!0),o=this.compileAndRun(i,[t]),a=new ua(r),s=this.compileAndRun(a,[e,o],t.dtype);return o.dispose(),s},t.prototype.avgPoolBackprop=function(e,t,n){var r=new Xi(n);return this.compileAndRun(r,[e],t.dtype)},t.prototype.cast=function(e,t){return Ai(e,t,this)},t.prototype.unstack=function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),i=0,o=0;o<e.rank;o++)o!==t&&(r[i++]=e.shape[o]);var a=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;var A=new Array(n);for(o=0;o<A.length;o++)a[t]=o,A[o]=this.slice(e,a,s).reshape(r);return A},t.prototype.avgPool3d=function(e,t){var n=new va(t,"avg",!1);return this.compileAndRun(n,[e],"float32")},t.prototype.avgPool3dBackprop=function(e,t,n){var r=new Yi(n);return this.compileAndRun(r,[e],t.dtype)},t.prototype.maxPool3d=function(e,t){var n=new va(t,"max",!1);return this.compileAndRun(n,[e],"float32")},t.prototype.maxPool3dBackprop=function(e,t,n,r){var i=new va(r,"max",!0),o=this.compileAndRun(i,[t]),a=new la(r),s=this.compileAndRun(a,[e,o],t.dtype);return o.dispose(),s},t.prototype.reshape=function(e,t){var n=this.texData.get(e.dataId);if(n.isPacked&&!Ot(e.shape,t)&&(null===n.texture||!Ot(n.shape,t))){var r=this.packedReshape(e,t);return Ve.makeTensorFromDataId(r.dataId,r.shape,r.dtype)}return ui(e,t)},t.prototype.resizeBilinear=function(e,t,n,r){var i=x().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new xa(e.shape,t,n,r):new Ba(e.shape,t,n,r);return this.compileAndRun(i,[e],"float32")},t.prototype.resizeBilinearBackprop=function(e,t,n){var r=new ba(e,t,n);return this.compileAndRun(r,[e])},t.prototype.resizeNearestNeighbor=function(e,t,n,r){var i=new Fa(e.shape,t,n,r);return this.compileAndRun(i,[e])},t.prototype.resizeNearestNeighborBackprop=function(e,t,n){var r=new Ca(e,t,n);return this.compileAndRun(r,[e])},t.prototype.multinomial=function(e,t,n,r){var i=t?e:jr(e),o=i.shape[0],a=i.shape[1],s=new fa(o,a,n),A=s.getCustomSetupFunc(r);return this.compileAndRun(s,[i],"int32",A)},t.prototype.oneHot=function(e,t,n,r){var i=new ha(e.size,t,n,r);return this.compileAndRun(i,[e])},t.prototype.diag=function(e){var t=new Io(e.size);return this.compileAndRun(t,[e])},t.prototype.nonMaxSuppression=function(e,t,n,r,i){return en("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"),mi(e.dataSync(),t.dataSync(),n,r,i)},t.prototype.cropAndResize=function(e,t,n,r,i,o){var a=new Co(e.shape,t.shape,r,i,o);return this.compileAndRun(a,[e,t,n],"float32")},t.prototype.depthToSpace=function(e,t,n){R(t>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+t});var r=e.shape[0],i="NHWC"===n?e.shape[1]:e.shape[2],o="NHWC"===n?e.shape[2]:e.shape[3],a="NHWC"===n?e.shape[3]:e.shape[1],s=i*t,A=o*t,u=a/(t*t),l=new _o("NHWC"===n?[r,s,A,u]:[r,u,s,A],t,n);return this.compileAndRun(l,[e])},t.prototype.split=function(e,t,n){return xi(e,t,n)},t.prototype.scatterND=function(e,t,n){var r=Lr(0,e,n),i=r.sliceRank,o=r.numUpdates,a=r.sliceSize,s=r.strides,A=r.outputSize,u=[A/a,a],l=e.reshape([o,i]),c=t.reshape([o,a]);if(0===A)return ui(yn([]),n);var f=Bn(0),h=new ka(o,i,l.rank,c.rank,s,u);return this.compileAndRun(h,[c,l,f]).reshape(n)},t.prototype.sparseToDense=function(e,t,n,r){var i=Lr(0,e,n),o=i.sliceRank,a=i.numUpdates,s=i.strides,A=i.outputSize,u=new ka(a,o,e.rank,t.rank,s,[A,1],!1);return this.compileAndRun(u,[t,e,r]).reshape(n)},t.prototype.fft=function(e){return this.fftImpl(e,!1)},t.prototype.ifft=function(e){return this.fftImpl(e,!0)},t.prototype.fftImpl=function(e,t){var n=this.texData.get(e.dataId),r=new Do("return real * expR - imag * expI;",e.shape,t),i=new Do("return real * expI + imag * expR;",e.shape,t),o=[this.makeComplexComponentTensorInfo(e,n.complexTensors.real),this.makeComplexComponentTensorInfo(e,n.complexTensors.imag)],a=this.compileAndRun(r,o),s=this.compileAndRun(i,o),A=this.complex(a,s).as2D(e.shape[0],e.shape[1]);return a.dispose(),s.dispose(),A},t.prototype.gatherND=function(e,t){var n=t.shape,r=n[n.length-1],i=_r(e,t),o=i[0],a=i[1],s=i[2],A=i[3],u=t.reshape([a,r]),l=e.reshape([e.size/s,s]),c=new Po(r,A,[a,s]);return this.compileAndRun(c,[l,u]).reshape(o)},t.prototype.fill=function(e,t,n){if("string"===(n=n||se(t))){var r=J(n,M(e));return r.fill(t),Ve.makeTensor(r,e,n,this)}var i=new Ro(e,t),o=i.getCustomSetupFunc(t);return this.compileAndRun(i,[],n,o)},t.prototype.onesLike=function(e){if("string"===e.dtype)throw new Error("onesLike is not supported under string dtype");return this.fill(e.shape,1,e.dtype)},t.prototype.zerosLike=function(e){return this.fill(e.shape,"string"===e.dtype?"":0,e.dtype)},t.prototype.linspace=function(e,t,n){return li(e,t,n)},t.prototype.makeTensorInfo=function(e,t){var n=this.write(null,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}},t.prototype.makeOutput=function(e,t){var n=this.makeTensorInfo(e,t).dataId;return Ve.makeTensorFromDataId(n,e,t,this)},t.prototype.unpackTensor=function(e){var t=new ds(e.shape);return this.runWebGLProgram(t,[e],e.dtype)},t.prototype.packTensor=function(e){var t=new da(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)},t.prototype.packedReshape=function(e,t){var n=[Qt(e.shape)].concat(Dt(e.shape)),r={dtype:e.dtype,shape:n,dataId:e.dataId},i=[Qt(t)].concat(Dt(t)),o=new ya(i,n),a=this.runWebGLProgram(o,[r],e.dtype,null,!0);return{dataId:a.dataId,shape:t,dtype:a.dtype}},t.prototype.decode=function(e){var t,n=this.texData.get(e),r=n.isPacked,i=n.shape,o=n.dtype,a=Rt(i);return t=r?new ko(a):new So(a),{dtype:o,shape:i,dataId:this.runWebGLProgram(t,[{shape:a,dtype:o,dataId:e}],o,null,!0).dataId}},t.prototype.runWebGLProgram=function(e,t,n,r,i){var o=this;void 0===i&&(i=!1);var a=this.makeTensorInfo(e.outputShape,n),s=this.texData.get(a.dataId);if(e.packedOutput&&(s.isPacked=!0),e.outPackingScheme===Xe.DENSE){var A=rt(e.outputShape);s.texShape=A.map(function(e){return 2*e})}if(null!=e.outTexUsage&&(s.usage=e.outTexUsage),0===M(a.shape))return s.values=Y(a.dtype,0),a;var u=[],l=t.map(function(t){if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");var n=o.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&M(t.shape)<=x().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}else if(!!n.isPacked!=!!e.packedInputs)t=n.isPacked?o.unpackTensor(t):o.packTensor(t),u.push(t),n=o.texData.get(t.dataId);else if(n.isPacked&&!Ot(n.shape,t.shape)){var r=t,i=t.shape;t.shape=n.shape,t=o.packedReshape(t,i),u.push(t),n=o.texData.get(t.dataId),r.shape=i}return o.uploadToGPU(t.dataId),{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(a.dataId);var c,f={shape:a.shape,texData:s,isUniform:!1},h=function(e,t,n){var r="";t.concat(n).forEach(function(e){var t=null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0,n=e.isUniform?"uniform":e.texData.texShape;r+=e.shape+"_"+n+"_"+t});var i=e.userCode;return e.constructor.name+"_"+r+"_"+i}(e,l,f),d=this.getAndSaveBinary(h,function(){return function(e,t,n,r){var i=t.userCode,o=n.map(function(e,n){var r={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(r.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:r}}),a=o.map(function(e){return e.shapeInfo}),s={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},A=Ri(o,s,i,t.packedInputs),u=e.createProgram(A),l=null,c=e.getUniformLocation(u,"NAN",!1);1===x().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(u,"INFINITY",!1));for(var f={},h=0;h<t.variableNames.length;h++){var d=t.variableNames[h];f[d]=e.getUniformLocation(u,d,!1),f["offset"+d]=e.getUniformLocation(u,"offset"+d,!1)}return{program:t,source:A,webGLProgram:u,uniformLocations:f,inShapeInfos:a,outShapeInfo:s,infLoc:l,nanLoc:c}}(o.gpgpu,e,l,f)}),p=null!=this.activeTimers;if(p&&(c=this.startTimer()),function(e,t,n,r,i){ia(t.inShapeInfos,n),ia([t.outShapeInfo],[r]);var o=r.texData.texture,a=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(o,a[0],a[1]):e.setOutputMatrixTexture(o,a[0],a[1]),e.setProgram(t.webGLProgram),1===x().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach(function(n,r){var i=t.program.variableNames[r],o=t.uniformLocations[i],a=t.uniformLocations["offset"+i];if(null!=o)if(n.isUniform)if(M(n.shape)<2)e.gl.uniform1f(o,n.uniformValues[0]);else{var s=n.uniformValues;s instanceof Float32Array||(s=new Float32Array(s)),e.gl.uniform1fv(o,s)}else null!=n.texData.slice&&null!=a&&e.gl.uniform1i(a,n.texData.slice.flatOffset),e.setInputMatrixTexture(n.texData.texture,o,r)}),null!=i&&i(e,t.webGLProgram),e.executeProgram()}(this.gpgpu,d,l,f,r),u.forEach(function(e){return o.disposeData(e.dataId)}),p&&(c=this.endTimer(c),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(c)})),!x().getBool("WEBGL_LAZILY_UNPACK")&&s.isPacked&&!1===i){var g=this.unpackTensor(a);return this.disposeData(a.dataId),g}return a},t.prototype.compileAndRun=function(e,t,n,r,i){void 0===i&&(i=!1),n=n||t[0].dtype;var o=this.runWebGLProgram(e,t,n,r,i);return Ve.makeTensorFromDataId(o.dataId,o.shape,o.dtype)},t.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},t.prototype.getTextureManager=function(){return this.textureManager},t.prototype.dispose=function(){var e=this;this.disposed||(x().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(function(t){e.gpgpu.deleteProgram(e.binaryCache[t].webGLProgram),delete e.binaryCache[t]}),this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)},t.prototype.floatPrecision=function(){var e=this;return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Zt(function(){if(!x().get("WEBGL_RENDER_FLOAT32_ENABLED")){var t=x().getBool("DEBUG");x().set("DEBUG",!1);var n=e.abs(Bn(1e-8)).dataSync()[0];if(x().set("DEBUG",t),n>0)return 32}return 16})),this.floatPrecisionValue},t.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},t.prototype.uploadToGPU=function(e){var t,n=this.texData.get(e),r=n.shape,i=n.dtype,o=n.values,a=n.texture,s=n.usage,A=n.isPacked;if(null==a){var u,l=null!=this.activeTimers;l&&(u=pe());var c=n.texShape;if(null==c&&(c=Tt(r,A),n.texShape=c),null!=o){var f=Rt(r),h=void 0,d=c[1],p=c[0],g=o instanceof Uint8Array;A?(d=(t=it(c[0],c[1]))[0],p=t[1],h=new Qo(f,[p,d],g)):h=new Lo(f,[p,d],g);var m=this.makeTensorInfo([p,d],i);this.texData.get(m.dataId).usage=g?Ye.PIXELS:Ye.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(m.dataId),d,p,o);var v=this.runWebGLProgram(h,[m],i,null,!0),w=this.texData.get(v.dataId);n.texture=w.texture,n.texShape=w.texShape,n.isPacked=w.isPacked,n.usage=w.usage,this.disposeData(m.dataId),this.texData.delete(v.dataId),n.values=null,l&&(this.uploadWaitMs+=pe()-u)}else{var y=this.acquireTexture(c,s,i,A);n.texture=y}}},t.prototype.convertAndCacheOnCPU=function(e,t){var n=this.texData.get(e),r=n.dtype;return this.releaseGPUData(e),null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){for(var n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r<n.length;++r)n[r]=Math.round(e[r]);return n}throw new Error("Unknown dtype "+t)}(t,r)),n.values},t.prototype.acquireTexture=function(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var i=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: "+i+" MB, most likely due to a memory leak")}return this.textureManager.acquireTexture(e,t,r)},t.prototype.computeBytes=function(e,t){return e[0]*e[1]*ne(t)},t}(Wr);Ge()&&Ve.registerBackend("webgl",function(){return new ms},2);var vs=gn({square_:function(e){var t=rn(e,"x","square"),n=[t];return Ve.runKernelFunc(function(e,n){return n([t]),e.square(t)},{x:t},null,"Square",{},n,[])}}),ws="SquaredDifference",ys=gn({squaredDifference_:function(e,t){var n,r=rn(e,"a","squaredDifference"),i=rn(t,"b","squaredDifference");n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape);var o={a:r,b:i},a=[r,i];return Ve.runKernelFunc(function(e,t){var n=e.squaredDifference(r,i);return t([r,i]),n},o,function(e,t){var n=t[0],r=t[1],i=Bn(2);return{a:function(){return e.mul(n.sub(r).mul(i))},b:function(){return e.mul(r.sub(n).mul(i))}}},ws,{},a,[])}}),bs=gn({abs_:function(e){var t=rn(e,"x","abs");return"complex64"===t.dtype?Ve.runKernelFunc(function(e){return e.complexAbs(t)},{$x:t}):Ve.runKernelFunc(function(e,n){var r=e.abs(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return e.mul(n.toFloat().step(-1))}}},"Abs")}}),Bs=gn({acos_:function(e){var t=rn(e,"x","acos");return Ve.runKernelFunc(function(e,n){var r=e.acos(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Bn(1).sub(n.toFloat().square()).sqrt()).neg()}}})}}),xs=gn({acosh_:function(e){var t=rn(e,"x","acosh");return Ve.runKernelFunc(function(e,n){var r=e.acosh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(n.toFloat().square().sub(1).sqrt())}}})}}),Cs=gn({asin_:function(e){var t=rn(e,"x","asin");return Ve.runKernelFunc(function(e,n){var r=e.asin(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Bn(1).sub(n.toFloat().square()).sqrt())}}})}}),Fs=gn({asinh_:function(e){var t=rn(e,"x","asinh");return Ve.runKernelFunc(function(e,n){var r=e.asinh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Bn(1).add(n.toFloat().square()).sqrt())}}})}}),Es=gn({atan_:function(e){var t=rn(e,"x","atan");return Ve.runKernelFunc(function(e,n){var r=e.atan(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.toFloat().square().add(1))}}})}}),Ss=gn({atanh_:function(e){var t=rn(e,"x","atanh");return Ve.runKernelFunc(function(e,n){var r=e.atanh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(Bn(1).sub(n.toFloat().square()))}}})}}),ks=gn({ceil_:function(e){var t=rn(e,"x","ceil");return Ve.runKernelFunc(function(e){return e.ceil(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),_s=gn({clipByValue_:function(e,t,n){var r=rn(e,"x","clipByValue");R(t<=n,function(){return"Error in clip: min ("+t+") must be less than or equal to max ("+n+")."});var i=[r],o={min:t,max:n};return Ve.runKernelFunc(function(e,i){var o=e.clip(r,t,n);return i([r]),o},{x:r},function(e,r){var i=r[0];return{x:function(){return e.where(i.greaterEqual(t).logicalAnd(i.lessEqual(n)),Un(e))}}},"ClipByValue",o,i)}}),Is=gn({cos_:function(e){var t=rn(e,"x","cos"),n=[t];return Ve.runKernelFunc(function(e,n){var r=e.cos(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return n.toFloat().sin().neg().mul(e)}}},"Cos",{},n)}}),Ns=gn({cosh_:function(e){var t=rn(e,"x","cosh");return Ve.runKernelFunc(function(e,n){var r=e.cosh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return n.toFloat().sinh().mulStrict(e)}}})}}),Us=gn({erf_:function(e){var t=rn(e,"x","erf");return R("int32"===t.dtype||"float32"===t.dtype,function(){return"Input dtype must be `int32` or `float32`."}),"int32"===t.dtype&&(t=t.toFloat()),Ve.runKernelFunc(function(e,n){var r=e.erf(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.square().neg().exp().mul(2/Math.sqrt(Math.PI)))}}})}}),Ls=gn({exp_:function(e){var t=rn(e,"x","exp");return Ve.runKernelFunc(function(e,n){var r=e.exp(t);return n([r]),r},{x:t},function(e,t){return{x:function(){return e.mulStrict(t[0])}}},"Exp",{},[],[!0])}}),Qs=gn({expm1_:function(e){var t=rn(e,"x","expm1");return Ve.runKernelFunc(function(e,n){var r=e.expm1(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.exp())}}})}}),Ds=gn({floor_:function(e){var t=rn(e,"x","floor");return Ve.runKernelFunc(function(e){return e.floor(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),Rs=gn({log_:function(e){var t=rn(e,"x","log"),n=[t];return Ve.runKernelFunc(function(e,n){var r=e.log(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return e.div(n.toFloat())}}},"Log",{},n)}}),Ts=gn({log1p_:function(e){var t=rn(e,"x","log1p");return Ve.runKernelFunc(function(e,n){var r=e.log1p(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.add(1))}}})}}),Ps=gn({logSigmoid_:function(e){var t=rn(e,"x","logSigmoid");return Ve.runKernelFunc(function(e,n){var r=e.softplus(t.neg()).neg();return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.neg().sigmoid())}}})}}),Os=gn({neg_:function(e){var t=rn(e,"x","neg"),n=[t];return Ve.runKernelFunc(function(e){return e.neg(t)},{x:t},function(e){return{x:function(){return e.neg()}}},"Neg",{},n)}}),Ms=gn({reciprocal_:function(e){var t=rn(e,"x","reciprocal");return Ve.runKernelFunc(function(e,n){var r=e.reciprocal(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.square().neg())}}})}}),Hs=gn({round_:function(e){var t=rn(e,"x","round");return Ve.runKernelFunc(function(e){return e.round(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),js=gn({rsqrt_:function(e){var t=rn(e,"x","rsqrt"),n=[t];return Ve.runKernelFunc(function(e,n){var r=e.rsqrt(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return e.div(n.pow(1.5).mul(2)).neg()}}},"Rsqrt",{},n)}}),zs=gn({sigmoid_:function(e){var t=rn(e,"x","sigmoid");return Ve.runKernelFunc(function(e,n){var r=e.sigmoid(t);return n([r]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return e.mul(n.mul(Bn(1).sub(n)))}}},"Sigmoid")}}),Ks=gn({sign_:function(e){var t=rn(e,"x","sign");return Ve.runKernelFunc(function(e){return e.sign(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),Ws=gn({isNaN_:function(e){var t=rn(e,"x","isNaN");return Ve.runKernelFunc(function(e){return e.isNaN(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),Vs=gn({isInf_:function(e){var t=rn(e,"x","isInf");return Ve.runKernelFunc(function(e){return e.isInf(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),Gs=gn({isFinite_:function(e){var t=rn(e,"x","isFinite");return Ve.runKernelFunc(function(e){return e.isFinite(t)},{$x:t},function(e){return{$x:function(){return Un(e)}}})}}),qs=gn({sin_:function(e){var t=rn(e,"x","sin"),n=[t];return Ve.runKernelFunc(function(e,n){var r=e.sin(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return n.toFloat().cos().mul(e)}}},"Sin",{},n)}}),Xs=gn({sinh_:function(e){var t=rn(e,"x","sinh");return Ve.runKernelFunc(function(e,n){var r=e.sinh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return n.toFloat().cosh().mulStrict(e)}}})}}),Ys=gn({softplus_:function(e){var t=rn(e,"x","softplus");return Ve.runKernelFunc(function(e,n){var r=e.softplus(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.sigmoid())}}})}}),Js=gn({sqrt_:function(e){var t=rn(e,"x","sqrt");return Ve.runKernelFunc(function(e,n){var r=e.sqrt(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.toFloat().sqrt().mul(2))}}})}}),Zs=gn({step_:function(e,t){void 0===t&&(t=0);var n=rn(e,"x","step");return Ve.runKernelFunc(function(e){return e.step(n,t)},{$x:n},function(e){return{$x:function(){return Un(e)}}})}}),$s=gn({tan_:function(e){var t=rn(e,"x","tan");return Ve.runKernelFunc(function(e,n){var r=e.tan(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.cos().square())}}})}}),eA=gn({tanh_:function(e){var t=rn(e,"x","tanh");return Ve.runKernelFunc(function(e,n){var r=e.tanh(t);return n([r]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return Bn(1).sub(n.square()).mulStrict(e)}}},"Tanh",{},null,[!0])}});function tA(e,t,n,r,i,o){var a,s,A=rn(e,"x","batchNorm"),u=rn(t,"mean","batchNorm"),l=rn(n,"variance","batchNorm");return null!=i&&(a=rn(i,"scale","batchNorm")),null!=r&&(s=rn(r,"offset","batchNorm")),R(2===A.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+A.rank+"."}),R(2===u.rank||1===u.rank,function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank "+u.rank+"."}),R(2===l.rank||1===l.rank,function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank "+l.rank+"."}),null!=a&&R(2===a.rank||1===a.rank,function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank "+a.rank+"."}),null!=s&&R(2===s.rank||1===s.rank,function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank "+s.rank+"."}),iA(A,u,l,s,a,o)}function nA(e,t,n,r,i,o){var a,s,A=rn(e,"x","batchNorm"),u=rn(t,"mean","batchNorm"),l=rn(n,"variance","batchNorm");return null!=i&&(a=rn(i,"scale","batchNorm")),null!=r&&(s=rn(r,"offset","batchNorm")),R(3===A.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+A.rank+"."}),R(3===u.rank||1===u.rank,function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank "+u.rank+"."}),R(3===l.rank||1===l.rank,function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank "+l.rank+"."}),null!=a&&R(3===a.rank||1===a.rank,function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank "+a.rank+"."}),null!=s&&R(3===s.rank||1===s.rank,function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank "+s.rank+"."}),iA(A,u,l,s,a,o)}function rA(e,t,n,r,i,o){var a,s,A=rn(e,"x","batchNorm"),u=rn(t,"mean","batchNorm"),l=rn(n,"variance","batchNorm");return null!=i&&(a=rn(i,"scale","batchNorm")),null!=r&&(s=rn(r,"offset","batchNorm")),R(4===A.rank,function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+A.rank+"."}),R(4===u.rank||1===u.rank,function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank "+u.rank+"."}),R(4===l.rank||1===l.rank,function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank "+l.rank+"."}),null!=a&&R(4===a.rank||1===a.rank,function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank "+a.rank+"."}),null!=s&&R(4===s.rank||1===s.rank,function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank "+s.rank+"."}),iA(A,u,l,s,a,o)}function iA(e,t,n,r,i,o){null==o&&(o=.001);var a,s,A,u=rn(e,"x","batchNorm"),l=rn(t,"mean","batchNorm"),c=rn(n,"variance","batchNorm");null!=i&&(a=rn(i,"scale","batchNorm")),null!=r&&(s=rn(r,"offset","batchNorm")),R(l.rank===c.rank,function(){return"Batch normalization gradient requires mean and variance to have equal ranks."}),R(null==s||l.rank===s.rank,function(){return"Batch normalization gradient requires mean and offset to have equal ranks."}),R(null==a||l.rank===a.rank,function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}),A=0===u.rank||1===u.rank?u.as4D(1,1,1,u.size):2===u.rank?u.as4D(1,1,u.shape[0],u.shape[1]):3===u.rank?u.as4D(1,u.shape[0],u.shape[1],u.shape[2]):u;var f=[u,l,c,a];return Ve.runKernelFunc(function(e,t){var n=e.batchNormalization(A,oA(l),oA(c),o,oA(a),oA(s));return t([u,l,c,a]),n},{x:u,mean:l,variance:c,scale:a,offset:s},function(e,t){var n=t,r=n[0],i=n[1],a=n[2],s=n[3],u=null==s?Bn(1):s,l=qr(i.shape,A.shape),c=[];if(1===i.rank){for(var f=0;f<A.shape.length-1;++f)c.push(A.shape[f]);c.push(1)}var h=r.sub(i),d=e.mul(u),p=js(a.add(Bn(o))),g=p.mul(p).mul(p).mul(Bn(-.5));return{x:function(){return 1===i.rank?e.mul(br(p.as4D(1,1,1,i.shape[0]),c)).mul(u).reshape(r.shape):e.mul(p).mul(u).reshape(r.shape)},mean:function(){var e=p.mul(Bn(-1)).mul(d);return 1===i.rank&&(e=e.sum(l)),e.reshape(i.shape)},variance:function(){var e=g.mul(h).mul(d);return 1===i.rank&&(e=e.sum(l)),e.reshape(i.shape)},scale:function(){var t=h.mul(p),n=e.mul(t);return 1===i.rank&&(n=n.sum(l)),n.reshape(i.shape)},offset:function(){var t=e;return 1===i.rank&&(t=t.sum(l)),t.reshape(i.shape)}}},"BatchNormalization",{varianceEpsilon:o},f).reshape(u.shape)}function oA(e){return null==e?null:0===e.rank?e.as1D():1===e.rank?e:2===e.rank?e.as4D(1,1,e.shape[0],e.shape[1]):3===e.rank?e.as4D(1,e.shape[0],e.shape[1],e.shape[2]):e}function aA(){Jt("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon")}var sA=gn({batchNormalization2d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),aA(),tA(e,t,n,o,i,r)}}),AA=gn({batchNormalization3d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),aA(),nA(e,t,n,o,i,r)}}),uA=gn({batchNormalization4d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),aA(),rA(e,t,n,o,i,r)}}),lA=gn({batchNormalization_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),aA(),iA(e,t,n,o,i,r)}}),cA=gn({batchNorm_:iA}),fA=gn({batchNorm2d_:tA}),hA=gn({batchNorm3d_:nA}),dA=gn({batchNorm4d_:rA}),pA=gn({logicalAnd_:function(e,t){var n=rn(e,"a","logicalAnd","bool"),r=rn(t,"b","logicalAnd","bool");return Xr(n.shape,r.shape),Ve.runKernelFunc(function(e){return e.logicalAnd(n,r)},{a:n,b:r},null,"LogicalAnd")}}),gA=gn({logicalNot_:function(e){var t=rn(e,"x","logicalNot","bool");return Ve.runKernelFunc(function(e){return e.logicalNot(t)},{$x:t})}}),mA=gn({logicalOr_:function(e,t){var n=rn(e,"a","logicalOr","bool"),r=rn(t,"b","logicalOr","bool");return Xr(n.shape,r.shape),Ve.runKernelFunc(function(e){return e.logicalOr(n,r)},{$a:n,$b:r})}}),vA=gn({logicalXor_:function(e,t){var n=rn(e,"a","logicalXor","bool"),r=rn(t,"b","logicalXor","bool");return Xr(n.shape,r.shape),mA(e,t).logicalAnd(pA(e,t).logicalNot())}}),wA=gn({where_:function(e,t,n){var r=rn(t,"a","where"),i=rn(n,"b","where"),o=rn(e,"condition","where","bool");return T(r.shape,i.shape,"Error in where: "),1===o.rank?R(o.shape[0]===r.shape[0],function(){return"The first dimension of `a` must match the size of `condition`."}):T(o.shape,i.shape,"Error in where: "),Ve.runKernelFunc(function(e,t){var n=e.select(o,r,i);return t([o]),n},{$condition:o,$a:r,$b:i},function(e,t){var n=t[0];return{$condition:function(){return Un(n).toFloat()},$a:function(){return e.mul(n.cast(e.dtype))},$b:function(){return e.mul(n.logicalNot().cast(e.dtype))}}})}}),yA=function(e){return y(this,void 0,void 0,function(){var t,n,r;return b(this,function(i){switch(i.label){case 0:return[4,(t=rn(e,"condition","whereAsync","bool")).data()];case 1:return n=i.sent(),r=Ei(t.shape,n),e!==t&&t.dispose(),[2,r]}})})},bA=gn({add_:function(e,t){var n,r=rn(e,"a","add"),i=rn(t,"b","add");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e){return e.add(r,i)},{a:r,b:i},function(e){return{a:function(){var t=e,n=qr(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)},b:function(){var t=e,n=qr(i.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(i.shape)}}},"Add")}}),BA=gn({addN_:function(e){R(Array.isArray(e),function(){return"The argument passed to tf.addN() must be a list of tensors"}),R(e.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+e.length});var t=e.map(function(e,t){return rn(e,"tensors"+t,"addN")}),n=t[0];t.forEach(function(e){if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(function(e){if(!H(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=t;return Ve.runKernelFunc(function(e){return e.addN(t)},r,function(e){var n={};return t.forEach(function(t,r){n[r]=function(){return e.clone()}}),n},"AddN")}}),xA=gn({addStrict_:function(e,t){var n=rn(e,"a","addStrict"),r=rn(t,"b","addStrict");return T(n.shape,r.shape,"Error in addStrict: "),n.add(r)}}),CA=gn({atan2_:function(e,t){var n,r=rn(e,"a","atan2"),i=rn(t,"b","atan2");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e,t){var n=e.atan2(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=bA(n.square(),r.square()),i=e.mul(r.div(t)),a=qr(n.shape,o);return a.length>0&&(i=i.sum(a)),i.reshape(n.shape)},$b:function(){var t=bA(n.square(),r.square()),i=Os(e.mul(n.div(t))),a=qr(r.shape,o);return a.length>0&&(i=i.sum(a)),i.reshape(r.shape)}}})}}),FA=gn({div_:function(e,t){var n,r=rn(e,"a","div"),i=rn(t,"b","div");if(n=Me(r,i),r=n[0],i=n[1],"int32"===r.dtype&&"int32"===i.dtype)return kA(r,i);var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e,t){var n=e.realDivide(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){var t=e.div(r.toFloat()),i=qr(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t},b:function(){var t=e.mul(n.toFloat()),i=qr(r.shape,o);i.length>0&&(t=t.sum(i).reshape(r.shape));var a=r.square();return t.div(a.toFloat()).neg()}}},"Div")}}),EA=gn({divNoNan_:function(e,t){var n,r=rn(e,"a","div"),i=rn(t,"b","div");r=(n=Me(r,i))[0],i=n[1];var o=FA(r,i),a=Un(o),s=i.equal(a);return wA(s,a,o)}}),SA=gn({divStrict_:function(e,t){var n=rn(e,"a","div"),r=rn(t,"b","div");return T(n.shape,r.shape,"Error in divideStrict: "),n.div(r)}}),kA=gn({floorDiv_:function(e,t){var n,r=rn(e,"a","floorDiv"),i=rn(t,"b","floorDiv");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e,t){var n=e.floorDiv(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){var t=e.div(r.toFloat()),i=qr(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t},b:function(){var t=e.mul(n.toFloat()),i=qr(r.shape,o);i.length>0&&(t=t.sum(i).reshape(r.shape));var a=r.square();return t.div(a.toFloat()).neg()}}},"FloorDiv")}}),_A=gn({maximum_:function(e,t){var n,r=rn(e,"a","maximum"),i=rn(t,"b","maximum");return n=Me(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),Xr(r.shape,i.shape),Ve.runKernelFunc(function(e,t){var n=e.maximum(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){return e.mul(n.greaterEqual(r).toFloat())},b:function(){return e.mul(n.less(r).toFloat())}}},"Maximum")}}),IA=gn({maximumStrict_:function(e,t){var n=rn(e,"a","maximumStrict"),r=rn(t,"b","maximumStrict");return T(n.shape,r.shape,"Error in maximumStrict: "),n.maximum(r)}}),NA=gn({minimum_:function(e,t){var n,r=rn(e,"a","minimum"),i=rn(t,"b","minimum");return n=Me(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),Xr(r.shape,i.shape),Ve.runKernelFunc(function(e,t){var n=e.minimum(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){return e.mul(n.lessEqual(r).toFloat())},b:function(){return e.mul(n.greater(r).toFloat())}}},"Minimum")}}),UA=gn({minimumStrict_:function(e,t){var n=rn(e,"a","minimumStrict"),r=rn(t,"b","minimumStrict");return T(n.shape,r.shape,"Error in minimumStrict: "),n.minimum(r)}}),LA=gn({mod_:function(e,t){var n,r=rn(e,"a","mod"),i=rn(t,"b","mod");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e,t){var n=e.mod(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=qr(n.shape,o);return t.length>0?e.sum(t).reshape(n.shape):e},$b:function(){var t=e.mul(n.div(r).floor().neg()),i=qr(r.shape,o);return i.length>0?t.sum(i).reshape(r.shape):t}}})}}),QA=gn({modStrict_:function(e,t){var n=rn(e,"a","modStrict"),r=rn(t,"b","modStrict");return T(n.shape,r.shape,"Error in modStrict: "),n.mod(r)}}),DA=gn({mul_:function(e,t){var n,r=rn(e,"a","mul"),i=rn(t,"b","mul");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e,t){var n=e.multiply(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){var t=e.mul(r.toFloat()),i=qr(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t},b:function(){var t=e.mul(n.toFloat()),i=qr(r.shape,o);return i.length>0?t.sum(i).reshape(r.shape):t}}},"Mul")}}),RA=gn({mulStrict_:function(e,t){var n=rn(e,"a","mul"),r=rn(t,"b","mul");return T(n.shape,r.shape,"Error in multiplyStrict: "),n.mul(r)}}),TA=gn({pow_:function(e,t){var n,r=rn(e,"base","pow"),i=rn(t,"exp","pow");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape),a=[r,i];return Ve.runKernelFunc(function(e,t){var n=e.pow(r,i);return t([r,i,n]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1],i=t[2];return{a:function(){var t=r.toFloat(),i=e.mul(t.mul(n.pow(t.sub(Bn(1))))),a=qr(n.shape,o);return a.length>0&&(i=i.sum(a)),i.reshape(n.shape)},b:function(){var t=n.greater(0),a=n.log().where(t,Un(n)),s=e.mul(i.mul(a)),A=qr(r.shape,o);return A.length>0&&(s=s.sum(A)),s.reshape(r.shape)}}},"Pow",{},a,[!0])}}),PA=gn({powStrict_:function(e,t){return T(e.shape,t.shape,"Error in powStrict: "),e.pow(t)}}),OA=gn({squaredDifferenceStrict_:function(e,t){var n=rn(e,"a","squaredDifferenceStrict"),r=rn(t,"b","squaredDifferenceStrict");return T(n.shape,r.shape,"Error in squaredDifferenceStrict: "),n.squaredDifference(r)}}),MA=gn({sub_:function(e,t){var n,r=rn(e,"a","sub"),i=rn(t,"b","sub");n=Me(r,i),r=n[0],i=n[1];var o=Xr(r.shape,i.shape);return Ve.runKernelFunc(function(e){return e.subtract(r,i)},{a:r,b:i},function(e){return{a:function(){var t=e,n=qr(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)},b:function(){var t=e,n=qr(i.shape,o);return n.length>0&&(t=t.sum(n)),t.neg().reshape(i.shape)}}},"Sub")}}),HA=gn({subStrict_:function(e,t){var n=rn(e,"a","subStrict"),r=rn(t,"b","subStrict");return T(n.shape,r.shape,"Error in subStrict: "),n.sub(r)}}),jA=gn({equal_:function(e,t){var n,r=rn(e,"a","equal"),i=rn(t,"b","equal");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e){return e.equal(r,i)},{$a:r,$b:i})}}),zA=gn({equalStrict_:function(e,t){var n=rn(e,"a","equalStrict"),r=rn(t,"b","equalStrict");return T(n.shape,r.shape,"Error in equalStrict: "),n.equal(r)}}),KA=gn({greater_:function(e,t){var n,r=rn(e,"a","greater"),i=rn(t,"b","greater");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e){return e.greater(r,i)},{a:r,b:i},null,"Greater")}}),WA=gn({greaterEqual_:function(e,t){var n,r=rn(e,"a","greaterEqual"),i=rn(t,"b","greaterEqual");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e,t){var n=e.greaterEqual(r,i);return t([r,i]),n},{a:r,b:i},function(e,t){var n=t[0],r=t[1];return{a:function(){return Un(n)},b:function(){return Un(r)}}},"GreaterEqual")}}),VA=gn({greaterEqualStrict_:function(e,t){var n=rn(e,"a","greaterEqualStrict"),r=rn(t,"b","greaterEqualStrict");return T(n.shape,r.shape,"Error in greaterEqualStrict: "),n.greaterEqual(r)}}),GA=gn({greaterStrict_:function(e,t){var n=rn(e,"a","greaterStrict"),r=rn(t,"b","greaterStrict");return T(n.shape,r.shape,"Error in greaterStrict: "),n.greater(r)}}),qA=gn({less_:function(e,t){var n,r=rn(e,"a","less"),i=rn(t,"b","less");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e){return e.less(r,i)},{a:r,b:i},null,"Less")}}),XA=gn({lessEqual_:function(e,t){var n,r=rn(e,"a","lessEqual"),i=rn(t,"b","lessEqual");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e,t){var n=e.lessEqual(r,i);return t([r,i]),n},{a:r,b:i},null,"LessEqual")}}),YA=gn({lessEqualStrict_:function(e,t){var n=rn(e,"a","lessEqualStrict"),r=rn(t,"b","lessEqualStrict");return T(n.shape,r.shape,"Error in lessEqualStrict: "),n.lessEqual(r)}}),JA=gn({lessStrict_:function(e,t){var n=rn(e,"a","lessStrict"),r=rn(t,"b","lessStrict");return T(n.shape,r.shape,"Error in lessStrict: "),n.less(r)}}),ZA=gn({notEqual_:function(e,t){var n,r=rn(e,"a","notEqual"),i=rn(t,"b","notEqual");return n=Me(r,i),r=n[0],i=n[1],Xr(r.shape,i.shape),Ve.runKernelFunc(function(e){return e.notEqual(r,i)},{a:r,b:i},null,"NotEqual")}}),$A=gn({notEqualStrict_:function(e,t){var n=rn(e,"a","notEqualStrict"),r=rn(t,"b","notEqualStrict");return T(n.shape,r.shape,"Error in notEqualStrict: "),n.notEqual(r)}});function eu(e,t){for(var n=[],r=e;r<t;++r)n.push(r);return n}function tu(e){for(var t=[],n=0;n<e.length;++n)for(var r=0;r<e[n].length;++r)t.push(e[n][r]);return t}var nu=gn({gather_:function(e,t,n){void 0===n&&(n=0);var r=rn(e,"x","gather"),i=rn(t,"indices","gather","int32");n=q(n,r.shape)[0];var o=function(e,t,n){for(var r=e.shape[n],i=[],o=1,a=1,s=0;s<n;s++)i.push(e.shape[s]),o*=e.shape[s];for(s=0;s<t.rank;s++)i.push(t.shape[s]);for(s=n+1;s<e.rank;s++)i.push(e.shape[s]),a*=e.shape[s];return{batchSize:o,sliceSize:a,dimSize:r,outputShape:i}}(r,i,n);return Ve.runKernelFunc(function(e,t){var o=e.gather(r,i.flatten(),n);return t([i]),o},{x:r,indices:i},function(e,t){var i=t[0];return{x:function(){var t=r.shape,o=i.size,a=t.slice(0,n),s=a.length,A=t.slice(n,t.length).slice(1),u=A.length,l=eu(0,s),c=eu(s+1,s+1+u),f=tu([a,[o],A]),h=e.reshape(f),d=i.reshape([o]),p=tu([[s],l,c]),g=h.transpose(p),m=ru(g,d,r.shape[n]),v=fn(p);return m.transpose(v)},indices:function(){return i}}},"Gather",{axis:n}).reshape(o.outputShape)}}),ru=gn({unsortedSegmentSum_:function(e,t,n){var r=rn(e,"x","unsortedSegmentSum"),i=rn(t,"segmentIds","unsortedSegmentSum","int32");return R(j(n),function(){return"numSegments must be of dtype int"}),Ve.runKernelFunc(function(e,t){var o=e.unsortedSegmentSum(r,i,n);return t([i]),o},{$x:r},function(e,t){var n=t[0];return{$x:function(){return function(e,t){for(var n=_A(t,Un(t)),r=nu(e,n),i=WA(t,Bn(0,"int32")),o=r.rank-i.rank,a=0;a<o;++a)i=ir(i,a+1);i=pA(i,Sn(r.shape,"bool"));var s=Un(r);return wA(i,r,s)}(e,n)}}})}});function iu(e,t,n,r,i,o,a){void 0===o&&(o="NHWC"),R(e.length===t.rank,function(){return"Length of inShape ("+e.length+") and rank of dy ("+t.rank+") must match"});var s=e,A=t,u=!1;3===t.rank&&(u=!0,A=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]),s=[1,e[0],e[1],e[2]]),R(4===s.length,function(){return"Error in conv2dDerInput: inShape must be length 4, but got length "+s.length+"."}),R(4===A.rank,function(){return"Error in conv2dDerInput: dy must be rank 4, but got rank "+A.rank}),R(4===n.rank,function(){return"Error in conv2dDerInput: filter must be rank 4, but got rank "+n.rank});var l="NHWC"===o?s[3]:s[1],c="NHWC"===o?A.shape[3]:A.shape[1];R(l===n.shape[2],function(){return"Error in conv2dDerInput: depth of input ("+l+") must match input depth for filter "+n.shape[2]+"."}),R(c===n.shape[3],function(){return"Error in conv2dDerInput: depth of output ("+c+") must match output depth for filter "+n.shape[3]+"."}),null!=a&&R(j(i),function(){return"Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+i+"."});var f=si(o),h=Zr(s,n.shape,r,1,i,a,!1,f),d=Ve.runKernelFunc(function(e,t){var r=e.conv2dDerInput(A,n,h);return t([n,A]),r},{dy4D:A,filter:n},function(e,t){var n=t[0],s=t[1];return{dy4D:function(){return Au(e,n,r,i,o,1,a)},filter:function(){return lu(e,s,n.shape,r,i,o,a)}}});return u?d.as3D(d.shape[1],d.shape[2],d.shape[3]):d}function ou(e){var t=function(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}(e),n=t[0],r=t[1],i=t[2];return 1===n&&1===r&&1===i}function au(e,t,n,r,i){R(e.length===t.rank,function(){return"Length of inShape ("+e.length+") and rank of dy ("+t.rank+") must match"});var o=e,a=t,s=!1;4===t.rank&&(s=!0,a=t.as5D(1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]),o=[1,e[0],e[1],e[2],e[3]]);var A=o[4],u=a.shape[4];R(5===o.length,function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+o.length+"."}),R(5===a.rank,function(){return"Error in conv3dDerInput: dy must be rank 5, but got rank "+a.rank}),R(5===n.rank,function(){return"Error in conv3dDerInput: filter must be rank 5, but got rank "+n.rank}),R(A===n.shape[3],function(){return"Error in conv3dDerInput: depth of input ("+A+") must match input depth for filter "+n.shape[3]+"."}),R(u===n.shape[4],function(){return"Error in conv3dDerInput: depth of output ("+u+") must match output depth for filter "+n.shape[4]+"."});var l=$r(o,n.shape,r,1,i),c=Ve.runKernelFunc(function(e){return e.conv3dDerInput(a,n,l)},{dy5D:a});return s?c.as4D(c.shape[1],c.shape[2],c.shape[3],c.shape[4]):c}var su=gn({conv1d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NWC"),void 0===o&&(o=1);var s=rn(e,"x","conv1d"),A=rn(t,"filter","conv1d"),u=s,l=!1;2===s.rank&&(l=!0,u=s.as3D(1,s.shape[0],s.shape[1])),R(3===u.rank,function(){return"Error in conv1d: input must be rank 3, but got rank "+u.rank+"."}),R(3===A.rank,function(){return"Error in conv1d: filter must be rank 3, but got rank "+A.rank+"."}),null!=a&&R(j(r),function(){return"Error in conv1d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r+"."}),R(u.shape[2]===A.shape[1],function(){return"Error in conv1d: depth of input ("+u.shape[2]+") must match input depth for filter "+A.shape[1]+"."}),R(ai(n,o),function(){return"Error in conv1D: Either stride or dilation must be 1. Got stride "+n+" and dilation '"+o+"'"}),R("NWC"===i,function(){return"Error in conv1d: got dataFormat of "+i+" but only NWC is currently supported."});var c=A.as4D(1,A.shape[0],A.shape[1],A.shape[2]),f=u.as4D(u.shape[0],1,u.shape[1],u.shape[2]),h=Au(f,c,[1,n],r,"NHWC",[1,o],a);return l?h.as2D(h.shape[2],h.shape[3]):h.as3D(h.shape[0],h.shape[2],h.shape[3])}}),Au=gn({conv2d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var s=rn(e,"x","conv2d"),A=rn(t,"filter","conv2d"),u=s,l=!1;3===s.rank&&(l=!0,u=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),R(4===u.rank,function(){return"Error in conv2d: input must be rank 4, but got rank "+u.rank+"."}),R(4===A.rank,function(){return"Error in conv2d: filter must be rank 4, but got rank "+A.rank+"."}),null!=a&&R(j(r),function(){return"Error in conv2d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r+"."});var c="NHWC"===i?u.shape[3]:u.shape[1];R(c===A.shape[2],function(){return"Error in conv2d: depth of input ("+c+") must match input depth for filter "+A.shape[2]+"."}),R(ai(n,o),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"});var f=si(i),h=Zr(u.shape,A.shape,n,o,r,a,!1,f),d=[A,u],p=Ve.runKernelFunc(function(e,t){var n=e.conv2d(u,A,h);return t([A,u]),n},{x:u,filter:A},function(e,t){var a=t,s=a[0],A=a[1];return R(oi(o),function(){return"Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"}),{x:function(){return cu(A.shape,e,s,n,r,i)},filter:function(){return lu(A,e,s.shape,n,r,i)}}},"Conv2D",h,d);return l?p.as3D(p.shape[1],p.shape[2],p.shape[3]):p}}),uu=gn({conv3d_:function(e,t,n,r,i,o){void 0===i&&(i="NDHWC"),void 0===o&&(o=[1,1,1]);var a=rn(e,"x","conv3d"),s=rn(t,"filter","conv3d"),A=a,u=!1;4===a.rank&&(u=!0,A=a.as5D(1,a.shape[0],a.shape[1],a.shape[2],a.shape[3])),R(5===A.rank,function(){return"Error in conv3d: input must be rank 5, but got rank "+A.rank+"."}),R(5===s.rank,function(){return"Error in conv3d: filter must be rank 5, but got rank "+s.rank+"."}),R(A.shape[4]===s.shape[3],function(){return"Error in conv3d: depth of input ("+A.shape[4]+") must match input depth for filter "+s.shape[3]+"."}),R(function(e,t){return ou(e)||ou(t)}(n,o),function(){return"Error in conv3D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),R("NDHWC"===i,function(){return"Error in conv3d: got dataFormat of "+i+" but only NDHWC is currently supported."});var l=$r(A.shape,s.shape,n,o,r),c=Ve.runKernelFunc(function(e,t){var n=e.conv3d(A,s,l);return t([A,s]),n},{x:A,$filter:s},function(e,t){R(ou(o),function(){return"Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"});var i=t[0],a=t[1];return{x:function(){return au(i.shape,e,a,n,r)},$filter:function(){return function(e,t,n,r,i){var o=e;4===e.rank&&(o=e.as5D(1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]));var a=t;4===a.rank&&(a=t.as5D(1,t.shape[0],t.shape[1],t.shape[2],t.shape[3])),R(5===o.rank,function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+o.shape+"."}),R(5===a.rank,function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+a.shape+"."}),R(5===n.length,function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+n+"."}),R(o.shape[4]===n[3],function(){return"Error in conv3dDerFilter: depth of input "+o.shape[4]+") must match input depth in filter ("+n[3]+"."}),R(a.shape[4]===n[4],function(){return"Error in conv3dDerFilter: depth of dy ("+a.shape[4]+") must match output depth for filter ("+n[4]+")."});var s=$r(o.shape,n,r,1,i);return Ve.runKernelFunc(function(e){return e.conv3dDerFilter(o,a,s)},{x5D:o,dy5D:a})}(i,e,a.shape,n,r)}}});return u?c.as4D(c.shape[1],c.shape[2],c.shape[3],c.shape[4]):c}}),lu=gn({conv2dDerFilter_:function(e,t,n,r,i,o,a){void 0===o&&(o="NHWC");var s=e;3===e.rank&&(s=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var A=t;3===A.rank&&(A=t.as4D(1,t.shape[0],t.shape[1],t.shape[2])),R(4===s.rank,function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+s.shape+"."}),R(4===A.rank,function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+A.shape+"."}),R(4===n.length,function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+n+"."});var u="NHWC"===o?s.shape[3]:s.shape[1],l="NHWC"===o?A.shape[3]:A.shape[1];R(u===n[2],function(){return"Error in conv2dDerFilter: depth of input "+u+") must match input depth in filter ("+n[2]+"."}),R(l===n[3],function(){return"Error in conv2dDerFilter: depth of dy ("+l+") must match output depth for filter ("+n[3]+")."}),null!=a&&R(j(i),function(){return"Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+i+"."});var c=si(o),f=Zr(s.shape,n,r,1,i,a,!1,c);return Ve.runKernelFunc(function(e){return e.conv2dDerFilter(s,A,f)},{x4D:s,dy4D:A})}}),cu=gn({conv2dDerInput_:iu}),fu=gn({depthwiseConv2d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var s=rn(e,"x","depthwiseConv2d"),A=rn(t,"filter","depthwiseConv2d"),u=s,l=!1;3===s.rank&&(l=!0,u=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),R(4===u.rank,function(){return"Error in depthwiseConv2d: input must be rank 4, but got rank "+u.rank+"."}),R(4===A.rank,function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+A.rank+"."}),R(u.shape[3]===A.shape[2],function(){return"Error in depthwiseConv2d: number of input channels ("+u.shape[3]+") must match the inChannels dimension in filter "+A.shape[2]+"."}),null==o&&(o=[1,1]),R(ai(n,o),function(){return"Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),null!=a&&R(j(r),function(){return"Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r+"."});var c=Zr(u.shape,A.shape,n,o,r,a,!0),f=[u,A],h=Ve.runKernelFunc(function(e,t){var n=e.depthwiseConv2D(u,A,c);return t([u,A]),n},{x:u,filter:A},function(e,t){R(oi(o),function(){return"Error in gradient of depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+o+"'"});var n=t[0],r=t[1];return{x:function(){return hu(n.shape,e,r,c)},filter:function(){return du(n,e,r.shape,c)}}},"DepthwiseConv2dNative",c,f);return l?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}}),hu=gn({depthwiseConv2dDerInput_:function(e,t,n,r){var i=t,o=!1;3===t.rank&&(o=!0,i=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]));var a=Ve.runKernelFunc(function(e){return e.depthwiseConv2DDerInput(i,n,r)},{dy4D:i});return o?a.as3D(a.shape[1],a.shape[2],a.shape[3]):a}}),du=gn({depthwiseConv2dDerFilter_:function(e,t,n,r){var i=e;3===e.rank&&(i=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var o=t;return 3===o.rank&&(o=t.as4D(1,t.shape[0],t.shape[1],t.shape[2])),Ve.runKernelFunc(function(e){return e.depthwiseConv2DDerFilter(i,o,r)},{x4D:i,dy4D:o})}}),pu=gn({separableConv2d_:function(e,t,n,r,i,o,a){void 0===o&&(o=[1,1]),void 0===a&&(a="NHWC");var s=rn(e,"x","separableConv2d"),A=rn(t,"depthwiseFilter","separableConv2d"),u=rn(n,"pointwiseFilter","separableConv2d"),l=s,c=!1;if(3===s.rank&&(c=!0,l=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");R(4===l.rank,function(){return"Error in separableConv2d: input must be rank 4, but got rank "+l.rank+"."}),R(4===A.rank,function(){return"Error in separableConv2d: depthwise filter must be rank 4, but got rank "+A.rank+"."}),R(4===u.rank,function(){return"Error in separableConv2d: pointwise filter must be rank 4, but got rank "+A.rank+"."}),R(1===u.shape[0],function(){return"Error in separableConv2d: the first dimension of pointwise filter must be 1, but got "+u.shape[0]+"."}),R(1===u.shape[1],function(){return"Error in separableConv2d: the second dimension of pointwise filter must be 1, but got "+u.shape[1]+"."});var f=A.shape[2],h=A.shape[3];R(u.shape[2]===f*h,function(){return"Error in separableConv2d: the third dimension of pointwise filter must be "+f*h+", but got "+u.shape[2]+"."});var d=fu(l,A,r,i,a,o),p=Au(d,u,1,"valid",a);return c?p.as3D(p.shape[1],p.shape[2],p.shape[3]):p}}),gu=gn({conv2dTranspose_:function(e,t,n,r,i,o){return iu(n,rn(e,"x","conv2dTranspose"),rn(t,"filter","conv2dTranspose"),r,i,"NHWC",o)}}),mu=gn({conv3dTranspose_:function(e,t,n,r,i){return au(n,rn(e,"x","conv3dTranspose"),rn(t,"filter","conv3dTranspose"),r,i)}}),vu=gn({matMul_:function(e,t,n,r){var i;void 0===n&&(n=!1),void 0===r&&(r=!1);var o=rn(e,"a","matMul"),a=rn(t,"b","matMul");i=Me(o,a),o=i[0],a=i[1];var s=n?o.shape[o.rank-2]:o.shape[o.rank-1],A=r?a.shape[a.rank-1]:a.shape[a.rank-2],u=n?o.shape[o.rank-1]:o.shape[o.rank-2],l=r?a.shape[a.rank-2]:a.shape[a.rank-1],c=o.shape.slice(0,-2),f=a.shape.slice(0,-2),h=M(c),d=M(f);R(o.rank>=2&&a.rank>=2&&o.rank===a.rank,function(){return"Error in matMul: inputs must have the same rank of at least 2, got ranks "+o.rank+" and "+a.rank+"."}),R(H(c,f),function(){return"Error in matMul: outer dimensions ("+c+") and ("+f+") of Tensors with shapes "+o.shape+" and "+a.shape+" must match."}),R(s===A,function(){return"Error in matMul: inner shapes ("+s+") and ("+A+") of Tensors with shapes "+o.shape+" and "+a.shape+" and transposeA="+n+" and transposeB="+r+" must match."});var p=o.shape.slice(0,-2).concat([u,l]),g=n?o.as3D(h,s,u):o.as3D(h,u,s),m=r?a.as3D(d,l,A):a.as3D(d,A,l),v={transposeA:n,transposeB:r};return Ve.runKernelFunc(function(e,t){var i=e.batchMatMul(g,m,n,r);return t([g,m]),i},{a:g,b:m},function(e,t){var i=t,o=i[0],a=i[1];return n||r?!n&&r?{a:function(){return e.matMul(a,!1,!1)},b:function(){return e.matMul(o,!0,!1)}}:n&&!r?{a:function(){return a.matMul(e,!1,!0)},b:function(){return o.matMul(e,!1,!1)}}:{a:function(){return a.matMul(e,!0,!0)},b:function(){return e.matMul(o,!0,!0)}}:{a:function(){return e.matMul(a,!1,!0)},b:function(){return o.matMul(e,!0,!1)}}},"BatchMatMul",v).reshape(p)}}),wu=gn({dot_:function(e,t){var n=rn(e,"t1","dot"),r=rn(t,"t2","dot");R(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+n.rank+" and "+r.rank+"."});var i=1===n.rank?n.size:n.shape[1],o=1===r.rank?r.size:r.shape[0];return R(i===o,function(){return"Error in dot: inner dimensions of inputs must match, but got "+i+" and "+o+"."}),1===n.rank&&1===r.rank?n.as2D(1,-1).matMul(r.as2D(-1,1)).asScalar():1===n.rank&&2===r.rank?n.as2D(1,-1).matMul(r.as2D(r.shape[0],r.shape[1])).as1D():2===n.rank&&1===r.rank?n.matMul(r.as2D(-1,1)).as1D():n.matMul(r.as2D(r.shape[0],r.shape[1]))}}),yu=gn({outerProduct_:function(e,t){var n=rn(e,"v1","outerProduct"),r=rn(t,"v2","outerProduct");return R(1===n.rank&&1===r.rank,function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+n.rank+" and "+r.rank+"."}),n.as2D(-1,1).matMul(r.as2D(1,-1))}}),bu=gn({reverse_:function(e,t){var n=rn(e,"x","reverse");if(0===n.rank)return n.clone();var r=q(t,n.shape);return Ve.runKernelFunc(function(e){return e.reverse(n,r)},{$x:n},function(e){return{$x:function(){return e.reverse(r)}}}).reshapeAs(n)}}),Bu=gn({reverse1d_:function(e){var t=rn(e,"x","reverse");return R(1===t.rank,function(){return"Error in reverse1D: x must be rank 1 but got rank "+t.rank+"."}),bu(t,0)}}),xu=gn({reverse2d_:function(e,t){var n=rn(e,"x","reverse");return R(2===n.rank,function(){return"Error in reverse2D: x must be rank 2 but got rank "+n.rank+"."}),bu(n,t)}}),Cu=gn({reverse3d_:function(e,t){var n=rn(e,"x","reverse");return R(3===n.rank,function(){return"Error in reverse3D: x must be rank 3 but got rank "+n.rank+"."}),bu(n,t)}}),Fu=gn({reverse4d_:function(e,t){var n=rn(e,"x","reverse");return R(4===n.rank,function(){return"Error in reverse4D: x must be rank 4 but got rank "+n.rank+"."}),bu(n,t)}});function Eu(e,t,n,r,i,o){var a=rn(e,"x","maxPool"),s=a,A=!1;3===a.rank&&(A=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),null==r&&(r=[1,1]),R(4===s.rank,function(){return"Error in maxPool: input must be rank 4 but got rank "+s.rank+"."}),R(ai(n,r),function(){return"Error in maxPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"}),null!=o&&R(j(i),function(){return"Error in maxPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var u=Yr(s.shape,t,n,r,i,o);if(1===u.filterWidth&&1===u.filterHeight&&H(u.inShape,u.outShape))return a.clone();var l=[s],c=Ve.runKernelFunc(function(e,t){var n=e.maxPool(s,u);return t([s,n]),n},{x:s},function(e,o){var a=o[0],s=o[1];return{x:function(){return function(e,t,n,r,i,o,a,s){var A=rn(e,"dy","maxPoolBackprop"),u=rn(t,"input","maxPoolBackprop"),l=rn(n,"output","maxPoolBackprop");R(u.rank===A.rank,function(){return"Rank of input ("+u.rank+") does not match rank of dy ("+A.rank+")"}),null==o&&(o=[1,1]),R(ai(i,o),function(){return"Error in maxPoolBackProp: Either strides or dilations must be 1. Got strides "+i+" and dilations '"+o+"'"}),R(4===A.rank,function(){return"Error in maxPoolBackprop: dy must be rank 4 but got rank "+A.rank+"."}),R(4===u.rank,function(){return"Error in maxPoolBackprop: input must be rank 4 but got rank "+u.rank+"."});var c=Yr(u.shape,r,i,o,a,s);return Ve.runKernelFunc(function(e){return e.maxPoolBackprop(A,u,l,c)},{$dy:A,$input:u})}(e,a,s,t,n,r,i)}}},"MaxPool",u,l);return A?c.as3D(c.shape[1],c.shape[2],c.shape[3]):c}function Su(e,t,n,r,i,o){var a=rn(e,"x","avgPool","float32");null==r&&(r=[1,1]),R(ai(n,r),function(){return"Error in avgPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"});var s=a,A=!1;3===a.rank&&(A=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),R(4===s.rank,function(){return"Error in avgPool: x must be rank 4 but got rank "+s.rank+"."}),null!=o&&R(j(i),function(){return"Error in avgPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var u=Yr(s.shape,t,n,r,i,o);if(1===u.filterWidth&&1===u.filterHeight&&H(u.inShape,u.outShape))return a.clone();var l=Ve.runKernelFunc(function(e){return e.avgPool(s,u)},{x:s},function(e){return{x:function(){return function(e,t,n,r,i,o){var a=rn(e,"dy","avgPoolBackprop"),s=rn(t,"input","avgPoolBackprop");R(s.rank===a.rank,function(){return"Rank of input ("+s.rank+") does not match rank of dy ("+a.rank+")"}),null==i&&(i=[1,1]),R(ai(r,i),function(){return"Error in avgPoolBackprop: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+i+"'"});var A=s,u=a,l=!1;3===s.rank&&(l=!0,A=s.as4D(1,s.shape[0],s.shape[1],s.shape[2]),u=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),R(4===u.rank,function(){return"Error in avgPoolBackprop: dy must be rank 4 but got rank "+u.rank+"."}),R(4===A.rank,function(){return"Error in avgPoolBackprop: input must be rank 4 but got rank "+A.rank+"."});var c=Yr(A.shape,n,r,i,o),f=Ve.runKernelFunc(function(e){return e.avgPoolBackprop(u,A,c)},{dy4D:u,input4D:A});return l?f.as3D(f.shape[1],f.shape[2],f.shape[3]):f}(e,s,t,n,r,i)}}},"AvgPool",u);return l=l.cast(a.dtype),A?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}var ku=gn({maxPool_:function(e,t,n,r,i){return Eu(e,t,n,1,r,i)}}),_u=gn({avgPool_:function(e,t,n,r,i){return Su(e,t,n,1,r,i)}}),Iu=gn({pool_:function(e,t,n,r,i,o){null==i&&(i=[1,1]),null==o&&(o=1),0===r&&(r="valid");var a=rn(e,"x","maxPool"),s=a,A=!1;3===a.rank&&(A=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),R(ai(o,i),function(){return"Error in pool: Either strides or dilations must be 1. Got strides "+o+" and dilations '"+i+"'"});var u,l=Yr(s.shape,t,o,i,r),c=[l.dilationHeight,l.dilationWidth];u="same"===r?function(e,t){var n=e.map(function(e,n){return e+(e-1)*(t[n]-1)}).map(function(e){return e-1}),r=n.map(function(e){return Math.floor(e/2)}),i=n.map(function(e,t){return e-r[t]});return n.map(function(e,t){return[r[t],i[t]]})}([l.filterHeight,l.filterWidth],c):[[0,0],[0,0]];var f=1===c[0]&&1===c[1],h=function(e,t,n){var r=n.map(function(e){return e[0]}),i=n.map(function(e){return e[1]}),o=e.concat(r,i),a=t.map(function(e,t){return(e-o[t]%e)%e}),s=i.map(function(e,t){return e+a[t]});return[t.map(function(e,t){return[r[t],s[t]]}),t.map(function(e,t){return[0,a[t]]})]}([l.inHeight,l.inWidth],c,u),d=h[0],p=h[1],g=f?r:"valid",m=f?s:vr(s,c,d),v=("avg"===n?function(){return Su(m,t,o,1,g)}:function(){return Eu(m,t,o,1,g)})(),w=f?v:Zn(v,c,p);return A?w.as3D(w.shape[1],w.shape[2],w.shape[3]):w}}),Nu=gn({maxPool3d_:function(e,t,n,r,i,o,a){void 0===o&&(o="NDHWC");var s=rn(e,"x","maxPool3d"),A=s,u=!1;4===s.rank&&(u=!0,A=s.as5D(1,s.shape[0],s.shape[1],s.shape[2],s.shape[3])),null==a&&(a=[1,1,1]),R(5===A.rank,function(){return"Error in maxPool3d: x must be rank 5 but got rank "+A.rank+"."}),R("NDHWC"===o,function(){return"Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of "+o}),R(ai(n,a),function(){return"Error in maxPool3d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+a+"'"}),null!=i&&R(j(r),function(){return"Error in maxPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r+"."});var l=Jr(A.shape,t,n,a,r,i,o),c=Ve.runKernelFunc(function(e,t){var n=e.maxPool3d(A,l);return t([A,n]),n},{x:A},function(e,o){var s=o[0],A=o[1];return{x:function(){return function(e,t,n,r,i,o,a,s){var A=rn(e,"dy","maxPool3dBackprop"),u=rn(t,"input","maxPool3dBackprop"),l=rn(n,"output","maxPool3dBackprop"),c=A,f=u,h=l,d=!1;4===u.rank&&(d=!0,c=A.as5D(1,A.shape[0],A.shape[1],A.shape[2],A.shape[3]),f=u.as5D(1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]),h=l.as5D(1,l.shape[0],l.shape[1],l.shape[2],l.shape[3])),R(5===c.rank,function(){return"Error in maxPool3dBackprop: dy must be rank 5 but got rank "+c.rank+"."}),R(5===f.rank,function(){return"Error in maxPool3dBackprop: input must be rank 5 but got rank "+f.rank+"."}),R(5===h.rank,function(){return"Error in maxPool3dBackprop: output must be rank 5 but got rank "+h.rank+"."}),null==o&&(o=[1,1,1]),R(ai(i,o),function(){return"Error in maxPool3dBackprop: Either strides or dilations must be 1. Got strides "+i+" and dilations '"+o+"'"}),null!=s&&R(j(a),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+a+"."});var p=Jr(f.shape,r,i,o,a,s),g=Ve.runKernelFunc(function(e){return e.maxPool3dBackprop(c,f,h,p)},{dy5D:c,input5D:f});return d?g.as4D(g.shape[1],g.shape[2],g.shape[3],g.shape[4]):g}(e,s,A,t,n,a,r,i)}}});return u?c.as4D(c.shape[1],c.shape[2],c.shape[3],c.shape[4]):c}}),Uu=gn({avgPool3d_:function(e,t,n,r,i,o,a){void 0===o&&(o="NDHWC");var s=rn(e,"x","avgPool3d","float32"),A=s,u=!1;4===s.rank&&(u=!0,A=s.as5D(1,s.shape[0],s.shape[1],s.shape[2],s.shape[3])),null==a&&(a=[1,1,1]),R(5===A.rank,function(){return"Error in avgPool3d: x must be rank 5 but got rank "+A.rank+"."}),R("NDHWC"===o,function(){return"Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of "+o}),R(ai(n,a),function(){return"Error in avgPool3d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+a+"'"}),null!=i&&R(j(r),function(){return"Error in avgPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r+"."});var l=Jr(A.shape,t,n,a,r,i,o),c=Ve.runKernelFunc(function(e){return e.avgPool3d(A,l)},{x:A},function(e){return{x:function(){return function(e,t,n,r,i,o,a){var s=rn(e,"dy","avgPool3dBackprop"),A=rn(t,"input","avgPool3dBackprop"),u=s,l=A,c=!1;4===A.rank&&(c=!0,u=s.as5D(1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]),l=A.as5D(1,A.shape[0],A.shape[1],A.shape[2],A.shape[3])),R(5===u.rank,function(){return"Error in avgPool3dBackprop: dy must be rank 5 but got rank "+u.rank+"."}),R(5===l.rank,function(){return"Error in avgPool3dBackprop: input must be rank 5 but got rank "+l.rank+"."}),null==i&&(i=[1,1,1]),R(ai(r,i),function(){return"Error in avgPool3dBackprop: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+i+"'"}),null!=a&&R(j(o),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+o+"."});var f=Jr(l.shape,n,r,i,o,a),h=Ve.runKernelFunc(function(e){return e.avgPool3dBackprop(u,l,f)},{dy5D:u,input5D:l});return c?h.as4D(h.shape[1],h.shape[2],h.shape[3],h.shape[4]):h}(e,A,t,n,a,r,i)}}});return c=c.cast(A.dtype),u?c.as4D(c.shape[1],c.shape[2],c.shape[3],c.shape[4]):c}}),Lu=gn({slice_:function(e,t,n){var r,i,o=rn(e,"x","slice");if(0===o.rank)throw new Error("Slicing scalar is not possible");(r="number"==typeof t?[t].concat(new Array(o.rank-1).fill(0)):t.length<o.rank?t.concat(new Array(o.rank-t.length).fill(0)):t.slice()).forEach(function(e){R(-1!==e,function(){return"slice() does not support negative begin indexing."})}),i=(i=null==n?new Array(o.rank).fill(-1):"number"==typeof n?[n].concat(new Array(o.rank-1).fill(-1)):n.length<o.rank?n.concat(new Array(o.rank-n.length).fill(-1)):n).map(function(e,t){return e>=0?e:(R(-1===e,function(){return"Negative size values should be exactly -1 but got "+e+" for the slice() size at index "+t+"."}),o.shape[t]-r[t])}),Qr(o,r,i);var a=o.shape,s={begin:r,size:i};return Ve.runKernelFunc(function(e){return e.slice(o,r,i)},{x:o},function(e){for(var t=[],n=0;n<e.rank;n++)t.push([r[n],a[n]-r[n]-i[n]]);return{x:function(){return e.pad(t)}}},"Slice",s)}}),Qu=gn({slice1d_:function(e,t,n){var r=rn(e,"x","slice1d");return R(1===r.rank,function(){return"slice1d expects a rank-1 tensor, but got a rank-"+r.rank+" tensor"}),Lu(r,[t],[n])}}),Du=gn({slice2d_:function(e,t,n){var r=rn(e,"x","slice2d");return R(2===r.rank,function(){return"slice2d expects a rank-2 tensor, but got a rank-"+r.rank+" tensor"}),Lu(r,t,n)}}),Ru=gn({slice3d_:function(e,t,n){var r=rn(e,"x","slice3d");return R(3===r.rank,function(){return"slice3d expects a rank-3 tensor, but got a rank-"+r.rank+" tensor"}),Lu(r,t,n)}}),Tu=gn({slice4d_:function(e,t,n){var r=rn(e,"x","slice4d");return R(4===r.rank,function(){return"slice4d expects a rank-4 tensor, but got a rank-"+r.rank+" tensor"}),Lu(r,t,n)}});function Pu(e,t,n,r,i){return t.rank<n.rank&&(t=t.reshape(un(t.shape,r))),e.rank<n.rank&&(e=e.reshape(un(e.shape,r))),{x:function(){var r=e.mul(n.equal(t).cast(e.dtype));return null==i?r:r.transpose(i)}}}var Ou=gn({all_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","all","bool"),i=q(t,r.shape),o=i,a=cn(o,r.rank);null!=a&&(r=r.transpose(a),o=hn(o.length,r.rank));var s=Ve.runKernelFunc(function(e){return e.all(r,o)},{$x:r});if(n){var A=un(s.shape,i);return s.reshape(A)}return s}}),Mu=gn({any_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","any","bool"),i=q(t,r.shape),o=i,a=cn(o,r.rank);null!=a&&(r=r.transpose(a),o=hn(o.length,r.rank));var s=Ve.runKernelFunc(function(e){return e.any(r,o)},{$x:r});if(n){var A=un(s.shape,i);return s.reshape(A)}return s}}),Hu=gn({argMax_:function(e,t){void 0===t&&(t=0);var n=rn(e,"x","argMax");null==t&&(t=0);var r=q(t,n.shape),i=cn(r,n.rank);null!=i&&(n=n.transpose(i),r=hn(r.length,n.rank));var o={axis:r[0]},a=[n];return Ve.runKernelFunc(function(e,t){var i=e.argMax(n,r[0]);return t([n]),i},{x:n},function(e,t){var n=t[0];return{x:function(){return Un(n)}}},"ArgMax",o,a)}}),ju=gn({argMin_:function(e,t){void 0===t&&(t=0);var n=rn(e,"x","argMin");null==t&&(t=0);var r=q(t,n.shape),i=cn(r,n.rank);return null!=i&&(n=n.transpose(i),r=hn(r.length,n.rank)),Ve.runKernelFunc(function(e,t){var i=e.argMin(n,r[0]);return t([n]),i},{$x:n},function(e,t){var n=t[0];return{$x:function(){return Un(n)}}})}}),zu=gn({logSumExp_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","logSumExp"),i=q(t,r.shape),o=r.max(i,!0),a=r.sub(o).exp().sum(i).log(),s=o.reshape(a.shape).add(a);if(n){var A=un(s.shape,i);return s.reshape(A)}return s}}),Ku=gn({max_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","max"),i=r,o=q(t,r.shape),a=o,s=cn(a,r.rank);null!=s&&(r=r.transpose(s),a=hn(a.length,r.rank));var A=[r],u=Ve.runKernelFunc(function(e,t){var n=e.max(r,a);return t([i,n]),n},{x:r},function(e,t){return Pu(e,t[1],t[0],o,s)},"Max",{axes:a},A,[!0]);if(n){var l=un(u.shape,o);u=u.reshape(l)}return u}}),Wu=gn({mean_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","mean"),i=q(t,r.shape),o=M(An(r.shape,i)[1]);return Hr(function(e){var r=Bn(o);return{value:(r.dtype===e.dtype?e:e.cast(r.dtype)).div(r).sum(t,n),gradFunc:function(t){var n=e.shape.slice();return i.forEach(function(e){n[e]=1}),t.reshape(n).mul(Sn(e.shape,"float32")).div(o)}}})(r)}}),Vu=gn({min_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","min"),i=r,o=q(t,r.shape),a=o,s=cn(a,r.rank);null!=s&&(r=r.transpose(s),a=hn(a.length,r.rank));var A=[r],u=Ve.runKernelFunc(function(e,t){var n=e.min(r,a);return t([i,n]),n},{x:r},function(e,t){return Pu(e,t[1],t[0],o,s)},"Min",{axes:a},A,[!0]);if(n){var l=un(u.shape,o);u=u.reshape(l)}return u}}),Gu=gn({moments_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=q(t,(e=rn(e,"x","moments")).shape),i=e.mean(r,n),o=i.shape;n||(o=un(i.shape,r));var a=e.toFloat().sub(i.reshape(o)).square();return{mean:i,variance:a.mean(r,n)}}}),qu=gn({sum_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","sum");"bool"===r.dtype&&(r=r.toInt());var i=q(t,r.shape);return Hr(function(e){var t=cn(i,e.rank),r=i,o=e;null!=t&&(o=e.transpose(t),r=hn(r.length,e.rank));var a=function(t){var n=e.shape.slice();return i.forEach(function(e){n[e]=1}),t.reshape(n).mul(Sn(e.shape,"float32"))},s={axes:r},A=Ve.runKernelFunc(function(e){return e.sum(o,r)},{x:o},function(e){return{x:function(){return a(e)}}},"Sum",s);if(n){var u=un(A.shape,i);A=A.reshape(u)}return{value:A,gradFunc:a}})(r)}}),Xu=gn({prod_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=rn(e,"x","prod");"bool"===r.dtype&&(r=r.toInt());var i=q(t,r.shape),o=cn(i,r.rank),a=i,s=r;null!=o&&(s=r.transpose(o),a=hn(a.length,r.rank));var A=Ve.runKernelFunc(function(e){return e.prod(s,a)},{permutedX:s});if(n){var u=un(A.shape,i);A=A.reshape(u)}return A}}),Yu=gn({elu_:function(e){var t=rn(e,"x","elu");return Ve.runKernelFunc(function(e,n){var r=e.elu(t);return n([r]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return Ve.runKernelFunc(function(t){return t.eluDer(e,n)},{dy:e,y:n})}}})}}),Ju=gn({leakyRelu_:function(e,t){void 0===t&&(t=.2);var n=rn(e,"x","leakyRelu");return _A(Bn(t).mul(n),n)}}),Zu=gn({prelu_:function(e,t){var n=rn(e,"x","prelu"),r=rn(t,"alpha","prelu");return Ve.runKernelFunc(function(e,t){var i=e.prelu(n,r);return t([n,r]),i},{x:n,alpha:r},function(e,t){var n=t[0],r=t[1],i=n.greater(0);return{x:function(){return wA(i,e,e.mul(r))},alpha:function(){var t=wA(i,Un(e),e.mul(n)),o=qr(r.shape,e.shape);return o.length>0&&(t=t.sum(o)),t.reshape(r.shape)}}},"Prelu")}}),$u=gn({relu_:function(e){var t=rn(e,"x","relu");return"bool"===t.dtype?t.toInt():Ve.runKernelFunc(function(e,n){var r=e.relu(t);return n([t]),r},{x:t},function(e,t){var n=t[0];return{x:function(){return e.mulStrict(n.step().toFloat())}}},"Relu")}}),el=gn({relu6_:function(e){var t=rn(e,"x","relu6");return"bool"===t.dtype?t.toInt():Ve.runKernelFunc(function(e,n){var r=e.relu6(t);return n([t]),r},{x:t},function(e,t){var n=t[0],r=n.lessEqual(6).mul(n.step());return{x:function(){return e.mulStrict(r.toFloat())}}},"Relu6")}}),tl=gn({selu_:function(e){var t=rn(e,"x","selu");return Ve.runKernelFunc(function(e,n){var r=e.selu(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){var t=n.greater(Bn(0)),r=Bn(Ha),i=Bn(ja),o=e.mul(i),a=e.mul(r).mul(n.toFloat().exp());return wA(t,o,a)}}})}}),nl=gn({transpose_:function(e,t){var n=rn(e,"x","transpose");if(null==t&&(t=n.shape.map(function(e,t){return t}).reverse()),R(n.rank===t.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of perm "+t+"."}),t.forEach(function(e){R(e>=0&&e<n.rank,function(){return"All entries in 'perm' must be between 0 and "+(n.rank-1)+" but got "+t})}),n.rank<=1)return n.clone();var r={perm:t};return Ve.runKernelFunc(function(e){return e.transpose(n,t)},{x:n},function(e){var n=fn(t);return{x:function(){return e.transpose(n)}}},"Transpose",r)}}),rl=gn({localResponseNormalization_:function(e,t,n,r,i){void 0===t&&(t=5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=.5);var o=rn(e,"x","localResponseNormalization");R(4===o.rank||3===o.rank,function(){return"Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank "+o.rank+"."}),R(j(t),function(){return"Error in localResponseNormalization: depthRadius must be an integer but got depthRadius "+t+"."});var a=o,s=!1;3===o.rank&&(s=!0,a=o.as4D(1,o.shape[0],o.shape[1],o.shape[2]));var A=Ve.runKernelFunc(function(e,o){var s=e.localResponseNormalization4D(a,t,n,r,i);return o([a,s]),s},{x4D:a},function(e,o){var a=o[0],s=o[1];return{x4D:function(){return Ve.runKernelFunc(function(o){return o.LRNGrad(e,a,s,t,n,r,i)},{})}}});return s?A.as3D(A.shape[1],A.shape[2],A.shape[3]):A}}),il=gn({norm_:function(e,t,n,r){void 0===t&&(t="euclidean"),void 0===n&&(n=null),void 0===r&&(r=!1);var i=function e(t,n,r){if(void 0===r&&(r=null),0===t.rank)return t.abs();if(1!==t.rank&&null===r)return e(t.reshape([-1]),n,r);if(1===t.rank||"number"==typeof r||Array.isArray(r)&&1===r.length){if(1===n)return t.abs().sum(r);if(n===1/0)return t.abs().max(r);if(n===-1/0)return t.abs().min(r);if("euclidean"===n||2===n)return t.abs().pow(Bn(2,"int32")).sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}if(Array.isArray(r)&&2===r.length){if(1===n)return t.abs().sum(r[0]).max(r[1]-1);if(n===1/0)return t.abs().sum(r[1]).max(r[0]);if(n===-1/0)return t.abs().sum(r[1]).min(r[0]);if("fro"===n||"euclidean"===n)return t.square().sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}throw new Error("Error in norm: invalid axis: "+r)}(e=rn(e,"x","norm"),t,n),o=i.shape;if(r){var a=q(n,e.shape);o=un(i.shape,a)}return i.reshape(o)}}),ol=gn({basicLSTMCell_:function(e,t,n,r,i,o){var a=rn(e,"forgetBias","basicLSTMCell"),s=rn(t,"lstmKernel","basicLSTMCell"),A=rn(n,"lstmBias","basicLSTMCell"),u=rn(r,"data","basicLSTMCell"),l=rn(i,"c","basicLSTMCell"),c=rn(o,"h","basicLSTMCell"),f=u.concat(c,1).matMul(s).add(A),h=f.shape[0],d=f.shape[1]/4,p=[h,d],g=f.slice([0,0],p),m=f.slice([0,d],p),v=f.slice([0,2*d],p),w=f.slice([0,3*d],p),y=g.sigmoid().mulStrict(m.tanh()).addStrict(l.mulStrict(a.add(v).sigmoid())),b=y.tanh().mulStrict(w.sigmoid());return[y,b]}}),al=gn({multiRNNCell_:function(e,t,n,r){for(var i=rn(t,"data","multiRNNCell"),o=on(n,"c","multiRNNCell"),a=on(r,"h","multiRNNCell"),s=i,A=[],u=0;u<e.length;u++){var l=e[u](s,o[u],a[u]);A.push(l[0]),A.push(l[1]),s=l[1]}var c=[],f=[];for(u=0;u<A.length;u+=2)c.push(A[u]),f.push(A[u+1]);return[c,f]}}),sl=gn({movingAverage_:function(e,t,n,r,i){void 0===i&&(i=!0);var o=rn(e,"v","movingAverage"),a=rn(t,"x","movingAverage"),s=rn(n,"decay","movingAverage");He(o,a),R(H(o.shape,a.shape),function(){return"Shape mismatch in v and x"});var A=Bn(1),u=A.sub(s),l=a.sub(o).mul(u);if(i){R(null!=r,function(){return"When using zeroDebias: true, step is required."});var c=rn(r,"step","movingAverage");l=l.div(A.sub(TA(s,c)))}return o.add(l)}}),Al=gn({stridedSlice_:function(e,t,n,r,i,o,a,s,A){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===A&&(A=0),null==r&&(r=new Array(t.length)),0!==a)throw new Error("ellipsis mask is not yet supported");var u=rn(e,"x","stridedSlice"),l=Dr(s),c=u.shape.slice();l.forEach(function(e){t[e]=0,n[e]=1,c.splice(e,0,1)}),u=u.reshape(c);for(var f=0;f<u.rank;f++)t[f]=Tr(i,t,r,u.shape,f),n[f]=Pr(o,n,r,u.shape,f),r[f]=r[f]||1;var h=Dr(A);h.forEach(function(e){n[e]=t[e]+1,r[e]=1});var d=Rr(t,n,r),p=d.filter(function(e,t){return-1===h.indexOf(t)});return r.every(function(e){return 1===e})?Lu(u,t,d).reshape(p):Ve.runKernelFunc(function(e){return e.stridedSlice(u,t,n,r)},{$x:u}).reshape(p)}}),ul=gn({topk_:function(e,t,n){void 0===t&&(t=1),void 0===n&&(n=!0);var r=rn(e,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");var i=r.shape[r.shape.length-1];if(t>i)throw new Error("'k' passed to topk() must be <= the last dimension ("+i+") but got "+t);var o=Ve.runKernelFunc(function(e){return e.topk(r,t,n)},{$x:r});return{values:o[0],indices:o[1]}}}),ll=gn({scatterND_:function(e,t,n){var r=rn(e,"indices","scatterND","int32"),i=rn(t,"updates","scatterND");return Ur(i,r,n),Ve.runKernelFunc(function(e){return e.scatterND(r,i,n)},{indices:r,updates:i},null,"ScatterNd",{shape:n})}}),cl=gn({fft_:function(e){R("complex64"===e.dtype,function(){return"The dtype for tf.spectral.fft() must be complex64 but got "+e.dtype+"."});var t=e.shape[e.shape.length-1],n=e.size/t,r=e.as2D(n,t);return Ve.runKernelFunc(function(e){return e.fft(r)},{input:e}).reshape(e.shape)}}),fl=gn({ifft_:function(e){R("complex64"===e.dtype,function(){return"The dtype for tf.spectral.ifft() must be complex64 but got "+e.dtype+"."});var t=e.shape[e.shape.length-1],n=e.size/t,r=e.as2D(n,t);return Ve.runKernelFunc(function(e){return e.ifft(r)},{input:e}).reshape(e.shape)}}),hl=gn({rfft_:function(e,t){R("float32"===e.dtype,function(){return"The dtype for rfft() must be real value but got "+e.dtype});var n,r=e.shape[e.shape.length-1],i=e.size/r;if(null!=t&&t<r){var o=e.shape.map(function(e){return 0}),a=e.shape.map(function(e){return e});a[e.shape.length-1]=t,n=e.slice(o,a),r=t}else if(null!=t&&t>r){var s=e.shape.map(function(e){return e});s[e.shape.length-1]=t-r,n=e.concat(kn(s),e.shape.length-1),r=t}else n=e;var A=n.zerosLike(),u=mn(n,A).as2D(i,r),l=cl(u),c=Math.floor(r/2)+1,f=vn(l),h=wn(l),d=f.split([c,r-c],f.shape.length-1),p=h.split([c,r-c],h.shape.length-1),g=n.shape.slice();return g[n.shape.length-1]=c,mn(d[0],p[0]).reshape(g)}}),dl=gn({irfft_:function(e){var t=e.shape[e.shape.length-1],n=e.size/t;if(t<=2){var r=e.as2D(n,t),i=fl(r);return vn(i)}var o=[n,2*(t-1)],a=vn(e).as2D(n,t),s=wn(e).as2D(n,t),A=a.slice([0,1],[n,t-2]).reverse(1),u=s.slice([0,1],[n,t-2]).reverse(1).mul(Bn(-1)),l=a.concat(A,1),c=s.concat(u,1);return r=mn(l,c).as2D(o[0],o[1]),i=fl(r),vn(i)}}),pl=Object.freeze({fft:cl,ifft:fl,rfft:hl,irfft:dl}),gl=gn({sparseToDense_:function(e,t,n,r){void 0===r&&(r=0);var i=rn(e,"sparseIndices","sparseToDense","int32"),o=rn(t,"sparseValues","sparseToDense"),a=rn(r,"defaultValue","sparseToDense",o.dtype);return function(e,t,n,r){if("int32"!==e.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type, but the dtype was "+e.dtype+".");if(e.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix, but got shape "+e.shape+".");var i=e.rank>0?e.shape[0]:1,o=e.rank>1?e.shape[1]:1;if(n.length!==o)throw new Error("outputShape has incorrect number of elements:, "+n.length+", should be: "+o+".");var a=t.size;if(0!==t.rank&&(1!==t.rank||a!==i))throw new Error("sparseValues has incorrect shape "+t.shape+", should be [] or ["+i+"]");if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,o,n,a),Ve.runKernelFunc(function(e){return e.sparseToDense(i,o,n,a)},{$sparseIndices:i,$sparseValues:o,$defaultValue:a})}}),ml=gn({gatherND_:function(e,t){var n=rn(t,"indices","gatherND","int32"),r=rn(e,"x","gatherND");return Ve.runKernelFunc(function(e){return e.gatherND(r,n)},{x:r,indices:n},null,"GatherNd")}}),vl=gn({diag_:function(e){var t=rn(e,"x","diag").flatten(),n=e.shape.concat(e.shape);return Ve.runKernelFunc(function(e){return e.diag(t)},{$x:t}).reshape(n)}}),wl=gn({dropout_:function(e,t,n,r){var i=rn(e,"x","dropout");if(R("float32"===i.dtype,function(){return"x has to be a floating point tensor since it's going to be scaled, but got a "+i.dtype+" tensor instead."}),R(t>=0&&t<1,function(){return"rate must be a float in the range [0, 1), but got "+t+"."}),0===t)return e instanceof Ie?i.clone():i;var o=function(e,t){if(null==t)return e.shape.slice();if(H(e.shape,t))return t;if(e.shape.length===t.length){for(var n=[],r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(i,n),a=1-t,s=gr(o,0,1,"float32",r).add(a).floor().div(a);return i.mul(s)}});function yl(e,t,n){for(var r=1-e%2,i=new Float32Array(e),o=0;o<e;++o){var a=2*Math.PI*o/(e+r-1);i[o]=t-n*Math.cos(a)}return xn(i,"float32")}var bl,Bl=gn({hannWindow_:function(e){return yl(e,.5,.5)}}),xl=gn({hammingWindow_:function(e){return yl(e,.54,.46)}}),Cl=gn({frame_:function(e,t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=0);for(var o=0,a=[];o+t<=e.size;)a.push(Lu(e,o,t)),o+=n;if(r)for(;o<e.size;){var s=o+t-e.size,A=Ln([Lu(e,o,t-s),_n([s],i)]);a.push(A),o+=n}return 0===a.length?Cn([],[0,t]):Ln(a).as2D(a.length,t)}}),Fl=gn({stft_:function(e,t,n,r,i){var o;void 0===i&&(i=Bl),null==r&&(o=t,r=Math.floor(Math.pow(2,Math.ceil(Math.log(o)/Math.log(2)))));for(var a=Cl(e,t,n),s=DA(a,i(t)),A=[],u=0;u<a.shape[0];u++)A.push(hl(s.slice([u,0],[1,t]),r));return Ln(A)}}),El=Object.freeze({hannWindow:Bl,hammingWindow:xl,frame:Cl,stft:Fl});!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(bl||(bl={}));var Sl=gn({absoluteDifference_:function(e,t,n,r){void 0===r&&(r=bl.SUM_BY_NONZERO_WEIGHTS);var i=rn(e,"labels","absoluteDifference"),o=rn(t,"predictions","absoluteDifference"),a=null;null!=n&&(a=rn(n,"weights","absoluteDifference")),T(i.shape,o.shape,"Error in absoluteDifference: ");var s=i.sub(o).abs();return kl(s,a,r)}}),kl=gn({computeWeightedLoss_:function(e,t,n){void 0===n&&(n=bl.SUM_BY_NONZERO_WEIGHTS);var r=rn(e,"losses","computeWeightedLoss"),i=null;null!=t&&(i=rn(t,"weights","computeWeightedLoss"));var o=null==i?r:r.mul(i);if(n===bl.NONE)return o;if(n===bl.SUM)return o.sum();if(n===bl.MEAN){if(null==i)return o.mean();var a=r.size/i.size,s=o.sum().div(i.sum());return a>1?s.div(Bn(a)):s}if(n===bl.SUM_BY_NONZERO_WEIGHTS){if(null==i)return o.sum().div(Bn(r.size));var A=i.mul(Sn(r.shape)).notEqual(Bn(0)).sum().toFloat();return o.sum().div(A)}throw Error("Unknown reduction: "+n)}}),_l=gn({cosineDistance_:function(e,t,n,r,i){void 0===i&&(i=bl.SUM_BY_NONZERO_WEIGHTS);var o=rn(e,"labels","cosineDistance"),a=rn(t,"predictions","cosineDistance"),s=null;null!=r&&(s=rn(r,"weights","cosineDistance")),T(o.shape,a.shape,"Error in cosineDistance: ");var A=Bn(1).sub(o.mul(a).sum(n,!0));return kl(A,s,i)}}),Il=gn({hingeLoss_:function(e,t,n,r){void 0===r&&(r=bl.SUM_BY_NONZERO_WEIGHTS);var i=rn(e,"labels","hingeLoss"),o=rn(t,"predictions","hingeLoss"),a=null;null!=n&&(a=rn(n,"weights","hingeLoss")),T(i.shape,o.shape,"Error in hingeLoss: ");var s=Bn(1);i=Bn(2).mul(i).sub(s);var A=s.sub(i.mul(o)).relu();return kl(A,a,r)}}),Nl=gn({huberLoss_:function(e,t,n,r,i){void 0===r&&(r=1),void 0===i&&(i=bl.SUM_BY_NONZERO_WEIGHTS);var o=rn(e,"labels","huberLoss"),a=rn(t,"predictions","huberLoss"),s=null;null!=n&&(s=rn(n,"weights","huberLoss")),T(o.shape,a.shape,"Error in huberLoss: ");var A=Bn(r),u=a.sub(o).abs(),l=NA(u,A),c=u.sub(l),f=Bn(.5).mul(l.square()).add(A.mul(c));return kl(f,s,i)}}),Ul=gn({logLoss_:function(e,t,n,r,i){void 0===r&&(r=1e-7),void 0===i&&(i=bl.SUM_BY_NONZERO_WEIGHTS);var o=rn(e,"labels","logLoss"),a=rn(t,"predictions","logLoss"),s=null;null!=n&&(s=rn(n,"weights","logLoss")),T(o.shape,a.shape,"Error in logLoss: ");var A=Bn(1),u=Bn(r),l=o.mul(a.add(u).log()).neg().sub(A.sub(o).mul(A.sub(a).add(u).log()));return kl(l,s,i)}}),Ll=gn({meanSquaredError_:function(e,t,n,r){void 0===r&&(r=bl.SUM_BY_NONZERO_WEIGHTS);var i=rn(e,"labels","meanSquaredError"),o=rn(t,"predictions","meanSquaredError"),a=null;null!=n&&(a=rn(n,"weights","meanSquaredError")),T(i.shape,o.shape,"Error in meanSquaredError: ");var s=i.squaredDifference(o);return kl(s,a,r)}}),Ql=gn({sigmoidCrossEntropy_:function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=bl.SUM_BY_NONZERO_WEIGHTS);var o=rn(e,"multiClassLabels","sigmoidCrossEntropy"),a=rn(t,"logits","sigmoidCrossEntropy"),s=null;if(null!=n&&(s=rn(n,"weights","sigmoidCrossEntropy")),T(o.shape,a.shape,"Error in sigmoidCrossEntropy: "),r>0){var A=Bn(r),u=Bn(1),l=Bn(.5);o=o.mul(u.sub(A)).add(l.mul(A))}var c=function(e,t){var n=rn(e,"labels","sigmoidCrossEntropyWithLogits"),r=rn(t,"logits","sigmoidCrossEntropyWithLogits");T(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var i=r.relu(),o=r.mul(n),a=r.abs().neg().exp().log1p();return i.sub(o).add(a)}(o,a);return kl(c,s,i)}}),Dl=gn({softmaxCrossEntropy_:function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=bl.SUM_BY_NONZERO_WEIGHTS);var o=rn(e,"onehotLabels","softmaxCrossEntropy"),a=rn(t,"logits","softmaxCrossEntropy"),s=null;if(null!=n&&(s=rn(n,"weights","softmaxCrossEntropy")),T(o.shape,a.shape,"Error in softmaxCrossEntropy: "),r>0){var A=Bn(r),u=Bn(1),l=Bn(o.shape[1]);o=o.mul(u.sub(A)).add(A.div(l))}var c=function(e,t,n){if(void 0===n&&(n=-1),-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+t.rank+" and dim was "+n);return Hr(function(e,t,r){var i=t.logSumExp([n],!0),o=t.toFloat().sub(i);return r([e,o]),{value:o.mul(e).neg().sum([n]),gradFunc:function(e,t){var r=t[0],i=t[1],o=un(e.shape,[n]);return[e.reshape(o).mul(r.toFloat().sub(i.exp())),e.reshape(o).mul(i.exp().sub(r.toFloat()))]}}})(e,t)}(o,a);return kl(c,s,i)}}),Rl=Object.freeze({get Reduction(){return bl},absoluteDifference:Sl,computeWeightedLoss:kl,cosineDistance:_l,hingeLoss:Il,huberLoss:Nl,logLoss:Ul,meanSquaredError:Ll,sigmoidCrossEntropy:Ql,softmaxCrossEntropy:Dl});function Tl(e,t){return void 0===t&&(t=!1),Ve.tidy(function(){if(2!==e.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+e.shape.length+"D Tensor.");for(var n=e.shape[0],r=e.shape[1],i=or(n),o=e.clone(),a=Cn([[1]],[1,1]),s=a.clone(),A=n>=r?r:n,u=function(e){var t,A=o,u=s,l=i;t=Ve.tidy(function(){var t=o.slice([e,e],[n-e,1]),A=t.norm(),u=o.slice([e,e],[1,1]),l=Cn([[-1]]).where(u.greater(0),Cn([[1]])),c=u.sub(l.mul(A)),f=t.div(c);s=1===f.shape[0]?a.clone():a.concat(f.slice([1,0],[f.shape[0]-1,f.shape[1]]),0);var h=l.matMul(c).div(A).neg(),d=o.slice([e,0],[n-e,r]),p=h.mul(s);if(0===e)o=d.sub(p.matMul(s.transpose().matMul(d)));else{var g=d.sub(p.matMul(s.transpose().matMul(d)));o=o.slice([0,0],[e,r]).concat(g,0)}var m=i.slice([0,e],[n,i.shape[1]-e]);if(0===e)i=m.sub(m.matMul(s).matMul(p.transpose()));else{var v=m.sub(m.matMul(s).matMul(p.transpose()));i=i.slice([0,0],[n,e]).concat(v,1)}return[s,o,i]}),s=t[0],o=t[1],i=t[2],$t([A,u,l])},l=0;l<A;++l)u(l);return!t&&n>r&&(i=i.slice([0,0],[n,r]),o=o.slice([0,0],[r,r])),[i,o]})}var Pl=gn({bandPart_:function(e,t,n){if(t%1!=0)throw new Error("bandPart(): numLower must be an integer, got "+t+".");if(n%1!=0)throw new Error("bandPart(): numUpper must be an integer, got "+n+".");var r=rn(e,"a","bandPart");if(r.rank<2)throw new Error("bandPart(): Rank must be at least 2, got "+r.rank+".");var i=r.shape,o=r.shape.slice(-2),a=o[0],s=o[1];if(!(t<=a))throw new Error("bandPart(): numLower ("+t+") must not be greater than the number of rows ("+a+").");if(!(n<=s))throw new Error("bandPart(): numUpper ("+n+") must not be greater than the number of columns ("+s+").");t<0&&(t=a),n<0&&(n=s);var A=In(0,a,1,"int32").reshape([-1,1]),u=In(0,s,1,"int32"),l=MA(A,u),c=pA(l.lessEqual(Bn(+t,"int32")),l.greaterEqual(Bn(-n,"int32"))),f=kn([a,s],r.dtype);return yr(xr(r.reshape([-1,a,s])).map(function(e){return wA(c,e,f)})).reshape(i)}}),Ol=gn({gramSchmidt_:function(e){var t;if(Array.isArray(e)){t=!1,R(null!=e&&e.length>0,function(){return"Gram-Schmidt process: input must not be null, undefined, or empty"});for(var n=e[0].shape[0],r=function(t){R(e[t].shape[0]===n,function(){return"Gram-Schmidt: Non-unique lengths found in the input vectors: ("+e[t].shape[0]+" vs. "+n+")"})},i=1;i<e.length;++i)r(i)}else t=!0,e=Pn(e,e.shape[0],0).map(function(e){return wr(e,[0])});R(e.length<=e[0].shape[0],function(){return"Gram-Schmidt: Number of vectors ("+e.length+") exceeds number of dimensions ("+e[0].shape[0]+")."});var o=[],a=e,s=function(e){o.push(Ve.tidy(function(){var t=a[e];if(e>0)for(var n=0;n<e;++n){var r=qu(o[n].mulStrict(t)).mul(o[n]);t=t.sub(r)}return t.div(il(t,"euclidean"))}))};for(i=0;i<e.length;++i)s(i);return t?yr(o,0):o}}),Ml=gn({qr_:function(e,t){if(void 0===t&&(t=!1),e.rank<2)throw new Error("qr() requires input tensor to have a rank >= 2, but got rank "+e.rank);if(2===e.rank)return Tl(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),r=xr(e.reshape([n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),i=[],o=[];return r.forEach(function(e){var n=Tl(e,t),r=n[0],a=n[1];i.push(r),o.push(a)}),[yr(i,0).reshape(e.shape),yr(o,0).reshape(e.shape)]}}),Hl=Object.freeze({bandPart:Pl,gramSchmidt:Ol,qr:Ml});function jl(e,t,n,r,i,o){null==r&&(r=.5),null==i&&(i=Number.NEGATIVE_INFINITY),null==o&&(o=0);var a=e.shape[0];return n=Math.min(n,a),R(0<=r&&r<=1,function(){return"iouThreshold must be in [0, 1], but was '"+r+"'"}),R(2===e.rank,function(){return"boxes must be a 2D tensor, but was of rank '"+e.rank+"'"}),R(4===e.shape[1],function(){return"boxes must have 4 columns, but 2nd dimension was "+e.shape[1]}),R(1===t.rank,function(){return"scores must be a 1D tensor"}),R(t.shape[0]===a,function(){return"scores has incompatible shape with boxes. Expected "+a+", but was "+t.shape[0]}),R(0<=o&&o<=1,function(){return"softNmsSigma must be in [0, 1], but was '"+o+"'"}),{maxOutputSize:n,iouThreshold:r,scoreThreshold:i,softNmsSigma:o}}var zl=gn({resizeBilinear_:function(e,t,n){void 0===n&&(n=!1);var r=rn(e,"images","resizeBilinear");R(3===r.rank||4===r.rank,function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."}),R(2===t.length,function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+t+"."});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var a=t[0],s=t[1],A=Ve.runKernelFunc(function(e,t){return t([i]),e.resizeBilinear(i,a,s,n)},{x:i},function(e,t){return{x:function(){return Ve.runKernelFunc(function(r){return r.resizeBilinearBackprop(e,t[0],n)},{})}}},"ResizeBilinear",{alignCorners:n,newHeight:a,newWidth:s});return o?A.as3D(A.shape[1],A.shape[2],A.shape[3]):A}}),Kl=gn({resizeNearestNeighbor_:function(e,t,n){void 0===n&&(n=!1);var r=rn(e,"images","resizeNearestNeighbor");R(3===r.rank||4===r.rank,function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."}),R(2===t.length,function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+t+"."}),R("float32"===r.dtype||"int32"===r.dtype,function(){return"`images` must have `int32` or `float32` as dtype"});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var a=t[0],s=t[1],A=Ve.runKernelFunc(function(e,t){return t([i]),e.resizeNearestNeighbor(i,a,s,n)},{batchImages:i},function(e,t){return{batchImages:function(){return Ve.runKernelFunc(function(r){return r.resizeNearestNeighborBackprop(e,t[0],n)},{})}}});return o?A.as3D(A.shape[1],A.shape[2],A.shape[3]):A}}),Wl=gn({nonMaxSuppression_:function(e,t,n,r,i){void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY);var o=rn(e,"boxes","nonMaxSuppression"),a=rn(t,"scores","nonMaxSuppression"),s=jl(o,a,n,r,i);n=s.maxOutputSize,r=s.iouThreshold,i=s.scoreThreshold;var A={maxOutputSize:n,iouThreshold:r,scoreThreshold:i};return Ve.runKernelFunc(function(e){return e.nonMaxSuppression(o,a,n,r,i)},{boxes:o,scores:a},null,"NonMaxSuppressionV3",A)}}),Vl=gn({nonMaxSuppressionWithScore_:function(e,t,n,r,i,o){void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),void 0===o&&(o=0);var a=rn(e,"boxes","nonMaxSuppression"),s=rn(t,"scores","nonMaxSuppression"),A=jl(a,s,n,r,i,o),u={maxOutputSize:n=A.maxOutputSize,iouThreshold:r=A.iouThreshold,scoreThreshold:i=A.scoreThreshold,softNmsSigma:o=A.softNmsSigma},l=Ve.runKernel("NonMaxSuppressionV5",{boxes:a,scores:s},u);return{selectedIndices:l[0],selectedScores:l[1]}}}),Gl=gn({cropAndResize_:function(e,t,n,r,i,o){var a=rn(e,"image","cropAndResize"),s=rn(t,"boxes","cropAndResize","float32"),A=rn(n,"boxInd","cropAndResize","int32");i=i||"bilinear",o=o||0;var u=s.shape[0];return R(4===a.rank,function(){return"Error in cropAndResize: image must be rank 4,but got rank "+a.rank+"."}),R(2===s.rank&&4===s.shape[1],function(){return"Error in cropAndResize: boxes must be have size ["+u+",4] but had shape "+s.shape+"."}),R(1===A.rank&&A.shape[0]===u,function(){return"Error in cropAndResize: boxInd must be have size ["+u+"] but had shape "+s.shape+"."}),R(2===r.length,function(){return"Error in cropAndResize: cropSize must be of length 2, but got length "+r.length+"."}),R(r[0]>=1&&r[1]>=1,function(){return"cropSize must be atleast [1,1], but was "+r}),R("bilinear"===i||"nearest"===i,function(){return"method must be bilinear or nearest, but was "+i}),Ve.runKernelFunc(function(e,t){return e.cropAndResize(a,s,A,r,i,o)},{images:a,boxes:s,boxInd:A},null,"CropAndResize",{method:i,extrapolationValue:o,cropSize:r})}}),ql=Object.freeze({resizeBilinear:zl,resizeNearestNeighbor:Kl,nonMaxSuppression:Wl,nonMaxSuppressionAsync:function(e,t,n,r,i){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),y(this,void 0,void 0,function(){var o,a,s,A,u,l,c;return b(this,function(f){switch(f.label){case 0:return o=rn(e,"boxes","nonMaxSuppressionAsync"),a=rn(t,"scores","nonMaxSuppressionAsync"),s=jl(o,a,n,r,i),n=s.maxOutputSize,r=s.iouThreshold,i=s.scoreThreshold,[4,Promise.all([o.data(),a.data()])];case 1:return A=f.sent(),u=A[0],l=A[1],c=mi(u,l,n,r,i),o!==e&&o.dispose(),a!==t&&a.dispose(),[2,c]}})})},nonMaxSuppressionWithScore:Vl,nonMaxSuppressionWithScoreAsync:function(e,t,n,r,i,o){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),void 0===o&&(o=0),y(this,void 0,void 0,function(){var a,s,A,u,l,c,f;return b(this,function(h){switch(h.label){case 0:return a=rn(e,"boxes","nonMaxSuppressionAsync"),s=rn(t,"scores","nonMaxSuppressionAsync"),A=jl(a,s,n,r,i,o),n=A.maxOutputSize,r=A.iouThreshold,i=A.scoreThreshold,o=A.softNmsSigma,[4,Promise.all([a.data(),s.data()])];case 1:return u=h.sent(),l=u[0],c=u[1],f=vi(l,c,n,r,i,o),a!==e&&a.dispose(),s!==t&&s.dispose(),[2,f]}})})},cropAndResize:Gl}),Xl=function(e,t){return!(e>0)||"linear"===t},Yl=function(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return e.mul(t.step());throw new Error("Gradient for activation "+n+" has not been implemented yet.")},Jl=function(e,t){var n=t,r=qr(e.shape,t.shape);return r.length>0&&(n=n.sum(r)),n.reshape(e.shape)},Zl=function(e,t,n){if("linear"===t)return e;if("relu"===t)return $u(e);if("elu"===t)return Yu(e);if("relu6"===t)return el(e);if("prelu"===t)return Zu(e,n);throw new Error("Unknown fused activation "+t+".")},$l=gn({fusedMatMul_:function(e){var t,n=e.a,r=e.b,i=e.transposeA,o=void 0!==i&&i,a=e.transposeB,s=void 0!==a&&a,A=e.bias,u=e.activation,l=void 0===u?"linear":u,c=e.preluActivationWeights;if(!1===Xl(Ve.state.gradientDepth,l)){var f=vu(n,r,o,s);return null!=A&&(f=bA(f,A)),Zl(f,l,c)}var h=rn(n,"a","fused matMul"),d=rn(r,"b","fused matMul");t=Me(h,d),h=t[0],d=t[1];var p=o?h.shape[h.rank-2]:h.shape[h.rank-1],g=s?d.shape[d.rank-1]:d.shape[d.rank-2],m=o?h.shape[h.rank-1]:h.shape[h.rank-2],v=s?d.shape[d.rank-2]:d.shape[d.rank-1],w=h.shape.slice(0,-2),y=d.shape.slice(0,-2),b=M(w),B=M(y);R(h.rank>=2&&d.rank>=2&&h.rank===d.rank,function(){return"Error in fused matMul: inputs must have the same rank of at least 2, got ranks "+h.rank+" and "+d.rank+"."}),R(H(w,y),function(){return"Error in fused matMul: outer dimensions ("+w+") and ("+y+") of Tensors with shapes "+h.shape+" and "+d.shape+" must match."}),R(p===g,function(){return"Error in fused matMul: inner shapes ("+p+") and ("+g+") of Tensors with shapes "+h.shape+" and "+d.shape+" and transposeA="+o+" and transposeB="+s+" must match."});var x,C,F=h.shape.slice(0,-2).concat([m,v]),E=o?h.as3D(b,p,m):h.as3D(b,m,p),S=s?d.as3D(B,v,g):d.as3D(B,g,v);null!=A&&Xr(F,(x=Me(x=rn(A,"bias","fused matMul"),h)[0]).shape),null!=c&&(C=rn(c,"prelu weights","fused matMul"));var k={a:E,b:S};null!=A&&(k.bias=x),null!=c&&(k.preluActivationWeights=C);var _=[E,S];return Ve.runKernelFunc(function(e,t){var n=e.fusedBatchMatMul({a:E,b:S,transposeA:o,transposeB:s,bias:x,activation:l,preluActivationWeights:C});return t([E,S,n]),n},k,function(e,t){var n=t[0],r=t[1],i=t[2],a=Yl(e,i,l),u={};return null!=A&&(u={bias:function(){return Jl(x,a)}}),o||s?!o&&s?Object.assign({a:function(){return a.matMul(r,!1,!1)},b:function(){return a.matMul(n,!0,!1)}},u):o&&!s?Object.assign({a:function(){return r.matMul(a,!1,!0)},b:function(){return n.matMul(a,!1,!1)}},u):Object.assign({a:function(){return r.matMul(a,!0,!0)},b:function(){return a.matMul(n,!0,!0)}},u):Object.assign({a:function(){return a.matMul(r,!1,!0)},b:function(){return n.matMul(a,!0,!1)}},u)},"_FusedMatMul",{transposeA:o,transposeB:s,activation:l},_,[!0]).reshape(F)}}),ec=gn({fusedConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,i=e.pad,o=e.dataFormat,a=void 0===o?"NHWC":o,s=e.dilations,A=void 0===s?[1,1]:s,u=e.dimRoundingMode,l=e.bias,c=e.activation,f=void 0===c?"linear":c,h=e.preluActivationWeights;if(f=f||"linear",!1===Xl(Ve.state.gradientDepth,f)){var d=Au(t,n,r,i,a,A,u);return null!=l&&(d=bA(d,l)),Zl(d,f,h)}var p=rn(t,"x","conv2d"),g=rn(n,"filter","conv2d"),m=p,v=!1;3===p.rank&&(v=!0,m=p.as4D(1,p.shape[0],p.shape[1],p.shape[2])),R(4===m.rank,function(){return"Error in fused conv2d: input must be rank 4, but got rank "+m.rank+"."}),R(4===g.rank,function(){return"Error in fused conv2d: filter must be rank 4, but got rank "+g.rank+"."}),null!=u&&R(j(i),function(){return"Error in fused conv2d: pad must be an integer when using, dimRoundingMode "+u+" but got pad "+i+"."}),R(m.shape[3]===g.shape[2],function(){return"Error in conv2d: depth of input ("+m.shape[3]+") must match input depth for filter "+g.shape[2]+"."}),R(ai(r,A),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+A+"'"}),R("NHWC"===a,function(){return"Error in conv2d: got dataFormat of "+a+" but only NHWC is currently supported."});var w,y,b=Zr(m.shape,g.shape,r,A,i,u);null!=l&&(w=Me(w=rn(l,"bias","fused conv2d"),p)[0],Xr(b.outShape,w.shape)),null!=h&&(y=rn(h,"prelu weights","fused conv2d"));var B={x:m,filter:g};null!=l&&(B.bias=w),null!=h&&(B.preluActivationWeights=y);var x=[g,m],C=Ve.runKernelFunc(function(e,t){var n=e.fusedConv2d({input:m,filter:g,convInfo:b,bias:w,activation:f,preluActivationWeights:y});return t([g,m,n]),n},B,function(e,t){var n=t,o=n[0],a=n[1],s=n[2],u=Yl(e,s,f);R(oi(A),function(){return"Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+A+"'"});var c={};return null!=l&&(c={bias:function(){return Jl(w,u)}}),Object.assign({x:function(){return cu(a.shape,u,o,r,i)},filter:function(){return lu(a,u,o.shape,r,i)}},c)},"FusedConv2D",{convInfo:b,activation:f},x,[!0]);return v?C.as3D(C.shape[1],C.shape[2],C.shape[3]):C}}),tc=gn({fusedDepthwiseConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,i=e.pad,o=e.dataFormat,a=void 0===o?"NHWC":o,s=e.dilations,A=void 0===s?[1,1]:s,u=e.dimRoundingMode,l=e.bias,c=e.activation,f=void 0===c?"linear":c,h=e.preluActivationWeights;if(!1===Xl(Ve.state.gradientDepth,f)){var d=fu(t,n,r,i,a,A,u);return null!=l&&(d=bA(d,l)),Zl(d,f,h)}var p=rn(t,"x","depthwiseConv2d"),g=rn(n,"filter","depthwiseConv2d"),m=p,v=!1;3===p.rank&&(v=!0,m=p.as4D(1,p.shape[0],p.shape[1],p.shape[2])),R(4===m.rank,function(){return"Error in fused depthwiseConv2d: input must be rank 4, but got rank "+m.rank+"."}),R(4===g.rank,function(){return"Error in fused depthwiseConv2d: filter must be rank 4, but got rank "+g.rank+"."}),R(m.shape[3]===g.shape[2],function(){return"Error in fused depthwiseConv2d: number of input channels ("+m.shape[3]+") must match the inChannels dimension in filter "+g.shape[2]+"."}),null==A&&(A=[1,1]),R(ai(r,A),function(){return"Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+A+"'"}),null!=u&&R(j(i),function(){return"Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode "+u+" but got pad "+i+"."});var w,y,b=Zr(m.shape,g.shape,r,A,i,u,!0);null!=l&&(w=Me(w=rn(l,"bias","fused conv2d"),p)[0],Xr(b.outShape,w.shape)),null!=h&&(y=rn(h,"prelu weights","fused depthwiseConv2d"));var B={x:m,filter:g};null!=l&&(B.bias=w),null!=h&&(B.preluActivationWeights=y);var x=[g,m],C=Ve.runKernelFunc(function(e,t){var n=e.fusedDepthwiseConv2D({input:m,filter:g,convInfo:b,bias:w,activation:f,preluActivationWeights:y});return t([g,m,n]),n},B,function(e,t){R(oi(A),function(){return"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+A+"'"});var n=t[0],r=t[1],i=t[2],o=Yl(e,i,f),a={};return null!=l&&(a={bias:function(){return Jl(w,o)}}),Object.assign({x:function(){return hu(r.shape,o,n,b)},filter:function(){return du(r,o,n.shape,b)}},a)},"FusedDepthwiseConv2D",{convInfo:b,activation:f},x,[!0]);return v?C.as3D(C.shape[1],C.shape[2],C.shape[3]):C}}),nc=Object.freeze({matMul:$l,conv2d:ec,depthwiseConv2d:tc}),rc=Object.freeze({image:ql,linalg:Hl,losses:Rl,spectral:pl,fused:nc,signal:El,square:vs,squaredDifference:ys,conv1d:su,conv2d:Au,conv3d:uu,depthwiseConv2d:fu,separableConv2d:pu,conv2dTranspose:gu,conv3dTranspose:mu,op:gn,batchNormalization2d:sA,batchNormalization3d:AA,batchNormalization4d:uA,batchNormalization:lA,batchNorm:cA,batchNorm2d:fA,batchNorm3d:hA,batchNorm4d:dA,booleanMaskAsync:function(e,t,n){return y(this,void 0,void 0,function(){var r,i,o,a,s,A,u,l,c,f,h,d,p;return b(this,function(g){switch(g.label){case 0:for(r=rn(e,"tensor","boolMask"),i=rn(t,"mask","boolMask","bool"),o=null==n?0:n,a=i.rank,s=r.shape,R(a>0,function(){return"mask cannot be scalar"}),T(s.slice(o,o+a),i.shape,"mask's shape must match the first K dimensions of tensor's shape,"),A=1,u=o;u<o+a;u++)A*=s[u];return l=s.slice(0,o).concat([A],s.slice(o+a)),c=r.reshape(l),f=i.reshape([-1]),[4,yA(f)];case 1:return h=g.sent(),d=h.squeeze([1]),p=nu(c,d,o),e!==r&&r.dispose(),t!==i&&i.dispose(),d.dispose(),c.dispose(),f.dispose(),h.dispose(),[2,p]}})})},complex:mn,real:vn,imag:wn,concat:Ln,concat1d:Qn,concat2d:Dn,concat3d:Rn,concat4d:Tn,split:Pn,matMul:vu,dot:wu,outerProduct:yu,reverse:bu,reverse1d:Bu,reverse2d:xu,reverse3d:Cu,reverse4d:Fu,maxPool:ku,avgPool:_u,pool:Iu,maxPool3d:Nu,avgPool3d:Uu,slice:Lu,slice1d:Qu,slice2d:Du,slice3d:Ru,slice4d:Tu,abs:bs,acos:Bs,acosh:xs,asin:Cs,asinh:Fs,atan:Es,atanh:Ss,ceil:ks,clipByValue:_s,cos:Is,cosh:Ns,erf:Us,exp:Ls,expm1:Qs,floor:Ds,log:Rs,log1p:Ts,logSigmoid:Ps,neg:Os,reciprocal:Ms,round:Hs,rsqrt:js,sigmoid:zs,sign:Ks,isNaN:Ws,isInf:Vs,isFinite:Gs,sin:qs,sinh:Xs,softplus:Ys,sqrt:Js,step:Zs,tan:$s,tanh:eA,all:Ou,any:Mu,argMax:Hu,argMin:ju,logSumExp:zu,max:Ku,mean:Wu,min:Vu,moments:Gu,sum:qu,prod:Xu,equal:jA,equalStrict:zA,greater:KA,greaterEqual:WA,greaterEqualStrict:VA,greaterStrict:GA,less:qA,lessEqual:XA,lessEqualStrict:YA,lessStrict:JA,notEqual:ZA,notEqualStrict:$A,add:bA,addN:BA,addStrict:xA,atan2:CA,div:FA,divNoNan:EA,divStrict:SA,floorDiv:kA,maximum:_A,maximumStrict:IA,minimum:NA,minimumStrict:UA,mod:LA,modStrict:QA,mul:DA,mulStrict:RA,pow:TA,powStrict:PA,squaredDifferenceStrict:OA,sub:MA,subStrict:HA,elu:Yu,leakyRelu:Ju,prelu:Zu,relu:$u,relu6:el,selu:tl,logicalAnd:pA,logicalNot:gA,logicalOr:mA,logicalXor:vA,where:wA,whereAsync:yA,buffer:Jn,print:function(e,t){void 0===t&&(t=!1),console.log(e.toString(t))},batchToSpaceND:Zn,broadcastTo:$n,cast:er,clone:tr,cumsum:nr,depthToSpace:rr,expandDims:ir,eye:or,multinomial:ar,oneHot:sr,pad:Ar,pad1d:ur,pad2d:lr,pad3d:cr,pad4d:fr,rand:hr,randomNormal:dr,randomGamma:pr,randomUniform:gr,reshape:mr,spaceToBatchND:vr,squeeze:wr,stack:yr,tile:br,truncatedNormal:Br,unstack:xr,setdiff1dAsync:function(e,t){return y(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l,c;return b(this,function(f){switch(f.label){case 0:return n=rn(e,"x","setdiff1d"),r=rn(t,"y","setdiff1d"),R(n.dtype===r.dtype,function(){return"x and y should have the same dtype, but got x ("+n.dtype+") and y ("+r.dtype+")."}),R(1===n.rank,function(){return"x should be 1D tensor, but got x ("+n.shape+")."}),R(1===r.rank,function(){return"y should be 1D tensor, but got y ("+r.shape+")."}),[4,n.data()];case 1:return i=f.sent(),[4,r.data()];case 2:for(o=f.sent(),a=new Set(o),s=0,l=0;l<i.length;l++)a.has(i[l])||s++;for(A=new Ee([s],n.dtype),u=new Ee([s],"int32"),l=0,c=0;l<i.length;l++)a.has(i[l])||(A.values[c]=i[l],u.values[c]=l,c++);return[2,[A.toTensor(),u.toTensor()]]}})})},fill:_n,linspace:function(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");return Ve.runKernelFunc(function(r){return r.linspace(e,t,n)},{})},ones:Sn,range:In,scalar:Bn,tensor:yn,tensor1d:xn,tensor2d:Cn,tensor3d:Fn,tensor4d:En,tensor5d:function(e,t,n){if(P(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");var r=tn(e,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return bn(e,t,r,n)},tensor6d:function(e,t,n){if(P(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");var r=tn(e,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return bn(e,t=t||r,r,n)},variable:function(e,t,n,r){return void 0===t&&(t=!0),Ve.makeVariable(e,t,n,r)},zeros:kn,onesLike:Nn,zerosLike:Un,transpose:nl,softmax:jr,logSoftmax:zr,localResponseNormalization:rl,norm:il,gather:nu,unsortedSegmentSum:ru,basicLSTMCell:ol,multiRNNCell:al,movingAverage:sl,stridedSlice:Al,topk:ul,scatterND:ll,fft:cl,ifft:fl,rfft:hl,irfft:dl,sparseToDense:gl,gatherND:ml,diag:vl,dropout:wl,hannWindow:Bl,hammingWindow:xl,frame:Cl,stft:Fl,inTopKAsync:function(e,t,n){return void 0===n&&(n=1),y(this,void 0,void 0,function(){var r,i,o,a,s,A,u,l,c,f,h,d,p,g;return b(this,function(m){switch(m.label){case 0:return r=rn(e,"predictions","inTopK"),i=rn(t,"targets","inTopK"),R(r.rank>1,function(){return"inTopK() expects the predictions to be of rank 2 or higher, but got "+r.rank}),R(r.rank-1===i.rank,function(){return"predictions rank should be 1 larger than targets rank, but got predictions rank "+r.rank+" and targets rank "+i.rank}),T(r.shape.slice(0,r.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension."),o=r.shape[r.shape.length-1],R(n>0&&n<=o,function(){return"'k' passed to inTopK() must be > 0 && <= the predictions last dimension ("+o+"), but got "+n}),[4,r.data()];case 1:return a=m.sent(),[4,i.data()];case 2:for(s=m.sent(),A=[a.length/o,o],l=A[1],c=Y("bool",u=A[0]),f=0;f<u;f++){for(h=f*l,d=a.subarray(h,h+l),p=[],g=0;g<d.length;g++)p.push({value:d[g],index:g});for(p.sort(function(e,t){return t.value-e.value}),c[f]=0,g=0;g<n;g++)if(p[g].index===s[f]){c[f]=1;break}}return e!==r&&r.dispose(),t!==i&&i.dispose(),[2,yn(c,i.shape,"bool")]}})})}});function ic(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){null!=e&&R("complex64"!==e.dtype,function(){return t+" does not support complex64 tensors."})})}function oc(e,t,n,r){if("linear"===n)return e.linear(t);if("relu"===n)return e.relu(t);if("elu"===n)return e.elu(t);if("relu6"===n)return e.relu6(t);if("prelu"===n)return e.prelu(t,r);throw new Error("Activation "+n+" has not been implemented for the CPU backend.")}var ac=function(e){function t(){var t=e.call(this)||this;return t.blockSize=48,t.firstUse=!0,t.data=new Kr(t,Ve),t}return w(t,e),t.prototype.write=function(e,t,n){this.firstUse&&(this.firstUse=!1,x().get("IS_NODE")&&en("\n============================\nHi there \ud83d\udc4b. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"));var r={};return this.data.set(r,{values:e,dtype:n}),r},t.prototype.move=function(e,t,n,r){this.data.set(e,{values:t,dtype:r})},t.prototype.numDataIds=function(){return this.data.numDataIds()},t.prototype.read=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){return[2,this.readSync(e)]})})},t.prototype.readSync=function(e){var t=this.data.get(e),n=t.dtype,r=t.complexTensors;return"complex64"===n?ci(this.readSync(r.real.dataId),this.readSync(r.imag.dataId)):this.data.get(e).values},t.prototype.bufferSync=function(e){var t=this.readSync(e.dataId),n=t;if("string"===e.dtype)try{n=t.map(function(e){return ve(e)})}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Jn(e.shape,e.dtype,n)},t.prototype.makeOutput=function(e,t,n){var r=this.write(e,t,n);return Ve.makeTensorFromDataId(r,t,n,this)},t.prototype.disposeData=function(e){if(this.data.has(e)){var t=this.data.get(e).complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.data.delete(e)}},t.prototype.time=function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){return t=pe(),e(),[2,{kernelMs:pe()-t}]})})},t.prototype.memory=function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}},t.prototype.complex=function(e,t){var n=this.makeOutput(null,e.shape,"complex64");return this.data.get(n.dataId).complexTensors={real:Ve.keep(e.clone()),imag:Ve.keep(t.clone())},n},t.prototype.real=function(e){return this.data.get(e.dataId).complexTensors.real.clone()},t.prototype.imag=function(e){return this.data.get(e.dataId).complexTensors.imag.clone()},t.prototype.slice=function(e,t,n){if(ic(e,"slice"),Or(e.shape,t,n)){var r=Mr(t,e.strides),i=M(n);return yn(this.readSync(e.dataId).subarray(r,r+i),n,e.dtype)}for(var o=Jn(n,e.dtype),a=this.bufferSync(e),s=0;s<o.size;++s){var A=o.indexToLoc(s).map(function(e,n){return e+t[n]});o.values[s]=a.get.apply(a,A)}return o.toTensor()},t.prototype.stridedSlice=function(e,t,n,r){ic(e,"stridedSlice");var i=Rr(t,n,r);if(i.some(function(e){return 0===e}))return yn([],i);for(var o=Jn(i,e.dtype),a=this.bufferSync(e),s=0;s<o.size;s++){for(var A=o.indexToLoc(s),u=new Array(A.length),l=0;l<u.length;l++)u[l]=A[l]*r[l]+t[l];o.set.apply(o,[a.get.apply(a,u)].concat(A))}return o.toTensor()},t.prototype.diag=function(e){for(var t=this.readSync(e.dataId),n=Jn([e.size,e.size],e.dtype),r=n.values,i=0;i<t.length;i++)r[i*e.size+i]=t[i];return n.toTensor()},t.prototype.unstack=function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),i=0,o=0;o<e.rank;o++)o!==t&&(r[i++]=e.shape[o]);var a=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;var A=new Array(n);for(o=0;o<A.length;o++)a[t]=o,A[o]=this.slice(e,a,s).reshape(r);return A},t.prototype.reverse=function(e,t){ic(e,"reverse");for(var n=Jn(e.shape,e.dtype),r=this.bufferSync(e),i=function(i){var o=n.indexToLoc(i),a=o.slice();t.forEach(function(t){return a[t]=e.shape[t]-1-a[t]}),n.set.apply(n,[r.get.apply(r,a)].concat(o))},o=0;o<n.size;o++)i(o);return n.toTensor()},t.prototype.concat=function(e,t){var n=this;if("complex64"===e[0].dtype){var r=e.map(function(e){return vn(e)}),i=e.map(function(e){return wn(e)});return mn(this.concat(r,t),this.concat(i,t))}var o=e.map(function(e){var n=M(e.shape.slice(t));return e.as2D(-1,n)}),a=pn(o.map(function(e){return e.shape}),1),s=Jn(a,e[0].dtype).values;if(1===o[0].shape[0]){var A=0;o.forEach(function(e){s.set(n.readSync(e.dataId),A),A+=e.size})}else{var u=0;o.forEach(function(e){for(var t=n.readSync(e.dataId),r=0,i=0;i<e.shape[0];++i)for(var o=i*a[1]+u,A=0;A<e.shape[1];++A)s[o+A]=t[r++];u+=e.shape[1]})}var l=pn(e.map(function(e){return e.shape}),t);return yn(s,l,e[0].dtype)},t.prototype.neg=function(e){return ic(e,"neg"),this.multiply(Bn(-1),e)},t.prototype.add=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e+n,imag:t+r}}):this.broadcastedBinaryOp(e,t,Pe(e.dtype,t.dtype),function(e,t){return e+t})},t.prototype.addN=function(e){var t=this;ic(e,"addN");for(var n=e.map(function(e){return t.readSync(e.dataId)}),r=Jn(e[0].shape,e[0].dtype),i=r.values,o=0;o<e.length;o++)for(var a=n[o],s=0;s<i.length;s++)i[s]+=a[s];return r.toTensor()},t.prototype.softmax=function(e,t){var n=q([t],e.shape),r=this.max(e,n),i=un(r.shape,n),o=this.subtract(e,r.reshape(i)),a=this.exp(o),s=this.sum(a,n).reshape(i);return this.realDivide(a,s)},t.prototype.subtract=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e-n,imag:t-r}}):this.broadcastedBinaryOp(e,t,Pe(e.dtype,t.dtype),function(e,t){return e-t})},t.prototype.pow=function(e,t){return ic([e,t],"pow"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.pow(e,t)})},t.prototype.batchMatMul=function(e,t,n,r){ic([e,t],"matMul");for(var i=n?e.shape[1]:e.shape[2],o=n?e.shape[2]:e.shape[1],a=r?t.shape[1]:t.shape[2],s=e.shape[0],A=this.readSync(e.dataId),u=this.readSync(t.dataId),l=n?[e.strides[0],1,e.strides[1]]:[e.strides[0],e.strides[1],1],c=l[0],f=l[1],h=l[2],d=r?[1,t.strides[1],t.strides[0]]:[t.strides[1],1,t.strides[0]],p=d[0],g=d[1],m=d[2],v=o*a,w=Jn([s,o,a],e.dtype),y=w.values,b=this.blockSize,B=0;B<s;B++)for(var x=0;x<o;x+=b)for(var C=0;C<a;C+=b)for(var F=0;F<i;F+=b)for(var E=Math.min(x+b,o),S=Math.min(C+b,a),k=Math.min(F+b,i),_=x;_<E;_++)for(var I=C;I<S;I++){for(var N=0,U=F;U<k;U++)N+=A[B*c+_*f+U*h]*u[U*p+I*g+B*m];y[B*v+(_*a+I)]+=N}return w.toTensor()},t.prototype.fusedBatchMatMul=function(e){var t=e.a,n=e.b,r=e.transposeA,i=e.transposeB,o=e.bias,a=e.activation,s=e.preluActivationWeights,A=this.batchMatMul(t,n,r,i);return o&&(A=this.add(A,o)),a&&(A=oc(this,A,a,s)),A},t.prototype.multiply=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e*n-t*r,imag:e*r+t*n}}):this.broadcastedBinaryOp(e,t,Pe(e.dtype,t.dtype),function(e,t){return e*t})},t.prototype.realDivide=function(e,t){return ic([e,t],"realDivide"),this.broadcastedBinaryOp(e,t,"float32",function(e,t){return e/t})},t.prototype.floorDiv=function(e,t){return ic([e,t],"floorDiv"),this.broadcastedBinaryOp(e,t,"int32",function(e,t){return Math.floor(e/t)})},t.prototype.sum=function(e,t){ic(e,"sum"),ln("sum",t,e.rank);for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,Pe(e.dtype,"int32")),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=0,f=0;f<a;++f)c+=A[l+f];s[u]=c}return o},t.prototype.prod=function(e,t){ic(e,"sum");for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,Pe(e.dtype,"int32")),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=1,f=0;f<a;++f)c*=A[l+f];s[u]=c}return o},t.prototype.unsortedSegmentSum=function(e,t,n){ic(e,"unsortedSegmentSum");for(var r=[],i=e.rank-t.rank,o=0;o<i;++o)t=t.expandDims(o+1);for(o=0;o<n;++o){var a=Bn(o,"int32"),s=jA(a,t).asType("float32").mul(e).sum(0);r.push(s)}return yr(r)},t.prototype.argMin=function(e,t){ic(e,"argMin");var n=[t];ln("argMin",n,e.rank);for(var r=An(e.shape,n),i=r[0],o=r[1],a=kn(i,"int32"),s=M(o),A=this.readSync(a.dataId),u=this.readSync(e.dataId),l=0;l<A.length;++l){for(var c=l*s,f=u[c],h=0,d=0;d<s;++d){var p=u[c+d];p<f&&(f=p,h=d)}A[l]=h}return a},t.prototype.argMax=function(e,t){ic(e,"argMax");var n=[t];ln("argMax",n,e.rank);for(var r=An(e.shape,n),i=r[0],o=r[1],a=kn(i,"int32"),s=M(o),A=this.readSync(a.dataId),u=this.readSync(e.dataId),l=0;l<A.length;++l){for(var c=l*s,f=u[c],h=0,d=0;d<s;++d){var p=u[c+d];p>f&&(f=p,h=d)}A[l]=h}return a},t.prototype.cumsum=function(e,t,n,r){if(ic(e,"cumsum"),t!==e.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(e.rank-1)+" but got axis="+t);for(var i=Pe(e.dtype,"int32"),o=kn(e.shape,i),a=this.readSync(o.dataId),s=this.readSync(e.dataId),A=e.shape[e.rank-1],u=r?function(e,t){return e+A-t-1}:function(e,t){return e+t},l=0;l<s.length;l+=A)for(var c=0;c<A;c++){var f=u(l,c);if(0===c)a[f]=n?0:s[f];else{var h=u(l,c-1);a[f]=n?s[h]+a[h]:s[f]+a[h]}}return o},t.prototype.equal=function(e,t){return ic([e,t],"equal"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e===t?1:0})},t.prototype.notEqual=function(e,t){return ic([e,t],"notEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e!==t?1:0})},t.prototype.less=function(e,t){return ic([e,t],"less"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e<t?1:0})},t.prototype.lessEqual=function(e,t){return ic([e,t],"lessEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e<=t?1:0})},t.prototype.greater=function(e,t){return ic([e,t],"greater"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>t?1:0})},t.prototype.greaterEqual=function(e,t){return ic([e,t],"greaterEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>=t?1:0})},t.prototype.logicalNot=function(e){ic(e,"logicalNot");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t[r]?0:1;return this.makeOutput(n,e.shape,"bool")},t.prototype.logicalAnd=function(e,t){return ic([e,t],"logicalAnd"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e&&t})},t.prototype.logicalOr=function(e,t){return ic([e,t],"logicalOr"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e||t})},t.prototype.select=function(e,t,n){ic([e,t,n],"select");for(var r=this.readSync(e.dataId),i=this.readSync(t.dataId),o=this.readSync(n.dataId),a=kn(t.shape,Pe(t.dtype,n.dtype)),s=this.readSync(a.dataId),A=0,u=0===e.rank||e.rank>1||1===t.rank?1:M(t.shape.slice(1)),l=0;l<r.length;l++)for(var c=0;c<u;c++)1===r[l]?s[A++]=i[l]:s[A++]=o[l];return a},t.prototype.where=function(e){ic([e],"where");var t=this.readSync(e.dataId);return Ei(e.shape,t)},t.prototype.topk=function(e,t,n){return ic(e,"topk"),Fi(this.readSync(e.dataId),e.shape,e.dtype,t)},t.prototype.min=function(e,t){ic(e,"min"),ln("min",t,e.rank);for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,e.dtype),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=A[l],f=0;f<a;++f){var h=A[l+f];h<c&&(c=h)}s[u]=c}return o},t.prototype.minimum=function(e,t){return ic([e,t],"minimum"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.min(e,t)})},t.prototype.mod=function(e,t){return ic([e,t],"mod"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){var n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})},t.prototype.max=function(e,t){ic(e,"max"),ln("max",t,e.rank);for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,e.dtype),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=A[l],f=0;f<a;++f){var h=A[l+f];h>c&&(c=h)}s[u]=c}return o},t.prototype.maximum=function(e,t){return ic([e,t],"maximum"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},t.prototype.all=function(e,t){ic(e,"all"),ln("all",t,e.rank);for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,e.dtype),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=A[l],f=0;f<a;++f){var h=A[l+f];c=c&&h}s[u]=c}return o},t.prototype.any=function(e,t){ic(e,"any"),ln("any",t,e.rank);for(var n=An(e.shape,t),r=n[0],i=n[1],o=kn(r,e.dtype),a=M(i),s=this.readSync(o.dataId),A=this.readSync(e.dataId),u=0;u<s.length;++u){for(var l=u*a,c=A[l],f=0;f<a;++f){var h=A[l+f];c=c||h}s[u]=c}return o},t.prototype.squaredDifference=function(e,t){return ic([e,t],"squaredDifference"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){var n=e-t;return n*n})},t.prototype.ceil=function(e){ic(e,"ceil");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.ceil(t[r]);return this.makeOutput(n,e.shape,"float32")},t.prototype.floor=function(e){ic(e,"floor");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.floor(t[r]);return this.makeOutput(n,e.shape,"float32")},t.prototype.sign=function(e){ic(e,"x");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)t[r]<0?n[r]=-1:t[r]>0?n[r]=1:n[r]=0;return this.makeOutput(n,e.shape,"float32")},t.prototype.isNaN=function(e){ic(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isNaN(t[r])&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")},t.prototype.isInf=function(e){ic(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Math.abs(t[r])===1/0&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")},t.prototype.isFinite=function(e){ic(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isFinite(t[r])&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")},t.prototype.round=function(e){ic(e,"round");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=Math.floor(t[r]);t[r]-i<.5?n[r]=Math.floor(t[r]):t[r]-i>.5?n[r]=Math.ceil(t[r]):n[r]=i%2==0?i:i+1}return this.makeOutput(n,e.shape,"float32")},t.prototype.exp=function(e){ic(e,"exp");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.exp(t[r]);return this.makeOutput(n,e.shape,"float32")},t.prototype.expm1=function(e){ic(e,"expm1");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.expm1(t[r]);return this.makeOutput(n,e.shape,"float32")},t.prototype.log=function(e){ic(e,"log");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.log(i)}return this.makeOutput(n,e.shape,"float32")},t.prototype.log1p=function(e){ic(e,"log1p");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.log1p(i)}return this.makeOutput(n,e.shape,"float32")},t.prototype.sqrt=function(e){ic(e,"sqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.sqrt(i)}return this.makeOutput(n,e.shape,"float32")},t.prototype.rsqrt=function(e){ic(e,"rsqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=1/Math.sqrt(i)}return this.makeOutput(n,e.shape,"float32")},t.prototype.reciprocal=function(e){ic(e,"reciprocal");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=1/t[r];return this.makeOutput(n,e.shape,"float32")},t.prototype.linear=function(e){return e},t.prototype.relu=function(e){ic(e,"relu");for(var t=kn(e.shape,e.dtype),n=this.readSync(t.dataId),r=this.readSync(e.dataId),i=0;i<r.length;++i)n[i]=Math.max(0,r[i]);return t},t.prototype.relu6=function(e){ic(e,"relu");for(var t=kn(e.shape,e.dtype),n=this.readSync(t.dataId),r=this.readSync(e.dataId),i=0;i<r.length;++i)n[i]=Math.min(Math.max(0,r[i]),6);return t},t.prototype.prelu=function(e,t){return ic([e,t],"prelu"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return e<0?t*e:e})},t.prototype.elu=function(e){ic(e,"elu");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var i=n[r];t[r]=i>=0?i:Math.exp(i)-1}return this.makeOutput(t,e.shape,"float32")},t.prototype.eluDer=function(e,t){ic([e,t],"eluDer");for(var n=new Float32Array(t.size),r=this.readSync(t.dataId),i=this.readSync(e.dataId),o=0;o<r.length;++o){var a=r[o];n[o]=a>=1?i[o]:i[o]*(a+1)}return this.makeOutput(n,t.shape,"float32")},t.prototype.selu=function(e){ic(e,"selu");for(var t=Ha,n=ja,r=new Float32Array(e.size),i=this.readSync(e.dataId),o=0;o<i.length;++o){var a=i[o];r[o]=a>=0?n*a:t*(Math.exp(a)-1)}return this.makeOutput(r,e.shape,"float32")},t.prototype.clip=function(e,t,n){ic(e,"clip");for(var r=new Float32Array(e.size),i=this.readSync(e.dataId),o=0;o<i.length;++o){var a=i[o];r[o]=a>n?n:a<t?t:a}return this.makeOutput(r,e.shape,"float32")},t.prototype.abs=function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.abs(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.complexAbs=function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<e.size;++r){var i=n[2*r],o=n[2*r+1];t[r]=Math.hypot(i,o)}return this.makeOutput(t,e.shape,"float32")},t.prototype.int=function(e){ic(e,"int");for(var t=new Int32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=n[r];return this.makeOutput(t,e.shape,"int32")},t.prototype.sigmoid=function(e){ic(e,"sigmoid");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=1/(1+Math.exp(-n[r]));return this.makeOutput(t,e.shape,"float32")},t.prototype.softplus=function(e){ic(e,"softplus");for(var t=Math.log(1.1920928955078125e-7)+2,n=new Float32Array(e.size),r=this.readSync(e.dataId),i=0;i<r.length;++i){var o,a=r[i]>-t,s=r[i]<t,A=Math.exp(r[i]);o=s?A:a?r[i]:Math.log(1+A),n[i]=o}return this.makeOutput(n,e.shape,"float32")},t.prototype.sin=function(e){ic(e,"sin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sin(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.cos=function(e){ic(e,"cos");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.cos(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.tan=function(e){ic(e,"tan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.tan(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.asin=function(e){ic(e,"asin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asin(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.acos=function(e){ic(e,"acos");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acos(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.atan=function(e){ic(e,"atan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atan(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.atan2=function(e,t){return ic([e,t],"atan2"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.atan2(e,t)})},t.prototype.sinh=function(e){ic(e,"sinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sinh(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.cosh=function(e){ic(e,"cosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.cosh(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.tanh=function(e){ic(e,"tanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=z(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.asinh=function(e){ic(e,"asinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asinh(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.acosh=function(e){ic(e,"acosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acosh(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.atanh=function(e){ic(e,"atanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atanh(n[r]);return this.makeOutput(t,e.shape,"float32")},t.prototype.erf=function(e){ic(e,"erf");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var i=Math.sign(n[r]),o=Math.abs(n[r]),a=1/(1+.3275911*o);t[r]=i*(1-((((1.061405429*a-1.453152027)*a+1.421413741)*a-.284496736)*a+.254829592)*a*Math.exp(-o*o))}return this.makeOutput(t,e.shape,"float32")},t.prototype.step=function(e,t){void 0===t&&(t=0),ic(e,"step");for(var n=new Float32Array(e.size),r=this.readSync(e.dataId),i=0;i<r.length;++i){var o=r[i];isNaN(o)?n[i]=NaN:n[i]=o>0?1:t}return this.makeOutput(n,e.shape,"float32")},t.prototype.fusedConv2d=function(e){var t=e.input,n=e.filter,r=e.convInfo,i=e.bias,o=e.activation,a=e.preluActivationWeights,s=this.conv2d(t,n,r);return i&&(s=this.add(s,i)),o&&(s=oc(this,s,o,a)),s},t.prototype.conv2d=function(e,t,n){ic([e,t],"conv2d");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,a=n.dilationWidth,s=n.padInfo.left,A=n.padInfo.top,u="channelsLast"===n.dataFormat,l=Jn(n.outShape,e.dtype),c=e.strides[0],f=u?e.strides[1]:e.strides[2],h=u?e.strides[2]:1,d=u?1:e.strides[1],p=l.strides[0],g=u?l.strides[1]:l.strides[2],m=u?l.strides[2]:1,v=u?1:l.strides[1],w=this.readSync(e.dataId),y=this.readSync(t.dataId),b=l.values,B=0;B<n.batchSize;++B)for(var x=B*c,C=B*p,F=0;F<n.outHeight;++F)for(var E=C+F*g,S=F*n.strideHeight-A,k=0;k<r;k++){var _=S+k*o;if(!(_<0||_>=n.inHeight))for(var I=k*t.strides[0],N=x+_*f,U=0;U<n.outWidth;++U)for(var L=E+U*m,Q=U*n.strideWidth-s,D=0;D<i;D++){var R=Q+D*a;if(!(R<0||R>=n.inWidth))for(var T=N+R*h,P=I+D*t.strides[1],O=0;O<n.inChannels;++O){for(var M=w[T+O*d],H=0;H<n.outChannels;++H)b[L+H*v]+=M*y[P+H];P+=n.outChannels}}}return l.toTensor()},t.prototype.conv3d=function(e,t,n){for(var r=n.filterDepth,i=n.filterHeight,o=n.filterWidth,a=n.dilationDepth,s=n.dilationHeight,A=n.dilationWidth,u=n.padInfo.front,l=n.padInfo.left,c=n.padInfo.top,f=Jn(n.outShape,e.dtype),h=this.readSync(e.dataId),d=this.readSync(t.dataId),p=f.values,g=0;g<n.batchSize;++g)for(var m=g*e.strides[0],v=g*f.strides[0],w=0;w<n.outDepth;++w)for(var y=v+w*f.strides[1],b=w*n.strideDepth-u,B=0;B<r;B++){var x=b+B*a;if(!(x<0||x>=n.inDepth))for(var C=B*t.strides[0],F=m+x*e.strides[1],E=0;E<n.outHeight;++E)for(var S=y+E*f.strides[2],k=E*n.strideHeight-c,_=0;_<i;_++){var I=k+_*s;if(!(I<0||I>=n.inHeight))for(var N=C+_*t.strides[1],U=F+I*e.strides[2],L=0;L<n.outWidth;++L)for(var Q=S+L*n.outChannels,D=L*n.strideWidth-l,R=0;R<o;R++){var T=D+R*A;if(!(T<0||T>=n.inWidth))for(var P=N+R*t.strides[2],O=U+T*n.inChannels,M=P,H=0;H<n.inChannels;++H){for(var j=h[O+H],z=0;z<n.outChannels;++z)p[Q+z]+=j*d[M+z];M+=n.outChannels}}}}return f.toTensor()},t.prototype.conv2dDerInput=function(e,t,n){ic([e,t],"conv2dDerInput");for(var r=Jn(n.inShape,"float32"),i=r.values,o=this.readSync(e.dataId),a=this.readSync(t.dataId),s=t.strides,A=s[0],u=s[1],l=s[2],c=n.batchSize,f=n.filterHeight,h=n.filterWidth,d=n.inChannels,p=n.inHeight,g=n.inWidth,m=n.outChannels,v=n.outHeight,w=n.outWidth,y=n.strideHeight,b=n.strideWidth,B=n.dataFormat,x=f-1-n.padInfo.top,C=h-1-n.padInfo.left,F="channelsLast"===B,E=r.strides[0],S=F?r.strides[1]:r.strides[2],k=F?r.strides[2]:1,_=F?1:r.strides[1],I=e.strides[0],N=F?e.strides[1]:e.strides[2],U=F?e.strides[2]:1,L=F?1:e.strides[1],Q=0;Q<c;++Q)for(var D=0;D<d;++D)for(var R=0;R<p;++R)for(var T=R-x,P=Math.max(0,Math.ceil(T/y)),O=Math.min(v,(f+T)/y),M=0;M<g;++M){for(var H=M-C,j=Math.max(0,Math.ceil(H/b)),z=Math.min(w,(h+H)/b),K=0,W=P;W<O;++W)for(var V=W*y-T,G=j;G<z;++G)for(var q=I*Q+N*W+U*G,X=A*(f-1-V)+u*(h-1-(G*b-H))+l*D,Y=0;Y<m;++Y)K+=o[q+L*Y]*a[X+Y];i[E*Q+S*R+k*M+_*D]=K}return r.toTensor()},t.prototype.conv3dDerInput=function(e,t,n){for(var r=Jn(n.inShape,"float32"),i=r.values,o=r.strides,a=o[0],s=o[1],A=o[2],u=o[3],l=this.readSync(e.dataId),c=e.strides,f=c[0],h=c[1],d=c[2],p=c[3],g=this.readSync(t.dataId),m=t.strides,v=m[0],w=m[1],y=m[2],b=m[3],B=n.batchSize,x=n.filterDepth,C=n.filterHeight,F=n.filterWidth,E=n.inChannels,S=n.inDepth,k=n.inHeight,_=n.inWidth,I=n.outChannels,N=n.outDepth,U=n.outHeight,L=n.outWidth,Q=n.strideDepth,D=n.strideHeight,R=n.strideWidth,T=x-1-n.padInfo.front,P=C-1-n.padInfo.top,O=F-1-n.padInfo.left,M=0;M<B;++M)for(var H=0;H<E;++H)for(var j=0;j<S;++j)for(var z=j-T,K=Math.max(0,Math.ceil(z/Q)),W=Math.min(N,(x+z)/Q),V=0;V<k;++V)for(var G=V-P,q=Math.max(0,Math.ceil(G/D)),X=Math.min(U,(C+G)/D),Y=0;Y<_;++Y){for(var J=Y-O,Z=Math.max(0,Math.ceil(J/R)),$=Math.min(L,(F+J)/R),ee=0,te=K;te<W;++te)for(var ne=te*Q-z,re=q;re<X;++re)for(var ie=re*D-G,oe=Z;oe<$;++oe)for(var ae=f*M+h*te+d*re+p*oe,se=v*(x-1-ne)+w*(C-1-ie)+y*(F-1-(oe*R-J))+b*H,Ae=0;Ae<I;++Ae)ee+=l[ae+Ae]*g[se+Ae];i[a*M+s*j+A*V+u*Y+H]=ee}return r.toTensor()},t.prototype.conv2dDerFilter=function(e,t,n){ic([e,t],"conv2dDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s="channelsLast"===n.dataFormat,A=Jn(n.filterShape,"float32"),u=n.padInfo.left,l=n.padInfo.top,c=this.bufferSync(e),f=this.bufferSync(t),h=0;h<o;++h)for(var d=Math.max(0,Math.ceil((l-h)/r)),p=Math.min(n.outHeight,(n.inHeight+l-h)/r),g=0;g<a;++g)for(var m=Math.max(0,Math.ceil((u-g)/i)),v=Math.min(n.outWidth,(n.inWidth+u-g)/i),w=0;w<n.inChannels;++w)for(var y=0;y<n.outChannels;++y){for(var b=0,B=0;B<n.batchSize;++B)for(var x=d;x<p;++x)for(var C=h+x*r-l,F=m;F<v;++F){var E=g+F*i-u;b+=s?c.get(B,C,E,w)*f.get(B,x,F,y):c.get(B,w,C,E)*f.get(B,y,x,F)}A.set(b,h,g,w,y)}return A.toTensor()},t.prototype.conv3dDerFilter=function(e,t,n){for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,a=n.filterDepth,s=n.filterHeight,A=n.filterWidth,u=Jn(n.filterShape,"float32"),l=u.values,c=u.strides,f=c[0],h=c[1],d=c[2],p=c[3],g=this.readSync(t.dataId),m=t.strides,v=m[0],w=m[1],y=m[2],b=m[3],B=this.readSync(e.dataId),x=e.strides,C=x[0],F=x[1],E=x[2],S=x[3],k=n.padInfo.front,_=n.padInfo.left,I=n.padInfo.top,N=0;N<a;++N)for(var U=Math.max(0,Math.ceil((k-N)/r)),L=Math.min(n.outDepth,(n.inDepth+k-N)/r),Q=N*f,D=0;D<s;++D)for(var R=Math.max(0,Math.ceil((I-D)/i)),T=Math.min(n.outHeight,(n.inHeight+I-D)/i),P=D*h+Q,O=0;O<A;++O)for(var M=Math.max(0,Math.ceil((_-O)/o)),H=Math.min(n.outWidth,(n.inWidth+_-O)/o),j=O*d+P,z=0;z<n.inChannels;++z)for(var K=z*p+j,W=0;W<n.outChannels;++W){for(var V=0,G=0;G<n.batchSize;++G)for(var q=G*C,X=G*v,Y=U;Y<L;++Y)for(var J=(N+Y*r-k)*F+q,Z=Y*w+X,$=R;$<T;++$)for(var ee=(D+$*i-I)*E+J,te=$*y+Z,ne=M;ne<H;++ne){var re=ne*b+te;V+=B[(O+ne*o-_)*S+ee+z]*g[re+W]}l[K+W]=V}return u.toTensor()},t.prototype.fusedDepthwiseConv2D=function(e){var t=e.input,n=e.filter,r=e.convInfo,i=e.bias,o=e.activation,a=e.preluActivationWeights,s=this.depthwiseConv2D(t,n,r);return i&&(s=this.add(s,i)),o&&(s=oc(this,s,o,a)),s},t.prototype.depthwiseConv2D=function(e,t,n){ic([e,t],"depthwiseConv2D");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,a=n.dilationWidth,s=n.padInfo.left,A=n.padInfo.top,u=n.outChannels/n.inChannels,l=Jn(n.outShape,e.dtype),c=this.readSync(e.dataId),f=this.readSync(t.dataId),h=l.values,d=0;d<n.batchSize;++d)for(var p=d*e.strides[0],g=d*l.strides[0],m=0;m<n.outHeight;++m)for(var v=g+m*l.strides[1],w=m*n.strideHeight-s,y=0;y<r;++y){var b=w+y*o;if(!(b<0||b>=n.inHeight))for(var B=y*t.strides[0],x=p+b*e.strides[1],C=0;C<n.outWidth;++C)for(var F=v+C*l.strides[2],E=C*n.strideWidth-A,S=0;S<i;++S){var k=E+S*a;if(!(k<0||k>=n.inWidth))for(var _=B+S*t.strides[1],I=x+k*n.inChannels,N=F,U=_,L=0;L<n.inChannels;++L){for(var Q=c[I+L],D=0;D<u;++D)h[N+D]+=Q*f[U+D];N+=u,U+=u}}}return l.toTensor()},t.prototype.depthwiseConv2DDerInput=function(e,t,n){ic([e,t],"depthwiseConv2DDerInput");for(var r=Jn(n.inShape,"float32"),i=r.values,o=r.strides,a=o[0],s=o[1],A=o[2],u=this.readSync(e.dataId),l=e.strides,c=l[0],f=l[1],h=l[2],d=this.readSync(t.dataId),p=t.strides,g=p[0],m=p[1],v=p[2],w=n.batchSize,y=n.filterHeight,b=n.filterWidth,B=n.inChannels,x=n.inHeight,C=n.inWidth,F=n.outChannels,E=n.outHeight,S=n.outWidth,k=n.strideHeight,_=n.strideWidth,I=y-1-n.padInfo.top,N=b-1-n.padInfo.left,U=F/B,L=0;L<w;++L)for(var Q=0;Q<B;++Q)for(var D=0;D<x;++D)for(var R=D-I,T=Math.max(0,Math.ceil(R/k)),P=Math.min(E,(y+R)/k),O=0;O<C;++O){for(var M=O-N,H=Math.max(0,Math.ceil(M/_)),j=Math.min(S,(b+M)/_),z=0,K=T;K<P;++K)for(var W=K*k-R,V=H;V<j;++V)for(var G=c*L+f*K+h*V,q=g*(y-1-W)+m*(b-1-(V*_-M))+v*Q,X=0;X<U;++X)z+=u[G+(Q*U+X)]*d[q+X];i[a*L+s*D+A*O+Q]=z}return r.toTensor()},t.prototype.depthwiseConv2DDerFilter=function(e,t,n){ic([e,t],"depthwiseConv2DDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s=Jn(n.filterShape,"float32"),A=n.padInfo.left,u=n.padInfo.top,l=n.outChannels/n.inChannels,c=this.bufferSync(e),f=this.bufferSync(t),h=0;h<o;++h)for(var d=Math.max(0,Math.ceil((u-h)/r)),p=Math.min(n.outHeight,(n.inHeight+u-h)/r),g=0;g<a;++g)for(var m=Math.max(0,Math.ceil((A-g)/i)),v=Math.min(n.outWidth,(n.inWidth+A-g)/i),w=0;w<n.outChannels;++w){for(var y=Math.trunc(w/l),b=w%l,B=0,x=0;x<n.batchSize;++x)for(var C=d;C<p;++C)for(var F=h+C*r-u,E=m;E<v;++E){var S=g+E*i-A;B+=c.get(x,F,S,y)*f.get(x,C,E,w)}s.set(B,h,g,y,b)}return s.toTensor()},t.prototype.tile=function(e,t){return ic(e,"tile"),Ci(this.bufferSync(e),t)},t.prototype.pad=function(e,t,n){ic(e,"pad");var r=t.map(function(t,n){return t[0]+e.shape[n]+t[1]}),i=t.map(function(e){return e[0]}),o=this.bufferSync(e),a=Jn(r,e.dtype);0!==n&&a.values.fill(n);for(var s=0;s<e.size;s++){var A=o.indexToLoc(s),u=A.map(function(e,t){return e+i[t]});a.set.apply(a,[o.get.apply(o,A)].concat(u))}return a.toTensor()},t.prototype.transpose=function(e,t){ic(e,"transpose");for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[t[r]];var i=this.readSync(e.dataId),o=Jn(n,e.dtype),a=this.bufferSync(e);for(r=0;r<e.size;++r){for(var s=a.indexToLoc(r),A=new Array(s.length),u=0;u<A.length;u++)A[u]=s[t[u]];var l=o.locToIndex(A);o.values[l]=i[r]}return o.toTensor()},t.prototype.gather=function(e,t,n){ic([e,t],"gather");var r=e.shape.slice(),i=this.readSync(t.dataId);r[n]=i.length;for(var o=Jn(r,e.dtype),a=this.bufferSync(e),s=0;s<o.size;++s){var A=o.indexToLoc(s),u=A.slice();u[n]=i[A[n]];var l=a.locToIndex(u);o.values[s]=a.values[l]}return o.toTensor()},t.prototype.batchToSpaceND=function(e,t,n){ic([e],"batchToSpaceND");var r=t.reduce(function(e,t){return e*t}),i=Cr(e.shape,t,r),o=Fr(i.length,t.length),a=Er(e.shape,t,r),s=Sr(n,t.length),A=kr(a,n,t.length);return e.reshape(i).transpose(o).reshape(a).slice(s,A)},t.prototype.spaceToBatchND=function(e,t,n){ic([e],"spaceToBatchND");var r=t.reduce(function(e,t){return e*t}),i=[[0,0]];i.push.apply(i,n);for(var o=1+t.length;o<e.shape.length;++o)i.push([0,0]);var a=e.pad(i),s=Cr(a.shape,t,r,!1),A=Fr(s.length,t.length,!1),u=Er(a.shape,t,r,!1);return a.reshape(s).transpose(A).reshape(u)},t.prototype.pool=function(e,t,n){ic(e,"pool");for(var r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,a=t.dilationWidth,s=t.effectiveFilterHeight,A=t.effectiveFilterWidth,u=t.padInfo.top,l=t.padInfo.left,c="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=this.readSync(e.dataId),h=Jn(t.outShape,e.dtype),d=h.values,p=t.outShape[1]*t.outShape[2]*t.outShape[3],g=t.outShape[2]*t.outShape[3],m=t.outShape[3],v=0;v<t.batchSize;++v)for(var w=v*p,y=v*e.strides[0],b=0;b<t.inChannels;++b)for(var B=0;B<t.outHeight;++B)for(var x=B*r-u,C=Math.max(0,x),F=Math.min(t.inHeight,s+x),E=w+B*g,S=0;S<t.outWidth;++S){for(var k=S*i-l,_=Math.max(0,k),I=Math.min(t.inWidth,A+k),N=c,U=0,L=0,Q=C;Q<F;Q+=o){for(var D=y+Q*e.strides[1],R=_;R<I;R+=a){var T=f[D+R*e.strides[2]+b];"max"===n&&T>N?N=T:"avg"===n&&(U+=T,L++)}if(isNaN(N))break}d[E+S*m+b]="avg"===n?U/L:N}return h.toTensor()},t.prototype.maxPool=function(e,t){return this.pool(e,t,"max")},t.prototype.maxPoolPositions=function(e,t){for(var n=Jn(t.outShape,"int32"),r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,a=t.dilationWidth,s=t.effectiveFilterHeight,A=t.effectiveFilterWidth,u=t.padInfo.top,l=t.padInfo.left,c=this.bufferSync(e),f=0;f<t.batchSize;++f)for(var h=0;h<t.inChannels;++h)for(var d=0;d<t.outHeight;++d){for(var p=d*r-u,g=p;g<0;)g+=o;for(var m=Math.min(t.inHeight,s+p),v=0;v<t.outWidth;++v){for(var w=v*i-l,y=w;y<0;)y+=a;for(var b=Math.min(t.inWidth,A+w),B=Number.NEGATIVE_INFINITY,x=-1,C=g;C<m;C+=o)for(var F=C-p,E=y;E<b;E+=a){var S=E-w,k=c.get(f,C,E,h);k>B&&(B=k,x=F*A+S)}n.set(x,f,d,v,h)}}return n.toTensor()},t.prototype.maxPoolBackprop=function(e,t,n,r){ic([t,n],"maxPoolBackprop");for(var i=this.maxPoolPositions(t,r),o=r.strideHeight,a=r.strideWidth,s=r.dilationHeight,A=r.dilationWidth,u=r.effectiveFilterHeight,l=r.effectiveFilterWidth,c=l-1-r.padInfo.left,f=u-1-r.padInfo.top,h=Jn(t.shape,"float32"),d=this.bufferSync(i),p=this.bufferSync(e),g=0;g<r.batchSize;++g)for(var m=0;m<r.inChannels;++m)for(var v=0;v<r.inHeight;++v)for(var w=0;w<r.inWidth;++w){for(var y=v-f,b=w-c,B=0,x=0;x<u;x+=s){var C=(y+x)/o;if(!(C<0||C>=r.outHeight||Math.floor(C)!==C))for(var F=0;F<l;F+=A){var E=(b+F)/a;if(!(E<0||E>=r.outWidth||Math.floor(E)!==E)){var S=u*l-1-d.get(g,C,E,m)===x*l+F?1:0;0!==S&&(B+=p.get(g,C,E,m)*S)}}}h.set(B,g,v,w,m)}return h.toTensor()},t.prototype.avgPoolBackprop=function(e,t,n){ic([e,t],"avgPoolBackprop");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s=n.dilationHeight,A=n.dilationWidth,u=n.effectiveFilterHeight,l=n.effectiveFilterWidth,c=l-1-n.padInfo.left,f=u-1-n.padInfo.top,h=Jn(t.shape,"float32"),d=1/(o*a),p=this.bufferSync(e),g=0;g<n.batchSize;++g)for(var m=0;m<n.inChannels;++m)for(var v=0;v<n.inHeight;++v)for(var w=0;w<n.inWidth;++w){for(var y=v-f,b=w-c,B=0,x=0;x<u;x+=s){var C=(y+x)/r;if(!(C<0||C>=n.outHeight||Math.floor(C)!==C))for(var F=0;F<l;F+=A){var E=(b+F)/i;E<0||E>=n.outWidth||Math.floor(E)!==E||(B+=p.get(g,C,E,m))}}h.set(B*d,g,v,w,m)}return h.toTensor()},t.prototype.pool3d=function(e,t,n){ic(e,"pool3d");for(var r=t.strideDepth,i=t.strideHeight,o=t.strideWidth,a=t.dilationDepth,s=t.dilationHeight,A=t.dilationWidth,u=t.effectiveFilterDepth,l=t.effectiveFilterHeight,c=t.effectiveFilterWidth,f=t.padInfo.front,h=t.padInfo.top,d=t.padInfo.left,p="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=this.readSync(e.dataId),m=Jn(t.outShape,e.dtype),v=m.values,w=t.outShape[1]*t.outShape[2]*t.outShape[3]*t.outShape[4],y=t.outShape[2]*t.outShape[3]*t.outShape[4],b=t.outShape[3]*t.outShape[4],B=t.outShape[4],x=0;x<t.batchSize;++x)for(var C=x*w,F=x*e.strides[0],E=0;E<t.inChannels;++E)for(var S=0;S<t.outDepth;++S){for(var k=S*r-f,_=k;_<0;)_+=a;for(var I=Math.min(t.inDepth,u+k),N=C+S*y,U=0;U<t.outHeight;++U){for(var L=U*i-h,Q=L;Q<0;)Q+=s;for(var D=Math.min(t.inHeight,l+L),R=N+U*b,T=0;T<t.outWidth;++T){for(var P=T*o-d,O=P;O<0;)O+=A;for(var M=Math.min(t.inWidth,c+P),H=R+T*B,j=p,z=0,K=0,W=_;W<I;W+=a){for(var V=F+W*e.strides[1],G=Q;G<D;G+=s){for(var q=V+G*e.strides[2],X=O;X<M;X+=A){var Y=g[q+X*e.strides[3]+E];if("max"===n&&Y>j?j=Y:"avg"===n&&(z+=Y,K++),isNaN(j))break}if(isNaN(j))break}if(isNaN(j))break}v[H+E]="avg"===n?z/K:j}}}return m.toTensor()},t.prototype.avgPool3d=function(e,t){return ic(e,"avgPool3d"),this.pool3d(e,t,"avg").toFloat()},t.prototype.avgPool3dBackprop=function(e,t,n){ic([e,t],"avgPool3dBackprop");for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,a=n.filterDepth,s=n.filterHeight,A=n.filterWidth,u=n.dilationDepth,l=n.dilationHeight,c=n.dilationWidth,f=n.effectiveFilterDepth,h=n.effectiveFilterHeight,d=n.effectiveFilterWidth,p=f-1-n.padInfo.front,g=d-1-n.padInfo.left,m=h-1-n.padInfo.top,v=Jn(t.shape,"float32"),w=1/(a*s*A),y=this.bufferSync(e),b=0;b<n.batchSize;++b)for(var B=0;B<n.inChannels;++B)for(var x=0;x<n.inDepth;++x)for(var C=0;C<n.inHeight;++C)for(var F=0;F<n.inWidth;++F){for(var E=x-p,S=C-m,k=F-g,_=0,I=0;I<f;I+=u){var N=(E+I)/r;if(!(N<0||N>=n.outDepth||Math.floor(N)!==N))for(var U=0;U<h;U+=l){var L=(S+U)/i;if(!(L<0||L>=n.outHeight||Math.floor(L)!==L))for(var Q=0;Q<d;Q+=c){var D=(k+Q)/o;D<0||D>=n.outWidth||Math.floor(D)!==D||(_+=y.get(b,N,L,D,B))}}}v.set(_*w,b,x,C,F,B)}return v.toTensor()},t.prototype.maxPool3d=function(e,t){return ic(e,"maxPool3d"),this.pool3d(e,t,"max").toFloat()},t.prototype.maxPool3dPositions=function(e,t){for(var n=Jn(t.outShape,"int32"),r=t.strideDepth,i=t.strideHeight,o=t.strideWidth,a=t.dilationDepth,s=t.dilationHeight,A=t.dilationWidth,u=t.effectiveFilterDepth,l=t.effectiveFilterHeight,c=t.effectiveFilterWidth,f=t.padInfo.front,h=t.padInfo.top,d=t.padInfo.left,p=this.bufferSync(e),g=0;g<t.batchSize;++g)for(var m=0;m<t.inChannels;++m)for(var v=0;v<t.outDepth;++v){for(var w=v*r-f,y=w;y<0;)y+=a;for(var b=Math.min(t.inDepth,u+w),B=0;B<t.outHeight;++B){for(var x=B*i-h,C=x;C<0;)C+=s;for(var F=Math.min(t.inHeight,l+x),E=0;E<t.outWidth;++E){for(var S=E*o-d,k=S;k<0;)k+=A;for(var _=Math.min(t.inWidth,c+S),I=Number.NEGATIVE_INFINITY,N=-1,U=y;U<b;U+=a)for(var L=U-w,Q=C;Q<F;Q+=s)for(var D=Q-x,R=k;R<_;R+=A){var T=R-S,P=p.get(g,U,Q,R,m);P>=I&&(I=P,N=L*l*c+D*l+T)}n.set(N,g,v,B,E,m)}}}return n.toTensor()},t.prototype.maxPool3dBackprop=function(e,t,n,r){ic([t,n],"maxPool3dBackprop");for(var i=this.maxPool3dPositions(t,r),o=r.strideDepth,a=r.strideHeight,s=r.strideWidth,A=r.dilationDepth,u=r.dilationHeight,l=r.dilationWidth,c=r.effectiveFilterDepth,f=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=c-1-r.padInfo.front,p=h-1-r.padInfo.left,g=f-1-r.padInfo.top,m=Jn(t.shape,"float32"),v=this.bufferSync(i),w=this.bufferSync(e),y=0;y<r.batchSize;++y)for(var b=0;b<r.inChannels;++b)for(var B=0;B<r.inDepth;++B)for(var x=0;x<r.inHeight;++x)for(var C=0;C<r.inWidth;++C){for(var F=B-d,E=x-g,S=C-p,k=0,_=0;_<c;_+=A){var I=(F+_)/o;if(!(I<0||I>=r.outDepth||Math.floor(I)!==I))for(var N=0;N<f;N+=u){var U=(E+N)/a;if(!(U<0||U>=r.outHeight||Math.floor(U)!==U))for(var L=0;L<h;L+=l){var Q=(S+L)/s;if(!(Q<0||Q>=r.outWidth||Math.floor(Q)!==Q)){var D=c*f*h-1-v.get(y,I,U,Q,b)===_*f*h+N*h+L?1:0;0!==D&&(k+=w.get(y,I,U,Q,b)*D)}}}}m.set(k,y,B,x,C,b)}return m.toTensor()},t.prototype.cast=function(e,t){return Ai(e,t,this)},t.prototype.reshape=function(e,t){return ui(e,t)},t.prototype.avgPool=function(e,t){return ic(e,"avgPool"),this.pool(e,t,"avg").toFloat()},t.prototype.resizeBilinear=function(e,t,n,r){ic(e,"resizeBilinear");for(var i=e.shape,o=i[0],a=i[1],s=i[2],A=i[3],u=this.readSync(e.dataId),l=new Float32Array(M([o,t,n,A])),c=[r&&t>1?a-1:a,r&&n>1?s-1:s],f=[r&&t>1?t-1:t,r&&n>1?n-1:n],h=0,d=c[0]/f[0],p=c[1]/f[1],g=0;g<o;g++)for(var m=0;m<t;m++)for(var v=d*m,w=Math.floor(v),y=v-w,b=Math.min(a-1,Math.ceil(v)),B=g*e.strides[0]+w*e.strides[1],x=g*e.strides[0]+b*e.strides[1],C=0;C<n;C++)for(var F=p*C,E=Math.floor(F),S=F-E,k=Math.min(s-1,Math.ceil(F)),_=B+E*e.strides[2],I=x+E*e.strides[2],N=B+k*e.strides[2],U=x+k*e.strides[2],L=0;L<A;L++){var Q=u[_+L],D=u[I+L],R=Q+(u[N+L]-Q)*S,T=R+(D+(u[U+L]-D)*S-R)*y;l[h++]=T}return yn(l,[o,t,n,A])},t.prototype.resizeBilinearBackprop=function(e,t,n){ic([e,t],"resizeBilinearBackprop");for(var r=t.shape,i=r[0],o=r[1],a=r[2],s=r[3],A=e.shape,u=A[1],l=A[2],c=new Float32Array(i*o*a*s),f=[n&&u>1?o-1:o,n&&l>1?a-1:a],h=[n&&u>1?u-1:u,n&&l>1?l-1:l],d=f[0]/h[0],p=f[1]/h[1],g=this.readSync(e.dataId),m=0,v=0;v<i;v++)for(var w=v*t.strides[0],y=0;y<u;y++)for(var b=y*d,B=Math.floor(b),x=Math.min(Math.ceil(b),o-1),C=w+B*t.strides[1],F=w+x*t.strides[1],E=b-B,S=1-E,k=0;k<l;k++)for(var _=k*p,I=Math.floor(_),N=Math.min(Math.ceil(_),a-1),U=_-I,L=1-U,Q=C+I*t.strides[2],D=C+N*t.strides[2],R=F+I*t.strides[2],T=F+N*t.strides[2],P=S*L,O=S*U,M=E*L,H=E*U,j=0;j<s;j++){var z=g[m++];c[Q+j]+=z*P,c[D+j]+=z*O,c[R+j]+=z*M,c[T+j]+=z*H}return En(c,[i,a,o,s],t.dtype)},t.prototype.resizeNearestNeighbor=function(e,t,n,r){ic(e,"resizeNearestNeighbor");for(var i=e.shape,o=i[0],a=i[1],s=i[2],A=i[3],u=this.readSync(e.dataId),l=new Float32Array(o*t*n*A),c=[r&&t>1?a-1:a,r&&n>1?s-1:s],f=[r&&t>1?t-1:t,r&&n>1?n-1:n],h=c[0]/f[0],d=c[1]/f[1],p=0,g=0;g<o;g++)for(var m=g*e.strides[0],v=0;v<t;v++)for(var w=h*v,y=m+Math.min(a-1,r?Math.round(w):Math.floor(w))*e.strides[1],b=0;b<n;b++)for(var B=d*b,x=y+Math.min(s-1,r?Math.round(B):Math.floor(B))*e.strides[2],C=0;C<A;C++){var F=u[x+C];l[p++]=F}return yn(l,[o,t,n,A],e.dtype)},t.prototype.resizeNearestNeighborBackprop=function(e,t,n){ic([e,t],"resizeNearestNeighborBackprop");for(var r=t.shape,i=r[0],o=r[1],a=r[2],s=r[3],A=e.shape,u=A[1],l=A[2],c=new Float32Array(i*o*a*s),f=this.readSync(e.dataId),h=[n&&u>1?o-1:o,n&&l>1?a-1:a],d=[n&&u>1?u-1:u,n&&l>1?l-1:l],p=h[0]/d[0],g=h[1]/d[1],m=1/p,v=1/g,w=2*Math.ceil(m)+2,y=2*Math.ceil(v)+2,b=0;b<i;b++)for(var B=b*t.strides[0],x=0;x<o;x++)for(var C=B+x*t.strides[1],F=Math.floor(x*m),E=Math.floor(F-w/2),S=0;S<a;S++)for(var k=C+S*t.strides[2],_=Math.floor(S*v),I=Math.floor(_-y/2),N=0;N<s;N++){for(var U=0,L=0;L<w;L++){var Q=L+E;if(!(Q<0||Q>=u)){var D=B+Q*e.strides[1],R=Q*p;if(x===Math.min(o-1,n?Math.round(R):Math.floor(R)))for(var T=0;T<y;T++){var P=T+I;if(!(P<0||P>=l)){var O=D+P*e.strides[2],M=P*g;S===Math.min(a-1,n?Math.round(M):Math.floor(M))&&(U+=f[O+N])}}}}c[k+N]=U}return En(c,t.shape,t.dtype)},t.prototype.batchNormalization=function(e,t,n,r,i,o){ic([e,t,n,i,o],"batchNorm");for(var a=this.readSync(e.dataId),s=this.readSync(t.dataId),A=this.readSync(n.dataId),u=i?this.readSync(i.dataId):new Float32Array([1]),l=o?this.readSync(o.dataId):new Float32Array([0]),c=new Float32Array(a.length),f=l.length,h=u.length,d=A.length,p=s.length,g=0,m=0,v=0,w=0,y=0;y<a.length;++y)c[y]=l[g++]+(a[y]-s[m++])*u[v++]/Math.sqrt(A[w++]+r),g>=f&&(g=0),m>=p&&(m=0),v>=h&&(v=0),w>=d&&(w=0);return En(c,e.shape)},t.prototype.localResponseNormalization4D=function(e,t,n,r,i){ic(e,"localResponseNormalization4D");var o=e.shape[3],a=o-1,s=this.readSync(e.dataId),A=e.size,u=new Float32Array(A);function l(e){for(var n=e%o,r=e-n+Math.max(0,n-t),i=e-n+Math.min(n+t,a),A=0;r<=i;r++){var u=s[r];A+=u*u}return A}for(var c=0;c<A;c++){var f=l(c),h=s[c]*Math.pow(n+r*f,-i);u[c]=h}return En(u,e.shape)},t.prototype.LRNGrad=function(e,t,n,r,i,o,a){ic(e,"LRNGrad");for(var s=e.shape[3],A=this.readSync(e.dataId),u=this.readSync(t.dataId),l=this.readSync(n.dataId),c=new Float32Array(e.size),f=e.size,h=0;h<f;h++){for(var d=h%s,p=h-d+Math.max(0,d-r),g=h-d+Math.min(s,d+r+1),m=0,v=p;v<g;v++)m+=Math.pow(u[v],2);for(m=o*m+i,v=p;v<g;v++){var w=-2*o*a*u[v]*l[h]/m;h===v&&(w+=Math.pow(m,-a)),w*=A[h],c[v]+=w}}return En(c,e.shape)},t.prototype.multinomial=function(e,t,n,r){ic(e,"multinomial");for(var i=t?e:jr(e),o=i.shape[0],a=i.shape[1],s=kn([o,n],"int32"),A=this.readSync(s.dataId),u=this.readSync(i.dataId),l=0;l<o;++l){var c=l*a,f=new Float32Array(a-1);f[0]=u[c];for(var h=1;h<f.length;++h)f[h]=f[h-1]+u[c+h];for(var d=Gn(r.toString()),p=l*n,g=0;g<n;++g){var m=d();A[p+g]=f.length;for(var v=0;v<f.length;v++)if(m<f[v]){A[p+g]=v;break}}}return s},t.prototype.oneHot=function(e,t,n,r){ic(e,"oneHot");var i=new Float32Array(e.size*t);i.fill(r);for(var o=this.readSync(e.dataId),a=0;a<e.size;++a)o[a]>=0&&o[a]<t&&(i[a*t+o[a]]=n);return Cn(i,[e.size,t],"int32")},t.prototype.nonMaxSuppression=function(e,t,n,r,i){return ic(e,"nonMaxSuppression"),mi(this.readSync(e.dataId),this.readSync(t.dataId),n,r,i)},t.prototype.fft=function(e){return this.fftBatch(e,!1)},t.prototype.ifft=function(e){return this.fftBatch(e,!0)},t.prototype.fftBatch=function(e,t){for(var n=e.shape[0],r=e.shape[1],i=Jn(e.shape,"float32"),o=Jn(e.shape,"float32"),a=vn(e).as2D(n,r),s=wn(e).as2D(n,r),A=0;A<n;A++)for(var u=a.slice([A,0],[1,r]),l=s.slice([A,0],[1,r]),c=mn(u,l),f=this.readSync(this.fftImpl(c,t).dataId),h=0;h<r;h++){var d=fi(f,h);i.values[A*r+h]=d.real,o.values[A*r+h]=d.imag}return mn(i.toTensor(),o.toTensor()).as2D(n,r)},t.prototype.fftImpl=function(e,t){var n=e.as1D(),r=n.size;if(this.isExponentOf2(r)){var i=this.fftRadix2(n,r,t).as2D(e.shape[0],e.shape[1]);return t&&(i=mn(vn(i).div(Bn(r)),wn(i).div(Bn(r)))),i}var o=this.readSync(e.dataId),a=function(e){for(var t=new Float32Array(e.length/2),n=new Float32Array(e.length/2),r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}(this.fourierTransformByMatmul(o,r,t));return mn(a.real,a.imag).as2D(e.shape[0],e.shape[1])},t.prototype.isExponentOf2=function(e){return 0==(e&e-1)},t.prototype.fftRadix2=function(e,t,n){if(1===t)return e;var r=this.readSync(e.dataId),i=t/2,o=function(e){for(var t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t),i=0;i<e.length;i+=4)n[Math.floor(i/4)]=e[i],r[Math.floor(i/4)]=e[i+1];return{real:n,imag:r}}(r),a=mn(o.real,o.imag).as1D(),s=function(e){for(var t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t),i=2;i<e.length;i+=4)n[Math.floor(i/4)]=e[i],r[Math.floor(i/4)]=e[i+1];return{real:n,imag:r}}(r),A=mn(s.real,s.imag).as1D();a=this.fftRadix2(a,i,n),A=this.fftRadix2(A,i,n);var u=function(e,t){for(var n=new Float32Array(e/2),r=new Float32Array(e/2),i=0;i<Math.ceil(e/2);i++){var o=(t?2:-2)*Math.PI*(i/e);n[i]=Math.cos(o),r[i]=Math.sin(o)}return{real:n,imag:r}}(t,n),l=mn(u.real,u.imag).mul(A),c=a.add(l),f=a.sub(l),h=vn(c).concat(vn(f)),d=wn(c).concat(wn(f));return mn(h,d).as1D()},t.prototype.fourierTransformByMatmul=function(e,t,n){for(var r=new Float32Array(2*t),i=0;i<t;i++){for(var o=0,a=0,s=0;s<t;s++){var A=di(i*s,t,n),u=fi(e,s);o+=u.real*A.real-u.imag*A.imag,a+=u.real*A.imag+u.imag*A.real}n&&(o/=t,a/=t),hi(r,o,a,i)}return r},t.prototype.depthToSpace=function(e,t,n){R("NHWC"===n,function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got "+n}),R(t>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+t});for(var r=e.shape[0],i=e.shape[1],o=e.shape[2],a=e.shape[3],s=i*t,A=o*t,u=a/(t*t),l=this.readSync(e.dataId),c=new Float32Array(r*s*A*u),f=0,h=0;h<r;++h)for(var d=0;d<s;++d)for(var p=Math.floor(d/t),g=d%t,m=0;m<A;++m)for(var v=Math.floor(m/t),w=(g*t+m%t)*u,y=0;y<u;++y){var b=y+w+a*(v+o*(p+i*h));c[f++]=l[b]}return En(c,[r,s,A,u])},t.prototype.broadcastedBinaryOp=function(e,t,n,r){var i=Xr(e.shape,t.shape),o=Jn(i,n),a=this.readSync(e.dataId),s=this.readSync(t.dataId),A=Gr(e.shape,i),u=Gr(t.shape,i),l=o.values;if(A.length+u.length===0)for(var c=0;c<l.length;++c)l[c]=r(a[c%a.length],s[c%s.length]);else{var f=this.bufferSync(e),h=this.bufferSync(t),d=function(n){var i=o.indexToLoc(n),c=i.slice(-e.rank);A.forEach(function(e){return c[e]=0});var d=f.locToIndex(c),p=i.slice(-t.rank);u.forEach(function(e){return p[e]=0});var g=h.locToIndex(p);l[n]=r(a[d],s[g])};for(c=0;c<l.length;++c)d(c)}return o.toTensor()},t.prototype.broadcastedBinaryComplexOp=function(e,t,n){var r=Xr(e.shape,t.shape),i=Jn(r,"float32"),o=Jn(r,"float32"),a=this.readSync(e.dataId),s=this.readSync(t.dataId),A=Gr(e.shape,r),u=Gr(t.shape,r),l=i.values,c=o.values;if(A.length+u.length===0)for(var f=0;f<l.length;f++){var h=f%a.length,d=f%s.length,p=n(a[2*h],a[2*h+1],s[2*d],s[2*d+1]);l[f]=p.real,c[f]=p.imag}else{var g=this.bufferSync(this.data.get(e.dataId).complexTensors.real),m=this.bufferSync(this.data.get(t.dataId).complexTensors.real),v=function(r){var o=i.indexToLoc(r),f=o.slice(-e.rank);A.forEach(function(e){return f[e]=0});var h=g.locToIndex(f),d=o.slice(-t.rank);u.forEach(function(e){return d[e]=0});var p=m.locToIndex(d),v=n(a[2*h],a[2*h+1],s[2*p],s[2*p+1]);l[r]=v.real,c[r]=v.imag};for(f=0;f<l.length;f++)v(f)}return this.complex(i.toTensor(),o.toTensor())},t.prototype.split=function(e,t,n){return xi(e,t,n)},t.prototype.dispose=function(){},t.prototype.floatPrecision=function(){return 32},t.prototype.epsilon=function(){return 1e-7},t.prototype.cropAndResize=function(e,t,n,r,i,o){for(var a=e.shape,s=a[0],A=a[1],u=a[2],l=a[3],c=t.shape[0],f=r[0],h=r[1],d=Jn([c,f,h,l],"float32"),p=this.readSync(t.dataId),g=this.readSync(n.dataId),m=this.readSync(e.dataId),v=e.strides,w=d.strides,y=0;y<c;y++){var b=4*y,B=p[b],x=p[b+1],C=p[b+2],F=p[b+3],E=g[y];if(!(E>=s))for(var S=f>1?(C-B)*(A-1)/(f-1):0,k=h>1?(F-x)*(u-1)/(h-1):0,_=0;_<f;_++){var I=f>1?B*(A-1)+_*S:.5*(B+C)*(A-1);if(I<0||I>A-1)for(var N=0;N<h;N++)for(var U=0;U<l;U++){var L=U+N*w[2]+_*w[1]+y*w[0];d.values[L]=o}else if("bilinear"===i){var Q=Math.floor(I),D=Math.ceil(I),R=I-Q;for(N=0;N<h;N++)if((W=h>1?x*(u-1)+N*k:.5*(x+F)*(u-1))<0||W>u-1)for(U=0;U<l;U++)L=U+N*w[2]+_*w[1]+y*w[0],d.values[L]=o;else{var T=Math.floor(W),P=Math.ceil(W),O=W-T;for(U=0;U<l;U++){var M=m[L=U+T*v[2]+Q*v[1]+E*v[0]],H=m[L=U+P*v[2]+Q*v[1]+E*v[0]],j=m[L=U+T*v[2]+D*v[1]+E*v[0]],z=M+(H-M)*O,K=j+(m[L=U+P*v[2]+D*v[1]+E*v[0]]-j)*O;L=U+N*w[2]+_*w[1]+y*w[0],d.values[L]=z+(K-z)*R}}}else for(N=0;N<h;++N){var W;if((W=h>1?x*(u-1)+N*k:.5*(x+F)*(u-1))<0||W>u-1)for(U=0;U<l;U++)L=U+N*w[2]+_*w[1]+y*w[0],d.values[L]=o;else{var V=Math.round(W),G=Math.round(I);for(U=0;U<l;U++){var q=U+V*v[2]+G*v[1]+E*v[0],X=U+N*w[2]+_*w[1]+y*w[0];d.values[X]=m[q]}}}}}return d.toTensor()},t.prototype.sparseToDense=function(e,t,n,r){var i=Lr(0,e,n),o=i.sliceRank,a=i.numUpdates,s=i.sliceSize,A=i.strides,u=i.outputSize;return this.scatter(e,t,n,u,s,a,o,A,r,!1)},t.prototype.gatherND=function(e,t){var n=t.shape,r=n[n.length-1],i=_r(e,t),o=i[0],a=i[1],s=i[2],A=i[3];if(0===a)return yn([],o,e.dtype);for(var u=new Ee([a,s],e.dtype),l=this.readSync(t.dataId),c=this.readSync(e.dataId),f=0;f<a;f++){for(var h=[],d=0,p=0;p<r;p++){var g=l[f*r+p];d+=g*A[p],h.push(g)}if(d<0||d>=e.size/s)throw new Error("Invalid indices: "+h+" does not index into "+e.shape);for(var m=0;m<s;m++)u.values[f*s+m]=c[d*s+m]}return u.toTensor().reshape(o)},t.prototype.scatterND=function(e,t,n){var r=Lr(0,e,n),i=r.sliceRank,o=r.numUpdates,a=r.sliceSize,s=r.strides,A=r.outputSize,u=Bn(0);return this.scatter(e,t,n,A,a,o,i,s,u,!0)},t.prototype.fill=function(e,t,n){var r=J(n=n||se(t),M(e));return r.fill(t),Ve.makeTensor(r,e,n,this)},t.prototype.onesLike=function(e){if("string"===e.dtype)throw new Error("onesLike is not supported for string tensors");return this.fill(e.shape,1,e.dtype)},t.prototype.zerosLike=function(e){var t=J(e.dtype,M(e.shape));return this.makeOutput(t,e.shape,e.dtype)},t.prototype.linspace=function(e,t,n){return li(e,t,n)},t.prototype.scatter=function(e,t,n,r,i,o,a,s,A,u){var l=[r/i,i],c=this.readSync(e.dataId),f=this.readSync(t.dataId);if(0===r)return yn([],n,t.dtype);var h=new Ee(l,t.dtype);h.values.fill(this.readSync(A.dataId)[0]);for(var d=0;d<o;d++){for(var p=[],g=0,m=0;m<a;m++){var v=c[d*a+m];p.push(v),g+=v*s[m]}if(g<0||g>=r/i)throw new Error("Invalid indices: "+p+" does not index into "+n);for(var w=0;w<i;w++)u?h.values[g*i+w]+=f[d*i+w]:h.values[g*i+w]=0===t.rank?f[0]:f[d*i+w]}return h.toTensor().reshape(n)},t}(Wr);Ve.registerBackend("cpu",function(){return new ac},1);for(var sc=0,Ac=[{kernelName:"NonMaxSuppressionV5",backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t,o=i.boxes,a=i.scores,s=r,A=s.maxOutputSize,u=s.iouThreshold,l=s.scoreThreshold,c=s.softNmsSigma,f=n;ic(o,"NonMaxSuppressionWithScore");var h=vi(f.data.get(o.dataId).values,f.data.get(a.dataId).values,A,u,l,c);return[h.selectedIndices,h.selectedScores]}},{kernelName:"Square",backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,i=n;ic(r,"square");for(var o=i.data.get(r.dataId).values,a=new Float32Array(o.length),s=0;s<o.length;++s){var A=o[s];a[s]=A*A}return{dataId:i.write(a,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},{kernelName:ws,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t,i=r.a,o=r.b,a=n;ic([i,o],ws);var s=a.data.get(i.dataId).values,A=a.data.get(o.dataId).values,u=function(e,t,n,r,i,o){var a=Xr(e,t),s=a.length,A=le(a),u=Y(i,M(a)),l=e.length,c=t.length,f=le(e),h=le(t),d=Gr(e,a),p=Gr(t,a);if(d.length+p.length===0)for(var g=0;g<u.length;++g)u[g]=o(n[g%n.length],r[g%r.length]);else{var m=function(e){var t=ye(e,s,A),i=t.slice(-l);d.forEach(function(e){return i[e]=0});var a=we(i,l,f),g=t.slice(-c);p.forEach(function(e){return g[e]=0});var m=we(g,c,h);u[e]=o(n[a],r[m])};for(g=0;g<u.length;++g)m(g)}return[u,a]}(i.shape,o.shape,s,A,i.dtype,function(e,t){var n=e-t;return n*n}),l=u[0],c=u[1];return{dataId:a.write(l,c,i.dtype),shape:c,dtype:i.dtype}}}];sc<Ac.length;sc++)_(Ac[sc]);for(var uc,lc=function(e){this.variableNames=["A"];var t=Ui(),n=e[0],r=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+r+".0, "+n+".0);\n\n vec4 values = "+t.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "},cc=function(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var t=Ui(),n=e[0],r=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+r+".0, "+n+".0);\n vec4 values = "+t.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n "+t.output+" = result;\n }\n "},fc=0,hc=[{kernelName:"FromPixels",backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t.pixels,o=r.numChannels,a="undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement,s="undefined"!=typeof HTMLImageElement&&i instanceof HTMLImageElement,A=a?[i.videoWidth,i.videoHeight]:[i.width,i.height],u=A[0],l=A[1],c=[l,u],f=[l,u,o];(s||a)&&(null==uc&&(uc=document.createElement("canvas").getContext("2d")),uc.canvas.width=u,uc.canvas.height=l,uc.drawImage(i,0,0,u,l),i=uc.canvas);var h=n.makeTensorInfo(c,"int32");n.texData.get(h.dataId).usage=Ye.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(h.dataId),i);var d=x().getBool("WEBGL_PACK")?new cc(f):new lc(f),p=n.runWebGLProgram(d,[h],"int32");return n.disposeData(h.dataId),p}},{kernelName:"NonMaxSuppressionV5",backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs;en("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=t,o=i.boxes,a=i.scores,s=r,A=s.maxOutputSize,u=s.iouThreshold,l=s.scoreThreshold,c=s.softNmsSigma,f=n,h=vi(f.readSync(o.dataId),f.readSync(a.dataId),A,u,l,c);return[h.selectedIndices,h.selectedScores]}},{kernelName:"Square",backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,i=n,o=new za(r.shape,"return x * x;");return i.runWebGLProgram(o,[r],r.dtype)}},{kernelName:ws,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t,i=r.a,o=r.b,a=n,s=x().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ao("return (a - b) * (a - b);",i.shape,o.shape):new io("return (a - b) * (a - b);",i.shape,o.shape);return a.compileAndRun(s,[i,o])}}];fc<hc.length;fc++)_(hc[fc]);for(var dc=0,pc=[{kernelName:"Square",gradFunc:function(e,t){var n=t[0];return{x:function(){return e.mul(n.toFloat().mul(2))}}}},{kernelName:ws,gradFunc:function(e,t){var n=t[0],r=t[1],i=Bn(2);return{a:function(){return DA(e,DA(i,MA(n,r)))},b:function(){return DA(e,DA(i,MA(r,n)))}}}}];dc<pc.length;dc++)I(pc[dc]);var gc=function(){function e(){}return e.prototype.fetch=function(e,t){return fetch(e,t)},e.prototype.now=function(){return performance.now()},e.prototype.encode=function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Browser's encoder only supports utf-8, but got "+t);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)},e.prototype.decode=function(e,t){return new TextDecoder(t).decode(e)},e}();x().get("IS_BROWSER")&&x().setPlatform("browser",new gc);var mc,vc=function(){function e(){this.util=n(745),this.textEncoder=new this.util.TextEncoder}return e.prototype.fetch=function(e,t){return null!=x().global.fetch?x().global.fetch(e,t):(null==mc&&(mc=n(7318)),mc(e,t))},e.prototype.now=function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6},e.prototype.encode=function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Node built-in encoder only supports utf-8, but got "+t);return this.textEncoder.encode(e)},e.prototype.decode=function(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)},e}();x().get("IS_NODE")&&x().setPlatform("node",new vc);var wc={float32:4,int32:4,uint16:2,uint8:1,bool:1};function yc(e,t){for(var n={},r=0,i=function(t){var i=t.name,o=t.dtype,a=t.shape,s=M(a),A=void 0;if("quantization"in t){var u=t.quantization;if("uint8"!==u.dtype&&"uint16"!==u.dtype)throw new Error("Weight "+t.name+" has unknown quantization dtype "+u.dtype+". Supported quantization dtypes are: 'uint8' and 'uint16'.");var l=wc[u.dtype],c=e.slice(r,r+s*l),f="uint8"===u.dtype?new Uint8Array(c):new Uint16Array(c);if("float32"===o)A=Float32Array.from(f,function(e){return e*u.scale+u.min});else{if("int32"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);A=Int32Array.from(f,function(e){return Math.round(e*u.scale+u.min)})}r+=s*l}else if("string"===o){var h=M(t.shape);A=[];for(var d=0;d<h;d++){var p=new Uint32Array(e.slice(r,r+4))[0];r+=4;var g=new Uint8Array(e.slice(r,r+p));A.push(g),r+=p}}else{var m=wc[o];if(c=e.slice(r,r+s*m),"float32"===o)A=new Float32Array(c);else if("int32"===o)A=new Int32Array(c);else{if("bool"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);A=new Uint8Array(c)}r+=s*m}n[i]=yn(A,a,o)},o=0,a=t;o<a.length;o++)i(a[o]);return n}function bc(e){if(null===e)throw new Error("Invalid input value: "+JSON.stringify(e));var t=0,n=[];e.forEach(function(e){if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error("Unsupported TypedArray subtype: "+e.constructor.name)});var r=new Uint8Array(t),i=0;return n.forEach(function(e){r.set(new Uint8Array(e.buffer),i),i+=e.byteLength}),r.buffer}var Bc="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function xc(e){return Bc?Buffer.byteLength(e):new Blob([e]).size}function Cc(e){var t=0;e.forEach(function(e){t+=e.byteLength});var n=new Uint8Array(t),r=0;return e.forEach(function(e){n.set(new Uint8Array(e),r),r+=e.byteLength}),n.buffer}function Fc(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);var t=e.split("/");return t[t.length-1]}function Ec(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:xc(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:xc(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}var Sc=function(){function e(){this.saveRouters=[],this.loadRouters=[]}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e.registerSaveRouter=function(t){e.getInstance().saveRouters.push(t)},e.registerLoadRouter=function(t){e.getInstance().loadRouters.push(t)},e.getSaveHandlers=function(t){return e.getHandlers(t,"save")},e.getLoadHandlers=function(t,n){return e.getHandlers(t,"load",n)},e.getHandlers=function(t,n,r){var i=[];return("load"===n?e.getInstance().loadRouters:e.getInstance().saveRouters).forEach(function(e){var n=e(t,r);null!==n&&i.push(n)}),i},e}(),kc="://",_c=function(){function e(){this.managers={}}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e.registerManager=function(t,n){R(null!=t,function(){return"scheme must not be undefined or null."}),t.endsWith(kc)&&(t=t.slice(0,t.indexOf(kc))),R(t.length>0,function(){return"scheme must not be an empty string."});var r=e.getInstance();R(null==r.managers[t],function(){return"A model store manager is already registered for scheme '"+t+"'."}),r.managers[t]=n},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '"+e+"'");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function Ic(e){if(-1===e.indexOf(kc))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+_c.getSchemes().join(","));return{scheme:e.split(kc)[0],path:e.split(kc)[1]}}function Nc(e,t,n){return void 0===n&&(n=!1),y(this,void 0,void 0,function(){var r,i,o,a,s,A,u,l,c;return b(this,function(f){switch(f.label){case 0:return R(e!==t,function(){return"Old path and new path are the same: '"+e+"'"}),R((r=Sc.getLoadHandlers(e)).length>0,function(){return"Copying failed because no load handler is found for source URL "+e+"."}),R(r.length<2,function(){return"Copying failed because more than one ("+r.length+") load handlers for source URL "+e+"."}),i=r[0],R((o=Sc.getSaveHandlers(t)).length>0,function(){return"Copying failed because no save handler is found for destination URL "+t+"."}),R(o.length<2,function(){return"Copying failed because more than one ("+r.length+") save handlers for destination URL "+t+"."}),a=o[0],s=Ic(e).scheme,A=Ic(e).path,u=s===Ic(e).scheme,[4,i.load()];case 1:return l=f.sent(),n&&u?[4,_c.getManager(s).removeModel(A)]:[3,3];case 2:f.sent(),f.label=3;case 3:return[4,a.save(l)];case 4:return c=f.sent(),!n||u?[3,6]:[4,_c.getManager(s).removeModel(A)];case 5:f.sent(),f.label=6;case 6:return[2,c.modelArtifactsInfo]}})})}var Uc="models_store",Lc="model_info_store";function Qc(){if(!x().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var e=window||self,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Dc(e){var t=e.result;t.createObjectStore(Uc,{keyPath:"modelPath"}),t.createObjectStore(Lc,{keyPath:"modelPath"})}var Rc=function(){function e(e){if(this.indexedDB=Qc(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}return e.prototype.save=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return[2,this.databaseAction(this.modelPath,e)]})})},e.prototype.load=function(){return y(this,void 0,void 0,function(){return b(this,function(e){return[2,this.databaseAction(this.modelPath)]})})},e.prototype.databaseAction=function(e,t){var n=this;return new Promise(function(e,r){var i=n.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return Dc(i)},i.onsuccess=function(){var o=i.result;if(null==t){var a=o.transaction(Uc,"readonly"),s=a.objectStore(Uc).get(n.modelPath);s.onsuccess=function(){if(null==s.result)return o.close(),r(new Error("Cannot find model with path '"+n.modelPath+"' in IndexedDB."));e(s.result.modelArtifacts)},s.onerror=function(e){return o.close(),r(s.error)},a.oncomplete=function(){return o.close()}}else{var A,u=Ec(t),l=o.transaction(Lc,"readwrite"),c=l.objectStore(Lc),f=c.put({modelPath:n.modelPath,modelArtifactsInfo:u});f.onsuccess=function(){var i=(A=o.transaction(Uc,"readwrite")).objectStore(Uc).put({modelPath:n.modelPath,modelArtifacts:t,modelArtifactsInfo:u});i.onsuccess=function(){return e({modelArtifactsInfo:u})},i.onerror=function(e){var t=(c=l.objectStore(Lc)).delete(n.modelPath);t.onsuccess=function(){return o.close(),r(i.error)},t.onerror=function(e){return o.close(),r(i.error)}}},f.onerror=function(e){return o.close(),r(f.error)},l.oncomplete=function(){null==A?o.close():A.oncomplete=function(){return o.close()}}}},i.onerror=function(e){return r(i.error)}})},e.URL_SCHEME="indexeddb://",e}(),Tc=function(e){return x().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Rc.URL_SCHEME)?(t=e.slice(Rc.URL_SCHEME.length),new Rc(t)):null;var t};Sc.registerSaveRouter(Tc),Sc.registerLoadRouter(Tc);var Pc=function(){function e(){this.indexedDB=Qc()}return e.prototype.listModels=function(){return y(this,void 0,void 0,function(){var e=this;return b(this,function(t){return[2,new Promise(function(t,n){var r=e.indexedDB.open("tensorflowjs",1);r.onupgradeneeded=function(){return Dc(r)},r.onsuccess=function(){var e=r.result,i=e.transaction(Lc,"readonly"),o=i.objectStore(Lc).getAll();o.onsuccess=function(){for(var e={},n=0,r=o.result;n<r.length;n++){var i=r[n];e[i.modelPath]=i.modelArtifactsInfo}t(e)},o.onerror=function(t){return e.close(),n(o.error)},i.oncomplete=function(){return e.close()}},r.onerror=function(e){return n(r.error)}})]})})},e.prototype.removeModel=function(e){return y(this,void 0,void 0,function(){var t=this;return b(this,function(n){var r;return e=(r=e).startsWith(Rc.URL_SCHEME)?r.slice(Rc.URL_SCHEME.length):r,[2,new Promise(function(n,r){var i=t.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return Dc(i)},i.onsuccess=function(){var t,o=i.result,a=o.transaction(Lc,"readwrite"),s=a.objectStore(Lc),A=s.get(e);A.onsuccess=function(){if(null==A.result)return o.close(),r(new Error("Cannot find model with path '"+e+"' in IndexedDB."));var i=s.delete(e),a=function(){var i=(t=o.transaction(Uc,"readwrite")).objectStore(Uc).delete(e);i.onsuccess=function(){return n(A.result.modelArtifactsInfo)},i.onerror=function(e){return r(A.error)}};i.onsuccess=a,i.onerror=function(e){return a(),o.close(),r(A.error)}},A.onerror=function(e){return o.close(),r(A.error)},a.oncomplete=function(){null==t?o.close():t.oncomplete=function(){return o.close()}}},i.onerror=function(e){return r(i.error)}})]})})},e}();if(x().getBool("IS_BROWSER"))try{_c.registerManager(Rc.URL_SCHEME,new Pc)}catch(v){}var Oc="/",Mc="tensorflowjs_models",Hc="info",jc="model_topology",zc="weight_specs",Kc="weight_data",Wc="model_metadata";function Vc(e){return{info:[Mc,e,Hc].join(Oc),topology:[Mc,e,jc].join(Oc),weightSpecs:[Mc,e,zc].join(Oc),weightData:[Mc,e,Kc].join(Oc),modelMetadata:[Mc,e,Wc].join(Oc)}}function Gc(e){var t=e.split(Oc);if(t.length<3)throw new Error("Invalid key format: "+e);return t.slice(1,t.length-1).join(Oc)}var qc=function(){function e(e){if(!x().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Vc(this.modelPath)}return e.prototype.save=function(e){return y(this,void 0,void 0,function(){var t,n,r;return b(this,function(i){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Ec(e);try{return this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Bc)return Buffer.from(e).toString("base64");for(var t=new Uint8Array(e),n="",r=0,i=t.length;r<i;r++)n+=String.fromCharCode(t[r]);return btoa(n)}(e.weightData)),this.LS.setItem(this.keys.modelMetadata,JSON.stringify({format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,userDefinedMetadata:e.userDefinedMetadata})),[2,{modelArtifactsInfo:r}]}catch(e){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error("Failed to save model '"+this.modelPath+"' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes="+r.modelTopologyBytes+", weightSpecsBytes="+r.weightSpecsBytes+", weightDataBytes="+r.weightDataBytes+".")}})})},e.prototype.load=function(){return y(this,void 0,void 0,function(){var e,t,n,r,i,o,a;return b(this,function(s){if(null==(e=JSON.parse(this.LS.getItem(this.keys.info))))throw new Error("In local storage, there is no model with name '"+this.modelPath+"'");if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");if(t={},null==(n=JSON.parse(this.LS.getItem(this.keys.topology))))throw new Error("In local storage, the topology of model '"+this.modelPath+"' is missing.");if(t.modelTopology=n,null==(r=JSON.parse(this.LS.getItem(this.keys.weightSpecs))))throw new Error("In local storage, the weight specs of model '"+this.modelPath+"' are missing.");if(t.weightSpecs=r,null!=(i=this.LS.getItem(this.keys.modelMetadata))&&(o=JSON.parse(i),t.format=o.format,t.generatedBy=o.generatedBy,t.convertedBy=o.convertedBy,t.userDefinedMetadata=o.userDefinedMetadata),null==(a=this.LS.getItem(this.keys.weightData)))throw new Error("In local storage, the binary weight values of model '"+this.modelPath+"' are missing.");return t.weightData=function(e){if(Bc){var t=Buffer.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}for(var n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r.set([n.charCodeAt(i)],i);return r.buffer}(a),[2,t]})})},e.URL_SCHEME="localstorage://",e}(),Xc=function(e){return x().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(qc.URL_SCHEME)?(t=e.slice(qc.URL_SCHEME.length),new qc(t)):null;var t};Sc.registerSaveRouter(Xc),Sc.registerLoadRouter(Xc);var Yc=function(){function e(){R(x().getBool("IS_BROWSER"),function(){return"Current environment is not a web browser"}),R("undefined"==typeof window||void 0!==window.localStorage,function(){return"Current browser does not appear to support localStorage"}),this.LS=window.localStorage}return e.prototype.listModels=function(){return y(this,void 0,void 0,function(){var e,t,n,r,i,o;return b(this,function(a){for(e={},t=Mc+Oc,n=Oc+Hc,r=0;r<this.LS.length;++r)(i=this.LS.key(r)).startsWith(t)&&i.endsWith(n)&&(o=Gc(i),e[o]=JSON.parse(this.LS.getItem(i)));return[2,e]})})},e.prototype.removeModel=function(e){return y(this,void 0,void 0,function(){var t,n;return b(this,function(r){var i;if(e=(i=e).startsWith(qc.URL_SCHEME)?i.slice(qc.URL_SCHEME.length):i,t=Vc(e),null==this.LS.getItem(t.info))throw new Error("Cannot find model at path '"+e+"'");return n=JSON.parse(this.LS.getItem(t.info)),this.LS.removeItem(t.info),this.LS.removeItem(t.topology),this.LS.removeItem(t.weightSpecs),this.LS.removeItem(t.weightData),[2,n]})})},e}();if(x().getBool("IS_BROWSER"))try{_c.registerManager(qc.URL_SCHEME,new Yc)}catch(v){}function Jc(e){return new Promise(function(e){return setTimeout(e)}).then(e)}var Zc=function(){function e(t){if(!x().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(e.URL_SCHEME)&&(t=t.slice(e.URL_SCHEME.length)),null!=t&&0!==t.length||(t="model"),this.modelTopologyFileName=t+".json",this.weightDataFileName=t+".weights.bin"}return e.prototype.save=function(e){return y(this,void 0,void 0,function(){var t,n,r,i,o,a;return b(this,function(s){switch(s.label){case 0:if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");if(t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"})),!(e.modelTopology instanceof ArrayBuffer))return[3,1];throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");case 1:return n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n},i=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),(o=null==this.jsonAnchor?document.createElement("a"):this.jsonAnchor).download=this.modelTopologyFileName,o.href=i,[4,Jc(function(){return o.dispatchEvent(new MouseEvent("click"))})];case 2:return s.sent(),null==e.weightData?[3,4]:((a=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,a.href=t,[4,Jc(function(){return a.dispatchEvent(new MouseEvent("click"))})]);case 3:s.sent(),s.label=4;case 4:return[2,{modelArtifactsInfo:Ec(e)}]}})})},e.URL_SCHEME="downloads://",e}(),$c=function(){function e(e){if(null==e||e.length<1)throw new Error("When calling browserFiles, at least 1 file is required, but received "+e);this.files=e}return e.prototype.load=function(){return y(this,void 0,void 0,function(){var e,t,n=this;return b(this,function(r){return e=this.files[0],t=this.files.slice(1),[2,new Promise(function(r,i){var o=new FileReader;o.onload=function(o){var a=JSON.parse(o.target.result),s=a.modelTopology;if(null!=s){0===t.length&&r({modelTopology:s});var A=a.weightsManifest;if(null!=A){var u;try{u=n.checkManifestAndWeightFiles(A,t)}catch(e){return void i(e)}var l=[],c=[],f=[];A.forEach(function(e){e.paths.forEach(function(e){c.push(e),f.push(null)}),l.push.apply(l,e.weights)}),A.forEach(function(e){e.paths.forEach(function(e){var t=new FileReader;t.onload=function(t){var n=t.target.result,i=c.indexOf(e);f[i]=n,-1===f.indexOf(null)&&r({modelTopology:s,weightSpecs:l,weightData:Cc(f),format:a.format,generatedBy:a.generatedBy,convertedBy:a.convertedBy,userDefinedMetadata:a.userDefinedMetadata})},t.onerror=function(t){return i("Failed to weights data from file of path '"+e+"'.")},t.readAsArrayBuffer(u[e])})})}else i(new Error("weightManifest field is missing from file "+e.name))}else i(new Error("modelTopology field is missing from file "+e.name))},o.onerror=function(t){return i("Failed to read model topology and weights manifest JSON from file '"+e.name+"'. BrowserFiles supports loading Keras-style tf.Model artifacts only.")},o.readAsText(e)})]})})},e.prototype.checkManifestAndWeightFiles=function(e,t){for(var n=[],r=t.map(function(e){return Fc(e.name)}),i={},o=0,a=e;o<a.length;o++)a[o].paths.forEach(function(e){var o=Fc(e);if(-1!==n.indexOf(o))throw new Error("Duplicate file basename found in weights manifest: '"+o+"'");if(n.push(o),-1===r.indexOf(o))throw new Error("Weight file with basename '"+o+"' is not provided.");i[e]=t[r.indexOf(o)]});if(n.length!==t.length)throw new Error("Mismatch in the number of files in weights manifest ("+n.length+") and the number of weight files provided ("+t.length+").");return i},e}();function ef(e,t,n,r){!function(e){R(null!=e&&Array.isArray(e)&&e.length>0,function(){return"promises must be a none empty array"})}(e),function(e,t){R(e>=0&&e<=1,function(){return"Progress fraction must be in range [0, 1], but got startFraction "+e}),R(t>=0&&t<=1,function(){return"Progress fraction must be in range [0, 1], but got endFraction "+t}),R(t>=e,function(){return"startFraction must be no more than endFraction, but got startFraction "+e+" and endFraction "+t})}(n=null==n?0:n,r=null==r?1:r);var i=0;return Promise.all(e.map(function(o){return o.then(function(o){var a=n+ ++i/e.length*(r-n);return t(a),o}),o}))}function tf(e,t){return y(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l;return b(this,function(c){switch(c.label){case 0:return null==t&&(t={}),n=null==t.fetchFunc?x().platform.fetch:t.fetchFunc,r=e.map(function(e){return n(e,t.requestInit,{isBinary:!0})}),i=0,o=.5,null!=t.onProgress?[3,2]:[4,Promise.all(r)];case 1:return a=c.sent(),[3,4];case 2:return[4,ef(r,t.onProgress,i,o)];case 3:a=c.sent(),c.label=4;case 4:return s=a.map(function(e){return e.arrayBuffer()}),A=.5,u=1,null!=t.onProgress?[3,6]:[4,Promise.all(s)];case 5:return l=c.sent(),[3,8];case 6:return[4,ef(s,t.onProgress,A,u)];case 7:l=c.sent(),c.label=8;case 8:return[2,l]}})})}function nf(e){var t=this;return function(n,r,i){return void 0===r&&(r=""),y(t,void 0,void 0,function(){var t,o,a,s,A,u,l,c,f,h;return b(this,function(d){switch(d.label){case 0:if(t=n.map(function(){return!1}),o={},a=null!=i?i.map(function(){return!1}):[],s=[],n.forEach(function(e,n){var r=0;e.weights.forEach(function(e){var A="quantization"in e?e.quantization.dtype:e.dtype,u=wc[A]*M(e.shape),l=function(){t[n]=!0,null==o[n]&&(o[n]=[]),o[n].push({manifestEntry:e,groupOffset:r,sizeBytes:u})};null!=i?i.forEach(function(t,n){t===e.name&&(l(),a[n]=!0)}):l(),s.push(e.name),r+=u})}),!a.every(function(e){return e}))throw A=i.filter(function(e,t){return!a[t]}),new Error("Could not find weights in manifest with names: "+A.join(", ")+". \nManifest JSON has weights with names: "+s.join(", ")+".");return u=t.reduce(function(e,t,n){return t&&e.push(n),e},[]),l=[],u.forEach(function(e){n[e].paths.forEach(function(e){var t=r+(r.endsWith("/")?"":"/")+e;l.push(t)})}),[4,e(l)];case 1:return c=d.sent(),f={},h=0,u.forEach(function(e){for(var t=n[e].paths.length,r=0,i=0;i<t;i++)r+=c[h+i].byteLength;for(var a=new ArrayBuffer(r),s=new Uint8Array(a),A=0,u=0;u<t;u++){var l=new Uint8Array(c[h+u]);s.set(l,A),A+=l.byteLength}o[e].forEach(function(e){var t=yc(a.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(var n in t)f[n]=t[n]}),h+=t}),[2,f]}})})}}Sc.registerSaveRouter(function(e){return x().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Zc.URL_SCHEME)?function(e){return void 0===e&&(e="model"),new Zc(e)}(e.slice(Zc.URL_SCHEME.length)):null});var rf=function(){function e(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,null!=t.fetchFunc?(R("function"==typeof t.fetchFunc,function(){return"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"}),this.fetch=t.fetchFunc):this.fetch=x().platform.fetch,R(null!=e&&e.length>0,function(){return"URL path for http must not be null, undefined or empty."}),Array.isArray(e)&&R(2===e.length,function(){return"URL paths for http must have a length of 2, (actual length is "+e.length+")."}),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}return e.prototype.save=function(e){return y(this,void 0,void 0,function(){var t,n,r,i;return b(this,function(o){switch(o.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,userDefinedMetadata:e.userDefinedMetadata,weightsManifest:n},t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,this.fetch(this.path,t)];case 1:if((i=o.sent()).ok)return[2,{modelArtifactsInfo:Ec(e),responses:[i]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+i.status+".")}})})},e.prototype.load=function(){return y(this,void 0,void 0,function(){var e,t,n,r,i,o,a,s,A,u,l,c;return b(this,function(f){switch(f.label){case 0:return[4,this.fetch(this.path,this.requestInit)];case 1:if(!(e=f.sent()).ok)throw new Error("Request to "+this.path+" failed with status code "+e.status+". Please verify this URL points to the model JSON of the model to load.");f.label=2;case 2:return f.trys.push([2,4,,5]),[4,e.json()];case 3:return t=f.sent(),[3,5];case 4:throw f.sent(),n="Failed to parse model JSON of response from "+this.path+".",this.path.endsWith(".pb")?n+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":n+=" Please make sure the server is serving valid JSON for this request.",new Error(n);case 5:if(r=t.modelTopology,i=t.weightsManifest,o=t.generatedBy,a=t.convertedBy,s=t.format,A=t.userDefinedMetadata,null==r&&null==i)throw new Error("The JSON from HTTP path "+this.path+" contains neither model topology or manifest for weights.");return null==i?[3,7]:[4,this.loadWeights(i)];case 6:c=f.sent(),u=c[0],l=c[1],f.label=7;case 7:return[2,{modelTopology:r,weightSpecs:u,weightData:l,userDefinedMetadata:A,generatedBy:o,convertedBy:a,format:s}]}})})},e.prototype.loadWeights=function(e){return y(this,void 0,void 0,function(){var t,n,r,i,o,a,s,A,u,l,c;return b(this,function(f){switch(f.label){case 0:for(t=Array.isArray(this.path)?this.path[1]:this.path,n=function(e){var t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}(t),r=n[0],i=n[1],o=this.weightPathPrefix||r,a=[],s=0,A=e;s<A.length;s++)u=A[s],a.push.apply(a,u.weights);return l=[],e.forEach(function(e){e.paths.forEach(function(e){l.push(o+e+i)})}),[4,tf(l,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})];case 1:return c=f.sent(),[2,[a,Cc(c)]]}})})},e.URL_SCHEME_REGEX=/^https?:\/\//,e}();function of(e){return null!=e.match(rf.URL_SCHEME_REGEX)}var af=function(e,t){return"undefined"==typeof fetch?null:(Array.isArray(e)?e.every(function(e){return of(e)}):of(e))?sf(e,{onProgress:t}):null};function sf(e,t){return new rf(e,t)}Sc.registerSaveRouter(af),Sc.registerLoadRouter(af);var Af,uf=function(){function e(e){this.modelArtifacts=e}return e.prototype.load=function(){return y(this,void 0,void 0,function(){return b(this,function(e){return[2,this.modelArtifacts]})})},e}(),lf=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){return[2,this.saveHandler(e)]})})},e}(),cf=Object.freeze({browserFiles:function(e){return new $c(e)},browserHTTPRequest:function(e,t){return sf(e,t)},concatenateArrayBuffers:Cc,decodeWeights:yc,encodeWeights:function(e,t){return y(this,void 0,void 0,function(){var n,r,i,o,a,s=this;return b(this,function(A){switch(A.label){case 0:for(n=[],r=[],i=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e),o=function(o){var a=i[o],A=Array.isArray(e)?e[o].tensor:e[a];if("float32"!==A.dtype&&"int32"!==A.dtype&&"bool"!==A.dtype&&"string"!==A.dtype)throw new Error("Unsupported dtype in weight '"+a+"': "+A.dtype);var u={name:a,shape:A.shape,dtype:A.dtype};if("string"===A.dtype){var l=new Promise(function(e){return y(s,void 0,void 0,function(){var t,n,r,i,o,a,s;return b(this,function(u){switch(u.label){case 0:return[4,A.bytes()];case 1:for(t=u.sent(),n=t.reduce(function(e,t){return e+t.length},0)+4*t.length,r=new Uint8Array(n),i=0,o=0;o<t.length;o++)a=t[o],s=new Uint8Array(new Uint32Array([a.length]).buffer),r.set(s,i),i+=4,r.set(a,i),i+=a.length;return e(r),[2]}})})});r.push(l)}else r.push(A.data());null!=t&&(u.group=t),n.push(u)},a=0;a<i.length;++a)o(a);return[4,Promise.all(r)];case 1:return[2,{data:bc(A.sent()),specs:n}]}})})},fromMemory:function(e,t,n,r){return 1===arguments.length?null!=e.modelTopology||null!=e.weightSpecs?new uf(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new uf({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new uf({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r}))},getLoadHandlers:function(e,t){return Sc.getLoadHandlers(e,t)},getModelArtifactsInfoForJSON:Ec,getSaveHandlers:function(e){return Sc.getSaveHandlers(e)},http:sf,isHTTPScheme:of,loadWeights:function(e,t,n,r){return void 0===t&&(t=""),y(this,void 0,void 0,function(){return b(this,function(i){return[2,nf(function(e){return tf(e,{requestInit:r})})(e,t,n)]})})},registerLoadRouter:function(e){return Sc.registerLoadRouter(e)},registerSaveRouter:function(e){return Sc.registerSaveRouter(e)},weightsLoaderFactory:nf,withSaveHandler:function(e){return new lf(e)},copyModel:function(e,t){return y(this,void 0,void 0,function(){return b(this,function(n){return[2,Nc(e,t,!1)]})})},listModels:function(){return y(this,void 0,void 0,function(){var e,t,n,r,i,o,a;return b(this,function(s){switch(s.label){case 0:e=_c.getSchemes(),t={},n=0,r=e,s.label=1;case 1:return n<r.length?(i=r[n],[4,_c.getManager(i).listModels()]):[3,4];case 2:for(a in o=s.sent())t[i+kc+a]=o[a];s.label=3;case 3:return n++,[3,1];case 4:return[2,t]}})})},moveModel:function(e,t){return y(this,void 0,void 0,function(){return b(this,function(n){return[2,Nc(e,t,!0)]})})},removeModel:function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){return t=Ic(e),[2,_c.getManager(t.scheme).removeModel(t.path)]})})}}),ff=gn({confusionMatrix_:function(e,t,n){var r=rn(e,"labels","confusionMatrix"),i=rn(t,"predictions","confusionMatrix");R(null==n||n>0&&Number.isInteger(n),function(){return"If provided, numClasses must be a positive integer, but got "+n}),R(1===r.rank,function(){return"Expected the rank of labels to be 1, but got "+r.rank}),R(1===i.rank,function(){return"Expected the rank of predictions to be 1, but got "+i.rank}),R(r.shape[0]===i.shape[0],function(){return"Mismatch in the number of examples: "+r.shape[0]+" vs. "+i.shape[0]+". Labels and predictions should have the same number of elements."}),R(n>0&&Number.isInteger(n),function(){return"numClasses is required to be a positive integer, but got "+n});var o=sr(r.asType("int32"),n),a=sr(i.asType("int32"),n);return o.transpose().matMul(a).asType("int32")}}),hf=(Object.freeze({confusionMatrix:ff}),gn({fromPixels_:function(e,t){if(void 0===t&&(t=3),t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n=!1,r=!1,i=!1,o=!1,a=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)i=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)o=!0;else{if(null==e.getContext)throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was "+e.constructor.name);a=!0}if(i&&i&&e.readyState<2)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.");if(null!=S("FromPixels",Ve.backendName))return Ve.runKernel("FromPixels",{pixels:e},{numChannels:t});var s,A,u=i?[e.videoWidth,e.videoHeight]:[e.width,e.height],l=u[0],c=u[1];if(a?s=e.getContext("2d").getImageData(0,0,l,c).data:r||n?s=e.data:(o||i)&&(null==Af&&(Af=document.createElement("canvas").getContext("2d")),Af.canvas.width=l,Af.canvas.height=c,Af.drawImage(e,0,0,l,c),s=Af.getImageData(0,0,l,c).data),4===t)A=new Int32Array(s);else{var f=l*c;A=new Int32Array(f*t);for(var h=0;h<f;h++)for(var d=0;d<t;++d)A[h*t+d]=s[4*h+d]}return Fn(A,[c,l,t],"int32")}})),df=Object.freeze({toPixels:function(e,t){return y(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,B,x,C,F;return b(this,function(b){switch(b.label){case 0:if(n=rn(e,"img","toPixels"),e instanceof Ie||(n=n.toInt()),2!==n.rank&&3!==n.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+n.rank+".");if(r=n.shape.slice(0,2),i=r[0],o=r[1],(a=2===n.rank?1:n.shape[2])>4||2===a)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+a);return[4,n.data()];case 1:return s=b.sent(),A=n.min(),u=n.max(),[4,Promise.all([A.data(),u.data()])];case 2:if(l=b.sent(),c=l[0],f=l[1],h=c[0],d=f[0],A.dispose(),u.dispose(),"float32"===n.dtype){if(h<0||d>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+h+" - "+d+"].")}else{if("int32"!==n.dtype)throw new Error("Unsupported type for toPixels: "+n.dtype+". Please use float32 or int32 tensors.");if(h<0||d>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+h+" - "+d+"].")}for(p="float32"===n.dtype?255:1,g=new Uint8ClampedArray(o*i*4),m=0;m<i*o;++m)v=void 0,w=void 0,y=void 0,B=void 0,1===a?(v=s[m]*p,w=s[m]*p,y=s[m]*p,B=255):3===a?(v=s[3*m]*p,w=s[3*m+1]*p,y=s[3*m+2]*p,B=255):4===a&&(v=s[4*m]*p,w=s[4*m+1]*p,y=s[4*m+2]*p,B=s[4*m+3]*p),g[0+(x=4*m)]=Math.round(v),g[x+1]=Math.round(w),g[x+2]=Math.round(y),g[x+3]=Math.round(B);return null!=t&&(t.width=o,t.height=i,C=t.getContext("2d"),F=new ImageData(g,o,i),C.putImageData(F,0,0)),n!==e&&n.dispose(),[2,g]}})})},fromPixels:hf}),pf=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),gf=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}();function mf(e){R(null!=e.className,function(){return"Class being registered does not have the static className property defined."}),R("string"==typeof e.className,function(){return"className is required to be a string, but got type "+typeof e.className}),R(e.className.length>0,function(){return"Class being registered has an empty-string as its className, which is disallowed."}),gf.register(e)}Object.freeze({Serializable:pf,SerializationMap:gf,registerClass:mf});function vf(){return 32===Ve.backend.floatPrecision()?.001:.1}function wf(e,t,n){var r=!0;if((te(e)||te(t))&&(r=!1),te(e)&&te(t)&&(r=!0),r){var i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error("Arrays are of different type. Actual: "+i+". Expected: "+o)}if(Array.isArray(e)&&Array.isArray(t)){var a=tn(e),s=tn(t);if(!H(a,s))throw new Error("Arrays have different shapes. Actual: ["+a+"]. Expected: ["+s+"]")}var A=te(e)?e:O(e),u=te(t)?t:O(t);if(A.length!==u.length)throw new Error("Arrays have different lengths actual: "+A.length+" vs expected: "+u.length+".\nActual: "+A+".\nExpected: "+u+".");for(var l=0;l<u.length;++l){var c=A[l],f=u[l];if(!n(c,f))throw new Error("Arrays differ: actual["+l+"] = "+c+", expected["+l+"] = "+f+".\nActual: "+A+".\nExpected: "+u+".")}}function yf(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}Object.freeze({TEST_EPSILON_FLOAT16:.1,expectArraysClose:function(e,t,n){return null==n&&(n=vf()),wf(e,t,function(e,t){return yf(e,t,n)})},testEpsilon:vf,expectPromiseToFail:function(e,t){e().then(function(){return t.fail()},function(){return t()})},expectArraysEqual:function(e,t){var n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return ie(e)||ie(e[0])||ie(t)||ie(t[0])?wf(e,n,function(e,t){return e==t}):wf(e,t,function(e,t){return yf(e,t,0)})},expectNumbersClose:function(e,t,n){if(null==n&&(n=vf()),!yf(e,t,n))throw new Error("Numbers differ: actual === "+e+", expected === "+t)},expectValuesInRange:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]<t||e[r]>n)throw new Error("Value out of range:"+e[r]+" low: "+t+", high: "+n)},expectArrayBuffersEqual:function(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}}),Object.freeze({gpgpu_util:na,webgl_util:Xt,forceHalfFloat:function(){x().set("WEBGL_FORCE_F16_TEXTURES",!0)},MathBackendWebGL:ms,setWebGLContext:et,GPGPUContext:ra});var bf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.minimize=function(e,t,n){void 0===t&&(t=!1);var r=this.computeGradients(e,n),i=r.value,o=r.grads;if(null!=n){var a=n.map(function(e){return{name:e.name,tensor:o[e.name]}});this.applyGradients(a)}else this.applyGradients(o);return $t(o),t?i:(i.dispose(),null)},Object.defineProperty(t.prototype,"iterations",{get:function(){return null==this.iterations_&&(this.iterations_=0),this.iterations_},enumerable:!0,configurable:!0}),t.prototype.incrementIterations=function(){this.iterations_=this.iterations+1},t.prototype.computeGradients=function(e,t){return function(e,t){R(Ae(e),function(){return"The f passed in variableGrads(f) must be a function"}),R(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof Re}),function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"});var n=null!=t;if(!n)for(var r in t=[],Ve.registeredVariables)t.push(Ve.registeredVariables[r]);var i=n?t.filter(function(e){return!e.trainable}):null,o=t.length;R((t=t.filter(function(e){return e.trainable})).length>0,function(){return"variableGrads() expects at least one of the input variables to be trainable, but none of the "+o+" variables is trainable."});var a=Ve.gradients(e,t,null,!0),s=a.value,A=a.grads;R(A.some(function(e){return null!=e}),function(){return"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."}),R(0===s.rank,function(){return"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+s.rank+" tensor"});var u={};return t.forEach(function(e,t){null!=A[t]&&(u[e.name]=A[t])}),null!=i&&i.forEach(function(e){return u[e.name]=null}),{value:s,grads:u}}(e,t)},t.prototype.dispose=function(){null!=this.iterations_&&$t(this.iterations_)},t.prototype.saveIterations=function(){return y(this,void 0,void 0,function(){return b(this,function(e){return null==this.iterations_&&(this.iterations_=0),[2,{name:"iter",tensor:Bn(this.iterations_,"int32")}]})})},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){return b(this,function(e){throw new Error("getWeights() is not implemented for this optimizer yet.")})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){return b(this,function(e){throw new Error("setWeights() is not implemented for this optimizer class "+this.getClassName())})})},t.prototype.extractIterations=function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){switch(n.label){case 0:return t=this,[4,e[0].tensor.data()];case 1:return t.iterations_=n.sent()[0],[2,e.slice(1)]}})})},t}(pf);Object.defineProperty(bf,Symbol.hasInstance,{value:function(e){return null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients}});var Bf=function(e){function t(t,n,r){void 0===r&&(r=null);var i=e.call(this)||this;return i.learningRate=t,i.rho=n,i.epsilon=r,i.accumulatedGrads=[],i.accumulatedUpdates=[],null==r&&(i.epsilon=Ve.backend.epsilon()),i}return w(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Ve.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:n+"/accum_grad",variable:Zt(function(){return Un(i).variable(!1)})}),null==t.accumulatedUpdates[r]&&(t.accumulatedUpdates[r]={originalName:n+"/accum_var",variable:Zt(function(){return Un(i).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedGrads[r].variable,s=t.accumulatedUpdates[r].variable;Zt(function(){var e=a.mul(t.rho).add(o.square().mul(1-t.rho)),n=s.add(t.epsilon).sqrt().div(a.add(t.epsilon).sqrt()).mul(o),r=s.mul(t.rho).add(n.square().mul(1-t.rho));a.assign(e),s.assign(r);var A=n.mul(-t.learningRate).add(i);i.assign(A)})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedUpdates&&($t(this.accumulatedGrads.map(function(e){return e.variable})),$t(this.accumulatedUpdates.map(function(e){return e.variable})))},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=this.accumulatedGrads.concat(this.accumulatedUpdates),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(e)];case 1:return e=n.sent(),t=e.length/2,this.accumulatedGrads=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedUpdates=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className="Adadelta",t}(bf);mf(Bf);var xf=function(e){function t(t,n){void 0===n&&(n=.1);var r=e.call(this)||this;return r.learningRate=t,r.initialAccumulatorValue=n,r.accumulatedGrads=[],r}return w(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Ve.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:n+"/accumulator",variable:Zt(function(){return _n(i.shape,t.initialAccumulatorValue).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedGrads[r].variable;Zt(function(){var e=a.add(o.square());a.assign(e);var n=o.div(e.add(Ve.backend.epsilon()).sqrt()).mul(-t.learningRate).add(i);i.assign(n)})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedGrads&&$t(this.accumulatedGrads.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(this.accumulatedGrads.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:return e=t.sent(),this.accumulatedGrads=e.map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className="Adagrad",t}(bf);mf(xf);var Cf=function(e){function t(t,n,r,i){void 0===i&&(i=null);var o=e.call(this)||this;return o.learningRate=t,o.beta1=n,o.beta2=r,o.epsilon=i,o.accumulatedFirstMoment=[],o.accumulatedSecondMoment=[],Zt(function(){o.accBeta1=Bn(n).variable(),o.accBeta2=Bn(r).variable()}),null==i&&(o.epsilon=Ve.backend.epsilon()),o}return w(t,e),t.prototype.applyGradients=function(e){var t=this,n=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e);Zt(function(){var r=MA(1,t.accBeta1),i=MA(1,t.accBeta2);n.forEach(function(n,o){var a=Ve.registeredVariables[n];null==t.accumulatedFirstMoment[o]&&(t.accumulatedFirstMoment[o]={originalName:n+"/m",variable:Zt(function(){return Un(a).variable(!1)})}),null==t.accumulatedSecondMoment[o]&&(t.accumulatedSecondMoment[o]={originalName:n+"/v",variable:Zt(function(){return Un(a).variable(!1)})});var s=Array.isArray(e)?e[o].tensor:e[n];if(null!=s){var A=t.accumulatedFirstMoment[o].variable,u=t.accumulatedSecondMoment[o].variable,l=A.mul(t.beta1).add(s.mul(1-t.beta1)),c=u.mul(t.beta2).add(s.square().mul(1-t.beta2)),f=l.div(r),h=c.div(i);A.assign(l),u.assign(c);var d=f.div(h.sqrt().add(t.epsilon)).mul(-t.learningRate).add(a);a.assign(d)}}),t.accBeta1.assign(t.accBeta1.mul(t.beta1)),t.accBeta2.assign(t.accBeta2.mul(t.beta2))}),this.incrementIterations()},t.prototype.dispose=function(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&$t(this.accumulatedFirstMoment.map(function(e){return e.variable})),null!=this.accumulatedSecondMoment&&$t(this.accumulatedSecondMoment.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=this.accumulatedFirstMoment.concat(this.accumulatedSecondMoment),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){var t,n=this;return b(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(e)];case 1:return e=r.sent(),Zt(function(){n.accBeta1.assign(TA(n.beta1,n.iterations_+1)),n.accBeta2.assign(TA(n.beta2,n.iterations_+1))}),t=e.length/2,this.accumulatedFirstMoment=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedSecondMoment=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className="Adam",t}(bf);mf(Cf);var Ff=function(e){function t(t,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=0);var a=e.call(this)||this;return a.learningRate=t,a.beta1=n,a.beta2=r,a.epsilon=i,a.decay=o,a.accumulatedFirstMoment=[],a.accumulatedWeightedInfNorm=[],Zt(function(){a.iteration=Bn(0).variable(),a.accBeta1=Bn(n).variable()}),null==i&&(a.epsilon=Ve.backend.epsilon()),a}return w(t,e),t.prototype.applyGradients=function(e){var t=this,n=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e);Zt(function(){var r=MA(1,t.accBeta1),i=FA(-t.learningRate,t.iteration.mul(t.decay).add(1));n.forEach(function(n,o){var a=Ve.registeredVariables[n];null==t.accumulatedFirstMoment[o]&&(t.accumulatedFirstMoment[o]={originalName:n+"/m",variable:Un(a).variable(!1)}),null==t.accumulatedWeightedInfNorm[o]&&(t.accumulatedWeightedInfNorm[o]={originalName:n+"/v",variable:Un(a).variable(!1)});var s=Array.isArray(e)?e[o].tensor:e[n];if(null!=s){var A=t.accumulatedFirstMoment[o].variable,u=t.accumulatedWeightedInfNorm[o].variable,l=A.mul(t.beta1).add(s.mul(1-t.beta1)),c=u.mul(t.beta2),f=s.abs(),h=c.maximum(f);A.assign(l),u.assign(h);var d=i.div(r).mul(l.div(h.add(t.epsilon))).add(a);a.assign(d)}}),t.iteration.assign(t.iteration.add(1)),t.accBeta1.assign(t.accBeta1.mul(t.beta1))}),this.incrementIterations()},t.prototype.dispose=function(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&$t(this.accumulatedFirstMoment.map(function(e){return e.variable})),null!=this.accumulatedWeightedInfNorm&&$t(this.accumulatedWeightedInfNorm.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){return b(this,function(e){throw new Error("getWeights() is not implemented for Adamax yet.")})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){return b(this,function(e){throw new Error("setWeights() is not implemented for Adamax yet.")})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className="Adamax",t}(bf);mf(Ff);var Ef=function(e){function t(t){var n=e.call(this)||this;return n.learningRate=t,n.setLearningRate(t),n}return w(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=Ve.registeredVariables[n];Zt(function(){var e=t.c.mul(i).add(o);o.assign(e)})}}),this.incrementIterations()},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=function(e){return Ve.keep(e)}(Bn(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()]]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:if(0!==(e=t.sent()).length)throw new Error("SGD optimizer does not have settable weights.");return[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className="SGD",t}(bf);mf(Ef);var Sf=function(e){function t(t,n,r){void 0===r&&(r=!1);var i=e.call(this,t)||this;return i.learningRate=t,i.momentum=n,i.useNesterov=r,i.accumulations=[],i.m=Bn(i.momentum),i}return w(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Ve.registeredVariables[n];null==t.accumulations[r]&&(t.accumulations[r]={originalName:n+"/momentum",variable:Zt(function(){return Un(i).variable(!1)})});var o=t.accumulations[r].variable,a=Array.isArray(e)?e[r].tensor:e[n];null!=a&&Zt(function(){var e,n=t.m.mul(o).add(a);e=t.useNesterov?t.c.mul(a.add(n.mul(t.m))).add(i):t.c.mul(n).add(i),o.assign(n),i.assign(e)})}),this.incrementIterations()},t.prototype.dispose=function(){this.m.dispose(),null!=this.accumulations&&$t(this.accumulations.map(function(e){return e.variable}))},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(this.accumulations.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:return e=t.sent(),this.accumulations=e.map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className="Momentum",t}(Ef);mf(Sf);var kf=function(e){function t(t,n,r,i,o){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===i&&(i=null),void 0===o&&(o=!1);var a=e.call(this)||this;if(a.learningRate=t,a.decay=n,a.momentum=r,a.epsilon=i,a.accumulatedMeanSquares=[],a.accumulatedMoments=[],a.accumulatedMeanGrads=[],a.centered=o,null==i&&(a.epsilon=Ve.backend.epsilon()),null==t)throw new Error("learningRate for RMSPropOptimizer must be defined.");return a}return w(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Ve.registeredVariables[n];null==t.accumulatedMeanSquares[r]&&(t.accumulatedMeanSquares[r]={originalName:n+"/rms",variable:Zt(function(){return Un(i).variable(!1)})}),null==t.accumulatedMoments[r]&&(t.accumulatedMoments[r]={originalName:n+"/momentum",variable:Zt(function(){return Un(i).variable(!1)})}),null==t.accumulatedMeanGrads[r]&&t.centered&&(t.accumulatedMeanGrads[r]={originalName:n+"/mg",variable:Zt(function(){return Un(i).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedMeanSquares[r].variable,s=t.accumulatedMoments[r].variable;Zt(function(){var e=a.mul(t.decay).add(o.square().mul(1-t.decay));if(t.centered){var n=t.accumulatedMeanGrads[r].variable,A=n.mul(t.decay).add(o.mul(1-t.decay)),u=s.mul(t.momentum).add(o.mul(t.learningRate).div(e.sub(A.square().add(t.epsilon)).sqrt()));a.assign(e),n.assign(A),s.assign(u);var l=i.sub(u);i.assign(l)}else{var c=a.mul(t.decay).add(o.square().mul(1-t.decay));u=s.mul(t.momentum).add(o.mul(t.learningRate).div(c.add(t.epsilon).sqrt())),a.assign(c),s.assign(u),l=i.sub(u),i.assign(l)}})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedMeanSquares&&$t(this.accumulatedMeanSquares.map(function(e){return e.variable})),null!=this.accumulatedMeanGrads&&this.centered&&$t(this.accumulatedMeanGrads.map(function(e){return e.variable})),null!=this.accumulatedMoments&&$t(this.accumulatedMoments.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=this.accumulatedMeanSquares.concat(this.accumulatedMoments),this.centered&&e.push.apply(e,this.accumulatedMeanGrads),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return y(this,void 0,void 0,function(){var t;return b(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(e)];case 1:return e=n.sent(),t=this.centered?e.length/3:e.length/2,this.accumulatedMeanSquares=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedMoments=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className="RMSProp",t}(bf);mf(kf);var _f=function(){function e(){}return e.sgd=function(e){return new Ef(e)},e.momentum=function(e,t,n){return void 0===n&&(n=!1),new Sf(e,t,n)},e.rmsprop=function(e,t,n,r,i){return void 0===t&&(t=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===i&&(i=!1),new kf(e,t,n,r,i)},e.adam=function(e,t,n,r){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new Cf(e,t,n,r)},e.adadelta=function(e,t,n){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===n&&(n=null),new Bf(e,t,n)},e.adamax=function(e,t,n,r,i){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===i&&(i=0),new Ff(e,t,n,r,i)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new xf(e,t)},e}();_f.sgd,_f.momentum,_f.adadelta,_f.adagrad,_f.rmsprop,_f.adamax,_f.adam,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate&&setImmediate;Ie.prototype.squaredDifference=function(e){return ys(this,e)},ke=rc;var If=function(e,t){return If=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},If(e,t)};function Nf(e,t){function n(){this.constructor=e}If(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Uf=function(){return Uf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Uf.apply(this,arguments)};function Lf(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{A(r.next(e))}catch(w){o(w)}}function s(e){try{A(r.throw(e))}catch(w){o(w)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}A((r=r.apply(e,t||[])).next())})}function Qf(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(w){o=[6,w],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function Df(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var Rf=function(){function e(e,t){if(!Kf(e)||!Kf(t))throw new Error("Dimensions.constructor - expected width and height to be valid numbers, instead have "+JSON.stringify({width:e,height:t}));this._width=e,this._height=t}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.reverse=function(){return new e(1/this.width,1/this.height)},e}();function Tf(e,t){return e instanceof Ie&&e.shape.length===t}function Pf(e){return Tf(e,3)}function Of(e){return Tf(e,4)}function Mf(e){return e%2===0}function Hf(e){return e&&e.width&&e.height}function jf(e){return e.reduce(function(e,t){return e.add(t)},new Vf(0,0)).div(new Vf(e.length,e.length))}function zf(e,t,n){return Array(e).fill(0).map(function(e,r){return t+r*n})}function Kf(e){return!!e&&e!==1/0&&e!==-1/0&&!isNaN(e)||0===e}function Wf(e){return Kf(e)&&0<=e&&e<=1}var Vf=function(){function e(e,t){this._x=e,this._y=t}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.sub=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.mul=function(t){return new e(this.x*t.x,this.y*t.y)},e.prototype.div=function(t){return new e(this.x/t.x,this.y/t.y)},e.prototype.abs=function(){return new e(Math.abs(this.x),Math.abs(this.y))},e.prototype.magnitude=function(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y))},e}(),Gf=function(){function e(t,n){void 0===n&&(n=!0);var r=t||{},i=[r.left,r.top,r.right,r.bottom].every(Kf),o=[r.x,r.y,r.width,r.height].every(Kf);if(!o&&!i)throw new Error("Box.constructor - expected box to be IBoundingBox | IRect, instead have "+JSON.stringify(r));var a=o?[r.x,r.y,r.width,r.height]:[r.left,r.top,r.right-r.left,r.bottom-r.top],s=a[0],A=a[1],u=a[2],l=a[3];e.assertIsValidBox({x:s,y:A,width:u,height:l},"Box.constructor",n),this._x=s,this._y=A,this._width=u,this._height=l}return e.isRect=function(e){return!!e&&[e.x,e.y,e.width,e.height].every(Kf)},e.assertIsValidBox=function(t,n,r){if(void 0===r&&(r=!1),!e.isRect(t))throw new Error(n+" - invalid box: "+JSON.stringify(t)+", expected object with properties x, y, width, height");if(!r&&(t.width<0||t.height<0))throw new Error(n+" - width ("+t.width+") and height ("+t.height+") must be positive numbers")},Object.defineProperty(e.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"area",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topLeft",{get:function(){return new Vf(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topRight",{get:function(){return new Vf(this.right,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomLeft",{get:function(){return new Vf(this.left,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomRight",{get:function(){return new Vf(this.right,this.bottom)},enumerable:!0,configurable:!0}),e.prototype.round=function(){var t=[this.x,this.y,this.width,this.height].map(function(e){return Math.round(e)});return new e({x:t[0],y:t[1],width:t[2],height:t[3]})},e.prototype.floor=function(){var t=[this.x,this.y,this.width,this.height].map(function(e){return Math.floor(e)});return new e({x:t[0],y:t[1],width:t[2],height:t[3]})},e.prototype.toSquare=function(){var t=this,n=t.x,r=t.y,i=t.width,o=t.height,a=Math.abs(i-o);return i<o&&(n-=a/2,i+=a),o<i&&(r-=a/2,o+=a),new e({x:n,y:r,width:i,height:o})},e.prototype.rescale=function(t){var n=Hf(t)?t.width:t,r=Hf(t)?t.height:t;return new e({x:this.x*n,y:this.y*r,width:this.width*n,height:this.height*r})},e.prototype.pad=function(t,n){var r=[this.x-t/2,this.y-n/2,this.width+t,this.height+n];return new e({x:r[0],y:r[1],width:r[2],height:r[3]})},e.prototype.clipAtImageBorders=function(t,n){var r=this,i=r.x,o=r.y,a=r.right,s=r.bottom,A=Math.max(i,0),u=Math.max(o,0),l=a-A,c=s-u;return new e({x:A,y:u,width:Math.min(l,t-A),height:Math.min(c,n-u)}).floor()},e.prototype.shift=function(t,n){var r=this.width,i=this.height;return new e({x:this.x+t,y:this.y+n,width:r,height:i})},e.prototype.padAtBorders=function(e,t){var n=this.width+1,r=this.height+1,i=n,o=r,a=this.left,s=this.top,A=this.right,u=this.bottom;return A>t&&(i=-A+t+n,A=t),u>e&&(o=-u+e+r,u=e),a<1&&(o=2-a,a=1),s<1&&(o=2-s,s=1),{dy:1,edy:o,dx:1,edx:i,y:s,ey:u,x:a,ex:A,w:n,h:r}},e.prototype.calibrate=function(t){return new e({left:this.left+t.left*this.width,top:this.top+t.top*this.height,right:this.right+t.right*this.width,bottom:this.bottom+t.bottom*this.height}).toSquare().round()},e}(),qf=function(e){function t(t,n,r,i,o){return void 0===o&&(o=!1),e.call(this,{left:t,top:n,right:r,bottom:i},o)||this}return Nf(t,e),t}(Gf),Xf=function(){function e(e,t,n,r,i){this._imageDims=new Rf(i.width,i.height),this._score=e,this._classScore=t,this._className=n,this._box=new Gf(r).rescale(this._imageDims)}return Object.defineProperty(e.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"box",{get:function(){return this._box},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageDims",{get:function(){return this._imageDims},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageWidth",{get:function(){return this.imageDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageHeight",{get:function(){return this.imageDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"relativeBox",{get:function(){return new Gf(this._box).rescale(this.imageDims.reverse())},enumerable:!0,configurable:!0}),e.prototype.forSize=function(t,n){return new e(this.score,this.classScore,this.className,this.relativeBox,{width:t,height:n})},e}(),Yf=function(e){function t(t,n,r){return e.call(this,t,t,"",n,r)||this}return Nf(t,e),t.prototype.forSize=function(n,r){var i=e.prototype.forSize.call(this,n,r);return new t(i.score,i.relativeBox,i.imageDims)},t}(Xf);function Jf(e,t,n){void 0===n&&(n=!0);var r=Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top));return n?r/(e.area+t.area-r):r/Math.min(e.area,t.area)}function Zf(e,t,n,r){void 0===r&&(r=!0);for(var i=t.map(function(e,t){return{score:e,boxIndex:t}}).sort(function(e,t){return e.score-t.score}).map(function(e){return e.boxIndex}),o=[],a=function(){var t=i.pop();o.push(t);for(var a=i,s=[],A=0;A<a.length;A++){var u=a[A],l=e[t],c=e[u];s.push(Jf(l,c,r))}i=i.filter(function(e,t){return s[t]<=n})};i.length>0;)a();return o}function $f(e,t){return Zt(function(){var n=t[0],r=t[1],i=t[2],o=_n(Df(e.shape.slice(0,3),[1]),n),a=_n(Df(e.shape.slice(0,3),[1]),r),s=_n(Df(e.shape.slice(0,3),[1]),i),A=Ln([o,a,s],3);return MA(e,A)})}function eh(e){return 1/(1+Math.exp(-e))}var th,nh=function(e){function t(t,n,r,i,o){return void 0===o&&(o=!1),e.call(this,{x:t,y:n,width:r,height:i},o)||this}return Nf(t,e),t}(Gf),rh=function(){function e(e,t,n){void 0===n&&(n=new Vf(0,0));var r=t.width,i=t.height;this._imgDims=new Rf(r,i),this._shift=n,this._positions=e.map(function(e){return e.mul(new Vf(r,i)).add(n)})}return Object.defineProperty(e.prototype,"shift",{get:function(){return new Vf(this._shift.x,this._shift.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageWidth",{get:function(){return this._imgDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageHeight",{get:function(){return this._imgDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positions",{get:function(){return this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"relativePositions",{get:function(){var e=this;return this._positions.map(function(t){return t.sub(e._shift).div(new Vf(e.imageWidth,e.imageHeight))})},enumerable:!0,configurable:!0}),e.prototype.forSize=function(e,t){return new this.constructor(this.relativePositions,{width:e,height:t})},e.prototype.shiftBy=function(e,t){return new this.constructor(this.relativePositions,this._imgDims,new Vf(e,t))},e.prototype.shiftByPoint=function(e){return this.shiftBy(e.x,e.y)},e.prototype.align=function(e,t){if(void 0===t&&(t={}),e){var n=e instanceof Yf?e.box.floor():new Gf(e);return this.shiftBy(n.x,n.y).align(null,t)}var r=Object.assign({},{useDlibAlignment:!1,minBoxPadding:.2},t),i=r.useDlibAlignment,o=r.minBoxPadding;return i?this.alignDlib():this.alignMinBbox(o)},e.prototype.alignDlib=function(){var e=this.getRefPointsForAlignment(),t=e[0],n=e[1],r=e[2],i=function(e){return r.sub(e).magnitude()},o=(i(t)+i(n))/2,a=Math.floor(o/.45),s=jf(e),A=Math.floor(Math.max(0,s.x-.5*a)),u=Math.floor(Math.max(0,s.y-.43*a));return new nh(A,u,Math.min(a,this.imageWidth+A),Math.min(a,this.imageHeight+u))},e.prototype.alignMinBbox=function(e){var t=function(e){var t=e.map(function(e){return e.x}),n=e.map(function(e){return e.y}),r=t.reduce(function(e,t){return t<e?t:e},1/0),i=n.reduce(function(e,t){return t<e?t:e},1/0),o=t.reduce(function(e,t){return e<t?t:e},0),a=n.reduce(function(e,t){return e<t?t:e},0);return new qf(r,i,o,a)}(this.positions);return t.pad(t.width*e,t.height*e)},e.prototype.getRefPointsForAlignment=function(){throw new Error("getRefPointsForAlignment not implemented by base class")},e}(),ih=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.getRefPointsForAlignment=function(){var e=this.positions;return[e[0],e[1],jf([e[3],e[4]])]},t}(rh),oh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.getJawOutline=function(){return this.positions.slice(0,17)},t.prototype.getLeftEyeBrow=function(){return this.positions.slice(17,22)},t.prototype.getRightEyeBrow=function(){return this.positions.slice(22,27)},t.prototype.getNose=function(){return this.positions.slice(27,36)},t.prototype.getLeftEye=function(){return this.positions.slice(36,42)},t.prototype.getRightEye=function(){return this.positions.slice(42,48)},t.prototype.getMouth=function(){return this.positions.slice(48,68)},t.prototype.getRefPointsForAlignment=function(){return[this.getLeftEye(),this.getRightEye(),this.getMouth()].map(jf)},t}(rh),ah=function(){function e(e,t){this._label=e,this._distance=t}return Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"distance",{get:function(){return this._distance},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){return void 0===e&&(e=!0),this.label+(e?" ("+function(e,t){void 0===t&&(t=2);var n=Math.pow(10,t);return Math.floor(e*n)/n}(this.distance)+")":"")},e}(),sh=function(e){function t(t,n){var r=e.call(this,t)||this;return r._label=n,r}return Nf(t,e),t.assertIsValidLabeledBox=function(e,t){if(Gf.assertIsValidBox(e,t),!Kf(e.label))throw new Error(t+" - expected property label ("+e.label+") to be a number")},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),t}(Gf),Ah=function(){function e(e,t){if("string"!==typeof e)throw new Error("LabeledFaceDescriptors - constructor expected label to be a string");if(!Array.isArray(t)||t.some(function(e){return!(e instanceof Float32Array)}))throw new Error("LabeledFaceDescriptors - constructor expected descriptors to be an array of Float32Array");this._label=e,this._descriptors=t}return Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"descriptors",{get:function(){return this._descriptors},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){return{label:this.label,descriptors:this.descriptors.map(function(e){return Array.from(e)})}},e.fromJSON=function(t){var n=t.descriptors.map(function(e){return new Float32Array(e)});return new e(t.label,n)},e}();!function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o._score=r,o._classScore=i,o}Nf(t,e),t.assertIsValidPredictedBox=function(e,t){if(sh.assertIsValidLabeledBox(e,t),!Wf(e.score)||!Wf(e.classScore))throw new Error(t+" - expected properties score ("+e.score+") and ("+e.classScore+") to be a number between [0, 1]")},Object.defineProperty(t.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0})}(sh);function uh(e,t){var n={detection:t};return Object.assign({},e,n)}function lh(){var e=window.fetch||function(){throw new Error("fetch - missing fetch implementation for browser environment")};return{Canvas:HTMLCanvasElement,CanvasRenderingContext2D:CanvasRenderingContext2D,Image:HTMLImageElement,ImageData:ImageData,Video:HTMLVideoElement,createCanvasElement:function(){return document.createElement("canvas")},createImageElement:function(){return document.createElement("img")},fetch:e,readFile:function(){throw new Error("readFile - filesystem not available for browser environment")}}}function ch(e){var t="";if(!e)try{e=n(Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()))}catch(Ov){t=Ov.toString()}var r=e?function(t){return new Promise(function(n,r){e.readFile(t,function(e,t){return e?r(e):n(t)})})}:function(){throw new Error("readFile - failed to require fs in nodejs environment with error: "+t)};return{readFile:r}}function fh(){var e=n.g.Canvas||n.g.HTMLCanvasElement,t=n.g.Image||n.g.HTMLImageElement,r=n.g.fetch||function(){throw new Error("fetch - missing fetch implementation for nodejs environment")},i=ch();return Uf({Canvas:e||function(){},CanvasRenderingContext2D:n.g.CanvasRenderingContext2D||function(){},Image:t||function(){},ImageData:n.g.ImageData||function(){},Video:n.g.HTMLVideoElement||function(){},createCanvasElement:function(){if(e)return new e;throw new Error("createCanvasElement - missing Canvas implementation for nodejs environment")},createImageElement:function(){if(t)return new t;throw new Error("createImageElement - missing Image implementation for nodejs environment")},fetch:r},i)}function hh(){return"object"===typeof window&&"undefined"!==typeof document&&"undefined"!==typeof HTMLImageElement&&"undefined"!==typeof HTMLCanvasElement&&"undefined"!==typeof HTMLVideoElement&&"undefined"!==typeof ImageData&&"undefined"!==typeof CanvasRenderingContext2D}function dh(){return"object"===typeof n.g&&"undefined"!==typeof process&&!!process.version}function ph(e){th=e}function gh(){hh()&&ph(lh()),dh()&&ph(fh())}var mh,vh={getEnv:function(){if(!th)throw new Error("getEnv - environment is not defined, check isNodejs() and isBrowser()");return th},setEnv:ph,initialize:gh,createBrowserEnv:lh,createFileSystem:ch,createNodejsEnv:fh,monkeyPatch:function(e){if(th||gh(),!th)throw new Error("monkeyPatch - environment is not defined, check isNodejs() and isBrowser()");var t=e.Canvas,n=void 0===t?th.Canvas:t,r=e.Image,i=void 0===r?th.Image:r;th.Canvas=n,th.Image=i,th.createCanvasElement=e.createCanvasElement||function(){return new n},th.createImageElement=e.createImageElement||function(){return new i},th.ImageData=e.ImageData||th.ImageData,th.Video=e.Video||th.Video,th.fetch=e.fetch||th.fetch,th.readFile=e.readFile||th.readFile},isBrowser:hh,isNodejs:dh};function wh(e){return vh.isNodejs()||"string"!==typeof e?e:document.getElementById(e)}function yh(e){var t=vh.getEnv(),n=t.Canvas;if(e instanceof t.CanvasRenderingContext2D)return e;var r=wh(e);if(!(r instanceof n))throw new Error("resolveContext2d - expected canvas to be of instance of Canvas");var i=r.getContext("2d");if(!i)throw new Error("resolveContext2d - canvas 2d context is null");return i}gh(),function(e){e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT"}(mh||(mh={}));var bh=function(e){void 0===e&&(e={});var t=e.anchorPosition,n=e.backgroundColor,r=e.fontColor,i=e.fontSize,o=e.fontStyle,a=e.padding;this.anchorPosition=t||mh.TOP_LEFT,this.backgroundColor=n||"rgba(0, 0, 0, 0.5)",this.fontColor=r||"rgba(255, 255, 255, 1)",this.fontSize=i||14,this.fontStyle=o||"Georgia",this.padding=a||4},Bh=function(){function e(t,n,r){void 0===r&&(r={}),this.text="string"===typeof t?[t]:t instanceof e?t.text:t,this.anchor=n,this.options=new bh(r)}return e.prototype.measureWidth=function(e){var t=this.options.padding;return this.text.map(function(t){return e.measureText(t).width}).reduce(function(e,t){return e<t?t:e},0)+2*t},e.prototype.measureHeight=function(){var e=this.options,t=e.fontSize,n=e.padding;return this.text.length*t+2*n},e.prototype.getUpperLeft=function(e,t){var n=this.options.anchorPosition,r=n===mh.BOTTOM_RIGHT||n===mh.TOP_RIGHT,i=n===mh.BOTTOM_LEFT||n===mh.BOTTOM_RIGHT,o=this.measureWidth(e),a=this.measureHeight(),s=r?this.anchor.x-o:this.anchor.x,A=i?this.anchor.y-a:this.anchor.y;if(t){var u=t.width,l=t.height;return{x:Math.max(Math.min(s,u-o),0),y:Math.max(Math.min(A,l-a),0)}}return{x:s,y:A}},e.prototype.draw=function(e){var t=wh(e),n=yh(t),r=this.options,i=r.backgroundColor,o=r.fontColor,a=r.fontSize,s=r.fontStyle,A=r.padding;n.font=a+"px "+s;var u=this.measureWidth(n),l=this.measureHeight();n.fillStyle=i;var c=this.getUpperLeft(n,t);n.fillRect(c.x,c.y,u,l),n.fillStyle=o,this.text.forEach(function(e,t){var r=A+c.x,i=A+c.y+(t+1)*a;n.fillText(e,r,i)})},e}(),xh=function(e){void 0===e&&(e={});var t=e.boxColor,n=e.lineWidth,r=e.label,i=e.drawLabelOptions;this.boxColor=t||"rgba(0, 0, 255, 1)",this.lineWidth=n||2,this.label=r;var o={anchorPosition:mh.BOTTOM_LEFT,backgroundColor:this.boxColor};this.drawLabelOptions=new bh(Object.assign({},o,i))};!function(){function e(e,t){void 0===t&&(t={}),this.box=new Gf(e),this.options=new xh(t)}e.prototype.draw=function(e){var t=yh(e),n=this.options,r=n.boxColor,i=n.lineWidth,o=this.box,a=o.x,s=o.y,A=o.width,u=o.height;t.strokeStyle=r,t.lineWidth=i,t.strokeRect(a,s,A,u);var l=this.options.label;l&&new Bh([l],{x:a-i/2,y:s},this.options.drawLabelOptions).draw(e)}}();function Ch(e){var t=vh.getEnv(),n=t.Image,r=t.Video;return e instanceof n&&e.complete||e instanceof r&&e.readyState>=3}function Fh(e){var t=vh.getEnv(),n=t.Image,r=t.Video;return e instanceof n?new Rf(e.naturalWidth,e.naturalHeight):e instanceof r?new Rf(e.videoWidth,e.videoHeight):new Rf(e.width,e.height)}function Eh(e){var t=e.width,n=e.height,r=(0,vh.getEnv().createCanvasElement)();return r.width=t,r.height=n,r}function Sh(e,t){var n=vh.getEnv().ImageData;if(!(e instanceof n)&&!Ch(e))throw new Error("createCanvasFromMedia - media has not finished loading yet");var r=t||Fh(e),i=r.width,o=r.height,a=Eh({width:i,height:o});return e instanceof n?yh(a).putImageData(e,0,0):yh(a).drawImage(e,0,0,i,o),a}function kh(e,t){return Lf(this,void 0,void 0,function(){var n,r,i,o,a,s;return Qf(this,function(A){switch(A.label){case 0:return n=t||vh.getEnv().createCanvasElement(),r=e.shape.slice(Of(e)?1:0),i=r[0],o=r[1],a=r[2],s=Zt(function(){return e.as3D(i,o,a).toInt()}),[4,df.toPixels(s,n)];case 1:return A.sent(),s.dispose(),[2,n]}})})}function _h(e){var t=vh.getEnv(),n=t.Image,r=t.Canvas,i=t.Video;return e instanceof n||e instanceof r||e instanceof i}var Ih=function(){function e(e,t){var n=this;if(void 0===t&&(t=!1),this._imageTensors=[],this._canvases=[],this._treatAsBatchInput=!1,this._inputDimensions=[],!Array.isArray(e))throw new Error("NetInput.constructor - expected inputs to be an Array of TResolvedNetInput or to be instanceof tf.Tensor4D, instead have "+e);this._treatAsBatchInput=t,this._batchSize=e.length,e.forEach(function(e,t){if(Pf(e))return n._imageTensors[t]=e,void(n._inputDimensions[t]=e.shape);if(Of(e)){var r=e.shape[0];if(1!==r)throw new Error("NetInput - tf.Tensor4D with batchSize "+r+" passed, but not supported in input array");return n._imageTensors[t]=e,void(n._inputDimensions[t]=e.shape.slice(1))}var i=e instanceof vh.getEnv().Canvas?e:Sh(e);n._canvases[t]=i,n._inputDimensions[t]=[i.height,i.width,3]})}return Object.defineProperty(e.prototype,"imageTensors",{get:function(){return this._imageTensors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvases",{get:function(){return this._canvases},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBatchInput",{get:function(){return this.batchSize>1||this._treatAsBatchInput},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"batchSize",{get:function(){return this._batchSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputDimensions",{get:function(){return this._inputDimensions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reshapedInputDimensions",{get:function(){var e=this;return zf(this.batchSize,0,1).map(function(t,n){return e.getReshapedInputDimensions(n)})},enumerable:!0,configurable:!0}),e.prototype.getInput=function(e){return this.canvases[e]||this.imageTensors[e]},e.prototype.getInputDimensions=function(e){return this._inputDimensions[e]},e.prototype.getInputHeight=function(e){return this._inputDimensions[e][0]},e.prototype.getInputWidth=function(e){return this._inputDimensions[e][1]},e.prototype.getReshapedInputDimensions=function(e){if("number"!==typeof this.inputSize)throw new Error("getReshapedInputDimensions - inputSize not set, toBatchTensor has not been called yet");return function(e,t){var n=e.width,r=e.height,i=t/Math.max(r,n);return new Rf(Math.round(n*i),Math.round(r*i))}({width:this.getInputWidth(e),height:this.getInputHeight(e)},this.inputSize)},e.prototype.toBatchTensor=function(e,t){var n=this;return void 0===t&&(t=!0),this._inputSize=e,Zt(function(){var r=zf(n.batchSize,0,1).map(function(r){var i=n.getInput(r);if(i instanceof Ie){var o=Of(i)?i:i.expandDims();return o=function(e,t){return void 0===t&&(t=!1),Zt(function(){var n=e.shape.slice(1),r=n[0],i=n[1];if(r===i)return e;var o=Math.abs(r-i),a=Math.round(o*(t?.5:1)),s=r>i?2:1,A=function(t){var n=e.shape.slice();return n[s]=t,_n(n,0)},u=A(a),l=o-u.shape[s],c=[t&&l?A(l):null,e,u].filter(function(e){return!!e}).map(function(e){return e.toFloat()});return Ln(c,s)})}(o,t),o.shape[1]===e&&o.shape[2]===e||(o=ql.resizeBilinear(o,[e,e])),o.as3D(e,e,3)}if(i instanceof vh.getEnv().Canvas)return df.fromPixels(function(e,t,n){void 0===n&&(n=!1);var r=vh.getEnv(),i=r.Image,o=r.Canvas;if(!(e instanceof i||e instanceof o))throw new Error("imageToSquare - expected arg0 to be HTMLImageElement | HTMLCanvasElement");var a=Fh(e),s=t/Math.max(a.height,a.width),A=s*a.width,u=s*a.height,l=Eh({width:t,height:t}),c=e instanceof o?e:Sh(e),f=Math.abs(A-u)/2,h=n&&A<u?f:0,d=n&&u<A?f:0;return yh(l).drawImage(c,h,d,A,u),l}(i,e,t));throw new Error("toBatchTensor - at batchIdx "+r+", expected input to be instanceof tf.Tensor or instanceof HTMLCanvasElement, instead have "+i)}),i=yr(r.map(function(e){return e.toFloat()})).as4D(n.batchSize,e,e,3);return i})},e}();function Nh(e){return Lf(this,void 0,void 0,function(){var t,n,r;return Qf(this,function(i){switch(i.label){case 0:if(e instanceof Ih)return[2,e];if(!(t=Array.isArray(e)?e:[e]).length)throw new Error("toNetInput - empty array passed as input");return n=function(t){return Array.isArray(e)?" at input index "+t+":":""},(r=t.map(wh)).forEach(function(e,r){if(!_h(e)&&!Pf(e)&&!Of(e)){if("string"===typeof t[r])throw new Error("toNetInput -"+n(r)+" string passed, but could not resolve HTMLElement for element id "+t[r]);throw new Error("toNetInput -"+n(r)+" expected media to be of type HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | tf.Tensor3D, or to be an element id")}if(Of(e)){var i=e.shape[0];if(1!==i)throw new Error("toNetInput -"+n(r)+" tf.Tensor4D with batchSize "+i+" passed, but not supported in input array")}}),[4,Promise.all(r.map(function(e){return _h(e)&&(t=e,new Promise(function(e,n){if(t instanceof vh.getEnv().Canvas||Ch(t))return e();function r(t){t.currentTarget&&(t.currentTarget.removeEventListener("load",r),t.currentTarget.removeEventListener("error",i),e(t))}function i(e){e.currentTarget&&(e.currentTarget.removeEventListener("load",r),e.currentTarget.removeEventListener("error",i),n(e))}t.addEventListener("load",r),t.addEventListener("error",i)}));var t}))];case 1:return i.sent(),[2,new Ih(r,Array.isArray(e))]}})})}function Uh(e,t){return Lf(this,void 0,void 0,function(){var n,r,i,o,a,s;return Qf(this,function(A){switch(A.label){case 0:return n=vh.getEnv().Canvas,r=e,e instanceof n?[3,5]:[4,Nh(e)];case 1:if((i=A.sent()).batchSize>1)throw new Error("extractFaces - batchSize > 1 not supported");return(o=i.getInput(0))instanceof n?(a=o,[3,4]):[3,2];case 2:return[4,kh(o)];case 3:a=A.sent(),A.label=4;case 4:r=a,A.label=5;case 5:return s=yh(r),[2,t.map(function(e){return e instanceof Yf?e.forSize(r.width,r.height).box.floor():e}).map(function(e){return e.clipAtImageBorders(r.width,r.height)}).map(function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=Eh({width:r,height:i});return yh(o).putImageData(s.getImageData(t,n,r,i),0,0),o})]}})})}function Lh(e,t){return Lf(this,void 0,void 0,function(){return Qf(this,function(n){if(!Pf(e)&&!Of(e))throw new Error("extractFaceTensors - expected image tensor to be 3D or 4D");if(Of(e)&&e.shape[0]>1)throw new Error("extractFaceTensors - batchSize > 1 not supported");return[2,Zt(function(){var n=e.shape.slice(Of(e)?1:0),r=n[0],i=n[1],o=n[2],a=t.map(function(e){return e instanceof Yf?e.forSize(i,r).box:e}).map(function(e){return e.clipAtImageBorders(i,r)}).map(function(t){var n=t.x,a=t.y,s=t.width,A=t.height;return Ru(e.as3D(r,i,o),[a,n,0],[A,s,o])});return a})]})})}function Qh(e,t){return Lf(this,void 0,void 0,function(){var n;return Qf(this,function(r){switch(r.label){case 0:return[4,(0,vh.getEnv().fetch)(e,t)];case 1:if(!((n=r.sent()).status<400))throw new Error("failed to fetch: ("+n.status+") "+n.statusText+", from url: "+n.url);return[2,n]}})})}function Dh(e){return Lf(this,void 0,void 0,function(){return Qf(this,function(t){switch(t.label){case 0:return[4,Qh(e)];case 1:return[2,t.sent().json()]}})})}function Rh(e,t){var n=t+"-weights_manifest.json";if(!e)return{modelBaseUri:"",manifestUri:n};if("/"===e)return{modelBaseUri:"/",manifestUri:"/"+n};var r=e.startsWith("http://")?"http://":e.startsWith("https://")?"https://":"",i=(e=e.replace(r,"")).split("/").filter(function(e){return e}),o=e.endsWith(".json")?i[i.length-1]:n,a=r+(e.endsWith(".json")?i.slice(0,i.length-1):i).join("/");return{modelBaseUri:a=e.startsWith("/")?"/"+a:a,manifestUri:"/"===a?"/"+o:a+"/"+o}}function Th(e,t){return Lf(this,void 0,void 0,function(){var n,r,i,o;return Qf(this,function(a){switch(a.label){case 0:return n=Rh(e,t),r=n.manifestUri,i=n.modelBaseUri,[4,Dh(r)];case 1:return o=a.sent(),[2,cf.loadWeights(o,i)]}})})}var Ph=function(){function e(e){this._name=e,this._params=void 0,this._paramMappings=[]}return Object.defineProperty(e.prototype,"params",{get:function(){return this._params},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paramMappings",{get:function(){return this._paramMappings},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoaded",{get:function(){return!!this.params},enumerable:!0,configurable:!0}),e.prototype.getParamFromPath=function(e){var t=this.traversePropertyPath(e);return t.obj[t.objProp]},e.prototype.reassignParamFromPath=function(e,t){var n=this.traversePropertyPath(e),r=n.obj,i=n.objProp;r[i].dispose(),r[i]=t},e.prototype.getParamList=function(){var e=this;return this._paramMappings.map(function(t){var n=t.paramPath;return{path:n,tensor:e.getParamFromPath(n)}})},e.prototype.getTrainableParams=function(){return this.getParamList().filter(function(e){return e.tensor instanceof Re})},e.prototype.getFrozenParams=function(){return this.getParamList().filter(function(e){return!(e.tensor instanceof Re)})},e.prototype.variable=function(){var e=this;this.getFrozenParams().forEach(function(t){var n=t.path,r=t.tensor;e.reassignParamFromPath(n,r.variable())})},e.prototype.freeze=function(){var e=this;this.getTrainableParams().forEach(function(t){var n=t.path,r=t.tensor,i=yn(r.dataSync());r.dispose(),e.reassignParamFromPath(n,i)})},e.prototype.dispose=function(e){void 0===e&&(e=!0),this.getParamList().forEach(function(t){if(e&&t.tensor.isDisposed)throw new Error("param tensor has already been disposed for path "+t.path);t.tensor.dispose()}),this._params=void 0},e.prototype.serializeParams=function(){return new Float32Array(this.getParamList().map(function(e){var t=e.tensor;return Array.from(t.dataSync())}).reduce(function(e,t){return e.concat(t)}))},e.prototype.load=function(e){return Lf(this,void 0,void 0,function(){return Qf(this,function(t){switch(t.label){case 0:return e instanceof Float32Array?(this.extractWeights(e),[2]):[4,this.loadFromUri(e)];case 1:return t.sent(),[2]}})})},e.prototype.loadFromUri=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:if(e&&"string"!==typeof e)throw new Error(this._name+".loadFromUri - expected model uri");return[4,Th(e,this.getDefaultModelName())];case 1:return t=n.sent(),this.loadFromWeightMap(t),[2]}})})},e.prototype.loadFromDisk=function(e){return Lf(this,void 0,void 0,function(){var t,n,r,i,o,a,s,A,u,l;return Qf(this,function(c){switch(c.label){case 0:if(e&&"string"!==typeof e)throw new Error(this._name+".loadFromDisk - expected model file path");return t=vh.getEnv().readFile,n=Rh(e,this.getDefaultModelName()),r=n.manifestUri,i=n.modelBaseUri,o=function(e){return Promise.all(e.map(function(e){return t(e).then(function(e){return e.buffer})}))},a=cf.weightsLoaderFactory(o),u=(A=JSON).parse,[4,t(r)];case 1:return s=u.apply(A,[c.sent().toString()]),[4,a(s,i)];case 2:return l=c.sent(),this.loadFromWeightMap(l),[2]}})})},e.prototype.loadFromWeightMap=function(e){var t=this.extractParamsFromWeigthMap(e),n=t.paramMappings,r=t.params;this._paramMappings=n,this._params=r},e.prototype.extractWeights=function(e){var t=this.extractParams(e),n=t.paramMappings,r=t.params;this._paramMappings=n,this._params=r},e.prototype.traversePropertyPath=function(e){if(!this.params)throw new Error("traversePropertyPath - model has no loaded params");var t=e.split("/").reduce(function(t,n){if(!t.nextObj.hasOwnProperty(n))throw new Error("traversePropertyPath - object does not have property "+n+", for path "+e);return{obj:t.nextObj,objProp:n,nextObj:t.nextObj[n]}},{nextObj:this.params}),n=t.obj,r=t.objProp;if(!n||!r||!(n[r]instanceof Ie))throw new Error("traversePropertyPath - parameter is not a tensor, for path "+e);return{obj:n,objProp:r}},e}();function Oh(e,t,n){return Zt(function(){var r=pu(e,t.depthwise_filter,t.pointwise_filter,n,"same");return r=bA(r,t.bias)})}function Mh(e,t,n){return void 0===n&&(n=!1),Zt(function(){var r=$u(n?bA(Au(e,t.conv0.filters,[2,2],"same"),t.conv0.bias):Oh(e,t.conv0,[2,2])),i=Oh(r,t.conv1,[1,1]),o=Oh($u(bA(r,i)),t.conv2,[1,1]);return $u(bA(r,bA(i,o)))})}function Hh(e,t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!0),Zt(function(){var i=$u(n?bA(Au(e,t.conv0.filters,r?[2,2]:[1,1],"same"),t.conv0.bias):Oh(e,t.conv0,r?[2,2]:[1,1])),o=Oh(i,t.conv1,[1,1]),a=Oh($u(bA(i,o)),t.conv2,[1,1]),s=Oh($u(bA(i,bA(o,a))),t.conv3,[1,1]);return $u(bA(i,bA(o,bA(a,s))))})}function jh(e,t,n,r){return void 0===n&&(n="same"),void 0===r&&(r=!1),Zt(function(){var i=bA(Au(e,t.filters,[1,1],n),t.bias);return r?$u(i):i})}function zh(e,t){Object.keys(e).forEach(function(n){t.some(function(e){return e.originalPath===n})||e[n].dispose()})}function Kh(e,t){return function(n,r,i,o){var a=En(e(n*r*i*i),[i,i,n,r]),s=xn(e(r));return t.push({paramPath:o+"/filters"},{paramPath:o+"/bias"}),{filters:a,bias:s}}}function Wh(e,t){return function(n,r,i){var o=Cn(e(n*r),[n,r]),a=xn(e(r));return t.push({paramPath:i+"/weights"},{paramPath:i+"/bias"}),{weights:o,bias:a}}}var Vh=function(e,t,n){this.depthwise_filter=e,this.pointwise_filter=t,this.bias=n};function Gh(e,t){return function(n,r,i){var o=En(e(9*n),[3,3,n,1]),a=En(e(n*r),[1,1,n,r]),s=xn(e(r));return t.push({paramPath:i+"/depthwise_filter"},{paramPath:i+"/pointwise_filter"},{paramPath:i+"/bias"}),new Vh(o,a,s)}}function qh(e){return function(t){var n=e(t+"/depthwise_filter",4),r=e(t+"/pointwise_filter",4),i=e(t+"/bias",1);return new Vh(n,r,i)}}function Xh(e,t){return function(n,r,i){var o=e[n];if(!Tf(o,r))throw new Error("expected weightMap["+n+"] to be a Tensor"+r+"D, instead have "+o);return t.push({originalPath:n,paramPath:i||n}),o}}function Yh(e){var t=e;return{extractWeights:function(e){var n=t.slice(0,e);return t=t.slice(e),n},getRemainingWeights:function(){return t}}}function Jh(e,t){var n=Kh(e,t),r=Gh(e,t);function i(e,t,i,o){return void 0===o&&(o=!1),{conv0:o?n(e,t,3,i+"/conv0"):r(e,t,i+"/conv0"),conv1:r(t,t,i+"/conv1"),conv2:r(t,t,i+"/conv2")}}return{extractDenseBlock3Params:i,extractDenseBlock4Params:function(e,t,n,o){void 0===o&&(o=!1);var a=i(e,t,n,o);return{conv0:a.conv0,conv1:a.conv1,conv2:a.conv2,conv3:r(t,t,n+"/conv3")}}}}function Zh(e){return function(t){return{filters:e(t+"/filters",4),bias:e(t+"/bias",1)}}}function $h(e,t){var n=Xh(e,t),r=Zh(n),i=qh(n);return{extractDenseBlock3Params:function(e,t){return void 0===t&&(t=!1),{conv0:t?r(e+"/conv0"):i(e+"/conv0"),conv1:i(e+"/conv1"),conv2:i(e+"/conv2")}},extractDenseBlock4Params:function(e,t){return void 0===t&&(t=!1),{conv0:t?r(e+"/conv0"):i(e+"/conv0"),conv1:i(e+"/conv1"),conv2:i(e+"/conv2"),conv3:i(e+"/conv3")}}}}var ed=function(e){function t(){return e.call(this,"FaceFeatureExtractor")||this}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this.params;if(!t)throw new Error("FaceFeatureExtractor - load model before inference");return Zt(function(){var n=Hh($f(e.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(Bn(255)),t.dense0,!0);return n=Hh(n,t.dense1),n=Hh(n,t.dense2),n=Hh(n,t.dense3),n=_u(n,[7,7],[2,2],"valid")})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.getDefaultModelName=function(){return"face_feature_extractor_model"},t.prototype.extractParamsFromWeigthMap=function(e){return function(e){var t=[],n=$h(e,t).extractDenseBlock4Params,r={dense0:n("dense0",!0),dense1:n("dense1"),dense2:n("dense2"),dense3:n("dense3")};return zh(e,t),{params:r,paramMappings:t}}(e)},t.prototype.extractParams=function(e){return function(e){var t=[],n=Yh(e),r=n.extractWeights,i=n.getRemainingWeights,o=Jh(r,t).extractDenseBlock4Params,a=o(3,32,"dense0",!0),s=o(32,64,"dense1"),A=o(64,128,"dense2"),u=o(128,256,"dense3");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:t,params:{dense0:a,dense1:s,dense2:A,dense3:u}}}(e)},t}(Ph);function td(e,t){return Zt(function(){return bA(vu(e,t.weights),t.bias)})}function nd(e){var t={},n={};return Object.keys(e).forEach(function(r){(r.startsWith("fc")?n:t)[r]=e[r]}),{featureExtractorMap:t,classifierMap:n}}var rd=function(e){function t(t,n){var r=e.call(this,t)||this;return r._faceFeatureExtractor=n,r}return Nf(t,e),Object.defineProperty(t.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),t.prototype.runNet=function(e){var t=this,n=this.params;if(!n)throw new Error(this._name+" - load model before inference");return Zt(function(){var r=e instanceof Ih?t.faceFeatureExtractor.forwardInput(e):e;return td(r.as2D(r.shape[0],-1),n.fc)})},t.prototype.dispose=function(t){void 0===t&&(t=!0),this.faceFeatureExtractor.dispose(t),e.prototype.dispose.call(this,t)},t.prototype.loadClassifierParams=function(e){var t=this.extractClassifierParams(e),n=t.params,r=t.paramMappings;this._params=n,this._paramMappings=r},t.prototype.extractClassifierParams=function(e){return function(e,t,n){var r=[],i=Yh(e),o=i.extractWeights,a=i.getRemainingWeights,s=Wh(o,r)(t,n,"fc");if(0!==a().length)throw new Error("weights remaing after extract: "+a().length);return{paramMappings:r,params:{fc:s}}}(e,this.getClassifierChannelsIn(),this.getClassifierChannelsOut())},t.prototype.extractParamsFromWeigthMap=function(e){var t=nd(e),n=t.featureExtractorMap,r=t.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(n),function(e){var t,n=[],r=Xh(e,n),i={fc:(t="fc",{weights:r(t+"/weights",2),bias:r(t+"/bias",1)})};return zh(e,n),{params:i,paramMappings:n}}(r)},t.prototype.extractParams=function(e){var t=this.getClassifierChannelsIn(),n=this.getClassifierChannelsOut(),r=n*t+n,i=e.slice(0,e.length-r),o=e.slice(e.length-r);return this.faceFeatureExtractor.extractWeights(i),this.extractClassifierParams(o)},t}(Ph),id=["neutral","happy","sad","angry","fearful","disgusted","surprised"],od=function(){function e(e){var t=this;if(7!==e.length)throw new Error("FaceExpressions.constructor - expected probabilities.length to be 7, have: "+e.length);id.forEach(function(n,r){t[n]=e[r]})}return e.prototype.asSortedArray=function(){var e=this;return id.map(function(t){return{expression:t,probability:e[t]}}).sort(function(e,t){return t.probability-e.probability})},e}(),ad=function(e){function t(t){return void 0===t&&(t=new ed),e.call(this,"FaceExpressionNet",t)||this}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this;return Zt(function(){return jr(t.runNet(e))})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.predictExpressions=function(e){return Lf(this,void 0,void 0,function(){var t,n,r,i,o=this;return Qf(this,function(a){switch(a.label){case 0:return[4,Nh(e)];case 1:return t=a.sent(),[4,this.forwardInput(t)];case 2:return n=a.sent(),[4,Promise.all(xr(n).map(function(e){return Lf(o,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return[4,e.data()];case 1:return t=n.sent(),e.dispose(),[2,t]}})})}))];case 3:return r=a.sent(),n.dispose(),i=r.map(function(e){return new od(e)}),[2,t.isBatchInput?i:i[0]]}})})},t.prototype.getDefaultModelName=function(){return"face_expression_model"},t.prototype.getClassifierChannelsIn=function(){return 256},t.prototype.getClassifierChannelsOut=function(){return 7},t}(rd);function sd(e,t){var n={expressions:t};return Object.assign({},e,n)}function Ad(e){return function(e){return e.detection instanceof Yf}(e)&&e.landmarks instanceof rh&&e.unshiftedLandmarks instanceof rh&&e.alignedRect instanceof Yf}function ud(e,t){var n=e.detection.box,r=t.shiftBy(n.x,n.y),i=r.align(),o=e.detection.imageDims,a={landmarks:r,unshiftedLandmarks:t,alignedRect:new Yf(e.detection.score,i.rescale(o.reverse()),o)};return Object.assign({},e,a)}function ld(e,t,n){if(void 0===n&&(n=!1),e.beginPath(),t.slice(1).forEach(function(n,r){var i=n.x,o=n.y,a=t[r];e.moveTo(a.x,a.y),e.lineTo(i,o)}),n){var r=t[t.length-1],i=t[0];if(!r||!i)return;e.moveTo(r.x,r.y),e.lineTo(i.x,i.y)}e.stroke()}var cd=function(e){void 0===e&&(e={});var t=e.drawLines,n=void 0===t||t,r=e.drawPoints,i=void 0===r||r,o=e.lineWidth,a=e.lineColor,s=e.pointSize,A=e.pointColor;this.drawLines=n,this.drawPoints=i,this.lineWidth=o||1,this.pointSize=s||2,this.lineColor=a||"rgba(0, 255, 255, 1)",this.pointColor=A||"rgba(255, 0, 255, 1)"};!function(){function e(e,t){void 0===t&&(t={}),this.faceLandmarks=e,this.options=new cd(t)}e.prototype.draw=function(e){var t=yh(e),n=this.options,r=n.drawLines,i=n.drawPoints,o=n.lineWidth,a=n.lineColor,s=n.pointSize,A=n.pointColor;if(r&&this.faceLandmarks instanceof oh&&(t.strokeStyle=a,t.lineWidth=o,ld(t,this.faceLandmarks.getJawOutline()),ld(t,this.faceLandmarks.getLeftEyeBrow()),ld(t,this.faceLandmarks.getRightEyeBrow()),ld(t,this.faceLandmarks.getNose()),ld(t,this.faceLandmarks.getLeftEye(),!0),ld(t,this.faceLandmarks.getRightEye(),!0),ld(t,this.faceLandmarks.getMouth(),!0)),i){t.strokeStyle=A,t.fillStyle=A;this.faceLandmarks.positions.forEach(function(e){t.beginPath(),t.arc(e.x,e.y,s,0,2*Math.PI),t.fill()})}}}();function fd(e,t){var n=[],r=Yh(e),i=r.extractWeights,o=r.getRemainingWeights,a=function(e,t){var n=Kh(e,t),r=Gh(e,t);return{extractConvParams:n,extractSeparableConvParams:r,extractReductionBlockParams:function(e,t,i){return{separable_conv0:r(e,t,i+"/separable_conv0"),separable_conv1:r(t,t,i+"/separable_conv1"),expansion_conv:n(e,t,1,i+"/expansion_conv")}},extractMainBlockParams:function(e,t){return{separable_conv0:r(e,e,t+"/separable_conv0"),separable_conv1:r(e,e,t+"/separable_conv1"),separable_conv2:r(e,e,t+"/separable_conv2")}}}}(i,n),s=a.extractConvParams,A=a.extractSeparableConvParams,u=a.extractReductionBlockParams,l=a.extractMainBlockParams,c={conv_in:s(3,32,3,"entry_flow/conv_in"),reduction_block_0:u(32,64,"entry_flow/reduction_block_0"),reduction_block_1:u(64,128,"entry_flow/reduction_block_1")},f={};zf(t,0,1).forEach(function(e){f["main_block_"+e]=l(128,"middle_flow/main_block_"+e)});var h={reduction_block:u(128,256,"exit_flow/reduction_block"),separable_conv:A(256,512,"exit_flow/separable_conv")};if(0!==o().length)throw new Error("weights remaing after extract: "+o().length);return{paramMappings:n,params:{entry_flow:c,middle_flow:f,exit_flow:h}}}function hd(e,t){var n=[],r=function(e,t){var n=Xh(e,t),r=Zh(n),i=qh(n);return{extractConvParams:r,extractSeparableConvParams:i,extractReductionBlockParams:function(e){return{separable_conv0:i(e+"/separable_conv0"),separable_conv1:i(e+"/separable_conv1"),expansion_conv:r(e+"/expansion_conv")}},extractMainBlockParams:function(e){return{separable_conv0:i(e+"/separable_conv0"),separable_conv1:i(e+"/separable_conv1"),separable_conv2:i(e+"/separable_conv2")}}}}(e,n),i=r.extractConvParams,o=r.extractSeparableConvParams,a=r.extractReductionBlockParams,s=r.extractMainBlockParams,A={conv_in:i("entry_flow/conv_in"),reduction_block_0:a("entry_flow/reduction_block_0"),reduction_block_1:a("entry_flow/reduction_block_1")},u={};zf(t,0,1).forEach(function(e){u["main_block_"+e]=s("middle_flow/main_block_"+e)});var l={reduction_block:a("exit_flow/reduction_block"),separable_conv:o("exit_flow/separable_conv")};return zh(e,n),{params:{entry_flow:A,middle_flow:u,exit_flow:l},paramMappings:n}}function dd(e,t,n){return bA(Au(e,t.filters,n,"same"),t.bias)}function pd(e,t,n){void 0===n&&(n=!0);var r=n?$u(e):e;return r=Oh(r,t.separable_conv0,[1,1]),r=Oh($u(r),t.separable_conv1,[1,1]),r=ku(r,[3,3],[2,2],"same"),r=bA(r,dd(e,t.expansion_conv,[2,2]))}var gd,md=function(e){function t(t){var n=e.call(this,"TinyXception")||this;return n._numMainBlocks=t,n}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this,n=this.params;if(!n)throw new Error("TinyXception - load model before inference");return Zt(function(){var r=$f(e.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(Bn(256)),i=$u(dd(r,n.entry_flow.conv_in,[2,2]));return i=pd(i,n.entry_flow.reduction_block_0,!1),i=pd(i,n.entry_flow.reduction_block_1),zf(t._numMainBlocks,0,1).forEach(function(e){i=function(e,t){var n=Oh($u(e),t.separable_conv0,[1,1]);return n=Oh($u(n),t.separable_conv1,[1,1]),n=Oh($u(n),t.separable_conv2,[1,1]),bA(n,e)}(i,n.middle_flow["main_block_"+e])}),i=pd(i,n.exit_flow.reduction_block),i=$u(Oh(i,n.exit_flow.separable_conv,[1,1]))})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.getDefaultModelName=function(){return"tiny_xception_model"},t.prototype.extractParamsFromWeigthMap=function(e){return hd(e,this._numMainBlocks)},t.prototype.extractParams=function(e){return fd(e,this._numMainBlocks)},t}(Ph);!function(e){e.FEMALE="female",e.MALE="male"}(gd||(gd={}));var vd=function(e){function t(t){void 0===t&&(t=new md(2));var n=e.call(this,"AgeGenderNet")||this;return n._faceFeatureExtractor=t,n}return Nf(t,e),Object.defineProperty(t.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),t.prototype.runNet=function(e){var t=this,n=this.params;if(!n)throw new Error(this._name+" - load model before inference");return Zt(function(){var r=e instanceof Ih?t.faceFeatureExtractor.forwardInput(e):e,i=_u(r,[7,7],[2,2],"valid").as2D(r.shape[0],-1);return{age:td(i,n.fc.age).as1D(),gender:td(i,n.fc.gender)}})},t.prototype.forwardInput=function(e){var t=this;return Zt(function(){var n=t.runNet(e),r=n.age,i=n.gender;return{age:r,gender:jr(i)}})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.predictAgeAndGender=function(e){return Lf(this,void 0,void 0,function(){var t,n,r,i,o,a,s=this;return Qf(this,function(A){switch(A.label){case 0:return[4,Nh(e)];case 1:return t=A.sent(),[4,this.forwardInput(t)];case 2:return n=A.sent(),r=xr(n.age),i=xr(n.gender),o=r.map(function(e,t){return{ageTensor:e,genderTensor:i[t]}}),[4,Promise.all(o.map(function(e){var t=e.ageTensor,n=e.genderTensor;return Lf(s,void 0,void 0,function(){var e,r,i,o,a;return Qf(this,function(s){switch(s.label){case 0:return[4,t.data()];case 1:return e=s.sent()[0],[4,n.data()];case 2:return r=s.sent()[0],o=(i=r>.5)?gd.MALE:gd.FEMALE,a=i?r:1-r,t.dispose(),n.dispose(),[2,{age:e,gender:o,genderProbability:a}]}})})}))];case 3:return a=A.sent(),n.age.dispose(),n.gender.dispose(),[2,t.isBatchInput?a:a[0]]}})})},t.prototype.getDefaultModelName=function(){return"age_gender_model"},t.prototype.dispose=function(t){void 0===t&&(t=!0),this.faceFeatureExtractor.dispose(t),e.prototype.dispose.call(this,t)},t.prototype.loadClassifierParams=function(e){var t=this.extractClassifierParams(e),n=t.params,r=t.paramMappings;this._params=n,this._paramMappings=r},t.prototype.extractClassifierParams=function(e){return function(e){var t=[],n=Yh(e),r=n.extractWeights,i=n.getRemainingWeights,o=Wh(r,t),a=o(512,1,"fc/age"),s=o(512,2,"fc/gender");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:t,params:{fc:{age:a,gender:s}}}}(e)},t.prototype.extractParamsFromWeigthMap=function(e){var t=nd(e),n=t.featureExtractorMap,r=t.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(n),function(e){var t=[],n=Xh(e,t);function r(e){return{weights:n(e+"/weights",2),bias:n(e+"/bias",1)}}var i={fc:{age:r("fc/age"),gender:r("fc/gender")}};return zh(e,t),{params:i,paramMappings:t}}(r)},t.prototype.extractParams=function(e){var t=e.slice(0,e.length-1539),n=e.slice(e.length-1539);return this.faceFeatureExtractor.extractWeights(t),this.extractClassifierParams(n)},t}(Ph),wd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.postProcess=function(e,t,n){var r=n.map(function(e){var n=e.width,r=e.height,i=t/Math.max(r,n);return{width:n*i,height:r*i}}),i=r.length;return Zt(function(){var n=function(e,t){return yr([_n([68],e),_n([68],t)],1).as2D(1,136).as1D()},o=function(e,t){var n=r[e],i=n.width,o=n.height;return t(i,o)?Math.abs(i-o)/2:0},a=e.mul(_n([i,136],t)).sub(yr(Array.from(Array(i),function(e,t){return n(function(e){return o(e,function(e,t){return e<t})}(t),function(e){return o(e,function(e,t){return t<e})}(t))}))).div(yr(Array.from(Array(i),function(e,t){return n(r[t].width,r[t].height)})));return a})},t.prototype.forwardInput=function(e){var t=this;return Zt(function(){var n=t.runNet(e);return t.postProcess(n,e.inputSize,e.inputDimensions.map(function(e){return{height:e[0],width:e[1]}}))})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.detectLandmarks=function(e){return Lf(this,void 0,void 0,function(){var t,n,r,i=this;return Qf(this,function(o){switch(o.label){case 0:return[4,Nh(e)];case 1:return t=o.sent(),n=Zt(function(){return xr(i.forwardInput(t))}),[4,Promise.all(n.map(function(e,n){return Lf(i,void 0,void 0,function(){var r,i,o,a,s;return Qf(this,function(A){switch(A.label){case 0:return o=(i=Array).from,[4,e.data()];case 1:return r=o.apply(i,[A.sent()]),a=r.filter(function(e,t){return Mf(t)}),s=r.filter(function(e,t){return!Mf(t)}),[2,new oh(Array(68).fill(0).map(function(e,t){return new Vf(a[t],s[t])}),{height:t.getInputHeight(n),width:t.getInputWidth(n)})]}})})}))];case 2:return r=o.sent(),n.forEach(function(e){return e.dispose()}),[2,t.isBatchInput?r:r[0]]}})})},t.prototype.getClassifierChannelsOut=function(){return 136},t}(rd),yd=function(e){function t(t){return void 0===t&&(t=new ed),e.call(this,"FaceLandmark68Net",t)||this}return Nf(t,e),t.prototype.getDefaultModelName=function(){return"face_landmark_68_model"},t.prototype.getClassifierChannelsIn=function(){return 256},t}(wd);var bd=function(e){function t(){return e.call(this,"TinyFaceFeatureExtractor")||this}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this.params;if(!t)throw new Error("TinyFaceFeatureExtractor - load model before inference");return Zt(function(){var n=Mh($f(e.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(Bn(255)),t.dense0,!0);return n=Mh(n,t.dense1),n=Mh(n,t.dense2),n=_u(n,[14,14],[2,2],"valid")})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.getDefaultModelName=function(){return"face_feature_extractor_tiny_model"},t.prototype.extractParamsFromWeigthMap=function(e){return function(e){var t=[],n=$h(e,t).extractDenseBlock3Params,r={dense0:n("dense0",!0),dense1:n("dense1"),dense2:n("dense2")};return zh(e,t),{params:r,paramMappings:t}}(e)},t.prototype.extractParams=function(e){return function(e){var t=[],n=Yh(e),r=n.extractWeights,i=n.getRemainingWeights,o=Jh(r,t).extractDenseBlock3Params,a=o(3,32,"dense0",!0),s=o(32,64,"dense1"),A=o(64,128,"dense2");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:t,params:{dense0:a,dense1:s,dense2:A}}}(e)},t}(Ph),Bd=function(e){function t(t){return void 0===t&&(t=new bd),e.call(this,"FaceLandmark68TinyNet",t)||this}return Nf(t,e),t.prototype.getDefaultModelName=function(){return"face_landmark_68_tiny_model"},t.prototype.getClassifierChannelsIn=function(){return 128},t}(wd);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Nf(t,e)}(yd);function xd(e,t,n,r,i){void 0===i&&(i="same");var o=t.conv,a=o.filters,s=o.bias,A=Au(e,a,n,i);return A=function(e,t){return bA(DA(e,t.weights),t.biases)}(A=bA(A,s),t.scale),r?$u(A):A}function Cd(e,t){return xd(e,t,[1,1],!1)}function Fd(e,t){return xd(e,t,[2,2],!0,"valid")}function Ed(e,t){function n(n,r,i,o){var a=function(t,n,r){var i=e(t),o=i.length/(n*r*r);if(o%1!==0)throw new Error("depth has to be an integer: "+o+", weights.length: "+i.length+", numFilters: "+n+", filterSize: "+r);return Zt(function(){return nl(En(i,[n,o,r,r]),[2,3,1,0])})}(n,r,i),s=xn(e(r));return t.push({paramPath:o+"/filters"},{paramPath:o+"/bias"}),{filters:a,bias:s}}function r(r,i,o,a){var s=n(r,i,o,a+"/conv"),A=function(n,r){var i=xn(e(n)),o=xn(e(n));return t.push({paramPath:r+"/weights"},{paramPath:r+"/biases"}),{weights:i,biases:o}}(i,a+"/scale");return{conv:s,scale:A}}return{extractConvLayerParams:r,extractResidualLayerParams:function(e,t,n,i,o){return void 0===o&&(o=!1),{conv1:r((o?.5:1)*e,t,n,i+"/conv1"),conv2:r(e,t,n,i+"/conv2")}}}}function Sd(e,t){var n=Xh(e,t);function r(e){var t=n(e+"/conv/filters",4),r=n(e+"/conv/bias",1),i=function(e){return{weights:n(e+"/scale/weights",1),biases:n(e+"/scale/biases",1)}}(e);return{conv:{filters:t,bias:r},scale:i}}return{extractConvLayerParams:r,extractResidualLayerParams:function(e){return{conv1:r(e+"/conv1"),conv2:r(e+"/conv2")}}}}function kd(e){var t=[],n=Sd(e,t),r=n.extractConvLayerParams,i=n.extractResidualLayerParams,o=r("conv32_down"),a=i("conv32_1"),s=i("conv32_2"),A=i("conv32_3"),u=i("conv64_down"),l=i("conv64_1"),c=i("conv64_2"),f=i("conv64_3"),h=i("conv128_down"),d=i("conv128_1"),p=i("conv128_2"),g=i("conv256_down"),m=i("conv256_1"),v=i("conv256_2"),w=i("conv256_down_out"),y=e.fc;if(t.push({originalPath:"fc",paramPath:"fc"}),!Tf(y,2))throw new Error("expected weightMap[fc] to be a Tensor2D, instead have "+y);var b={conv32_down:o,conv32_1:a,conv32_2:s,conv32_3:A,conv64_down:u,conv64_1:l,conv64_2:c,conv64_3:f,conv128_down:h,conv128_1:d,conv128_2:p,conv256_down:g,conv256_1:m,conv256_2:v,conv256_down_out:w,fc:y};return zh(e,t),{params:b,paramMappings:t}}function _d(e,t){var n=function(e,t){return xd(e,t,[1,1],!0)}(e,t.conv1);return n=Cd(n,t.conv2),n=bA(n,e),n=$u(n)}function Id(e,t){var n=Fd(e,t.conv1);n=Cd(n,t.conv2);var r=_u(e,2,2,"valid"),i=kn(r.shape),o=r.shape[3]!==n.shape[3];if(r.shape[1]!==n.shape[1]||r.shape[2]!==n.shape[2]){var a=Df(n.shape);a[1]=1;var s=kn(a),A=Df((n=Ln([n,s],1)).shape);A[2]=1;var u=kn(A);n=Ln([n,u],2)}return r=o?Ln([r,i],3):r,n=bA(r,n),n=$u(n)}var Nd=function(e){function t(){return e.call(this,"FaceRecognitionNet")||this}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this.params;if(!t)throw new Error("FaceRecognitionNet - load model before inference");return Zt(function(){var n=Fd($f(e.toBatchTensor(150,!0).toFloat(),[122.782,117.001,104.298]).div(Bn(256)),t.conv32_down);n=_d(n=ku(n,3,2,"valid"),t.conv32_1),n=_d(n,t.conv32_2),n=_d(n,t.conv32_3),n=_d(n=Id(n,t.conv64_down),t.conv64_1),n=_d(n,t.conv64_2),n=_d(n,t.conv64_3),n=_d(n=Id(n,t.conv128_down),t.conv128_1),n=_d(n,t.conv128_2),n=_d(n=Id(n,t.conv256_down),t.conv256_1);var r=(n=Id(n=_d(n,t.conv256_2),t.conv256_down_out)).mean([1,2]);return vu(r,t.fc)})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.computeFaceDescriptor=function(e){return Lf(this,void 0,void 0,function(){var t,n,r,i=this;return Qf(this,function(o){switch(o.label){case 0:return[4,Nh(e)];case 1:return t=o.sent(),n=Zt(function(){return xr(i.forwardInput(t))}),[4,Promise.all(n.map(function(e){return e.data()}))];case 2:return r=o.sent(),n.forEach(function(e){return e.dispose()}),[2,t.isBatchInput?r:r[0]]}})})},t.prototype.getDefaultModelName=function(){return"face_recognition_model"},t.prototype.extractParamsFromWeigthMap=function(e){return kd(e)},t.prototype.extractParams=function(e){return function(e){var t=Yh(e),n=t.extractWeights,r=t.getRemainingWeights,i=[],o=Ed(n,i),a=o.extractConvLayerParams,s=o.extractResidualLayerParams,A=a(4704,32,7,"conv32_down"),u=s(9216,32,3,"conv32_1"),l=s(9216,32,3,"conv32_2"),c=s(9216,32,3,"conv32_3"),f=s(36864,64,3,"conv64_down",!0),h=s(36864,64,3,"conv64_1"),d=s(36864,64,3,"conv64_2"),p=s(36864,64,3,"conv64_3"),g=s(147456,128,3,"conv128_down",!0),m=s(147456,128,3,"conv128_1"),v=s(147456,128,3,"conv128_2"),w=s(589824,256,3,"conv256_down",!0),y=s(589824,256,3,"conv256_1"),b=s(589824,256,3,"conv256_2"),B=s(589824,256,3,"conv256_down_out"),x=Zt(function(){return nl(Cn(n(32768),[128,256]),[1,0])});if(i.push({paramPath:"fc"}),0!==r().length)throw new Error("weights remaing after extract: "+r().length);return{params:{conv32_down:A,conv32_1:u,conv32_2:l,conv32_3:c,conv64_down:f,conv64_1:h,conv64_2:d,conv64_3:p,conv128_down:g,conv128_1:m,conv128_2:v,conv256_down:w,conv256_1:y,conv256_2:b,conv256_down_out:B,fc:x},paramMappings:i}}(e)},t}(Ph);function Ud(e,t,n){var r={gender:t,genderProbability:n};return Object.assign({},e,r)}var Ld=function(){function e(e){var t=void 0===e?{}:e,n=t.minFaceSize,r=t.scaleFactor,i=t.maxNumScales,o=t.scoreThresholds,a=t.scaleSteps;if(this._name="MtcnnOptions",this._minFaceSize=n||20,this._scaleFactor=r||.709,this._maxNumScales=i||10,this._scoreThresholds=o||[.6,.7,.7],this._scaleSteps=a,"number"!==typeof this._minFaceSize||this._minFaceSize<0)throw new Error(this._name+" - expected minFaceSize to be a number > 0");if("number"!==typeof this._scaleFactor||this._scaleFactor<=0||this._scaleFactor>=1)throw new Error(this._name+" - expected scaleFactor to be a number between 0 and 1");if("number"!==typeof this._maxNumScales||this._maxNumScales<0)throw new Error(this._name+" - expected maxNumScales to be a number > 0");if(!Array.isArray(this._scoreThresholds)||3!==this._scoreThresholds.length||this._scoreThresholds.some(function(e){return"number"!==typeof e}))throw new Error(this._name+" - expected scoreThresholds to be an array of numbers of length 3");if(this._scaleSteps&&(!Array.isArray(this._scaleSteps)||this._scaleSteps.some(function(e){return"number"!==typeof e})))throw new Error(this._name+" - expected scaleSteps to be an array of numbers")}return Object.defineProperty(e.prototype,"minFaceSize",{get:function(){return this._minFaceSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scaleFactor",{get:function(){return this._scaleFactor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxNumScales",{get:function(){return this._maxNumScales},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scoreThresholds",{get:function(){return this._scoreThresholds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scaleSteps",{get:function(){return this._scaleSteps},enumerable:!0,configurable:!0}),e}();function Qd(e,t){function n(n,r,i,o,a){var s=En(e(n*r*i*i),[i,i,n,r]),A=xn(e(r));return t.push({paramPath:o+"/filters"},{paramPath:o+"/"+(a?"batch_norm_offset":"bias")}),{filters:s,bias:A}}function r(e,t,r,i){var o=n(e,t,r,i,!0);return{filters:o.filters,batch_norm_offset:o.bias}}function i(n,i,o){var a=function(n,r){var i=En(e(9*n),[3,3,n,1]),o=xn(e(n)),a=xn(e(n)),s=xn(e(n)),A=xn(e(n));return t.push({paramPath:r+"/filters"},{paramPath:r+"/batch_norm_scale"},{paramPath:r+"/batch_norm_offset"},{paramPath:r+"/batch_norm_mean"},{paramPath:r+"/batch_norm_variance"}),{filters:i,batch_norm_scale:o,batch_norm_offset:a,batch_norm_mean:s,batch_norm_variance:A}}(n,o+"/depthwise_conv");return{depthwise_conv:a,pointwise_conv:r(n,i,1,o+"/pointwise_conv")}}return{extractMobilenetV1Params:function(){return{conv_0:r(3,32,3,"mobilenetv1/conv_0"),conv_1:i(32,64,"mobilenetv1/conv_1"),conv_2:i(64,128,"mobilenetv1/conv_2"),conv_3:i(128,128,"mobilenetv1/conv_3"),conv_4:i(128,256,"mobilenetv1/conv_4"),conv_5:i(256,256,"mobilenetv1/conv_5"),conv_6:i(256,512,"mobilenetv1/conv_6"),conv_7:i(512,512,"mobilenetv1/conv_7"),conv_8:i(512,512,"mobilenetv1/conv_8"),conv_9:i(512,512,"mobilenetv1/conv_9"),conv_10:i(512,512,"mobilenetv1/conv_10"),conv_11:i(512,512,"mobilenetv1/conv_11"),conv_12:i(512,1024,"mobilenetv1/conv_12"),conv_13:i(1024,1024,"mobilenetv1/conv_13")}},extractPredictionLayerParams:function(){return{conv_0:r(1024,256,1,"prediction_layer/conv_0"),conv_1:r(256,512,3,"prediction_layer/conv_1"),conv_2:r(512,128,1,"prediction_layer/conv_2"),conv_3:r(128,256,3,"prediction_layer/conv_3"),conv_4:r(256,128,1,"prediction_layer/conv_4"),conv_5:r(128,256,3,"prediction_layer/conv_5"),conv_6:r(256,64,1,"prediction_layer/conv_6"),conv_7:r(64,128,3,"prediction_layer/conv_7"),box_predictor_0:{box_encoding_predictor:n(512,12,1,"prediction_layer/box_predictor_0/box_encoding_predictor"),class_predictor:n(512,9,1,"prediction_layer/box_predictor_0/class_predictor")},box_predictor_1:{box_encoding_predictor:n(1024,24,1,"prediction_layer/box_predictor_1/box_encoding_predictor"),class_predictor:n(1024,18,1,"prediction_layer/box_predictor_1/class_predictor")},box_predictor_2:{box_encoding_predictor:n(512,24,1,"prediction_layer/box_predictor_2/box_encoding_predictor"),class_predictor:n(512,18,1,"prediction_layer/box_predictor_2/class_predictor")},box_predictor_3:{box_encoding_predictor:n(256,24,1,"prediction_layer/box_predictor_3/box_encoding_predictor"),class_predictor:n(256,18,1,"prediction_layer/box_predictor_3/class_predictor")},box_predictor_4:{box_encoding_predictor:n(256,24,1,"prediction_layer/box_predictor_4/box_encoding_predictor"),class_predictor:n(256,18,1,"prediction_layer/box_predictor_4/class_predictor")},box_predictor_5:{box_encoding_predictor:n(128,24,1,"prediction_layer/box_predictor_5/box_encoding_predictor"),class_predictor:n(128,18,1,"prediction_layer/box_predictor_5/class_predictor")}}}}}function Dd(e){var t=[],n=function(e,t){var n=Xh(e,t);function r(e,t,r){return{filters:n(e+"/Conv2d_"+t+"_pointwise/weights",4,r+"/filters"),batch_norm_offset:n(e+"/Conv2d_"+t+"_pointwise/convolution_bn_offset",1,r+"/batch_norm_offset")}}function i(e){var t="mobilenetv1/conv_"+e,i="MobilenetV1/Conv2d_"+e+"_depthwise",o=t+"/depthwise_conv",a=t+"/pointwise_conv";return{depthwise_conv:{filters:n(i+"/depthwise_weights",4,o+"/filters"),batch_norm_scale:n(i+"/BatchNorm/gamma",1,o+"/batch_norm_scale"),batch_norm_offset:n(i+"/BatchNorm/beta",1,o+"/batch_norm_offset"),batch_norm_mean:n(i+"/BatchNorm/moving_mean",1,o+"/batch_norm_mean"),batch_norm_variance:n(i+"/BatchNorm/moving_variance",1,o+"/batch_norm_variance")},pointwise_conv:r("MobilenetV1",e,a)}}function o(e,t){return{filters:n(e+"/weights",4,t+"/filters"),bias:n(e+"/biases",1,t+"/bias")}}function a(e){return{box_encoding_predictor:o("Prediction/BoxPredictor_"+e+"/BoxEncodingPredictor","prediction_layer/box_predictor_"+e+"/box_encoding_predictor"),class_predictor:o("Prediction/BoxPredictor_"+e+"/ClassPredictor","prediction_layer/box_predictor_"+e+"/class_predictor")}}return{extractMobilenetV1Params:function(){return{conv_0:r("MobilenetV1",0,"mobilenetv1/conv_0"),conv_1:i(1),conv_2:i(2),conv_3:i(3),conv_4:i(4),conv_5:i(5),conv_6:i(6),conv_7:i(7),conv_8:i(8),conv_9:i(9),conv_10:i(10),conv_11:i(11),conv_12:i(12),conv_13:i(13)}},extractPredictionLayerParams:function(){return{conv_0:r("Prediction",0,"prediction_layer/conv_0"),conv_1:r("Prediction",1,"prediction_layer/conv_1"),conv_2:r("Prediction",2,"prediction_layer/conv_2"),conv_3:r("Prediction",3,"prediction_layer/conv_3"),conv_4:r("Prediction",4,"prediction_layer/conv_4"),conv_5:r("Prediction",5,"prediction_layer/conv_5"),conv_6:r("Prediction",6,"prediction_layer/conv_6"),conv_7:r("Prediction",7,"prediction_layer/conv_7"),box_predictor_0:a(0),box_predictor_1:a(1),box_predictor_2:a(2),box_predictor_3:a(3),box_predictor_4:a(4),box_predictor_5:a(5)}}}}(e,t),r=n.extractMobilenetV1Params,i=n.extractPredictionLayerParams,o=e["Output/extra_dim"];if(t.push({originalPath:"Output/extra_dim",paramPath:"output_layer/extra_dim"}),!Pf(o))throw new Error("expected weightMap['Output/extra_dim'] to be a Tensor3D, instead have "+o);var a={mobilenetv1:r(),prediction_layer:i(),output_layer:{extra_dim:o}};return zh(e,t),{params:a,paramMappings:t}}function Rd(e,t,n){return Zt(function(){var r=Au(e,t.filters,n,"same");return r=bA(r,t.batch_norm_offset),_s(r,0,6)})}function Td(e,t){return Zt(function(){var n=null,r=Rd(e,t.conv_0,[2,2]);if([t.conv_1,t.conv_2,t.conv_3,t.conv_4,t.conv_5,t.conv_6,t.conv_7,t.conv_8,t.conv_9,t.conv_10,t.conv_11,t.conv_12,t.conv_13].forEach(function(e,t){var i=t+1,o=function(e){return[2,4,6,12].some(function(t){return t===e})?[2,2]:[1,1]}(i);r=function(e,t,n){return Zt(function(){var r=fu(e,t.filters,n,"same");return r=cA(r,t.batch_norm_mean,t.batch_norm_variance,t.batch_norm_offset,t.batch_norm_scale,.0010000000474974513),_s(r,0,6)})}(r,e.depthwise_conv,o),r=Rd(r,e.pointwise_conv,[1,1]),11===i&&(n=r)}),null===n)throw new Error("mobileNetV1 - output of conv layer 11 is null");return{out:r,conv11:n}})}function Pd(e,t,n){var r=e.arraySync(),i=Math.min(r[t][0],r[t][2]),o=Math.min(r[t][1],r[t][3]),a=Math.max(r[t][0],r[t][2]),s=Math.max(r[t][1],r[t][3]),A=Math.min(r[n][0],r[n][2]),u=Math.min(r[n][1],r[n][3]),l=Math.max(r[n][0],r[n][2]),c=Math.max(r[n][1],r[n][3]),f=(a-i)*(s-o),h=(l-A)*(c-u);if(f<=0||h<=0)return 0;var d=Math.max(i,A),p=Math.max(o,u),g=Math.min(a,l),m=Math.min(s,c),v=Math.max(g-d,0)*Math.max(m-p,0);return v/(f+h-v)}function Od(e,t){var n=function(e){var t=xr(nl(e,[1,0])),n=[MA(t[2],t[0]),MA(t[3],t[1])];return{sizes:n,centers:[bA(t[0],FA(n[0],Bn(2))),bA(t[1],FA(n[1],Bn(2)))]}}(e),r=n.sizes,i=n.centers,o=xr(nl(t,[1,0])),a=FA(DA(Ls(FA(o[2],Bn(5))),r[0]),Bn(2)),s=bA(DA(FA(o[0],Bn(10)),r[0]),i[0]),A=FA(DA(Ls(FA(o[3],Bn(5))),r[1]),Bn(2)),u=bA(DA(FA(o[1],Bn(10)),r[1]),i[1]);return nl(yr([MA(s,a),MA(u,A),bA(s,a),bA(u,A)]),[1,0])}function Md(e,t){return Zt(function(){var n=e.shape[0];return{boxPredictionEncoding:mr(jh(e,t.box_encoding_predictor),[n,-1,1,4]),classPrediction:mr(jh(e,t.class_predictor),[n,-1,3])}})}var Hd=function(){function e(e){var t=void 0===e?{}:e,n=t.minConfidence,r=t.maxResults;if(this._name="SsdMobilenetv1Options",this._minConfidence=n||.5,this._maxResults=r||100,"number"!==typeof this._minConfidence||this._minConfidence<=0||this._minConfidence>=1)throw new Error(this._name+" - expected minConfidence to be a number between 0 and 1");if("number"!==typeof this._maxResults)throw new Error(this._name+" - expected maxResults to be a number")}return Object.defineProperty(e.prototype,"minConfidence",{get:function(){return this._minConfidence},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxResults",{get:function(){return this._maxResults},enumerable:!0,configurable:!0}),e}(),jd=function(e){function t(){return e.call(this,"SsdMobilenetv1")||this}return Nf(t,e),t.prototype.forwardInput=function(e){var t=this.params;if(!t)throw new Error("SsdMobilenetv1 - load model before inference");return Zt(function(){var n=e.toBatchTensor(512,!1).toFloat(),r=Td(MA(DA(n,Bn(.007843137718737125)),Bn(1)),t.mobilenetv1),i=function(e,t,n){return Zt(function(){var r=Rd(e,n.conv_0,[1,1]),i=Rd(r,n.conv_1,[2,2]),o=Rd(i,n.conv_2,[1,1]),a=Rd(o,n.conv_3,[2,2]),s=Rd(a,n.conv_4,[1,1]),A=Rd(s,n.conv_5,[2,2]),u=Rd(A,n.conv_6,[1,1]),l=Rd(u,n.conv_7,[2,2]),c=Md(t,n.box_predictor_0),f=Md(e,n.box_predictor_1),h=Md(i,n.box_predictor_2),d=Md(a,n.box_predictor_3),p=Md(A,n.box_predictor_4),g=Md(l,n.box_predictor_5);return{boxPredictions:Ln([c.boxPredictionEncoding,f.boxPredictionEncoding,h.boxPredictionEncoding,d.boxPredictionEncoding,p.boxPredictionEncoding,g.boxPredictionEncoding],1),classPredictions:Ln([c.classPrediction,f.classPrediction,h.classPrediction,d.classPrediction,p.classPrediction,g.classPrediction],1)}})}(r.out,r.conv11,t.prediction_layer);return function(e,t,n){return Zt(function(){var r=e.shape[0],i=Od(mr(br(n.extra_dim,[r,1,1]),[-1,4]),mr(e,[-1,4]));i=mr(i,[r,i.shape[0]/r,4]);var o=zs(Lu(t,[0,0,1],[-1,-1,-1])),a=Lu(o,[0,0,0],[-1,-1,1]);return a=mr(a,[r,a.shape[1]]),{boxes:xr(i),scores:xr(a)}})}(i.boxPredictions,i.classPredictions,t.output_layer)})},t.prototype.forward=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=this.forwardInput,[4,Nh(e)];case 1:return[2,t.apply(this,[n.sent()])]}})})},t.prototype.locateFaces=function(e,t){return void 0===t&&(t={}),Lf(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b;return Qf(this,function(B){switch(B.label){case 0:return n=new Hd(t),r=n.maxResults,i=n.minConfidence,[4,Nh(e)];case 1:for(o=B.sent(),a=this.forwardInput(o),s=a.boxes,A=a.scores,u=s[0],l=A[0],c=1;c<s.length;c++)s[c].dispose(),A[c].dispose();return d=(h=Array).from,[4,l.data()];case 2:return f=d.apply(h,[B.sent()]),p=function(e,t,n,r,i){var o=e.shape[0],a=Math.min(n,o),s=t.map(function(e,t){return{score:e,boxIndex:t}}).filter(function(e){return e.score>i}).sort(function(e,t){return t.score-e.score}),A=function(e){return e<=r?1:0},u=[];return s.forEach(function(t){if(!(u.length>=a)){for(var n=t.score,r=u.length-1;r>=0;--r){var o=Pd(e,t.boxIndex,u[r]);if(0!==o&&(t.score*=A(o),t.score<=i))break}n===t.score&&u.push(t.boxIndex)}}),u}(u,f,r,.5,i),g=o.getReshapedInputDimensions(0),m=o.inputSize,v=m/g.width,w=m/g.height,y=u.arraySync(),b=p.map(function(e){var t=[Math.max(0,y[e][0]),Math.min(1,y[e][2])].map(function(e){return e*w}),n=t[0],r=t[1],i=[Math.max(0,y[e][1]),Math.min(1,y[e][3])].map(function(e){return e*v}),a=i[0],s=i[1];return new Yf(f[e],new nh(a,n,s-a,r-n),{height:o.getInputHeight(0),width:o.getInputWidth(0)})}),u.dispose(),l.dispose(),[2,b]}})})},t.prototype.getDefaultModelName=function(){return"ssd_mobilenetv1_model"},t.prototype.extractParamsFromWeigthMap=function(e){return Dd(e)},t.prototype.extractParams=function(e){return function(e){var t=[],n=Yh(e),r=n.extractWeights,i=n.getRemainingWeights,o=Qd(r,t),a=o.extractMobilenetV1Params,s=o.extractPredictionLayerParams,A=a(),u=s(),l={extra_dim:Fn(r(20472),[1,5118,4])};if(t.push({paramPath:"output_layer/extra_dim"}),0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{params:{mobilenetv1:A,prediction_layer:u,output_layer:l},paramMappings:t}}(e)},t}(Ph);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Nf(t,e)}(jd);var zd,Kd=[new Vf(.738768,.874946),new Vf(2.42204,2.65704),new Vf(4.30971,7.04493),new Vf(10.246,4.59428),new Vf(12.6868,11.8741)],Wd=[new Vf(1.603231,2.094468),new Vf(6.041143,7.080126),new Vf(2.882459,3.518061),new Vf(4.266906,5.178857),new Vf(9.041765,10.66308)],Vd=[117.001,114.697,97.404],Gd=function(e){return"number"===typeof e};function qd(e){return Zt(function(){var t=DA(e,Bn(.10000000149011612));return bA($u(MA(e,t)),t)})}function Xd(e,t){return Zt(function(){var n=Ar(e,[[0,0],[1,1],[1,1],[0,0]]);return n=Au(n,t.conv.filters,[1,1],"valid"),n=MA(n,t.bn.sub),n=DA(n,t.bn.truediv),qd(n=bA(n,t.conv.bias))})}function Yd(e,t){return Zt(function(){var n=Ar(e,[[0,0],[1,1],[1,1],[0,0]]);return n=pu(n,t.depthwise_filter,t.pointwise_filter,[1,1],"valid"),qd(n=bA(n,t.bias))})}function Jd(e,t){var n=Kh(e,t);var r=Gh(e,t);return{extractConvParams:n,extractConvWithBatchNormParams:function(r,i,o){var a=n(r,i,3,o+"/conv"),s=function(n,r){var i=xn(e(n)),o=xn(e(n));return t.push({paramPath:r+"/sub"},{paramPath:r+"/truediv"}),{sub:i,truediv:o}}(i,o+"/bn");return{conv:a,bn:s}},extractSeparableConvParams:r}}function Zd(e,t){var n=Xh(e,t);function r(e){return{filters:n(e+"/filters",4),bias:n(e+"/bias",1)}}return{extractConvParams:r,extractConvWithBatchNormParams:function(e){var t=r(e+"/conv"),i=function(e){return{sub:n(e+"/sub",1),truediv:n(e+"/truediv",1)}}(e+"/bn");return{conv:t,bn:i}},extractSeparableConvParams:qh(n)}}!function(e){e[e.XS=224]="XS",e[e.SM=320]="SM",e[e.MD=416]="MD",e[e.LG=608]="LG"}(zd||(zd={}));var $d=function(){function e(e){var t=void 0===e?{}:e,n=t.inputSize,r=t.scoreThreshold;if(this._name="TinyYolov2Options",this._inputSize=n||416,this._scoreThreshold=r||.5,"number"!==typeof this._inputSize||this._inputSize%32!==0)throw new Error(this._name+" - expected inputSize to be a number divisible by 32");if("number"!==typeof this._scoreThreshold||this._scoreThreshold<=0||this._scoreThreshold>=1)throw new Error(this._name+" - expected scoreThreshold to be a number between 0 and 1")}return Object.defineProperty(e.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scoreThreshold",{get:function(){return this._scoreThreshold},enumerable:!0,configurable:!0}),e}(),ep=function(e){function t(t){var n=e.call(this,"TinyYolov2")||this;return function(e){if(!e)throw new Error("invalid config: "+e);if("boolean"!==typeof e.withSeparableConvs)throw new Error("config.withSeparableConvs has to be a boolean, have: "+e.withSeparableConvs);if(!Gd(e.iouThreshold)||e.iouThreshold<0||e.iouThreshold>1)throw new Error("config.iouThreshold has to be a number between [0, 1], have: "+e.iouThreshold);if(!Array.isArray(e.classes)||!e.classes.length||!e.classes.every(function(e){return"string"===typeof e}))throw new Error("config.classes has to be an array class names: string[], have: "+JSON.stringify(e.classes));if(!Array.isArray(e.anchors)||!e.anchors.length||!e.anchors.map(function(e){return e||{}}).every(function(e){return Gd(e.x)&&Gd(e.y)}))throw new Error("config.anchors has to be an array of { x: number, y: number }, have: "+JSON.stringify(e.anchors));if(e.meanRgb&&(!Array.isArray(e.meanRgb)||3!==e.meanRgb.length||!e.meanRgb.every(Gd)))throw new Error("config.meanRgb has to be an array of shape [number, number, number], have: "+JSON.stringify(e.meanRgb))}(t),n._config=t,n}return Nf(t,e),Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"withClassScores",{get:function(){return this.config.withClassScores||this.config.classes.length>1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"boxEncodingSize",{get:function(){return 5+(this.withClassScores?this.config.classes.length:0)},enumerable:!0,configurable:!0}),t.prototype.runTinyYolov2=function(e,t){var n=Xd(e,t.conv0);return n=Xd(n=ku(n,[2,2],[2,2],"same"),t.conv1),n=Xd(n=ku(n,[2,2],[2,2],"same"),t.conv2),n=Xd(n=ku(n,[2,2],[2,2],"same"),t.conv3),n=Xd(n=ku(n,[2,2],[2,2],"same"),t.conv4),n=Xd(n=ku(n,[2,2],[2,2],"same"),t.conv5),n=Xd(n=ku(n,[2,2],[1,1],"same"),t.conv6),jh(n=Xd(n,t.conv7),t.conv8,"valid",!1)},t.prototype.runMobilenet=function(e,t){var n=this.config.isFirstLayerConv2d?qd(jh(e,t.conv0,"valid",!1)):Yd(e,t.conv0);return n=Yd(n=ku(n,[2,2],[2,2],"same"),t.conv1),n=Yd(n=ku(n,[2,2],[2,2],"same"),t.conv2),n=Yd(n=ku(n,[2,2],[2,2],"same"),t.conv3),n=Yd(n=ku(n,[2,2],[2,2],"same"),t.conv4),n=Yd(n=ku(n,[2,2],[2,2],"same"),t.conv5),n=ku(n,[2,2],[1,1],"same"),n=t.conv6?Yd(n,t.conv6):n,jh(n=t.conv7?Yd(n,t.conv7):n,t.conv8,"valid",!1)},t.prototype.forwardInput=function(e,t){var n=this,r=this.params;if(!r)throw new Error("TinyYolov2 - load model before inference");return Zt(function(){var i=e.toBatchTensor(t,!1).toFloat();return i=(i=n.config.meanRgb?$f(i,n.config.meanRgb):i).div(Bn(256)),n.config.withSeparableConvs?n.runMobilenet(i,r):n.runTinyYolov2(i,r)})},t.prototype.forward=function(e,t){return Lf(this,void 0,void 0,function(){var n;return Qf(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,Nh(e)];case 1:return[4,n.apply(this,[r.sent(),t])];case 2:return[2,r.sent()]}})})},t.prototype.detect=function(e,t){return void 0===t&&(t={}),Lf(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l,c,f,h,d,p=this;return Qf(this,function(g){switch(g.label){case 0:return n=new $d(t),r=n.inputSize,i=n.scoreThreshold,[4,Nh(e)];case 1:return o=g.sent(),[4,this.forwardInput(o,r)];case 2:return a=g.sent(),s=Zt(function(){return xr(a)[0].expandDims()}),A={width:o.getInputWidth(0),height:o.getInputHeight(0)},[4,this.extractBoxes(s,o.getReshapedInputDimensions(0),i)];case 3:return u=g.sent(),a.dispose(),s.dispose(),l=u.map(function(e){return e.box}),c=u.map(function(e){return e.score}),f=u.map(function(e){return e.classScore}),h=u.map(function(e){return p.config.classes[e.label]}),d=Zf(l.map(function(e){return e.rescale(r)}),c,this.config.iouThreshold,!0),[2,d.map(function(e){return new Xf(c[e],f[e],h[e],l[e],A)})]}})})},t.prototype.getDefaultModelName=function(){return""},t.prototype.extractParamsFromWeigthMap=function(e){return function(e,t){var n,r=[],i=Zd(e,r),o=i.extractConvParams,a=i.extractConvWithBatchNormParams,s=i.extractSeparableConvParams;if(t.withSeparableConvs){var A=t.filterSizes&&t.filterSizes.length||9;n={conv0:t.isFirstLayerConv2d?o("conv0"):s("conv0"),conv1:s("conv1"),conv2:s("conv2"),conv3:s("conv3"),conv4:s("conv4"),conv5:s("conv5"),conv6:A>7?s("conv6"):void 0,conv7:A>8?s("conv7"):void 0,conv8:o("conv8")}}else n={conv0:a("conv0"),conv1:a("conv1"),conv2:a("conv2"),conv3:a("conv3"),conv4:a("conv4"),conv5:a("conv5"),conv6:a("conv6"),conv7:a("conv7"),conv8:o("conv8")};return zh(e,r),{params:n,paramMappings:r}}(e,this.config)},t.prototype.extractParams=function(e){var n=this.config.filterSizes||t.DEFAULT_FILTER_SIZES,r=n?n.length:void 0;if(7!==r&&8!==r&&9!==r)throw new Error("TinyYolov2 - expected 7 | 8 | 9 convolutional filters, but found "+r+" filterSizes in config");return function(e,t,n,r){var i,o=Yh(e),a=o.extractWeights,s=o.getRemainingWeights,A=[],u=Jd(a,A),l=u.extractConvParams,c=u.extractConvWithBatchNormParams,f=u.extractSeparableConvParams;if(t.withSeparableConvs){var h=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],w=r[6],y=r[7],b=r[8];i={conv0:t.isFirstLayerConv2d?l(h,d,3,"conv0"):f(h,d,"conv0"),conv1:f(d,p,"conv1"),conv2:f(p,g,"conv2"),conv3:f(g,m,"conv3"),conv4:f(m,v,"conv4"),conv5:f(v,w,"conv5"),conv6:y?f(w,y,"conv6"):void 0,conv7:b?f(y,b,"conv7"):void 0,conv8:l(b||y||w,5*n,1,"conv8")}}else h=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],w=r[6],y=r[7],b=r[8],i={conv0:c(h,d,"conv0"),conv1:c(d,p,"conv1"),conv2:c(p,g,"conv2"),conv3:c(g,m,"conv3"),conv4:c(m,v,"conv4"),conv5:c(v,w,"conv5"),conv6:c(w,y,"conv6"),conv7:c(y,b,"conv7"),conv8:l(b,5*n,1,"conv8")};if(0!==s().length)throw new Error("weights remaing after extract: "+s().length);return{params:i,paramMappings:A}}(e,this.config,this.boxEncodingSize,n)},t.prototype.extractBoxes=function(e,t,n){return Lf(this,void 0,void 0,function(){var r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E,S,k,_,I,N,U=this;return Qf(this,function(L){switch(L.label){case 0:return r=t.width,i=t.height,o=Math.max(r,i),a=o/r,s=o/i,A=e.shape[1],u=this.config.anchors.length,l=Zt(function(){var t=e.reshape([A,A,u,U.boxEncodingSize]);return[t.slice([0,0,0,0],[A,A,u,4]),t.slice([0,0,0,4],[A,A,u,1]),U.withClassScores?jr(t.slice([0,0,0,5],[A,A,u,U.config.classes.length]),3):Bn(0)]}),c=l[0],f=l[1],h=l[2],d=[],[4,f.array()];case 1:return p=L.sent(),[4,c.array()];case 2:g=L.sent(),m=0,L.label=3;case 3:if(!(m<A))return[3,12];v=0,L.label=4;case 4:if(!(v<A))return[3,11];w=0,L.label=5;case 5:return w<u?(y=eh(p[m][v][w][0]),!n||y>n?(b=(v+eh(g[m][v][w][0]))/A*a,B=(m+eh(g[m][v][w][1]))/A*s,x=Math.exp(g[m][v][w][2])*this.config.anchors[w].x/A*a,C=Math.exp(g[m][v][w][3])*this.config.anchors[w].y/A*s,F=b-x/2,E=B-C/2,S={row:m,col:v,anchor:w},this.withClassScores?[4,this.extractPredictedClass(h,S)]:[3,7]):[3,9]):[3,10];case 6:return N=L.sent(),[3,8];case 7:N={classScore:1,label:0},L.label=8;case 8:_=(k=N).classScore,I=k.label,d.push(Uf({box:new qf(F,E,F+x,E+C),score:y,classScore:y*_,label:I},S)),L.label=9;case 9:return w++,[3,5];case 10:return v++,[3,4];case 11:return m++,[3,3];case 12:return c.dispose(),f.dispose(),h.dispose(),[2,d]}})})},t.prototype.extractPredictedClass=function(e,t){return Lf(this,void 0,void 0,function(){var n,r,i,o;return Qf(this,function(a){switch(a.label){case 0:return n=t.row,r=t.col,i=t.anchor,[4,e.array()];case 1:return o=a.sent(),[2,Array(this.config.classes.length).fill(0).map(function(e,t){return o[n][r][i][t]}).map(function(e,t){return{classScore:e,label:t}}).reduce(function(e,t){return e.classScore>t.classScore?e:t})]}})})},t.DEFAULT_FILTER_SIZES=[3,16,32,64,128,256,512,1024,1024],t}(Ph),tp=function(e){function t(t){void 0===t&&(t=!0);var n=Object.assign({},{withSeparableConvs:t,iouThreshold:.4,classes:["face"]},t?{anchors:Wd,meanRgb:Vd}:{anchors:Kd,withClassScores:!0});return e.call(this,n)||this}return Nf(t,e),Object.defineProperty(t.prototype,"withSeparableConvs",{get:function(){return this.config.withSeparableConvs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),t.prototype.locateFaces=function(e,t){return Lf(this,void 0,void 0,function(){return Qf(this,function(n){switch(n.label){case 0:return[4,this.detect(e,t)];case 1:return[2,n.sent().map(function(e){return new Yf(e.score,e.relativeBox,{width:e.imageWidth,height:e.imageHeight})})]}})})},t.prototype.getDefaultModelName=function(){return this.withSeparableConvs?"tiny_yolov2_separable_conv_model":"tiny_yolov2_model"},t.prototype.extractParamsFromWeigthMap=function(t){return e.prototype.extractParamsFromWeigthMap.call(this,t)},t}(ep);var np=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._name="TinyFaceDetectorOptions",t}return Nf(t,e),t}($d),rp=function(){function e(){}return e.prototype.then=function(e){return Lf(this,void 0,void 0,function(){var t;return Qf(this,function(n){switch(n.label){case 0:return t=e,[4,this.run()];case 1:return[2,t.apply(void 0,[n.sent()])]}})})},e.prototype.run=function(){return Lf(this,void 0,void 0,function(){return Qf(this,function(e){throw new Error("ComposableTask - run is not implemented")})})},e}();function ip(e,t){var n={descriptor:t};return Object.assign({},e,n)}function op(e,t,n,r,i){return void 0===i&&(i=function(e){return e.alignedRect}),Lf(this,void 0,void 0,function(){var o,a,s,A,u;return Qf(this,function(l){switch(l.label){case 0:return o=e.map(function(e){return Ad(e)?i(e):e.detection}),(s=r)?[3,5]:t instanceof Ie?[4,Lh(t,o)]:[3,2];case 1:return A=l.sent(),[3,4];case 2:return[4,Uh(t,o)];case 3:A=l.sent(),l.label=4;case 4:s=A,l.label=5;case 5:return[4,n(a=s)];case 6:return u=l.sent(),a.forEach(function(e){return e instanceof Ie&&e.dispose()}),[2,u]}})})}function ap(e,t,n,r,i){return Lf(this,void 0,void 0,function(){var o=this;return Qf(this,function(a){return[2,op([e],t,function(e){return Lf(o,void 0,void 0,function(){return Qf(this,function(t){return[2,n(e[0])]})})},r,i)]})})}function sp(e){var t=Yh(e),n=t.extractWeights,r=t.getRemainingWeights,i=[],o=function(e,t){var n=Kh(e,t),r=Wh(e,t);function i(n,r){var i=xn(e(n));return t.push({paramPath:r}),i}function o(e,t,r){return void 0===r&&(r=!1),{conv1:n(e[0],e[1],3,t+"/conv1"),prelu1_alpha:i(e[1],t+"/prelu1_alpha"),conv2:n(e[1],e[2],3,t+"/conv2"),prelu2_alpha:i(e[2],t+"/prelu2_alpha"),conv3:n(e[2],e[3],r?2:3,t+"/conv3"),prelu3_alpha:i(e[3],t+"/prelu3_alpha")}}return{extractPNetParams:function(){var e=o([3,10,16,32],"pnet"),t=n(32,2,1,"pnet/conv4_1"),r=n(32,4,1,"pnet/conv4_2");return Uf(Uf({},e),{conv4_1:t,conv4_2:r})},extractRNetParams:function(){var e=o([3,28,48,64],"rnet",!0),t=r(576,128,"rnet/fc1"),n=i(128,"rnet/prelu4_alpha"),a=r(128,2,"rnet/fc2_1"),s=r(128,4,"rnet/fc2_2");return Uf(Uf({},e),{fc1:t,prelu4_alpha:n,fc2_1:a,fc2_2:s})},extractONetParams:function(){var e=o([3,32,64,64],"onet"),t=n(64,128,2,"onet/conv4"),a=i(128,"onet/prelu4_alpha"),s=r(1152,256,"onet/fc1"),A=i(256,"onet/prelu5_alpha"),u=r(256,2,"onet/fc2_1"),l=r(256,4,"onet/fc2_2"),c=r(256,10,"onet/fc2_3");return Uf(Uf({},e),{conv4:t,prelu4_alpha:a,fc1:s,prelu5_alpha:A,fc2_1:u,fc2_2:l,fc2_3:c})}}}(n,i),a=o.extractPNetParams,s=o.extractRNetParams,A=o.extractONetParams,u=a(),l=s(),c=A();if(0!==r().length)throw new Error("weights remaing after extract: "+r().length);return{params:{pnet:u,rnet:l,onet:c},paramMappings:i}}function Ap(e){var t=[],n=function(e,t){var n=Xh(e,t);function r(e){return{filters:n(e+"/weights",4,e+"/filters"),bias:n(e+"/bias",1)}}function i(e){return{weights:n(e+"/weights",2),bias:n(e+"/bias",1)}}function o(e){return n(e,1)}function a(e){return{conv1:r(e+"/conv1"),prelu1_alpha:o(e+"/prelu1_alpha"),conv2:r(e+"/conv2"),prelu2_alpha:o(e+"/prelu2_alpha"),conv3:r(e+"/conv3"),prelu3_alpha:o(e+"/prelu3_alpha")}}return{extractPNetParams:function(){var e=a("pnet"),t=r("pnet/conv4_1"),n=r("pnet/conv4_2");return Uf(Uf({},e),{conv4_1:t,conv4_2:n})},extractRNetParams:function(){var e=a("rnet"),t=i("rnet/fc1"),n=o("rnet/prelu4_alpha"),r=i("rnet/fc2_1"),s=i("rnet/fc2_2");return Uf(Uf({},e),{fc1:t,prelu4_alpha:n,fc2_1:r,fc2_2:s})},extractONetParams:function(){var e=a("onet"),t=r("onet/conv4"),n=o("onet/prelu4_alpha"),s=i("onet/fc1"),A=o("onet/prelu5_alpha"),u=i("onet/fc2_1"),l=i("onet/fc2_2"),c=i("onet/fc2_3");return Uf(Uf({},e),{conv4:t,prelu4_alpha:n,fc1:s,prelu5_alpha:A,fc2_1:u,fc2_2:l,fc2_3:c})}}}(e,t),r=n.extractPNetParams,i=n.extractRNetParams,o=n.extractONetParams,a=r(),s=i(),A=o();return zh(e,t),{params:{pnet:a,rnet:s,onet:A},paramMappings:t}}function up(e,t){var n=t[0],r=t[1];return{height:Math.floor(n*e),width:Math.floor(r*e)}}var lp=function(e){function t(t,n,r,i){return e.call(this,{left:t,top:n,right:r,bottom:i},!0)||this}return Nf(t,e),t}(Gf);function cp(e){return Zt(function(){return DA(MA(e,Bn(127.5)),Bn(.0078125))})}function fp(e,t){return Zt(function(){return bA($u(e),DA(t,Os($u(Os(e)))))})}function hp(e,t,n){return void 0===n&&(n=!1),Zt(function(){var r=jh(e,t.conv1,"valid");return r=fp(r,t.prelu1_alpha),r=fp(r=jh(r=ku(r,n?[2,2]:[3,3],[2,2],"same"),t.conv2,"valid"),t.prelu2_alpha),r=fp(r=jh(r=n?r:ku(r,[3,3],[2,2],"valid"),t.conv3,"valid"),t.prelu3_alpha)})}function dp(e,t,n,r,i){i.stage1=[];var o=t.map(function(t){return Zt(function(){var n={scale:t},i=function(e,t){return Zt(function(){var n=up(t,e.shape.slice(1)),r=n.height,i=n.width,o=cp(ql.resizeBilinear(e,[r,i]));return nl(o,[0,2,1,3])})}(e,t),o=Date.now(),a=function(e,t){return Zt(function(){var n=hp(e,t,!0),r=jh(n,t.conv4_1,"valid"),i=ir(Ku(r,3),3);return{prob:jr(MA(r,i),3),regions:jh(n,t.conv4_2,"valid")}})}(i,r),s=a.prob,A=a.regions;return n.pnet=Date.now()-o,{scoresTensor:xr(xr(s,3)[1])[0],regionsTensor:xr(A)[0],scale:t,statsForScale:n}})}),a=o.map(function(e){var t=e.scoresTensor,r=e.regionsTensor,o=e.scale,a=e.statsForScale,s=function(e,t,n,r){for(var i=[],o=e.arraySync(),a=0;a<e.shape[0];a++)for(var s=0;s<e.shape[1];s++)o[a][s]>=r&&i.push(new Vf(s,a));return i.map(function(e){var r=new qf(Math.round((2*e.y+1)/n),Math.round((2*e.x+1)/n),Math.round((2*e.y+12)/n),Math.round((2*e.x+12)/n)),i=o[e.y][e.x],a=t.arraySync();return{cell:r,score:i,region:new lp(a[e.y][e.x][0],a[e.y][e.x][1],a[e.y][e.x][2],a[e.y][e.x][3])}})}(t,r,o,n);if(t.dispose(),r.dispose(),!s.length)return i.stage1.push(a),[];var A=Date.now(),u=Zf(s.map(function(e){return e.cell}),s.map(function(e){return e.score}),.5);return a.nms=Date.now()-A,a.numBoxes=u.length,i.stage1.push(a),u.map(function(e){return s[e]})}),s=a.reduce(function(e,t){return e.concat(t)},[]),A=[],u=[];if(s.length>0){var l=Date.now(),c=Zf(s.map(function(e){return e.cell}),s.map(function(e){return e.score}),.7);i.stage1_nms=Date.now()-l,u=c.map(function(e){return s[e].score}),A=c.map(function(e){return s[e]}).map(function(e){var t=e.cell,n=e.region;return new qf(t.left+n.left*t.width,t.top+n.top*t.height,t.right+n.right*t.width,t.bottom+n.bottom*t.height).toSquare().round()})}return{boxes:A,scores:u}}function pp(e,t,n){var r=n.width,i=n.height;return Lf(this,void 0,void 0,function(){var n,o,a,s=this;return Qf(this,function(A){switch(A.label){case 0:return n=yh(e),[4,Promise.all(t.map(function(t){return Lf(s,void 0,void 0,function(){var r,i,o,a,s,A,u,l;return Qf(this,function(c){return r=t.padAtBorders(e.height,e.width),i=r.y,o=r.ey,a=r.x,s=r.ex,A=a-1,u=i-1,l=n.getImageData(A,u,s-A,o-u),[2,vh.isNodejs()?Sh(l):createImageBitmap(l)]})})}))];case 1:return o=A.sent(),a=[],o.forEach(function(e){var t=yh(Eh({width:r,height:i}));t.drawImage(e,0,0,r,i);for(var n=t.getImageData(0,0,r,i).data,o=[],s=0;s<n.length;s+=4)o.push(n[s+2]),o.push(n[s+1]),o.push(n[s]);a.push(o)}),[2,a.map(function(e){return Zt(function(){return cp(nl(En(e,[1,r,i,3]),[0,2,1,3]).toFloat())})})]}})})}function gp(e,t,n,r,i){return Lf(this,void 0,void 0,function(){var o,a,s,A,u,l,c,f,h,d,p,g,m,v;return Qf(this,function(w){switch(w.label){case 0:return o=Date.now(),[4,pp(e,t,{width:24,height:24})];case 1:return a=w.sent(),i.stage2_extractImagePatches=Date.now()-o,o=Date.now(),s=a.map(function(e){var t=function(e,t){return Zt(function(){var n=hp(e,t),r=fp(td(mr(n,[n.shape[0],t.fc1.weights.shape[0]]),t.fc1),t.prelu4_alpha),i=td(r,t.fc2_1),o=ir(Ku(i,1),1),a=jr(MA(i,o),1),s=td(r,t.fc2_2);return{scores:xr(a,1)[1],regions:s}})}(e,r);return e.dispose(),t}),i.stage2_rnet=Date.now()-o,A=s.length>1?Ln(s.map(function(e){return e.scores})):s[0].scores,c=(l=Array).from,[4,A.data()];case 2:return u=c.apply(l,[w.sent()]),A.dispose(),f=u.map(function(e,t){return{score:e,idx:t}}).filter(function(e){return e.score>n}).map(function(e){return e.idx}),h=f.map(function(e){return t[e]}),d=f.map(function(e){return u[e]}),p=[],g=[],h.length>0&&(o=Date.now(),m=Zf(h,d,.7),i.stage2_nms=Date.now()-o,v=m.map(function(e){var t=s[f[e]].regions.arraySync();return new lp(t[0][0],t[0][1],t[0][2],t[0][3])}),g=m.map(function(e){return d[e]}),p=m.map(function(e,t){return h[e].calibrate(v[t])})),s.forEach(function(e){e.regions.dispose(),e.scores.dispose()}),[2,{boxes:p,scores:g}]}})})}function mp(e,t,n,r,i){return Lf(this,void 0,void 0,function(){var o,a,s,A,u,l,c,f,h,d,p,g,m,v,w;return Qf(this,function(y){switch(y.label){case 0:return o=Date.now(),[4,pp(e,t,{width:48,height:48})];case 1:return a=y.sent(),i.stage3_extractImagePatches=Date.now()-o,o=Date.now(),s=a.map(function(e){var t=function(e,t){return Zt(function(){var n=hp(e,t);n=fp(n=jh(n=ku(n,[2,2],[2,2],"same"),t.conv4,"valid"),t.prelu4_alpha);var r=fp(td(mr(n,[n.shape[0],t.fc1.weights.shape[0]]),t.fc1),t.prelu5_alpha),i=td(r,t.fc2_1),o=ir(Ku(i,1),1),a=jr(MA(i,o),1),s=td(r,t.fc2_2),A=td(r,t.fc2_3);return{scores:xr(a,1)[1],regions:s,points:A}})}(e,r);return e.dispose(),t}),i.stage3_onet=Date.now()-o,A=s.length>1?Ln(s.map(function(e){return e.scores})):s[0].scores,c=(l=Array).from,[4,A.data()];case 2:return u=c.apply(l,[y.sent()]),A.dispose(),f=u.map(function(e,t){return{score:e,idx:t}}).filter(function(e){return e.score>n}).map(function(e){return e.idx}),h=f.map(function(e){var t=s[e].regions.arraySync();return new lp(t[0][0],t[0][1],t[0][2],t[0][3])}),d=f.map(function(e,n){return t[e].calibrate(h[n])}),p=f.map(function(e){return u[e]}),g=[],m=[],v=[],d.length>0&&(o=Date.now(),w=Zf(d,p,.7,!1),i.stage3_nms=Date.now()-o,g=w.map(function(e){return d[e]}),m=w.map(function(e){return p[e]}),v=w.map(function(e,t){return Array(5).fill(0).map(function(n,r){var i=s[e].points.arraySync();return new Vf(i[0][r]*(g[t].width+1)+g[t].left,i[0][r+5]*(g[t].height+1)+g[t].top)})})),s.forEach(function(e){e.regions.dispose(),e.scores.dispose(),e.points.dispose()}),[2,{boxes:g,scores:m,points:v}]}})})}var vp=function(e){function t(){return e.call(this,"Mtcnn")||this}return Nf(t,e),t.prototype.load=function(t){return Lf(this,void 0,void 0,function(){return Qf(this,function(n){return console.warn("mtcnn is deprecated and will be removed soon"),[2,e.prototype.load.call(this,t)]})})},t.prototype.loadFromDisk=function(t){return Lf(this,void 0,void 0,function(){return Qf(this,function(n){return console.warn("mtcnn is deprecated and will be removed soon"),[2,e.prototype.loadFromDisk.call(this,t)]})})},t.prototype.forwardInput=function(e,t){return void 0===t&&(t={}),Lf(this,void 0,void 0,function(){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b,B;return Qf(this,function(x){switch(x.label){case 0:if(!(n=this.params))throw new Error("Mtcnn - load model before inference");if(!(r=e.canvases[0]))throw new Error("Mtcnn - inputCanvas is not defined, note that passing tensors into Mtcnn.forwardInput is not supported yet.");return i={},o=Date.now(),a=Zt(function(){return e=ir(df.fromPixels(r)).toFloat(),Zt(function(){return yr(xr(e,3).reverse(),3)});var e}),s=function(e){return a.dispose(),i.total=Date.now()-o,e},A=a.shape.slice(1),u=A[0],l=A[1],c=new Ld(t),f=c.minFaceSize,h=c.scaleFactor,d=c.maxNumScales,p=c.scoreThresholds,g=c.scaleSteps,m=(g||function(e,t,n){for(var r=n[0],i=n[1],o=12/e,a=[],s=Math.min(r,i)*o,A=0;s>=12;)a.push(o*Math.pow(t,A)),s*=t,A+=1;return a}(f,h,[u,l])).filter(function(e){var t=up(e,[u,l]);return Math.min(t.width,t.height)>12}).slice(0,d),i.scales=m,i.pyramid=m.map(function(e){return up(e,[u,l])}),v=Date.now(),[4,dp(a,m,p[0],n.pnet,i)];case 1:return w=x.sent(),i.total_stage1=Date.now()-v,w.boxes.length?(i.stage2_numInputBoxes=w.boxes.length,v=Date.now(),[4,gp(r,w.boxes,p[1],n.rnet,i)]):[2,s({results:[],stats:i})];case 2:return y=x.sent(),i.total_stage2=Date.now()-v,y.boxes.length?(i.stage3_numInputBoxes=y.boxes.length,v=Date.now(),[4,mp(r,y.boxes,p[2],n.onet,i)]):[2,s({results:[],stats:i})];case 3:return b=x.sent(),i.total_stage3=Date.now()-v,B=b.boxes.map(function(e,t){return ud(uh({},new Yf(b.scores[t],new nh(e.left/l,e.top/u,e.width/l,e.height/u),{height:u,width:l})),new ih(b.points[t].map(function(t){return t.sub(new Vf(e.left,e.top)).div(new Vf(e.width,e.height))}),{width:e.width,height:e.height}))}),[2,s({results:B,stats:i})]}})})},t.prototype.forward=function(e,t){return void 0===t&&(t={}),Lf(this,void 0,void 0,function(){var n;return Qf(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,Nh(e)];case 1:return[4,n.apply(this,[r.sent(),t])];case 2:return[2,r.sent().results]}})})},t.prototype.forwardWithStats=function(e,t){return void 0===t&&(t={}),Lf(this,void 0,void 0,function(){var n;return Qf(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,Nh(e)];case 1:return[2,n.apply(this,[r.sent(),t])]}})})},t.prototype.getDefaultModelName=function(){return"mtcnn_model"},t.prototype.extractParamsFromWeigthMap=function(e){return Ap(e)},t.prototype.extractParams=function(e){return sp(e)},t}(Ph),wp=[new Vf(1.603231,2.094468),new Vf(6.041143,7.080126),new Vf(2.882459,3.518061),new Vf(4.266906,5.178857),new Vf(9.041765,10.66308)],yp=[117.001,114.697,97.404],bp=function(e){function t(){var t={withSeparableConvs:!0,iouThreshold:.4,classes:["face"],anchors:wp,meanRgb:yp,isFirstLayerConv2d:!0,filterSizes:[3,16,32,64,128,256,512]};return e.call(this,t)||this}return Nf(t,e),Object.defineProperty(t.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),t.prototype.locateFaces=function(e,t){return Lf(this,void 0,void 0,function(){return Qf(this,function(n){switch(n.label){case 0:return[4,this.detect(e,t)];case 1:return[2,n.sent().map(function(e){return new Yf(e.score,e.relativeBox,{width:e.imageWidth,height:e.imageHeight})})]}})})},t.prototype.getDefaultModelName=function(){return"tiny_face_detector_model"},t.prototype.extractParamsFromWeigthMap=function(t){return e.prototype.extractParamsFromWeigthMap.call(this,t)},t}(ep),Bp={ssdMobilenetv1:new jd,tinyFaceDetector:new bp,tinyYolov2:new tp,mtcnn:new vp,faceLandmark68Net:new yd,faceLandmark68TinyNet:new Bd,faceRecognitionNet:new Nd,faceExpressionNet:new ad,ageGenderNet:new vd};function xp(e,t){var n={age:t};return Object.assign({},e,n)}var Cp=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parentTask=t,i.input=n,i.extractedFaces=r,i}return Nf(t,e),t}(rp),Fp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n=this;return Qf(this,function(r){switch(r.label){case 0:return[4,this.parentTask];case 1:return[4,op(e=r.sent(),this.input,function(e){return Lf(n,void 0,void 0,function(){return Qf(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(e){return Bp.faceExpressionNet.predictExpressions(e)}))];case 1:return[2,t.sent()]}})})},this.extractedFaces)];case 2:return t=r.sent(),[2,e.map(function(e,n){return sd(e,t[n])})]}})})},t.prototype.withAgeAndGender=function(){return new Ip(this,this.input)},t}(Cp),Ep=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t;return Qf(this,function(n){switch(n.label){case 0:return[4,this.parentTask];case 1:return(e=n.sent())?[4,ap(e,this.input,function(e){return Bp.faceExpressionNet.predictExpressions(e)},this.extractedFaces)]:[2];case 2:return t=n.sent(),[2,sd(e,t)]}})})},t.prototype.withAgeAndGender=function(){return new Np(this,this.input)},t}(Cp),Sp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.withAgeAndGender=function(){return new Up(this,this.input)},t.prototype.withFaceDescriptors=function(){return new Dp(this,this.input)},t}(Fp),kp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.withAgeAndGender=function(){return new Lp(this,this.input)},t.prototype.withFaceDescriptor=function(){return new Rp(this,this.input)},t}(Ep),_p=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parentTask=t,i.input=n,i.extractedFaces=r,i}return Nf(t,e),t}(rp),Ip=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n=this;return Qf(this,function(r){switch(r.label){case 0:return[4,this.parentTask];case 1:return[4,op(e=r.sent(),this.input,function(e){return Lf(n,void 0,void 0,function(){return Qf(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(e){return Bp.ageGenderNet.predictAgeAndGender(e)}))];case 1:return[2,t.sent()]}})})},this.extractedFaces)];case 2:return t=r.sent(),[2,e.map(function(e,n){var r=t[n],i=r.age;return xp(Ud(e,r.gender,r.genderProbability),i)})]}})})},t.prototype.withFaceExpressions=function(){return new Fp(this,this.input)},t}(_p),Np=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n,r,i;return Qf(this,function(o){switch(o.label){case 0:return[4,this.parentTask];case 1:return(e=o.sent())?[4,ap(e,this.input,function(e){return Bp.ageGenderNet.predictAgeAndGender(e)},this.extractedFaces)]:[2];case 2:return t=o.sent(),n=t.age,r=t.gender,i=t.genderProbability,[2,xp(Ud(e,r,i),n)]}})})},t.prototype.withFaceExpressions=function(){return new Ep(this,this.input)},t}(_p),Up=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.withFaceExpressions=function(){return new Sp(this,this.input)},t.prototype.withFaceDescriptors=function(){return new Dp(this,this.input)},t}(Ip),Lp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.withFaceExpressions=function(){return new kp(this,this.input)},t.prototype.withFaceDescriptor=function(){return new Rp(this,this.input)},t}(Np),Qp=function(e){function t(t,n){var r=e.call(this)||this;return r.parentTask=t,r.input=n,r}return Nf(t,e),t}(rp),Dp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e;return Qf(this,function(t){switch(t.label){case 0:return[4,this.parentTask];case 1:return[4,op(e=t.sent(),this.input,function(e){return Promise.all(e.map(function(e){return Bp.faceRecognitionNet.computeFaceDescriptor(e)}))},null,function(e){return e.landmarks.align(null,{useDlibAlignment:!0})})];case 2:return[2,t.sent().map(function(t,n){return ip(e[n],t)})]}})})},t.prototype.withFaceExpressions=function(){return new Sp(this,this.input)},t.prototype.withAgeAndGender=function(){return new Up(this,this.input)},t}(Qp),Rp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t;return Qf(this,function(n){switch(n.label){case 0:return[4,this.parentTask];case 1:return(e=n.sent())?[4,ap(e,this.input,function(e){return Bp.faceRecognitionNet.computeFaceDescriptor(e)},null,function(e){return e.landmarks.align(null,{useDlibAlignment:!0})})]:[2];case 2:return t=n.sent(),[2,ip(e,t)]}})})},t.prototype.withFaceExpressions=function(){return new kp(this,this.input)},t.prototype.withAgeAndGender=function(){return new Lp(this,this.input)},t}(Qp),Tp=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parentTask=t,i.input=n,i.useTinyLandmarkNet=r,i}return Nf(t,e),Object.defineProperty(t.prototype,"landmarkNet",{get:function(){return this.useTinyLandmarkNet?Bp.faceLandmark68TinyNet:Bp.faceLandmark68Net},enumerable:!0,configurable:!0}),t}(rp),Pp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n,r,i,o=this;return Qf(this,function(a){switch(a.label){case 0:return[4,this.parentTask];case 1:return e=a.sent(),t=e.map(function(e){return e.detection}),this.input instanceof Ie?[4,Lh(this.input,t)]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,Uh(this.input,t)];case 4:r=a.sent(),a.label=5;case 5:return n=r,[4,Promise.all(n.map(function(e){return o.landmarkNet.detectLandmarks(e)}))];case 6:return i=a.sent(),n.forEach(function(e){return e instanceof Ie&&e.dispose()}),[2,e.map(function(e,t){return ud(e,i[t])})]}})})},t.prototype.withFaceExpressions=function(){return new Sp(this,this.input)},t.prototype.withAgeAndGender=function(){return new Up(this,this.input)},t.prototype.withFaceDescriptors=function(){return new Dp(this,this.input)},t}(Tp),Op=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n,r,i;return Qf(this,function(o){switch(o.label){case 0:return[4,this.parentTask];case 1:return(e=o.sent())?(t=e.detection,this.input instanceof Ie?[4,Lh(this.input,[t])]:[3,3]):[2];case 2:return r=o.sent(),[3,5];case 3:return[4,Uh(this.input,[t])];case 4:r=o.sent(),o.label=5;case 5:return n=r,[4,this.landmarkNet.detectLandmarks(n[0])];case 6:return i=o.sent(),n.forEach(function(e){return e instanceof Ie&&e.dispose()}),[2,ud(e,i)]}})})},t.prototype.withFaceExpressions=function(){return new kp(this,this.input)},t.prototype.withAgeAndGender=function(){return new Lp(this,this.input)},t.prototype.withFaceDescriptor=function(){return new Rp(this,this.input)},t}(Tp),Mp=function(e){function t(t,n){void 0===n&&(n=new Hd);var r=e.call(this)||this;return r.input=t,r.options=n,r}return Nf(t,e),t}(rp),Hp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t,n,r;return Qf(this,function(i){switch(i.label){case 0:return t=(e=this).input,(n=e.options)instanceof Ld?[4,Bp.mtcnn.forward(t,n)]:[3,2];case 1:return[2,i.sent().map(function(e){return e.detection})];case 2:if(r=n instanceof np?function(e){return Bp.tinyFaceDetector.locateFaces(e,n)}:n instanceof Hd?function(e){return Bp.ssdMobilenetv1.locateFaces(e,n)}:n instanceof $d?function(e){return Bp.tinyYolov2.locateFaces(e,n)}:null,!r)throw new Error("detectFaces - expected options to be instance of TinyFaceDetectorOptions | SsdMobilenetv1Options | MtcnnOptions | TinyYolov2Options");return[2,r(t)]}})})},t.prototype.runAndExtendWithFaceDetections=function(){var e=this;return new Promise(function(t){return Lf(e,void 0,void 0,function(){var e;return Qf(this,function(n){switch(n.label){case 0:return[4,this.run()];case 1:return e=n.sent(),[2,t(e.map(function(e){return uh({},e)}))]}})})})},t.prototype.withFaceLandmarks=function(e){return void 0===e&&(e=!1),new Pp(this.runAndExtendWithFaceDetections(),this.input,e)},t.prototype.withFaceExpressions=function(){return new Fp(this.runAndExtendWithFaceDetections(),this.input)},t.prototype.withAgeAndGender=function(){return new Ip(this.runAndExtendWithFaceDetections(),this.input)},t}(Mp),jp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nf(t,e),t.prototype.run=function(){return Lf(this,void 0,void 0,function(){var e,t;return Qf(this,function(n){switch(n.label){case 0:return[4,new Hp(this.input,this.options)];case 1:return e=n.sent(),t=e[0],e.forEach(function(e){e.score>t.score&&(t=e)}),[2,t]}})})},t.prototype.runAndExtendWithFaceDetection=function(){var e=this;return new Promise(function(t){return Lf(e,void 0,void 0,function(){var e;return Qf(this,function(n){switch(n.label){case 0:return[4,this.run()];case 1:return e=n.sent(),[2,t(e?uh({},e):void 0)]}})})})},t.prototype.withFaceLandmarks=function(e){return void 0===e&&(e=!1),new Op(this.runAndExtendWithFaceDetection(),this.input,e)},t.prototype.withFaceExpressions=function(){return new Ep(this.runAndExtendWithFaceDetection(),this.input)},t.prototype.withAgeAndGender=function(){return new Np(this.runAndExtendWithFaceDetection(),this.input)},t}(Mp);!function(){function e(e,t){void 0===t&&(t=.6),this._distanceThreshold=t;var n=Array.isArray(e)?e:[e];if(!n.length)throw new Error("FaceRecognizer.constructor - expected atleast one input");var r=1,i=function(){return"person "+r++};this._labeledDescriptors=n.map(function(e){if(e instanceof Ah)return e;if(e instanceof Float32Array)return new Ah(i(),[e]);if(e.descriptor&&e.descriptor instanceof Float32Array)return new Ah(i(),[e.descriptor]);throw new Error("FaceRecognizer.constructor - expected inputs to be of type LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array | Array<LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array>")})}Object.defineProperty(e.prototype,"labeledDescriptors",{get:function(){return this._labeledDescriptors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"distanceThreshold",{get:function(){return this._distanceThreshold},enumerable:!0,configurable:!0}),e.prototype.computeMeanDistance=function(e,t){return t.map(function(t){return function(e,t){if(e.length!==t.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");var n=Array.from(e),r=Array.from(t);return Math.sqrt(n.map(function(e,t){return e-r[t]}).reduce(function(e,t){return e+Math.pow(t,2)},0))}(t,e)}).reduce(function(e,t){return e+t},0)/(t.length||1)},e.prototype.matchDescriptor=function(e){var t=this;return this.labeledDescriptors.map(function(n){var r=n.descriptors,i=n.label;return new ah(i,t.computeMeanDistance(e,r))}).reduce(function(e,t){return e.distance<t.distance?e:t})},e.prototype.findBestMatch=function(e){var t=this.matchDescriptor(e);return t.distance<this.distanceThreshold?t:new ah("unknown",t.distance)},e.prototype.toJSON=function(){return{distanceThreshold:this.distanceThreshold,labeledDescriptors:this.labeledDescriptors.map(function(e){return e.toJSON()})}},e.fromJSON=function(t){var n=t.labeledDescriptors.map(function(e){return Ah.fromJSON(e)});return new e(n,t.distanceThreshold)}}();function zp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Kp=n(4980);function Wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wp(Object(n),!0).forEach(function(t){(0,Kp.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Gp=["sri"],qp=["page"],Xp=["page","matches"],Yp=["onClick","discover","prefetch","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jp=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Zp=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];var $p="popstate";function eg(){return sg(function(e,t){let{pathname:n,search:r,hash:i}=e.location;return ig("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:og(t)},null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function tg(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function ng(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function rg(e,t){return{usr:e.state,key:e.key,idx:t}}function ig(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return Vp(Vp({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?ag(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)})}function og(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function ag(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function sg(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s="POP",A=null,u=l();function l(){return(a.state||{idx:null}).idx}function c(){s="POP";let e=l(),t=null==e?null:e-u;u=e,A&&A({action:s,location:h.location,delta:t})}function f(e){return Ag(e)}null==u&&(u=0,a.replaceState(Vp(Vp({},a.state),{},{idx:u}),""));let h={get action(){return s},get location(){return e(i,a)},listen(e){if(A)throw new Error("A history only accepts one active listener");return i.addEventListener($p,c),A=e,()=>{i.removeEventListener($p,c),A=null}},createHref:e=>t(i,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=ig(h.location,e,t);n&&n(r,e),u=l()+1;let c=rg(r,u),f=h.createHref(r);try{a.pushState(c,"",f)}catch(d){if(d instanceof DOMException&&"DataCloneError"===d.name)throw d;i.location.assign(f)}o&&A&&A({action:s,location:h.location,delta:1})},replace:function(e,t){s="REPLACE";let r=ig(h.location,e,t);n&&n(r,e),u=l();let i=rg(r,u),c=h.createHref(r);a.replaceState(i,"",c),o&&A&&A({action:s,location:h.location,delta:0})},go:e=>a.go(e)};return h}function Ag(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="http://localhost";"undefined"!==typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),tg(n,"No window.location.(origin|href) available to create URL");let r="string"===typeof e?e:og(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}new WeakMap;function ug(e,t){return lg(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function lg(e,t,n,r){let i=Fg(("string"===typeof t?ag(t):t).pathname||"/",n);if(null==i)return null;let o=cg(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let a=null;for(let s=0;null==a&&s<o.length;++s){let e=Cg(i);a=bg(o[s],e,r)}return a}function cg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=function(e,o){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i,s=arguments.length>3?arguments[3]:void 0,A={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(A.relativePath.startsWith("/")){if(!A.relativePath.startsWith(r)&&a)return;tg(A.relativePath.startsWith(r),'Absolute route path "'.concat(A.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),A.relativePath=A.relativePath.slice(r.length)}let u=Ig([r,A.relativePath]),l=n.concat(A);e.children&&e.children.length>0&&(tg(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(u,'".')),cg(e.children,t,l,u,a)),(null!=e.path||e.index)&&t.push({path:u,score:yg(u,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of fg(e.path))o(e,t,!0,r);else o(e,t)}),t}function fg(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=fg(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var hg=/^:[\w-]+$/,dg=3,pg=2,gg=1,mg=10,vg=-2,wg=e=>"*"===e;function yg(e,t){let n=e.split("/"),r=n.length;return n.some(wg)&&(r+=vg),t&&(r+=pg),n.filter(e=>!wg(e)).reduce((e,t)=>e+(hg.test(t)?dg:""===t?gg:mg),r)}function bg(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],A=s===r.length-1,u="/"===o?t:t.slice(o.length)||"/",l=Bg({path:e.relativePath,caseSensitive:e.caseSensitive,end:A},u),c=e.route;if(!l&&A&&n&&!r[r.length-1].route.index&&(l=Bg({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!l)return null;Object.assign(i,l.params),a.push({params:i,pathname:Ig([o,l.pathname]),pathnameBase:Ng(Ig([o,l.pathnameBase])),route:c}),"/"!==l.pathnameBase&&(o=Ig([o,l.pathnameBase]))}return a}function Bg(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xg(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const A=s[n];return e[r]=i&&!A?void 0:(A||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function xg(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];ng("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Cg(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return ng(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function Fg(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Eg(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function Sg(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function kg(e){let t=Sg(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _g(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=ag(e):(r=Vp({},e),tg(!r.pathname||!r.pathname.includes("?"),Eg("?","pathname","search",r)),tg(!r.pathname||!r.pathname.includes("#"),Eg("#","pathname","hash",r)),tg(!r.search||!r.search.includes("#"),Eg("#","search","hash",r)));let o,a=""===e||""===r.pathname,s=a?"/":r.pathname;if(null==s)o=n;else{let e=t.length-1;if(!i&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}o=e>=0?t[e]:"/"}let A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:i=""}="string"===typeof e?ag(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:Ug(r),hash:Lg(i)}}(r,o),u=s&&"/"!==s&&s.endsWith("/"),l=(a||"."===s)&&n.endsWith("/");return A.pathname.endsWith("/")||!u&&!l||(A.pathname+="/"),A}var Ig=e=>e.join("/").replace(/\/\/+/g,"/"),Ng=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ug=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Lg=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function Qg(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var Dg=["POST","PUT","PATCH","DELETE"],Rg=(new Set(Dg),["GET",...Dg]);new Set(Rg),Symbol("ResetLoaderData");var Tg=e.createContext(null);Tg.displayName="DataRouter";var Pg=e.createContext(null);Pg.displayName="DataRouterState";var Og=e.createContext(!1);var Mg=e.createContext({isTransitioning:!1});Mg.displayName="ViewTransition";var Hg=e.createContext(new Map);Hg.displayName="Fetchers";var jg=e.createContext(null);jg.displayName="Await";var zg=e.createContext(null);zg.displayName="Navigation";var Kg=e.createContext(null);Kg.displayName="Location";var Wg=e.createContext({outlet:null,matches:[],isDataRoute:!1});Wg.displayName="Route";var Vg=e.createContext(null);Vg.displayName="RouteError";function Gg(){return null!=e.useContext(Kg)}function qg(){return tg(Gg(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(Kg).location}var Xg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Yg(t){e.useContext(zg).static||e.useLayoutEffect(t)}function Jg(){let{isDataRoute:t}=e.useContext(Wg);return t?function(){let{router:t}=am("useNavigate"),n=Am("useNavigate"),r=e.useRef(!1);Yg(()=>{r.current=!0});let i=e.useCallback(async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ng(r.current,Xg),r.current&&("number"===typeof e?t.navigate(e):await t.navigate(e,Vp({fromRouteId:n},i)))},[t,n]);return i}():function(){tg(Gg(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(Tg),{basename:n,navigator:r}=e.useContext(zg),{matches:i}=e.useContext(Wg),{pathname:o}=qg(),a=JSON.stringify(kg(i)),s=e.useRef(!1);Yg(()=>{s.current=!0});let A=e.useCallback(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ng(s.current,Xg),!s.current)return;if("number"===typeof e)return void r.go(e);let A=_g(e,JSON.parse(a),o,"path"===i.relative);null==t&&"/"!==n&&(A.pathname="/"===A.pathname?n:Ig([n,A.pathname])),(i.replace?r.replace:r.push)(A,i.state,i)},[n,r,a,o,t]);return A}()}e.createContext(null);function Zg(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:r}=e.useContext(Wg),{pathname:i}=qg(),o=JSON.stringify(kg(r));return e.useMemo(()=>_g(t,JSON.parse(o),i,"path"===n),[t,o,i,n])}function $g(t,n,r,i,o){tg(Gg(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=e.useContext(zg),{matches:s}=e.useContext(Wg),A=s[s.length-1],u=A?A.params:{},l=A?A.pathname:"/",c=A?A.pathnameBase:"/",f=A&&A.route;{let e=f&&f.path||"";cm(l,!f||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(l,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let h,d=qg();if(n){var p;let e="string"===typeof n?ag(n):n;tg("/"===c||(null===(p=e.pathname)||void 0===p?void 0:p.startsWith(c)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(c,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),h=e}else h=d;let g=h.pathname||"/",m=g;if("/"!==c){let e=c.replace(/^\//,"").split("/");m="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=ug(t,{pathname:m});ng(f||null!=v,'No routes matched location "'.concat(h.pathname).concat(h.search).concat(h.hash,'" ')),ng(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,'Matched leaf route at location "'.concat(h.pathname).concat(h.search).concat(h.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let w=im(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:Ig([c,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Ig([c,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,i,o);return n&&w?e.createElement(Kg.Provider,{value:{location:Vp({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:"POP"}},w):w}function em(){let t=um(),n=Qg(t)?"".concat(t.status," ").concat(t.statusText):t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},s=null;return console.error("Error handled by React Router default ErrorBoundary:",t),s=e.createElement(e.Fragment,null,e.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:a},"ErrorBoundary")," or"," ",e.createElement("code",{style:a},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),r?e.createElement("pre",{style:o},r):null,s)}var tm=e.createElement(em,null),nm=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return void 0!==this.state.error?e.createElement(Wg.Provider,{value:this.props.routeContext},e.createElement(Vg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function rm(t){let{routeContext:n,match:r,children:i}=t,o=e.useContext(Tg);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(Wg.Provider,{value:n},i)}function im(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(null==t){if(!r)return null;if(r.errors)t=r.matches;else{if(0!==n.length||r.initialized||!(r.matches.length>0))return null;t=r.matches}}let o=t,a=null===r||void 0===r?void 0:r.errors;if(null!=a){let e=o.findIndex(e=>e.route.id&&void 0!==(null===a||void 0===a?void 0:a[e.route.id]));tg(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(a).join(","))),o=o.slice(0,Math.min(o.length,e+1))}let s=!1,A=-1;if(r)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(A=e),t.route.id){let{loaderData:e,errors:n}=r,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||i){s=!0,o=A>=0?o.slice(0,A+1):[o[0]];break}}}return o.reduceRight((t,u,l)=>{let c,f=!1,h=null,d=null;r&&(c=a&&u.route.id?a[u.route.id]:void 0,h=u.route.errorElement||tm,s&&(A<0&&0===l?(cm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,d=null):A===l&&(f=!0,d=u.route.hydrateFallbackElement||null)));let p=n.concat(o.slice(0,l+1)),g=()=>{let n;return n=c?h:f?d:u.route.Component?e.createElement(u.route.Component,null):u.route.element?u.route.element:t,e.createElement(rm,{match:u,routeContext:{outlet:t,matches:p,isDataRoute:null!=r},children:n})};return r&&(u.route.ErrorBoundary||u.route.errorElement||0===l)?e.createElement(nm,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0},unstable_onError:i}):g()},null)}function om(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function am(t){let n=e.useContext(Tg);return tg(n,om(t)),n}function sm(t){let n=e.useContext(Pg);return tg(n,om(t)),n}function Am(t){let n=function(t){let n=e.useContext(Wg);return tg(n,om(t)),n}(t),r=n.matches[n.matches.length-1];return tg(r.route.id,"".concat(t,' can only be used on routes that contain a unique "id"')),r.route.id}function um(){var t;let n=e.useContext(Vg),r=sm("useRouteError"),i=Am("useRouteError");return void 0!==n?n:null===(t=r.errors)||void 0===t?void 0:t[i]}var lm={};function cm(e,t,n){t||lm[e]||(lm[e]=!0,ng(!1,n))}var fm={};function hm(e,t){e||fm[t]||(fm[t]=!0,console.warn(t))}e.memo(function(e){let{routes:t,future:n,state:r,unstable_onError:i}=e;return $g(t,void 0,r,i,n)});function dm(e){tg(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pm(t){let{basename:n="/",children:r=null,location:i,navigationType:o="POP",navigator:a,static:s=!1}=t;tg(!Gg(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let A=n.replace(/^\/*/,"/"),u=e.useMemo(()=>({basename:A,navigator:a,static:s,future:{}}),[A,a,s]);"string"===typeof i&&(i=ag(i));let{pathname:l="/",search:c="",hash:f="",state:h=null,key:d="default"}=i,p=e.useMemo(()=>{let e=Fg(l,A);return null==e?null:{location:{pathname:e,search:c,hash:f,state:h,key:d},navigationType:o}},[A,l,c,f,h,d,o]);return ng(null!=p,'<Router basename="'.concat(A,'"> is not able to match the URL "').concat(l).concat(c).concat(f,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==p?null:e.createElement(zg.Provider,{value:u},e.createElement(Kg.Provider,{children:r,value:p}))}function gm(e){let{children:t,location:n}=e;return $g(mm(t),n)}e.Component;function mm(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];return e.Children.forEach(t,(t,i)=>{if(!e.isValidElement(t))return;let o=[...n,i];if(t.type===e.Fragment)return void r.push.apply(r,mm(t.props.children,o));tg(t.type===dm,"[".concat("string"===typeof t.type?t.type:t.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),tg(!t.props.index||!t.props.children,"An index route cannot have child routes.");let a={id:t.props.id||o.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(a.children=mm(t.props.children,o)),r.push(a)}),r}var vm="get",wm="application/x-www-form-urlencoded";function ym(e){return null!=e&&"string"===typeof e.tagName}var bm=null;var Bm=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xm(e){return null==e||Bm.has(e)?e:(ng(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(wm,'"')),null)}function Cm(e,t){let n,r,i,o,a;if(ym(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?Fg(a,t):null,n=e.getAttribute("method")||vm,i=xm(e.getAttribute("enctype"))||wm,o=new FormData(e)}else if(function(e){return ym(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ym(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||a.getAttribute("action");if(r=s?Fg(s,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||vm,i=xm(e.getAttribute("formenctype"))||xm(a.getAttribute("enctype"))||wm,o=new FormData(a,e),!function(){if(null===bm)try{new FormData(document.createElement("form"),0),bm=!1}catch(w){bm=!0}return bm}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";o.append("".concat(e,"x"),"0"),o.append("".concat(e,"y"),"0")}else t&&o.append(t,r)}}else{if(ym(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=vm,r=null,i=wm,a=e}var s;return o&&"text/plain"===i&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!==typeof window?window:"undefined"!==typeof globalThis&&globalThis;function Fm(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}Symbol("SingleFetchRedirect");function Em(e,t,n){let r="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return"/"===r.pathname?r.pathname="_root.".concat(n):t&&"/"===Fg(r.pathname,t)?r.pathname="".concat(t.replace(/\/$/,""),"/_root.").concat(n):r.pathname="".concat(r.pathname.replace(/\/$/,""),".").concat(n),r}async function Sm(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function km(e){return null!=e&&"string"===typeof e.page}function _m(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function Im(e,t,n,r,i,o){let a=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null===(r=n[t].route.path)||void 0===r?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===o?t.filter((e,t)=>a(e,t)||s(e,t)):"data"===o?t.filter((t,o)=>{let A=r.routes[t.route.id];if(!A||!A.hasLoader)return!1;if(a(t,o)||s(t,o))return!0;if(t.route.shouldRevalidate){var u;let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:(null===(u=n[0])||void 0===u?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0}):[]}function Nm(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1),[...new Set(r)];var r}function Um(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!km(i)&&"script"===i.as&&i.href&&r.has(i.href))return e;let o=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(i));return n.has(o)||(n.add(o),e.push({key:o,link:i})),e},[])}function Lm(e,t){return"lazy"===e.mode&&!0===t}function Qm(){let t=e.useContext(Tg);return Fm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Dm(){let t=e.useContext(Pg);return Fm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Rm=e.createContext(void 0);function Tm(){let t=e.useContext(Rm);return Fm(t,"You must render this element inside a <HydratedRouter> element"),t}function Pm(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Om(e,t,n){if(n&&!zm)return[e[0]];if(t){let n=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,n+1)}return e}Rm.displayName="FrameworkContext";function Mm(t){let{page:n}=t,r=zp(t,qp),{router:i}=Qm(),o=e.useMemo(()=>ug(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?e.createElement(jm,Vp({page:n,matches:o},r)):null}function Hm(t){let{manifest:n,routeModules:r}=Tm(),[i,o]=e.useState([]);return e.useEffect(()=>{let e=!1;return async function(e,t,n){return Um((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Sm(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(_m).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?Vp(Vp({},e),{},{rel:"prefetch",as:"style"}):Vp(Vp({},e),{},{rel:"prefetch"})))}(t,n,r).then(t=>{e||o(t)}),()=>{e=!0}},[t,n,r]),i}function jm(t){let{page:n,matches:r}=t,i=zp(t,Xp),o=qg(),{manifest:a,routeModules:s}=Tm(),{basename:A}=Qm(),{loaderData:u,matches:l}=Dm(),c=e.useMemo(()=>Im(n,r,l,a,o,"data"),[n,r,l,a,o]),f=e.useMemo(()=>Im(n,r,l,a,o,"assets"),[n,r,l,a,o]),h=e.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let e=new Set,t=!1;if(r.forEach(n=>{var r;let i=a.routes[n.route.id];i&&i.hasLoader&&(!c.some(e=>e.route.id===n.route.id)&&n.route.id in u&&null!==(r=s[n.route.id])&&void 0!==r&&r.shouldRevalidate||i.hasClientLoader?t=!0:e.add(n.route.id))}),0===e.size)return[];let i=Em(n,A,"data");return t&&e.size>0&&i.searchParams.set("_routes",r.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[i.pathname+i.search]},[A,u,o,a,c,r,n,s]),d=e.useMemo(()=>Nm(f,a),[f,a]),p=Hm(f);return e.createElement(e.Fragment,null,h.map(t=>e.createElement("link",Vp({key:t,rel:"prefetch",as:"fetch",href:t},i))),d.map(t=>e.createElement("link",Vp({key:t,rel:"modulepreload",href:t},i))),p.map(t=>{let{key:n,link:r}=t;return e.createElement("link",Vp({key:n,nonce:i.nonce},r))}))}var zm=!1;function Km(t){let{manifest:n,serverHandoffString:r,isSpaMode:i,renderMeta:o,routeDiscovery:a,ssr:s}=Tm(),{router:A,static:u,staticContext:l}=Qm(),{matches:c}=Dm(),f=e.useContext(Og),h=Lm(a,s);o&&(o.didRenderScripts=!0);let d=Om(c,null,i);e.useEffect(()=>{0},[]);let p=e.useMemo(()=>{var i;if(f)return null;let o=l?"window.__reactRouterContext = ".concat(r,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",a=u?"".concat(null!==n.hmr&&void 0!==i&&i.runtime?"import ".concat(JSON.stringify(n.hmr.runtime),";"):"").concat(h?"":"import ".concat(JSON.stringify(n.url)),";\n").concat(d.map((e,t)=>{let r="route".concat(t),i=n.routes[e.route.id];Fm(i,"Route ".concat(e.route.id," not found in manifest"));let{clientActionModule:o,clientLoaderModule:a,clientMiddlewareModule:s,hydrateFallbackModule:A,module:u}=i,l=[...o?[{module:o,varName:"".concat(r,"_clientAction")}]:[],...a?[{module:a,varName:"".concat(r,"_clientLoader")}]:[],...s?[{module:s,varName:"".concat(r,"_clientMiddleware")}]:[],...A?[{module:A,varName:"".concat(r,"_HydrateFallback")}]:[],{module:u,varName:"".concat(r,"_main")}];return 1===l.length?"import * as ".concat(r," from ").concat(JSON.stringify(u),";"):[l.map(e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";')).join("\n"),"const ".concat(r," = {").concat(l.map(e=>"...".concat(e.varName)).join(","),"};")].join("\n")}).join("\n"),"\n ").concat(h?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let{sri:n}=e,r=zp(e,Gp),i=new Set(t.state.matches.map(e=>e.route.id)),o=t.state.location.pathname.split("/").filter(Boolean),a=["/"];for(o.pop();o.length>0;)a.push("/".concat(o.join("/"))),o.pop();a.forEach(e=>{let n=ug(t.routes,e,t.basename);n&&n.forEach(e=>i.add(e.route.id))});let s=[...i].reduce((e,t)=>Object.assign(e,{[t]:r.routes[t]}),{});return Vp(Vp({},r),{},{routes:s,sri:!!n||void 0})}(n,A),null,2),";"):"","\n window.__reactRouterRouteModules = {").concat(d.map((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t)).join(","),"};\n\nimport(").concat(JSON.stringify(n.entry.module),");"):" ";return e.createElement(e.Fragment,null,e.createElement("script",Vp(Vp({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o},type:void 0})),e.createElement("script",Vp(Vp({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0})))},[]),g=zm||f?[]:(n.entry.imports.concat(Nm(d,n,{includeHydrateFallback:!0})),[...new Set(m)]);var m;let v="object"===typeof n.sri?n.sri:{};return hm(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),zm||f?null:e.createElement(e.Fragment,null,"object"===typeof n.sri?e.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,h?null:e.createElement("link",{rel:"modulepreload",href:n.url,crossOrigin:t.crossOrigin,integrity:v[n.url],suppressHydrationWarning:!0}),e.createElement("link",{rel:"modulepreload",href:n.entry.module,crossOrigin:t.crossOrigin,integrity:v[n.entry.module],suppressHydrationWarning:!0}),g.map(n=>e.createElement("link",{key:n,rel:"modulepreload",href:n,crossOrigin:t.crossOrigin,integrity:v[n],suppressHydrationWarning:!0})),p)}function Wm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)})}}e.Component;function Vm(t){let{error:n,isOutsideRemixApp:r}=t;console.error(n);let i,o=e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(Qg(n))return e.createElement(Gm,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},n.status," ",n.statusText),o);if(n instanceof Error)0;else{let e=null==n?"Unknown Error":"object"===typeof n&&"toString"in n?n.toString():JSON.stringify(n);new Error(e)}return e.createElement(Gm,{title:"Application Error!",isOutsideRemixApp:r},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},i.stack),o)}function Gm(t){var n;let{title:r,renderScripts:i,isOutsideRemixApp:o,children:a}=t,{routeModules:s}=Tm();return null!==s.root&&void 0!==n&&n.Layout&&!o?a:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,r)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,i?e.createElement(Km,null):null)))}var qm="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{qm&&(window.__reactRouterVersion="7.9.1")}catch(w){}function Xm(t){let{basename:n,children:r,window:i}=t,o=e.useRef();null==o.current&&(o.current=eg({window:i,v5Compat:!0}));let a=o.current,[s,A]=e.useState({action:a.action,location:a.location}),u=e.useCallback(t=>{e.startTransition(()=>A(t))},[A]);return e.useLayoutEffect(()=>a.listen(u),[a,u]),e.createElement(pm,{basename:n,children:r,location:s.location,navigationType:s.action,navigator:a})}var Ym=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jm=e.forwardRef(function(t,n){let r,{onClick:i,discover:o="render",prefetch:a="none",relative:s,reloadDocument:A,replace:u,state:l,target:c,to:f,preventScrollReset:h,viewTransition:d}=t,p=zp(t,Yp),{basename:g}=e.useContext(zg),m="string"===typeof f&&Ym.test(f),v=!1;if("string"===typeof f&&m&&(r=f,qm))try{let e=new URL(window.location.href),t=f.startsWith("//")?new URL(e.protocol+f):new URL(f),n=Fg(t.pathname,g);t.origin===e.origin&&null!=n?f=n+t.search+t.hash:v=!0}catch(w){ng(!1,'<Link to="'.concat(f,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}let y=function(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tg(Gg(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=e.useContext(zg),{hash:o,pathname:a,search:s}=Zg(t,{relative:n}),A=a;return"/"!==r&&(A="/"===a?r:Ig([r,a])),i.createHref({pathname:A,search:s,hash:o})}(f,{relative:s}),[b,B,x]=function(t,n){let r=e.useContext(Rm),[i,o]=e.useState(!1),[a,s]=e.useState(!1),{onFocus:A,onBlur:u,onMouseEnter:l,onMouseLeave:c,onTouchStart:f}=n,h=e.useRef(null);e.useEffect(()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let d=()=>{o(!0)},p=()=>{o(!1),s(!1)};return r?"intent"!==t?[a,h,{}]:[a,h,{onFocus:Pm(A,d),onBlur:Pm(u,p),onMouseEnter:Pm(l,d),onMouseLeave:Pm(c,p),onTouchStart:Pm(f,d)}]:[!1,h,{}]}(a,p),C=function(t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},A=Jg(),u=qg(),l=Zg(t,{relative:a});return e.useCallback(e=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(e,n)){e.preventDefault();let n=void 0!==r?r:og(u)===og(l);A(t,{replace:n,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[u,A,l,r,i,n,t,o,a,s])}(f,{replace:u,state:l,target:c,preventScrollReset:h,relative:s,viewTransition:d});let F=e.createElement("a",Vp(Vp(Vp({},p),x),{},{href:r||y,onClick:v||A?i:function(e){i&&i(e),e.defaultPrevented||C(e)},ref:Wm(n,B),target:c,"data-discover":m||"render"!==o?void 0:"true"}));return b&&!m?e.createElement(e.Fragment,null,F,e.createElement(Mm,{page:y})):F});Jm.displayName="Link";var Zm=e.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:A,viewTransition:u,children:l}=t,c=zp(t,Jp),f=Zg(A,{relative:c.relative}),h=qg(),d=e.useContext(Pg),{navigator:p,basename:g}=e.useContext(zg),m=null!=d&&function(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.useContext(Mg);tg(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=tv("useViewTransitionState"),o=Zg(t,{relative:n});if(!r.isTransitioning)return!1;let a=Fg(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=Fg(r.nextLocation.pathname,i)||r.nextLocation.pathname;return null!=Bg(o.pathname,s)||null!=Bg(o.pathname,a)}(f)&&!0===u,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,w=h.pathname,y=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;i||(w=w.toLowerCase(),y=y?y.toLowerCase():null,v=v.toLowerCase()),y&&g&&(y=Fg(y,g)||y);const b="/"!==v&&v.endsWith("/")?v.length-1:v.length;let B,x=w===v||!a&&w.startsWith(v)&&"/"===w.charAt(b),C=null!=y&&(y===v||!a&&y.startsWith(v)&&"/"===y.charAt(v.length)),F={isActive:x,isPending:C,isTransitioning:m},E=x?r:void 0;B="function"===typeof o?o(F):[o,x?"active":null,C?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let S="function"===typeof s?s(F):s;return e.createElement(Jm,Vp(Vp({},c),{},{"aria-current":E,className:B,ref:n,style:S,to:A,viewTransition:u}),"function"===typeof l?l(F):l)});Zm.displayName="NavLink";var $m=e.forwardRef((t,n)=>{let{discover:r="render",fetcherKey:i,navigate:o,reloadDocument:a,replace:s,state:A,method:u=vm,action:l,onSubmit:c,relative:f,preventScrollReset:h,viewTransition:d}=t,p=zp(t,Zp),g=iv(),m=function(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:r}=e.useContext(zg),i=e.useContext(Wg);tg(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),a=Vp({},Zg(t||".",{relative:n})),s=qg();if(null==t){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll("index"),n=t.some(e=>""===e);if(n){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();a.search=n?"?".concat(n):""}}t&&"."!==t||!o.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(a.pathname="/"===a.pathname?r:Ig([r,a.pathname]));return og(a)}(l,{relative:f}),v="get"===u.toLowerCase()?"get":"post",w="string"===typeof l&&Ym.test(l);return e.createElement("form",Vp(Vp({ref:n,method:v,action:m,onSubmit:a?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null===t||void 0===t?void 0:t.getAttribute("formmethod"))||u;g(t||e.currentTarget,{fetcherKey:i,method:n,navigate:o,replace:s,state:A,relative:f,preventScrollReset:h,viewTransition:d})}},p),{},{"data-discover":w||"render"!==r?void 0:"true"}))});function ev(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function tv(t){let n=e.useContext(Tg);return tg(n,ev(t)),n}$m.displayName="Form";var nv=0,rv=()=>"__".concat(String(++nv),"__");function iv(){let{router:t}=tv("useSubmit"),{basename:n}=e.useContext(zg),r=Am("useRouteId");return e.useCallback(async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:o,method:a,encType:s,formData:A,body:u}=Cm(e,n);if(!1===i.navigate){let e=i.fetcherKey||rv();await t.fetch(e,r,i.action||o,{preventScrollReset:i.preventScrollReset,formData:A,body:u,formMethod:i.method||a,formEncType:i.encType||s,flushSync:i.flushSync})}else await t.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:A,body:u,formMethod:i.method||a,formEncType:i.encType||s,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[t,n,r])}const ov=(e,t)=>new Promise((n,r)=>{const i=indexedDB.open("ElixifyDB",1);i.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains("analysisStore")||t.createObjectStore("analysisStore")},i.onsuccess=i=>{const o=i.target.result.transaction("analysisStore","readwrite").objectStore("analysisStore"),a=null===t?o.delete(e):o.put(t,e);a.onsuccess=()=>n(),a.onerror=()=>r(a.error)},i.onerror=()=>r(i.error)}),av=JSON.parse('{"r":1774451399318,"p":"2026-03-25T15:09:59.318Z"}');var sv=n(579);const Av=()=>{const t={error_below_min_image_size:"Input image resolution is too small",error_exceed_max_image_size:"Input image resolution is too large",error_src_skin_too_small:"The skin area in the uploaded image is too small. The width of the skin needs to be greater than 60% of the width of the image.",error_src_skin_out_of_bound:"The skin area in the uploaded image is out of bound",error_lighting_dark:"The lighting in the uploaded image is too dark"},[n,r]=(0,e.useState)("landing"),[o,a]=(0,e.useState)(null),[s,A]=(0,e.useState)(""),[u,l]=(0,e.useState)(null),[c,f]=(0,e.useState)(null),[h,d]=(0,e.useState)(!1),[p,v]=(0,e.useState)(null),[y,b]=(0,e.useState)(!1),[B,x]=(0,e.useState)(null),[C,F]=(0,e.useState)({}),[E,S]=(0,e.useState)(null),[k,_]=(0,e.useState)(!0),[I,N]=(0,e.useState)(!1),[U,L]=(0,e.useState)(null),Q=Jg(),D=(0,e.useRef)(null);(0,e.useRef)(null);(0,e.useEffect)(()=>{console.log("%c Build Version: ".concat(av.r," | Date: ").concat(av.p),"color: #0097C3; font-weight: bold; font-size: 14px;");(async()=>{await Promise.all([Bp.tinyFaceDetector.loadFromUri("/elixifyskinanalyser/models"),Bp.faceLandmark68TinyNet.loadFromUri("/elixifyskinanalyser/models")]),b(!0)})(),sessionStorage.setItem("isNewAnalysis","true")},[]),(0,e.useEffect)(()=>{let e;if("camera"===n&&D.current&&y){e=setInterval(async()=>{const e=await(t=D.current,n=new np,void 0===n&&(n=new Hd),new jp(t,n));var t,n;v(e?e.box:null)},300)}return()=>clearInterval(e)},[n,y]),(0,e.useEffect)(()=>{D.current&&u&&(D.current.srcObject=u)},[u]),(0,e.useEffect)(()=>{let e=null,t=!0;if("camera"===n&&!u){const n=async()=>{if(f(null),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)try{if(e=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:1920},height:{ideal:1080}}}),!t)return void e.getTracks().forEach(e=>e.stop());l(e)}catch(Ov){if(console.warn("Primary camera request failed, attempting fallback...",Ov),!t)return;try{if(e=await navigator.mediaDevices.getUserMedia({video:!0}),!t)return void e.getTracks().forEach(e=>e.stop());l(e)}catch(n){if(console.error("All camera requests failed:",n),!t)return;let e="Could not access the camera.";"NotAllowedError"===n.name?e="Camera access denied. check permissions.":"NotFoundError"===n.name?e="No camera found. Connect a webcam.":"NotReadableError"===n.name&&(e="Camera is in use by another app or tab."),f(e)}}else t&&f("Camera API not accessible. Ensure you are using HTTPS.")};n()}return()=>{t=!1,e&&e.getTracks().forEach(e=>e.stop())}},[n]),(0,e.useEffect)(()=>{"camera"!==n&&u&&(u.getTracks().forEach(e=>e.stop()),l(null))},[n,u]);const R=e=>new Promise(t=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.readAsDataURL(e)}),T=()=>{r("camera"),a(null),A(""),x(null),F({}),f(null)};return(0,e.useEffect)(()=>{"results"===n&&Q("/result")},[n,Q]),(0,sv.jsx)("div",{className:"min-h-screen relative overflow-hidden bg-[#F8F9FA]",children:(0,sv.jsxs)("div",{className:"container mx-auto px-4 py-10 md:py-16 relative z-10 min-h-screen flex flex-col items-center justify-start gap-4 md:gap-8",children:[(0,sv.jsxs)("header",{className:"fixed top-0 left-0 right-0 z-[60] py-4 px-6 flex items-center justify-between bg-[#0097C3] shadow-lg",children:[(0,sv.jsx)("div",{className:"flex items-center gap-4",children:(0,sv.jsx)("img",{src:"/elixifyskinanalyser/assets/images/elixify_logo.png",alt:"Elixify Logo",className:"h-12 md:h-16 w-auto brightness-0 invert"})}),(0,sv.jsxs)("div",{className:"flex items-center gap-4",children:[(0,sv.jsx)("button",{className:"text-white hover:text-white/80 transition-colors",onClick:()=>N(!I),children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),"landing"!==n&&(0,sv.jsx)("button",{className:"text-white hover:text-white/80 transition-colors",onClick:()=>{u&&(u.getTracks().forEach(e=>e.stop()),l(null)),v(null),r("landing"),a(null),A(""),x(null)},children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,sv.jsxs)("main",{className:"w-full max-w-2xl mx-auto flex flex-col items-center justify-center relative",children:["landing"===n&&(0,sv.jsxs)("div",{className:"flex flex-col items-center justify-center w-full px-4 gap-8 fade-in mt-20 md:mt-32",children:[(0,sv.jsxs)("div",{className:"text-center space-y-4 mb-2",children:[(0,sv.jsxs)("h1",{className:"text-4xl md:text-5xl font-bold text-[#0e5e73] leading-tight tracking-[0.02em] uppercase",style:{fontFamily:"'Oswald', sans-serif"},children:["AI-POWERED",(0,sv.jsx)("br",{}),"SKIN ANALYSER"]}),(0,sv.jsx)("p",{className:"text-lg text-gray-700 font-medium tracking-wide max-w-sm mx-auto",children:"Experience professional-grade skin analysis in seconds"})]}),(0,sv.jsxs)("div",{className:"w-full flex flex-col gap-4",children:[(0,sv.jsxs)("div",{onClick:()=>r("camera"),className:"bg-white border-2 border-dashed border-[#0097C3]/30 p-8 flex flex-col items-center justify-center gap-4 cursor-pointer hover:border-[#0097C3] transition-all duration-300 shadow-xl group",children:[(0,sv.jsx)("div",{className:"w-16 h-16 bg-[#0097C3]/10 rounded-full flex items-center justify-center group-hover:scale-110 transition-transform",children:(0,sv.jsxs)("svg",{className:"w-8 h-8 text-[#0097C3]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,sv.jsxs)("div",{className:"text-center",children:[(0,sv.jsx)("p",{className:"text-xl font-bold text-black uppercase tracking-widest",children:"Take a Photo"}),(0,sv.jsx)("p",{className:"text-gray-500 text-sm mt-1",children:"Capture using your camera"})]})]}),(0,sv.jsxs)("div",{onClick:()=>document.getElementById("uploadInput").click(),className:"bg-white border-2 border-dashed border-[#0097C3]/30 p-8 flex flex-col items-center justify-center gap-4 cursor-pointer hover:border-[#0097C3] transition-all duration-300 shadow-xl group",children:[(0,sv.jsx)("div",{className:"w-16 h-16 bg-[#0097C3]/10 rounded-full flex items-center justify-center group-hover:scale-110 transition-transform",children:(0,sv.jsx)("svg",{className:"w-8 h-8 text-[#0097C3]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}),(0,sv.jsxs)("div",{className:"text-center",children:[(0,sv.jsx)("p",{className:"text-xl font-bold text-black uppercase tracking-widest",children:"Upload Photo"}),(0,sv.jsx)("p",{className:"text-gray-500 text-sm mt-1",children:"Select from your gallery"})]}),(0,sv.jsx)("input",{type:"file",id:"uploadInput",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target.files[0];t&&(a(t),A(URL.createObjectURL(t)),r("preview"),f(null))}})]})]}),(0,sv.jsx)("div",{className:"mt-8",children:(0,sv.jsx)("button",{onClick:()=>Q("/login"),className:"text-gray-400 hover:text-[#0097C3] transition-colors text-xs uppercase tracking-widest font-bold",children:"Admin Login"})})]}),"camera"===n&&(0,sv.jsx)("div",{className:"fixed inset-0 z-50 bg-black flex flex-col",children:(0,sv.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[(0,sv.jsx)("video",{ref:D,autoPlay:!0,playsInline:!0,className:"w-full h-full object-cover transform scale-x-[-1]"}),(0,sv.jsx)("div",{className:"absolute inset-0 z-10 pointer-events-none",children:(0,sv.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/40"})}),(0,sv.jsx)("div",{className:"absolute bottom-12 left-0 right-0 flex justify-center items-center z-20",children:(0,sv.jsx)("button",{onClick:()=>{if(!D.current)return;const e=D.current,t=e.videoWidth,n=e.videoHeight,i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");let s;if(o.translate(t,0),o.scale(-1,1),o.drawImage(e,0,0,i.width,i.height),k){const e=.55*i.width,t=.75*i.height,n=(i.width-e)/2,r=(i.height-t)/2;s=document.createElement("canvas"),s.width=e,s.height=t;s.getContext("2d").drawImage(i,n,r,e,t,0,0,e,t)}else s=i;s.toBlob(e=>{const t=new File([e],"captured-skin.jpg",{type:"image/jpeg"});a(t),A(URL.createObjectURL(t)),u&&u.getTracks().forEach(e=>e.stop()),l(null),r("preview")},"image/jpeg",.95)},className:"transform active:scale-95 transition-all cursor-pointer bg-[#0097C3] w-36 h-18 py-4 px-10 rounded-full shadow-[0_0_20px_rgba(0,151,195,0.3)] flex items-center justify-center border-none",children:(0,sv.jsx)(g,{className:"w-12 h-12 text-white"})})})]})}),"preview"===n&&(0,sv.jsx)("div",{className:"fixed inset-0 z-50 bg-black flex flex-col fade-in",children:(0,sv.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[s?(0,sv.jsx)("img",{src:s,alt:"Preview",className:"w-full h-full object-cover"}):(0,sv.jsx)("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:"No Image"}),h&&(0,sv.jsxs)("div",{className:"absolute inset-0 z-20 pointer-events-none overflow-hidden",children:[(0,sv.jsx)("div",{className:"w-full h-[2px] bg-[#0097C3] shadow-[0_0_20px_rgba(0,151,195,0.8)] absolute top-0 animate-[scan_3s_linear_infinite]"}),(0,sv.jsx)("div",{className:"w-full h-32 bg-gradient-to-t from-[#0097C3]/20 to-transparent absolute top-0 -translate-y-full animate-[scanTrace_3s_linear_infinite]"})]}),(0,sv.jsx)("div",{className:"absolute bottom-10 left-0 right-0 flex flex-col items-center justify-center gap-4 z-30 px-6",children:(0,sv.jsxs)("div",{className:"flex items-center gap-4 w-full justify-center",children:[(0,sv.jsxs)("button",{onClick:T,disabled:h,className:"h-14 px-6 bg-white text-black rounded-none flex items-center justify-center gap-2 shadow-lg hover:bg-gray-200 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Retake",children:[(0,sv.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,sv.jsx)("span",{className:"font-bold text-sm tracking-widest uppercase",children:"Retake"})]}),(0,sv.jsx)("button",{onClick:async()=>{if(o){d(!0),f(null);try{let f,d;try{f=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2048,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1080;return new Promise((i,o)=>{const a=new Image;a.onload=()=>{let{width:s,height:A}=a,u=1;(s>t||A>n)&&(u=Math.min(t/s,n/A));const l=Math.min(s,A);l*u<r&&(u=Math.max(r/l,u));const c=Math.round(s*u),f=Math.round(A*u),h=document.createElement("canvas");h.width=c,h.height=f,h.getContext("2d").drawImage(a,0,0,c,f),h.toBlob(t=>{if(!t)return o(new Error("Canvas empty"));i(new File([t],e.name.replace(/\.\w+$/,".jpg"),{type:"image/jpeg"}))},"image/jpeg",.9)},a.onerror=()=>o(new Error("Image load failed"));const s=new FileReader;s.onload=e=>a.src=e.target.result,s.readAsDataURL(e)})}(o,2048,2048,1080)}catch(w){throw new Error("Image resizing failed: ".concat(w.message))}try{const e=new FormData;e.append("image",f);const t=await fetch("".concat(m,"/api/perfectcorp/analyze"),{method:"POST",body:e}),n=await(async e=>{const t=await e.text();try{return JSON.parse(t)}catch(w){throw console.error("Non-JSON API response:",t.substring(0,200)),new Error("Server returned an invalid non-JSON response. Please check your proxy or API URL configuration.")}})(t);if(!t.ok)throw new Error(n.error||"Backend perfectcorp proxy failed");d={result:n.result}}catch(w){throw new Error("Backend Analysis Request failed: ".concat(w.message))}try{var e,t,n,a,A,u,l,c,h;const o=(null===(e=d.result)||void 0===e||null===(t=e.results)||void 0===t||null===(n=t[0])||void 0===n||null===(a=n.data)||void 0===a||null===(A=a[0])||void 0===A?void 0:A.url)||(null===(u=d.result)||void 0===u?void 0:u.url);if(!o)throw new Error("No mask ZIP URL found in result");S(o);const f=await fetch(o);if(!f.ok)throw new Error("Failed to download ZIP file (status: ".concat(f.status,")"));const p=await f.blob(),g=await i().loadAsync(p),m=g.file("skinanalysisResult/score_info.json")||g.file("score_info.json"),v=m?JSON.parse(await m.async("text")):(null===(l=d.result)||void 0===l||null===(c=l.results)||void 0===c||null===(h=c[0])||void 0===h?void 0:h.scores)||{};if(0===Object.keys(v).length)throw new Error("Could not extract scores from analysis result.");const w={};for(const e of Object.keys(v)){const t=v[e].output_mask_name;if(!t)continue;const n=g.file("skinanalysisResult/".concat(t))||g.file("masks/".concat(t))||g.file(t);if(!n)continue;const r=await n.async("blob");w[t]=await R(r)}const y=await R(await fetch(s).then(e=>e.blob()));await ov("analysisData",{scoreData:v,maskImages:w,originalImage:y,zipDownloadUrl:o}),x(v),F(w),r("results")}catch(w){throw new Error("Processing analysis result failed: ".concat(w.message))}}catch(w){console.error(w),f("Analysis failed: ".concat(w.message)),r("preview")}finally{d(!1)}}},disabled:h,className:"h-14 w-20 bg-[#0097C3] text-white rounded-none flex items-center justify-center shadow-lg hover:bg-[#007ba0] transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Confirm",children:(0,sv.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M1 13l4 4L15 7m-6 6l4 4L23 7"})})})]})})]})}),c&&(0,sv.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm p-6 animate-[fadeIn_0.2s_ease-out]",children:(0,sv.jsxs)("div",{className:"bg-white rounded-none shadow-2xl w-full max-w-sm p-8 text-center",children:[(0,sv.jsx)("div",{className:"w-16 h-16 bg-cyan-100 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,sv.jsx)("svg",{className:"w-8 h-8 text-[#0097C3]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,sv.jsx)("h3",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Analysis Failed"}),(0,sv.jsx)("p",{className:"text-gray-600 mb-8 leading-relaxed text-sm",children:(()=>{const e=Object.keys(t).find(e=>c&&c.includes(e));return e?t[e]:c})()}),(0,sv.jsx)("button",{onClick:T,className:"w-full bg-[#0097C3] text-white font-bold py-4 px-6 rounded-none hover:bg-[#007ba0] transition-all active:scale-95 uppercase tracking-widest text-sm",children:"Retake Photo"})]})})]}),I&&(0,sv.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-[fadeIn_0.2s_ease-out]",children:(0,sv.jsxs)("div",{className:"bg-white rounded-none shadow-2xl w-full max-w-sm p-8 relative",children:[(0,sv.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,sv.jsx)("h2",{className:"text-3xl font-bold text-black",children:"Help"}),(0,sv.jsx)("button",{onClick:()=>N(!1),className:"p-2 -mr-2 text-black hover:bg-gray-100 rounded-full transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,sv.jsxs)("div",{className:"space-y-6",children:[(0,sv.jsxs)("div",{className:"flex items-start gap-4",children:[(0,sv.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 mt-2.5 shrink-0"}),(0,sv.jsxs)("p",{className:"text-lg text-gray-700 leading-relaxed",children:["To access previous reports, please contact us at ",(0,sv.jsx)("a",{href:"mailto:hello@elixify.com",className:"font-bold text-black",children:"hello@elixify.com"})]})]}),(0,sv.jsxs)("div",{className:"flex items-start gap-4",children:[(0,sv.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 mt-2.5 shrink-0"}),(0,sv.jsxs)("p",{className:"text-lg text-gray-700 leading-relaxed",children:["If you experience any technical issues, please contact us at ",(0,sv.jsx)("a",{href:"mailto:support@example.com",className:"font-bold text-black",children:"support@example.com"})]})]})]})]})})]})})};var uv=n(2284),lv=Uint8Array,cv=Uint16Array,fv=Int32Array,hv=new lv([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),dv=new lv([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pv=new lv([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gv=function(e,t){for(var n=new cv(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new fv(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},mv=gv(hv,2),vv=mv.b,wv=mv.r;vv[28]=258,wv[258]=28;for(var yv=gv(dv,0),bv=yv.b,Bv=yv.r,xv=new cv(32768),Cv=0;Cv<32768;++Cv){var Fv=(43690&Cv)>>1|(21845&Cv)<<1;Fv=(61680&(Fv=(52428&Fv)>>2|(13107&Fv)<<2))>>4|(3855&Fv)<<4,xv[Cv]=((65280&Fv)>>8|(255&Fv)<<8)>>1}var Ev=function(e,t,n){for(var r=e.length,i=0,o=new cv(t);i<r;++i)e[i]&&++o[e[i]-1];var a,s=new cv(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new cv(1<<t);var A=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],c=s[e[i]-1]++<<l,f=c|(1<<l)-1;c<=f;++c)a[xv[c]>>A]=u}else for(a=new cv(r),i=0;i<r;++i)e[i]&&(a[i]=xv[s[e[i]-1]++]>>15-e[i]);return a},Sv=new lv(288);for(Cv=0;Cv<144;++Cv)Sv[Cv]=8;for(Cv=144;Cv<256;++Cv)Sv[Cv]=9;for(Cv=256;Cv<280;++Cv)Sv[Cv]=7;for(Cv=280;Cv<288;++Cv)Sv[Cv]=8;var kv=new lv(32);for(Cv=0;Cv<32;++Cv)kv[Cv]=5;var _v=Ev(Sv,9,0),Iv=Ev(Sv,9,1),Nv=Ev(kv,5,0),Uv=Ev(kv,5,1),Lv=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Qv=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Dv=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},Rv=function(e){return(e+7)/8|0},Tv=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new lv(e.subarray(t,n))},Pv=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ov=function(e,t,n){var r=new Error(t||Pv[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ov),!n)throw r;return r},Mv=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new lv(0);var a=!n,s=a||2!=t.i,A=t.i;a&&(n=new lv(3*i));var u=function(e){var t=n.length;if(e>t){var r=new lv(Math.max(2*t,e));r.set(n),n=r}},l=t.f||0,c=t.p||0,f=t.b||0,h=t.l,d=t.d,p=t.m,g=t.n,m=8*i;do{if(!h){l=Qv(e,c,1);var v=Qv(e,c+1,3);if(c+=3,!v){var w=e[(I=Rv(c)+4)-4]|e[I-3]<<8,y=I+w;if(y>i){A&&Ov(0);break}s&&u(f+w),n.set(e.subarray(I,y),f),t.b=f+=w,t.p=c=8*y,t.f=l;continue}if(1==v)h=Iv,d=Uv,p=9,g=5;else if(2==v){var b=Qv(e,c,31)+257,B=Qv(e,c+10,15)+4,x=b+Qv(e,c+5,31)+1;c+=14;for(var C=new lv(x),F=new lv(19),E=0;E<B;++E)F[pv[E]]=Qv(e,c+3*E,7);c+=3*B;var S=Lv(F),k=(1<<S)-1,_=Ev(F,S,1);for(E=0;E<x;){var I,N=_[Qv(e,c,k)];if(c+=15&N,(I=N>>4)<16)C[E++]=I;else{var U=0,L=0;for(16==I?(L=3+Qv(e,c,3),c+=2,U=C[E-1]):17==I?(L=3+Qv(e,c,7),c+=3):18==I&&(L=11+Qv(e,c,127),c+=7);L--;)C[E++]=U}}var Q=C.subarray(0,b),D=C.subarray(b);p=Lv(Q),g=Lv(D),h=Ev(Q,p,1),d=Ev(D,g,1)}else Ov(1);if(c>m){A&&Ov(0);break}}s&&u(f+131072);for(var R=(1<<p)-1,T=(1<<g)-1,P=c;;P=c){var O=(U=h[Dv(e,c)&R])>>4;if((c+=15&U)>m){A&&Ov(0);break}if(U||Ov(2),O<256)n[f++]=O;else{if(256==O){P=c,h=null;break}var M=O-254;if(O>264){var H=hv[E=O-257];M=Qv(e,c,(1<<H)-1)+vv[E],c+=H}var j=d[Dv(e,c)&T],z=j>>4;j||Ov(3),c+=15&j;D=bv[z];if(z>3){H=dv[z];D+=Dv(e,c)&(1<<H)-1,c+=H}if(c>m){A&&Ov(0);break}s&&u(f+131072);var K=f+M;if(f<D){var W=o-D,V=Math.min(D,K);for(W+f<0&&Ov(3);f<V;++f)n[f]=r[W+f]}for(;f<K;++f)n[f]=n[f-D]}}t.l=h,t.p=P,t.b=f,t.f=l,h&&(l=1,t.m=p,t.d=d,t.n=g)}while(!l);return f!=n.length&&a?Tv(n,0,f):n.subarray(0,f)},Hv=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},jv=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},zv=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:Yv,l:0};if(1==i){var a=new lv(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],A=n[1],u=0,l=1,c=2;for(n[0]={s:-1,f:s.f+A.f,l:s,r:A};l!=i-1;)s=n[n[u].f<n[c].f?u++:c++],A=n[u!=l&&n[u].f<n[c].f?u++:c++],n[l++]={s:-1,f:s.f+A.f,l:s,r:A};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var h=new cv(f+1),d=Kv(n[l-1],h,0);if(d>t){r=0;var p=0,g=d-t,m=1<<g;for(o.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<i;++r){var v=o[r].s;if(!(h[v]>t))break;p+=m-(1<<d-h[v]),h[v]=t}for(p>>=g;p>0;){var w=o[r].s;h[w]<t?p-=1<<t-h[w]++-1:++r}for(;r>=0&&p;--r){var y=o[r].s;h[y]==t&&(--h[y],++p)}d=t}return{t:new lv(h),l:d}},Kv=function(e,t,n){return-1==e.s?Math.max(Kv(e.l,t,n+1),Kv(e.r,t,n+1)):t[e.s]=n},Wv=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new cv(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return{c:n.subarray(0,r),n:t}},Vv=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Gv=function(e,t,n){var r=n.length,i=Rv(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},qv=function(e,t,n,r,i,o,a,s,A,u,l){Hv(t,l++,n),++i[256];for(var c=zv(i,15),f=c.t,h=c.l,d=zv(o,15),p=d.t,g=d.l,m=Wv(f),v=m.c,w=m.n,y=Wv(p),b=y.c,B=y.n,x=new cv(19),C=0;C<v.length;++C)++x[31&v[C]];for(C=0;C<b.length;++C)++x[31&b[C]];for(var F=zv(x,7),E=F.t,S=F.l,k=19;k>4&&!E[pv[k-1]];--k);var _,I,N,U,L=u+5<<3,Q=Vv(i,Sv)+Vv(o,kv)+a,D=Vv(i,f)+Vv(o,p)+a+14+3*k+Vv(x,E)+2*x[16]+3*x[17]+7*x[18];if(A>=0&&L<=Q&&L<=D)return Gv(t,l,e.subarray(A,A+u));if(Hv(t,l,1+(D<Q)),l+=2,D<Q){_=Ev(f,h,0),I=f,N=Ev(p,g,0),U=p;var R=Ev(E,S,0);Hv(t,l,w-257),Hv(t,l+5,B-1),Hv(t,l+10,k-4),l+=14;for(C=0;C<k;++C)Hv(t,l+3*C,E[pv[C]]);l+=3*k;for(var T=[v,b],P=0;P<2;++P){var O=T[P];for(C=0;C<O.length;++C){var M=31&O[C];Hv(t,l,R[M]),l+=E[M],M>15&&(Hv(t,l,O[C]>>5&127),l+=O[C]>>12)}}}else _=_v,I=Sv,N=Nv,U=kv;for(C=0;C<s;++C){var H=r[C];if(H>255){jv(t,l,_[(M=H>>18&31)+257]),l+=I[M+257],M>7&&(Hv(t,l,H>>23&31),l+=hv[M]);var j=31&H;jv(t,l,N[j]),l+=U[j],j>3&&(jv(t,l,H>>5&8191),l+=dv[j])}else jv(t,l,_[H]),l+=I[H]}return jv(t,l,_[256]),l+I[256]},Xv=new fv([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yv=new lv(0),Jv=function(e,t,n,r,i,o){var a=o.z||e.length,s=new lv(r+a+5*(1+Math.ceil(a/7e3))+i),A=s.subarray(r,s.length-i),u=o.l,l=7&(o.r||0);if(t){l&&(A[0]=o.r>>3);for(var c=Xv[t-1],f=c>>13,h=8191&c,d=(1<<n)-1,p=o.p||new cv(32768),g=o.h||new cv(d+1),m=Math.ceil(n/3),v=2*m,w=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<v)&d},y=new fv(25e3),b=new cv(288),B=new cv(32),x=0,C=0,F=o.i||0,E=0,S=o.w||0,k=0;F+2<a;++F){var _=w(F),I=32767&F,N=g[_];if(p[I]=N,g[_]=I,S<=F){var U=a-F;if((x>7e3||E>24576)&&(U>423||!u)){l=qv(e,A,0,y,b,B,C,E,k,F-k,l),E=x=C=0,k=F;for(var L=0;L<286;++L)b[L]=0;for(L=0;L<30;++L)B[L]=0}var Q=2,D=0,R=h,T=I-N&32767;if(U>2&&_==w(F-T))for(var P=Math.min(f,U)-1,O=Math.min(32767,F),M=Math.min(258,U);T<=O&&--R&&I!=N;){if(e[F+Q]==e[F+Q-T]){for(var H=0;H<M&&e[F+H]==e[F+H-T];++H);if(H>Q){if(Q=H,D=T,H>P)break;var j=Math.min(T,H-2),z=0;for(L=0;L<j;++L){var K=F-T+L&32767,W=K-p[K]&32767;W>z&&(z=W,N=K)}}}T+=(I=N)-(N=p[I])&32767}if(D){y[E++]=268435456|wv[Q]<<18|Bv[D];var V=31&wv[Q],G=31&Bv[D];C+=hv[V]+dv[G],++b[257+V],++B[G],S=F+Q,++x}else y[E++]=e[F],++b[e[F]]}}for(F=Math.max(F,S);F<a;++F)y[E++]=e[F],++b[e[F]];l=qv(e,A,u,y,b,B,C,E,k,F-k,l),u||(o.r=7&l|A[l/8|0]<<3,l-=7,o.h=g,o.p=p,o.i=F,o.w=S)}else{for(F=o.w||0;F<a+u;F+=65535){var q=F+65535;q>=a&&(A[l/8|0]=u,q=a),l=Gv(A,l+1,e.subarray(F,q))}o.i=a}return Tv(s,0,r+Rv(l)+i)},Zv=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=0|n.length,a=0;a!=o;){for(var s=Math.min(a+2655,o);a<s;++a)i+=r+=n[a];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},$v=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),a=new lv(o.length+e.length);a.set(o),a.set(e,o.length),e=a,i.w=o.length}return Jv(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,i)},ew=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},tw=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=Zv();i.p(t.dictionary),ew(e,2,i.d())}},nw=function(e,t){return(8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Ov(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&Ov(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),2+(e[1]>>3&4)};function rw(e,t){t||(t={});var n=Zv();n.p(e);var r=$v(e,t,t.dictionary?6:2,4);return tw(r,t),ew(r,r.length-4,n.d()),r}function iw(e,t){return Mv(e.subarray(nw(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var ow="undefined"!=typeof TextDecoder&&new TextDecoder;try{ow.decode(Yv,{stream:!0})}catch(w){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var aw=function(){return"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:this}();function sw(){aw.console&&"function"==typeof aw.console.log&&aw.console.log.apply(aw.console,arguments)}var Aw={log:sw,warn:function(e){aw.console&&("function"==typeof aw.console.warn?aw.console.warn.apply(aw.console,arguments):sw.call(null,arguments))},error:function(e){aw.console&&("function"==typeof aw.console.error?aw.console.error.apply(aw.console,arguments):sw(e))}};function uw(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){dw(r.response,t,n)},r.onerror=function(){Aw.error("could not download file")},r.send()}function lw(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function cw(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(b){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var fw,hw,dw=aw.saveAs||("object"!==("undefined"==typeof window?"undefined":(0,uv.A)(window))||window!==aw?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=aw.URL||aw.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener","string"==typeof e?(i.href=e,i.origin!==location.origin?lw(i.href)?uw(e,t,n):cw(i,i.target="_blank"):cw(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){cw(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(lw(e))uw(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){cw(r)})}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==(0,uv.A)(t)&&(Aw.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return uw(e,t,n);var i="application/octet-stream"===e.type,o=/constructor/i.test(aw.HTMLElement)||aw.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&o)&&"object"===("undefined"==typeof FileReader?"undefined":(0,uv.A)(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var A=aw.URL||aw.webkitURL,u=A.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){A.revokeObjectURL(u)},4e4)}});function pw(e){var t;e=e||"",this.ok=!1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,o=n[r].process,a=i.exec(e);a&&(t=o(a),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}}function gw(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];n=vw(n,r,i,o,t[0],7,-680876936),o=vw(o,n,r,i,t[1],12,-389564586),i=vw(i,o,n,r,t[2],17,606105819),r=vw(r,i,o,n,t[3],22,-1044525330),n=vw(n,r,i,o,t[4],7,-176418897),o=vw(o,n,r,i,t[5],12,1200080426),i=vw(i,o,n,r,t[6],17,-1473231341),r=vw(r,i,o,n,t[7],22,-45705983),n=vw(n,r,i,o,t[8],7,1770035416),o=vw(o,n,r,i,t[9],12,-1958414417),i=vw(i,o,n,r,t[10],17,-42063),r=vw(r,i,o,n,t[11],22,-1990404162),n=vw(n,r,i,o,t[12],7,1804603682),o=vw(o,n,r,i,t[13],12,-40341101),i=vw(i,o,n,r,t[14],17,-1502002290),n=ww(n,r=vw(r,i,o,n,t[15],22,1236535329),i,o,t[1],5,-165796510),o=ww(o,n,r,i,t[6],9,-1069501632),i=ww(i,o,n,r,t[11],14,643717713),r=ww(r,i,o,n,t[0],20,-373897302),n=ww(n,r,i,o,t[5],5,-701558691),o=ww(o,n,r,i,t[10],9,38016083),i=ww(i,o,n,r,t[15],14,-660478335),r=ww(r,i,o,n,t[4],20,-405537848),n=ww(n,r,i,o,t[9],5,568446438),o=ww(o,n,r,i,t[14],9,-1019803690),i=ww(i,o,n,r,t[3],14,-187363961),r=ww(r,i,o,n,t[8],20,1163531501),n=ww(n,r,i,o,t[13],5,-1444681467),o=ww(o,n,r,i,t[2],9,-51403784),i=ww(i,o,n,r,t[7],14,1735328473),n=yw(n,r=ww(r,i,o,n,t[12],20,-1926607734),i,o,t[5],4,-378558),o=yw(o,n,r,i,t[8],11,-2022574463),i=yw(i,o,n,r,t[11],16,1839030562),r=yw(r,i,o,n,t[14],23,-35309556),n=yw(n,r,i,o,t[1],4,-1530992060),o=yw(o,n,r,i,t[4],11,1272893353),i=yw(i,o,n,r,t[7],16,-155497632),r=yw(r,i,o,n,t[10],23,-1094730640),n=yw(n,r,i,o,t[13],4,681279174),o=yw(o,n,r,i,t[0],11,-358537222),i=yw(i,o,n,r,t[3],16,-722521979),r=yw(r,i,o,n,t[6],23,76029189),n=yw(n,r,i,o,t[9],4,-640364487),o=yw(o,n,r,i,t[12],11,-421815835),i=yw(i,o,n,r,t[15],16,530742520),n=bw(n,r=yw(r,i,o,n,t[2],23,-995338651),i,o,t[0],6,-198630844),o=bw(o,n,r,i,t[7],10,1126891415),i=bw(i,o,n,r,t[14],15,-1416354905),r=bw(r,i,o,n,t[5],21,-57434055),n=bw(n,r,i,o,t[12],6,1700485571),o=bw(o,n,r,i,t[3],10,-1894986606),i=bw(i,o,n,r,t[10],15,-1051523),r=bw(r,i,o,n,t[1],21,-2054922799),n=bw(n,r,i,o,t[8],6,1873313359),o=bw(o,n,r,i,t[15],10,-30611744),i=bw(i,o,n,r,t[6],15,-1560198380),r=bw(r,i,o,n,t[13],21,1309151649),n=bw(n,r,i,o,t[4],6,-145523070),o=bw(o,n,r,i,t[11],10,-1120210379),i=bw(i,o,n,r,t[2],15,718787259),r=bw(r,i,o,n,t[9],21,-343485551),e[0]=_w(n,e[0]),e[1]=_w(r,e[1]),e[2]=_w(i,e[2]),e[3]=_w(o,e[3])}function mw(e,t,n,r,i,o){return t=_w(_w(t,e),_w(r,o)),_w(t<<i|t>>>32-i,n)}function vw(e,t,n,r,i,o,a){return mw(t&n|~t&r,e,t,i,o,a)}function ww(e,t,n,r,i,o,a){return mw(t&r|n&~r,e,t,i,o,a)}function yw(e,t,n,r,i,o,a){return mw(t^n^r,e,t,i,o,a)}function bw(e,t,n,r,i,o,a){return mw(n^(t|~r),e,t,i,o,a)}function Bw(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)gw(r,xw(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(gw(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,gw(r,i),r}function xw(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}fw=aw.atob.bind(aw),hw=aw.btoa.bind(aw);var Cw="0123456789abcdef".split("");function Fw(e){for(var t="",n=0;n<4;n++)t+=Cw[e>>8*n+4&15]+Cw[e>>8*n&15];return t}function Ew(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Sw(e){return Bw(e).map(Ew).join("")}var kw="5d41402abc4b2a76b9719d911017c592"!=function(e){for(var t=0;t<e.length;t++)e[t]=Fw(e[t]);return e.join("")}(Bw("hello"));function _w(e,t){if(kw){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}function Iw(e,t){var n,r,i,o;if(e!==n){for(var a=(i=e,o=1+(256/e.length|0),new Array(o+1).join(i)),s=[],A=0;A<256;A++)s[A]=A;var u=0;for(A=0;A<256;A++){var l=s[A];u=(u+l+a.charCodeAt(A))%256,s[A]=s[u],s[u]=l}n=e,r=s}else s=r;var c=t.length,f=0,h=0,d="";for(A=0;A<c;A++)h=(h+(l=s[f=(f+1)%256]))%256,s[f]=s[h],s[h]=l,a=s[(s[f]+s[h])%256],d+=String.fromCharCode(t.charCodeAt(A)^a);return d}var Nw={print:4,modify:8,copy:16,"annot-forms":32};function Uw(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(e){if(void 0!==Nw.perm)throw new Error("Invalid permission: "+e);i+=Nw[e]}),this.padding="(\xbfN^Nu\x8aAd\0NV\xff\xfa\x01\b..\0\xb6\xd0h>\x80/\f\xa9\xfedSiz";var o=(t+this.padding).substr(0,32),a=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(o,a),this.P=-(1+(255^i)),this.encryptionKey=Sw(o+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Iw(this.encryptionKey,this.padding)}function Lw(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);t+=i<33||35===i||37===i||40===i||41===i||47===i||60===i||62===i||91===i||93===i||123===i||125===i||i>126?"#"+("0"+i.toString(16)).slice(-2):e[r]}return t}function Qw(e){if("object"!==(0,uv.A)(e))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,n,r){if(r=r||!1,"string"!=typeof e||"function"!=typeof n||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var i=Math.random().toString(35);return t[e][i]=[n,!!r],i},this.unsubscribe=function(e){for(var n in t)if(t[n][e])return delete t[n][e],0===Object.keys(t[n]).length&&delete t[n],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var o in t[n]){var a=t[n][o];try{a[0].apply(e,r)}catch(n){aw.console&&Aw.error("jsPDF PubSub Error",n.message,n)}a[1]&&i.push(o)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Dw(e){if(!(this instanceof Dw))return new Dw(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function Rw(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Tw(e,t,n,r,i){if(!(this instanceof Tw))return new Tw(e,t,n,r,i);this.type="axial"===e?2:3,this.coords=t,this.colors=n,Rw.call(this,r,i)}function Pw(e,t,n,r,i){if(!(this instanceof Pw))return new Pw(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,Rw.call(this,r,i)}function Ow(e){var t,n="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],i=arguments[2],o=arguments[3],a=[],s=1,A=16,u="S",l=null;"object"===(0,uv.A)(e=e||{})&&(n=e.orientation,r=e.unit||r,i=e.format||i,o=e.compress||e.compressPdf||o,null!==(l=e.encryption||null)&&(l.userPassword=l.userPassword||"",l.ownerPassword=l.ownerPassword||"",l.userPermissions=l.userPermissions||[]),s="number"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(t=e.precision),void 0!==e.floatPrecision&&(A=e.floatPrecision),u=e.defaultPathOperation||"S"),a=e.filters||(!0===o?["FlateEncode"]:a),r=r||"mm",n=(""+(n||"P")).toLowerCase();var c=e.putOnlyUsedFonts||!1,f={},h={internal:{},__private__:{}};h.__private__.PubSub=Qw;var d="1.3",p=h.__private__.getPdfVersion=function(){return d};h.__private__.setPdfVersion=function(e){d=e};var g={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]};h.__private__.getPageFormats=function(){return g};var m=h.__private__.getPageFormat=function(e){return g[e]};i=i||"a4";var v="compat",w="advanced",y=v;function b(){this.saveGraphicsState(),J(new Ne(fe,0,0,-fe,0,un()*fe).toString()+" cm"),this.setFontSize(this.getFontSize()/fe),u="n",y=w}function B(){this.restoreGraphicsState(),u="S",y=v}var x=h.__private__.combineFontStyleAndFontWeight=function(e,t){if("bold"==e&&"normal"==t||"bold"==e&&400==t||"normal"==e&&"italic"==t||"bold"==e&&"italic"==t)throw new Error("Invalid Combination of fontweight and fontstyle");return t&&(e=400==t||"normal"===t?"italic"===e?"italic":"normal":700!=t&&"bold"!==t||"normal"!==e?(700==t?"bold":t)+""+e:"bold"),e};h.advancedAPI=function(e){var t=y===v;return t&&b.call(this),"function"!=typeof e||(e(this),t&&B.call(this)),this},h.compatAPI=function(e){var t=y===w;return t&&B.call(this),"function"!=typeof e||(e(this),t&&b.call(this)),this},h.isAdvancedAPI=function(){return y===w};var C,F=function(e){if(y!==w)throw new Error(e+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},E=h.roundToPrecision=h.__private__.roundToPrecision=function(e,n){var r=t||n;if(isNaN(e)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return e.toFixed(r).replace(/0+$/,"")};C=h.hpf=h.__private__.hpf="number"==typeof A?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return E(e,A)}:"smart"===A?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return E(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return E(e,16)};var S=h.f2=h.__private__.f2=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f2");return E(e,2)},k=h.__private__.f3=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f3");return E(e,3)},_=h.scale=h.__private__.scale=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.scale");return y===v?e*fe:y===w?e:void 0},I=function(e){return _(function(e){return y===v?un()-e:y===w?e:void 0}(e))};h.__private__.setPrecision=h.setPrecision=function(e){"number"==typeof parseInt(e,10)&&(t=parseInt(e,10))};var N,U="00000000000000000000000000000000",L=h.__private__.getFileId=function(){return U},Q=h.__private__.setFileId=function(e){return U=void 0!==e&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():U.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==l&&(vt=new Uw(l.userPermissions,l.userPassword,l.ownerPassword,U)),U};h.setFileId=function(e){return Q(e),this},h.getFileId=function(){return L()};var D=h.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),n=t<0?"+":"-",r=Math.floor(Math.abs(t/60)),i=Math.abs(t%60),o=[n,M(r),"'",M(i),"'"].join("");return["D:",e.getFullYear(),M(e.getMonth()+1),M(e.getDate()),M(e.getHours()),M(e.getMinutes()),M(e.getSeconds()),o].join("")},R=h.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),n=parseInt(e.substr(6,2),10)-1,r=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),a=parseInt(e.substr(14,2),10);return new Date(t,n,r,i,o,a,0)},T=h.__private__.setCreationDate=function(e){var t;if(void 0===e&&(e=new Date),e instanceof Date)t=D(e);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))throw new Error("Invalid argument passed to jsPDF.setCreationDate");t=e}return N=t},P=h.__private__.getCreationDate=function(e){var t=N;return"jsDate"===e&&(t=R(N)),t};h.setCreationDate=function(e){return T(e),this},h.getCreationDate=function(e){return P(e)};var O,M=h.__private__.padd2=function(e){return("0"+parseInt(e)).slice(-2)},H=h.__private__.padd2Hex=function(e){return("00"+(e=e.toString())).substr(e.length)},j=0,z=[],K=[],W=0,V=[],G=[],q=!1,X=K;h.__private__.setCustomOutputDestination=function(e){q=!0,X=e};var Y=function(e){q||(X=e)};h.__private__.resetCustomOutputDestination=function(){q=!1,X=K};var J=h.__private__.out=function(e){return e=e.toString(),W+=e.length+1,X.push(e),X},Z=h.__private__.write=function(e){return J(1===arguments.length?e.toString():Array.prototype.join.call(arguments," "))},$=h.__private__.getArrayBuffer=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n);t--;)r[t]=e.charCodeAt(t);return n},ee=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];h.__private__.getStandardFonts=function(){return ee};var te=e.fontSize||16;h.__private__.setFontSize=h.setFontSize=function(e){return te=y===w?e/fe:e,this};var ne,re=h.__private__.getFontSize=h.getFontSize=function(){return y===v?te:te*fe},ie=e.R2L||!1;h.__private__.setR2L=h.setR2L=function(e){return ie=e,this},h.__private__.getR2L=h.getR2L=function(){return ie};var oe,ae=h.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))ne=e;else if(isNaN(e)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(e))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+e+'" is not recognized.');ne=e}else ne=parseInt(e,10)};h.__private__.getZoomMode=function(){return ne};var se,Ae=h.__private__.setPageMode=function(e){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');oe=e};h.__private__.getPageMode=function(){return oe};var ue=h.__private__.setLayoutMode=function(e){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(e))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+e+'" is not recognized.');se=e};h.__private__.getLayoutMode=function(){return se},h.__private__.setDisplayMode=h.setDisplayMode=function(e,t,n){return ae(e),ue(t),Ae(n),this};var le={title:"",subject:"",author:"",keywords:"",creator:""};h.__private__.getDocumentProperty=function(e){if(-1===Object.keys(le).indexOf(e))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return le[e]},h.__private__.getDocumentProperties=function(){return le},h.__private__.setDocumentProperties=h.setProperties=h.setDocumentProperties=function(e){for(var t in le)le.hasOwnProperty(t)&&e[t]&&(le[t]=e[t]);return this},h.__private__.setDocumentProperty=function(e,t){if(-1===Object.keys(le).indexOf(e))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return le[e]=t};var ce,fe,he,de,pe,ge={},me={},ve=[],we={},ye={},be={},Be={},xe=null,Ce=0,Fe=[],Ee=new Qw(h),Se=e.hotfixes||[],ke={},_e={},Ie=[],Ne=function e(t,n,r,i,o,a){if(!(this instanceof e))return new e(t,n,r,i,o,a);isNaN(t)&&(t=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(o)&&(o=0),isNaN(a)&&(a=0),this._matrix=[t,n,r,i,o,a]};Object.defineProperty(Ne.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ne.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ne.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ne.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ne.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ne.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ne.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ne.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ne.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ne.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ne.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ne.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ne.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ne.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ne.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ne.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Ne.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(C).join(e)},Ne.prototype.multiply=function(e){var t=e.sx*this.sx+e.shy*this.shx,n=e.sx*this.shy+e.shy*this.sy,r=e.shx*this.sx+e.sy*this.shx,i=e.shx*this.shy+e.sy*this.sy,o=e.tx*this.sx+e.ty*this.shx+this.tx,a=e.tx*this.shy+e.ty*this.sy+this.ty;return new Ne(t,n,r,i,o,a)},Ne.prototype.decompose=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,a=Math.sqrt(e*e+t*t),s=(e/=a)*n+(t/=a)*r;n-=e*s,r-=t*s;var A=Math.sqrt(n*n+r*r);return s/=A,e*(r/=A)<t*(n/=A)&&(e=-e,t=-t,s=-s,a=-a),{scale:new Ne(a,0,0,A,0,0),translate:new Ne(1,0,0,1,i,o),rotate:new Ne(e,t,-t,e,0,0),skew:new Ne(1,0,s,1,0,0)}},Ne.prototype.toString=function(e){return this.join(" ")},Ne.prototype.inversed=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,a=1/(e*r-t*n),s=r*a,A=-t*a,u=-n*a,l=e*a;return new Ne(s,A,u,l,-s*i-u*o,-A*i-l*o)},Ne.prototype.applyToPoint=function(e){var t=e.x*this.sx+e.y*this.shx+this.tx,n=e.x*this.shy+e.y*this.sy+this.ty;return new tn(t,n)},Ne.prototype.applyToRectangle=function(e){var t=this.applyToPoint(e),n=this.applyToPoint(new tn(e.x+e.w,e.y+e.h));return new nn(t.x,t.y,n.x-t.x,n.y-t.y)},Ne.prototype.clone=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty;return new Ne(e,t,n,r,i,o)},h.Matrix=Ne;var Ue=h.matrixMult=function(e,t){return t.multiply(e)},Le=new Ne(1,0,0,1,0,0);h.unitMatrix=h.identityMatrix=Le;var Qe=function(e,t){if(!ye[e]){var n=(t instanceof Tw?"Sh":"P")+(Object.keys(we).length+1).toString(10);t.id=n,ye[e]=n,we[n]=t,Ee.publish("addPattern",t)}};h.ShadingPattern=Tw,h.TilingPattern=Pw,h.addShadingPattern=function(e,t){return F("addShadingPattern()"),Qe(e,t),this},h.beginTilingPattern=function(e){F("beginTilingPattern()"),on(e.boundingBox[0],e.boundingBox[1],e.boundingBox[2]-e.boundingBox[0],e.boundingBox[3]-e.boundingBox[1],e.matrix)},h.endTilingPattern=function(e,t){F("endTilingPattern()"),t.stream=G[O].join("\n"),Qe(e,t),Ee.publish("endTilingPattern",t),Ie.pop().restore()};var De=h.__private__.newObject=function(){var e=Re();return Te(e,!0),e},Re=h.__private__.newObjectDeferred=function(){return j++,z[j]=function(){return W},j},Te=function(e,t){return t="boolean"==typeof t&&t,z[e]=W,t&&J(e+" 0 obj"),e},Pe=h.__private__.newAdditionalObject=function(){var e={objId:Re(),content:""};return V.push(e),e},Oe=Re(),Me=Re(),He=h.__private__.decodeColorString=function(e){var t=e.split(" ");if(2!==t.length||"g"!==t[1]&&"G"!==t[1])5!==t.length||"k"!==t[4]&&"K"!==t[4]||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),"r"]);else{var n=parseFloat(t[0]);t=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(t[i])).toString(16)).slice(-2);return r},je=h.__private__.encodeColorString=function(e){var t;"string"==typeof e&&(e={ch1:e});var n=e.ch1,r=e.ch2,i=e.ch3,o=e.ch4,a="draw"===e.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var s=new pw(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var A=parseInt(n.substr(1),16);n=A>>16&255,r=A>>8&255,i=255&A}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)t=n+" "+a[0];else if(2===e.precision)t=S(n/255)+" "+a[0];else t=k(n/255)+" "+a[0];else if(void 0===o||"object"===(0,uv.A)(o)){if(o&&!isNaN(o.a)&&0===o.a)return["1.","1.","1.",a[1]].join(" ");if("string"==typeof n)t=[n,r,i,a[1]].join(" ");else if(2===e.precision)t=[S(n/255),S(r/255),S(i/255),a[1]].join(" ");else t=[k(n/255),k(r/255),k(i/255),a[1]].join(" ")}else if("string"==typeof n)t=[n,r,i,o,a[2]].join(" ");else if(2===e.precision)t=[S(n),S(r),S(i),S(o),a[2]].join(" ");else t=[k(n),k(r),k(i),k(o),a[2]].join(" ");return t},ze=h.__private__.getFilters=function(){return a},Ke=h.__private__.putStream=function(e){var t=(e=e||{}).data||"",n=e.filters||ze(),r=e.alreadyAppliedFilters||[],i=e.addLength1||!1,o=t.length,a=e.objectId,s=function(e){return e};if(null!==l&&void 0===a)throw new Error("ObjectId must be passed to putStream for file encryption");null!==l&&(s=vt.encryptor(a,0));var A={};!0===n&&(n=["FlateEncode"]);var u=e.additionalKeyValues||[],c=(A=void 0!==Ow.API.processDataByFilters?Ow.API.processDataByFilters(t,n):{data:t,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==A.data.length&&(u.push({key:"Length",value:A.data.length}),!0===i&&u.push({key:"Length1",value:o})),0!=c.length)if(c.split("/").length-1==1)u.push({key:"Filter",value:c});else{u.push({key:"Filter",value:"["+c+"]"});for(var f=0;f<u.length;f+=1)if("DecodeParms"===u[f].key){for(var h=[],d=0;d<A.reverseChain.split("/").length-1;d+=1)h.push("null");h.push(u[f].value),u[f].value="["+h.join(" ")+"]"}}J("<<");for(var p=0;p<u.length;p++)J("/"+u[p].key+" "+u[p].value);J(">>"),0!==A.data.length&&(J("stream"),J(s(A.data)),J("endstream"))},We=h.__private__.putPage=function(e){var t=e.number,n=e.data,r=e.objId,i=e.contentsObjId;Te(r,!0),J("<</Type /Page"),J("/Parent "+e.rootDictionaryObjId+" 0 R"),J("/Resources "+e.resourceDictionaryObjId+" 0 R"),J("/MediaBox ["+parseFloat(C(e.mediaBox.bottomLeftX))+" "+parseFloat(C(e.mediaBox.bottomLeftY))+" "+C(e.mediaBox.topRightX)+" "+C(e.mediaBox.topRightY)+"]"),null!==e.cropBox&&J("/CropBox ["+C(e.cropBox.bottomLeftX)+" "+C(e.cropBox.bottomLeftY)+" "+C(e.cropBox.topRightX)+" "+C(e.cropBox.topRightY)+"]"),null!==e.bleedBox&&J("/BleedBox ["+C(e.bleedBox.bottomLeftX)+" "+C(e.bleedBox.bottomLeftY)+" "+C(e.bleedBox.topRightX)+" "+C(e.bleedBox.topRightY)+"]"),null!==e.trimBox&&J("/TrimBox ["+C(e.trimBox.bottomLeftX)+" "+C(e.trimBox.bottomLeftY)+" "+C(e.trimBox.topRightX)+" "+C(e.trimBox.topRightY)+"]"),null!==e.artBox&&J("/ArtBox ["+C(e.artBox.bottomLeftX)+" "+C(e.artBox.bottomLeftY)+" "+C(e.artBox.topRightX)+" "+C(e.artBox.topRightY)+"]"),"number"==typeof e.userUnit&&1!==e.userUnit&&J("/UserUnit "+e.userUnit),Ee.publish("putPage",{objId:r,pageContext:Fe[t],pageNumber:t,page:n}),J("/Contents "+i+" 0 R"),J(">>"),J("endobj");var o=n.join("\n");return y===w&&(o+="\nQ"),Te(i,!0),Ke({data:o,filters:ze(),objectId:i}),J("endobj"),r},Ve=h.__private__.putPages=function(){var e,t,n=[];for(e=1;e<=Ce;e++)Fe[e].objId=Re(),Fe[e].contentsObjId=Re();for(e=1;e<=Ce;e++)n.push(We({number:e,data:G[e],objId:Fe[e].objId,contentsObjId:Fe[e].contentsObjId,mediaBox:Fe[e].mediaBox,cropBox:Fe[e].cropBox,bleedBox:Fe[e].bleedBox,trimBox:Fe[e].trimBox,artBox:Fe[e].artBox,userUnit:Fe[e].userUnit,rootDictionaryObjId:Oe,resourceDictionaryObjId:Me}));Te(Oe,!0),J("<</Type /Pages");var r="/Kids [";for(t=0;t<Ce;t++)r+=n[t]+" 0 R ";J(r+"]"),J("/Count "+Ce),J(">>"),J("endobj"),Ee.publish("postPutPages")},Ge=function(e){Ee.publish("putFont",{font:e,out:J,newObject:De,putStream:Ke}),!0!==e.isAlreadyPutted&&(e.objectNumber=De(),J("<<"),J("/Type /Font"),J("/BaseFont /"+Lw(e.postScriptName)),J("/Subtype /Type1"),"string"==typeof e.encoding&&J("/Encoding /"+e.encoding),J("/FirstChar 32"),J("/LastChar 255"),J(">>"),J("endobj"))},qe=function(e){e.objectNumber=De();var t=[];t.push({key:"Type",value:"/XObject"}),t.push({key:"Subtype",value:"/Form"}),t.push({key:"BBox",value:"["+[C(e.x),C(e.y),C(e.x+e.width),C(e.y+e.height)].join(" ")+"]"}),t.push({key:"Matrix",value:"["+e.matrix.toString()+"]"});var n=e.pages[1].join("\n");Ke({data:n,additionalKeyValues:t,objectId:e.objectNumber}),J("endobj")},Xe=function(e,t){t||(t=21);var n=De(),r=function(e,t){var n,r=[],i=1/(t-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=e[0].offset){var o={offset:0,color:e[0].color};e.unshift(o)}if(1!=e[e.length-1].offset){var a={offset:1,color:e[e.length-1].color};e.push(a)}for(var s="",A=0,u=0;u<r.length;u++){for(n=r[u];n>e[A+1].offset;)A++;var l=e[A].offset,c=(n-l)/(e[A+1].offset-l),f=e[A].color,h=e[A+1].color;s+=H(Math.round((1-c)*f[0]+c*h[0]).toString(16))+H(Math.round((1-c)*f[1]+c*h[1]).toString(16))+H(Math.round((1-c)*f[2]+c*h[2]).toString(16))}return s.trim()}(e.colors,t),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+t+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ke({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),J("endobj"),e.objectNumber=De(),J("<< /ShadingType "+e.type),J("/ColorSpace /DeviceRGB");var o="/Coords ["+C(parseFloat(e.coords[0]))+" "+C(parseFloat(e.coords[1]))+" ";2===e.type?o+=C(parseFloat(e.coords[2]))+" "+C(parseFloat(e.coords[3])):o+=C(parseFloat(e.coords[2]))+" "+C(parseFloat(e.coords[3]))+" "+C(parseFloat(e.coords[4]))+" "+C(parseFloat(e.coords[5])),J(o+="]"),e.matrix&&J("/Matrix ["+e.matrix.toString()+"]"),J("/Function "+n+" 0 R"),J("/Extend [true true]"),J(">>"),J("endobj")},Ye=function(e,t){var n=Re(),r=De();t.push({resourcesOid:n,objectOid:r}),e.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+e.boundingBox.map(C).join(" ")+"]"}),i.push({key:"XStep",value:C(e.xStep)}),i.push({key:"YStep",value:C(e.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),e.matrix&&i.push({key:"Matrix",value:"["+e.matrix.toString()+"]"}),Ke({data:e.stream,additionalKeyValues:i,objectId:e.objectNumber}),J("endobj")},Je=function(e){for(var t in e.objectNumber=De(),J("<<"),e)switch(t){case"opacity":J("/ca "+S(e[t]));break;case"stroke-opacity":J("/CA "+S(e[t]))}J(">>"),J("endobj")},Ze=function(e){Te(e.resourcesOid,!0),J("<<"),J("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var e in J("/Font <<"),ge)ge.hasOwnProperty(e)&&(!1===c||!0===c&&f.hasOwnProperty(e))&&J("/"+e+" "+ge[e].objectNumber+" 0 R");J(">>")}(),function(){if(Object.keys(we).length>0){for(var e in J("/Shading <<"),we)we.hasOwnProperty(e)&&we[e]instanceof Tw&&we[e].objectNumber>=0&&J("/"+e+" "+we[e].objectNumber+" 0 R");Ee.publish("putShadingPatternDict"),J(">>")}}(),function(e){if(Object.keys(we).length>0){for(var t in J("/Pattern <<"),we)we.hasOwnProperty(t)&&we[t]instanceof h.TilingPattern&&we[t].objectNumber>=0&&we[t].objectNumber<e&&J("/"+t+" "+we[t].objectNumber+" 0 R");Ee.publish("putTilingPatternDict"),J(">>")}}(e.objectOid),function(){if(Object.keys(be).length>0){var e;for(e in J("/ExtGState <<"),be)be.hasOwnProperty(e)&&be[e].objectNumber>=0&&J("/"+e+" "+be[e].objectNumber+" 0 R");Ee.publish("putGStateDict"),J(">>")}}(),function(){for(var e in J("/XObject <<"),ke)ke.hasOwnProperty(e)&&ke[e].objectNumber>=0&&J("/"+e+" "+ke[e].objectNumber+" 0 R");Ee.publish("putXobjectDict"),J(">>")}(),J(">>"),J("endobj")},$e=function(){var e=[];(function(){for(var e in ge)ge.hasOwnProperty(e)&&(!1===c||!0===c&&f.hasOwnProperty(e))&&Ge(ge[e])})(),function(){var e;for(e in be)be.hasOwnProperty(e)&&Je(be[e])}(),function(){for(var e in ke)ke.hasOwnProperty(e)&&qe(ke[e])}(),function(e){var t;for(t in we)we.hasOwnProperty(t)&&(we[t]instanceof Tw?Xe(we[t]):we[t]instanceof Pw&&Ye(we[t],e))}(e),Ee.publish("putResources"),e.forEach(Ze),Ze({resourcesOid:Me,objectOid:Number.MAX_SAFE_INTEGER}),Ee.publish("postPutResources")},et=function(e){me[e.fontName]=me[e.fontName]||{},me[e.fontName][e.fontStyle]=e.id},tt=function(e,t,n,r,i){var o={id:"F"+(Object.keys(ge).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Ee.publish("addFont",{font:o,instance:this}),ge[o.id]=o,et(o),o.id},nt=h.__private__.pdfEscape=h.pdfEscape=function(e,t){return function(e,t){var n,r,i,o,a,s,A,u,l;if(i=(t=t||{}).sourceEncoding||"Unicode",a=t.outputEncoding,(t.autoencode||a)&&ge[ce].metadata&&ge[ce].metadata[i]&&ge[ce].metadata[i].encoding&&(o=ge[ce].metadata[i].encoding,!a&&ge[ce].encoding&&(a=ge[ce].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(A=!1,s=[],n=0,r=e.length;n<r;n++)(u=a[e.charCodeAt(n)])?s.push(String.fromCharCode(u)):s.push(e[n]),s[n].charCodeAt(0)>>8&&(A=!0);e=s.join("")}for(n=e.length;void 0===A&&0!==n;)e.charCodeAt(n-1)>>8&&(A=!0),n--;if(!A)return e;for(s=t.noBOM?[]:[254,255],n=0,r=e.length;n<r;n++){if((l=(u=e.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(l),s.push(u-(l<<8))}return String.fromCharCode.apply(void 0,s)}(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},rt=h.__private__.beginPage=function(e){G[++Ce]=[],Fe[Ce]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},at(Ce),Y(G[O])},it=function(e,t){var r,o,a;switch(n=t||n,"string"==typeof e&&(r=m(e.toLowerCase()),Array.isArray(r)&&(o=r[0],a=r[1])),Array.isArray(e)&&(o=e[0]*fe,a=e[1]*fe),isNaN(o)&&(o=i[0],a=i[1]),(o>14400||a>14400)&&(Aw.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),o=Math.min(14400,o),a=Math.min(14400,a)),i=[o,a],n.substr(0,1)){case"l":a>o&&(i=[a,o]);break;case"p":o>a&&(i=[a,o])}rt(i),Pt(Rt),J(Vt),0!==Zt&&J(Zt+" J"),0!==$t&&J($t+" j"),Ee.publish("addPage",{pageNumber:Ce})},ot=function(e){e>0&&e<=Ce&&(G.splice(e,1),Fe.splice(e,1),Ce--,O>Ce&&(O=Ce),this.setPage(O))},at=function(e){e>0&&e<=Ce&&(O=e)},st=h.__private__.getNumberOfPages=h.getNumberOfPages=function(){return G.length-1},At=function(e,t,n){var r,i=void 0;return n=n||{},e=void 0!==e?e:ge[ce].fontName,t=void 0!==t?t:ge[ce].fontStyle,r=e.toLowerCase(),void 0!==me[r]&&void 0!==me[r][t]?i=me[r][t]:void 0!==me[e]&&void 0!==me[e][t]?i=me[e][t]:!1===n.disableWarning&&Aw.warn("Unable to look up font label for font '"+e+"', '"+t+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=me.times[t])&&(i=me.times.normal),i},ut=h.__private__.putInfo=function(){var e=De(),t=function(e){return e};for(var n in null!==l&&(t=vt.encryptor(e,0)),J("<<"),J("/Producer ("+nt(t("jsPDF "+Ow.version))+")"),le)le.hasOwnProperty(n)&&le[n]&&J("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+nt(t(le[n]))+")");J("/CreationDate ("+nt(t(N))+")"),J(">>"),J("endobj")},lt=h.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||Oe;switch(De(),J("<<"),J("/Type /Catalog"),J("/Pages "+t+" 0 R"),ne||(ne="fullwidth"),ne){case"fullwidth":J("/OpenAction [3 0 R /FitH null]");break;case"fullheight":J("/OpenAction [3 0 R /FitV null]");break;case"fullpage":J("/OpenAction [3 0 R /Fit]");break;case"original":J("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+ne;"%"===n.substr(n.length-1)&&(ne=parseInt(ne)/100),"number"==typeof ne&&J("/OpenAction [3 0 R /XYZ null null "+S(ne)+"]")}switch(se||(se="continuous"),se){case"continuous":J("/PageLayout /OneColumn");break;case"single":J("/PageLayout /SinglePage");break;case"two":case"twoleft":J("/PageLayout /TwoColumnLeft");break;case"tworight":J("/PageLayout /TwoColumnRight")}oe&&J("/PageMode /"+oe),Ee.publish("putCatalog"),J(">>"),J("endobj")},ct=h.__private__.putTrailer=function(){J("trailer"),J("<<"),J("/Size "+(j+1)),J("/Root "+j+" 0 R"),J("/Info "+(j-1)+" 0 R"),null!==l&&J("/Encrypt "+vt.oid+" 0 R"),J("/ID [ <"+U+"> <"+U+"> ]"),J(">>")},ft=h.__private__.putHeader=function(){J("%PDF-"+d),J("%\xba\xdf\xac\xe0")},ht=h.__private__.putXRef=function(){var e="0000000000";J("xref"),J("0 "+(j+1)),J("0000000000 65535 f ");for(var t=1;t<=j;t++)"function"==typeof z[t]?J((e+z[t]()).slice(-10)+" 00000 n "):void 0!==z[t]?J((e+z[t]).slice(-10)+" 00000 n "):J("0000000000 00000 n ")},dt=h.__private__.buildDocument=function(){j=0,W=0,K=[],z=[],V=[],Oe=Re(),Me=Re(),Y(K),Ee.publish("buildDocument"),ft(),Ve(),function(){Ee.publish("putAdditionalObjects");for(var e=0;e<V.length;e++){var t=V[e];Te(t.objId,!0),J(t.content),J("endobj")}Ee.publish("postPutAdditionalObjects")}(),$e(),null!==l&&(vt.oid=De(),J("<<"),J("/Filter /Standard"),J("/V "+vt.v),J("/R "+vt.r),J("/U <"+vt.toHexString(vt.U)+">"),J("/O <"+vt.toHexString(vt.O)+">"),J("/P "+vt.P),J(">>"),J("endobj")),ut(),lt();var e=W;return ht(),ct(),J("startxref"),J(""+e),J("%%EOF"),Y(G[O]),K.join("\n")},pt=h.__private__.getBlob=function(e){return new Blob([$(e)],{type:"application/pdf"})},gt=h.output=h.__private__.output=function(e){return e.foo=function(){try{return e.apply(this,arguments)}catch(e){var t=e.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var n="Error in function "+t.split("\n")[0].split("<")[0]+": "+e.message;if(!aw.console)throw new Error(n);aw.console.error(n,e),aw.alert&&alert(n)}},e.foo.bar=e,e.foo}(function(e,t){switch("string"==typeof(t=t||{})?t={filename:t}:t.filename=t.filename||"generated.pdf",e){case void 0:return dt();case"save":h.save(t.filename);break;case"arraybuffer":return $(dt());case"blob":return pt(dt());case"bloburi":case"bloburl":if(void 0!==aw.URL&&"function"==typeof aw.URL.createObjectURL)return aw.URL&&aw.URL.createObjectURL(pt(dt()))||void 0;Aw.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=dt();try{n=hw(r)}catch(e){n=hw(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+t.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(aw)){var i="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",o=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';t.pdfObjectUrl&&(i=t.pdfObjectUrl,o="");var a='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+i+'"'+o+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(t)+");<\/script></body></html>",s=aw.open();return null!==s&&s.document.write(a),s}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(aw)){var A='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(t.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+t.filename+'" width="500px" height="400px" /></body></html>',u=aw.open();if(null!==u){u.document.write(A);var l=this;u.document.documentElement.querySelector("#pdfViewer").onload=function(){u.document.title=t.filename,u.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(l.output("bloburl"))}}return u}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(aw))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var c='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",t)+'"></iframe></body></html>',f=aw.open();if(null!==f&&(f.document.write(c),f.document.title=t.filename),f||"undefined"==typeof safari)return f;break;case"datauri":case"dataurl":return aw.document.location.href=this.output("datauristring",t);default:return null}}),mt=function(e){return!0===Array.isArray(Se)&&Se.indexOf(e)>-1};switch(r){case"pt":fe=1;break;case"mm":fe=72/25.4;break;case"cm":fe=72/2.54;break;case"in":fe=72;break;case"px":fe=1==mt("px_scaling")?.75:96/72;break;case"pc":case"em":fe=12;break;case"ex":fe=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);fe=r}var vt=null;T(),Q();var wt=h.__private__.getPageInfo=h.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Fe[e].objId,pageNumber:e,pageContext:Fe[e]}},yt=h.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var t in Fe)if(Fe[t].objId===e)break;return wt(t)},bt=h.__private__.getCurrentPageInfo=h.getCurrentPageInfo=function(){return{objId:Fe[O].objId,pageNumber:O,pageContext:Fe[O]}};h.addPage=function(){return it.apply(this,arguments),this},h.setPage=function(){return at.apply(this,arguments),Y.call(this,G[O]),this},h.insertPage=function(e){return this.addPage(),this.movePage(O,e),this},h.movePage=function(e,t){var n,r;if(e>t){n=G[e],r=Fe[e];for(var i=e;i>t;i--)G[i]=G[i-1],Fe[i]=Fe[i-1];G[t]=n,Fe[t]=r,this.setPage(t)}else if(e<t){n=G[e],r=Fe[e];for(var o=e;o<t;o++)G[o]=G[o+1],Fe[o]=Fe[o+1];G[t]=n,Fe[t]=r,this.setPage(t)}return this},h.deletePage=function(){return ot.apply(this,arguments),this},h.__private__.text=h.text=function(e,t,n,r,i){var o,a,s,A,u,l,c,h,d,p=(r=r||{}).scope||this;if("number"==typeof e&&"number"==typeof t&&("string"==typeof n||Array.isArray(n))){var g=n;n=t,t=e,e=g}if(arguments[3]instanceof Ne==0?(s=arguments[4],A=arguments[5],"object"===(0,uv.A)(c=arguments[3])&&null!==c||("string"==typeof s&&(A=s,s=null),"string"==typeof c&&(A=c,c=null),"number"==typeof c&&(s=c,c=null),r={flags:c,angle:s,align:A})):(F("The transform parameter of text() with a Matrix value"),d=i),isNaN(t)||isNaN(n)||null==e)throw new Error("Invalid arguments passed to jsPDF.text");if(0===e.length)return p;var m,v="",b="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Dt,B=p.internal.scaleFactor;function x(e){return e=e.split("\t").join(Array(r.TabLen||9).join(" ")),nt(e,c)}function E(e){for(var t,n=e.concat(),r=[],i=n.length;i--;)"string"==typeof(t=n.shift())?r.push(t):Array.isArray(e)&&(1===t.length||void 0===t[1]&&void 0===t[2])?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function S(e,t){var n;if("string"==typeof e)n=t(e)[0];else if(Array.isArray(e)){for(var r,i,o=e.concat(),a=[],s=o.length;s--;)"string"==typeof(r=o.shift())?a.push(t(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(i=t(r[0],r[1],r[2]),a.push([i[0],i[1],i[2]]));n=a}return n}var k=!1,I=!0;if("string"==typeof e)k=!0;else if(Array.isArray(e)){var N=e.concat();a=[];for(var U,L=N.length;L--;)("string"!=typeof(U=N.shift())||Array.isArray(U)&&"string"!=typeof U[0])&&(I=!1);k=I}if(!1===k)throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');"string"==typeof e&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var Q=te/p.internal.scaleFactor,D=Q*(b-1);switch(r.baseline){case"bottom":n-=D;break;case"top":n+=Q-D;break;case"hanging":n+=Q-2*D;break;case"middle":n+=Q/2-D}if((l=r.maxWidth||0)>0&&("string"==typeof e?e=p.splitTextToSize(e,l):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(p.splitTextToSize(t,l))},[]))),o={text:e,x:t,y:n,options:r,mutex:{pdfEscape:nt,activeFontKey:ce,fonts:ge,activeFontSize:te}},Ee.publish("preProcessText",o),e=o.text,s=(r=o.options).angle,d instanceof Ne==0&&s&&"number"==typeof s){s*=Math.PI/180,0===r.rotationDirection&&(s=-s),y===w&&(s=-s);var R=Math.cos(s),T=Math.sin(s);d=new Ne(R,T,-T,R,0,0)}else s&&s instanceof Ne&&(d=s);y!==w||d||(d=Le),void 0!==(u=r.charSpace||Yt)&&(v+=C(_(u))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(h=r.horizontalScale)&&(v+=C(100*h)+" Tz\n"),r.lang;var P=-1,O=void 0!==r.renderingMode?r.renderingMode:r.stroke,M=p.internal.getCurrentPageInfo().pageContext;switch(O){case 0:case!1:case"fill":P=0;break;case 1:case!0:case"stroke":P=1;break;case 2:case"fillThenStroke":P=2;break;case 3:case"invisible":P=3;break;case 4:case"fillAndAddForClipping":P=4;break;case 5:case"strokeAndAddPathForClipping":P=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":P=6;break;case 7:case"addToPathForClipping":P=7}var H=void 0!==M.usedRenderingMode?M.usedRenderingMode:-1;-1!==P?v+=P+" Tr\n":-1!==H&&(v+="0 Tr\n"),-1!==P&&(M.usedRenderingMode=P),A=r.align||"left";var j,z=te*b,K=p.internal.pageSize.getWidth(),W=ge[ce];u=r.charSpace||Yt,l=r.maxWidth||0,c=Object.assign({autoencode:!0,noBOM:!0},r.flags);var V=[],G=function(e){return p.getStringUnitWidth(e,{font:W,charSpace:u,fontSize:te,doKerning:!1})*te/B};if("[object Array]"===Object.prototype.toString.call(e)){var q;a=E(e),"left"!==A&&(j=a.map(G));var X,Y=0;if("right"===A){t-=j[0],e=[],L=a.length;for(var Z=0;Z<L;Z++)0===Z?(X=jt(t),q=zt(n)):(X=_(Y-j[Z]),q=-z),e.push([a[Z],X,q]),Y=j[Z]}else if("center"===A){t-=j[0]/2,e=[],L=a.length;for(var $=0;$<L;$++)0===$?(X=jt(t),q=zt(n)):(X=_((Y-j[$])/2),q=-z),e.push([a[$],X,q]),Y=j[$]}else if("left"===A){e=[],L=a.length;for(var ee=0;ee<L;ee++)e.push(a[ee])}else if("justify"===A&&"Identity-H"===W.encoding){e=[],L=a.length,l=0!==l?l:K;for(var ne=0,re=0;re<L;re++)if(q=0===re?zt(n):-z,X=0===re?jt(t):ne,re<L-1){var oe=_((l-j[re])/(a[re].split(" ").length-1)),ae=a[re].split(" ");e.push([ae[0]+" ",X,q]),ne=0;for(var se=1;se<ae.length;se++){var Ae=(G(ae[se-1]+" "+ae[se])-G(ae[se]))*B+oe;se==ae.length-1?e.push([ae[se],Ae,0]):e.push([ae[se]+" ",Ae,0]),ne-=Ae}}else e.push([a[re],X,q]);e.push(["",ne,0])}else{if("justify"!==A)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(e=[],L=a.length,l=0!==l?l:K,re=0;re<L;re++)q=0===re?zt(n):-z,X=0===re?jt(t):0,re<L-1?V.push(C(_((l-j[re])/(a[re].split(" ").length-1)))):V.push(0),e.push([a[re],X,q])}}!0===("boolean"==typeof r.R2L?r.R2L:ie)&&(e=S(e,function(e,t,n){return[e.split("").reverse().join(""),t,n]})),o={text:e,x:t,y:n,options:r,mutex:{pdfEscape:nt,activeFontKey:ce,fonts:ge,activeFontSize:te}},Ee.publish("postProcessText",o),e=o.text,m=o.mutex.isHex||!1;var ue=ge[ce].encoding;"WinAnsiEncoding"!==ue&&"StandardEncoding"!==ue||(e=S(e,function(e,t,n){return[x(e),t,n]})),a=E(e),e=[];for(var le,fe,he,de=Array.isArray(a[0])?1:0,pe="",me=function(e,t,n){var i="";return n instanceof Ne?(n="number"==typeof r.angle?Ue(n,new Ne(1,0,0,1,e,t)):Ue(new Ne(1,0,0,1,e,t),n),y===w&&(n=Ue(new Ne(1,0,0,-1,0,0),n)),i=n.join(" ")+" Tm\n"):i=C(e)+" "+C(t)+" Td\n",i},ve=0;ve<a.length;ve++){switch(pe="",de){case 1:he=(m?"<":"(")+a[ve][0]+(m?">":")"),le=parseFloat(a[ve][1]),fe=parseFloat(a[ve][2]);break;case 0:he=(m?"<":"(")+a[ve]+(m?">":")"),le=jt(t),fe=zt(n)}void 0!==V&&void 0!==V[ve]&&(pe=V[ve]+" Tw\n"),0===ve?e.push(pe+me(le,fe,d)+he):0===de?e.push(pe+he):1===de&&e.push(pe+me(le,fe,d)+he)}e=0===de?e.join(" Tj\nT* "):e.join(" Tj\n"),e+=" Tj\n";var we="BT\n/";return we+=ce+" "+te+" Tf\n",we+=C(te*b)+" TL\n",we+=qt+"\n",we+=v,we+=e,J(we+="ET"),f[ce]=!0,p};var Bt=h.__private__.clip=h.clip=function(e){return J("evenodd"===e?"W*":"W"),this};h.clipEvenOdd=function(){return Bt("evenodd")},h.__private__.discardPath=h.discardPath=function(){return J("n"),this};var xt=h.__private__.isValidStyle=function(e){var t=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(e)&&(t=!0),t};h.__private__.setDefaultPathOperation=h.setDefaultPathOperation=function(e){return xt(e)&&(u=e),this};var Ct=h.__private__.getStyle=h.getStyle=function(e){var t=u;switch(e){case"D":case"S":t="S";break;case"F":t="f";break;case"FD":case"DF":t="B";break;case"f":case"f*":case"B":case"B*":t=e}return t},Ft=h.close=function(){return J("h"),this};h.stroke=function(){return J("S"),this},h.fill=function(e){return Et("f",e),this},h.fillEvenOdd=function(e){return Et("f*",e),this},h.fillStroke=function(e){return Et("B",e),this},h.fillStrokeEvenOdd=function(e){return Et("B*",e),this};var Et=function(e,t){"object"===(0,uv.A)(t)?_t(t,e):J(e)},St=function(e){null===e||y===w&&void 0===e||(e=Ct(e),J(e))};function kt(e,t,n,r,i){var o=new Pw(t||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);o.stream=this.stream;var a=e+"$$"+this.cloneIndex+++"$$";return Qe(a,o),o}var _t=function(e,t){var n=ye[e.key],r=we[n];if(r instanceof Tw)J("q"),J(It(t)),r.gState&&h.setGState(r.gState),J(e.matrix.toString()+" cm"),J("/"+n+" sh"),J("Q");else if(r instanceof Pw){var i=new Ne(1,0,0,-1,0,un());e.matrix&&(i=i.multiply(e.matrix||Le),n=kt.call(r,e.key,e.boundingBox,e.xStep,e.yStep,i).id),J("q"),J("/Pattern cs"),J("/"+n+" scn"),r.gState&&h.setGState(r.gState),J(t),J("Q")}},It=function(e){switch(e){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Nt=h.moveTo=function(e,t){return J(C(_(e))+" "+C(I(t))+" m"),this},Ut=h.lineTo=function(e,t){return J(C(_(e))+" "+C(I(t))+" l"),this},Lt=h.curveTo=function(e,t,n,r,i,o){return J([C(_(e)),C(I(t)),C(_(n)),C(I(r)),C(_(i)),C(I(o)),"c"].join(" ")),this};h.__private__.line=h.line=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!xt(i))throw new Error("Invalid arguments passed to jsPDF.line");return y===v?this.lines([[n-e,r-t]],e,t,[1,1],i||"S"):this.lines([[n-e,r-t]],e,t,[1,1]).stroke()},h.__private__.lines=h.lines=function(e,t,n,r,i,o){var a,s,A,u,l,c,f,h,d,p,g,m;if("number"==typeof e&&(m=n,n=t,t=e,e=m),r=r||[1,1],o=o||!1,isNaN(t)||isNaN(n)||!Array.isArray(e)||!Array.isArray(r)||!xt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(Nt(t,n),a=r[0],s=r[1],u=e.length,p=t,g=n,A=0;A<u;A++)2===(l=e[A]).length?(p=l[0]*a+p,g=l[1]*s+g,Ut(p,g)):(c=l[0]*a+p,f=l[1]*s+g,h=l[2]*a+p,d=l[3]*s+g,p=l[4]*a+p,g=l[5]*s+g,Lt(c,f,h,d,p,g));return o&&Ft(),St(i),this},h.path=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.c;switch(n.op){case"m":Nt(r[0],r[1]);break;case"l":Ut(r[0],r[1]);break;case"c":Lt.apply(this,r);break;case"h":Ft()}}return this},h.__private__.rect=h.rect=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!xt(i))throw new Error("Invalid arguments passed to jsPDF.rect");return y===v&&(r=-r),J([C(_(e)),C(I(t)),C(_(n)),C(_(r)),"re"].join(" ")),St(i),this},h.__private__.triangle=h.triangle=function(e,t,n,r,i,o,a){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!xt(a))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-e,r-t],[i-n,o-r],[e-i,t-o]],e,t,[1,1],a,!0),this},h.__private__.roundedRect=h.roundedRect=function(e,t,n,r,i,o,a){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!xt(a))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),o=Math.min(o,.5*r),this.lines([[n-2*i,0],[i*s,0,i,o-o*s,i,o],[0,r-2*o],[0,o*s,-i*s,o,-i,o],[2*i-n,0],[-i*s,0,-i,-o*s,-i,-o],[0,2*o-r],[0,-o*s,i*s,-o,i,-o]],e+i,t,[1,1],a,!0),this},h.__private__.ellipse=h.ellipse=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!xt(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var o=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return Nt(e+n,t),Lt(e+n,t-a,e+o,t-r,e,t-r),Lt(e-o,t-r,e-n,t-a,e-n,t),Lt(e-n,t+a,e-o,t+r,e,t+r),Lt(e+o,t+r,e+n,t+a,e+n,t),St(i),this},h.__private__.circle=h.circle=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||!xt(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(e,t,n,n,r)},h.setFont=function(e,t,n){return n&&(t=x(t,n)),ce=At(e,t,{disableWarning:!1}),this};var Qt=h.__private__.getFont=h.getFont=function(){return ge[At.apply(h,arguments)]};h.__private__.getFontList=h.getFontList=function(){var e,t,n={};for(e in me)if(me.hasOwnProperty(e))for(t in n[e]=[],me[e])me[e].hasOwnProperty(t)&&n[e].push(t);return n},h.addFont=function(e,t,n,r,i){var o=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==o.indexOf(arguments[3])?i=arguments[3]:arguments[3]&&-1==o.indexOf(arguments[3])&&(n=x(n,r)),tt.call(this,e,t,n,i=i||"Identity-H")};var Dt,Rt=e.lineWidth||.200025,Tt=h.__private__.getLineWidth=h.getLineWidth=function(){return Rt},Pt=h.__private__.setLineWidth=h.setLineWidth=function(e){return Rt=e,J(C(_(e))+" w"),this};h.__private__.setLineDash=Ow.API.setLineDash=Ow.API.setLineDashPattern=function(e,t){if(e=e||[],t=t||0,isNaN(t)||!Array.isArray(e))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return e=e.map(function(e){return C(_(e))}).join(" "),t=C(_(t)),J("["+e+"] "+t+" d"),this};var Ot=h.__private__.getLineHeight=h.getLineHeight=function(){return te*Dt};h.__private__.getLineHeight=h.getLineHeight=function(){return te*Dt};var Mt=h.__private__.setLineHeightFactor=h.setLineHeightFactor=function(e){return"number"==typeof(e=e||1.15)&&(Dt=e),this},Ht=h.__private__.getLineHeightFactor=h.getLineHeightFactor=function(){return Dt};Mt(e.lineHeight);var jt=h.__private__.getHorizontalCoordinate=function(e){return _(e)},zt=h.__private__.getVerticalCoordinate=function(e){return y===w?e:Fe[O].mediaBox.topRightY-Fe[O].mediaBox.bottomLeftY-_(e)},Kt=h.__private__.getHorizontalCoordinateString=h.getHorizontalCoordinateString=function(e){return C(jt(e))},Wt=h.__private__.getVerticalCoordinateString=h.getVerticalCoordinateString=function(e){return C(zt(e))},Vt=e.strokeColor||"0 G";h.__private__.getStrokeColor=h.getDrawColor=function(){return He(Vt)},h.__private__.setStrokeColor=h.setDrawColor=function(e,t,n,r){return Vt=je({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"draw",precision:2}),J(Vt),this};var Gt=e.fillColor||"0 g";h.__private__.getFillColor=h.getFillColor=function(){return He(Gt)},h.__private__.setFillColor=h.setFillColor=function(e,t,n,r){return Gt=je({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"fill",precision:2}),J(Gt),this};var qt=e.textColor||"0 g",Xt=h.__private__.getTextColor=h.getTextColor=function(){return He(qt)};h.__private__.setTextColor=h.setTextColor=function(e,t,n,r){return qt=je({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this};var Yt=e.charSpace,Jt=h.__private__.getCharSpace=h.getCharSpace=function(){return parseFloat(Yt||0)};h.__private__.setCharSpace=h.setCharSpace=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Yt=e,this};var Zt=0;h.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},h.__private__.setLineCap=h.setLineCap=function(e){var t=h.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Zt=t,J(t+" J"),this};var $t=0;h.__private__.setLineJoin=h.setLineJoin=function(e){var t=h.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return $t=t,J(t+" j"),this},h.__private__.setLineMiterLimit=h.__private__.setMiterLimit=h.setLineMiterLimit=h.setMiterLimit=function(e){if(e=e||0,isNaN(e))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return J(C(_(e))+" M"),this},h.GState=Dw,h.setGState=function(e){(e="string"==typeof e?be[Be[e]]:en(null,e)).equals(xe)||(J("/"+e.id+" gs"),xe=e)};var en=function(e,t){if(!e||!Be[e]){var n=!1;for(var r in be)if(be.hasOwnProperty(r)&&be[r].equals(t)){n=!0;break}if(n)t=be[r];else{var i="GS"+(Object.keys(be).length+1).toString(10);be[i]=t,t.id=i}return e&&(Be[e]=t.id),Ee.publish("addGState",t),t}};h.addGState=function(e,t){return en(e,t),this},h.saveGraphicsState=function(){return J("q"),ve.push({key:ce,size:te,color:qt}),this},h.restoreGraphicsState=function(){J("Q");var e=ve.pop();return ce=e.key,te=e.size,qt=e.color,xe=null,this},h.setCurrentTransformationMatrix=function(e){return J(e.toString()+" cm"),this},h.comment=function(e){return J("#"+e),this};var tn=function(e,t){var n=e||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(e){isNaN(e)||(n=parseFloat(e))}});var r=t||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(e){isNaN(e)||(r=parseFloat(e))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(e){i=e.toString()}}),this},nn=function(e,t,n,r){tn.call(this,e,t),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(e){isNaN(e)||(i=parseFloat(e))}});var o=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return o},set:function(e){isNaN(e)||(o=parseFloat(e))}}),this},rn=function(){this.page=Ce,this.currentPage=O,this.pages=G.slice(0),this.pagesContext=Fe.slice(0),this.x=he,this.y=de,this.matrix=pe,this.width=sn(O),this.height=un(O),this.outputDestination=X,this.id="",this.objectNumber=-1};rn.prototype.restore=function(){Ce=this.page,O=this.currentPage,Fe=this.pagesContext,G=this.pages,he=this.x,de=this.y,pe=this.matrix,An(O,this.width),ln(O,this.height),X=this.outputDestination};var on=function(e,t,n,r,i){Ie.push(new rn),Ce=O=0,G=[],he=e,de=t,pe=i,rt([n,r])};for(var an in h.beginFormObject=function(e,t,n,r,i){return on(e,t,n,r,i),this},h.endFormObject=function(e){return function(e){if(_e[e])Ie.pop().restore();else{var t=new rn,n="Xo"+(Object.keys(ke).length+1).toString(10);t.id=n,_e[e]=n,ke[n]=t,Ee.publish("addFormObject",t),Ie.pop().restore()}}(e),this},h.doFormObject=function(e,t){var n=ke[_e[e]];return J("q"),J(t.toString()+" cm"),J("/"+n.id+" Do"),J("Q"),this},h.getFormObject=function(e){var t=ke[_e[e]];return{x:t.x,y:t.y,width:t.width,height:t.height,matrix:t.matrix}},h.save=function(e,t){return e=e||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1===t.returnPromise?(dw(pt(dt()),e),"function"==typeof dw.unload&&aw.setTimeout&&setTimeout(dw.unload,911),this):new Promise(function(t,n){try{var r=dw(pt(dt()),e);"function"==typeof dw.unload&&aw.setTimeout&&setTimeout(dw.unload,911),t(r)}catch(e){n(e.message)}})},Ow.API)Ow.API.hasOwnProperty(an)&&("events"===an&&Ow.API.events.length?function(e,t){var n,r,i;for(i=t.length-1;-1!==i;i--)n=t[i][0],r=t[i][1],e.subscribe.apply(e,[n].concat("function"==typeof r?[r]:r))}(Ee,Ow.API.events):h[an]=Ow.API[an]);var sn=h.getPageWidth=function(e){return(Fe[e=e||O].mediaBox.topRightX-Fe[e].mediaBox.bottomLeftX)/fe},An=h.setPageWidth=function(e,t){Fe[e].mediaBox.topRightX=t*fe+Fe[e].mediaBox.bottomLeftX},un=h.getPageHeight=function(e){return(Fe[e=e||O].mediaBox.topRightY-Fe[e].mediaBox.bottomLeftY)/fe},ln=h.setPageHeight=function(e,t){Fe[e].mediaBox.topRightY=t*fe+Fe[e].mediaBox.bottomLeftY};return h.internal={pdfEscape:nt,getStyle:Ct,getFont:Qt,getFontSize:re,getCharSpace:Jt,getTextColor:Xt,getLineHeight:Ot,getLineHeightFactor:Ht,getLineWidth:Tt,write:Z,getHorizontalCoordinate:jt,getVerticalCoordinate:zt,getCoordinateString:Kt,getVerticalCoordinateString:Wt,collections:{},newObject:De,newAdditionalObject:Pe,newObjectDeferred:Re,newObjectDeferredBegin:Te,getFilters:ze,putStream:Ke,events:Ee,scaleFactor:fe,pageSize:{getWidth:function(){return sn(O)},setWidth:function(e){An(O,e)},getHeight:function(){return un(O)},setHeight:function(e){ln(O,e)}},encryptionOptions:l,encryption:vt,getEncryptor:function(e){return null!==l?vt.encryptor(e,0):function(e){return e}},output:gt,getNumberOfPages:st,pages:G,out:J,f2:S,f3:k,getPageInfo:wt,getPageInfoByObjId:yt,getCurrentPageInfo:bt,getPDFVersion:p,Point:tn,Rectangle:nn,Matrix:Ne,hasHotfix:mt},Object.defineProperty(h.internal.pageSize,"width",{get:function(){return sn(O)},set:function(e){An(O,e)},enumerable:!0,configurable:!0}),Object.defineProperty(h.internal.pageSize,"height",{get:function(){return un(O)},set:function(e){ln(O,e)},enumerable:!0,configurable:!0}),function(e){for(var t=0,n=ee.length;t<n;t++){var r=tt.call(this,e[t][0],e[t][1],e[t][2],ee[t][3],!0);!1===c&&(f[r]=!0);var i=e[t][0].split("-");et({id:r,fontName:i[0],fontStyle:i[1]||""})}Ee.publish("addFonts",{fonts:ge,dictionary:me})}.call(h,ee),ce="F1",it(i,n),Ee.publish("initialized"),h}Uw.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},Uw.prototype.toHexString=function(e){return e.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Uw.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},Uw.prototype.processOwnerPassword=function(e,t){return Iw(Sw(t).substr(0,5),e)},Uw.prototype.encryptor=function(e,t){var n=Sw(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return Iw(n,e)}},Dw.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||(0,uv.A)(e)!==(0,uv.A)(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t))return!1;if(this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return 0===r},Ow.API={events:[]},Ow.version="3.0.1";var Mw=Ow.API,Hw=1,jw=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},zw=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Kw=function(e){return e.toFixed(2)},Ww=function(e){return e.toFixed(5)};Mw.__acroform__={};var Vw=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Gw=function(e){return e*Hw},qw=function(e){var t=new cy,n=Fy.internal.getHeight(e)||0,r=Fy.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Kw(r)),Number(Kw(n))],t},Xw=Mw.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},Yw=Mw.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},Jw=Mw.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(e&1<<t)?0:1},Zw=Mw.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Jw(e,t-1)},$w=Mw.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Xw(e,t-1)},ey=Mw.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Yw(e,t-1)},ty=Mw.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,i=e[0],o=e[1],a=e[2],s=e[3],A={};return A.lowerLeft_X=n(i)||0,A.lowerLeft_Y=r(o+s)||0,A.upperRight_X=n(i+a)||0,A.upperRight_Y=r(o)||0,[Number(Kw(A.lowerLeft_X)),Number(Kw(A.lowerLeft_Y)),Number(Kw(A.upperRight_X)),Number(Kw(A.upperRight_Y))]},ny=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=ry(e,n),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+Kw(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var o=qw(e);return o.scope=e.scope,o.stream=t.join("\n"),o}},ry=function(e,t){var n=0===e.fontSize?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},i=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(e){return e.split("\n")}):i.map(function(e){return[e]});var o=n,a=Fy.internal.getHeight(e)||0;a=a<0?-a:a;var s=Fy.internal.getWidth(e)||0;s=s<0?-s:s;var A=function(t,n,r){if(t+1<i.length){var o=n+" "+i[t+1][0];return iy(o,e,r).width<=s-4}return!1};o++;e:for(;o>0;){t="",o--;var u,l,c=iy("3",e,o).height,f=e.multiline?a-o:(a-c)/2,h=f+=2,d=0,p=0,g=0;if(o<=0){t="(...) Tj\n",t+="% Width of Text: "+iy(t,e,o=12).width+", FieldWidth:"+s+"\n";break}for(var m="",v=0,w=0;w<i.length;w++)if(i.hasOwnProperty(w)){var y=!1;if(1!==i[w].length&&g!==i[w].length-1){if((c+2)*(v+2)+2>a)continue e;m+=i[w][g],y=!0,p=w,w--}else{m=" "==(m+=i[w][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var b=parseInt(w),B=A(b,m,o),x=w>=i.length-1;if(B&&!x){m+=" ",g=0;continue}if(B||x){if(x)p=b;else if(e.multiline&&(c+2)*(v+2)+2>a)continue e}else{if(!e.multiline)continue e;if((c+2)*(v+2)+2>a)continue e;p=b}}for(var C="",F=d;F<=p;F++){var E=i[F];if(e.multiline){if(F===p){C+=E[g]+" ",g=(g+1)%E.length;continue}if(F===d){C+=E[E.length-1]+" ";continue}}C+=E[0]+" "}switch(C=" "==C.substr(C.length-1)?C.substr(0,C.length-1):C,l=iy(C,e,o).width,e.textAlign){case"right":u=s-l-2;break;case"center":u=(s-l)/2;break;default:u=2}t+=Kw(u)+" "+Kw(h)+" Td\n",t+="("+jw(C)+") Tj\n",t+=-Kw(u)+" 0 Td\n",h=-(o+2),l=0,d=y?p:p+1,v++,m=""}break}return r.text=t,r.fontSize=o,r},iy=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},oy={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},ay=function(e,t){var n={type:"reference",object:e};void 0===t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===n.type&&e.object===n.object})&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},sy=function(e,t){if(t.scope=e,void 0!==e.internal&&(void 0===e.internal.acroformPlugin||!1===e.internal.acroformPlugin.isInitialized)){if(hy.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(oy)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Hw=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new fy,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){!function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0}(e)}),e.internal.events.subscribe("buildDocument",function(){!function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.objId=void 0,r.hasAnnotation&&ay(r,e)}}(e)}),e.internal.events.subscribe("putCatalog",function(){!function(e){if(void 0===e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");e.internal.write("/AcroForm "+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(e)}),e.internal.events.subscribe("postPutPages",function(t){!function(e,t){var n=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var i=e[r],o=[],a=i.Rect;if(i.Rect&&(i.Rect=ty(i.Rect,t)),t.internal.newObjectDeferredBegin(i.objId,!0),i.DA=Fy.createDefaultAppearanceStream(i),"object"===(0,uv.A)(i)&&"function"==typeof i.getKeyValueListForStream&&(o=i.getKeyValueListForStream()),i.Rect=a,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=ny(i);o.push({key:"AP",value:"<</N "+s+">>"}),t.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var A="";for(var u in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(u)){var l=i.appearanceStreamContent[u];if(A+="/"+u+" ",A+="<<",Object.keys(l).length>=1||Array.isArray(l)){for(var r in l)if(l.hasOwnProperty(r)){var c=l[r];"function"==typeof c&&(c=c.call(t,i)),A+="/"+r+" "+c+" ",t.internal.acroformPlugin.xForms.indexOf(c)>=0||t.internal.acroformPlugin.xForms.push(c)}}else"function"==typeof(c=l)&&(c=c.call(t,i)),A+="/"+r+" "+c,t.internal.acroformPlugin.xForms.indexOf(c)>=0||t.internal.acroformPlugin.xForms.push(c);A+=">>"}o.push({key:"AP",value:"<<\n"+A+">>"})}t.internal.putStream({additionalKeyValues:o,objectId:i.objId}),t.internal.out("endobj")}n&&function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,i=e[n];t.internal.newObjectDeferredBegin(i.objId,!0),"object"===(0,uv.A)(i)&&"function"==typeof i.putStream&&i.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)}(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},Ay=Mw.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(e){return e};if(Array.isArray(e)){for(var i="[",o=0;o<e.length;o++)switch(0!==o&&(i+=" "),(0,uv.A)(e[o])){case"boolean":case"number":case"object":i+=e[o].toString();break;case"string":"/"!==e[o].substr(0,1)?(void 0!==t&&n&&(r=n.internal.getEncryptor(t)),i+="("+jw(r(e[o].toString()))+")"):i+=e[o].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},uy=function(e,t,n){var r=function(e){return e};return void 0!==t&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+jw(r(e))+")"},ly=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};ly.prototype.toString=function(){return this.objId+" 0 R"},ly.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},ly.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return"content"!=e&&"appearanceStreamContent"!=e&&"scope"!=e&&"objId"!=e&&"_"!=e.substring(0,1)});for(var n in t)if(!1===Object.getOwnPropertyDescriptor(this,t[n]).configurable){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:Ay(i,this.objId,this.scope)}):i instanceof ly?(i.scope=this.scope,e.push({key:r,value:i.objId+" 0 R"})):"function"!=typeof i&&e.push({key:r,value:i}))}return e};var cy=function(){ly.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};Vw(cy,ly);var fy=function(){ly.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+jw(t(e))+")"}},set:function(t){e=t}})};Vw(fy,ly);var hy=function e(){ly.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(t,3))},set:function(e){!0===Boolean(e)?this.F=$w(t,3):this.F=ey(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute Ff supplied.');n=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(e){r=void 0!==e?e:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(e){switch(e){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=e;break;default:throw new Error('Invalid value "'+e+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof by)return;o="FieldObject"+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+jw(t(o))+")"},set:function(e){o=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(e){a=e}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var A=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return A},set:function(e){A=e}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===u?50/Hw:u},set:function(e){u=e}});var l="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return l},set:function(e){l=e}});var c="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!c||this instanceof by||this instanceof xy))return uy(c,this.objId,this.scope)},set:function(e){e=e.toString(),c=e}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof vy==0?uy(f,this.objId,this.scope):f},set:function(e){e=e.toString(),f=this instanceof vy==0?"("===e.substr(0,1)?zw(e.substr(1,e.length-2)):zw(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof vy==1?zw(f.substr(1,f.length-1)):f},set:function(e){e=e.toString(),f=this instanceof vy==1?"/"+e:e}});var h=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(h)return h},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof vy==0?uy(h,this.objId,this.scope):h},set:function(e){e=e.toString(),h=this instanceof vy==0?"("===e.substr(0,1)?zw(e.substr(1,e.length-2)):zw(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof vy==1?zw(h.substr(1,h.length-1)):h},set:function(e){e=e.toString(),h=this instanceof vy==1?"/"+e:e}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var d,p=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return p},set:function(e){e=Boolean(e),p=e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(d)return d},set:function(e){d=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,1))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,1):this.Ff=ey(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,2))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,2):this.Ff=ey(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,3))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,3):this.Ff=ey(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(e){if(-1===[0,1,2].indexOf(e))throw new Error('Invalid value "'+e+'" for attribute Q supplied.');g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e="left";break;case 1:e="center";break;case 2:e="right"}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};Vw(hy,ly);var dy=function(){hy.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Ay(t,this.objId,this.scope)},set:function(e){var n,r;r=[],"string"==typeof(n=e)&&(r=function(e,t,n){n||(n=1);for(var r,i=[];r=t.exec(e);)i.push(r[n]);return i}(n,/\((.*?)\)/g)),t=r}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||"").toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,n){for(n=n||!1,e=(e=e||"").toString();-1!==t.indexOf(e)&&(t.splice(t.indexOf(e),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,18))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,18):this.Ff=ey(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,19))},set:function(e){!0===this.combo&&(!0===Boolean(e)?this.Ff=$w(this.Ff,19):this.Ff=ey(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,20))},set:function(e){!0===Boolean(e)?(this.Ff=$w(this.Ff,20),t.sort()):this.Ff=ey(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,22))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,22):this.Ff=ey(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,23):this.Ff=ey(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,27))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,27):this.Ff=ey(this.Ff,27)}}),this.hasAppearanceStream=!1};Vw(dy,hy);var py=function(){dy.call(this),this.fontName="helvetica",this.combo=!1};Vw(py,dy);var gy=function(){py.call(this),this.combo=!0};Vw(gy,py);var my=function(){gy.call(this),this.edit=!0};Vw(my,gy);var vy=function(){hy.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,15))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,15):this.Ff=ey(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,16))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,16):this.Ff=ey(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,17))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,17):this.Ff=ey(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,26):this.Ff=ey(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(t).length){var n,r=[];for(n in r.push("<<"),t)r.push("/"+n+" ("+jw(e(t[n]))+")");return r.push(">>"),r.join("\n")}},set:function(e){"object"===(0,uv.A)(e)&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};Vw(vy,hy);var wy=function(){vy.call(this),this.pushButton=!0};Vw(wy,vy);var yy=function(){vy.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};Vw(yy,vy);var by=function(){var e,t;hy.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,n=[];for(t in n.push("<<"),r)n.push("/"+t+" ("+jw(e(r[t]))+")");return n.push(">>"),n.join("\n")},set:function(e){"object"===(0,uv.A)(e)&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(e){"string"==typeof e&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(e){n="/"+e}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Fy.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Vw(by,hy),yy.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},yy.prototype.createOption=function(e){var t=new by;return t.Parent=this,t.optionName=e,this.Kids.push(t),Ey.call(this.scope,t),t};var By=function(){vy.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Fy.CheckBox.createAppearanceStream()};Vw(By,vy);var xy=function(){hy.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,13))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,13):this.Ff=ey(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,21))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,21):this.Ff=ey(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,23):this.Ff=ey(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,24))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,24):this.Ff=ey(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,25))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,25):this.Ff=ey(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,26):this.Ff=ey(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Vw(xy,hy);var Cy=function(){xy.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(Zw(this.Ff,14))},set:function(e){!0===Boolean(e)?this.Ff=$w(this.Ff,14):this.Ff=ey(this.Ff,14)}}),this.password=!0};Vw(Cy,xy);var Fy={CheckBox:{createAppearanceStream:function(){return{N:{On:Fy.CheckBox.YesNormal},D:{On:Fy.CheckBox.YesPushDown,Off:Fy.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),o=ry(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+Kw(Fy.internal.getWidth(e))+" "+Kw(Fy.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Kw(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join("\n"),t},YesNormal:function(e){var t=qw(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],o=Fy.internal.getHeight(e),a=Fy.internal.getWidth(e),s=ry(e,e.caption);return i.push("1 g"),i.push("0 0 "+Kw(a)+" "+Kw(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Kw(a-1)+" "+Kw(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Kw(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),t.stream=i.join("\n"),t},OffPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Kw(Fy.internal.getWidth(e))+" "+Kw(Fy.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join("\n"),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Fy.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Fy.RadioButton.Circle.YesNormal,t.D[e]=Fy.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=qw(e);t.scope=e.scope;var n=[],r=Fy.internal.getWidth(e)<=Fy.internal.getHeight(e)?Fy.internal.getWidth(e)/4:Fy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Fy.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+Ww(Fy.internal.getWidth(e)/2)+" "+Ww(Fy.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join("\n"),t},YesPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=[],r=Fy.internal.getWidth(e)<=Fy.internal.getHeight(e)?Fy.internal.getWidth(e)/4:Fy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),o=Number((i*Fy.internal.Bezier_C).toFixed(5)),a=Number((r*Fy.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Ww(Fy.internal.getWidth(e)/2)+" "+Ww(Fy.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+Ww(Fy.internal.getWidth(e)/2)+" "+Ww(Fy.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join("\n"),t},OffPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=[],r=Fy.internal.getWidth(e)<=Fy.internal.getHeight(e)?Fy.internal.getWidth(e)/4:Fy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),o=Number((i*Fy.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Ww(Fy.internal.getWidth(e)/2)+" "+Ww(Fy.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join("\n"),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Fy.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Fy.RadioButton.Cross.YesNormal,t.D[e]=Fy.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=qw(e);t.scope=e.scope;var n=[],r=Fy.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+Kw(Fy.internal.getWidth(e)-2)+" "+Kw(Fy.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Kw(r.x1.x)+" "+Kw(r.x1.y)+" m"),n.push(Kw(r.x2.x)+" "+Kw(r.x2.y)+" l"),n.push(Kw(r.x4.x)+" "+Kw(r.x4.y)+" m"),n.push(Kw(r.x3.x)+" "+Kw(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join("\n"),t},YesPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=Fy.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Kw(Fy.internal.getWidth(e))+" "+Kw(Fy.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Kw(Fy.internal.getWidth(e)-2)+" "+Kw(Fy.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Kw(n.x1.x)+" "+Kw(n.x1.y)+" m"),r.push(Kw(n.x2.x)+" "+Kw(n.x2.y)+" l"),r.push(Kw(n.x4.x)+" "+Kw(n.x4.y)+" m"),r.push(Kw(n.x3.x)+" "+Kw(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join("\n"),t},OffPushDown:function(e){var t=qw(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Kw(Fy.internal.getWidth(e))+" "+Kw(Fy.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join("\n"),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Fy.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Fy.internal.getWidth(e),n=Fy.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Fy.internal.getWidth=function(e){var t=0;return"object"===(0,uv.A)(e)&&(t=Gw(e.Rect[2])),t},Fy.internal.getHeight=function(e){var t=0;return"object"===(0,uv.A)(e)&&(t=Gw(e.Rect[3])),t};var Ey=Mw.addField=function(e){if(sy(this,e),!(e instanceof hy))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};Mw.AcroFormChoiceField=dy,Mw.AcroFormListBox=py,Mw.AcroFormComboBox=gy,Mw.AcroFormEditBox=my,Mw.AcroFormButton=vy,Mw.AcroFormPushButton=wy,Mw.AcroFormRadioButton=yy,Mw.AcroFormCheckBox=By,Mw.AcroFormTextField=xy,Mw.AcroFormPasswordField=Cy,Mw.AcroFormAppearance=Fy,Mw.AcroForm={ChoiceField:dy,ListBox:py,ComboBox:gy,EditBox:my,Button:vy,PushButton:wy,RadioButton:yy,CheckBox:By,TextField:xy,PasswordField:Cy,Appearance:Fy},Ow.AcroForm={ChoiceField:dy,ListBox:py,ComboBox:gy,EditBox:my,Button:vy,PushButton:wy,RadioButton:yy,CheckBox:By,TextField:xy,PasswordField:Cy,Appearance:Fy};Ow.AcroForm;function Sy(e){return e.reduce(function(e,t,n){return e[t]=n,e},{})}!function(e){e.__addimage__={};var t="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=e.__addimage__.getImageFileTypeByImageData=function(e,r){var i,o,a,s,A,u=t;if("RGBA"===(r=r||t)||void 0!==e.data&&e.data instanceof Uint8ClampedArray&&"height"in e&&"width"in e)return"RGBA";if(B(e))for(A in n)for(a=n[A],i=0;i<a.length;i+=1){for(s=!0,o=0;o<a[i].length;o+=1)if(void 0!==a[i][o]&&a[i][o]!==e[o]){s=!1;break}if(!0===s){u=A;break}}else for(A in n)for(a=n[A],i=0;i<a.length;i+=1){for(s=!0,o=0;o<a[i].length;o+=1)if(void 0!==a[i][o]&&a[i][o]!==e.charCodeAt(o)){s=!1;break}if(!0===s){u=A;break}}return u===t&&r!==t&&(u=r),u},i=function e(t){for(var n=this.internal.write,r=this.internal.putStream,i=(0,this.internal.getFilters)();-1!==i.indexOf("FlateEncode");)i.splice(i.indexOf("FlateEncode"),1);t.objectId=this.internal.newObject();var o=[];if(o.push({key:"Type",value:"/XObject"}),o.push({key:"Subtype",value:"/Image"}),o.push({key:"Width",value:t.width}),o.push({key:"Height",value:t.height}),t.colorSpace===g.INDEXED?o.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(o.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===g.DEVICE_CMYK&&o.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),o.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&o.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)){for(var a="",s=0,A=t.transparency.length;s<A;s++)a+=t.transparency[s]+" "+t.transparency[s]+" ";o.push({key:"Mask",value:"["+a+"]"})}void 0!==t.sMask&&o.push({key:"SMask",value:t.objectId+1+" 0 R"});var u=void 0!==t.filter?["/"+t.filter]:void 0;if(r({data:t.data,additionalKeyValues:o,alreadyAppliedFilters:u,objectId:t.objectId}),n("endobj"),"sMask"in t&&void 0!==t.sMask){var l="/Predictor "+t.predictor+" /Colors 1 /BitsPerComponent "+t.bitsPerComponent+" /Columns "+t.width,c={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:t.bitsPerComponent,decodeParameters:l,data:t.sMask};"filter"in t&&(c.filter=t.filter),e.call(this,c)}if(t.colorSpace===g.INDEXED){var f=this.internal.newObject();r({data:C(new Uint8Array(t.palette)),objectId:f}),n("endobj")}},o=function(){var e=this.internal.collections.addImage_images;for(var t in e)i.call(this,e[t])},a=function(){var e,t=this.internal.collections.addImage_images,n=this.internal.write;for(var r in t)n("/I"+(e=t[r]).index,e.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",a))},A=function(){var e=this.internal.collections.addImage_images;return s.call(this),e},u=function(){return Object.keys(this.internal.collections.addImage_images).length},l=function(t){return"function"==typeof e["process"+t.toUpperCase()]},c=function(e){return"object"===(0,uv.A)(e)&&1===e.nodeType},f=function(t,n){if("IMG"===t.nodeName&&t.hasAttribute("src")){var r=""+t.getAttribute("src");if(0===r.indexOf("data:image/"))return fw(unescape(r).split("base64,").pop());var i=e.loadFile(r,!0);if(void 0!==i)return i}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw new Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);var o;switch(n){case"PNG":o="image/png";break;case"WEBP":o="image/webp";break;default:o="image/jpeg"}return fw(t.toDataURL(o,1).split("base64,").pop())}},h=function(e){var t=this.internal.collections.addImage_images;if(t)for(var n in t)if(e===t[n].alias)return t[n]},d=function(e,t,n){return e||t||(e=-96,t=-96),e<0&&(e=-1*n.width*72/e/this.internal.scaleFactor),t<0&&(t=-1*n.height*72/t/this.internal.scaleFactor),0===e&&(e=t*n.width/n.height),0===t&&(t=e*n.height/n.width),[e,t]},p=function(e,t,n,r,i,o){var a=d.call(this,n,r,i),s=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString,l=A.call(this);if(n=a[0],r=a[1],l[i.index]=i,o){o*=Math.PI/180;var c=Math.cos(o),f=Math.sin(o),h=function(e){return e.toFixed(4)},p=[h(c),h(f),h(-1*f),h(c),0,0,"cm"]}this.internal.write("q"),o?(this.internal.write([1,"0","0",1,s(e),u(t+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([s(n),"0","0",s(r),"0","0","cm"].join(" "))):this.internal.write([s(n),"0","0",s(r),s(e),u(t+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+i.index+" Do"),this.internal.write("Q")},g=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 m=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},v=e.__addimage__.sHashCode=function(e){var t,n,r=0;if("string"==typeof e)for(n=e.length,t=0;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;else if(B(e))for(n=e.byteLength/2,t=0;t<n;t++)r=(r<<5)-r+e[t],r|=0;return r},w=e.__addimage__.validateStringAsBase64=function(e){(e=e||"").toString().trim();var t=!0;return 0===e.length&&(t=!1),e.length%4!=0&&(t=!1),!1===/^[A-Za-z0-9+/]+$/.test(e.substr(0,e.length-2))&&(t=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2))&&(t=!1),t},y=e.__addimage__.extractImageFromDataUrl=function(e){if(null==e)return null;if(!(e=e.trim()).startsWith("data:"))return null;var t=e.indexOf(",");return t<0?null:e.substring(0,t).trim().endsWith("base64")?e.substring(t+1):null},b=e.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};e.__addimage__.isArrayBuffer=function(e){return b()&&e instanceof ArrayBuffer};var B=e.__addimage__.isArrayBufferView=function(e){return b()&&"undefined"!=typeof Uint32Array&&(e instanceof Int8Array||e instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)},x=e.__addimage__.binaryStringToUint8Array=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n},C=e.__addimage__.arrayBufferToBinaryString=function(e){for(var t="",n=B(e)?e:new Uint8Array(e),r=0;r<n.length;r+=8192)t+=String.fromCharCode.apply(null,n.subarray(r,r+8192));return t};e.addImage=function(){var e,n,r,i,o,a,A,u,l;if("number"==typeof arguments[1]?(n=t,r=arguments[1],i=arguments[2],o=arguments[3],a=arguments[4],A=arguments[5],u=arguments[6],l=arguments[7]):(n=arguments[1],r=arguments[2],i=arguments[3],o=arguments[4],a=arguments[5],A=arguments[6],u=arguments[7],l=arguments[8]),"object"===(0,uv.A)(e=arguments[0])&&!c(e)&&"imageData"in e){var f=e;e=f.imageData,n=f.format||n||t,r=f.x||r||0,i=f.y||i||0,o=f.w||f.width||o,a=f.h||f.height||a,A=f.alias||A,u=f.compression||u,l=f.rotation||f.angle||l}var h=this.internal.getFilters();if(void 0===u&&-1!==h.indexOf("FlateEncode")&&(u="SLOW"),isNaN(r)||isNaN(i))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var d=F.call(this,e,n,A,u);return p.call(this,r,i,o,a,d,l),this};var F=function(n,i,o,a){var s,A,d;if("string"==typeof n&&r(n)===t){n=unescape(n);var p=E(n,!1);(""!==p||void 0!==(p=e.loadFile(n,!0)))&&(n=p)}if(c(n)&&(n=f(n,i)),i=r(n,i),!l(i))throw new Error("addImage does not support files of type '"+i+"', please ensure that a plugin for '"+i+"' support is added.");if((null==(d=o)||0===d.length)&&(o=function(e){return"string"==typeof e||B(e)?v(e):B(e.data)?v(e.data):null}(n)),(s=h.call(this,o))||(b()&&(n instanceof Uint8Array||"RGBA"===i||(A=n,n=x(n))),s=this["process"+i.toUpperCase()](n,u.call(this),o,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:m.NONE}(a),A)),!s)throw new Error("An unknown error occurred whilst processing the image.");return s},E=e.__addimage__.convertBase64ToBinaryString=function(e,t){t="boolean"!=typeof t||t;var n,r="";if("string"==typeof e){var i;n=null!==(i=y(e))&&void 0!==i?i:e;try{r=fw(n)}catch(e){if(t)throw w(n)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};e.getImageProperties=function(n){var i,o,a="";if(c(n)&&(n=f(n)),"string"==typeof n&&r(n)===t&&(""===(a=E(n,!1))&&(a=e.loadFile(n)||""),n=a),o=r(n),!l(o))throw new Error("addImage does not support files of type '"+o+"', please ensure that a plugin for '"+o+"' support is added.");if(!b()||n instanceof Uint8Array||(n=x(n)),!(i=this["process"+o.toUpperCase()](n)))throw new Error("An unknown error occurred whilst processing the image");return i.fileType=o,i}}(Ow.API),function(e){var t=function(e){if(void 0!==e&&""!=e)return!0};Ow.API.events.push(["addPage",function(e){this.internal.getPageInfo(e.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(e){for(var n,r,i,o=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString,s=this.internal.getPageInfoByObjId(e.objId),A=e.pageContext.annotations,u=!1,l=0;l<A.length&&!u;l++)switch((n=A[l]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(0!=u){this.internal.write("/Annots [");for(var c=0;c<A.length;c++){n=A[c];var f=this.internal.pdfEscape,h=this.internal.getEncryptor(e.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var d=this.internal.newAdditionalObject(),p=this.internal.newAdditionalObject(),g=this.internal.getEncryptor(d.objId),m=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(r="/Rect ["+o(n.bounds.x)+" "+a(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+a(n.bounds.y)+"] ")+"/Contents ("+f(g(n.contents))+")",i+=" /Popup "+p.objId+" 0 R",i+=" /P "+s.objId+" 0 R",i+=" /T ("+f(g(m))+") >>",d.content=i;var v=d.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(r="/Rect ["+o(n.bounds.x+30)+" "+a(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+a(n.bounds.y)+"] ")+" /Parent "+v,n.open&&(i+=" /Open true"),i+=" >>",p.content=i,this.internal.write(d.objId,"0 R",p.objId,"0 R");break;case"freetext":r="/Rect ["+o(n.bounds.x)+" "+a(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+a(n.bounds.y+n.bounds.h)+"] ";var w=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+r+"/Contents ("+f(h(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+w+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var y=this.annotations._nameMap[n.options.name];n.options.pageNumber=y.page,n.options.top=y.y}else n.options.top||(n.options.top=0);if(r="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",i="",n.options.url)i="<</Type /Annot /Subtype /Link "+r+"/Border [0 0 0] /A <</S /URI /URI ("+f(h(n.options.url))+") >>";else if(n.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+r+"/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":i+=" /Fit]";break;case"FitH":i+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,i+=" /FitV "+n.options.left+"]";break;default:var b=a(n.options.top);n.options.left=n.options.left||0,void 0===n.options.zoom&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+b+" "+n.options.zoom+"]"}""!=i&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(e){var t=this.internal.getCurrentPageInfo();switch(e.type){case"link":this.link(e.bounds.x,e.bounds.y,e.bounds.w,e.bounds.h,e);break;case"text":case"freetext":t.pageContext.annotations.push(e)}},e.link=function(e,t,n,r,i){var o=this.internal.getCurrentPageInfo(),a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:a(e),y:s(t),w:a(e+n),h:s(t+r)},options:i,type:"link"})},e.textWithLink=function(e,t,n,r){var i,o,a=this.getTextWidth(e),s=this.internal.getLineHeight()/this.internal.scaleFactor;if(void 0!==r.maxWidth){o=r.maxWidth;var A=this.splitTextToSize(e,o).length;i=Math.ceil(s*A)}else o=a,i=s;return this.text(e,t,n,r),n+=.2*s,"center"===r.align&&(t-=a/2),"right"===r.align&&(t-=a),this.link(t,n-s,o,i,r),a},e.getTextWidth=function(e){var t=this.internal.getFontSize();return this.getStringUnitWidth(e)*t/this.internal.scaleFactor}}(Ow.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(e){return void 0!==t[e.charCodeAt(0)]},a=e.__arabicParser__.isArabicLetter=function(e){return"string"==typeof e&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(e)},s=e.__arabicParser__.isArabicEndLetter=function(e){return a(e)&&o(e)&&t[e.charCodeAt(0)].length<=2},A=e.__arabicParser__.isArabicAlfLetter=function(e){return a(e)&&i.indexOf(e.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(e){return a(e)&&o(e)&&t[e.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(e){return a(e)&&o(e)&&t[e.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(e){return a(e)&&o(e)&&t[e.charCodeAt(0)].length>=3};var l=e.__arabicParser__.arabicLetterHasMedialForm=function(e){return a(e)&&o(e)&&4==t[e.charCodeAt(0)].length},c=e.__arabicParser__.resolveLigatures=function(e){var t=0,r=n,i="",o=0;for(t=0;t<e.length;t+=1)void 0!==r[e.charCodeAt(t)]?(o++,"number"==typeof(r=r[e.charCodeAt(t)])&&(i+=String.fromCharCode(r),r=n,o=0),t===e.length-1&&(r=n,i+=e.charAt(t-(o-1)),t-=o-1,o=0)):(r=n,i+=e.charAt(t-o),t-=o,o=0);return i};e.__arabicParser__.isArabicDiacritic=function(e){return void 0!==e&&void 0!==r[e.charCodeAt(0)]};var f=e.__arabicParser__.getCorrectForm=function(e,t,n){return a(e)?!1===o(e)?-1:!u(e)||!a(t)&&!a(n)||!a(n)&&s(t)||s(e)&&!a(t)||s(e)&&A(t)||s(e)&&s(t)?0:l(e)&&a(t)&&!s(t)&&a(n)&&u(n)?3:s(e)||!a(n)?1:2:-1},h=function(e){var n=0,r=0,i=0,o="",s="",A="",u=(e=e||"").split("\\s+"),l=[];for(n=0;n<u.length;n+=1){for(l.push(""),r=0;r<u[n].length;r+=1)o=u[n][r],s=u[n][r-1],A=u[n][r+1],a(o)?(i=f(o,s,A),l[n]+=-1!==i?String.fromCharCode(t[o.charCodeAt(0)][i]):o):l[n]+=o;l[n]=c(l[n])}return l.join(" ")},d=e.__arabicParser__.processArabic=e.processArabic=function(){var e,t="string"==typeof arguments[0]?arguments[0]:arguments[0].text,n=[];if(Array.isArray(t)){var r=0;for(n=[],r=0;r<t.length;r+=1)Array.isArray(t[r])?n.push([h(t[r][0]),t[r][1],t[r][2]]):n.push([h(t[r])]);e=n}else e=h(t);return"string"==typeof arguments[0]?e:(arguments[0].text=e,arguments[0])};e.events.push(["preProcessText",d])}(Ow.API),Ow.API.autoPrint=function(e){var t;if("javascript"===((e=e||{}).variant=e.variant||"non-conform",e.variant))this.addJS("print({});");else this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")});return this},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=t+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(e){n=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(e){r=e}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(e){i=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var n;if("2d"!==(e=e||"2d"))return null;for(n in t)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=t[n]);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}])}(Ow.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=function(){void 0===this.internal.__cell__&&(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 e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var i=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var o=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return o},set:function(e){o=e}});var a=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return a},set:function(e){a=e}}),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(e){return r.call(this),this.internal.__cell__.headerFunction="function"==typeof e?e:void 0,this},e.getTextDimensions=function(e,t){r.call(this);var n=(t=t||{}).fontSize||this.getFontSize(),i=t.font||this.getFont(),o=t.scaleFactor||this.internal.scaleFactor,a=0,s=0,A=0,u=this;if(!Array.isArray(e)&&"string"!=typeof e){if("number"!=typeof e)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");e=String(e)}var l=t.maxWidth;l>0?"string"==typeof e?e=this.splitTextToSize(e,l):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(u.splitTextToSize(t,l))},[])):e=Array.isArray(e)?e:[e];for(var c=0;c<e.length;c++)a<(A=this.getStringUnitWidth(e[c],{font:i})*n)&&(a=A);return 0!==a&&(s=e.length),{w:a/=o,h:Math.max((s*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/o,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var e=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(e.left,e.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var e;e=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),r.call(this);var i=this.internal.__cell__.lastCell,a=this.internal.__cell__.padding,s=this.internal.__cell__.margins||t,A=this.internal.__cell__.tableHeaderRow,u=this.internal.__cell__.printHeaders;return void 0!==i.lineNumber&&(i.lineNumber===e.lineNumber?(e.x=(i.x||0)+(i.width||0),e.y=i.y||0):i.y+i.height+e.height+s.bottom>this.getPageHeight()?(this.cellAddPage(),e.y=s.top,u&&A&&(this.printHeaderRow(e.lineNumber,!0),e.y+=A[0].height)):e.y=i.y+i.height||e.y),void 0!==e.text[0]&&(this.rect(e.x,e.y,e.width,e.height,!0===n?"FD":void 0),"right"===e.align?this.text(e.text,e.x+e.width-a,e.y+a,{align:"right",baseline:"top"}):"center"===e.align?this.text(e.text,e.x+e.width/2,e.y+a,{align:"center",baseline:"top",maxWidth:e.width-a-a}):this.text(e.text,e.x+a,e.y+a,{align:"left",baseline:"top",maxWidth:e.width-a-a})),this.internal.__cell__.lastCell=e,this};e.table=function(e,n,A,u,l){if(r.call(this),!A)throw new Error("No data for PDF table.");var c,f,h,d,p=[],g=[],m=[],v={},w={},y=[],b=[],B=(l=l||{}).autoSize||!1,x=!1!==l.printHeaders,C=l.css&&void 0!==l.css["font-size"]?16*l.css["font-size"]:l.fontSize||12,F=l.margins||Object.assign({width:this.getPageWidth()},t),E="number"==typeof l.padding?l.padding:3,S=l.headerBackgroundColor||"#c8c8c8",k=l.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=x,this.internal.__cell__.margins=F,this.internal.__cell__.table_font_size=C,this.internal.__cell__.padding=E,this.internal.__cell__.headerBackgroundColor=S,this.internal.__cell__.headerTextColor=k,this.setFontSize(C),null==u)g=p=Object.keys(A[0]),m=p.map(function(){return"left"});else if(Array.isArray(u)&&"object"===(0,uv.A)(u[0]))for(p=u.map(function(e){return e.name}),g=u.map(function(e){return e.prompt||e.name||""}),m=u.map(function(e){return e.align||"left"}),c=0;c<u.length;c+=1)w[u[c].name]=u[c].width*(19.049976/25.4);else Array.isArray(u)&&"string"==typeof u[0]&&(g=p=u,m=p.map(function(){return"left"}));if(B||Array.isArray(u)&&"string"==typeof u[0])for(c=0;c<p.length;c+=1){for(v[d=p[c]]=A.map(function(e){return e[d]}),this.setFont(void 0,"bold"),y.push(this.getTextDimensions(g[c],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),f=v[d],this.setFont(void 0,"normal"),h=0;h<f.length;h+=1)y.push(this.getTextDimensions(f[h],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);w[d]=Math.max.apply(null,y)+E+E,y=[]}if(x){var _={};for(c=0;c<p.length;c+=1)_[p[c]]={},_[p[c]].text=g[c],_[p[c]].align=m[c];var I=s.call(this,_,w);b=p.map(function(t){return new o(e,n,w[t],I,_[t].text,void 0,_[t].align)}),this.setTableHeaderRow(b),this.printHeaderRow(1,!1)}var N=u.reduce(function(e,t){return e[t.name]=t.align,e},{});for(c=0;c<A.length;c+=1){"rowStart"in l&&l.rowStart instanceof Function&&l.rowStart({row:c,data:A[c]},this);var U=s.call(this,A[c],w);for(h=0;h<p.length;h+=1){var L=A[c][p[h]];"cellStart"in l&&l.cellStart instanceof Function&&l.cellStart({row:c,col:h,data:L},this),a.call(this,new o(e,n,w[p[h]],U,L,c+2,N[p[h]]))}}return this.internal.__cell__.table_x=e,this.internal.__cell__.table_y=n,this};var s=function(e,t){var n=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,i=this.internal.scaleFactor;return Object.keys(e).map(function(r){var i=e[r];return this.splitTextToSize(i.hasOwnProperty("text")?i.text:i,t[r]-n-n)},this).map(function(e){return this.getLineHeightFactor()*e.length*r/i+n+n},this).reduce(function(e,t){return Math.max(e,t)},0)};e.setTableHeaderRow=function(e){r.call(this),this.internal.__cell__.tableHeaderRow=e},e.printHeaderRow=function(e,t){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var i;if(n=!0,"function"==typeof this.internal.__cell__.headerFunction){var s=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(s[0],s[1],s[2],s[3],void 0,-1)}this.setFont(void 0,"bold");for(var A=[],u=0;u<this.internal.__cell__.tableHeaderRow.length;u+=1){i=this.internal.__cell__.tableHeaderRow[u].clone(),t&&(i.y=this.internal.__cell__.margins.top||0,A.push(i)),i.lineNumber=e;var l=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,i),this.setTextColor(l)}A.length>0&&this.setTableHeaderRow(A),this.setFont(void 0,"normal"),n=!1}}(Ow.API);var ky={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},_y=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Iy=Sy(_y),Ny=[100,200,300,400,500,600,700,800,900],Uy=Sy(Ny);function Ly(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(e){return ky[e=e||"normal"]?e:"normal"}(e.style),r=function(e){return e?"number"==typeof e?e>=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):"bold"===e?700:400:400}(e.weight),i=function(e){return"number"==typeof Iy[e=e||"normal"]?e:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(" ")}}}function Qy(e,t,n,r){var i;for(i=n;i>=0&&i<t.length;i+=r)if(e[t[i]])return e[t[i]];for(i=n;i>=0&&i<t.length;i-=r)if(e[t[i]])return e[t[i]]}var Dy={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Ry={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Ty(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Py(e){return e.trimLeft()}function Oy(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function My(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===t?null:[t[0],e.substring(t[0].length)]}var Hy,jy,zy,Ky=["times"];!function(e){var t,n,r,i,o,a,s,A,u,l=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||"#000000",this.fillStyle=e.fillStyle||"#000000",this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||"10px sans-serif",this.textBaseline=e.textBaseline||"alphabetic",this.textAlign=e.textAlign||"left",this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||"miter",this.lineCap=e.lineCap||"butt",this.path=e.path||[],this.transform=void 0!==e.transform?e.transform.clone():new A,this.globalCompositeOperation=e.globalCompositeOperation||"normal",this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new a,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new a,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof e.ignoreClearRect||e.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new c(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,a=this.internal.Point,s=this.internal.Rectangle,A=this.internal.Matrix,u=new l}]);var c=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(e){n=Boolean(e)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(e){r=Boolean(e)}});var i=0;Object.defineProperty(this,"posX",{get:function(){return i},set:function(e){isNaN(e)||(i=e)}});var o=0;Object.defineProperty(this,"posY",{get:function(){return o},set:function(e){isNaN(e)||(o=e)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(e){var t;"number"==typeof e?t=[e,e,e,e]:((t=new Array(4))[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),u.margin=t}});var a=!1;Object.defineProperty(this,"autoPaging",{get:function(){return a},set:function(e){a=e}});var s=0;Object.defineProperty(this,"lastBreak",{get:function(){return s},set:function(e){s=e}});var A=[];Object.defineProperty(this,"pageBreaks",{get:function(){return A},set:function(e){A=e}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(e){e instanceof l&&(u=e)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(e){u.path=e}});var c=[];Object.defineProperty(this,"ctxStack",{get:function(){return c},set:function(e){c=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t;t=f(e),this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=0===t.a,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=f(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=0===t.a,this.ctx.strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){-1!==["butt","round","square"].indexOf(e)&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){-1!==["bevel","round","miter"].indexOf(e)&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){-1!==["right","end","center","left","start"].indexOf(e)&&(this.ctx.textAlign=e)}});var h=null;function d(e,t){if(null===h){var n=function(e){var t=[];return Object.keys(e).forEach(function(n){e[n].forEach(function(e){var r=null;switch(e){case"bold":r={family:n,weight:"bold"};break;case"italic":r={family:n,style:"italic"};break;case"bolditalic":r={family:n,weight:"bold",style:"italic"};break;case"":case"normal":r={family:n}}null!==r&&(r.ref={name:n,style:e},t.push(r))})}),t}(e.getFontList());h=function(e){for(var t={},n=0;n<e.length;++n){var r=Ly(e[n]),i=r.family,o=r.stretch,a=r.style,s=r.weight;t[i]=t[i]||{},t[i][o]=t[i][o]||{},t[i][o][a]=t[i][o][a]||{},t[i][o][a][s]=r}return t}(n.concat(t))}return h}var p=null;Object.defineProperty(this,"fontFaces",{get:function(){return p},set:function(e){h=null,p=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,null!==(t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(e))){var n=t[1];t[2];var r=t[3],i=t[4];t[5];var o=t[6],a=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i="px"===a?Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor):"em"===a?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var s=function(e){var t,n,r=[],i=e.trim();if(""===i)return Ky;if(i in Ry)return[Ry[i]];for(;""!==i;){switch(n=null,t=(i=Py(i)).charAt(0)){case'"':case"'":n=Oy(i.substring(1),t);break;default:n=My(i)}if(null===n)return Ky;if(r.push(n[0]),""!==(i=Py(n[1]))&&","!==i.charAt(0))return Ky;i=i.replace(/^,/,"")}return r}(o);if(this.fontFaces){var A=function(e,t,n){for(var r=(n=n||{}).defaultFontFamily||"times",i=Object.assign({},Dy,n.genericFontFamilies||{}),o=null,a=null,s=0;s<t.length;++s)if(i[(o=Ly(t[s])).family]&&(o.family=i[o.family]),e.hasOwnProperty(o.family)){a=e[o.family];break}if(!(a=a||e[r]))throw new Error("Could not find a font-family for the rule '"+Ty(o)+"' and default family '"+r+"'.");if(a=function(e,t){if(t[e])return t[e];var n=Iy[e],r=n<=Iy.normal?-1:1,i=Qy(t,_y,n,r);if(!i)throw new Error("Could not find a matching font-stretch value for "+e);return i}(o.stretch,a),a=function(e,t){if(t[e])return t[e];for(var n=ky[e],r=0;r<n.length;++r)if(t[n[r]])return t[n[r]];throw new Error("Could not find a matching font-style for "+e)}(o.style,a),!(a=function(e,t){if(t[e])return t[e];if(400===e&&t[500])return t[500];if(500===e&&t[400])return t[400];var n=Uy[e],r=Qy(t,Ny,n,e<400?-1:1);if(!r)throw new Error("Could not find a matching font-weight for value "+e);return r}(o.weight,a)))throw new Error("Failed to resolve a font for the rule '"+Ty(o)+"'.");return a}(d(this.pdf,this.fontFaces),s.map(function(e){return{family:e,stretch:"normal",weight:r,style:n}}));this.pdf.setFont(A.ref.name,A.ref.style)}else{var u="";("bold"===r||parseInt(r,10)>=700||"bold"===n)&&(u="bold"),"italic"===n&&(u+="italic"),0===u.length&&(u="normal");for(var l="",c={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"},f=0;f<s.length;f++){if(void 0!==this.pdf.internal.getFont(s[f],u,{noFallback:!0,disableWarning:!0})){l=s[f];break}if("bolditalic"===u&&void 0!==this.pdf.internal.getFont(s[f],"bold",{noFallback:!0,disableWarning:!0}))l=s[f],u="bold";else if(void 0!==this.pdf.internal.getFont(s[f],"normal",{noFallback:!0,disableWarning:!0})){l=s[f],u="normal";break}}if(""===l)for(var h=0;h<s.length;h++)if(c[s[h]]){l=c[s[h]];break}l=""===l?"Times":l,this.pdf.setFont(l,u)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(e){this.ctx.globalCompositeOperation=e}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(e){this.ctx.globalAlpha=e}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(e){this.ctx.lineDashOffset=e,T.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(e){this.ctx.lineDash=e,T.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(e){this.ctx.ignoreClearRect=Boolean(e)}})};c.prototype.setLineDash=function(e){this.lineDash=e},c.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},c.prototype.fill=function(){y.call(this,"fill",!1)},c.prototype.stroke=function(){y.call(this,"stroke",!1)},c.prototype.beginPath=function(){this.path=[{type:"begin"}]},c.prototype.moveTo=function(e,t){if(isNaN(e)||isNaN(t))throw Aw.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new a(e,t));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new a(e,t)},c.prototype.closePath=function(){var e=new a(0,0),t=0;for(t=this.path.length-1;-1!==t;t--)if("begin"===this.path[t].type&&"object"===(0,uv.A)(this.path[t+1])&&"number"==typeof this.path[t+1].x){e=new a(this.path[t+1].x,this.path[t+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(e.x,e.y)},c.prototype.lineTo=function(e,t){if(isNaN(e)||isNaN(t))throw Aw.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new a(e,t));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new a(n.x,n.y)},c.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),y.call(this,null,!0)},c.prototype.quadraticCurveTo=function(e,t,n,r){if(isNaN(n)||isNaN(r)||isNaN(e)||isNaN(t))throw Aw.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new a(n,r)),o=this.ctx.transform.applyToPoint(new a(e,t));this.path.push({type:"qct",x1:o.x,y1:o.y,x:i.x,y:i.y}),this.ctx.lastPoint=new a(i.x,i.y)},c.prototype.bezierCurveTo=function(e,t,n,r,i,o){if(isNaN(i)||isNaN(o)||isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Aw.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var s=this.ctx.transform.applyToPoint(new a(i,o)),A=this.ctx.transform.applyToPoint(new a(e,t)),u=this.ctx.transform.applyToPoint(new a(n,r));this.path.push({type:"bct",x1:A.x,y1:A.y,x2:u.x,y2:u.y,x:s.x,y:s.y}),this.ctx.lastPoint=new a(s.x,s.y)},c.prototype.arc=function(e,t,n,r,i,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i))throw Aw.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(o=Boolean(o),!this.ctx.transform.isIdentity){var s=this.ctx.transform.applyToPoint(new a(e,t));e=s.x,t=s.y;var A=this.ctx.transform.applyToPoint(new a(0,n)),u=this.ctx.transform.applyToPoint(new a(0,0));n=Math.sqrt(Math.pow(A.x-u.x,2)+Math.pow(A.y-u.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:e,y:t,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},c.prototype.arcTo=function(e,t,n,r,i){throw new Error("arcTo not implemented.")},c.prototype.rect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Aw.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.lineTo(e+n,t),this.lineTo(e,t)},c.prototype.fillRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Aw.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(e,t,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},c.prototype.strokeRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Aw.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");d.call(this)||(this.beginPath(),this.rect(e,t,n,r),this.stroke())},c.prototype.clearRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Aw.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(e,t,n,r))},c.prototype.save=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(t),e){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new l(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},c.prototype.restore=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(t),e&&0!==this.ctxStack.length&&(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)},c.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var f=function(e){var t,n,r,i;if(!0===e.isCanvasGradient&&(e=e.getColor()),!e)return{r:0,g:0,b:0,a:0,style:e};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))t=0,n=0,r=0,i=0;else{var o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(null!==o)t=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=1;else if(null!==(o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))t=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseFloat(o[4]);else{if(i=1,"string"==typeof e&&"#"!==e.charAt(0)){var a=new pw(e);e=a.ok?a.toHex():"#000000"}4===e.length?(t=e.substring(1,2),t+=t,n=e.substring(2,3),n+=n,r=e.substring(3,4),r+=r):(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7)),t=parseInt(t,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:t,g:n,b:r,a:i,style:e}},h=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},d=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};c.prototype.fillText=function(e,t,n,r){if(isNaN(t)||isNaN(n)||"string"!=typeof e)throw Aw.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!h.call(this)){var i=Q(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;k.call(this,{text:e,x:t,y:n,scale:o,angle:i,align:this.textAlign,maxWidth:r})}},c.prototype.strokeText=function(e,t,n,r){if(isNaN(t)||isNaN(n)||"string"!=typeof e)throw Aw.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!d.call(this)){r=isNaN(r)?void 0:r;var i=Q(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;k.call(this,{text:e,x:t,y:n,scale:o,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},c.prototype.measureText=function(e){if("string"!=typeof e)throw Aw.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var t=this.pdf,n=this.pdf.internal.scaleFactor,r=t.internal.getFontSize(),i=t.getStringUnitWidth(e)*r/t.internal.scaleFactor;return new function(e){var t=(e=e||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return t}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},c.prototype.scale=function(e,t){if(isNaN(e)||isNaN(t))throw Aw.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new A(e,0,0,t,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},c.prototype.rotate=function(e){if(isNaN(e))throw Aw.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var t=new A(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);this.ctx.transform=this.ctx.transform.multiply(t)},c.prototype.translate=function(e,t){if(isNaN(e)||isNaN(t))throw Aw.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new A(1,0,0,1,e,t);this.ctx.transform=this.ctx.transform.multiply(n)},c.prototype.transform=function(e,t,n,r,i,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o))throw Aw.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var a=new A(e,t,n,r,i,o);this.ctx.transform=this.ctx.transform.multiply(a)},c.prototype.setTransform=function(e,t,n,r,i,o){e=isNaN(e)?1:e,t=isNaN(t)?0:t,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,o=isNaN(o)?0:o,this.ctx.transform=new A(e,t,n,r,i,o)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};c.prototype.drawImage=function(e,t,n,r,i,o,a,u,l){var c=this.pdf.getImageProperties(e),f=1,h=1,d=1,m=1;void 0!==r&&void 0!==u&&(d=u/r,m=l/i,f=c.width/r*u/r,h=c.height/i*l/i),void 0===o&&(o=t,a=n,t=0,n=0),void 0!==r&&void 0===u&&(u=r,l=i),void 0===r&&void 0===u&&(u=c.width,l=c.height);for(var y,B=this.ctx.transform.decompose(),x=Q(B.rotate.shx),C=new A,F=(C=(C=(C=C.multiply(B.translate)).multiply(B.skew)).multiply(B.scale)).applyToRectangle(new s(o-t*d,a-n*m,r*f,i*h)),E=g.call(this,F),S=[],k=0;k<E.length;k+=1)-1===S.indexOf(E[k])&&S.push(E[k]);if(w(S),this.autoPaging)for(var _=S[0],I=S[S.length-1],N=_;N<I+1;N++){this.pdf.setPage(N);var U=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],L=1===N?this.posY+this.margin[0]:this.margin[0],D=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],R=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],T=1===N?0:D+(N-2)*R;if(0!==this.ctx.clip_path.length){var P=this.path;y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(y,this.posX+this.margin[3],-T+L+this.ctx.prevPageLastElemOffset),b.call(this,"fill",!0),this.path=P}var O=JSON.parse(JSON.stringify(F));O=v([O],this.posX+this.margin[3],-T+L+this.ctx.prevPageLastElemOffset)[0];var M=(N>_||N<I)&&p.call(this);M&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],U,R,null).clip().discardPath()),this.pdf.addImage(e,"JPEG",O.x,O.y,O.w,O.h,null,null,x),M&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(e,"JPEG",F.x,F.y,F.w,F.h,null,null,x)};var g=function(e,t,n){var r=[];t=t||this.pdf.internal.pageSize.width,n=n||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var i=this.posY+this.ctx.prevPageLastElemOffset;switch(e.type){default:case"mt":case"lt":r.push(Math.floor((e.y+i)/n)+1);break;case"arc":r.push(Math.floor((e.y+i-e.radius)/n)+1),r.push(Math.floor((e.y+i+e.radius)/n)+1);break;case"qct":var o=D(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x,e.y);r.push(Math.floor((o.y+i)/n)+1),r.push(Math.floor((o.y+o.h+i)/n)+1);break;case"bct":var a=R(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x2,e.y2,e.x,e.y);r.push(Math.floor((a.y+i)/n)+1),r.push(Math.floor((a.y+a.h+i)/n)+1);break;case"rect":r.push(Math.floor((e.y+i)/n)+1),r.push(Math.floor((e.y+e.h+i)/n)+1)}for(var s=0;s<r.length;s+=1)for(;this.pdf.internal.getNumberOfPages()<r[s];)m.call(this);return r},m=function(){var e=this.fillStyle,t=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,o=this.lineJoin;this.pdf.addPage(),this.fillStyle=e,this.strokeStyle=t,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=o},v=function(e,t,n){for(var r=0;r<e.length;r++)switch(e[r].type){case"bct":e[r].x2+=t,e[r].y2+=n;case"qct":e[r].x1+=t,e[r].y1+=n;default:e[r].x+=t,e[r].y+=n}return e},w=function(e){return e.sort(function(e,t){return e-t})},y=function(e,t){for(var n,r,i=this.fillStyle,o=this.strokeStyle,a=this.lineCap,s=this.lineWidth,A=Math.abs(s*this.ctx.transform.scaleX),u=this.lineJoin,l=JSON.parse(JSON.stringify(this.path)),c=JSON.parse(JSON.stringify(this.path)),f=[],h=0;h<c.length;h++)if(void 0!==c[h].x)for(var d=g.call(this,c[h]),y=0;y<d.length;y+=1)-1===f.indexOf(d[y])&&f.push(d[y]);for(var B=0;B<f.length;B++)for(;this.pdf.internal.getNumberOfPages()<f[B];)m.call(this);if(w(f),this.autoPaging)for(var x=f[0],C=f[f.length-1],F=x;F<C+1;F++){this.pdf.setPage(F),this.fillStyle=i,this.strokeStyle=o,this.lineCap=a,this.lineWidth=A,this.lineJoin=u;var E=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],S=1===F?this.posY+this.margin[0]:this.margin[0],k=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],_=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],I=1===F?0:k+(F-2)*_;if(0!==this.ctx.clip_path.length){var N=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(n,this.posX+this.margin[3],-I+S+this.ctx.prevPageLastElemOffset),b.call(this,e,!0),this.path=N}if(r=JSON.parse(JSON.stringify(l)),this.path=v(r,this.posX+this.margin[3],-I+S+this.ctx.prevPageLastElemOffset),!1===t||0===F){var U=(F>x||F<C)&&p.call(this);U&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],E,_,null).clip().discardPath()),b.call(this,e,t),U&&this.pdf.restoreGraphicsState()}this.lineWidth=s}else this.lineWidth=A,b.call(this,e,t),this.lineWidth=s;this.path=l},b=function(e,t){if(("stroke"!==e||t||!d.call(this))&&("stroke"===e||t||!h.call(this))){for(var n,r,i=[],o=this.path,a=0;a<o.length;a++){var s=o[a];switch(s.type){case"begin":i.push({begin:!0});break;case"close":i.push({close:!0});break;case"mt":i.push({start:s,deltas:[],abs:[]});break;case"lt":var A=i.length;if(o[a-1]&&!isNaN(o[a-1].x)&&(n=[s.x-o[a-1].x,s.y-o[a-1].y],A>0))for(;A>=0;A--)if(!0!==i[A-1].close&&!0!==i[A-1].begin){i[A-1].deltas.push(n),i[A-1].abs.push(s);break}break;case"bct":n=[s.x1-o[a-1].x,s.y1-o[a-1].y,s.x2-o[a-1].x,s.y2-o[a-1].y,s.x-o[a-1].x,s.y-o[a-1].y],i[i.length-1].deltas.push(n);break;case"qct":var u=o[a-1].x+2/3*(s.x1-o[a-1].x),l=o[a-1].y+2/3*(s.y1-o[a-1].y),c=s.x+2/3*(s.x1-s.x),f=s.y+2/3*(s.y1-s.y),p=s.x,g=s.y;n=[u-o[a-1].x,l-o[a-1].y,c-o[a-1].x,f-o[a-1].y,p-o[a-1].x,g-o[a-1].y],i[i.length-1].deltas.push(n);break;case"arc":i.push({deltas:[],abs:[],arc:!0}),Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(s)}}r=t?null:"stroke"===e?"stroke":"fill";for(var m=!1,v=0;v<i.length;v++)if(i[v].arc)for(var w=i[v].abs,y=0;y<w.length;y++){var b=w[y];"arc"===b.type?C.call(this,b.x,b.y,b.radius,b.startAngle,b.endAngle,b.counterclockwise,void 0,t,!m):_.call(this,b.x,b.y),m=!0}else if(!0===i[v].close)this.pdf.internal.out("h"),m=!1;else if(!0!==i[v].begin){var B=i[v].start.x,x=i[v].start.y;I.call(this,i[v].deltas,B,x),m=!0}r&&F.call(this,r),t&&E.call(this)}},B=function(e){var t=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=t*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return e-n;case"top":return e+t-n;case"hanging":return e+t-2*n;case"middle":return e+t/2-n;default:return e}},x=function(e){return e+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};c.prototype.createLinearGradient=function(){var e=function(){};return e.colorStops=[],e.addColorStop=function(e,t){this.colorStops.push([e,t])},e.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},e.isCanvasGradient=!0,e},c.prototype.createPattern=function(){return this.createLinearGradient()},c.prototype.createRadialGradient=function(){return this.createLinearGradient()};var C=function(e,t,n,r,i,o,a,s,A){for(var u=U.call(this,n,r,i,o),l=0;l<u.length;l++){var c=u[l];0===l&&(A?S.call(this,c.x1+e,c.y1+t):_.call(this,c.x1+e,c.y1+t)),N.call(this,e,t,c.x2,c.y2,c.x3,c.y3,c.x4,c.y4)}s?E.call(this):F.call(this,a)},F=function(e){switch(e){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},E=function(){this.pdf.clip(),this.pdf.discardPath()},S=function(e,t){this.pdf.internal.out(n(e)+" "+r(t)+" m")},k=function(e){var t;switch(e.align){case"right":case"end":t="right";break;case"center":t="center";break;default:t="left"}var n=this.pdf.getTextDimensions(e.text),r=B.call(this,e.y),i=x.call(this,r)-n.h,o=this.ctx.transform.applyToPoint(new a(e.x,r)),u=this.ctx.transform.decompose(),l=new A;l=(l=(l=l.multiply(u.translate)).multiply(u.skew)).multiply(u.scale);for(var c,f,h,d=this.ctx.transform.applyToRectangle(new s(e.x,r,n.w,n.h)),m=l.applyToRectangle(new s(e.x,i,n.w,n.h)),y=g.call(this,m),C=[],F=0;F<y.length;F+=1)-1===C.indexOf(y[F])&&C.push(y[F]);if(w(C),this.autoPaging)for(var E=C[0],S=C[C.length-1],k=E;k<S+1;k++){this.pdf.setPage(k);var _=1===k?this.posY+this.margin[0]:this.margin[0],I=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],N=this.pdf.internal.pageSize.height-this.margin[2],U=N-this.margin[0],L=this.pdf.internal.pageSize.width-this.margin[1],Q=L-this.margin[3],D=1===k?0:I+(k-2)*U;if(0!==this.ctx.clip_path.length){var R=this.path;c=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(c,this.posX+this.margin[3],-1*D+_),b.call(this,"fill",!0),this.path=R}var T=v([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-D+_+this.ctx.prevPageLastElemOffset)[0];e.scale>=.01&&(f=this.pdf.internal.getFontSize(),this.pdf.setFontSize(f*e.scale),h=this.lineWidth,this.lineWidth=h*e.scale);var P="text"!==this.autoPaging;if(P||T.y+T.h<=N){if(P||T.y>=_&&T.x<=L){var O=P?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||L-T.x)[0],M=v([JSON.parse(JSON.stringify(d))],this.posX+this.margin[3],-D+_+this.ctx.prevPageLastElemOffset)[0],H=P&&(k>E||k<S)&&p.call(this);H&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Q,U,null).clip().discardPath()),this.pdf.text(O,M.x,M.y,{angle:e.angle,align:t,renderingMode:e.renderingMode}),H&&this.pdf.restoreGraphicsState()}}else T.y<N&&(this.ctx.prevPageLastElemOffset+=N-T.y);e.scale>=.01&&(this.pdf.setFontSize(f),this.lineWidth=h)}else e.scale>=.01&&(f=this.pdf.internal.getFontSize(),this.pdf.setFontSize(f*e.scale),h=this.lineWidth,this.lineWidth=h*e.scale),this.pdf.text(e.text,o.x+this.posX,o.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(f),this.lineWidth=h)},_=function(e,t,i,o){i=i||0,o=o||0,this.pdf.internal.out(n(e+i)+" "+r(t+o)+" l")},I=function(e,t,n){return this.pdf.lines(e,t,n,null,null)},N=function(e,n,r,a,s,A,u,l){this.pdf.internal.out([t(i(r+e)),t(o(a+n)),t(i(s+e)),t(o(A+n)),t(i(u+e)),t(o(l+n)),"c"].join(" "))},U=function(e,t,n,r){for(var i=2*Math.PI,o=Math.PI/2;t>n;)t-=i;var a=Math.abs(n-t);a<i&&r&&(a=i-a);for(var s=[],A=r?-1:1,u=t;a>1e-5;){var l=u+A*Math.min(a,o);s.push(L.call(this,e,u,l)),a-=Math.abs(l-u),u=l}return s},L=function(e,t,n){var r=(n-t)/2,i=e*Math.cos(r),o=e*Math.sin(r),a=i,s=-o,A=a*a+s*s,u=A+a*i+s*o,l=4/3*(Math.sqrt(2*A*u)-u)/(a*o-s*i),c=a-l*s,f=s+l*a,h=c,d=-f,p=r+t,g=Math.cos(p),m=Math.sin(p);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:c*g-f*m,y2:c*m+f*g,x3:h*g-d*m,y3:h*m+d*g,x4:e*Math.cos(n),y4:e*Math.sin(n)}},Q=function(e){return 180*e/Math.PI},D=function(e,t,n,r,i,o){var a=e+.5*(n-e),A=t+.5*(r-t),u=i+.5*(n-i),l=o+.5*(r-o),c=Math.min(e,i,a,u),f=Math.max(e,i,a,u),h=Math.min(t,o,A,l),d=Math.max(t,o,A,l);return new s(c,h,f-c,d-h)},R=function(e,t,n,r,i,o,a,A){var u,l,c,f,h,d,p,g,m,v,w,y,b,B,x=n-e,C=r-t,F=i-n,E=o-r,S=a-i,k=A-o;for(l=0;l<41;l++)m=(p=(c=e+(u=l/40)*x)+u*((h=n+u*F)-c))+u*(h+u*(i+u*S-h)-p),v=(g=(f=t+u*C)+u*((d=r+u*E)-f))+u*(d+u*(o+u*k-d)-g),0==l?(w=m,y=v,b=m,B=v):(w=Math.min(w,m),y=Math.min(y,v),b=Math.max(b,m),B=Math.max(B,v));return new s(Math.round(w),Math.round(y),Math.round(b-w),Math.round(B-y))},T=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,n=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==n&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=n)}}}(Ow.API),function(e){var t=function(e){var t,n,r,i,o,a,s,A,u,l;for(/[^\x00-\xFF]/.test(e),n=[],r=0,i=(e+=t="\0\0\0\0".slice(e.length%4||4)).length;i>r;r+=4)0!==(o=(e.charCodeAt(r)<<24)+(e.charCodeAt(r+1)<<16)+(e.charCodeAt(r+2)<<8)+e.charCodeAt(r+3))?(a=(o=((o=((o=((o=(o-(l=o%85))/85)-(u=o%85))/85)-(A=o%85))/85)-(s=o%85))/85)%85,n.push(a+33,s+33,A+33,u+33,l+33)):n.push(122);return function(e,t){for(var n=t;n>0;n--)e.pop()}(n,t.length),String.fromCharCode.apply(String,n)+"~>"},n=function(e){var t,n,r,i,o,a=String,s="length",A=255,u="charCodeAt",l="slice",c="replace";for(e[l](-2),e=e[l](0,-2)[c](/\s/g,"")[c]("z","!!!!!"),r=[],i=0,o=(e+=t="uuuuu"[l](e[s]%5||5))[s];o>i;i+=5)n=52200625*(e[u](i)-33)+614125*(e[u](i+1)-33)+7225*(e[u](i+2)-33)+85*(e[u](i+3)-33)+(e[u](i+4)-33),r.push(A&n>>24,A&n>>16,A&n>>8,A&n);return function(e,t){for(var n=t;n>0;n--)e.pop()}(r,t[s]),a.fromCharCode.apply(a,r)},r=function(e){var t=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(e=e.replace(/\s/g,"")).indexOf(">")&&(e=e.substr(0,e.indexOf(">"))),e.length%2&&(e+="0"),!1===t.test(e))return"";for(var n="",r=0;r<e.length;r+=2)n+=String.fromCharCode("0x"+(e[r]+e[r+1]));return n},i=function(e){for(var t=new Uint8Array(e.length),n=e.length;n--;)t[n]=e.charCodeAt(n);return(t=rw(t)).reduce(function(e,t){return e+String.fromCharCode(t)},"")};e.processDataByFilters=function(e,o){var a=0,s=e||"",A=[];for("string"==typeof(o=o||[])&&(o=[o]),a=0;a<o.length;a+=1)switch(o[a]){case"ASCII85Decode":case"/ASCII85Decode":s=n(s),A.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":s=t(s),A.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":s=r(s),A.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":s=s.split("").map(function(e){return("0"+e.charCodeAt().toString(16)).slice(-2)}).join("")+">",A.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":s=i(s),A.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[a]+'" is not implemented')}return{data:s,reverseChain:A.reverse().join(" ")}}}(Ow.API),function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,i=0,o=function(e){var t=e.length,n=[],r=String.fromCharCode;for(i=0;i<t;i+=1)n.push(r(255&e.charCodeAt(i)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(o(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return o(r.responseText)}(e,t,n)}catch(e){}return r}(e,t,n)},e.loadImageFile=e.loadFile}(Ow.API),function(e){function t(){return(aw.html2canvas?Promise.resolve(aw.html2canvas):Promise.resolve().then(n.t.bind(n,5239,23))).catch(function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))}).then(function(e){return e.default?e.default:e})}function r(){return(aw.DOMPurify?Promise.resolve(aw.DOMPurify):n.e(977).then(n.bind(n,7977))).catch(function(e){return Promise.reject(new Error("Could not load dompurify: "+e))}).then(function(e){return e.default?e.default:e})}var i=function(e){var t=(0,uv.A)(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},o=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},a=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(e,t){return e.__proto__=t||a.prototype,e},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(e,t){return this.then(function(){switch(t=t||function(e){switch(i(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(r).then(function(t){return this.set({src:o("div",{innerHTML:e,dompurify:t})})});case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}})},a.prototype.to=function(e){switch(e){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 e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||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},t=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),i=t.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(e(i,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=o("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=o("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(o("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 e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)}).then(function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,i=Object.assign({async:!0,allowTaint:!0,scale:r,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 i.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var o=0;o<n.length;++o){var a=n[o],s=a.src.find(function(e){return"truetype"===e.format});s&&t.addFont(s.url,a.ref.name,a.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,t.context2d.save(!0),e(this.prop.container,i)}).then(function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e})},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(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},a.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(e,t)})},a.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(e){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 "'+e+'" is not supported.'}})},a.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}: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(e){if("object"!==i(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in a.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},a.prototype.get=function(e,t){return this.then(function(){var n=e in a.template.prop?this.prop[e]:this.opt[e];return t?t(n):n})},a.prototype.setMargin=function(e){return this.then(function(){switch(i(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e}).then(this.setPageSize)},a.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then(function(){(e=e||Ow.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e})},a.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},a.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(e){return n.updateProgress(1),e})})},a.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then,e&&(e=e.bind(this)),t&&(t=t.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:a.convert(Object.assign({},this),Promise.prototype),i=n.call(r,e,t);return a.convert(i,this.__proto__)},a.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},a.prototype.thenList=function(e){var t=this;return e.forEach(function(e){t=t.thenCore(e)}),t},a.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return a.convert(t,this)},a.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},a.prototype.error=function(e){return this.then(function(){throw new Error(e)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Ow.getPageSize=function(e,t,n){if("object"===(0,uv.A)(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var i,o=(""+n).toLowerCase(),a={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(t){case"pt":i=1;break;case"mm":i=72/25.4;break;case"cm":i=72/2.54;break;case"in":i=72;break;case"px":i=.75;break;case"pc":case"em":i=12;break;case"ex":i=6;break;default:throw"Invalid unit: "+t}var s,A=0,u=0;if(a.hasOwnProperty(o))A=a[o][1]/i,u=a[o][0]/i;else try{A=n[1],u=n[0]}catch(v){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",u>A&&(s=u,u=A,A=s);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",A>u&&(s=u,u=A,A=s)}return{width:u,height:A,unit:t,k:i,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(Ly):null;var n=new a(t);return t.worker?n:n.from(e).doCallback()}}(Ow.API),Ow.API.addJS=function(e){return zy=e,this.internal.events.subscribe("postPutResources",function(){Hy=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Hy+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),jy=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+zy+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==Hy&&void 0!==jy&&this.internal.out("/Names <</JavaScript "+Hy+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var e=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var r=e.outline.render().split(/\r\n/),i=0;i<r.length;i++){var o=r[i],a=n.exec(o);if(null!=a){var s=a[1];e.internal.newObjectDeferredBegin(s,!1)}e.internal.write(o)}if(this.outline.createNamedDestinations){var A=this.internal.pages.length,u=[];for(i=0;i<A;i++){var l=e.internal.newObject();u.push(l);var c=e.internal.getPageInfo(i+1);e.internal.write("<< /D["+c.objId+" 0 R /XYZ null null null]>> endobj")}var f=e.internal.newObject();for(e.internal.write("<< /Names [ "),i=0;i<u.length;i++)e.internal.write("(page_"+(i+1)+")"+u[i]+" 0 R");e.internal.write(" ] >>","endobj"),t=e.internal.newObject(),e.internal.write("<< /Dests "+f+" 0 R"),e.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var e=this;e.outline={createNamedDestinations:!1,root:{children:[]}},e.outline.add=function(e,t,n){var r={title:t,options:n,children:[]};return null==e&&(e=this.root),e.children.push(r),r},e.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=e,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},e.outline.genIds_r=function(t){t.id=e.internal.newObjectDeferred();for(var n=0;n<t.children.length;n++)this.genIds_r(t.children[n])},e.outline.renderRoot=function(e){this.objStart(e),this.line("/Type /Outlines"),e.children.length>0&&(this.line("/First "+this.makeRef(e.children[0])),this.line("/Last "+this.makeRef(e.children[e.children.length-1]))),this.line("/Count "+this.count_r({count:0},e)),this.objEnd()},e.outline.renderItems=function(t){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,r=0;r<t.children.length;r++){var i=t.children[r];this.objStart(i),this.line("/Title "+this.makeString(i.title)),this.line("/Parent "+this.makeRef(t)),r>0&&this.line("/Prev "+this.makeRef(t.children[r-1])),r<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[r+1])),i.children.length>0&&(this.line("/First "+this.makeRef(i.children[0])),this.line("/Last "+this.makeRef(i.children[i.children.length-1])));var o=this.count=this.count_r({count:0},i);if(o>0&&this.line("/Count "+o),i.options&&i.options.pageNumber){var a=e.internal.getPageInfo(i.options.pageNumber);this.line("/Dest ["+a.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var s=0;s<t.children.length;s++)this.renderItems(t.children[s])},e.outline.line=function(e){this.ctx.val+=e+"\r\n"},e.outline.makeRef=function(e){return e.id+" 0 R"},e.outline.makeString=function(t){return"("+e.internal.pdfEscape(t)+")"},e.outline.objStart=function(e){this.ctx.val+="\r\n"+e.id+" 0 obj\r\n<<\r\n"},e.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},e.outline.count_r=function(e,t){for(var n=0;n<t.children.length;n++)e.count++,this.count_r(e,t.children[n]);return e.count}}])}(Ow.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(e,n,r,i,o,a){var s,A=this.decode.DCT_DECODE,u=null;if("string"==typeof e||this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e)){switch(e=o||e,e=this.__addimage__.isArrayBuffer(e)?new Uint8Array(e):e,(s=function(e){for(var n,r=256*e.charCodeAt(4)+e.charCodeAt(5),i=e.length,o={width:0,height:0,numcomponents:1},a=4;a<i;a+=2){if(a+=r,-1!==t.indexOf(e.charCodeAt(a+1))){n=256*e.charCodeAt(a+5)+e.charCodeAt(a+6),o={width:256*e.charCodeAt(a+7)+e.charCodeAt(a+8),height:n,numcomponents:e.charCodeAt(a+9)};break}r=256*e.charCodeAt(a+2)+e.charCodeAt(a+3)}return o}(e=this.__addimage__.isArrayBufferView(e)?this.__addimage__.arrayBufferToBinaryString(e):e)).numcomponents){case 1:a=this.color_spaces.DEVICE_GRAY;break;case 4:a=this.color_spaces.DEVICE_CMYK;break;case 3:a=this.color_spaces.DEVICE_RGB}u={data:e,width:s.width,height:s.height,colorSpace:a,bitsPerComponent:8,filter:A,index:n,alias:r}}return u}}(Ow.API);var Wy,Vy,Gy,qy,Xy,Yy=function(){var e,t,n;function r(e){var t,n,r,i,o,a,s,A,u,l,c,f,h,d;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},a=null;;){switch(t=this.readUInt32(),u=function(){var e,t;for(t=[],e=0;e<4;++e)t.push(String.fromCharCode(this.data[this.pos++]));return t}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":a&&this.animation.frames.push(a),this.pos+=4,a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},o=this.readUInt16(),i=this.readUInt16()||100,a.delay=1e3*o/i,a.disposeOp=this.data[this.pos++],a.blendOp=this.data[this.pos++],a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===u&&(this.pos+=4,t-=4),e=(null!=a?a.data:void 0)||this.imgData,f=0;0<=t?f<t:f>t;0<=t?++f:--f)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(t),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if((l=r-this.transparency.indexed.length)>0)for(h=0;0<=l?h<l:h>l;0<=l?++h:--h)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":s=(c=this.read(t)).indexOf(0),A=String.fromCharCode.apply(String,c.slice(0,s)),this.text[A]=String.fromCharCode.apply(String,c.slice(s+1));break;case"IEND":return a&&this.animation.frames.push(a),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(e){var t,n;for(n=[],t=0;0<=e?t<e:t>e;0<=e?++t:--t)n.push(this.data[this.pos++]);return n},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(e){var t=this.pixelBitlength/8,n=new Uint8Array(this.width*this.height*t),r=0,i=this;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);function o(o,a,s,A){var u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E,S,k,_,I=Math.ceil((i.width-o)/s),N=Math.ceil((i.height-a)/A),U=i.width==I&&i.height==N;for(B=t*I,y=U?n:new Uint8Array(B*N),d=e.length,b=0,l=0;b<N&&r<d;){switch(e[r++]){case 0:for(f=F=0;F<B;f=F+=1)y[l++]=e[r++];break;case 1:for(f=E=0;E<B;f=E+=1)u=e[r++],h=f<t?0:y[l-t],y[l++]=(u+h)%256;break;case 2:for(f=S=0;S<B;f=S+=1)u=e[r++],c=(f-f%t)/t,x=b&&y[(b-1)*B+c*t+f%t],y[l++]=(x+u)%256;break;case 3:for(f=k=0;k<B;f=k+=1)u=e[r++],c=(f-f%t)/t,h=f<t?0:y[l-t],x=b&&y[(b-1)*B+c*t+f%t],y[l++]=(u+Math.floor((h+x)/2))%256;break;case 4:for(f=_=0;_<B;f=_+=1)u=e[r++],c=(f-f%t)/t,h=f<t?0:y[l-t],0===b?x=C=0:(x=y[(b-1)*B+c*t+f%t],C=c&&y[(b-1)*B+(c-1)*t+f%t]),p=h+x-C,g=Math.abs(p-h),v=Math.abs(p-x),w=Math.abs(p-C),m=g<=v&&g<=w?h:v<=w?x:C,y[l++]=(u+m)%256;break;default:throw new Error("Invalid filter algorithm: "+e[r-1])}if(!U){var L=((a+b*A)*i.width+o)*t,Q=b*B;for(f=0;f<I;f+=1){for(var D=0;D<t;D+=1)n[L++]=y[Q++];L+=(s-1)*t}}b++}}return e=iw(e),1==i.interlaceMethod?(o(0,0,8,8),o(4,0,8,8),o(0,4,4,8),o(2,0,4,4),o(0,2,2,4),o(1,0,2,2),o(0,1,1,2)):o(0,0,1,1),n},r.prototype.decodePalette=function(){var e,t,n,r,i,o,a,s,A;for(n=this.palette,o=this.transparency.indexed||[],i=new Uint8Array((o.length||0)+n.length),r=0,e=0,t=a=0,s=n.length;a<s;t=a+=3)i[r++]=n[t],i[r++]=n[t+1],i[r++]=n[t+2],i[r++]=null!=(A=o[e++])?A:255;return i},r.prototype.copyToImageData=function(e,t){var n,r,i,o,a,s,A,u,l,c,f;if(r=this.colors,l=null,n=this.hasAlphaChannel,this.palette.length&&(l=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),r=4,n=!0),u=(i=e.data||e).length,a=l||t,o=s=0,1===r)for(;o<u;)A=l?4*t[o/4]:s,c=a[A++],i[o++]=c,i[o++]=c,i[o++]=c,i[o++]=n?a[A++]:255,s=A;else for(;o<u;)A=l?4*t[o/4]:s,i[o++]=a[A++],i[o++]=a[A++],i[o++]=a[A++],i[o++]=n?a[A++]:255,s=A},r.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e};var i=function(){if("[object Window]"===Object.prototype.toString.call(aw)){try{t=aw.document.createElement("canvas"),n=t.getContext("2d")}catch(e){return!1}return!0}return!1};return i(),e=function(e){var r;if(!0===i())return n.width=e.width,n.height=e.height,n.clearRect(0,0,e.width,e.height),n.putImageData(e,0,0),(r=new Image).src=t.toDataURL(),r;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(t){var n,r,i,o,a,s,A,u;if(this.animation){for(u=[],r=a=0,s=(A=this.animation.frames).length;a<s;r=++a)n=A[r],i=t.createImageData(n.width,n.height),o=this.decodePixels(new Uint8Array(n.data)),this.copyToImageData(i,o),n.imageData=i,u.push(n.image=e(i));return u}},r.prototype.renderFrame=function(e,t){var n,r,i;return n=(r=this.animation.frames)[t],i=r[t-1],0===t&&e.clearRect(0,0,this.width,this.height),1===(null!=i?i.disposeOp:void 0)?e.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&e.putImageData(i.imageData,i.xOffset,i.yOffset),0===n.blendOp&&e.clearRect(n.xOffset,n.yOffset,n.width,n.height),e.drawImage(n.image,n.xOffset,n.yOffset)},r.prototype.animate=function(e){var t,n,r,i,o,a,s=this;return n=0,a=this.animation,i=a.numFrames,r=a.frames,o=a.numPlays,(t=function(){var a,A;if(a=n++%i,A=r[a],s.renderFrame(e,a),i>1&&n/i<o)return s.animation._timeout=setTimeout(t,A.delay)})()},r.prototype.stopAnimation=function(){var e;return clearTimeout(null!=(e=this.animation)?e._timeout:void 0)},r.prototype.render=function(e){var t,n;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(n=t.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),t.putImageData(n,0,0))},r}();function Jy(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,i=e[t++],o=i>>7,a=1<<1+(7&i);e[t++],e[t++];var s=null,A=null;o&&(s=t,A=a,t+=3*a);var u=!0,l=[],c=0,f=null,h=0,d=null;for(this.width=n,this.height=r;u&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,d=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((S=e[t++])>=0))throw Error("Invalid block size");if(0===S)break;t+=S}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var p=e[t++];c=e[t++]|e[t++]<<8,f=e[t++],0==(1&p)&&(f=null),h=p>>2&7,t++;break;case 254:for(;;){if(!((S=e[t++])>=0))throw Error("Invalid block size");if(0===S)break;t+=S}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,m=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,y=e[t++],b=y>>6&1,B=1<<1+(7&y),x=s,C=A,F=!1;y>>7&&(F=!0,x=t,C=B,t+=3*B);var E=t;for(t++;;){var S;if(!((S=e[t++])>=0))throw Error("Invalid block size");if(0===S)break;t+=S}l.push({x:g,y:m,width:v,height:w,has_local_palette:F,palette_offset:x,palette_size:C,data_offset:E,data_length:t-E,transparent_index:f,interlaced:!!b,delay:c,disposal:h});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(t,r){var i=this.frameInfo(t),o=i.width*i.height,a=new Uint8Array(o);Zy(e,i.data_offset,a,o);var s=i.palette_offset,A=i.transparent_index;null===A&&(A=256);var u=i.width,l=n-u,c=u,f=4*(i.y*n+i.x),h=4*((i.y+i.height)*n+i.x),d=f,p=4*l;!0===i.interlaced&&(p+=4*n*7);for(var g=8,m=0,v=a.length;m<v;++m){var w=a[m];if(0===c&&(c=u,(d+=p)>=h&&(p=4*l+4*n*(g-1),d=f+(u+l)*(g<<1),g>>=1)),w===A)d+=4;else{var y=e[s+3*w],b=e[s+3*w+1],B=e[s+3*w+2];r[d++]=B,r[d++]=b,r[d++]=y,r[d++]=255}--c}},this.decodeAndBlitFrameRGBA=function(t,r){var i=this.frameInfo(t),o=i.width*i.height,a=new Uint8Array(o);Zy(e,i.data_offset,a,o);var s=i.palette_offset,A=i.transparent_index;null===A&&(A=256);var u=i.width,l=n-u,c=u,f=4*(i.y*n+i.x),h=4*((i.y+i.height)*n+i.x),d=f,p=4*l;!0===i.interlaced&&(p+=4*n*7);for(var g=8,m=0,v=a.length;m<v;++m){var w=a[m];if(0===c&&(c=u,(d+=p)>=h&&(p=4*l+4*n*(g-1),d=f+(u+l)*(g<<1),g>>=1)),w===A)d+=4;else{var y=e[s+3*w],b=e[s+3*w+1],B=e[s+3*w+2];r[d++]=y,r[d++]=b,r[d++]=B,r[d++]=255}--c}}}function Zy(e,t,n,r){for(var i=e[t++],o=1<<i,a=o+1,s=a+1,A=i+1,u=(1<<A)-1,l=0,c=0,f=0,h=e[t++],d=new Int32Array(4096),p=null;;){for(;l<16&&0!==h;)c|=e[t++]<<l,l+=8,1===h?h=e[t++]:--h;if(l<A)break;var g=c&u;if(c>>=A,l-=A,g!==o){if(g===a)break;for(var m=g<s?g:p,v=0,w=m;w>o;)w=d[w]>>8,++v;var y=w;if(f+v+(m!==g?1:0)>r)return void Aw.log("Warning, gif stream longer than expected.");n[f++]=y;var b=f+=v;for(m!==g&&(n[f++]=y),w=m;v--;)w=d[w],n[--b]=255&w,w>>=8;null!==p&&s<4096&&(d[s++]=p<<8|y,s>=u+1&&A<12&&(++A,u=u<<1|1)),p=g}else s=a+1,u=(1<<(A=i+1))-1,p=null}return f!==r&&Aw.log("Warning, gif stream shorter than expected."),n}function $y(e){var t,n,r,i,o,a=Math.floor,s=new Array(64),A=new Array(64),u=new Array(64),l=new Array(64),c=new Array(65535),f=new Array(65535),h=new Array(64),d=new Array(64),p=[],g=0,m=7,v=new Array(64),w=new Array(64),y=new Array(64),b=new Array(256),B=new Array(2048),x=[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],C=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],S=[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],k=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],_=[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],N=[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 U(e,t){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=e[o];a++)i[t[r]]=[],i[t[r]][0]=n,i[t[r]][1]=o,r++,n++;n*=2}return i}function L(e){for(var t=e[0],n=e[1]-1;n>=0;)t&1<<n&&(g|=1<<m),n--,--m<0&&(255==g?(Q(255),Q(0)):Q(g),m=7,g=0)}function Q(e){p.push(e)}function D(e){Q(e>>8&255),Q(255&e)}function R(e,t,n,r,i){for(var o,a=i[0],s=i[240],A=function(e,t){var n,r,i,o,a,s,A,u,l,c,f=0;for(l=0;l<8;++l){n=e[f],r=e[f+1],i=e[f+2],o=e[f+3],a=e[f+4],s=e[f+5],A=e[f+6];var d=n+(u=e[f+7]),p=n-u,g=r+A,m=r-A,v=i+s,w=i-s,y=o+a,b=o-a,B=d+y,x=d-y,C=g+v,F=g-v;e[f]=B+C,e[f+4]=B-C;var E=.707106781*(F+x);e[f+2]=x+E,e[f+6]=x-E;var S=.382683433*((B=b+w)-(F=m+p)),k=.5411961*B+S,_=1.306562965*F+S,I=.707106781*(C=w+m),N=p+I,U=p-I;e[f+5]=U+k,e[f+3]=U-k,e[f+1]=N+_,e[f+7]=N-_,f+=8}for(f=0,l=0;l<8;++l){n=e[f],r=e[f+8],i=e[f+16],o=e[f+24],a=e[f+32],s=e[f+40],A=e[f+48];var L=n+(u=e[f+56]),Q=n-u,D=r+A,R=r-A,T=i+s,P=i-s,O=o+a,M=o-a,H=L+O,j=L-O,z=D+T,K=D-T;e[f]=H+z,e[f+32]=H-z;var W=.707106781*(K+j);e[f+16]=j+W,e[f+48]=j-W;var V=.382683433*((H=M+P)-(K=R+Q)),G=.5411961*H+V,q=1.306562965*K+V,X=.707106781*(z=P+R),Y=Q+X,J=Q-X;e[f+40]=J+G,e[f+24]=J-G,e[f+8]=Y+q,e[f+56]=Y-q,f++}for(l=0;l<64;++l)c=e[l]*t[l],h[l]=c>0?c+.5|0:c-.5|0;return h}(e,t),u=0;u<64;++u)d[x[u]]=A[u];var l=d[0]-n;n=d[0],0==l?L(r[0]):(L(r[f[o=32767+l]]),L(c[o]));for(var p=63;p>0&&0==d[p];)p--;if(0==p)return L(a),n;for(var g,m=1;m<=p;){for(var v=m;0==d[m]&&m<=p;)++m;var w=m-v;if(w>=16){g=w>>4;for(var y=1;y<=g;++y)L(s);w&=15}o=32767+d[m],L(i[(w<<4)+f[o]]),L(c[o]),m++}return 63!=p&&L(a),n}function T(e){e=Math.min(Math.max(e,1),100),o!=e&&(function(e){for(var t=[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],n=0;n<64;n++){var r=a((t[n]*e+50)/100);r=Math.min(Math.max(r,1),255),s[x[n]]=r}for(var i=[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],o=0;o<64;o++){var c=a((i[o]*e+50)/100);c=Math.min(Math.max(c,1),255),A[x[o]]=c}for(var f=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,d=0;d<8;d++)for(var p=0;p<8;p++)u[h]=1/(s[x[h]]*f[d]*f[p]*8),l[h]=1/(A[x[h]]*f[d]*f[p]*8),h++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),o=e)}this.encode=function(e,o){o&&T(o),p=new Array,g=0,m=7,D(65496),D(65504),D(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),D(1),D(1),Q(0),Q(0),function(){D(65499),D(132),Q(0);for(var e=0;e<64;e++)Q(s[e]);Q(1);for(var t=0;t<64;t++)Q(A[t])}(),function(e,t){D(65472),D(17),Q(8),D(t),D(e),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)}(e.width,e.height),function(){D(65476),D(418),Q(0);for(var e=0;e<16;e++)Q(C[e+1]);for(var t=0;t<=11;t++)Q(F[t]);Q(16);for(var n=0;n<16;n++)Q(E[n+1]);for(var r=0;r<=161;r++)Q(S[r]);Q(1);for(var i=0;i<16;i++)Q(k[i+1]);for(var o=0;o<=11;o++)Q(_[o]);Q(17);for(var a=0;a<16;a++)Q(I[a+1]);for(var s=0;s<=161;s++)Q(N[s])}(),D(65498),D(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0);var a=0,c=0,f=0;g=0,m=7,this.encode.displayName="_encode_";for(var h,d,b,x,U,P,O,M,H,j=e.data,z=e.width,K=e.height,W=4*z,V=0;V<K;){for(h=0;h<W;){for(U=W*V+h,O=-1,M=0,H=0;H<64;H++)P=U+(M=H>>3)*W+(O=4*(7&H)),V+M>=K&&(P-=W*(V+1+M-K)),h+O>=W&&(P-=h+O-W+4),d=j[P++],b=j[P++],x=j[P++],v[H]=(B[d]+B[b+256|0]+B[x+512|0]>>16)-128,w[H]=(B[d+768|0]+B[b+1024|0]+B[x+1280|0]>>16)-128,y[H]=(B[d+1280|0]+B[b+1536|0]+B[x+1792|0]>>16)-128;a=R(v,u,a,t,r),c=R(w,l,c,n,i),f=R(y,l,f,n,i),h+=32}V+=8}if(m>=0){var G=[];G[1]=m+1,G[0]=(1<<m+1)-1,L(G)}return D(65497),new Uint8Array(p)},e=e||50,function(){for(var e=String.fromCharCode,t=0;t<256;t++)b[t]=e(t)}(),t=U(C,F),n=U(k,_),r=U(E,S),i=U(I,N),function(){for(var e=1,t=2,n=1;n<=15;n++){for(var r=e;r<t;r++)f[32767+r]=n,c[32767+r]=[],c[32767+r][1]=n,c[32767+r][0]=r;for(var i=-(t-1);i<=-e;i++)f[32767+i]=n,c[32767+i]=[],c[32767+i][1]=n,c[32767+i][0]=t-1+i;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)B[e]=19595*e,B[e+256|0]=38470*e,B[e+512|0]=7471*e+32768,B[e+768|0]=-11059*e,B[e+1024|0]=-21709*e,B[e+1280|0]=32768*e+8421375,B[e+1536|0]=-27439*e,B[e+1792|0]=-5329*e}(),T(e)}function eb(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,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function tb(e){function t(e){if(!e)throw Error("assert :P")}function n(e,t,n){for(var r=0;4>r;r++)if(e[t+r]!=n.charCodeAt(r))return!0;return!1}function r(e,t,n,r,i){for(var o=0;o<i;o++)e[t+o]=n[r+o]}function i(e,t,n,r){for(var i=0;i<r;i++)e[t+i]=n}function o(e){return new Int32Array(e)}function a(e,t){for(var n=[],r=0;r<e;r++)n.push(new t);return n}function s(e,t){var n=[];return function e(n,r,i){for(var o=i[r],a=0;a<o&&(n.push(i.length>r+1?[]:new t),!(i.length<r+1));a++)e(n[a],r+1,i)}(n,0,e),n}var A=function(){var e=this;function A(e,t){for(var n=1<<t-1>>>0;e&n;)n>>>=1;return n?(e&n-1)+n:e}function u(e,n,r,i,o){t(!(i%r));do{e[n+(i-=r)]=o}while(0<i)}function l(e,n,r,i,a){if(t(2328>=a),512>=a)var s=o(512);else if(null==(s=o(a)))return 0;return function(e,n,r,i,a,s){var l,f,h=n,d=1<<r,p=o(16),g=o(16);for(t(0!=a),t(null!=i),t(null!=e),t(0<r),f=0;f<a;++f){if(15<i[f])return 0;++p[i[f]]}if(p[0]==a)return 0;for(g[1]=0,l=1;15>l;++l){if(p[l]>1<<l)return 0;g[l+1]=g[l]+p[l]}for(f=0;f<a;++f)l=i[f],0<i[f]&&(s[g[l]++]=f);if(1==g[15])return(i=new c).g=0,i.value=s[0],u(e,h,1,d,i),d;var m,v=-1,w=d-1,y=0,b=1,B=1,x=1<<r;for(f=0,l=1,a=2;l<=r;++l,a<<=1){if(b+=B<<=1,0>(B-=p[l]))return 0;for(;0<p[l];--p[l])(i=new c).g=l,i.value=s[f++],u(e,h+y,a,x,i),y=A(y,l)}for(l=r+1,a=2;15>=l;++l,a<<=1){if(b+=B<<=1,0>(B-=p[l]))return 0;for(;0<p[l];--p[l]){if(i=new c,(y&w)!=v){for(h+=x,m=1<<(v=l)-r;15>v&&!(0>=(m-=p[v]));)++v,m<<=1;d+=x=1<<(m=v-r),e[n+(v=y&w)].g=m+r,e[n+v].value=h-n-v}i.g=l-r,i.value=s[f++],u(e,h+(y>>r),a,x,i),y=A(y,l)}}return b!=2*g[15]-1?0:d}(e,n,r,i,a,s)}function c(){this.value=this.g=0}function f(){this.value=this.g=0}function h(){this.G=a(5,c),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(On,f)}function d(e,n,r,i){t(null!=e),t(null!=n),t(2147483648>i),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=n,e.pa=r,e.Jd=n,e.Yc=r+i,e.Zc=4<=i?r+i-4+1:r,E(e)}function p(e,t){for(var n=0;0<t--;)n|=k(e,128)<<t;return n}function g(e,t){var n=p(e,t);return S(e)?-n:n}function m(e,n,r,i){var o,a=0;for(t(null!=e),t(null!=n),t(4294967288>i),e.Sb=i,e.Ra=0,e.u=0,e.h=0,4<i&&(i=4),o=0;o<i;++o)a+=n[r+o]<<8*o;e.Ra=a,e.bb=i,e.oa=n,e.pa=r}function v(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<jn-8>>>0,++e.bb,e.u-=8;x(e)&&(e.h=1,e.u=0)}function w(e,n){if(t(0<=n),!e.h&&n<=Hn){var r=B(e)&Mn[n];return e.u+=n,v(e),r}return e.h=1,e.u=0}function y(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function b(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function B(e){return e.Ra>>>(e.u&jn-1)>>>0}function x(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>jn}function C(e,t){e.u=t,e.h=x(e)}function F(e){e.u>=zn&&(t(e.u>=zn),v(e))}function E(e){t(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(t(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function S(e){return p(e,1)}function k(e,t){var n=e.Ca;0>e.b&&E(e);var r=e.b,i=n*t>>>8,o=(e.I>>>r>i)+0;for(o?(n-=i,e.I-=i+1<<r>>>0):n=i+1,r=n,i=0;256<=r;)i+=8,r>>=8;return r=7^i+Kn[r],e.b-=r,e.Ca=(n<<r)-1,o}function _(e,t,n){e[t+0]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function I(e,t){return e[t+0]|e[t+1]<<8}function N(e,t){return I(e,t)|e[t+2]<<16}function U(e,t){return I(e,t)|I(e,t+2)<<16}function L(e,n){var r=1<<n;return t(null!=e),t(0<n),e.X=o(r),null==e.X?0:(e.Mb=32-n,e.Xa=n,1)}function Q(e,n){t(null!=e),t(null!=n),t(e.Xa==n.Xa),r(n.X,0,e.X,0,1<<n.Xa)}function D(){this.X=[],this.Xa=this.Mb=0}function R(e,n,r,i){t(null!=r),t(null!=i);var o=r[0],a=i[0];return 0==o&&(o=(e*a+n/2)/n),0==a&&(a=(n*o+e/2)/e),0>=o||0>=a?0:(r[0]=o,i[0]=a,1)}function T(e,t){return e+(1<<t)-1>>>t}function P(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function O(t,n){e[n]=function(n,r,i,o,a,s,A){var u;for(u=0;u<a;++u){var l=e[t](s[A+u-1],i,o+u);s[A+u]=P(n[r+u],l)}}}function M(){this.ud=this.hd=this.jd=0}function H(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function j(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function z(e,t){return j(e+(e-t+.5>>1))}function K(e,t,n){return Math.abs(t-n)-Math.abs(e-n)}function W(e,t,n,r,i,o,a){for(r=o[a-1],n=0;n<i;++n)o[a+n]=r=P(e[t+n],r)}function V(e,t,n,r,i){var o;for(o=0;o<n;++o){var a=e[t+o],s=a>>8&255,A=16711935&(A=(A=16711935&a)+((s<<16)+s));r[i+o]=(4278255360&a)+A>>>0}}function G(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function q(e,t,n,r,i,o){var a;for(a=0;a<r;++a){var s=t[n+a],A=s>>>8,u=s,l=255&(l=(l=s>>>16)+((e.jd<<24>>24)*(A<<24>>24)>>>5));u=255&(u=(u+=(e.hd<<24>>24)*(A<<24>>24)>>>5)+((e.ud<<24>>24)*(l<<24>>24)>>>5)),i[o+a]=(4278255360&s)+(l<<16)+u}}function X(t,n,r,i,o){e[n]=function(e,t,n,r,a,s,A,u,l){for(r=A;r<u;++r)for(A=0;A<l;++A)a[s++]=o(n[i(e[t++])])},e[t]=function(t,n,a,s,A,u,l){var c=8>>t.b,f=t.Ea,h=t.K[0],d=t.w;if(8>c)for(t=(1<<t.b)-1,d=(1<<c)-1;n<a;++n){var p,g=0;for(p=0;p<f;++p)p&t||(g=i(s[A++])),u[l++]=o(h[g&d]),g>>=c}else e["VP8LMapColor"+r](s,A,h,d,u,l,n,a,f)}}function Y(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o}}function J(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o,r[i++]=o>>24&255}}function Z(e,t,n,r,i){for(n=t+n;t<n;){var o=(a=e[t++])>>16&240|a>>12&15,a=240&a|a>>28&15;r[i++]=o,r[i++]=a}}function $(e,t,n,r,i){for(n=t+n;t<n;){var o=(a=e[t++])>>16&248|a>>13&7,a=a>>5&224|a>>3&31;r[i++]=o,r[i++]=a}}function ee(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=255&o,r[i++]=o>>8&255,r[i++]=o>>16&255}}function te(e,t,n,i,o,a){if(0==a)for(n=t+n;t<n;)_(i,((a=e[t++])[0]>>24|a[1]>>8&65280|a[2]<<8&16711680|a[3]<<24)>>>0),o+=32;else r(i,o,e,t,n)}function ne(t,n){e[n][0]=e[t+"0"],e[n][1]=e[t+"1"],e[n][2]=e[t+"2"],e[n][3]=e[t+"3"],e[n][4]=e[t+"4"],e[n][5]=e[t+"5"],e[n][6]=e[t+"6"],e[n][7]=e[t+"7"],e[n][8]=e[t+"8"],e[n][9]=e[t+"9"],e[n][10]=e[t+"10"],e[n][11]=e[t+"11"],e[n][12]=e[t+"12"],e[n][13]=e[t+"13"],e[n][14]=e[t+"0"],e[n][15]=e[t+"0"]}function re(e){return e==zr||e==Kr||e==Wr||e==Vr}function ie(){this.eb=[],this.size=this.A=this.fb=0}function oe(){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 ae(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ie,this.f.kb=new oe,this.sd=null}function se(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Ae(){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 ue(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function le(e,t){var n=e.T,i=t.ba.f.RGBA,o=i.eb,a=i.fb+e.ka*i.A,s=mi[t.ba.S],A=e.y,u=e.O,l=e.f,c=e.N,f=e.ea,h=e.W,d=t.cc,p=t.dc,g=t.Mc,m=t.Nc,v=e.ka,w=e.ka+e.T,y=e.U,b=y+1>>1;for(0==v?s(A,u,null,null,l,c,f,h,l,c,f,h,o,a,null,null,y):(s(t.ec,t.fc,A,u,d,p,g,m,l,c,f,h,o,a-i.A,o,a,y),++n);v+2<w;v+=2)d=l,p=c,g=f,m=h,c+=e.Rc,h+=e.Rc,a+=2*i.A,s(A,(u+=2*e.fa)-e.fa,A,u,d,p,g,m,l,c,f,h,o,a-i.A,o,a,y);return u+=e.fa,e.j+w<e.o?(r(t.ec,t.fc,A,u,y),r(t.cc,t.dc,l,c,b),r(t.Mc,t.Nc,f,h,b),n--):1&w||s(A,u,null,null,l,c,f,h,l,c,f,h,o,a+i.A,null,null,y),n}function ce(e,n,r){var i=e.F,o=[e.J];if(null!=i){var a=e.U,s=n.ba.S,A=s==Mr||s==Wr;n=n.ba.f.RGBA;var u=[0],l=e.ka;u[0]=e.T,e.Kb&&(0==l?--u[0]:(--l,o[0]-=e.width),e.j+e.ka+e.T==e.o&&(u[0]=e.o-e.j-l));var c=n.eb;l=n.fb+l*n.A,e=Fr(i,o[0],e.width,a,u,c,l+(A?0:3),n.A),t(r==u),e&&re(s)&&xr(c,l,A,a,u,n.A)}return 0}function fe(e){var t=e.ma,n=t.ba.S,r=11>n,i=n==Tr||n==Or||n==Mr||n==Hr||12==n||re(n);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!Rn(t.Oa,e,i?11:12))return 0;if(i&&re(n)&&wn(),e.da)alert("todo:use_scaling");else{if(r){if(t.Ib=ue,e.Kb){if(n=e.U+1>>1,t.memory=o(e.U+2*n),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+n,t.Ib=le,wn()}}else alert("todo:EmitYUV");i&&(t.Jb=ce,r&&mn())}if(r&&!Ni){for(e=0;256>e;++e)Ui[e]=89858*(e-128)+Ei>>Fi,Di[e]=-22014*(e-128)+Ei,Qi[e]=-45773*(e-128),Li[e]=113618*(e-128)+Ei>>Fi;for(e=Si;e<ki;++e)t=76283*(e-16)+Ei>>Fi,Ri[e-Si]=We(t,255),Ti[e-Si]=We(t+8>>4,15);Ni=1}return 1}function he(e){var n=e.ma,r=e.U,i=e.T;return t(!(1&e.ka)),0>=r||0>=i?0:(r=n.Ib(e,n),null!=n.Jb&&n.Jb(e,n,r),n.Dc+=r,1)}function de(e){e.ma.memory=null}function pe(e,t,n,r){return 47!=w(e,8)?0:(t[0]=w(e,14)+1,n[0]=w(e,14)+1,r[0]=w(e,1),0!=w(e,3)?0:!e.h)}function ge(e,t){if(4>e)return e+1;var n=e-2>>1;return(2+(1&e)<<n)+w(t,n)+1}function me(e,t){return 120<t?t-120:1<=(n=((n=Zr[t-1])>>4)*e+(8-(15&n)))?n:1;var n}function ve(e,t,n){var r=B(n),i=e[t+=255&r].g-8;return 0<i&&(C(n,n.u+8),r=B(n),t+=e[t].value,t+=r&(1<<i)-1),C(n,n.u+e[t].g),e[t].value}function we(e,n,r){return r.g+=e.g,r.value+=e.value<<n>>>0,t(8>=r.g),e.g}function ye(e,n,r){var i=e.xc;return t((n=0==i?0:e.vc[e.md*(r>>i)+(n>>i)])<e.Wb),e.Ya[n]}function be(e,n,i,o){var a=e.ab,s=e.c*n,A=e.C;n=A+n;var u=i,l=o;for(o=e.Ta,i=e.Ua;0<a--;){var c=e.gc[a],f=A,h=n,d=u,p=l,g=(l=o,u=i,c.Ea);switch(t(f<h),t(h<=c.nc),c.hc){case 2:Gn(d,p,(h-f)*g,l,u);break;case 0:var m=f,v=h,w=l,y=u,b=(E=c).Ea;0==m&&(Wn(d,p,null,null,1,w,y),W(d,p+1,0,0,b-1,w,y+1),p+=b,y+=b,++m);for(var B=1<<E.b,x=B-1,C=T(b,E.b),F=E.K,E=E.w+(m>>E.b)*C;m<v;){var S=F,k=E,_=1;for(Vn(d,p,w,y-b,1,w,y);_<b;){var I=(_&~x)+B;I>b&&(I=b),(0,Zn[S[k++]>>8&15])(d,p+ +_,w,y+_-b,I-_,w,y+_),_=I}p+=b,y+=b,++m&x||(E+=C)}h!=c.nc&&r(l,u-g,l,u+(h-f-1)*g,g);break;case 1:for(g=d,v=p,b=(d=c.Ea)-(y=d&~(w=(p=1<<c.b)-1)),m=T(d,c.b),B=c.K,c=c.w+(f>>c.b)*m;f<h;){for(x=B,C=c,F=new M,E=v+y,S=v+d;v<E;)G(x[C++],F),$n(F,g,v,p,l,u),v+=p,u+=p;v<S&&(G(x[C++],F),$n(F,g,v,b,l,u),v+=b,u+=b),++f&w||(c+=m)}break;case 3:if(d==l&&p==u&&0<c.b){for(v=l,d=g=u+(h-f)*g-(y=(h-f)*T(c.Ea,c.b)),p=l,w=u,m=[],y=(b=y)-1;0<=y;--y)m[y]=p[w+y];for(y=b-1;0<=y;--y)v[d+y]=m[y];qn(c,f,h,l,g,l,u)}else qn(c,f,h,d,p,l,u)}u=o,l=i}l!=i&&r(o,i,u,l,s)}function Be(e,n){var r=e.V,i=e.Ba+e.c*e.C,o=n-e.C;if(t(n<=e.l.o),t(16>=o),0<o){var a=e.l,s=e.Ta,A=e.Ua,u=a.width;if(be(e,o,r,i),o=A=[A],t((r=e.C)<(i=n)),t(a.v<a.va),i>a.o&&(i=a.o),r<a.j){var l=a.j-r;r=a.j,o[0]+=l*u}if(r>=i?r=0:(o[0]+=4*a.v,a.ka=r-a.j,a.U=a.va-a.v,a.T=i-r,r=1),r){if(A=A[0],11>(r=e.ca).S){var c=r.f.RGBA,f=(i=r.S,o=a.U,a=a.T,l=c.eb,c.A),h=a;for(c=c.fb+e.Ma*c.A;0<h--;){var d=s,p=A,g=o,m=l,v=c;switch(i){case Rr:er(d,p,g,m,v);break;case Tr:tr(d,p,g,m,v);break;case zr:tr(d,p,g,m,v),xr(m,v,0,g,1,0);break;case Pr:ir(d,p,g,m,v);break;case Or:te(d,p,g,m,v,1);break;case Kr:te(d,p,g,m,v,1),xr(m,v,0,g,1,0);break;case Mr:te(d,p,g,m,v,0);break;case Wr:te(d,p,g,m,v,0),xr(m,v,1,g,1,0);break;case Hr:nr(d,p,g,m,v);break;case Vr:nr(d,p,g,m,v),Cr(m,v,g,1,0);break;case jr:rr(d,p,g,m,v);break;default:t(0)}A+=u,c+=f}e.Ma+=a}else alert("todo:EmitRescaledRowsYUVA");t(e.Ma<=r.height)}}e.C=n,t(e.C<=e.i)}function xe(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var n=e.Ya[t].G,r=e.Ya[t].H;if(0<n[1][r[1]+0].g||0<n[2][r[2]+0].g||0<n[3][r[3]+0].g)return 0}return 1}function Ce(e,n,r,i,o,a){if(0!=e.Z){var s=e.qd,A=e.rd;for(t(null!=gi[e.Z]);n<r;++n)gi[e.Z](s,A,i,o,i,o,a),s=i,A=o,o+=a;e.qd=s,e.rd=A}}function Fe(e,n){var r=e.l.ma,i=0==r.Z||1==r.Z?e.l.j:e.C;if(i=e.C<i?i:e.C,t(n<=e.l.o),n>i){var o=e.l.width,a=r.ca,s=r.tb+o*i,A=e.V,u=e.Ba+e.c*i,l=e.gc;t(1==e.ab),t(3==l[0].hc),Yn(l[0],i,n,A,u,a,s),Ce(r,i,n,a,s,o)}e.C=e.Ma=n}function Ee(e,n,r,i,o,a,s){var A=e.$/i,u=e.$%i,l=e.m,c=e.s,f=r+e.$,h=f;o=r+i*o;var d=r+i*a,p=280+c.ua,g=e.Pb?A:16777216,m=0<c.ua?c.Wa:null,v=c.wc,w=f<d?ye(c,u,A):null;t(e.C<a),t(d<=o);var y=!1;e:for(;;){for(;y||f<d;){var b=0;if(A>=g){var E=f-r;t((g=e).Pb),g.wd=g.m,g.xd=E,0<g.s.ua&&Q(g.s.Wa,g.s.vb),g=A+ei}if(u&v||(w=ye(c,u,A)),t(null!=w),w.Qb&&(n[f]=w.qb,y=!0),!y)if(F(l),w.jc){b=l,E=n;var S=f,k=w.pd[B(b)&On-1];t(w.jc),256>k.g?(C(b,b.u+k.g),E[S]=k.value,b=0):(C(b,b.u+k.g-256),t(256<=k.value),b=k.value),0==b&&(y=!0)}else b=ve(w.G[0],w.H[0],l);if(l.h)break;if(y||256>b){if(!y)if(w.nd)n[f]=(w.qb|b<<8)>>>0;else{if(F(l),y=ve(w.G[1],w.H[1],l),F(l),E=ve(w.G[2],w.H[2],l),S=ve(w.G[3],w.H[3],l),l.h)break;n[f]=(S<<24|y<<16|b<<8|E)>>>0}if(y=!1,++f,++u>=i&&(u=0,++A,null!=s&&A<=a&&!(A%16)&&s(e,A),null!=m))for(;h<f;)b=n[h++],m.X[(506832829*b&4294967295)>>>m.Mb]=b}else if(280>b){if(b=ge(b-256,l),E=ve(w.G[4],w.H[4],l),F(l),E=me(i,E=ge(E,l)),l.h)break;if(f-r<E||o-f<b)break e;for(S=0;S<b;++S)n[f+S]=n[f+S-E];for(f+=b,u+=b;u>=i;)u-=i,++A,null!=s&&A<=a&&!(A%16)&&s(e,A);if(t(f<=o),u&v&&(w=ye(c,u,A)),null!=m)for(;h<f;)b=n[h++],m.X[(506832829*b&4294967295)>>>m.Mb]=b}else{if(!(b<p))break e;for(y=b-280,t(null!=m);h<f;)b=n[h++],m.X[(506832829*b&4294967295)>>>m.Mb]=b;b=f,t(!(y>>>(E=m).Xa)),n[b]=E.X[y],y=!0}y||t(l.h==x(l))}if(e.Pb&&l.h&&f<o)t(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&Q(e.s.vb,e.s.Wa);else{if(l.h)break e;null!=s&&s(e,A>a?a:A),e.a=0,e.$=f-r}return 1}return e.a=3,0}function Se(e){t(null!=e),e.vc=null,e.yc=null,e.Ya=null;var n=e.Wa;null!=n&&(n.X=null),e.vb=null,t(null!=e)}function ke(){var t=new sn;return null==t?null:(t.a=0,t.xb=pi,ne("Predictor","VP8LPredictors"),ne("Predictor","VP8LPredictors_C"),ne("PredictorAdd","VP8LPredictorsAdd"),ne("PredictorAdd","VP8LPredictorsAdd_C"),Gn=V,$n=q,er=Y,tr=J,nr=Z,rr=$,ir=ee,e.VP8LMapColor32b=Xn,e.VP8LMapColor8b=Jn,t)}function _e(e,n,r,s,A){var u=1,f=[e],d=[n],p=s.m,g=s.s,m=null,v=0;e:for(;;){if(r)for(;u&&w(p,1);){var y=f,b=d,x=s,E=1,S=x.m,k=x.gc[x.ab],_=w(S,2);if(x.Oc&1<<_)u=0;else{switch(x.Oc|=1<<_,k.hc=_,k.Ea=y[0],k.nc=b[0],k.K=[null],++x.ab,t(4>=x.ab),_){case 0:case 1:k.b=w(S,3)+2,E=_e(T(k.Ea,k.b),T(k.nc,k.b),0,x,k.K),k.K=k.K[0];break;case 3:var I,N=w(S,8)+1,U=16<N?0:4<N?1:2<N?2:3;if(y[0]=T(k.Ea,U),k.b=U,I=E=_e(N,1,0,x,k.K)){var Q,D=N,R=k,O=1<<(8>>R.b),M=o(O);if(null==M)I=0;else{var H=R.K[0],j=R.w;for(M[0]=R.K[0][0],Q=1;Q<1*D;++Q)M[Q]=P(H[j+Q],M[Q-1]);for(;Q<4*O;++Q)M[Q]=0;R.K[0]=null,R.K[0]=M,I=1}}E=I;break;case 2:break;default:t(0)}u=E}}if(f=f[0],d=d[0],u&&w(p,1)&&!(u=1<=(v=w(p,4))&&11>=v)){s.a=3;break e}var z;if(z=u)t:{var K,W,V,G=s,q=f,X=d,Y=v,J=r,Z=G.m,$=G.s,ee=[null],te=1,ne=0,re=$r[Y];n:for(;;){if(J&&w(Z,1)){var ie=w(Z,3)+2,oe=T(q,ie),ae=T(X,ie),se=oe*ae;if(!_e(oe,ae,0,G,ee))break n;for(ee=ee[0],$.xc=ie,K=0;K<se;++K){var Ae=ee[K]>>8&65535;ee[K]=Ae,Ae>=te&&(te=Ae+1)}}if(Z.h)break n;for(W=0;5>W;++W){var ue=Xr[W];!W&&0<Y&&(ue+=1<<Y),ne<ue&&(ne=ue)}var le=a(te*re,c),ce=te,fe=a(ce,h);if(null==fe)var he=null;else t(65536>=ce),he=fe;var de=o(ne);if(null==he||null==de||null==le){G.a=1;break n}var pe=le;for(K=V=0;K<te;++K){var ge=he[K],me=ge.G,ve=ge.H,ye=0,be=1,Be=0;for(W=0;5>W;++W){ue=Xr[W],me[W]=pe,ve[W]=V,!W&&0<Y&&(ue+=1<<Y);r:{var xe,Ce=ue,Fe=G,ke=de,Ie=pe,Ne=V,Ue=0,Le=Fe.m,Qe=w(Le,1);if(i(ke,0,0,Ce),Qe){var De=w(Le,1)+1,Re=w(Le,1),Te=w(Le,0==Re?1:8);ke[Te]=1,2==De&&(ke[Te=w(Le,8)]=1);var Pe=1}else{var Oe=o(19),Me=w(Le,4)+4;if(19<Me){Fe.a=3;var He=0;break r}for(xe=0;xe<Me;++xe)Oe[Jr[xe]]=w(Le,3);var je=void 0,ze=void 0,Ke=Fe,We=Oe,Ve=Ce,Ge=ke,qe=0,Xe=Ke.m,Ye=8,Je=a(128,c);i:for(;l(Je,0,7,We,19);){if(w(Xe,1)){var Ze=2+2*w(Xe,3);if((je=2+w(Xe,Ze))>Ve)break i}else je=Ve;for(ze=0;ze<Ve&&je--;){F(Xe);var $e=Je[0+(127&B(Xe))];C(Xe,Xe.u+$e.g);var et=$e.value;if(16>et)Ge[ze++]=et,0!=et&&(Ye=et);else{var tt=16==et,nt=et-16,rt=qr[nt],it=w(Xe,Gr[nt])+rt;if(ze+it>Ve)break i;for(var ot=tt?Ye:0;0<it--;)Ge[ze++]=ot}}qe=1;break i}qe||(Ke.a=3),Pe=qe}(Pe=Pe&&!Le.h)&&(Ue=l(Ie,Ne,8,ke,Ce)),Pe&&0!=Ue?He=Ue:(Fe.a=3,He=0)}if(0==He)break n;if(be&&1==Yr[W]&&(be=0==pe[V].g),ye+=pe[V].g,V+=He,3>=W){var at,st=de[0];for(at=1;at<ue;++at)de[at]>st&&(st=de[at]);Be+=st}}if(ge.nd=be,ge.Qb=0,be&&(ge.qb=(me[3][ve[3]+0].value<<24|me[1][ve[1]+0].value<<16|me[2][ve[2]+0].value)>>>0,0==ye&&256>me[0][ve[0]+0].value&&(ge.Qb=1,ge.qb+=me[0][ve[0]+0].value<<8)),ge.jc=!ge.Qb&&6>Be,ge.jc){var At,ut=ge;for(At=0;At<On;++At){var lt=At,ct=ut.pd[lt],ft=ut.G[0][ut.H[0]+lt];256<=ft.value?(ct.g=ft.g+256,ct.value=ft.value):(ct.g=0,ct.value=0,lt>>=we(ft,8,ct),lt>>=we(ut.G[1][ut.H[1]+lt],16,ct),lt>>=we(ut.G[2][ut.H[2]+lt],0,ct),we(ut.G[3][ut.H[3]+lt],24,ct))}}}$.vc=ee,$.Wb=te,$.Ya=he,$.yc=le,z=1;break t}z=0}if(!(u=z)){s.a=3;break e}if(0<v){if(g.ua=1<<v,!L(g.Wa,v)){s.a=1,u=0;break e}}else g.ua=0;var ht=s,dt=f,pt=d,gt=ht.s,mt=gt.xc;if(ht.c=dt,ht.i=pt,gt.md=T(dt,mt),gt.wc=0==mt?-1:(1<<mt)-1,r){s.xb=di;break e}if(null==(m=o(f*d))){s.a=1,u=0;break e}u=(u=Ee(s,m,0,f,d,d,null))&&!p.h;break e}return u?(null!=A?A[0]=m:(t(null==m),t(r)),s.$=0,r||Se(g)):Se(g),u}function Ie(e,n){var r=e.c*e.i,i=r+n+16*n;return t(e.c<=n),e.V=o(i),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+r+n,1)}function Ne(e,n){var r=e.C,i=n-r,o=e.V,a=e.Ba+e.c*r;for(t(n<=e.l.o);0<i;){var s=16<i?16:i,A=e.l.ma,u=e.l.width,l=u*s,c=A.ca,f=A.tb+u*r,h=e.Ta,d=e.Ua;be(e,s,o,a),Er(h,d,c,f,l),Ce(A,r,r+s,c,f,u),i-=s,o+=s*e.c,r+=s}t(r==n),e.C=e.Ma=n}function Ue(){this.ub=this.yd=this.td=this.Rb=0}function Le(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Qe(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function De(){this.Yb=function(){var e=[];return function e(t,n,r){for(var i=r[n],o=0;o<i&&(t.push(r.length>n+1?[]:0),!(r.length<n+1));o++)e(t[o],n+1,r)}(e,0,[3,11]),e}()}function Re(){this.jb=o(3),this.Wc=s([4,8],De),this.Xc=s([4,17],De)}function Te(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function Pe(){this.ld=this.La=this.dd=this.tc=0}function Oe(){this.Na=this.la=0}function Me(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function He(){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 je(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pe),this.Y=0,this.ya=Array(new He),this.aa=0,this.l=new Ve}function ze(){this.y=o(16),this.f=o(8),this.ea=o(8)}function Ke(){this.cb=this.a=0,this.sc="",this.m=new y,this.Od=new Ue,this.Kc=new Le,this.ed=new Te,this.Qa=new Qe,this.Ic=this.$c=this.Aa=0,this.D=new je,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,y),this.ia=0,this.pb=a(4,Me),this.Pa=new Re,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new ze),this.Hd=0,this.rb=Array(new Oe),this.sb=0,this.wa=Array(new Pe),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 He),this.L=this.aa=0,this.gd=s([4,2],Pe),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 We(e,t){return 0>e?0:e>t?t:e}function Ve(){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 Ge(){var e=new Ke;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,ri||(ri=Je)),e}function qe(e,t,n){return 0==e.a&&(e.a=t,e.sc=n,e.cb=0),0}function Xe(e,t,n){return 3<=n&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function Ye(e,n){if(null==e)return 0;if(e.a=0,e.sc="OK",null==n)return qe(e,2,"null VP8Io passed to VP8GetHeaders()");var r=n.data,o=n.w,a=n.ha;if(4>a)return qe(e,7,"Truncated header.");var s=r[o+0]|r[o+1]<<8|r[o+2]<<16,A=e.Od;if(A.Rb=!(1&s),A.td=s>>1&7,A.yd=s>>4&1,A.ub=s>>5,3<A.td)return qe(e,3,"Incorrect keyframe parameters.");if(!A.yd)return qe(e,4,"Frame not displayable.");o+=3,a-=3;var u=e.Kc;if(A.Rb){if(7>a)return qe(e,7,"cannot parse picture header");if(!Xe(r,o,a))return qe(e,3,"Bad code word");u.c=16383&(r[o+4]<<8|r[o+3]),u.Td=r[o+4]>>6,u.i=16383&(r[o+6]<<8|r[o+5]),u.Ud=r[o+6]>>6,o+=7,a-=7,e.za=u.c+15>>4,e.Ub=u.i+15>>4,n.width=u.c,n.height=u.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,i((s=e.Pa).jb,0,255,s.jb.length),t(null!=(s=e.Qa)),s.Cb=0,s.Bb=0,s.Fb=1,i(s.Zb,0,0,s.Zb.length),i(s.Lb,0,0,s.Lb)}if(A.ub>a)return qe(e,7,"bad partition length");d(s=e.m,r,o,A.ub),o+=A.ub,a-=A.ub,A.Rb&&(u.Ld=S(s),u.Kd=S(s)),u=e.Qa;var l,c=e.Pa;if(t(null!=s),t(null!=u),u.Cb=S(s),u.Cb){if(u.Bb=S(s),S(s)){for(u.Fb=S(s),l=0;4>l;++l)u.Zb[l]=S(s)?g(s,7):0;for(l=0;4>l;++l)u.Lb[l]=S(s)?g(s,6):0}if(u.Bb)for(l=0;3>l;++l)c.jb[l]=S(s)?p(s,8):255}else u.Bb=0;if(s.Ka)return qe(e,3,"cannot parse segment header");if((u=e.ed).zd=S(s),u.Tb=p(s,6),u.wb=p(s,3),u.Pc=S(s),u.Pc&&S(s)){for(c=0;4>c;++c)S(s)&&(u.vd[c]=g(s,6));for(c=0;4>c;++c)S(s)&&(u.od[c]=g(s,6))}if(e.L=0==u.Tb?0:u.zd?1:2,s.Ka)return qe(e,3,"cannot parse filter header");var f=a;if(a=l=o,o=l+f,u=f,e.Xb=(1<<p(e.m,2))-1,f<3*(c=e.Xb))r=7;else{for(l+=3*c,u-=3*c,f=0;f<c;++f){var h=r[a+0]|r[a+1]<<8|r[a+2]<<16;h>u&&(h=u),d(e.Jc[+f],r,l,h),l+=h,u-=h,a+=3}d(e.Jc[+c],r,l,u),r=l<o?0:5}if(0!=r)return qe(e,r,"cannot parse partitions");for(r=p(l=e.m,7),a=S(l)?g(l,4):0,o=S(l)?g(l,4):0,u=S(l)?g(l,4):0,c=S(l)?g(l,4):0,l=S(l)?g(l,4):0,f=e.Qa,h=0;4>h;++h){if(f.Cb){var m=f.Zb[h];f.Fb||(m+=r)}else{if(0<h){e.pb[h]=e.pb[0];continue}m=r}var v=e.pb[h];v.Sc[0]=ti[We(m+a,127)],v.Sc[1]=ni[We(m+0,127)],v.Eb[0]=2*ti[We(m+o,127)],v.Eb[1]=101581*ni[We(m+u,127)]>>16,8>v.Eb[1]&&(v.Eb[1]=8),v.Qc[0]=ti[We(m+c,117)],v.Qc[1]=ni[We(m+l,127)],v.lc=m+l}if(!A.Rb)return qe(e,4,"Not a key frame.");for(S(s),A=e.Pa,r=0;4>r;++r){for(a=0;8>a;++a)for(o=0;3>o;++o)for(u=0;11>u;++u)c=k(s,ui[r][a][o][u])?p(s,8):si[r][a][o][u],A.Wc[r][a].Yb[o][u]=c;for(a=0;17>a;++a)A.Xc[r][a]=A.Wc[r][li[a]]}return e.kc=S(s),e.kc&&(e.Bd=p(s,8)),e.cb=1}function Je(e,t,n,r,i,o,a){var s=t[i].Yb[n];for(n=0;16>i;++i){if(!k(e,s[n+0]))return i;for(;!k(e,s[n+1]);)if(s=t[++i].Yb[0],n=0,16==i)return 16;var A=t[i+1].Yb;if(k(e,s[n+2])){var u=e,l=0;if(k(u,(f=s)[(c=n)+3]))if(k(u,f[c+6])){for(s=0,c=2*(l=k(u,f[c+8]))+(f=k(u,f[c+9+l])),l=0,f=ii[c];f[s];++s)l+=l+k(u,f[s]);l+=3+(8<<c)}else k(u,f[c+7])?(l=7+2*k(u,165),l+=k(u,145)):l=5+k(u,159);else l=k(u,f[c+4])?3+k(u,f[c+5]):2;s=A[2]}else l=1,s=A[1];A=a+oi[i],0>(u=e).b&&E(u);var c,f=u.b,h=(c=u.Ca>>1)-(u.I>>f)>>31;--u.b,u.Ca+=h,u.Ca|=1,u.I-=(c+1&h)<<f,o[A]=((l^h)-h)*r[(0<i)+0]}return 16}function Ze(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,i(e.zc,0,0,e.zc.length),e.ja=0}function $e(e,n){if(null==e)return 0;if(null==n)return qe(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!Ye(e,n))return 0;if(t(e.cb),null==n.ac||n.ac(n)){n.ob&&(e.L=0);var s=Oi[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=n.v-s>>4,e.zb=n.j-s>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=n.o+15+s>>4,e.Hb=n.va+15+s>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var A=e.ed;for(s=0;4>s;++s){var u;if(e.Qa.Cb){var l=e.Qa.Lb[s];e.Qa.Fb||(l+=A.Tb)}else l=A.Tb;for(u=0;1>=u;++u){var c=e.gd[s][u],f=l;if(A.Pc&&(f+=A.vd[0],u&&(f+=A.od[0])),0<(f=0>f?0:63<f?63:f)){var h=f;0<A.wb&&(h=4<A.wb?h>>2:h>>1)>9-A.wb&&(h=9-A.wb),1>h&&(h=1),c.dd=h,c.tc=2*f+h,c.ld=40<=f?2:15<=f?1:0}else c.tc=0;c.La=u}}}s=0}else qe(e,6,"Frame setup failed"),s=e.a;if(s=0==s){if(s){e.$c=0,0<e.Aa||(e.Ic=Hi);e:{s=e.Ic,A=4*(h=e.za);var d=32*h,p=h+1,g=0<e.L?h*(0<e.Aa?2:1):0,m=(2==e.Aa?2:1)*h;if((c=A+832+(u=3*(16*s+Oi[e.L])/2*d)+(l=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=c)s=0;else{if(c>e.Vb){if(e.Vb=0,e.Ec=o(c),e.Fc=0,null==e.Ec){s=qe(e,1,"no memory during frame initialization.");break e}e.Vb=c}c=e.Ec,f=e.Fc,e.Ac=c,e.Bc=f,f+=A,e.Gd=a(d,ze),e.Hd=0,e.rb=a(p+1,Oe),e.sb=1,e.wa=g?a(g,Pe):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=h),t(!0),e.oc=c,e.pc=f,f+=832,e.ya=a(m,He),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=h),e.R=16*h,e.B=8*h,h=(d=Oi[e.L])*e.R,d=d/2*e.B,e.sa=c,e.ta=f+h,e.qa=e.sa,e.ra=e.ta+16*s*e.R+d,e.Ha=e.qa,e.Ia=e.ra+8*s*e.B+d,e.$c=0,f+=u,e.mb=l?c:null,e.nb=l?f:null,t(f+l<=e.Fc+e.Vb),Ze(e),i(e.Ac,e.Bc,0,A),s=1}}if(s){if(n.ka=0,n.y=e.sa,n.O=e.ta,n.f=e.qa,n.N=e.ra,n.ea=e.Ha,n.Vd=e.Ia,n.fa=e.R,n.Rc=e.B,n.F=null,n.J=0,!Nr){for(s=-255;255>=s;++s)Sr[255+s]=0>s?-s:s;for(s=-1020;1020>=s;++s)kr[1020+s]=-128>s?-128:127<s?127:s;for(s=-112;112>=s;++s)_r[112+s]=-16>s?-16:15<s?15:s;for(s=-255;510>=s;++s)Ir[255+s]=0>s?0:255<s?255:s;Nr=1}or=ut,ar=ot,Ar=at,ur=st,lr=At,sr=it,cr=qt,fr=Xt,hr=Zt,dr=$t,pr=Yt,gr=Jt,mr=en,vr=tn,wr=jt,yr=zt,br=Kt,Br=Wt,fi[0]=Ct,fi[1]=ct,fi[2]=Bt,fi[3]=xt,fi[4]=Ft,fi[5]=St,fi[6]=Et,fi[7]=kt,fi[8]=It,fi[9]=_t,ci[0]=mt,ci[1]=ht,ci[2]=dt,ci[3]=pt,ci[4]=vt,ci[5]=wt,ci[6]=yt,hi[0]=Qt,hi[1]=ft,hi[2]=Nt,hi[3]=Ut,hi[4]=Rt,hi[5]=Dt,hi[6]=Tt,s=1}else s=0}s&&(s=function(e,n){for(e.M=0;e.M<e.Va;++e.M){var a,s=e.Jc[e.M&e.Xb],A=e.m,u=e;for(a=0;a<u.za;++a){var l=A,c=u,f=c.Ac,h=c.Bc+4*a,d=c.zc,p=c.ya[c.aa+a];if(c.Qa.Bb?p.$b=k(l,c.Pa.jb[0])?2+k(l,c.Pa.jb[2]):k(l,c.Pa.jb[1]):p.$b=0,c.kc&&(p.Ad=k(l,c.Bd)),p.Za=!k(l,145)+0,p.Za){var g=p.Ob,m=0;for(c=0;4>c;++c){var v,w=d[0+c];for(v=0;4>v;++v){w=Ai[f[h+v]][w];for(var y=ai[k(l,w[0])];0<y;)y=ai[2*y+k(l,w[y])];w=-y,f[h+v]=w}r(g,m,f,h,4),m+=4,d[0+c]=w}}else w=k(l,156)?k(l,128)?1:3:k(l,163)?2:0,p.Ob[0]=w,i(f,h,w,4),i(d,0,w,4);p.Dd=k(l,142)?k(l,114)?k(l,183)?1:3:2:0}if(u.m.Ka)return qe(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(u=s,l=(A=e).rb[A.sb-1],f=A.rb[A.sb+A.ja],a=A.ya[A.aa+A.ja],h=A.kc?a.Ad:0)l.la=f.la=0,a.Za||(l.Na=f.Na=0),a.Hc=0,a.Gc=0,a.ia=0;else{var b,B;if(l=f,f=u,h=A.Pa.Xc,d=A.ya[A.aa+A.ja],p=A.pb[d.$b],c=d.ad,g=0,m=A.rb[A.sb-1],w=v=0,i(c,g,0,384),d.Za)var x=0,C=h[3];else{y=o(16);var F=l.Na+m.Na;if(F=ri(f,h[1],F,p.Eb,0,y,0),l.Na=m.Na=(0<F)+0,1<F)or(y,0,c,g);else{var E=y[0]+3>>3;for(y=0;256>y;y+=16)c[g+y]=E}x=1,C=h[0]}var S=15&l.la,_=15&m.la;for(y=0;4>y;++y){var I=1&_;for(E=B=0;4>E;++E)S=S>>1|(I=(F=ri(f,C,F=I+(1&S),p.Sc,x,c,g))>x)<<7,B=B<<2|(3<F?3:1<F?2:0!=c[g+0]),g+=16;S>>=4,_=_>>1|I<<7,v=(v<<8|B)>>>0}for(C=S,x=_>>4,b=0;4>b;b+=2){for(B=0,S=l.la>>4+b,_=m.la>>4+b,y=0;2>y;++y){for(I=1&_,E=0;2>E;++E)F=I+(1&S),S=S>>1|(I=0<(F=ri(f,h[2],F,p.Qc,0,c,g)))<<3,B=B<<2|(3<F?3:1<F?2:0!=c[g+0]),g+=16;S>>=2,_=_>>1|I<<5}w|=B<<4*b,C|=S<<4<<b,x|=(240&_)<<b}l.la=C,m.la=x,d.Hc=v,d.Gc=w,d.ia=43690&w?0:p.ia,h=!(v|w)}if(0<A.L&&(A.wa[A.Y+A.ja]=A.gd[a.$b][a.Za],A.wa[A.Y+A.ja].La|=!h),u.Ka)return qe(e,7,"Premature end-of-file encountered.")}if(Ze(e),A=n,u=1,a=(s=e).D,l=0<s.L&&s.M>=s.zb&&s.M<=s.Va,0==s.Aa)e:{if(a.M=s.M,a.uc=l,Qn(s,a),u=1,a=(B=s.D).Nb,l=(w=Oi[s.L])*s.R,f=w/2*s.B,y=16*a*s.R,E=8*a*s.B,h=s.sa,d=s.ta-l+y,p=s.qa,c=s.ra-f+E,g=s.Ha,m=s.Ia-f+E,_=0==(S=B.M),v=S>=s.Va-1,2==s.Aa&&Qn(s,B),B.uc)for(I=(F=s).D.M,t(F.D.uc),B=F.yb;B<F.Hb;++B){x=B,C=I;var N=(U=(H=F).D).Nb;b=H.R;var U=U.wa[U.Y+x],L=H.sa,Q=H.ta+16*N*b+16*x,D=U.dd,R=U.tc;if(0!=R)if(t(3<=R),1==H.L)0<x&&yr(L,Q,b,R+4),U.La&&Br(L,Q,b,R),0<C&&wr(L,Q,b,R+4),U.La&&br(L,Q,b,R);else{var T=H.B,P=H.qa,O=H.ra+8*N*T+8*x,M=H.Ha,H=H.Ia+8*N*T+8*x;N=U.ld,0<x&&(fr(L,Q,b,R+4,D,N),dr(P,O,M,H,T,R+4,D,N)),U.La&&(gr(L,Q,b,R,D,N),vr(P,O,M,H,T,R,D,N)),0<C&&(cr(L,Q,b,R+4,D,N),hr(P,O,M,H,T,R+4,D,N)),U.La&&(pr(L,Q,b,R,D,N),mr(P,O,M,H,T,R,D,N))}}if(s.ia&&alert("todo:DitherRow"),null!=A.put){if(B=16*S,S=16*(S+1),_?(A.y=s.sa,A.O=s.ta+y,A.f=s.qa,A.N=s.ra+E,A.ea=s.Ha,A.W=s.Ia+E):(B-=w,A.y=h,A.O=d,A.f=p,A.N=c,A.ea=g,A.W=m),v||(S-=w),S>A.o&&(S=A.o),A.F=null,A.J=null,null!=s.Fa&&0<s.Fa.length&&B<S&&(A.J=fn(s,A,B,S-B),A.F=s.mb,null==A.F&&0==A.F.length)){u=qe(s,3,"Could not decode alpha data.");break e}B<A.j&&(w=A.j-B,B=A.j,t(!(1&w)),A.O+=s.R*w,A.N+=s.B*(w>>1),A.W+=s.B*(w>>1),null!=A.F&&(A.J+=A.width*w)),B<S&&(A.O+=A.v,A.N+=A.v>>1,A.W+=A.v>>1,null!=A.F&&(A.J+=A.v),A.ka=B-A.j,A.U=A.va-A.v,A.T=S-B,u=A.put(A))}a+1!=s.Ic||v||(r(s.sa,s.ta-l,h,d+16*s.R,l),r(s.qa,s.ra-f,p,c+8*s.B,f),r(s.Ha,s.Ia-f,g,m+8*s.B,f))}if(!u)return qe(e,6,"Output aborted.")}return 1}(e,n)),null!=n.bc&&n.bc(n),s&=1}return s?(e.cb=0,s):0}function et(e,t,n,r,i){i=e[t+n+32*r]+(i>>3),e[t+n+32*r]=-256&i?0>i?0:255:i}function tt(e,t,n,r,i,o){et(e,t,0,n,r+i),et(e,t,1,n,r+o),et(e,t,2,n,r-o),et(e,t,3,n,r-i)}function nt(e){return(20091*e>>16)+e}function rt(e,t,n,r){var i,a=0,s=o(16);for(i=0;4>i;++i){var A=e[t+0]+e[t+8],u=e[t+0]-e[t+8],l=(35468*e[t+4]>>16)-nt(e[t+12]),c=nt(e[t+4])+(35468*e[t+12]>>16);s[a+0]=A+c,s[a+1]=u+l,s[a+2]=u-l,s[a+3]=A-c,a+=4,t++}for(i=a=0;4>i;++i)A=(e=s[a+0]+4)+s[a+8],u=e-s[a+8],l=(35468*s[a+4]>>16)-nt(s[a+12]),et(n,r,0,0,A+(c=nt(s[a+4])+(35468*s[a+12]>>16))),et(n,r,1,0,u+l),et(n,r,2,0,u-l),et(n,r,3,0,A-c),a++,r+=32}function it(e,t,n,r){var i=e[t+0]+4,o=35468*e[t+4]>>16,a=nt(e[t+4]),s=35468*e[t+1]>>16;tt(n,r,0,i+a,e=nt(e[t+1]),s),tt(n,r,1,i+o,e,s),tt(n,r,2,i-o,e,s),tt(n,r,3,i-a,e,s)}function ot(e,t,n,r,i){rt(e,t,n,r),i&&rt(e,t+16,n,r+4)}function at(e,t,n,r){ar(e,t+0,n,r,1),ar(e,t+32,n,r+128,1)}function st(e,t,n,r){var i;for(e=e[t+0]+4,i=0;4>i;++i)for(t=0;4>t;++t)et(n,r,t,i,e)}function At(e,t,n,r){e[t+0]&&ur(e,t+0,n,r),e[t+16]&&ur(e,t+16,n,r+4),e[t+32]&&ur(e,t+32,n,r+128),e[t+48]&&ur(e,t+48,n,r+128+4)}function ut(e,t,n,r){var i,a=o(16);for(i=0;4>i;++i){var s=e[t+0+i]+e[t+12+i],A=e[t+4+i]+e[t+8+i],u=e[t+4+i]-e[t+8+i],l=e[t+0+i]-e[t+12+i];a[0+i]=s+A,a[8+i]=s-A,a[4+i]=l+u,a[12+i]=l-u}for(i=0;4>i;++i)s=(e=a[0+4*i]+3)+a[3+4*i],A=a[1+4*i]+a[2+4*i],u=a[1+4*i]-a[2+4*i],l=e-a[3+4*i],n[r+0]=s+A>>3,n[r+16]=l+u>>3,n[r+32]=s-A>>3,n[r+48]=l-u>>3,r+=64}function lt(e,t,n){var r,i=t-32,o=Qr,a=255-e[i-1];for(r=0;r<n;++r){var s,A=o,u=a+e[t-1];for(s=0;s<n;++s)e[t+s]=A[u+e[i+s]];t+=32}}function ct(e,t){lt(e,t,4)}function ft(e,t){lt(e,t,8)}function ht(e,t){lt(e,t,16)}function dt(e,t){var n;for(n=0;16>n;++n)r(e,t+32*n,e,t-32,16)}function pt(e,t){var n;for(n=16;0<n;--n)i(e,t,e[t-1],16),t+=32}function gt(e,t,n){var r;for(r=0;16>r;++r)i(t,n+32*r,e,16)}function mt(e,t){var n,r=16;for(n=0;16>n;++n)r+=e[t-1+32*n]+e[t+n-32];gt(r>>5,e,t)}function vt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t-1+32*n];gt(r>>4,e,t)}function wt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t+n-32];gt(r>>4,e,t)}function yt(e,t){gt(128,e,t)}function bt(e,t,n){return e+2*t+n+2>>2}function Bt(e,t){var n,i=t-32;for(i=new Uint8Array([bt(e[i-1],e[i+0],e[i+1]),bt(e[i+0],e[i+1],e[i+2]),bt(e[i+1],e[i+2],e[i+3]),bt(e[i+2],e[i+3],e[i+4])]),n=0;4>n;++n)r(e,t+32*n,i,0,i.length)}function xt(e,t){var n=e[t-1],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96];_(e,t+0,16843009*bt(e[t-1-32],n,r)),_(e,t+32,16843009*bt(n,r,i)),_(e,t+64,16843009*bt(r,i,o)),_(e,t+96,16843009*bt(i,o,o))}function Ct(e,t){var n,r=4;for(n=0;4>n;++n)r+=e[t+n-32]+e[t-1+32*n];for(r>>=3,n=0;4>n;++n)i(e,t+32*n,r,4)}function Ft(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1-32],a=e[t+0-32],s=e[t+1-32],A=e[t+2-32],u=e[t+3-32];e[t+0+96]=bt(r,i,e[t-1+96]),e[t+1+96]=e[t+0+64]=bt(n,r,i),e[t+2+96]=e[t+1+64]=e[t+0+32]=bt(o,n,r),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=bt(a,o,n),e[t+3+64]=e[t+2+32]=e[t+1+0]=bt(s,a,o),e[t+3+32]=e[t+2+0]=bt(A,s,a),e[t+3+0]=bt(u,A,s)}function Et(e,t){var n=e[t+1-32],r=e[t+2-32],i=e[t+3-32],o=e[t+4-32],a=e[t+5-32],s=e[t+6-32],A=e[t+7-32];e[t+0+0]=bt(e[t+0-32],n,r),e[t+1+0]=e[t+0+32]=bt(n,r,i),e[t+2+0]=e[t+1+32]=e[t+0+64]=bt(r,i,o),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=bt(i,o,a),e[t+3+32]=e[t+2+64]=e[t+1+96]=bt(o,a,s),e[t+3+64]=e[t+2+96]=bt(a,s,A),e[t+3+96]=bt(s,A,A)}function St(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1-32],a=e[t+0-32],s=e[t+1-32],A=e[t+2-32],u=e[t+3-32];e[t+0+0]=e[t+1+64]=o+a+1>>1,e[t+1+0]=e[t+2+64]=a+s+1>>1,e[t+2+0]=e[t+3+64]=s+A+1>>1,e[t+3+0]=A+u+1>>1,e[t+0+96]=bt(i,r,n),e[t+0+64]=bt(r,n,o),e[t+0+32]=e[t+1+96]=bt(n,o,a),e[t+1+32]=e[t+2+96]=bt(o,a,s),e[t+2+32]=e[t+3+96]=bt(a,s,A),e[t+3+32]=bt(s,A,u)}function kt(e,t){var n=e[t+0-32],r=e[t+1-32],i=e[t+2-32],o=e[t+3-32],a=e[t+4-32],s=e[t+5-32],A=e[t+6-32],u=e[t+7-32];e[t+0+0]=n+r+1>>1,e[t+1+0]=e[t+0+64]=r+i+1>>1,e[t+2+0]=e[t+1+64]=i+o+1>>1,e[t+3+0]=e[t+2+64]=o+a+1>>1,e[t+0+32]=bt(n,r,i),e[t+1+32]=e[t+0+96]=bt(r,i,o),e[t+2+32]=e[t+1+96]=bt(i,o,a),e[t+3+32]=e[t+2+96]=bt(o,a,s),e[t+3+64]=bt(a,s,A),e[t+3+96]=bt(s,A,u)}function _t(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96];e[t+0+0]=n+r+1>>1,e[t+2+0]=e[t+0+32]=r+i+1>>1,e[t+2+32]=e[t+0+64]=i+o+1>>1,e[t+1+0]=bt(n,r,i),e[t+3+0]=e[t+1+32]=bt(r,i,o),e[t+3+32]=e[t+1+64]=bt(i,o,o),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=o}function It(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96],a=e[t-1-32],s=e[t+0-32],A=e[t+1-32],u=e[t+2-32];e[t+0+0]=e[t+2+32]=n+a+1>>1,e[t+0+32]=e[t+2+64]=r+n+1>>1,e[t+0+64]=e[t+2+96]=i+r+1>>1,e[t+0+96]=o+i+1>>1,e[t+3+0]=bt(s,A,u),e[t+2+0]=bt(a,s,A),e[t+1+0]=e[t+3+32]=bt(n,a,s),e[t+1+32]=e[t+3+64]=bt(r,n,a),e[t+1+64]=e[t+3+96]=bt(i,r,n),e[t+1+96]=bt(o,i,r)}function Nt(e,t){var n;for(n=0;8>n;++n)r(e,t+32*n,e,t-32,8)}function Ut(e,t){var n;for(n=0;8>n;++n)i(e,t,e[t-1],8),t+=32}function Lt(e,t,n){var r;for(r=0;8>r;++r)i(t,n+32*r,e,8)}function Qt(e,t){var n,r=8;for(n=0;8>n;++n)r+=e[t+n-32]+e[t-1+32*n];Lt(r>>4,e,t)}function Dt(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t+n-32];Lt(r>>3,e,t)}function Rt(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t-1+32*n];Lt(r>>3,e,t)}function Tt(e,t){Lt(128,e,t)}function Pt(e,t,n){var r=e[t-n],i=e[t+0],o=3*(i-r)+Ur[1020+e[t-2*n]-e[t+n]],a=Lr[112+(o+4>>3)];e[t-n]=Qr[255+r+Lr[112+(o+3>>3)]],e[t+0]=Qr[255+i-a]}function Ot(e,t,n,r){var i=e[t+0],o=e[t+n];return Dr[255+e[t-2*n]-e[t-n]]>r||Dr[255+o-i]>r}function Mt(e,t,n,r){return 4*Dr[255+e[t-n]-e[t+0]]+Dr[255+e[t-2*n]-e[t+n]]<=r}function Ht(e,t,n,r,i){var o=e[t-3*n],a=e[t-2*n],s=e[t-n],A=e[t+0],u=e[t+n],l=e[t+2*n],c=e[t+3*n];return 4*Dr[255+s-A]+Dr[255+a-u]>r?0:Dr[255+e[t-4*n]-o]<=i&&Dr[255+o-a]<=i&&Dr[255+a-s]<=i&&Dr[255+c-l]<=i&&Dr[255+l-u]<=i&&Dr[255+u-A]<=i}function jt(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Mt(e,t+r,n,i)&&Pt(e,t+r,n)}function zt(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Mt(e,t+r*n,1,i)&&Pt(e,t+r*n,1)}function Kt(e,t,n,r){var i;for(i=3;0<i;--i)jt(e,t+=4*n,n,r)}function Wt(e,t,n,r){var i;for(i=3;0<i;--i)zt(e,t+=4,n,r)}function Vt(e,t,n,r,i,o,a,s){for(o=2*o+1;0<i--;){if(Ht(e,t,n,o,a))if(Ot(e,t,n,s))Pt(e,t,n);else{var A=e,u=t,l=n,c=A[u-2*l],f=A[u-l],h=A[u+0],d=A[u+l],p=A[u+2*l],g=27*(v=Ur[1020+3*(h-f)+Ur[1020+c-d]])+63>>7,m=18*v+63>>7,v=9*v+63>>7;A[u-3*l]=Qr[255+A[u-3*l]+v],A[u-2*l]=Qr[255+c+m],A[u-l]=Qr[255+f+g],A[u+0]=Qr[255+h-g],A[u+l]=Qr[255+d-m],A[u+2*l]=Qr[255+p-v]}t+=r}}function Gt(e,t,n,r,i,o,a,s){for(o=2*o+1;0<i--;){if(Ht(e,t,n,o,a))if(Ot(e,t,n,s))Pt(e,t,n);else{var A=e,u=t,l=n,c=A[u-l],f=A[u+0],h=A[u+l],d=Lr[112+(4+(p=3*(f-c))>>3)],p=Lr[112+(p+3>>3)],g=d+1>>1;A[u-2*l]=Qr[255+A[u-2*l]+g],A[u-l]=Qr[255+c+p],A[u+0]=Qr[255+f-d],A[u+l]=Qr[255+h-g]}t+=r}}function qt(e,t,n,r,i,o){Vt(e,t,n,1,16,r,i,o)}function Xt(e,t,n,r,i,o){Vt(e,t,1,n,16,r,i,o)}function Yt(e,t,n,r,i,o){var a;for(a=3;0<a;--a)Gt(e,t+=4*n,n,1,16,r,i,o)}function Jt(e,t,n,r,i,o){var a;for(a=3;0<a;--a)Gt(e,t+=4,1,n,16,r,i,o)}function Zt(e,t,n,r,i,o,a,s){Vt(e,t,i,1,8,o,a,s),Vt(n,r,i,1,8,o,a,s)}function $t(e,t,n,r,i,o,a,s){Vt(e,t,1,i,8,o,a,s),Vt(n,r,1,i,8,o,a,s)}function en(e,t,n,r,i,o,a,s){Gt(e,t+4*i,i,1,8,o,a,s),Gt(n,r+4*i,i,1,8,o,a,s)}function tn(e,t,n,r,i,o,a,s){Gt(e,t+4,1,i,8,o,a,s),Gt(n,r+4,1,i,8,o,a,s)}function nn(){this.ba=new ae,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Ae,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function rn(){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 on(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function an(){this.ua=0,this.Wa=new D,this.vb=new D,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new h,this.yc=new c}function sn(){this.xb=this.a=0,this.l=new Ve,this.ca=new ae,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new b,this.Pb=0,this.wd=new b,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new an,this.ab=0,this.gc=a(4,on),this.Oc=0}function An(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ve,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function un(e,t,n,r,i,o,a){for(e=null==e?0:e[t+0],t=0;t<a;++t)i[o+t]=e+n[r+t]&255,e=i[o+t]}function ln(e,t,n,r,i,o,a){var s;if(null==e)un(null,null,n,r,i,o,a);else for(s=0;s<a;++s)i[o+s]=e[t+s]+n[r+s]&255}function cn(e,t,n,r,i,o,a){if(null==e)un(null,null,n,r,i,o,a);else{var s,A=e[t+0],u=A,l=A;for(s=0;s<a;++s)u=l+(A=e[t+s])-u,l=n[r+s]+(-256&u?0>u?0:255:u)&255,u=A,i[o+s]=l}}function fn(e,n,i,a){var s=n.width,A=n.o;if(t(null!=e&&null!=n),0>i||0>=a||i+a>A)return null;if(!e.Cc){if(null==e.ga){var u;if(e.ga=new An,(u=null==e.ga)||(u=n.width*n.o,t(0==e.Gb.length),e.Gb=o(u),e.Uc=0,null==e.Gb?u=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,u=1),u=!u),!u){u=e.ga;var l=e.Fa,c=e.P,f=e.qc,h=e.mb,d=e.nb,p=c+1,g=f-1,v=u.l;if(t(null!=l&&null!=h&&null!=n),gi[0]=null,gi[1]=un,gi[2]=ln,gi[3]=cn,u.ca=h,u.tb=d,u.c=n.width,u.i=n.height,t(0<u.c&&0<u.i),1>=f)n=0;else if(u.$a=3&l[c+0],u.Z=l[c+0]>>2&3,u.Lc=l[c+0]>>4&3,c=l[c+0]>>6&3,0>u.$a||1<u.$a||4<=u.Z||1<u.Lc||c)n=0;else if(v.put=he,v.ac=fe,v.bc=de,v.ma=u,v.width=n.width,v.height=n.height,v.Da=n.Da,v.v=n.v,v.va=n.va,v.j=n.j,v.o=n.o,u.$a)e:{t(1==u.$a),n=ke();t:for(;;){if(null==n){n=0;break e}if(t(null!=u),u.mc=n,n.c=u.c,n.i=u.i,n.l=u.l,n.l.ma=u,n.l.width=u.c,n.l.height=u.i,n.a=0,m(n.m,l,p,g),!_e(u.c,u.i,1,n,null))break t;if(1==n.ab&&3==n.gc[0].hc&&xe(n.s)?(u.ic=1,l=n.c*n.i,n.Ta=null,n.Ua=0,n.V=o(l),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(u.ic=0,n=Ie(n,u.c)),!n)break t;n=1;break e}u.mc=null,n=0}else n=g>=u.c*u.i;u=!n}if(u)return null;1!=e.ga.Lc?e.Ga=0:a=A-i}t(null!=e.ga),t(i+a<=A);e:{if(n=(l=e.ga).c,A=l.l.o,0==l.$a){if(p=e.rc,g=e.Vc,v=e.Fa,c=e.P+1+i*n,f=e.mb,h=e.nb+i*n,t(c<=e.P+e.qc),0!=l.Z)for(t(null!=gi[l.Z]),u=0;u<a;++u)gi[l.Z](p,g,v,c,f,h,n),p=f,g=h,h+=n,c+=n;else for(u=0;u<a;++u)r(f,h,v,c,n),p=f,g=h,h+=n,c+=n;e.rc=p,e.Vc=g}else{if(t(null!=l.mc),n=i+a,t(null!=(u=l.mc)),t(n<=u.i),u.C>=n)n=1;else if(l.ic||mn(),l.ic){l=u.V,p=u.Ba,g=u.c;var w=u.i,y=(v=1,c=u.$/g,f=u.$%g,h=u.m,d=u.s,u.$),b=g*w,B=g*n,C=d.wc,E=y<B?ye(d,f,c):null;t(y<=b),t(n<=w),t(xe(d));t:for(;;){for(;!h.h&&y<B;){if(f&C||(E=ye(d,f,c)),t(null!=E),F(h),256>(w=ve(E.G[0],E.H[0],h)))l[p+y]=w,++y,++f>=g&&(f=0,++c<=n&&!(c%16)&&Fe(u,c));else{if(!(280>w)){v=0;break t}w=ge(w-256,h);var S,k=ve(E.G[4],E.H[4],h);if(F(h),!(y>=(k=me(g,k=ge(k,h)))&&b-y>=w)){v=0;break t}for(S=0;S<w;++S)l[p+y+S]=l[p+y+S-k];for(y+=w,f+=w;f>=g;)f-=g,++c<=n&&!(c%16)&&Fe(u,c);y<B&&f&C&&(E=ye(d,f,c))}t(h.h==x(h))}Fe(u,c>n?n:c);break t}!v||h.h&&y<b?(v=0,u.a=h.h?5:3):u.$=y,n=v}else n=Ee(u,u.V,u.Ba,u.c,u.i,n,Ne);if(!n){a=0;break e}}i+a>=A&&(e.Cc=1),a=1}if(!a)return null;if(e.Cc&&(null!=(a=e.ga)&&(a.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+i*s}function hn(e,t,n,r,i,o){for(;0<i--;){var a,s=e,A=t+(n?1:0),u=e,l=t+(n?0:3);for(a=0;a<r;++a){var c=u[l+4*a];255!=c&&(c*=32897,s[A+4*a+0]=s[A+4*a+0]*c>>23,s[A+4*a+1]=s[A+4*a+1]*c>>23,s[A+4*a+2]=s[A+4*a+2]*c>>23)}t+=o}}function dn(e,t,n,r,i){for(;0<r--;){var o;for(o=0;o<n;++o){var a=e[t+2*o+0],s=15&(u=e[t+2*o+1]),A=4369*s,u=(240&u|u>>4)*A>>16;e[t+2*o+0]=(240&a|a>>4)*A>>16&240|(15&a|a<<4)*A>>16>>4&15,e[t+2*o+1]=240&u|s}t+=i}}function pn(e,t,n,r,i,o,a,s){var A,u,l=255;for(u=0;u<i;++u){for(A=0;A<r;++A){var c=e[t+A];o[a+4*A]=c,l&=c}t+=n,a+=s}return 255!=l}function gn(e,t,n,r,i){var o;for(o=0;o<i;++o)n[r+o]=e[t+o]>>8}function mn(){xr=hn,Cr=dn,Fr=pn,Er=gn}function vn(n,r,i){e[n]=function(e,n,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w){var y,b=w-1>>1,B=s[A+0]|u[l+0]<<16,x=c[f+0]|h[d+0]<<16;t(null!=e);var C=3*B+x+131074>>2;for(r(e[n+0],255&C,C>>16,p,g),null!=o&&(C=3*x+B+131074>>2,r(o[a+0],255&C,C>>16,m,v)),y=1;y<=b;++y){var F=s[A+y]|u[l+y]<<16,E=c[f+y]|h[d+y]<<16,S=B+F+x+E+524296,k=S+2*(F+x)>>3;C=k+B>>1,B=(S=S+2*(B+E)>>3)+F>>1,r(e[n+2*y-1],255&C,C>>16,p,g+(2*y-1)*i),r(e[n+2*y-0],255&B,B>>16,p,g+(2*y-0)*i),null!=o&&(C=S+x>>1,B=k+E>>1,r(o[a+2*y-1],255&C,C>>16,m,v+(2*y-1)*i),r(o[a+2*y+0],255&B,B>>16,m,v+(2*y+0)*i)),B=F,x=E}1&w||(C=3*B+x+131074>>2,r(e[n+w-1],255&C,C>>16,p,g+(w-1)*i),null!=o&&(C=3*x+B+131074>>2,r(o[a+w-1],255&C,C>>16,m,v+(w-1)*i)))}}function wn(){mi[Rr]=vi,mi[Tr]=yi,mi[Pr]=wi,mi[Or]=bi,mi[Mr]=Bi,mi[Hr]=xi,mi[jr]=Ci,mi[zr]=yi,mi[Kr]=bi,mi[Wr]=Bi,mi[Vr]=xi}function yn(e){return e&~Ii?0>e?0:255:e>>_i}function bn(e,t){return yn((19077*e>>8)+(26149*t>>8)-14234)}function Bn(e,t,n){return yn((19077*e>>8)-(6419*t>>8)-(13320*n>>8)+8708)}function xn(e,t){return yn((19077*e>>8)+(33050*t>>8)-17685)}function Cn(e,t,n,r,i){r[i+0]=bn(e,n),r[i+1]=Bn(e,t,n),r[i+2]=xn(e,t)}function Fn(e,t,n,r,i){r[i+0]=xn(e,t),r[i+1]=Bn(e,t,n),r[i+2]=bn(e,n)}function En(e,t,n,r,i){var o=Bn(e,t,n);t=o<<3&224|xn(e,t)>>3,r[i+0]=248&bn(e,n)|o>>5,r[i+1]=t}function Sn(e,t,n,r,i){var o=240&xn(e,t)|15;r[i+0]=240&bn(e,n)|Bn(e,t,n)>>4,r[i+1]=o}function kn(e,t,n,r,i){r[i+0]=255,Cn(e,t,n,r,i+1)}function _n(e,t,n,r,i){Fn(e,t,n,r,i),r[i+3]=255}function In(e,t,n,r,i){Cn(e,t,n,r,i),r[i+3]=255}function We(e,t){return 0>e?0:e>t?t:e}function Nn(t,n,r){e[t]=function(e,t,i,o,a,s,A,u,l){for(var c=u+(-2&l)*r;u!=c;)n(e[t+0],i[o+0],a[s+0],A,u),n(e[t+1],i[o+0],a[s+0],A,u+r),t+=2,++o,++s,u+=2*r;1&l&&n(e[t+0],i[o+0],a[s+0],A,u)}}function Un(e,t,n){return 0==n?0==e?0==t?6:5:0==t?4:0:n}function Ln(e,t,n,r,i){switch(e>>>30){case 3:ar(t,n,r,i,0);break;case 2:sr(t,n,r,i);break;case 1:ur(t,n,r,i)}}function Qn(e,t){var n,o,a=t.M,s=t.Nb,A=e.oc,u=e.pc+40,l=e.oc,c=e.pc+584,f=e.oc,h=e.pc+600;for(n=0;16>n;++n)A[u+32*n-1]=129;for(n=0;8>n;++n)l[c+32*n-1]=129,f[h+32*n-1]=129;for(0<a?A[u-1-32]=l[c-1-32]=f[h-1-32]=129:(i(A,u-32-1,127,21),i(l,c-32-1,127,9),i(f,h-32-1,127,9)),o=0;o<e.za;++o){var d=t.ya[t.aa+o];if(0<o){for(n=-1;16>n;++n)r(A,u+32*n-4,A,u+32*n+12,4);for(n=-1;8>n;++n)r(l,c+32*n-4,l,c+32*n+4,4),r(f,h+32*n-4,f,h+32*n+4,4)}var p=e.Gd,g=e.Hd+o,m=d.ad,v=d.Hc;if(0<a&&(r(A,u-32,p[g].y,0,16),r(l,c-32,p[g].f,0,8),r(f,h-32,p[g].ea,0,8)),d.Za){var w=A,y=u-32+16;for(0<a&&(o>=e.za-1?i(w,y,p[g].y[15],4):r(w,y,p[g+1].y,0,4)),n=0;4>n;n++)w[y+128+n]=w[y+256+n]=w[y+384+n]=w[y+0+n];for(n=0;16>n;++n,v<<=2)w=A,y=u+Pi[n],fi[d.Ob[n]](w,y),Ln(v,m,16*+n,w,y)}else if(w=Un(o,a,d.Ob[0]),ci[w](A,u),0!=v)for(n=0;16>n;++n,v<<=2)Ln(v,m,16*+n,A,u+Pi[n]);for(n=d.Gc,w=Un(o,a,d.Dd),hi[w](l,c),hi[w](f,h),v=m,w=l,y=c,255&(d=n|0)&&(170&d?Ar(v,256,w,y):lr(v,256,w,y)),d=f,v=h,255&(n>>=8)&&(170&n?Ar(m,320,d,v):lr(m,320,d,v)),a<e.Ub-1&&(r(p[g].y,0,A,u+480,16),r(p[g].f,0,l,c+224,8),r(p[g].ea,0,f,h+224,8)),n=8*s*e.B,p=e.sa,g=e.ta+16*o+16*s*e.R,m=e.qa,d=e.ra+8*o+n,v=e.Ha,w=e.Ia+8*o+n,n=0;16>n;++n)r(p,g+n*e.R,A,u+32*n,16);for(n=0;8>n;++n)r(m,d+n*e.B,l,c+32*n,8),r(v,w+n*e.B,f,h+32*n,8)}}function Dn(e,r,i,o,a,s,A,u,l){var c=[0],f=[0],h=0,d=null!=l?l.kd:0,p=null!=l?l:new rn;if(null==e||12>i)return 7;p.data=e,p.w=r,p.ha=i,r=[r],i=[i],p.gb=[p.gb];e:{var g=r,v=i,w=p.gb;if(t(null!=e),t(null!=v),t(null!=w),w[0]=0,12<=v[0]&&!n(e,g[0],"RIFF")){if(n(e,g[0]+8,"WEBP")){w=3;break e}var y=U(e,g[0]+4);if(12>y||4294967286<y){w=3;break e}if(d&&y>v[0]-8){w=7;break e}w[0]=y,g[0]+=12,v[0]-=12}w=0}if(0!=w)return w;for(y=0<p.gb[0],i=i[0];;){e:{var B=e;v=r,w=i;var x=c,C=f,F=g=[0];if((k=h=[h])[0]=0,8>w[0])w=7;else{if(!n(B,v[0],"VP8X")){if(10!=U(B,v[0]+4)){w=3;break e}if(18>w[0]){w=7;break e}var E=U(B,v[0]+8),S=1+N(B,v[0]+12);if(2147483648<=S*(B=1+N(B,v[0]+15))){w=3;break e}null!=F&&(F[0]=E),null!=x&&(x[0]=S),null!=C&&(C[0]=B),v[0]+=18,w[0]-=18,k[0]=1}w=0}}if(h=h[0],g=g[0],0!=w)return w;if(v=!!(2&g),!y&&h)return 3;if(null!=s&&(s[0]=!!(16&g)),null!=A&&(A[0]=v),null!=u&&(u[0]=0),A=c[0],g=f[0],h&&v&&null==l){w=0;break}if(4>i){w=7;break}if(y&&h||!y&&!h&&!n(e,r[0],"ALPH")){i=[i],p.na=[p.na],p.P=[p.P],p.Sa=[p.Sa];e:{E=e,w=r,y=i;var k=p.gb;x=p.na,C=p.P,F=p.Sa,S=22,t(null!=E),t(null!=y),B=w[0];var _=y[0];for(t(null!=x),t(null!=F),x[0]=null,C[0]=null,F[0]=0;;){if(w[0]=B,y[0]=_,8>_){w=7;break e}var I=U(E,B+4);if(4294967286<I){w=3;break e}var L=8+I+1&-2;if(S+=L,0<k&&S>k){w=3;break e}if(!n(E,B,"VP8 ")||!n(E,B,"VP8L")){w=0;break e}if(_[0]<L){w=7;break e}n(E,B,"ALPH")||(x[0]=E,C[0]=B+8,F[0]=I),B+=L,_-=L}}if(i=i[0],p.na=p.na[0],p.P=p.P[0],p.Sa=p.Sa[0],0!=w)break}i=[i],p.Ja=[p.Ja],p.xa=[p.xa];e:if(k=e,w=r,y=i,x=p.gb[0],C=p.Ja,F=p.xa,E=w[0],B=!n(k,E,"VP8 "),S=!n(k,E,"VP8L"),t(null!=k),t(null!=y),t(null!=C),t(null!=F),8>y[0])w=7;else{if(B||S){if(k=U(k,E+4),12<=x&&k>x-12){w=3;break e}if(d&&k>y[0]-8){w=7;break e}C[0]=k,w[0]+=8,y[0]-=8,F[0]=S}else F[0]=5<=y[0]&&47==k[E+0]&&!(k[E+4]>>5),C[0]=y[0];w=0}if(i=i[0],p.Ja=p.Ja[0],p.xa=p.xa[0],r=r[0],0!=w)break;if(4294967286<p.Ja)return 3;if(null==u||v||(u[0]=p.xa?2:1),A=[A],g=[g],p.xa){if(5>i){w=7;break}u=A,d=g,v=s,null==e||5>i?e=0:5<=i&&47==e[r+0]&&!(e[r+4]>>5)?(y=[0],k=[0],x=[0],m(C=new b,e,r,i),pe(C,y,k,x)?(null!=u&&(u[0]=y[0]),null!=d&&(d[0]=k[0]),null!=v&&(v[0]=x[0]),e=1):e=0):e=0}else{if(10>i){w=7;break}u=g,null==e||10>i||!Xe(e,r+3,i-3)?e=0:(d=e[r+0]|e[r+1]<<8|e[r+2]<<16,v=16383&(e[r+7]<<8|e[r+6]),e=16383&(e[r+9]<<8|e[r+8]),1&d||3<(d>>1&7)||!(d>>4&1)||d>>5>=p.Ja||!v||!e?e=0:(A&&(A[0]=v),u&&(u[0]=e),e=1))}if(!e)return 3;if(A=A[0],g=g[0],h&&(c[0]!=A||f[0]!=g))return 3;null!=l&&(l[0]=p,l.offset=r-l.w,t(4294967286>r-l.w),t(l.offset==l.ha-i));break}return 0==w||7==w&&h&&null==l?(null!=s&&(s[0]|=null!=p.na&&0<p.na.length),null!=o&&(o[0]=A),null!=a&&(a[0]=g),0):w}function Rn(e,t,n){var r=t.width,i=t.height,o=0,a=0,s=r,A=i;if(t.Da=null!=e&&0<e.Da,t.Da&&(s=e.cd,A=e.bd,o=e.v,a=e.j,11>n||(o&=-2,a&=-2),0>o||0>a||0>=s||0>=A||o+s>r||a+A>i))return 0;if(t.v=o,t.j=a,t.va=o+s,t.o=a+A,t.U=s,t.T=A,t.da=null!=e&&0<e.da,t.da){if(!R(s,A,n=[e.ib],o=[e.hb]))return 0;t.ib=n[0],t.hb=o[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*r/4&&t.hb<3*i/4,t.Kb=0),1}function Tn(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function Pn(e,t,n,r){if(null==r||0>=e||0>=t)return 2;if(null!=n){if(n.Da){var i=n.cd,a=n.bd,s=-2&n.v,A=-2&n.j;if(0>s||0>A||0>=i||0>=a||s+i>e||A+a>t)return 2;e=i,t=a}if(n.da){if(!R(e,t,i=[n.ib],a=[n.hb]))return 2;e=i[0],t=a[0]}}r.width=e,r.height=t;e:{var u=r.width,l=r.height;if(e=r.S,0>=u||0>=l||!(e>=Rr&&13>e))e=2;else{if(0>=r.Rd&&null==r.sd){s=a=i=t=0;var c=(A=u*ji[e])*l;if(11>e||(a=(l+1)/2*(t=(u+1)/2),12==e&&(s=(i=u)*l)),null==(l=o(c+2*a+s))){e=1;break e}r.sd=l,11>e?((u=r.f.RGBA).eb=l,u.fb=0,u.A=A,u.size=c):((u=r.f.kb).y=l,u.O=0,u.fa=A,u.Fd=c,u.f=l,u.N=0+c,u.Ab=t,u.Cd=a,u.ea=l,u.W=0+c+a,u.Db=t,u.Ed=a,12==e&&(u.F=l,u.J=0+c+2*a),u.Tc=s,u.lb=i)}if(t=1,i=r.S,a=r.width,s=r.height,i>=Rr&&13>i)if(11>i)e=r.f.RGBA,t&=(A=Math.abs(e.A))*(s-1)+a<=e.size,t&=A>=a*ji[i],t&=null!=e.eb;else{e=r.f.kb,A=(a+1)/2,c=(s+1)/2,u=Math.abs(e.fa),l=Math.abs(e.Ab);var f=Math.abs(e.Db),h=Math.abs(e.lb),d=h*(s-1)+a;t&=u*(s-1)+a<=e.Fd,t&=l*(c-1)+A<=e.Cd,t=(t&=f*(c-1)+A<=e.Ed)&u>=a&l>=A&f>=A,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==i&&(t&=h>=a,t&=d<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=n&&n.fd&&(e=Tn(r)),e}var On=64,Mn=[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],Hn=24,jn=32,zn=8,Kn=[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];O("Predictor0","PredictorAdd0"),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,n){return t[n+0]},e.Predictor3=function(e,t,n){return t[n+1]},e.Predictor4=function(e,t,n){return t[n-1]},e.Predictor5=function(e,t,n){return H(H(e,t[n+1]),t[n+0])},e.Predictor6=function(e,t,n){return H(e,t[n-1])},e.Predictor7=function(e,t,n){return H(e,t[n+0])},e.Predictor8=function(e,t,n){return H(t[n-1],t[n+0])},e.Predictor9=function(e,t,n){return H(t[n+0],t[n+1])},e.Predictor10=function(e,t,n){return H(H(e,t[n-1]),H(t[n+0],t[n+1]))},e.Predictor11=function(e,t,n){var r=t[n+0];return 0>=K(r>>24&255,e>>24&255,(t=t[n-1])>>24&255)+K(r>>16&255,e>>16&255,t>>16&255)+K(r>>8&255,e>>8&255,t>>8&255)+K(255&r,255&e,255&t)?r:e},e.Predictor12=function(e,t,n){var r=t[n+0];return(j((e>>24&255)+(r>>24&255)-((t=t[n-1])>>24&255))<<24|j((e>>16&255)+(r>>16&255)-(t>>16&255))<<16|j((e>>8&255)+(r>>8&255)-(t>>8&255))<<8|j((255&e)+(255&r)-(255&t)))>>>0},e.Predictor13=function(e,t,n){var r=t[n-1];return(z((e=H(e,t[n+0]))>>24&255,r>>24&255)<<24|z(e>>16&255,r>>16&255)<<16|z(e>>8&255,r>>8&255)<<8|z(255&e,255&r))>>>0};var Wn=e.PredictorAdd0;e.PredictorAdd1=W,O("Predictor2","PredictorAdd2"),O("Predictor3","PredictorAdd3"),O("Predictor4","PredictorAdd4"),O("Predictor5","PredictorAdd5"),O("Predictor6","PredictorAdd6"),O("Predictor7","PredictorAdd7"),O("Predictor8","PredictorAdd8"),O("Predictor9","PredictorAdd9"),O("Predictor10","PredictorAdd10"),O("Predictor11","PredictorAdd11"),O("Predictor12","PredictorAdd12"),O("Predictor13","PredictorAdd13");var Vn=e.PredictorAdd2;X("ColorIndexInverseTransform","MapARGB","32b",function(e){return e>>8&255},function(e){return e}),X("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(e){return e},function(e){return e>>8&255});var Gn,qn=e.ColorIndexInverseTransform,Xn=e.MapARGB,Yn=e.VP8LColorIndexInverseTransformAlpha,Jn=e.MapAlpha,Zn=e.VP8LPredictorsAdd=[];Zn.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var $n,er,tr,nr,rr,ir,or,ar,sr,Ar,ur,lr,cr,fr,hr,dr,pr,gr,mr,vr,wr,yr,br,Br,xr,Cr,Fr,Er,Sr=o(511),kr=o(2041),_r=o(225),Ir=o(767),Nr=0,Ur=kr,Lr=_r,Qr=Ir,Dr=Sr,Rr=0,Tr=1,Pr=2,Or=3,Mr=4,Hr=5,jr=6,zr=7,Kr=8,Wr=9,Vr=10,Gr=[2,3,7],qr=[3,3,11],Xr=[280,256,256,256,40],Yr=[0,1,1,1,0],Jr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Zr=[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],$r=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ei=8,ti=[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],ni=[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],ri=null,ii=[[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]],oi=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ai=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],si=[[[[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]]]],Ai=[[[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]]],ui=[[[[255,255,255,255,255,255,255,255,255,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]]]],li=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ci=[],fi=[],hi=[],di=1,pi=2,gi=[],mi=[];vn("UpsampleRgbLinePair",Cn,3),vn("UpsampleBgrLinePair",Fn,3),vn("UpsampleRgbaLinePair",In,4),vn("UpsampleBgraLinePair",_n,4),vn("UpsampleArgbLinePair",kn,4),vn("UpsampleRgba4444LinePair",Sn,2),vn("UpsampleRgb565LinePair",En,2);var vi=e.UpsampleRgbLinePair,wi=e.UpsampleBgrLinePair,yi=e.UpsampleRgbaLinePair,bi=e.UpsampleBgraLinePair,Bi=e.UpsampleArgbLinePair,xi=e.UpsampleRgba4444LinePair,Ci=e.UpsampleRgb565LinePair,Fi=16,Ei=1<<Fi-1,Si=-227,ki=482,_i=6,Ii=(256<<_i)-1,Ni=0,Ui=o(256),Li=o(256),Qi=o(256),Di=o(256),Ri=o(ki-Si),Ti=o(ki-Si);Nn("YuvToRgbRow",Cn,3),Nn("YuvToBgrRow",Fn,3),Nn("YuvToRgbaRow",In,4),Nn("YuvToBgraRow",_n,4),Nn("YuvToArgbRow",kn,4),Nn("YuvToRgba4444Row",Sn,2),Nn("YuvToRgb565Row",En,2);var Pi=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Oi=[0,2,8],Mi=[8,7,6,4,4,2,2,2,1,1,1,1],Hi=1;this.WebPDecodeRGBA=function(e,n,r,i,o){var a=Tr,s=new nn,A=new ae;s.ba=A,A.S=a,A.width=[A.width],A.height=[A.height];var u=A.width,l=A.height,c=new se;if(null==c||null==e)var f=2;else t(null!=c),f=Dn(e,n,r,c.width,c.height,c.Pd,c.Qd,c.format,null);if(0!=f?u=0:(null!=u&&(u[0]=c.width[0]),null!=l&&(l[0]=c.height[0]),u=1),u){A.width=A.width[0],A.height=A.height[0],null!=i&&(i[0]=A.width),null!=o&&(o[0]=A.height);e:{if(i=new Ve,(o=new rn).data=e,o.w=n,o.ha=r,o.kd=1,n=[0],t(null!=o),(0==(e=Dn(o.data,o.w,o.ha,null,null,null,n,null,o))||7==e)&&n[0]&&(e=4),0==(n=e)){if(t(null!=s),i.data=o.data,i.w=o.w+o.offset,i.ha=o.ha-o.offset,i.put=he,i.ac=fe,i.bc=de,i.ma=s,o.xa){if(null==(e=ke())){s=1;break e}if(function(e,n){var r=[0],i=[0],o=[0];t:for(;;){if(null==e)return 0;if(null==n)return e.a=2,0;if(e.l=n,e.a=0,m(e.m,n.data,n.w,n.ha),!pe(e.m,r,i,o)){e.a=3;break t}if(e.xb=pi,n.width=r[0],n.height=i[0],!_e(r[0],i[0],1,e,null))break t;return 1}return t(0!=e.a),0}(e,i)){if(i=0==(n=Pn(i.width,i.height,s.Oa,s.ba))){t:{i=e;n:for(;;){if(null==i){i=0;break t}if(t(null!=i.s.yc),t(null!=i.s.Ya),t(0<i.s.Wb),t(null!=(r=i.l)),t(null!=(o=r.ma)),0!=i.xb){if(i.ca=o.ba,i.tb=o.tb,t(null!=i.ca),!Rn(o.Oa,r,Or)){i.a=2;break n}if(!Ie(i,r.width))break n;if(r.da)break n;if((r.da||re(i.ca.S))&&mn(),11>i.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=i.ca.f.kb.F&&mn()),i.Pb&&0<i.s.ua&&null==i.s.vb.X&&!L(i.s.vb,i.s.Wa.Xa)){i.a=1;break n}i.xb=0}if(!Ee(i,i.V,i.Ba,i.c,i.i,r.o,Be))break n;o.Dc=i.Ma,i=1;break t}t(0!=i.a),i=0}i=!i}i&&(n=e.a)}else n=e.a}else{if(null==(e=new Ge)){s=1;break e}if(e.Fa=o.na,e.P=o.P,e.qc=o.Sa,Ye(e,i)){if(0==(n=Pn(i.width,i.height,s.Oa,s.ba))){if(e.Aa=0,r=s.Oa,t(null!=(o=e)),null!=r){if(0<(u=0>(u=r.Md)?0:100<u?255:255*u/100)){for(l=c=0;4>l;++l)12>(f=o.pb[l]).lc&&(f.ia=u*Mi[0>f.lc?0:f.lc]>>3),c|=f.ia;c&&(alert("todo:VP8InitRandom"),o.ia=1)}o.Ga=r.Id,100<o.Ga?o.Ga=100:0>o.Ga&&(o.Ga=0)}$e(e,i)||(n=e.a)}}else n=e.a}0==n&&null!=s.Oa&&s.Oa.fd&&(n=Tn(s.ba))}s=n}a=0!=s?null:11>a?A.f.RGBA.eb:A.f.kb.y}else a=null;return a};var ji=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(e,t){for(var n="",r=0;r<4;r++)n+=String.fromCharCode(e[t++]);return n}function l(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function c(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new A;var f=[0],h=[0],d=[],p=new A,g=e,m=function(e,t){var n={},r=0,i=!1,o=0,a=0;if(n.frames=[],!function(e,t){for(var n=0;n<4;n++)if(e[t+n]!="RIFF".charCodeAt(n))return!0;return!1}(e,t)){for(c(e,t+=4),t+=8;t<e.length;){var s=u(e,t),A=c(e,t+=4);t+=4;var f=A+(1&A);switch(s){case"VP8 ":case"VP8L":void 0===n.frames[r]&&(n.frames[r]={}),(p=n.frames[r]).src_off=i?a:t-8,p.src_size=o+A+8,r++,i&&(i=!1,o=0,a=0);break;case"VP8X":(p=n.header={}).feature_flags=e[t];var h=t+4;p.canvas_width=1+l(e,h),h+=3,p.canvas_height=1+l(e,h),h+=3;break;case"ALPH":i=!0,o=f+8,a=t-8;break;case"ANIM":(p=n.header).bgcolor=c(e,t),h=t+4,p.loop_count=(g=e)[(m=h)+0]|g[m+1]<<8,h+=2;break;case"ANMF":var d,p;(p=n.frames[r]={}).offset_x=2*l(e,t),t+=3,p.offset_y=2*l(e,t),t+=3,p.width=1+l(e,t),t+=3,p.height=1+l(e,t),t+=3,p.duration=l(e,t),t+=3,d=e[t++],p.dispose=1&d,p.blend=d>>1&1}"ANMF"!=s&&(t+=f)}var g,m;return n}}(g,0);m.response=g,m.rgbaoutput=!0,m.dataurl=!1;var v=m.header?m.header:null,w=m.frames?m.frames:null;if(v){v.loop_counter=v.loop_count,f=[v.canvas_height],h=[v.canvas_width];for(var y=0;y<w.length&&0!=w[y].blend;y++);}var b=w[0],B=p.WebPDecodeRGBA(g,b.src_off,b.src_size,h,f);b.rgba=B,b.imgwidth=h[0],b.imgheight=f[0];for(var x=0;x<h[0]*f[0]*4;x++)d[x]=B[x];return this.width=h,this.height=f,this.data=d,this}!function(e){var t=function(t,r,A,u){var l=4,c=o;switch(u){case e.image_compression.FAST:l=1,c=i;break;case e.image_compression.MEDIUM:l=6,c=a;break;case e.image_compression.SLOW:l=9,c=s}var f=rw(t=n(t,r,A,c),{level:l});return e.__addimage__.arrayBufferToBinaryString(f)},n=function(e,t,n,r){for(var i,o,a,s=e.length/t,A=new Uint8Array(e.length+s),c=u(),f=0;f<s;f+=1){if(a=f*t,i=e.subarray(a,a+t),r)A.set(r(i,n,o),a+f);else{for(var h,d=c.length,p=[];h<d;h+=1)p[h]=c[h](i,n,o);var g=l(p.concat());A.set(p[g],a+f)}o=i}return A},r=function(e){var t=Array.apply([],e);return t.unshift(0),t},i=function(e,t){var n,r=[],i=e.length;r[0]=1;for(var o=0;o<i;o+=1)n=e[o-t]||0,r[o+1]=e[o]-n+256&255;return r},o=function(e,t,n){var r,i=[],o=e.length;i[0]=2;for(var a=0;a<o;a+=1)r=n&&n[a]||0,i[a+1]=e[a]-r+256&255;return i},a=function(e,t,n){var r,i,o=[],a=e.length;o[0]=3;for(var s=0;s<a;s+=1)r=e[s-t]||0,i=n&&n[s]||0,o[s+1]=e[s]+256-(r+i>>>1)&255;return o},s=function(e,t,n){var r,i,o,a,s=[],u=e.length;s[0]=4;for(var l=0;l<u;l+=1)r=e[l-t]||0,i=n&&n[l]||0,o=n&&n[l-t]||0,a=A(r,i,o),s[l+1]=e[l]-a+256&255;return s},A=function(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),i=Math.abs(e-n),o=Math.abs(e+t-n-n);return r<=i&&r<=o?e:i<=o?t:n},u=function(){return[r,i,o,a,s]},l=function(e){var t=e.map(function(e){return e.reduce(function(e,t){return e+Math.abs(t)},0)});return t.indexOf(Math.min.apply(null,t))};e.processPNG=function(n,r,i,o){var a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b=this.decode.FLATE_DECODE,B="";if(this.__addimage__.isArrayBuffer(n)&&(n=new Uint8Array(n)),this.__addimage__.isArrayBufferView(n)){if(n=(A=new Yy(n)).imgData,s=A.bits,a=A.colorSpace,l=A.colors,-1!==[4,6].indexOf(A.colorType)){if(8===A.bits){d=(h=32==A.pixelBitlength?new Uint32Array(A.decodePixels().buffer):16==A.pixelBitlength?new Uint16Array(A.decodePixels().buffer):new Uint8Array(A.decodePixels().buffer)).length,g=new Uint8Array(d*A.colors),p=new Uint8Array(d);var x,C=A.pixelBitlength-A.bits;for(w=0,y=0;w<d;w++){for(v=h[w],x=0;x<C;)g[y++]=v>>>x&255,x+=A.bits;p[w]=v>>>x&255}}if(16===A.bits){d=(h=new Uint32Array(A.decodePixels().buffer)).length,g=new Uint8Array(d*(32/A.pixelBitlength)*A.colors),p=new Uint8Array(d*(32/A.pixelBitlength)),m=A.colors>1,w=0,y=0;for(var F=0;w<d;)v=h[w++],g[y++]=v>>>0&255,m&&(g[y++]=v>>>16&255,v=h[w++],g[y++]=v>>>0&255),p[F++]=v>>>16&255;s=8}o!==e.image_compression.NONE?(n=t(g,A.width*A.colors,A.colors,o),f=t(p,A.width,1,o)):(n=g,f=p,b=void 0)}if(3===A.colorType&&(a=this.color_spaces.INDEXED,c=A.palette,A.transparency.indexed)){var E=A.transparency.indexed,S=0;for(w=0,d=E.length;w<d;++w)S+=E[w];if((S/=255)===d-1&&-1!==E.indexOf(0))u=[E.indexOf(0)];else if(S!==d){for(h=A.decodePixels(),p=new Uint8Array(h.length),w=0,d=h.length;w<d;w++)p[w]=E[h[w]];f=t(p,A.width,1)}}var k=function(t){var n;switch(t){case e.image_compression.FAST:n=11;break;case e.image_compression.MEDIUM:n=13;break;case e.image_compression.SLOW:n=14;break;default:n=12}return n}(o);return b===this.decode.FLATE_DECODE&&(B="/Predictor "+k+" "),B+="/Colors "+l+" /BitsPerComponent "+s+" /Columns "+A.width,(this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n))&&(n=this.__addimage__.arrayBufferToBinaryString(n)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:i,data:n,index:r,filter:b,decodeParameters:B,transparency:u,palette:c,sMask:f,predictor:k,width:A.width,height:A.height,bitsPerComponent:s,colorSpace:a}}}}(Ow.API),function(e){e.processGIF89A=function(t,n,r,i){var o=new Jy(t),a=o.width,s=o.height,A=[];o.decodeAndBlitFrameRGBA(0,A);var u={data:A,width:a,height:s},l=new $y(100).encode(u,100);return e.processJPEG.call(this,l,n,r,i)},e.processGIF87A=e.processGIF89A}(Ow.API),eb.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,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=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:r,blue:n,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},eb.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(e){Aw.log("bit decode error:"+e)}},eb.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var A=this.palette[o>>7-s&1];this.data[a+4*s]=A.blue,this.data[a+4*s+1]=A.green,this.data[a+4*s+2]=A.red,this.data[a+4*s+3]=255}0!==n&&(this.pos+=4-n)}},eb.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,s=o>>4,A=15&o,u=this.palette[s];if(this.data[a]=u.blue,this.data[a+1]=u.green,this.data[a+2]=u.red,this.data[a+3]=255,2*i+1>=this.width)break;u=this.palette[A],this.data[a+4]=u.blue,this.data[a+4+1]=u.green,this.data[a+4+2]=u.red,this.data[a+4+3]=255}0!==t&&(this.pos+=4-t)}},eb.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;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}0!==e&&(this.pos+=4-e)}},eb.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,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,A=(o>>10&t)/t*255|0,u=o>>15?255:0,l=r*this.width*4+4*i;this.data[l]=A,this.data[l+1]=s,this.data[l+2]=a,this.data[l+3]=u}this.pos+=e}},eb.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,A=(a>>5&n)/n*255|0,u=(a>>11)/t*255|0,l=i*this.width*4+4*o;this.data[l]=u,this.data[l+1]=A,this.data[l+2]=s,this.data[l+3]=255}this.pos+=e}},eb.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=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*n;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},eb.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=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*n;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=a}},eb.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,i){var o=new eb(t,!1),a=o.width,s=o.height,A={data:o.getData(),width:a,height:s},u=new $y(100).encode(A,100);return e.processJPEG.call(this,u,n,r,i)}}(Ow.API),tb.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,i){var o=new tb(t),a=o.width,s=o.height,A={data:o.getData(),width:a,height:s},u=new $y(100).encode(A,100);return e.processJPEG.call(this,u,n,r,i)}}(Ow.API),Ow.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,o=new Uint8Array(i/4*3),a=new Uint8Array(i/4),s=0,A=0,u=0;u<i;u+=4){var l=r[u],c=r[u+1],f=r[u+2],h=r[u+3];o[s++]=l,o[s++]=c,o[s++]=f,a[A++]=h}var d=this.__addimage__.arrayBufferToBinaryString(o);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:d,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Ow.API.setLanguage=function(e){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={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]&&(this.internal.languageSettings.languageCode=e,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Wy=Ow.API,Vy=Wy.getCharWidthsArray=function(e,t){var n,r,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,A=s.fof?s.fof:1,u=t.kerning?t.kerning:i.metadata.Unicode.kerning,l=u.fof?u.fof:1,c=!1!==t.doKerning,f=0,h=e.length,d=0,p=s[0]||A,g=[];for(n=0;n<h;n++)r=e.charCodeAt(n),"function"==typeof i.metadata.widthOfString?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/o)||0)/1e3):(f=c&&"object"===(0,uv.A)(u[r])&&!isNaN(parseInt(u[r][d],10))?u[r][d]/l:0,g.push((s[r]||p)/A+f)),d=r;return g},Gy=Wy.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return Wy.processArabic&&(e=Wy.processArabic(e)),"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(e,n,i)/n:Vy.apply(this,arguments).reduce(function(e,t){return e+t},0)},qy=function(e,t,n,r){for(var i=[],o=0,a=e.length,s=0;o!==a&&s+t[o]<n;)s+=t[o],o++;i.push(e.slice(0,o));var A=o;for(s=0;o!==a;)s+t[o]>r&&(i.push(e.slice(A,o)),s=0,A=o),s+=t[o],o++;return A!==o&&i.push(e.slice(A,o)),i},Xy=function(e,t,n){n||(n={});var r,i,o,a,s,A,u,l=[],c=[l],f=n.textIndent||0,h=0,d=0,p=e.split(" "),g=Vy.apply(this,[" ",n])[0];if(A=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(A).join(" "),v=[];p.map(function(e){(e=e.split(/\s*\n/)).length>1?v=v.concat(e.map(function(e,t){return(t&&e.length?"\n":"")+e})):v.push(e[0])}),p=v,A=Gy.apply(this,[m,n])}for(o=0,a=p.length;o<a;o++){var w=0;if(r=p[o],A&&"\n"==r[0]&&(r=r.substr(1),w=1),f+h+(d=(i=Vy.apply(this,[r,n])).reduce(function(e,t){return e+t},0))>t||w){if(d>t){for(s=qy.apply(this,[r,i,t-(f+h),t]),l.push(s.shift()),l=[s.pop()];s.length;)c.push([s.shift()]);d=i.slice(r.length-(l[0]?l[0].length:0)).reduce(function(e,t){return e+t},0)}else l=[r];c.push(l),f=d+A,h=g}else l.push(r),f+=h+d,h=g}return u=A?function(e,t){return(t?m:"")+e.join(" ")}:function(e){return e.join(" ")},c.map(u)},Wy.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle);return t.metadata.Unicode?{widths:t.metadata.Unicode.widths||{0:1},kerning:t.metadata.Unicode.kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=n.lineIndent;var s,A,u=[];for(s=0,A=r.length;s<A;s++)u=u.concat(Xy.apply(this,[r[s],a,o]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",n={},r={},i=0;i<16;i++)n[t[i]]="0123456789abcdef"[i],r["0123456789abcdef"[i]]=t[i];var o=function(e){return"0x"+parseInt(e,10).toString(16)},a=e.__fontmetrics__.compress=function(e){var t,n,i,s,A=["{"];for(var u in e){if(t=e[u],isNaN(parseInt(u,10))?n="'"+u+"'":(u=parseInt(u,10),n=(n=o(u).slice(2)).slice(0,-1)+r[n.slice(-1)]),"number"==typeof t)t<0?(i=o(t).slice(3),s="-"):(i=o(t).slice(2),s=""),i=s+i.slice(0,-1)+r[i.slice(-1)];else{if("object"!==(0,uv.A)(t))throw new Error("Don't know what to do with value type "+(0,uv.A)(t)+".");i=a(t)}A.push(n+i)}return A.push("}"),A.join("")},s=e.__fontmetrics__.uncompress=function(e){if("string"!=typeof e)throw new Error("Invalid argument passed to uncompress.");for(var t,r,i,o,a={},s=1,A=a,u=[],l="",c="",f=e.length-1,h=1;h<f;h+=1)"'"==(o=e[h])?t?(i=t.join(""),t=void 0):t=[]:t?t.push(o):"{"==o?(u.push([A,i]),A={},i=void 0):"}"==o?((r=u.pop())[0][r[1]]=A,i=void 0,A=r[0]):"-"==o?s=-1:void 0===i?n.hasOwnProperty(o)?(l+=n[o],i=parseInt(l,16)*s,s=1,l=""):l+=o:n.hasOwnProperty(o)?(c+=n[o],A[i]=parseInt(c,16)*s,s=1,i=void 0,c=""):c+=o;return a},A={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:A,"Courier-Bold":A,"Courier-BoldOblique":A,"Courier-Oblique":A,Helvetica:A,"Helvetica-Bold":A,"Helvetica-BoldOblique":A,"Helvetica-Oblique":A,"Times-Roman":A,"Times-Bold":A,"Times-BoldItalic":A,"Times-Italic":A}},l={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'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":s("{'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:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'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:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'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":s("{'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:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'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":s("{'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":s("{'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(e){var t=e.font,n=l.Unicode[t.postScriptName];n&&(t.metadata.Unicode={},t.metadata.Unicode.widths=n.widths,t.metadata.Unicode.kerning=n.kerning);var r=u.Unicode[t.postScriptName];r&&(t.metadata.Unicode.encoding=r,t.encoding=r.codePages[0])}])}(Ow.API),function(e){var t=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,o=n.instance;if(!i.isStandardFont){if(void 0===o)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if("string"!=typeof(r=!1===o.existsFileInVFS(i.postScriptName)?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");!function(n,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(fw(r)),n.metadata=e.API.TTFFont.open(r),n.metadata.Unicode=n.metadata.Unicode||{encoding:{},kerning:{},widths:[]},n.metadata.glyIdsUsed=[0]}(i,r)}}])}(Ow),Ow.API.addSvgAsImage=function(e,t,r,i,o,a,s,A){if(isNaN(t)||isNaN(r))throw Aw.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Aw.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=i,u.height=o;var l=u.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,u.width,u.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(aw.canvg?Promise.resolve(aw.canvg):n.e(455).then(n.bind(n,8455))).catch(function(e){return Promise.reject(new Error("Could not load canvg: "+e))}).then(function(e){return e.default?e.default:e}).then(function(t){return t.fromString(l,e,c)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(e){return e.render(c)}).then(function(){f.addImage(u.toDataURL("image/jpeg",1),t,r,i,o,s,A)})},Ow.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},Ow.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,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),A=[],u=0,l=0,c=0;function f(e,t){var n,r=!1;for(n=0;n<e.length;n+=1)e[n]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var h=s.length;for(c=0;c<h;c+=1)n[s[c]].value=n[s[c]].defaultValue,n[s[c]].explicitSet=!1}if("object"===(0,uv.A)(e))for(i in e)if(o=e[i],f(s,i)&&void 0!==o){if("boolean"===n[i].type&&"boolean"==typeof o)n[i].value=o;else if("name"===n[i].type&&f(n[i].valueSet,o))n[i].value=o;else if("integer"===n[i].type&&Number.isInteger(o))n[i].value=o;else if("array"===n[i].type){for(u=0;u<o.length;u+=1)if(r=!0,1===o[u].length&&"number"==typeof o[u][0])A.push(String(o[u]-1));else if(o[u].length>1){for(l=0;l<o[u].length;l+=1)"number"!=typeof o[u][l]&&(r=!1);!0===r&&A.push([o[u][0]-1,o[u][1]-1].join(" "))}n[i].value="["+A.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var e,t=[];for(e in n)!0===n[e].explicitSet&&("name"===n[e].type?t.push("/"+e+" /"+n[e].value):t.push("/"+e+" "+n[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},function(e){var t=function(){var e='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',t=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(e)),r=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),o=unescape(encodeURIComponent("</x:xmpmeta>")),a=n.length+r.length+i.length+t.length+o.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(t+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(e,r){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:e,namespaceuri:r||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",t)),this}}(Ow.API),function(e){var t=e.API,n=t.pdfEscape16=function(e,t){for(var n,r=t.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=e.length;a<s;++a){if(n=t.metadata.characterToGlyph(e.charCodeAt(a)),t.metadata.glyIdsUsed.push(n),t.metadata.toUnicode[n]=e.charCodeAt(a),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(t.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(i[4-n.length],n)}return o.join("")},r=function(e){var t,n,r,i,o,a,s;for(o="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],a=0,s=(n=Object.keys(e).sort(function(e,t){return e-t})).length;a<s;a++)t=n[a],r.length>=100&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==e[t]&&null!==e[t]&&"function"==typeof e[t].toString&&(i=("0000"+e[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+i+">"));return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var n=t.font,i=t.out,o=t.newObject,a=t.putStream;if(n.metadata instanceof e.API.TTFFont&&"Identity-H"===n.encoding){for(var s=n.metadata.Unicode.widths,A=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),u="",l=0;l<A.length;l++)u+=String.fromCharCode(A[l]);var c=o();a({data:u,addLength1:!0,objectId:c}),i("endobj");var f=o();a({data:r(n.metadata.toUnicode),addLength1:!0,objectId:f}),i("endobj");var h=o();i("<<"),i("/Type /FontDescriptor"),i("/FontName /"+Lw(n.fontName)),i("/FontFile2 "+c+" 0 R"),i("/FontBBox "+e.API.PDFObject.convert(n.metadata.bbox)),i("/Flags "+n.metadata.flags),i("/StemV "+n.metadata.stemV),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i(">>"),i("endobj");var d=o();i("<<"),i("/Type /Font"),i("/BaseFont /"+Lw(n.fontName)),i("/FontDescriptor "+h+" 0 R"),i("/W "+e.API.PDFObject.convert(s)),i("/CIDToGIDMap /Identity"),i("/DW 1000"),i("/Subtype /CIDFontType2"),i("/CIDSystemInfo"),i("<<"),i("/Supplement 0"),i("/Registry (Adobe)"),i("/Ordering ("+n.encoding+")"),i(">>"),i(">>"),i("endobj"),n.objectNumber=o(),i("<<"),i("/Type /Font"),i("/Subtype /Type0"),i("/ToUnicode "+f+" 0 R"),i("/BaseFont /"+Lw(n.fontName)),i("/Encoding /"+n.encoding),i("/DescendantFonts ["+d+" 0 R]"),i(">>"),i("endobj"),n.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var n=t.font,i=t.out,o=t.newObject,a=t.putStream;if(n.metadata instanceof e.API.TTFFont&&"WinAnsiEncoding"===n.encoding){for(var s=n.metadata.rawData,A="",u=0;u<s.length;u++)A+=String.fromCharCode(s[u]);var l=o();a({data:A,addLength1:!0,objectId:l}),i("endobj");var c=o();a({data:r(n.metadata.toUnicode),addLength1:!0,objectId:c}),i("endobj");var f=o();i("<<"),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i("/StemV "+n.metadata.stemV),i("/Type /FontDescriptor"),i("/FontFile2 "+l+" 0 R"),i("/Flags 96"),i("/FontBBox "+e.API.PDFObject.convert(n.metadata.bbox)),i("/FontName /"+Lw(n.fontName)),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i(">>"),i("endobj"),n.objectNumber=o();for(var h=0;h<n.metadata.hmtx.widths.length;h++)n.metadata.hmtx.widths[h]=parseInt(n.metadata.hmtx.widths[h]*(1e3/n.metadata.head.unitsPerEm));i("<</Subtype/TrueType/Type/Font/ToUnicode "+c+" 0 R/BaseFont/"+Lw(n.fontName)+"/FontDescriptor "+f+" 0 R/Encoding/"+n.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(n.metadata.hmtx.widths)+">>"),i("endobj"),n.isAlreadyPutted=!0}}(t)}]);var i=function(e){var t,r=e.text||"",i=e.x,o=e.y,a=e.options||{},s=e.mutex||{},A=s.pdfEscape,u=s.activeFontKey,l=s.fonts,c=u,f="",h=0,d="",p=l[c].encoding;if("Identity-H"!==l[c].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(d=r,c=u,Array.isArray(r)&&(d=r[0]),h=0;h<d.length;h+=1)l[c].metadata.hasOwnProperty("cmap")&&(t=l[c].metadata.cmap.unicode.codeMap[d[h].charCodeAt(0)]),t||d[h].charCodeAt(0)<256&&l[c].metadata.hasOwnProperty("Unicode")?f+=d[h]:f+="";var g="";return parseInt(c.slice(1))<14||"WinAnsiEncoding"===p?g=A(f,c).split("").map(function(e){return e.charCodeAt(0).toString(16)}).join(""):"Identity-H"===p&&(g=n(f,l[c])),s.isHex=!0,{text:g,x:i,y:o,options:a,mutex:s}};t.events.push(["postProcessText",function(e){var t=e.text||"",n=[],r={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var o=0;for(o=0;o<t.length;o+=1)Array.isArray(t[o])&&3===t[o].length?n.push([i(Object.assign({},r,{text:t[o][0]})).text,t[o][1],t[o][2]]):n.push(i(Object.assign({},r,{text:t[o]})).text);e.text=n}else e.text=i(Object.assign({},r,{text:t})).text}])}(Ow),function(e){var t=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]},e.addFileToVFS=function(e,n){return t.call(this),this.internal.vFS[e]=n,this},e.getFileFromVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]?this.internal.vFS[e]:null}}(Ow.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var n,r,i,o,a,s,A,u=t,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],f={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},h={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},d=["(",")","(","<",">","<","[","]","[","{","}","{","\xab","\xbb","\xab","\u2039","\u203a","\u2039","\u2045","\u2046","\u2045","\u207d","\u207e","\u207d","\u208d","\u208e","\u208d","\u2264","\u2265","\u2264","\u2329","\u232a","\u2329","\ufe59","\ufe5a","\ufe59","\ufe5b","\ufe5c","\ufe5b","\ufe5d","\ufe5e","\ufe5d","\ufe64","\ufe65","\ufe64"],p=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var v=function(e){var t=e.charCodeAt(),n=t>>8,r=h[n];return void 0!==r?u[256*r+(255&t)]:252===n||253===n?"AL":p.test(n)?"L":8===n?"R":"N"},w=function(e){for(var t,n=0;n<e.length;n++){if("L"===(t=v(e.charAt(n))))return!1;if("R"===t)return!0}return!1},y=function(e,t,a,s){var A,u,l,c,f=t[s];switch(f){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(f="AN");break;case"AL":g=!0,f="R";break;case"WS":case"BN":f="N";break;case"CS":s<1||s+1>=t.length||"EN"!==(A=a[s-1])&&"AN"!==A||"EN"!==(u=t[s+1])&&"AN"!==u?f="N":g&&(u="AN"),f=u===A?u:"N";break;case"ES":f="EN"===(A=s>0?a[s-1]:"B")&&s+1<t.length&&"EN"===t[s+1]?"EN":"N";break;case"ET":if(s>0&&"EN"===a[s-1]){f="EN";break}if(g){f="N";break}for(l=s+1,c=t.length;l<c&&"ET"===t[l];)l++;f=l<c&&"EN"===t[l]?"EN":"N";break;case"NSM":if(i&&!o){for(c=t.length,l=s+1;l<c&&"NSM"===t[l];)l++;if(l<c){var h=e[s],d=h>=1425&&h<=2303||64286===h;if(A=t[l],d&&("R"===A||"AL"===A)){f="R";break}}}f=s<1||"B"===(A=t[s-1])?"N":a[s-1];break;case"B":g=!1,n=!0,f=m;break;case"S":r=!0,f="N"}return f},b=function(e,t,n){var r=e.split("");return n&&B(r,n,{hiLevel:m}),r.reverse(),t&&t.reverse(),r.join("")},B=function(e,t,i){var o,a,s,A,u,h=-1,d=e.length,p=0,w=[],b=m?c:l,B=[];for(g=!1,n=!1,r=!1,a=0;a<d;a++)B[a]=v(e[a]);for(s=0;s<d;s++){if(u=p,w[s]=y(e,B,w,s),o=240&(p=b[u][f[w[s]]]),p&=15,t[s]=A=b[p][5],o>0)if(16===o){for(a=h;a<s;a++)t[a]=1;h=-1}else h=-1;if(b[p][6])-1===h&&(h=s);else if(h>-1){for(a=h;a<s;a++)t[a]=A;h=-1}"B"===B[s]&&(t[s]=0),i.hiLevel|=A}r&&function(e,t,n){for(var r=0;r<n;r++)if("S"===e[r]){t[r]=m;for(var i=r-1;i>=0&&"WS"===e[i];i--)t[i]=m}}(B,t,d)},x=function(e,t,r,i,o){if(!(o.hiLevel<e)){if(1===e&&1===m&&!n)return t.reverse(),void(r&&r.reverse());for(var a,s,A,u,l=t.length,c=0;c<l;){if(i[c]>=e){for(A=c+1;A<l&&i[A]>=e;)A++;for(u=c,s=A-1;u<s;u++,s--)a=t[u],t[u]=t[s],t[s]=a,r&&(a=r[u],r[u]=r[s],r[s]=a);c=A}c++}}},C=function(e,t,n){var r=e.split(""),i={hiLevel:m};return n||(n=[]),B(r,n,i),function(e,t,n){if(0!==n.hiLevel&&A)for(var r,i=0;i<e.length;i++)1===t[i]&&(r=d.indexOf(e[i]))>=0&&(e[i]=d[r+1])}(r,n,i),x(2,r,t,n,i),x(1,r,t,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,n){if(function(e,t){if(t)for(var n=0;n<e.length;n++)t[n]=n;void 0===o&&(o=w(e)),void 0===s&&(s=w(e))}(e,t),i||!a||s)if(i&&a&&o^s)m=o?1:0,e=b(e,t,n);else if(!i&&a&&s)m=o?1:0,e=C(e,t,n),e=b(e,t);else if(!i||o||a||s){if(i&&!a&&o^s)e=b(e,t),o?(m=0,e=C(e,t,n)):(m=1,e=C(e,t,n),e=b(e,t));else if(i&&o&&!a&&s)m=1,e=C(e,t,n),e=b(e,t);else if(!i&&!a&&o^s){var r=A;o?(m=1,e=C(e,t,n),m=0,A=!1,e=C(e,t,n),A=r):(m=0,e=C(e,t,n),e=b(e,t),m=1,A=!1,e=C(e,t,n),A=r,e=b(e,t))}}else m=0,e=C(e,t,n);else m=o?1:0,e=C(e,t,n);return e},this.__bidiEngine__.setOptions=function(e){e&&(i=e.isInputVisual,a=e.isOutputVisual,o=e.isInputRtl,s=e.isOutputRtl,A=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text;e.x,e.y;var r=e.options||{};e.mutex,r.lang;var i=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,n.setOptions(r),"[object Array]"===Object.prototype.toString.call(t)){var o=0;for(i=[],o=0;o<t.length;o+=1)"[object Array]"===Object.prototype.toString.call(t[o])?i.push([n.doBidiReorder(t[o][0]),t[o][1],t[o][2]]):i.push([n.doBidiReorder(t[o])]);e.text=i}else e.text=n.doBidiReorder(t);n.setOptions({isInputVisual:!0})}])}(Ow),Ow.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new rb(e),this.contents.pos=4,"ttcf"===t.readString(4))throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Bb(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new ib(this.contents),this.head=new sb(this),this.name=new db(this),this.cmap=new ub(this),this.toUnicode={},this.hhea=new lb(this),this.maxp=new pb(this),this.hmtx=new gb(this),this.post=new fb(this),this.os2=new cb(this),this.loca=new bb(this),this.glyf=new vb(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,n,r,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,n,r,i;for(i=[],t=0,n=(r=this.bbox).length;t<n;t++)e=r[t],i.push(Math.round(e*this.scaleFactor));return i}.call(this),this.stemV=0,this.post.exists?(n=255&(r=this.post.italic_angle),0!=(32768&(t=r>>16))&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(i=this.familyClass)||2===i||3===i||4===i||5===i||7===i,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,n){var r,i,o,a;for(o=0,i=0,a=(e=""+e).length;0<=a?i<a:i>a;i=0<=a?++i:--i)r=e.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/t)||0;return o*(t/1e3)},e.prototype.lineHeight=function(e,t){var n;return null==t&&(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},e}();var nb,rb=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,n;for(n=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(e){var t,n,r;for(r=[],t=0,n=e.length;0<=n?t<n:t>n;t=0<=n?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,n,r,i,o,a,s;return e=this.readByte(),t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),o=this.readByte(),a=this.readByte(),s=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^o)+256*(255^a)+(255^s)+1):72057594037927940*e+281474976710656*t+1099511627776*n+4294967296*r+16777216*i+65536*o+256*a+s},e.prototype.writeLongLong=function(e){var t,n;return t=Math.floor(e/4294967296),n=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,n;for(t=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(e){var t,n,r,i;for(i=[],n=0,r=e.length;n<r;n++)t=e[n],i.push(this.writeByte(t));return i},e}(),ib=function(){var e;function t(e){var t,n,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:n>r;n=0<=r?++n:--n)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var n,r,i,o,a,s,A,u,l,c,f,h,d;for(d in f=Object.keys(t).length,s=Math.log(2),l=16*Math.floor(Math.log(f)/s),o=Math.floor(l/s),u=16*f-l,(r=new rb).writeInt(this.scalarType),r.writeShort(f),r.writeShort(l),r.writeShort(o),r.writeShort(u),i=16*f,A=r.pos+i,a=null,h=[],t)for(c=t[d],r.writeString(d),r.writeInt(e(c)),r.writeInt(A),r.writeInt(c.length),h=h.concat(c),"head"===d&&(a=A),A+=c.length;A%4;)h.push(0),A++;return r.write(h),n=2981146554-e(r.data),r.pos=a+8,r.writeUInt32(n),r.data},e=function(e){var t,n,r,i;for(e=mb.call(e);e.length%4;)e.push(0);for(r=new rb(e),n=0,t=0,i=e.length;t<i;t=t+=4)n+=r.readUInt32();return 4294967295&n},t}(),ob={}.hasOwnProperty,ab=function(e,t){for(var n in t)ob.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};nb=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var sb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new rb).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),Ab=function(){function e(e,t){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),l=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=0;s<256;++s)this.codeMap[s]=e.readByte();break;case 4:for(f=e.readUInt16(),c=f/2,e.pos+=6,i=function(){var t,n;for(n=[],s=t=0;0<=c?t<c:t>c;s=0<=c?++t:--t)n.push(e.readUInt16());return n}(),e.pos+=2,d=function(){var t,n;for(n=[],s=t=0;0<=c?t<c:t>c;s=0<=c?++t:--t)n.push(e.readUInt16());return n}(),A=function(){var t,n;for(n=[],s=t=0;0<=c?t<c:t>c;s=0<=c?++t:--t)n.push(e.readUInt16());return n}(),u=function(){var t,n;for(n=[],s=t=0;0<=c?t<c:t>c;s=0<=c?++t:--t)n.push(e.readUInt16());return n}(),r=(this.length-e.pos+this.offset)/2,a=function(){var t,n;for(n=[],s=t=0;0<=r?t<r:t>r;s=0<=r?++t:--t)n.push(e.readUInt16());return n}(),s=g=0,v=i.length;g<v;s=++g)for(p=i[s],n=m=h=d[s];h<=p?m<=p:m>=p;n=h<=p?++m:--m)0===u[s]?o=n+A[s]:0!==(o=a[u[s]/2+(n-h)-(c-s)]||0)&&(o+=A[s]),this.codeMap[n]=65535&o}e.pos=l}return e.encode=function(e,t){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g,m,v,w,y,b,B,x,C,F,E,S,k,_,I,N,U,L,Q,D,R,T,P,O,M,H,j,z,K,W,V,G;switch(_=new rb,o=Object.keys(e).sort(function(e,t){return e-t}),t){case"macroman":for(d=0,p=function(){var e=[];for(h=0;h<256;++h)e.push(0);return e}(),m={0:0},i={},I=0,Q=o.length;I<Q;I++)null==m[K=e[r=o[I]]]&&(m[K]=++d),i[r]={old:e[r],new:m[e[r]]},p[r]=m[e[r]];return _.writeUInt16(1),_.writeUInt16(0),_.writeUInt32(12),_.writeUInt16(0),_.writeUInt16(262),_.writeUInt16(0),_.write(p),{charMap:i,subtable:_.data,maxGlyphID:d+1};case"unicode":for(S=[],l=[],v=0,m={},n={},g=A=null,N=0,D=o.length;N<D;N++)null==m[y=e[r=o[N]]]&&(m[y]=++v),n[r]={old:y,new:m[y]},a=m[y]-r,null!=g&&a===A||(g&&l.push(g),S.push(r),A=a),g=r;for(g&&l.push(g),l.push(65535),S.push(65535),F=2*(C=S.length),x=2*Math.pow(Math.log(C)/Math.LN2,2),c=Math.log(x/2)/Math.LN2,B=2*C-x,s=[],b=[],f=[],h=U=0,R=S.length;U<R;h=++U){if(E=S[h],u=l[h],65535===E){s.push(0),b.push(0);break}if(E-(k=n[E].new)>=32768)for(s.push(0),b.push(2*(f.length+C-h)),r=L=E;E<=u?L<=u:L>=u;r=E<=u?++L:--L)f.push(n[r].new);else s.push(k-E),b.push(0)}for(_.writeUInt16(3),_.writeUInt16(1),_.writeUInt32(12),_.writeUInt16(4),_.writeUInt16(16+8*C+2*f.length),_.writeUInt16(0),_.writeUInt16(F),_.writeUInt16(x),_.writeUInt16(c),_.writeUInt16(B),j=0,T=l.length;j<T;j++)r=l[j],_.writeUInt16(r);for(_.writeUInt16(0),z=0,P=S.length;z<P;z++)r=S[z],_.writeUInt16(r);for(W=0,O=s.length;W<O;W++)a=s[W],_.writeUInt16(a);for(V=0,M=b.length;V<M;V++)w=b[V],_.writeUInt16(w);for(G=0,H=f.length;G<H;G++)d=f[G],_.writeUInt16(d);return{charMap:n,subtable:_.data,maxGlyphID:v+1}}},e}(),ub=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,n,r;for(e.pos=this.offset,this.version=e.readUInt16(),r=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t=new Ab(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var n,r;return null==t&&(t="macroman"),n=Ab.encode(e,t),(r=new rb).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),lb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),cb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,n;for(n=[],t=0;t<10;++t)n.push(e.readByte());return n}(),this.charRange=function(){var t,n;for(n=[],t=0;t<4;++t)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,n;for(n=[],t=0;t<2;t=++t)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),fb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="post",e.prototype.parse=function(e){var t,n,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.pos<this.offset+this.length;)t=e.readByte(),r.push(this.names.push(e.readString(t)));return r;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=function(){var t,n,r;for(r=[],i=t=0,n=this.file.maxp.numGlyphs;0<=n?t<n:t>n;i=0<=n?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),hb=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},db=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="name",e.prototype.parse=function(e){var t,n,r,i,o,a,s,A,u,l,c;for(e.pos=this.offset,e.readShort(),t=e.readShort(),a=e.readShort(),n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+a+e.readShort()});for(s={},i=u=0,l=n.length;u<l;i=++u)r=n[i],e.pos=r.offset,A=e.readString(r.length),o=new hb(A,r),null==s[c=r.nameID]&&(s[c]=[]),s[r.nameID].push(o);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},e}(),pb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),gb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,n,r,i,o,a,s;for(e.pos=this.offset,this.metrics=[],t=0,a=this.file.hhea.numberOfMetrics;0<=a?t<a:t>a;t=0<=a?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i;for(i=[],t=n=0;0<=r?n<r:n>r;t=0<=r?++n:--n)i.push(e.readInt16());return i}(),this.widths=function(){var e,t,n,r;for(r=[],e=0,t=(n=this.metrics).length;e<t;e++)i=n[e],r.push(i.advance);return r}.call(this),n=this.widths[this.widths.length-1],s=[],t=o=0;0<=r?o<r:o>r;t=0<=r?++o:--o)s.push(this.widths.push(n));return s},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),mb=[].slice,vb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,n,r,i,o,a,s,A,u,l;return e in this.cache?this.cache[e]:(i=this.file.loca,t=this.file.contents,n=i.indexOf(e),0===(r=i.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+n,o=(a=new rb(t.read(r))).readShort(),A=a.readShort(),l=a.readShort(),s=a.readShort(),u=a.readShort(),this.cache[e]=-1===o?new yb(a,A,l,s,u):new wb(a,o,A,l,s,u),this.cache[e]))},e.prototype.encode=function(e,t,n){var r,i,o,a,s;for(o=[],i=[],a=0,s=t.length;a<s;a++)r=e[t[a]],i.push(o.length),r&&(o=o.concat(r.encode(n)));return i.push(o.length),{table:o,offsets:i}},e}(),wb=function(){function e(e,t,n,r,i,o){this.raw=e,this.numberOfContours=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),yb=function(){function e(e,t,n,r,i){var o,a;for(this.raw=e,this.xMin=t,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;a=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&a;)o.pos+=1&a?4:2,128&a?o.pos+=8:64&a?o.pos+=4:8&a&&(o.pos+=2)}return e.prototype.encode=function(){var e,t,n;for(t=new rb(mb.call(this.raw.data)),e=0,n=this.glyphIDs.length;e<n;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),bb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return ab(e,nb),e.prototype.tag="loca",e.prototype.parse=function(e){var t,n;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,r;for(r=[],n=0,t=this.length;n<t;n+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,r;for(r=[],n=0,t=this.length;n<t;n+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r,i<t.length&&t[i]==o){++i,n[o]=r;var a=this.offsets[o],s=this.offsets[o+1]-a;s>0&&(r+=s)}for(var A=new Array(4*n.length),u=0;u<n.length;++u)A[4*u+3]=255&n[u],A[4*u+2]=(65280&n[u])>>8,A[4*u+1]=(16711680&n[u])>>16,A[4*u]=(4278190080&n[u])>>24;return A},e}(),Bb=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,n,r,i;for(t in r=this.font.cmap.tables[0].codeMap,e={},i=this.subset)n=i[t],e[t]=r[n];return e},e.prototype.glyphsFor=function(e){var t,n,r,i,o,a,s;for(r={},o=0,a=e.length;o<a;o++)r[i=e[o]]=this.font.glyf.glyphFor(i);for(i in t=[],r)(null!=(n=r[i])?n.compound:void 0)&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in s=this.glyphsFor(t))n=s[i],r[i]=n;return r},e.prototype.encode=function(e,t){var n,r,i,o,a,s,A,u,l,c,f,h,d,p,g;for(r in n=ub.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),f={0:0},g=n.charMap)f[(s=g[r]).old]=s.new;for(h in c=n.maxGlyphID,o)h in f||(f[h]=c++);return u=function(e){var t,n;for(t in n={},e)n[e[t]]=t;return n}(f),l=Object.keys(u).sort(function(e,t){return e-t}),d=function(){var e,t,n;for(n=[],e=0,t=l.length;e<t;e++)a=l[e],n.push(u[a]);return n}(),i=this.font.glyf.encode(o,d,f),A=this.font.loca.encode(i.offsets,d),p={cmap:this.font.cmap.raw(),glyf:i.table,loca:A,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(p["OS/2"]=this.font.os2.raw()),this.font.directory.encode(p)},e}();Ow.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(n){var r,i,o,a;if(Array.isArray(n))return"["+function(){var e,i,o;for(o=[],e=0,i=n.length;e<i;e++)r=n[e],o.push(t.convert(r));return o}().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(n)){for(i in o=["<<"],n)a=n[i],o.push("/"+i+" "+t.convert(a));return o.push(">>"),o.join("\n")}return""+n},t}();var xb=n(5239),Cb=n.n(xb);const Fb=()=>{const t=Jg(),[n,r]=(0,e.useState)(null),[i,o]=(0,e.useState)(!0),[a,s]=(0,e.useState)(null),[A,u]=(0,e.useState)(null),[l,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!1),[d,p]=(0,e.useState)(!1),[g,v]=(0,e.useState)(!1),[y,b]=(0,e.useState)({name:"",phone:""}),[B,x]=(0,e.useState)({name:"",phone:""}),C=(0,e.useRef)(null),[F,E]=(0,e.useState)(!1),[S,k]=(0,e.useState)(new Array(6).fill("")),[_,I]=(0,e.useState)(""),[N,U]=(0,e.useState)(!1),[L,Q]=(0,e.useState)(!1),[D,R]=(0,e.useState)(!1),[T,P]=(0,e.useState)({show:!1,message:""}),[O,M]=(0,e.useState)(""),H=/^[a-zA-Z\s]*$/,j=/^\d{0,10}$/,z=(0,e.useRef)(null);(0,e.useEffect)(()=>{(async()=>{try{const t=new URLSearchParams(window.location.search),n=t.get("phone"),i=t.get("report");if(n&&i)try{const e=await fetch("".concat(m,"/api/reports/").concat(i));if(e.ok){const t=await e.json();return r(t.data),b(e=>Vp(Vp({},e),{},{phone:n,name:t.userName||""})),v(!0),void o(!1)}}catch(w){console.error("Failed to load report",w)}const a=await(e="analysisData",new Promise((t,n)=>{const r=indexedDB.open("ElixifyDB",1);r.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains("analysisStore")||t.createObjectStore("analysisStore")},r.onsuccess=r=>{const i=r.target.result;if(!i.objectStoreNames.contains("analysisStore"))return t(null);const o=i.transaction("analysisStore","readonly").objectStore("analysisStore").get(e);o.onsuccess=()=>t(o.result),o.onerror=()=>n(o.error)},r.onerror=()=>n(r.error)}));if(!a)throw new Error("No analysis data found. Please start a new analysis.");r(a),o(!1)}catch(Ov){s(Ov.message),o(!1)}var e})()},[]);const K=async()=>{await ov("analysisData",null),t("/")},W=(e,t)=>e&&"object"===typeof e?e[t]&&"object"===typeof e[t]?e[t].ui_score||e[t].score||e[t].raw_score||null:void 0!==e[t]&&null!==e[t]?e[t]:null:null,V=(e,t)=>e&&e[t]&&"object"===typeof e[t]&&void 0!==e[t].ui_score,G=e=>{const t=Number(e);return isNaN(t)||null===e||void 0===e?null:Math.max(0,t-5)};if(i)return(0,sv.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,sv.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,sv.jsx)("div",{className:"w-12 h-12 border-4 border-white/10 border-t-[#0097C3] rounded-full animate-spin"}),(0,sv.jsx)("p",{className:"text-gray-300 animate-pulse",children:"Analyzing skin profile..."})]})});if(a)return(0,sv.jsx)("div",{className:"min-h-screen flex items-center justify-center p-4",children:(0,sv.jsxs)("div",{className:"glass-panel p-8 rounded-none shadow-xl max-w-md w-full text-center border border-white/10",children:[(0,sv.jsx)("div",{className:"w-16 h-16 bg-[#0097C3]/20 rounded-none flex items-center justify-center mx-auto mb-4",children:(0,sv.jsx)("svg",{className:"w-8 h-8 text-[#0097C3]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,sv.jsx)("h2",{className:"text-xl font-bold text-white mb-2",children:"Analysis Failed"}),(0,sv.jsx)("p",{className:"text-gray-300 mb-6",children:{error_below_min_image_size:"Input image resolution is too small",error_exceed_max_image_size:"Input image resolution is too large",error_src_skin_too_small:"The skin area in the uploaded image is too small. The width of the skin needs to be greater than 60% of the width of the image.",error_src_skin_out_of_bound:"The skin area in the uploaded image is out of bound",error_lighting_dark:"The lighting in the uploaded image is too dark"}[a]||a}),(0,sv.jsx)("button",{onClick:K,className:"w-full py-3 bg-[#0097C3] hover:bg-[#007ba0] text-white rounded-none font-bold transition-colors shadow-lg shadow-[#0097C3]/30",children:"Try Again"})]})});if(!n||!n.scoreData)return(0,sv.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,sv.jsxs)("div",{className:"text-center",children:[(0,sv.jsx)("p",{className:"text-gray-300 mb-4",children:"No analysis data available."}),(0,sv.jsx)("button",{onClick:K,className:"px-6 py-2 bg-[#0097C3] text-white rounded-none shadow-lg",children:"Start New Analysis"})]})});const{scoreData:q}=n,X=(e=>e?Object.keys(e).filter(e=>!["all","skin_age","takeaways","resize","image","url","resize_image","image_size"].includes(e)).map(t=>{const n=V(e,t)?e[t].ui_score:W(e,t),r=G(n);return{key:t,name:(i=t,{wrinkle:"Wrinkles",radiance:"Radiance",firmness:"Firmness",oiliness:"Oiliness",redness:"Redness",dark_circle_v2:"Dark Circles",pore:"Pores",eye_bag:"Eye Bags",texture:"Texture",age_spot:"Age Spots",droopy_lower_eyelid:"Droopy Lower Eyelid",moisture:"Moisture",droopy_upper_eyelid:"Droopy Upper Eyelid",acne:"Acne"}[i]||i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())),ui_score:r,raw_score:V(e,t)?e[t].raw_score:null,output_mask_name:V(e,t)?e[t].output_mask_name:null,hasDetails:V(e,t)};var i}):[])(q),Y=W(q,"all"),J=G(Y),Z=W(q,"skin_age"),$=(null===Z||void 0===Z||isNaN(Number(Z))||Math.max(0,Math.round(Number(Z)-5)),q.takeaways,Math.PI,g?X.filter(e=>null!==e.ui_score).sort((e,t)=>e.ui_score-t.ui_score):X.filter(e=>null!==e.ui_score).sort((e,t)=>e.ui_score-t.ui_score).slice(0,3));return(0,sv.jsxs)("div",{className:"h-screen overflow-hidden bg-[#18181b] font-sans relative flex flex-col",children:[(0,sv.jsxs)("header",{className:"fixed top-0 left-0 right-0 z-50 py-4 px-6 flex items-center justify-between bg-[#0097C3] shadow-lg",children:[(0,sv.jsx)("div",{className:"flex items-center gap-4",children:(0,sv.jsx)("img",{src:"/elixifyskinanalyser/assets/images/elixify_logo.png",alt:"Elixify Logo",className:"h-12 md:h-16 w-auto brightness-0 invert"})}),(0,sv.jsxs)("div",{className:"flex items-center gap-4",children:[(0,sv.jsx)("button",{onClick:()=>p(!0),className:"text-white hover:text-white/80 transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,sv.jsx)("button",{onClick:K,className:"text-white hover:text-white/80 transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,sv.jsxs)("main",{ref:z,className:"flex-1 flex flex-col relative z-10 min-h-0 bg-[#18181b]",children:[(0,sv.jsx)("div",{className:"relative w-full flex-1 min-h-0 bg-[#18181b]",children:(()=>{const e=null===n||void 0===n?void 0:n.originalImage;return e?(0,sv.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center overflow-hidden bg-[#18181b]",children:[(0,sv.jsx)("img",{src:e,alt:"Skin Analysis",className:"w-full h-full object-cover transition-opacity duration-500 ".concat(l?"opacity-40":"opacity-100")}),l&&(0,sv.jsx)("img",{src:l,alt:"Analysis Mask",className:"absolute inset-0 w-full h-full object-cover animate-pulse-slow"})]}):null})()}),(0,sv.jsxs)("div",{className:"bg-[#18181b] px-5 pb-4 relative z-20 shrink-0",children:[(0,sv.jsxs)("div",{className:"flex items-center justify-between border-b border-white/20 pb-2 mb-2",children:[(0,sv.jsxs)("div",{className:"flex items-center gap-4",children:[(0,sv.jsx)("span",{className:"text-[5rem] leading-none font-normal text-white tracking-tighter",children:null===J||void 0===J?void 0:J.toFixed(0)}),(0,sv.jsx)("div",{className:"flex items-center gap-2 mt-2",children:(0,sv.jsx)("span",{className:"text-xl text-white font-normal",children:"Skin Health"})})]}),l&&(0,sv.jsx)("button",{onClick:()=>{c(null),u(null)},className:"text-white hover:text-[#0097C3] transition-colors flex items-center mb-2",title:"Show original image",children:(0,sv.jsx)("svg",{className:"w-7 h-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),(0,sv.jsxs)("div",{children:[(0,sv.jsx)("h4",{className:"text-[11px] uppercase tracking-widest text-white font-bold mb-2 ml-1",children:g?"ANALYSIS METRICS":"TOP CONCERNS"}),(0,sv.jsxs)("div",{className:"flex gap-2 pb-1 ".concat(g?"overflow-x-auto scrollbar-hide -mr-5 pr-5":"overflow-hidden -mr-5"),children:[$.map((e,t)=>(0,sv.jsxs)("div",{onClick:()=>g&&(e=>{if(e.output_mask_name){var t;const r=null===n||void 0===n||null===(t=n.maskImages)||void 0===t?void 0:t[e.output_mask_name];r?(c(r),u(e.key)):(c(null),u(null))}else c(null),u(null)})(e),className:"bg-[#2B2B2B] rounded-none flex flex-col items-center justify-between p-2 h-[145px] flex-shrink-0 w-[30%] relative group transition-all duration-300 ".concat(g?"cursor-pointer hover:bg-[#333]":""),style:{border:A===e.key?"1px solid transparent":"1px solid #333",backgroundImage:A===e.key?"linear-gradient(#2B2B2B, #2B2B2B), linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.1) 40%, rgba(255,255,255,0.1) 60%, #ffffff 100%)":"none",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box"},children:[(0,sv.jsxs)("div",{className:"text-center flex flex-col items-center w-full mt-1 gap-1",children:[(0,sv.jsx)("span",{className:"text-3xl font-medium text-white",children:e.ui_score}),(0,sv.jsx)("span",{className:"text-[12px] text-gray-200 font-medium leading-tight text-center h-10 flex items-center justify-center px-1 uppercase tracking-wide",children:e.name})]}),(0,sv.jsx)("div",{className:"px-3 py-1 rounded-full text-[11px] font-bold uppercase min-w-[65px] text-center ".concat(e.ui_score>=70?"bg-emerald-500/20 text-[#4ade80] border border-emerald-500/30":e.ui_score>=40?"bg-amber-500/20 text-[#fbbf24] border border-amber-500/30":"bg-[#0097C3]/20 text-[#0097C3] border border-[#0097C3]/30"),children:e.ui_score>=70?"Good":e.ui_score>=40?"Average":"Bad"})]},e.key)),!g&&(0,sv.jsx)("div",{className:"bg-[#2B2B2B] rounded-none flex items-center justify-center border border-white/5 h-[145px] flex-shrink-0 w-[30%] relative",children:(0,sv.jsx)("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})})]})]})]}),g?(0,sv.jsx)("div",{className:"bg-[#18181b] px-5 py-6 flex flex-col gap-4 relative z-30 shrink-0 border-t border-white/10",children:(0,sv.jsxs)("button",{onClick:async()=>{if(!C.current)return;const e=C.current;e.style.display="block";try{const t=await Cb()(e,{scale:2,useCORS:!0,allowTaint:!0,backgroundColor:"#ffffff"}),n=t.toDataURL("image/png"),r=new Ow("p","mm","a4"),i=r.internal.pageSize.getWidth(),o=t.height*i/t.width;r.addImage(n,"PNG",0,0,i,o),r.save("Elixify_Skin_Report_".concat(y.name||"User",".pdf"))}catch(Ov){console.error("PDF Generation Error:",Ov),alert("Failed to generate PDF. Please try again.")}finally{e.style.display="none"}},className:"w-full bg-[#0097C3] hover:bg-[#007ba0] text-white h-14 rounded-none font-bold text-lg shadow-sm flex items-center justify-center gap-3 transition-all transform active:scale-95 relative",children:[(0,sv.jsx)("span",{className:"text-[1.1rem]",children:"Download Report"}),(0,sv.jsx)("div",{className:"w-6 h-6 bg-white/20 rounded-full flex items-center justify-center",children:(0,sv.jsx)("svg",{className:"w-4 h-4 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M17.25 9.45L12 14.7l-5.25-5.25M12 3v11.7"})})})]})}):(0,sv.jsxs)("div",{className:"bg-[#18181b] px-5 py-6 flex flex-col gap-4 relative z-30 shrink-0 border-t border-white/10",children:[(0,sv.jsxs)("button",{onClick:()=>h(!0),className:"w-full bg-[#0097C3] hover:bg-[#007ba0] text-white h-14 rounded-none font-bold text-lg shadow-sm flex items-center justify-center gap-3 transition-all transform active:scale-95 relative",children:[(0,sv.jsx)("span",{className:"text-[1.1rem]",children:"Access Full Report"}),(0,sv.jsx)("div",{className:"w-6 h-6 bg-white/20 rounded-full flex items-center justify-center",children:(0,sv.jsx)("svg",{className:"w-3.5 h-3.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M14 5l7 7m0 0l-7 7m7-7H3"})})})]}),(0,sv.jsx)("p",{className:"text-center text-xs text-gray-400 font-medium",children:"Sign up to access overall analysis report"})]})]}),f&&(0,sv.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:(0,sv.jsxs)("div",{className:"bg-white w-full max-w-sm p-6 relative shadow-2xl animate-[fadeIn_0.2s_ease-out]",children:[(0,sv.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,sv.jsx)("h2",{className:"text-2xl font-bold text-black",children:"Sign Up"}),(0,sv.jsx)("button",{onClick:()=>h(!1),className:"text-black transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,sv.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,sv.jsxs)("div",{children:[(0,sv.jsxs)("label",{className:"block text-gray-700 text-sm font-medium mb-1",children:["Full Name",(0,sv.jsx)("span",{className:"text-[#0097C3]",children:"*"})]}),(0,sv.jsx)("input",{type:"text",placeholder:"Enter your First Name",value:y.name,onChange:e=>{const t=e.target.value;H.test(t)&&(b(e=>Vp(Vp({},e),{},{name:t})),B.name&&x(e=>Vp(Vp({},e),{},{name:""})))},className:"w-full border-b border-dashed py-2 text-base text-black placeholder-gray-400 focus:outline-none transition-colors bg-transparent ".concat(B.name?"border-[#0097C3]":"border-gray-400 focus:border-[#0097C3]")}),B.name&&(0,sv.jsx)("p",{className:"text-[#0097C3] text-xs mt-1",children:B.name})]}),(0,sv.jsxs)("div",{children:[(0,sv.jsxs)("label",{className:"block text-gray-700 text-sm font-medium mb-1",children:["Whatsapp Number",(0,sv.jsx)("span",{className:"text-[#0097C3]",children:"*"})]}),(0,sv.jsx)("input",{type:"tel",placeholder:"Enter your Whatsapp Number",value:y.phone,onChange:e=>{const t=e.target.value;j.test(t)&&(b(e=>Vp(Vp({},e),{},{phone:t})),B.phone&&x(e=>Vp(Vp({},e),{},{phone:""})))},className:"w-full border-b border-dashed py-2 text-base text-black placeholder-gray-400 focus:outline-none transition-colors bg-transparent ".concat(B.phone?"border-[#0097C3]":"border-gray-400 focus:border-[#0097C3]")}),B.phone&&(0,sv.jsx)("p",{className:"text-[#0097C3] text-[13px] mt-2 font-medium leading-tight",children:B.phone})]}),(0,sv.jsx)("button",{onClick:async()=>{let e={};if(y.name.trim()||(e.name="Name is required"),10!==y.phone.length&&(e.phone="Number must be exactly 10 digits"),Object.keys(e).length>0)x(e);else{R(!0);try{const e=await(async e=>{const t=Math.random().toString(36).substring(7),r=window.location.origin+window.location.pathname,i="".concat(r,"?phone=").concat(e,"&report=").concat(t);let o="",a=!1;try{const r=await fetch("".concat(m,"/api/users"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y.name,phone:e})}),s=await r.text();let A;try{A=JSON.parse(s)}catch(w){throw console.error("User API returned non-JSON:",s),new Error("Could not connect to user API properly. Please try again.")}if(A.success)o=A.user.otp,a=A.user.isExisting||!1,M(o);else{if(!A.message||!A.message.includes("already registered")){const e=A.message||"Failed to register user";throw new Error(e)}a=!0,console.log("User already registered, proceeding as existing user")}await fetch("".concat(m,"/api/reports"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reportId:t,phone:e,userName:y.name,data:n,link:i})}),console.log("Sending WhatsApp message request to backend for ".concat(e));const u=await fetch("".concat(m,"/api/whatsapp/send-otp"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:e,name:y.name,otpToUse:o,verificationLink:i,isExisting:a})});if(!u.ok){const e=await u.text();let t;try{t=JSON.parse(e)}catch(w){t={message:e.substring(0,100)}}throw console.error("Backend WhatsApp API Error:",t),new Error(t.message||"Failed to send WhatsApp message")}return console.log("WhatsApp message sent successfully via backend"),Vp(Vp({},A.user||{}),{},{isExisting:a})}catch(Ov){throw console.error("Error in sendWhatsappOtp:",Ov),Ov}})(y.phone);h(!1),e&&e.isExisting?(v(!0),P({show:!0,message:"You're already an user, welcome back!"}),setTimeout(()=>P({show:!1,message:""}),4e3)):(E(!0),k(new Array(6).fill("")))}catch(Ov){x({phone:Ov.message||"Failed to send message. Please try again."})}finally{R(!1)}}},disabled:D,className:"w-full bg-[#0097C3] hover:bg-[#007ba0] text-white py-3 font-semibold text-lg mt-4 transition-colors disabled:opacity-70 flex items-center justify-center h-14",children:D?(0,sv.jsxs)("div",{className:"flex items-center gap-3",children:[(0,sv.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),(0,sv.jsx)("span",{children:"Verifying..."})]}):"Submit"})]})]})}),F&&(0,sv.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:(0,sv.jsxs)("div",{className:"bg-white w-full max-w-sm p-6 relative shadow-2xl animate-[fadeIn_0.2s_ease-out]",children:[(0,sv.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,sv.jsx)("h2",{className:"text-2xl font-bold text-black",children:"OTP Verification"}),(0,sv.jsx)("button",{onClick:()=>E(!1),className:"text-black transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,sv.jsx)("p",{className:"text-sm text-black mb-8 mt-4 font-medium",children:"Please enter the OTP sent to you on whatsapp."}),(0,sv.jsx)("div",{className:"flex justify-between gap-2 mb-8",children:S.map((e,t)=>(0,sv.jsx)("input",{className:"w-11 h-11 border border-gray-300 rounded-md text-center text-xl focus:border-[#0097C3] focus:outline-none font-medium text-black",type:"text",name:"otp",maxLength:"1",value:e,onChange:e=>((e,t)=>{if(isNaN(e.value))return!1;k([...S.map((n,r)=>r===t?e.value:n)]),e.nextSibling&&""!==e.value&&e.nextSibling.focus()})(e.target,t),onFocus:e=>e.target.select()},t))}),_&&(0,sv.jsx)("p",{className:"text-[#0097C3] text-sm mb-4 text-center",children:_}),(0,sv.jsx)("button",{onClick:async()=>{const e=S.join("");if(6===e.length){U(!0),I("");try{const t=await(async e=>{try{const t=await fetch("".concat(m,"/api/verify-otp"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:y.phone,otp:e})});return(await t.json()).success}catch(w){return console.error("OTP verification error",w),!1}})(e);t?(alert("OTP Verified Successfully!"),E(!1),v(!0)):I("Invalid OTP. Please try again.")}catch(a){I("Verification failed. Please try again.")}finally{U(!1)}}else I("Please enter a valid 6-digit OTP")},disabled:N,className:"w-full bg-[#0097C3] hover:bg-[#007ba0] text-white py-4 font-semibold text-lg transition-colors disabled:opacity-70 flex items-center justify-center",children:N?(0,sv.jsx)("div",{className:"w-6 h-6 border-2 border-white/30 border-t-white rounded-full animate-spin"}):"Verify OTP"})]})}),d&&(0,sv.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-[100] flex items-center justify-center p-4",children:(0,sv.jsxs)("div",{className:"bg-white w-full max-w-sm p-8 rounded-none relative",children:[(0,sv.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,sv.jsx)("h2",{className:"text-[28px] font-bold text-black",children:"Help"}),(0,sv.jsx)("button",{onClick:()=>p(!1),className:"text-black transition-colors",children:(0,sv.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,sv.jsxs)("div",{className:"space-y-6",children:[(0,sv.jsxs)("div",{className:"flex gap-3",children:[(0,sv.jsx)("span",{className:"text-black/40 mt-1.5 font-bold",children:"\u2022"}),(0,sv.jsxs)("p",{className:"text-[15px] leading-relaxed text-black/70 font-medium",children:["To access previous reports, please contact us at ",(0,sv.jsx)("span",{className:"text-black font-semibold",children:"hello@elixify.com"})]})]}),(0,sv.jsxs)("div",{className:"flex gap-3",children:[(0,sv.jsx)("span",{className:"text-black/40 mt-1.5 font-bold",children:"\u2022"}),(0,sv.jsxs)("p",{className:"text-[15px] leading-relaxed text-black/70 font-medium",children:["If you experience any technical issues, please contact us at ",(0,sv.jsx)("span",{className:"text-black font-semibold",children:"support@example.com"})]})]})]})]})}),T.show&&(0,sv.jsx)("div",{className:"fixed top-24 right-6 z-[200] animate-[fadeIn_0.3s_ease-out]",children:(0,sv.jsxs)("div",{className:"bg-white text-[#0097C3] px-6 py-4 shadow-[0_10px_40px_rgba(0,0,0,0.15)] flex items-center gap-3 border-l-4 border-[#0097C3]",children:[(0,sv.jsx)("div",{className:"bg-[#0097C3]/10 p-1.5 rounded-full",children:(0,sv.jsx)("svg",{className:"w-5 h-5 text-[#0097C3]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),(0,sv.jsx)("span",{className:"font-bold tracking-tight text-sm uppercase",children:T.message})]})}),(0,sv.jsxs)("div",{ref:C,style:{display:"none",width:"210mm",minHeight:"297mm",backgroundColor:"#ffffff",padding:"15mm",color:"#1a1a1a",fontFamily:"'Inter', sans-serif",boxSizing:"border-box"},children:[(0,sv.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px"},children:[(0,sv.jsx)("div",{style:{width:"120px"},children:(0,sv.jsx)("img",{src:"/elixifyskinanalyser/assets/images/elixify_logo.png",style:{height:"45px",objectFit:"contain"},alt:"Logo"})}),(0,sv.jsx)("div",{style:{flex:1,textAlign:"center"},children:(0,sv.jsx)("h1",{style:{fontSize:"28px",fontWeight:"900",margin:0,textTransform:"uppercase",letterSpacing:"0.02em",color:"#0097C3",fontFamily:"'Playfair Display', serif"},children:"Skin Analysis Report"})}),(0,sv.jsx)("div",{style:{width:"120px"}})]}),(0,sv.jsx)("div",{style:{height:"2px",backgroundColor:"#0097C3",marginBottom:"25px"}}),(0,sv.jsxs)("div",{style:{backgroundColor:"#f3f4f6",padding:"18px 25px",display:"flex",justifyContent:"space-between",marginBottom:"30px"},children:[(0,sv.jsxs)("div",{style:{flex:1.5},children:[(0,sv.jsx)("p",{style:{margin:0,fontSize:"10px",color:"#666",textTransform:"uppercase",fontWeight:"700",letterSpacing:"1px"},children:"Name"}),(0,sv.jsx)("p",{style:{margin:"4px 0 0 0",fontSize:"16px",fontWeight:"800",color:"#000"},children:y.name||"Anonymous"})]}),(0,sv.jsxs)("div",{style:{flex:1.5},children:[(0,sv.jsx)("p",{style:{margin:0,fontSize:"10px",color:"#666",textTransform:"uppercase",fontWeight:"700",letterSpacing:"1px"},children:"Contact Number"}),(0,sv.jsxs)("p",{style:{margin:"4px 0 0 0",fontSize:"16px",fontWeight:"800",color:"#000"},children:["+91 ",y.phone||"N/A"]})]}),(0,sv.jsxs)("div",{style:{flex:1,textAlign:"right"},children:[(0,sv.jsx)("p",{style:{margin:0,fontSize:"10px",color:"#666",textTransform:"uppercase",fontWeight:"700",letterSpacing:"1px"},children:"Analysis Date"}),(0,sv.jsx)("p",{style:{margin:"4px 0 0 0",fontSize:"16px",fontWeight:"800",color:"#000"},children:(()=>{const e=new Date,t=e.getDate(),n=t>3&&t<21||t%10>3?"th":["th","st","nd","rd"][t%10];return"".concat(t).concat(n," ").concat(e.toLocaleString("en-GB",{month:"long"})," ").concat(e.getFullYear())})()})]})]}),(0,sv.jsxs)("div",{style:{display:"flex",gap:"20px",marginBottom:"35px"},children:[(0,sv.jsxs)("div",{style:{flex:"1",position:"relative"},children:[(0,sv.jsx)("div",{style:{width:"100%",height:"320px",overflow:"hidden",border:"4px solid #0097C3"},children:(0,sv.jsx)("img",{src:null===n||void 0===n?void 0:n.originalImage,style:{width:"100%",height:"100%",objectFit:"cover"},alt:"Original Scan"})}),(0,sv.jsx)("div",{style:{position:"absolute",bottom:"15px",right:"15px",backgroundColor:"#0097C3",color:"#fff",padding:"6px 15px",fontSize:"10px",fontWeight:"bold",textTransform:"uppercase"},children:"Analyzed skin Profile"})]}),(0,sv.jsx)("div",{style:{flex:"0.6",display:"flex",flexDirection:"column"},children:(0,sv.jsxs)("div",{style:{flex:1,backgroundColor:"#0097C3",color:"#fff",padding:"20px 15px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"2px"},children:[(0,sv.jsx)("p",{style:{margin:0,fontSize:"11px",fontWeight:"800",textTransform:"uppercase",letterSpacing:"1px",opacity:.9},children:"Skin Health"}),(0,sv.jsx)("div",{style:{margin:"15px 0"},children:(0,sv.jsx)("h1",{style:{fontSize:"80px",fontWeight:"900",margin:0,lineHeight:.9},children:Math.round(J)})})]})})]}),(0,sv.jsxs)("div",{style:{marginBottom:"35px"},children:[(0,sv.jsxs)("h2",{style:{fontSize:"15px",fontWeight:"900",marginBottom:"18px",textTransform:"uppercase",letterSpacing:"1.5px",display:"flex",alignItems:"center",gap:"10px"},children:[(0,sv.jsx)("span",{style:{height:"15px",width:"15px",display:"inline-block",border:"3px solid #0097C3"}}),"Diagnostic Deep-Dive"]}),(0,sv.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"15px"},children:X.filter(e=>"all"!==e.key).map((e,t)=>(0,sv.jsxs)("div",{style:{padding:"14px",border:"1px solid #f0f0f0",display:"flex",flexDirection:"column",gap:"8px"},children:[(0,sv.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,sv.jsx)("span",{style:{fontSize:"11px",fontWeight:"800",color:"#1a1a1a",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.name}),(0,sv.jsxs)("span",{style:{fontSize:"13px",fontWeight:"900",color:e.ui_score>=70?"#10b981":e.ui_score>=40?"#f59e0b":"#ef4444"},children:[e.ui_score,"%"]})]}),(0,sv.jsx)("div",{style:{width:"100%",height:"4px",backgroundColor:"#f5f5f5",borderRadius:"10px",overflow:"hidden"},children:(0,sv.jsx)("div",{style:{width:"".concat(e.ui_score,"%"),height:"100%",backgroundColor:e.ui_score>=70?"#10b981":e.ui_score>=40?"#f59e0b":"#0097C3"}})})]},t))})]}),(0,sv.jsxs)("div",{style:{padding:"25px",backgroundColor:"#fafafa",border:"1px solid #eee",marginBottom:"40px",borderRadius:"4px"},children:[(0,sv.jsx)("h3",{style:{margin:"0 0 15px 0",fontSize:"14px",fontWeight:"900",color:"#1a1a1a",textTransform:"uppercase",letterSpacing:"1px"},children:"Prescriptive Guidance"}),(0,sv.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"15px"},children:[(0,sv.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[(0,sv.jsx)("span",{style:{fontSize:"10px",fontWeight:"900",color:"#0097C3"},children:"STEP 01"}),(0,sv.jsxs)("p",{style:{margin:0,fontSize:"11px",color:"#555",lineHeight:"1.5"},children:[(0,sv.jsx)("strong",{children:"Advanced Hydration:"})," Apply hyaluronic acid serum daily to stabilize moisture levels."]})]}),(0,sv.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[(0,sv.jsx)("span",{style:{fontSize:"10px",fontWeight:"900",color:"#0097C3"},children:"STEP 02"}),(0,sv.jsxs)("p",{style:{margin:0,fontSize:"11px",color:"#555",lineHeight:"1.5"},children:[(0,sv.jsx)("strong",{children:"Dermal Protection:"})," Broad-spectrum physical sunshade is mandatory for UV protection."]})]}),(0,sv.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[(0,sv.jsx)("span",{style:{fontSize:"10px",fontWeight:"900",color:"#0097C3"},children:"STEP 03"}),(0,sv.jsxs)("p",{style:{margin:0,fontSize:"11px",color:"#555",lineHeight:"1.5"},children:[(0,sv.jsx)("strong",{children:"Clinical Intervention:"})," Visit your specialist for focused treatment on top priority zones."]})]})]})]}),(0,sv.jsxs)("div",{style:{marginTop:"auto",borderTop:"0.5px solid #eee",paddingTop:"15px"},children:[(0,sv.jsx)("p",{style:{margin:"0 0 10px 0",fontSize:"9px",color:"#b3b3b3",textAlign:"center",fontStyle:"italic"},children:"* This diagnostic data is interpreted by Elixify AI Skin Vision. For detailed medical prescriptions, please book a 1-on-1 therapist consultation."}),(0,sv.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,sv.jsx)("p",{style:{margin:0,fontSize:"10px",fontWeight:"800",color:"#1a1a1a"},children:"ELIXIFY CLINICAL SYSTEMS"}),(0,sv.jsx)("p",{style:{margin:0,fontSize:"9px",color:"#999"},children:"support@elixify.com | elixify.com"})]})]})]})]})};function Eb(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(e)}function Sb(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 5 19 12 12 19"},child:[]}]})(e)}function kb(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},child:[]},{tag:"line",attr:{x1:"1",y1:"1",x2:"23",y2:"23"},child:[]}]})(e)}function _b(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function Ib(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(e)}function Nb(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(e)}function Ub(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}function Lb(e){return d({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}const Qb=()=>{const[t,n]=(0,e.useState)({email:"",password:""}),[r,i]=(0,e.useState)(!1),[o,a]=(0,e.useState)(""),s=Jg();return(0,sv.jsx)("div",{className:"min-h-screen bg-[#18181b] flex items-center justify-center p-4 font-sans",children:(0,sv.jsxs)("div",{className:"bg-white w-full max-w-md p-10 shadow-2xl rounded-none",children:[(0,sv.jsx)("div",{className:"flex flex-col items-center mb-10",children:(0,sv.jsx)("div",{className:"bg-[#0097C3] p-4 mb-6",children:(0,sv.jsx)("img",{src:"/elixifyskinanalyser/assets/images/elixify_logo.png",alt:"Elixify",className:"h-8 brightness-0 invert"})})}),o&&(0,sv.jsx)("p",{className:"text-[#0097C3] text-sm font-bold text-center mb-6 animate-shake",children:o}),(0,sv.jsxs)("form",{onSubmit:e=>{e.preventDefault(),a(""),"admin@elixify.com"===t.email&&"admin@2026"===t.password?s("/dashboard"):a("Incorrect admin credentials")},className:"space-y-6",children:[(0,sv.jsxs)("div",{children:[(0,sv.jsx)("label",{className:"block text-sm font-bold text-black uppercase tracking-wider mb-2",children:"Email Address"}),(0,sv.jsx)("input",{type:"email",required:!0,className:"w-full border-b-2 border-gray-200 py-3 focus:outline-none focus:border-[#0097C3] transition-colors text-black",placeholder:"olivia@elixify.com",value:t.email,onChange:e=>n(Vp(Vp({},t),{},{email:e.target.value}))})]}),(0,sv.jsxs)("div",{className:"relative",children:[(0,sv.jsx)("label",{className:"block text-sm font-bold text-black uppercase tracking-wider mb-2",children:"Password"}),(0,sv.jsxs)("div",{className:"relative",children:[(0,sv.jsx)("input",{type:r?"text":"password",required:!0,className:"w-full border-b-2 border-gray-200 py-3 pr-10 focus:outline-none focus:border-[#0097C3] transition-colors text-black",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",value:t.password,onChange:e=>n(Vp(Vp({},t),{},{password:e.target.value}))}),(0,sv.jsx)("button",{type:"button",className:"absolute right-0 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black transition-colors",onClick:()=>i(!r),children:r?(0,sv.jsx)(_b,{size:20}):(0,sv.jsx)(kb,{size:20})})]})]}),(0,sv.jsx)("button",{type:"submit",className:"w-full bg-[#0097C3] text-white py-4 font-bold uppercase tracking-widest hover:bg-[#007ba0] transition-colors mt-4",children:"Login"})]})]})})};function Db(e){return d({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},child:[]}]})(e)}const Rb=()=>{const[t,n]=(0,e.useState)(""),[r,i]=(0,e.useState)([]),o=Jg();(0,e.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(m,"/api/dashboard/users")),t=await e.json();i(t)}catch(Ov){console.error("Failed to fetch users",Ov)}})()},[]);const[a,s]=(0,e.useState)(!1),[A,u]=(0,e.useState)("reports"),[l,c]=(0,e.useState)(1),[f,h]=(0,e.useState)({siteName:"Elixify Skin Analyser",adminEmail:"olivia@elixify.com",whatsappNotifications:!0,autoArchive:!1}),d=r.map(e=>({id:e.phone,name:e.name,phone:e.phone,report:"View Link",link:e.lastLink})).filter(e=>e.name.toLowerCase().includes(t.toLowerCase())||e.phone.includes(t)),p=Math.ceil(d.length/8),g=d.slice(8*(l-1),8*l),v=e=>{e>=1&&e<=p&&c(e)};return(0,sv.jsxs)("div",{className:"flex h-screen bg-[#F8F9FA] font-sans",children:[(0,sv.jsxs)("aside",{className:"w-64 bg-[#0097C3] text-white flex flex-col shrink-0",children:[(0,sv.jsx)("div",{className:"p-6 mb-4",children:(0,sv.jsx)("img",{src:"/elixifyskinanalyser/assets/images/elixify_logo.png",alt:"ELIXIFY",className:"h-10 w-auto brightness-0 invert"})}),(0,sv.jsxs)("nav",{className:"flex-1 px-0 mt-4",children:[(0,sv.jsxs)("div",{onClick:()=>u("reports"),className:"flex items-center gap-3 px-6 py-4 cursor-pointer transition-colors ".concat("reports"===A?"bg-white text-[#0097C3]":"text-white hover:bg-white/10"),children:[(0,sv.jsx)(Db,{className:"text-xl"}),(0,sv.jsx)("span",{className:"font-bold uppercase tracking-wider text-xs",children:"Reports"})]}),(0,sv.jsxs)("div",{onClick:()=>s(!0),className:"text-white hover:bg-white/10 flex items-center gap-3 px-6 py-4 transition-colors cursor-pointer",children:[(0,sv.jsx)(Ib,{className:"text-xl"}),(0,sv.jsx)("span",{className:"font-bold uppercase tracking-wider text-xs",children:"Support"})]})]}),(0,sv.jsxs)("div",{className:"px-0 space-y-0 mb-6 border-t border-white/10",children:[(0,sv.jsxs)("div",{onClick:()=>u("settings"),className:"flex items-center gap-3 px-6 py-4 cursor-pointer transition-colors ".concat("settings"===A?"bg-white text-[#0097C3]":"text-white hover:bg-white/10"),children:[(0,sv.jsx)(Lb,{className:"text-xl"}),(0,sv.jsx)("span",{className:"font-bold uppercase tracking-wider text-xs",children:"Settings"})]}),(0,sv.jsx)("div",{className:"hover:bg-white/10 text-white flex items-center gap-3 px-6 py-5 transition-colors cursor-pointer border-t border-white/10",children:(0,sv.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,sv.jsx)("div",{className:"w-10 h-10 bg-[#0086ad] rounded-full flex items-center justify-center overflow-hidden border border-white/30 text-white font-bold text-sm",children:"LA"}),(0,sv.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,sv.jsx)("p",{className:"text-[13px] font-bold truncate",children:"Elixify Admin"}),(0,sv.jsx)("p",{className:"text-[10px] text-white/70 truncate tracking-wide",children:"8778913301"})]}),(0,sv.jsx)("button",{onClick:()=>{o("/login")},className:"text-lg opacity-70 hover:opacity-100 transition-opacity p-1 ml-auto",title:"Logout",children:(0,sv.jsx)(Nb,{})})]})})]})]}),(0,sv.jsxs)("main",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[(0,sv.jsxs)("header",{className:"h-16 bg-white border-b flex items-center justify-between px-8 shrink-0",children:[(0,sv.jsx)("h1",{className:"text-xl font-bold text-gray-800",children:"reports"===A?"Welcome back, Admin":"System Settings"}),"reports"===A&&(0,sv.jsxs)("div",{className:"relative w-80",children:[(0,sv.jsx)(Ub,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),(0,sv.jsx)("input",{type:"text",placeholder:"Search",className:"w-full bg-gray-50 border border-gray-200 rounded-lg py-2 pl-10 pr-4 focus:outline-none focus:ring-1 focus:ring-[#0097C3] text-sm text-gray-900",value:t,onChange:e=>n(e.target.value)})]})]}),(0,sv.jsx)("div",{className:"flex-1 overflow-auto p-8",children:"reports"===A?(0,sv.jsxs)("div",{className:"bg-white border border-gray-200 shadow-sm overflow-hidden flex flex-col min-h-[600px]",children:[(0,sv.jsx)("div",{className:"p-6 border-b flex items-center justify-between",children:(0,sv.jsx)("h2",{className:"text-lg font-bold text-gray-800",children:"Reports"})}),(0,sv.jsx)("div",{className:"flex-1 overflow-x-auto",children:(0,sv.jsxs)("table",{className:"w-full text-left",children:[(0,sv.jsx)("thead",{className:"bg-[#F9FAFB] border-b border-gray-200",children:(0,sv.jsxs)("tr",{children:[(0,sv.jsx)("th",{className:"px-6 py-4 text-xs font-bold text-gray-500 uppercase tracking-wider w-16",children:"S.No"}),(0,sv.jsx)("th",{className:"px-6 py-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Name"}),(0,sv.jsx)("th",{className:"px-6 py-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Mobile Number"}),(0,sv.jsx)("th",{className:"px-6 py-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Report"})]})}),(0,sv.jsx)("tbody",{className:"divide-y divide-gray-200",children:g.map((e,t)=>(0,sv.jsxs)("tr",{className:"hover:bg-gray-50 transition-colors",children:[(0,sv.jsx)("td",{className:"px-6 py-4 text-sm text-gray-500 font-medium",children:8*(l-1)+t+1}),(0,sv.jsx)("td",{className:"px-6 py-4 text-sm font-medium text-gray-700",children:e.name}),(0,sv.jsx)("td",{className:"px-6 py-4 text-sm text-gray-500",children:e.phone}),(0,sv.jsx)("td",{className:"px-6 py-4 text-sm text-[#0097C3] font-semibold truncate max-w-[200px]",children:(0,sv.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:e.link?e.link.substring(e.link.indexOf("result")):"-"})})]},e.id))})]})}),(0,sv.jsxs)("div",{className:"p-6 border-t flex items-center justify-between bg-white shrink-0",children:[(0,sv.jsxs)("button",{onClick:()=>v(l-1),disabled:1===l,className:"flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg text-sm font-bold text-black hover:bg-gray-50 transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-sm",children:[(0,sv.jsx)(Eb,{className:"text-lg"}),"Previous"]}),(0,sv.jsx)("div",{className:"flex items-center gap-1",children:(()=>{const e=[];if(p<=7)for(let t=1;t<=p;t++)e.push(t);else l<=4?e.push(1,2,3,4,5,"...",p):l>=p-3?e.push(1,"...",p-4,p-3,p-2,p-1,p):e.push(1,"...",l-1,l,l+1,"...",p);return e.map((e,t)=>(0,sv.jsx)("button",{onClick:()=>"number"===typeof e&&v(e),className:"min-w-[40px] h-10 flex items-center justify-center text-sm font-semibold transition-all duration-200 rounded-lg ".concat(l===e?"bg-gray-50 text-gray-900":"number"===typeof e?"text-gray-500 hover:text-gray-900 hover:bg-gray-50":"text-gray-400 cursor-default"),children:e},t))})()}),(0,sv.jsxs)("button",{onClick:()=>v(l+1),disabled:l===p||0===p,className:"flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg text-sm font-bold text-black hover:bg-gray-50 transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-sm",children:["Next",(0,sv.jsx)(Sb,{className:"text-lg"})]})]})]}):(0,sv.jsxs)("div",{className:"bg-white border border-gray-200 shadow-sm p-8 max-w-2xl",children:[(0,sv.jsx)("h2",{className:"text-xl font-bold text-gray-800 mb-8 pb-4 border-b",children:"General Settings"}),(0,sv.jsxs)("div",{className:"space-y-8",children:[(0,sv.jsxs)("div",{className:"grid grid-cols-3 items-center gap-4",children:[(0,sv.jsx)("label",{className:"text-sm font-bold text-gray-700 uppercase",children:"Site Name"}),(0,sv.jsx)("input",{type:"text",className:"col-span-2 border-b-2 py-2 focus:outline-none focus:border-[#0097C3] transition-colors",value:f.siteName,onChange:e=>h(Vp(Vp({},f),{},{siteName:e.target.value}))})]}),(0,sv.jsxs)("div",{className:"grid grid-cols-3 items-center gap-4",children:[(0,sv.jsx)("label",{className:"text-sm font-bold text-gray-700 uppercase",children:"Admin Email"}),(0,sv.jsx)("input",{type:"email",className:"col-span-2 border-b-2 py-2 focus:outline-none focus:border-[#C7372C] transition-colors",value:f.adminEmail,onChange:e=>h(Vp(Vp({},f),{},{adminEmail:e.target.value}))})]}),(0,sv.jsxs)("div",{className:"flex items-center justify-between py-4 border-t",children:[(0,sv.jsxs)("div",{children:[(0,sv.jsx)("p",{className:"font-bold text-gray-800",children:"WhatsApp Notifications"}),(0,sv.jsx)("p",{className:"text-sm text-gray-500",children:"Send automatic alerts for new analysis signups"})]}),(0,sv.jsx)("button",{onClick:()=>h(Vp(Vp({},f),{},{whatsappNotifications:!f.whatsappNotifications})),className:"w-12 h-6 rounded-full transition-colors relative ".concat(f.whatsappNotifications?"bg-green-500":"bg-gray-300"),children:(0,sv.jsx)("div",{className:"absolute top-1 bg-white w-4 h-4 rounded-full transition-transform ".concat(f.whatsappNotifications?"translate-x-7":"translate-x-1")})})]}),(0,sv.jsxs)("div",{className:"flex items-center justify-between py-4 border-t",children:[(0,sv.jsxs)("div",{children:[(0,sv.jsx)("p",{className:"font-bold text-gray-800",children:"Auto-Archive Reports"}),(0,sv.jsx)("p",{className:"text-sm text-gray-500",children:"Automatically archive reports older than 30 days"})]}),(0,sv.jsx)("button",{onClick:()=>h(Vp(Vp({},f),{},{autoArchive:!f.autoArchive})),className:"w-12 h-6 rounded-full transition-colors relative ".concat(f.autoArchive?"bg-[#0097C3]":"bg-gray-300"),children:(0,sv.jsx)("div",{className:"absolute top-1 bg-white w-4 h-4 rounded-full transition-transform ".concat(f.autoArchive?"translate-x-7":"translate-x-1")})})]}),(0,sv.jsx)("div",{className:"pt-6",children:(0,sv.jsx)("button",{className:"bg-[#0097C3] text-white px-8 py-3 font-bold uppercase tracking-widest hover:bg-[#007ba0] transition-colors",children:"Save Changes"})})]})]})})]}),a&&(0,sv.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:(0,sv.jsxs)("div",{className:"bg-white w-full max-w-lg p-10 relative shadow-2xl animate-[fadeIn_0.2s_ease-out] rounded-none",children:[(0,sv.jsxs)("div",{className:"flex justify-between items-center mb-10",children:[(0,sv.jsx)("h2",{className:"text-4xl font-bold text-[#18181b]",children:"Help"}),(0,sv.jsx)("button",{onClick:()=>s(!1),className:"text-gray-900 hover:text-black transition-colors",children:(0,sv.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,sv.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,sv.jsxs)("div",{className:"space-y-8",children:[(0,sv.jsxs)("div",{className:"flex items-start gap-4",children:[(0,sv.jsx)("div",{className:"w-2 h-2 rounded-full bg-gray-500 mt-2.5 shrink-0"}),(0,sv.jsxs)("p",{className:"text-xl text-gray-600 leading-relaxed",children:["To access previous reports, please contact us at ",(0,sv.jsx)("i",{className:"text-gray-800 font-medium",children:"hello@elixify.com"})]})]}),(0,sv.jsxs)("div",{className:"flex items-start gap-4",children:[(0,sv.jsx)("div",{className:"w-2 h-2 rounded-full bg-gray-500 mt-2.5 shrink-0"}),(0,sv.jsxs)("p",{className:"text-xl text-gray-600 leading-relaxed",children:["If you experience any technical issues, please contact us at ",(0,sv.jsx)("i",{className:"text-gray-800 font-medium",children:"support@example.com"})]})]})]})]})})]})};t.createRoot(document.getElementById("root")).render((0,sv.jsx)(e.StrictMode,{children:(0,sv.jsx)(Xm,{basename:"/elixifyskinanalyser",children:(0,sv.jsxs)(gm,{children:[(0,sv.jsx)(dm,{path:"/",element:(0,sv.jsx)(Av,{})}),(0,sv.jsx)(dm,{path:"/result",element:(0,sv.jsx)(Fb,{})}),(0,sv.jsx)(dm,{path:"/login",element:(0,sv.jsx)(Qb,{})}),(0,sv.jsx)(dm,{path:"/dashboard",element:(0,sv.jsx)(Rb,{})})]})})}))})()})();
|
|
//# sourceMappingURL=main.c8d4b79e.js.map |