var Em=Object.defineProperty;var wm=(e,i,s)=>i in e?Em(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s;var Wn=(e,i,s)=>(wm(e,typeof i!="symbol"?i+"":i,s),s),fs=(e,i,s)=>{if(!i.has(e))throw TypeError("Cannot "+s)};var Pt=(e,i,s)=>(fs(e,i,"read from private field"),s?s.call(e):i.get(e)),rn=(e,i,s)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,s)},fn=(e,i,s,o)=>(fs(e,i,"write to private field"),o?o.call(e,s):i.set(e,s),s),ps=(e,i,s,o)=>({set _(a){fn(e,i,a,s)},get _(){return Pt(e,i,o)}}),on=(e,i,s)=>(fs(e,i,"access private method"),s);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(a){if(a.ep)return;a.ep=!0;const c=s(a);fetch(a.href,c)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var i=e.default;if(typeof i=="function"){var s=function o(){if(this instanceof o){var a=[null];a.push.apply(a,arguments);var c=Function.bind.apply(i,a);return new c}return i.apply(this,arguments)};s.prototype=i.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(s,o,a.get?a:{enumerable:!0,get:function(){return e[o]}})}),s}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var l$1=Symbol.for("react.element"),n$1=Symbol.for("react.portal"),p$2=Symbol.for("react.fragment"),q$1=Symbol.for("react.strict_mode"),r$1=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$1=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z$1=Symbol.iterator;function A$1(e){return e===null||typeof e!="object"?null:(e=z$1&&e[z$1]||e["@@iterator"],typeof e=="function"?e:null)}var B$1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D$1={};function E$1(e,i,s){this.props=e,this.context=i,this.refs=D$1,this.updater=s||B$1}E$1.prototype.isReactComponent={};E$1.prototype.setState=function(e,i){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,i,"setState")};E$1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F(){}F.prototype=E$1.prototype;function G$1(e,i,s){this.props=e,this.context=i,this.refs=D$1,this.updater=s||B$1}var H$1=G$1.prototype=new F;H$1.constructor=G$1;C$1(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I$1=Array.isArray,J=Object.prototype.hasOwnProperty,K$1={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};function M$1(e,i,s){var o,a={},c=null,d=null;if(i!=null)for(o in i.ref!==void 0&&(d=i.ref),i.key!==void 0&&(c=""+i.key),i)J.call(i,o)&&!L$1.hasOwnProperty(o)&&(a[o]=i[o]);var g=arguments.length-2;if(g===1)a.children=s;else if(1>>1,Tt=Ft[Xt];if(0>>1;Xta(At,qt))Rta(Dt,At)?(Ft[Xt]=Dt,Ft[Rt]=qt,Xt=Rt):(Ft[Xt]=At,Ft[mt]=qt,Xt=mt);else if(Rta(Dt,qt))Ft[Xt]=Dt,Ft[Rt]=qt,Xt=Rt;else break e}}return Ht}function a(Ft,Ht){var qt=Ft.sortIndex-Ht.sortIndex;return qt!==0?qt:Ft.id-Ht.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,g=d.now();e.unstable_now=function(){return d.now()-g}}var _=[],b=[],_e=1,rt=null,st=3,lt=!1,tt=!1,$=!1,ot=typeof setTimeout=="function"?setTimeout:null,et=typeof clearTimeout=="function"?clearTimeout:null,it=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function nt(Ft){for(var Ht=s(b);Ht!==null;){if(Ht.callback===null)o(b);else if(Ht.startTime<=Ft)o(b),Ht.sortIndex=Ht.expirationTime,i(_,Ht);else break;Ht=s(b)}}function at(Ft){if($=!1,nt(Ft),!tt)if(s(_)!==null)tt=!0,Wt(yt);else{var Ht=s(b);Ht!==null&&jt(at,Ht.startTime-Ft)}}function yt(Ft,Ht){tt=!1,$&&($=!1,et(ct),ct=-1),lt=!0;var qt=st;try{for(nt(Ht),rt=s(_);rt!==null&&(!(rt.expirationTime>Ht)||Ft&&!Et());){var Xt=rt.callback;if(typeof Xt=="function"){rt.callback=null,st=rt.priorityLevel;var Tt=Xt(rt.expirationTime<=Ht);Ht=e.unstable_now(),typeof Tt=="function"?rt.callback=Tt:rt===s(_)&&o(_),nt(Ht)}else o(_);rt=s(_)}if(rt!==null)var gt=!0;else{var mt=s(b);mt!==null&&jt(at,mt.startTime-Ht),gt=!1}return gt}finally{rt=null,st=qt,lt=!1}}var vt=!1,xt=null,ct=-1,pt=5,ht=-1;function Et(){return!(e.unstable_now()-htFt||125Xt?(Ft.sortIndex=qt,i(b,Ft),s(_)===null&&Ft===s(b)&&($?(et(ct),ct=-1):$=!0,jt(at,qt-Xt))):(Ft.sortIndex=Tt,i(_,Ft),tt||lt||(tt=!0,Wt(yt))),Ft},e.unstable_shouldYield=Et,e.unstable_wrapCallback=function(Ft){var Ht=st;return function(){var qt=st;st=Ht;try{return Ft.apply(this,arguments)}finally{st=qt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var aa=reactExports,ca=schedulerExports;function p(e){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[: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]*$/,la={},ma={};function oa(e){return ja.call(ma,e)?!0:ja.call(la,e)?!1:ka.test(e)?ma[e]=!0:(la[e]=!0,!1)}function pa(e,i,s,o){if(s!==null&&s.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return o?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qa(e,i,s,o){if(i===null||typeof i>"u"||pa(e,i,s,o))return!0;if(o)return!1;if(s!==null)switch(s.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function v(e,i,s,o,a,c,d){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=o,this.attributeNamespace=a,this.mustUseProperty=s,this.propertyName=e,this.type=i,this.sanitizeURL=c,this.removeEmptyString=d}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){z[e]=new v(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var i=e[0];z[i]=new v(i,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){z[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){z[e]=new v(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){z[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){z[e]=new v(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){z[e]=new v(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){z[e]=new v(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){z[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var i=e.replace(ra,sa);z[i]=new v(i,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var i=e.replace(ra,sa);z[i]=new v(i,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var i=e.replace(ra,sa);z[i]=new v(i,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){z[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)});z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){z[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function ta(e,i,s,o){var a=z.hasOwnProperty(i)?z[i]:null;(a!==null?a.type!==0:o||!(2g||a[d]!==c[g]){var _=` `+a[d].replace(" at new "," at ");return e.displayName&&_.includes("")&&(_=_.replace("",e.displayName)),_}while(1<=d&&0<=g);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?Ma(e):""}function Pa(e){switch(e.tag){case 5:return Ma(e.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return e=Oa(e.type,!1),e;case 11:return e=Oa(e.type.render,!1),e;case 1:return e=Oa(e.type,!0),e;default:return""}}function Qa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ca:return(e.displayName||"Context")+".Consumer";case Ba:return(e._context.displayName||"Context")+".Provider";case Da:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ga:return i=e.displayName||null,i!==null?i:Qa(e.type)||"Memo";case Ha:i=e._payload,e=e._init;try{return Qa(e(i))}catch{}}return null}function Ra(e){var i=e.type;switch(e.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=i.render,e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(i);case 8:return i===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Sa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ta(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ua(e){var i=Ta(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,i),o=""+e[i];if(!e.hasOwnProperty(i)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var a=s.get,c=s.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return a.call(this)},set:function(d){o=""+d,c.call(this,d)}}),Object.defineProperty(e,i,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(d){o=""+d},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Va(e){e._valueTracker||(e._valueTracker=Ua(e))}function Wa(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var s=i.getValue(),o="";return e&&(o=Ta(e)?e.checked?"true":"false":e.value),e=o,e!==s?(i.setValue(e),!0):!1}function Xa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ya(e,i){var s=i.checked;return A({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Za(e,i){var s=i.defaultValue==null?"":i.defaultValue,o=i.checked!=null?i.checked:i.defaultChecked;s=Sa(i.value!=null?i.value:s),e._wrapperState={initialChecked:o,initialValue:s,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function ab(e,i){i=i.checked,i!=null&&ta(e,"checked",i,!1)}function bb(e,i){ab(e,i);var s=Sa(i.value),o=i.type;if(s!=null)o==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}i.hasOwnProperty("value")?cb(e,i.type,s):i.hasOwnProperty("defaultValue")&&cb(e,i.type,Sa(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(e.defaultChecked=!!i.defaultChecked)}function db(e,i,s){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var o=i.type;if(!(o!=="submit"&&o!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+e._wrapperState.initialValue,s||i===e.value||(e.value=i),e.defaultValue=i}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function cb(e,i,s){(i!=="number"||Xa(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var eb=Array.isArray;function fb(e,i,s,o){if(e=e.options,i){i={};for(var a=0;a"+i.valueOf().toString()+"",i=mb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;i.firstChild;)e.appendChild(i.firstChild)}});function ob(e,i){if(i){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=i;return}}e.textContent=i}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(e){qb.forEach(function(i){i=i+e.charAt(0).toUpperCase()+e.substring(1),pb[i]=pb[e]})});function rb(e,i,s){return i==null||typeof i=="boolean"||i===""?"":s||typeof i!="number"||i===0||pb.hasOwnProperty(e)&&pb[e]?(""+i).trim():i+"px"}function sb(e,i){e=e.style;for(var s in i)if(i.hasOwnProperty(s)){var o=s.indexOf("--")===0,a=rb(s,i[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,a):e[s]=a}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(e,i){if(i){if(tb[e]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(p(137,e));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(p(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(p(61))}if(i.style!=null&&typeof i.style!="object")throw Error(p(62))}}function vb(e,i){if(e.indexOf("-")===-1)return typeof i.is=="string";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 wb=null;function xb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yb=null,zb=null,Ab=null;function Bb(e){if(e=Cb(e)){if(typeof yb!="function")throw Error(p(280));var i=e.stateNode;i&&(i=Db(i),yb(e.stateNode,e.type,i))}}function Eb(e){zb?Ab?Ab.push(e):Ab=[e]:zb=e}function Fb(){if(zb){var e=zb,i=Ab;if(Ab=zb=null,Bb(e),i)for(e=0;e>>=0,e===0?32:31-(pc(e)/qc|0)|0}var rc=64,sc=4194304;function tc(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function uc(e,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,a=e.suspendedLanes,c=e.pingedLanes,d=s&268435455;if(d!==0){var g=d&~a;g!==0?o=tc(g):(c&=d,c!==0&&(o=tc(c)))}else d=s&~a,d!==0?o=tc(d):c!==0&&(o=tc(c));if(o===0)return 0;if(i!==0&&i!==o&&!(i&a)&&(a=o&-o,c=i&-i,a>=c||a===16&&(c&4194240)!==0))return i;if(o&4&&(o|=s&16),i=e.entangledLanes,i!==0)for(e=e.entanglements,i&=o;0s;s++)i.push(e);return i}function Ac(e,i,s){e.pendingLanes|=i,i!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,i=31-oc(i),e[i]=s}function Bc(e,i){var s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;function ge(e,i){switch(e){case"keyup":return $d.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ie=!1;function je(e,i){switch(e){case"compositionend":return he(i);case"keypress":return i.which!==32?null:(fe=!0,ee);case"textInput":return e=i.data,e===ee&&fe?null:e;default:return null}}function ke(e,i){if(ie)return e==="compositionend"||!ae&&ge(e,i)?(e=nd(),md=ld=kd=null,ie=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:s,offset:i-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je(s)}}function Le(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Le(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Me(){for(var e=window,i=Xa();i instanceof e.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)e=i.contentWindow;else break;i=Xa(e.document)}return i}function Ne(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}function Oe(e){var i=Me(),s=e.focusedElem,o=e.selectionRange;if(i!==s&&s&&s.ownerDocument&&Le(s.ownerDocument.documentElement,s)){if(o!==null&&Ne(s)){if(i=o.start,e=o.end,e===void 0&&(e=i),"selectionStart"in s)s.selectionStart=i,s.selectionEnd=Math.min(e,s.value.length);else if(e=(i=s.ownerDocument||document)&&i.defaultView||window,e.getSelection){e=e.getSelection();var a=s.textContent.length,c=Math.min(o.start,a);o=o.end===void 0?c:Math.min(o.end,a),!e.extend&&c>o&&(a=o,o=c,c=a),a=Ke(s,c);var d=Ke(s,o);a&&d&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(i=i.createRange(),i.setStart(a.node,a.offset),e.removeAllRanges(),c>o?(e.addRange(i),e.extend(d.node,d.offset)):(i.setEnd(d.node,d.offset),e.addRange(i)))}}for(i=[],e=s;e=e.parentNode;)e.nodeType===1&&i.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(e,i,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te||Qe==null||Qe!==Xa(o)||(o=Qe,"selectionStart"in o&&Ne(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Se&&Ie(Se,o)||(Se=o,o=oe(Re,"onSelect"),0Tf||(e.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(e,i){Tf++,Sf[Tf]=e.current,e.current=i}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(e,i){var s=e.type.contextTypes;if(!s)return Vf;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===i)return o.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in s)a[c]=i[c];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),a}function Zf(e){return e=e.childContextTypes,e!=null}function $f(){E(Wf),E(H)}function ag(e,i,s){if(H.current!==Vf)throw Error(p(168));G(H,i),G(Wf,s)}function bg(e,i,s){var o=e.stateNode;if(i=i.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var a in o)if(!(a in i))throw Error(p(108,Ra(e)||"Unknown",a));return A({},s,o)}function cg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,e),G(Wf,Wf.current),!0}function dg(e,i,s){var o=e.stateNode;if(!o)throw Error(p(169));s?(e=bg(e,i,Xf),o.__reactInternalMemoizedMergedChildContext=e,E(Wf),E(H),G(H,e)):E(Wf),G(Wf,s)}var eg=null,fg=!1,gg=!1;function hg(e){eg===null?eg=[e]:eg.push(e)}function ig(e){fg=!0,hg(e)}function jg(){if(!gg&&eg!==null){gg=!0;var e=0,i=C;try{var s=eg;for(C=1;e>=d,a-=d,rg=1<<32-oc(i)+a|s<ct?(pt=xt,xt=null):pt=xt.sibling;var ht=st(et,xt,nt[ct],at);if(ht===null){xt===null&&(xt=pt);break}e&&xt&&ht.alternate===null&&i(et,xt),it=c(ht,it,ct),vt===null?yt=ht:vt.sibling=ht,vt=ht,xt=pt}if(ct===nt.length)return s(et,xt),I&&tg(et,ct),yt;if(xt===null){for(;ctct?(pt=xt,xt=null):pt=xt.sibling;var Et=st(et,xt,ht.value,at);if(Et===null){xt===null&&(xt=pt);break}e&&xt&&Et.alternate===null&&i(et,xt),it=c(Et,it,ct),vt===null?yt=Et:vt.sibling=Et,vt=Et,xt=pt}if(ht.done)return s(et,xt),I&&tg(et,ct),yt;if(xt===null){for(;!ht.done;ct++,ht=nt.next())ht=rt(et,ht.value,at),ht!==null&&(it=c(ht,it,ct),vt===null?yt=ht:vt.sibling=ht,vt=ht);return I&&tg(et,ct),yt}for(xt=o(et,xt);!ht.done;ct++,ht=nt.next())ht=lt(xt,et,ct,ht.value,at),ht!==null&&(e&&ht.alternate!==null&&xt.delete(ht.key===null?ct:ht.key),it=c(ht,it,ct),vt===null?yt=ht:vt.sibling=ht,vt=ht);return e&&xt.forEach(function(Ct){return i(et,Ct)}),I&&tg(et,ct),yt}function ot(et,it,nt,at){if(typeof nt=="object"&&nt!==null&&nt.type===ya&&nt.key===null&&(nt=nt.props.children),typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case va:e:{for(var yt=nt.key,vt=it;vt!==null;){if(vt.key===yt){if(yt=nt.type,yt===ya){if(vt.tag===7){s(et,vt.sibling),it=a(vt,nt.props.children),it.return=et,et=it;break e}}else if(vt.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===Ha&&uh(yt)===vt.type){s(et,vt.sibling),it=a(vt,nt.props),it.ref=sh(et,vt,nt),it.return=et,et=it;break e}s(et,vt);break}else i(et,vt);vt=vt.sibling}nt.type===ya?(it=Ah(nt.props.children,et.mode,at,nt.key),it.return=et,et=it):(at=yh(nt.type,nt.key,nt.props,null,et.mode,at),at.ref=sh(et,it,nt),at.return=et,et=at)}return d(et);case wa:e:{for(vt=nt.key;it!==null;){if(it.key===vt)if(it.tag===4&&it.stateNode.containerInfo===nt.containerInfo&&it.stateNode.implementation===nt.implementation){s(et,it.sibling),it=a(it,nt.children||[]),it.return=et,et=it;break e}else{s(et,it);break}else i(et,it);it=it.sibling}it=zh(nt,et.mode,at),it.return=et,et=it}return d(et);case Ha:return vt=nt._init,ot(et,it,vt(nt._payload),at)}if(eb(nt))return tt(et,it,nt,at);if(Ka(nt))return $(et,it,nt,at);th(et,nt)}return typeof nt=="string"&&nt!==""||typeof nt=="number"?(nt=""+nt,it!==null&&it.tag===6?(s(et,it.sibling),it=a(it,nt),it.return=et,et=it):(s(et,it),it=xh(nt,et.mode,at),it.return=et,et=it),d(et)):s(et,it)}return ot}var Bh=vh$1(!0),Ch=vh$1(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(e){if(e===Dh)throw Error(p(174));return e}function Ih(e,i){switch(G(Gh,i),G(Fh,e),G(Eh,Dh),e=i.nodeType,e){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:lb(null,"");break;default:e=e===8?i.parentNode:i,i=e.namespaceURI||null,e=e.tagName,i=lb(i,e)}E(Eh),G(Eh,i)}function Jh(){E(Eh),E(Fh),E(Gh)}function Kh(e){Hh(Gh.current);var i=Hh(Eh.current),s=lb(i,e.type);i!==s&&(G(Fh,e),G(Eh,s))}function Lh(e){Fh.current===e&&(E(Eh),E(Fh))}var M=Uf(0);function Mh(e){for(var i=e;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Nh=[];function Oh(){for(var e=0;es?s:4,e(!0);var o=Qh.transition;Qh.transition={};try{e(!1),i()}finally{C=s,Qh.transition=o}}function Fi(){return di().memoizedState}function Gi(e,i,s){var o=lh(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},Hi(e))Ii(i,s);else if(s=Yg(e,i,s,o),s!==null){var a=L();mh(s,e,o,a),Ji(s,i,o)}}function ri(e,i,s){var o=lh(e),a={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hi(e))Ii(i,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=i.lastRenderedReducer,c!==null))try{var d=i.lastRenderedState,g=c(d,s);if(a.hasEagerState=!0,a.eagerState=g,He(g,d)){var _=i.interleaved;_===null?(a.next=a,Xg(i)):(a.next=_.next,_.next=a),i.interleaved=a;return}}catch{}finally{}s=Yg(e,i,a,o),s!==null&&(a=L(),mh(s,e,o,a),Ji(s,i,o))}}function Hi(e){var i=e.alternate;return e===N||i!==null&&i===N}function Ii(e,i){Th=Sh=!0;var s=e.pending;s===null?i.next=i:(i.next=s.next,s.next=i),e.pending=i}function Ji(e,i,s){if(s&4194240){var o=i.lanes;o&=e.pendingLanes,s|=o,i.lanes=s,Cc(e,s)}}var ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(e,i){return ci().memoizedState=[e,i===void 0?null:i],e},useContext:Vg,useEffect:vi,useImperativeHandle:function(e,i,s){return s=s!=null?s.concat([e]):null,ti(4194308,4,yi.bind(null,i,e),s)},useLayoutEffect:function(e,i){return ti(4194308,4,e,i)},useInsertionEffect:function(e,i){return ti(4,2,e,i)},useMemo:function(e,i){var s=ci();return i=i===void 0?null:i,e=e(),s.memoizedState=[e,i],e},useReducer:function(e,i,s){var o=ci();return i=s!==void 0?s(i):i,o.memoizedState=o.baseState=i,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},o.queue=e,e=e.dispatch=Gi.bind(null,N,e),[o.memoizedState,e]},useRef:function(e){var i=ci();return e={current:e},i.memoizedState=e},useState:qi,useDebugValue:Ai,useDeferredValue:function(e){return ci().memoizedState=e},useTransition:function(){var e=qi(!1),i=e[0];return e=Ei.bind(null,e[1]),ci().memoizedState=e,[i,e]},useMutableSource:function(){},useSyncExternalStore:function(e,i,s){var o=N,a=ci();if(I){if(s===void 0)throw Error(p(407));s=s()}else{if(s=i(),R===null)throw Error(p(349));Rh&30||ni(o,i,s)}a.memoizedState=s;var c={value:s,getSnapshot:i};return a.queue=c,vi(ki.bind(null,o,c,e),[e]),o.flags|=2048,li(9,mi.bind(null,o,c,s,i),void 0,null),s},useId:function(){var e=ci(),i=R.identifierPrefix;if(I){var s=sg,o=rg;s=(o&~(1<<32-oc(o)-1)).toString(32)+s,i=":"+i+"R"+s,s=Uh++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=d.createElement(s,{is:o.is}):(e=d.createElement(s),s==="select"&&(d=e,o.multiple?d.multiple=!0:o.size&&(d.size=o.size))):e=d.createElementNS(e,s),e[Of]=i,e[Pf]=o,Aj(e,i,!1,!1),i.stateNode=e;e:{switch(d=vb(s,o),s){case"dialog":D("cancel",e),D("close",e),a=o;break;case"iframe":case"object":case"embed":D("load",e),a=o;break;case"video":case"audio":for(a=0;aHj&&(i.flags|=128,o=!0,Ej(c,!1),i.lanes=4194304)}else{if(!o)if(e=Mh(d),e!==null){if(i.flags|=128,o=!0,s=e.updateQueue,s!==null&&(i.updateQueue=s,i.flags|=4),Ej(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!I)return S(i),null}else 2*B()-c.renderingStartTime>Hj&&s!==1073741824&&(i.flags|=128,o=!0,Ej(c,!1),i.lanes=4194304);c.isBackwards?(d.sibling=i.child,i.child=d):(s=c.last,s!==null?s.sibling=d:i.child=d,c.last=d)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=B(),i.sibling=null,s=M.current,G(M,o?s&1|2:s&1),i):(S(i),null);case 22:case 23:return Ij(),o=i.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(i.flags|=8192),o&&i.mode&1?gj&1073741824&&(S(i),i.subtreeFlags&6&&(i.flags|=8192)):S(i),null;case 24:return null;case 25:return null}throw Error(p(156,i.tag))}function Jj(e,i){switch(wg(i),i.tag){case 1:return Zf(i.type)&&$f(),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Jh(),E(Wf),E(H),Oh(),e=i.flags,e&65536&&!(e&128)?(i.flags=e&-65537|128,i):null;case 5:return Lh(i),null;case 13:if(E(M),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(p(340));Ig()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(i.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Mj(e,i){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){W(e,i,o)}else s.current=null}function Nj(e,i,s){try{s()}catch(o){W(e,i,o)}}var Oj=!1;function Pj(e,i){if(Cf=dd,e=Me(),Ne(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var a=o.anchorOffset,c=o.focusNode;o=o.focusOffset;try{s.nodeType,c.nodeType}catch{s=null;break e}var d=0,g=-1,_=-1,b=0,_e=0,rt=e,st=null;t:for(;;){for(var lt;rt!==s||a!==0&&rt.nodeType!==3||(g=d+a),rt!==c||o!==0&&rt.nodeType!==3||(_=d+o),rt.nodeType===3&&(d+=rt.nodeValue.length),(lt=rt.firstChild)!==null;)st=rt,rt=lt;for(;;){if(rt===e)break t;if(st===s&&++b===a&&(g=d),st===c&&++_e===o&&(_=d),(lt=rt.nextSibling)!==null)break;rt=st,st=rt.parentNode}rt=lt}s=g===-1||_===-1?null:{start:g,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:e,selectionRange:s},dd=!1,V=i;V!==null;)if(i=V,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,V=e;else for(;V!==null;){i=V;try{var tt=i.alternate;if(i.flags&1024)switch(i.tag){case 0:case 11:case 15:break;case 1:if(tt!==null){var $=tt.memoizedProps,ot=tt.memoizedState,et=i.stateNode,it=et.getSnapshotBeforeUpdate(i.elementType===i.type?$:Lg(i.type,$),ot);et.__reactInternalSnapshotBeforeUpdate=it}break;case 3:var nt=i.stateNode.containerInfo;nt.nodeType===1?nt.textContent="":nt.nodeType===9&&nt.documentElement&&nt.removeChild(nt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(at){W(i,i.return,at)}if(e=i.sibling,e!==null){e.return=i.return,V=e;break}V=i.return}return tt=Oj,Oj=!1,tt}function Qj(e,i,s){var o=i.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var a=o=o.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Nj(i,s,c)}a=a.next}while(a!==o)}}function Rj(e,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var o=s.create;s.destroy=o()}s=s.next}while(s!==i)}}function Sj(e){var i=e.ref;if(i!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof i=="function"?i(e):i.current=e}}function Tj(e){var i=e.alternate;i!==null&&(e.alternate=null,Tj(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&(delete i[Of],delete i[Pf],delete i[of],delete i[Qf],delete i[Rf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uj(e){return e.tag===5||e.tag===3||e.tag===4}function Vj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wj(e,i,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?s.nodeType===8?s.parentNode.insertBefore(e,i):s.insertBefore(e,i):(s.nodeType===8?(i=s.parentNode,i.insertBefore(e,s)):(i=s,i.appendChild(e)),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Bf));else if(o!==4&&(e=e.child,e!==null))for(Wj(e,i,s),e=e.sibling;e!==null;)Wj(e,i,s),e=e.sibling}function Xj(e,i,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?s.insertBefore(e,i):s.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Xj(e,i,s),e=e.sibling;e!==null;)Xj(e,i,s),e=e.sibling}var X=null,Yj=!1;function Zj(e,i,s){for(s=s.child;s!==null;)ak(e,i,s),s=s.sibling}function ak(e,i,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Mj(s,i);case 6:var o=X,a=Yj;X=null,Zj(e,i,s),X=o,Yj=a,X!==null&&(Yj?(e=X,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Yj?(e=X,s=s.stateNode,e.nodeType===8?Kf(e.parentNode,s):e.nodeType===1&&Kf(e,s),bd(e)):Kf(X,s.stateNode));break;case 4:o=X,a=Yj,X=s.stateNode.containerInfo,Yj=!0,Zj(e,i,s),X=o,Yj=a;break;case 0:case 11:case 14:case 15:if(!U&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){a=o=o.next;do{var c=a,d=c.destroy;c=c.tag,d!==void 0&&(c&2||c&4)&&Nj(s,i,d),a=a.next}while(a!==o)}Zj(e,i,s);break;case 1:if(!U&&(Mj(s,i),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(g){W(s,i,g)}Zj(e,i,s);break;case 21:Zj(e,i,s);break;case 22:s.mode&1?(U=(o=U)||s.memoizedState!==null,Zj(e,i,s),U=o):Zj(e,i,s);break;default:Zj(e,i,s)}}function bk(e){var i=e.updateQueue;if(i!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Lj),i.forEach(function(o){var a=ck.bind(null,e,o);s.has(o)||(s.add(o),o.then(a,a))})}}function dk(e,i){var s=i.deletions;if(s!==null)for(var o=0;oa&&(a=d),o&=~c}if(o=a,o=B()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*mk(o/1960))-o,10e?16:e,xk===null)var o=!1;else{if(e=xk,xk=null,yk=0,K&6)throw Error(p(331));var a=K;for(K|=4,V=e.current;V!==null;){var c=V,d=c.child;if(V.flags&16){var g=c.deletions;if(g!==null){for(var _=0;_B()-gk?Lk(e,0):sk|=s),Ek(e,i)}function Zk(e,i){i===0&&(e.mode&1?(i=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):i=1);var s=L();e=Zg(e,i),e!==null&&(Ac(e,i,s),Ek(e,s))}function vj(e){var i=e.memoizedState,s=0;i!==null&&(s=i.retryLane),Zk(e,s)}function ck(e,i){var s=0;switch(e.tag){case 13:var o=e.stateNode,a=e.memoizedState;a!==null&&(s=a.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(p(314))}o!==null&&o.delete(i),Zk(e,s)}var Wk;Wk=function(e,i,s){if(e!==null)if(e.memoizedProps!==i.pendingProps||Wf.current)Ug=!0;else{if(!(e.lanes&s)&&!(i.flags&128))return Ug=!1,zj(e,i,s);Ug=!!(e.flags&131072)}else Ug=!1,I&&i.flags&1048576&&ug(i,ng,i.index);switch(i.lanes=0,i.tag){case 2:var o=i.type;jj(e,i),e=i.pendingProps;var a=Yf(i,H.current);Tg(i,s),a=Xh(null,i,o,e,a,s);var c=bi();return i.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,Zf(o)?(c=!0,cg(i)):c=!1,i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ah(i),a.updater=nh,i.stateNode=a,a._reactInternals=i,rh(i,o,e,s),i=kj(null,i,o,!0,c,s)):(i.tag=0,I&&c&&vg(i),Yi(null,i,a,s),i=i.child),i;case 16:o=i.elementType;e:{switch(jj(e,i),e=i.pendingProps,a=o._init,o=a(o._payload),i.type=o,a=i.tag=$k(o),e=Lg(o,e),a){case 0:i=dj(null,i,o,e,s);break e;case 1:i=ij(null,i,o,e,s);break e;case 11:i=Zi(null,i,o,e,s);break e;case 14:i=aj(null,i,o,Lg(o.type,e),s);break e}throw Error(p(306,o,""))}return i;case 0:return o=i.type,a=i.pendingProps,a=i.elementType===o?a:Lg(o,a),dj(e,i,o,a,s);case 1:return o=i.type,a=i.pendingProps,a=i.elementType===o?a:Lg(o,a),ij(e,i,o,a,s);case 3:e:{if(lj(i),e===null)throw Error(p(387));o=i.pendingProps,c=i.memoizedState,a=c.element,bh(e,i),gh(i,o,null,s);var d=i.memoizedState;if(o=d.element,c.isDehydrated)if(c={element:o,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},i.updateQueue.baseState=c,i.memoizedState=c,i.flags&256){a=Ki(Error(p(423)),i),i=mj(e,i,o,s,a);break e}else if(o!==a){a=Ki(Error(p(424)),i),i=mj(e,i,o,s,a);break e}else for(yg=Lf(i.stateNode.containerInfo.firstChild),xg=i,I=!0,zg=null,s=Ch(i,null,o,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),o===a){i=$i(e,i,s);break e}Yi(e,i,o,s)}i=i.child}return i;case 5:return Kh(i),e===null&&Eg(i),o=i.type,a=i.pendingProps,c=e!==null?e.memoizedProps:null,d=a.children,Ef(o,a)?d=null:c!==null&&Ef(o,c)&&(i.flags|=32),hj(e,i),Yi(e,i,d,s),i.child;case 6:return e===null&&Eg(i),null;case 13:return pj(e,i,s);case 4:return Ih(i,i.stateNode.containerInfo),o=i.pendingProps,e===null?i.child=Bh(i,null,o,s):Yi(e,i,o,s),i.child;case 11:return o=i.type,a=i.pendingProps,a=i.elementType===o?a:Lg(o,a),Zi(e,i,o,a,s);case 7:return Yi(e,i,i.pendingProps,s),i.child;case 8:return Yi(e,i,i.pendingProps.children,s),i.child;case 12:return Yi(e,i,i.pendingProps.children,s),i.child;case 10:e:{if(o=i.type._context,a=i.pendingProps,c=i.memoizedProps,d=a.value,G(Mg,o._currentValue),o._currentValue=d,c!==null)if(He(c.value,d)){if(c.children===a.children&&!Wf.current){i=$i(e,i,s);break e}}else for(c=i.child,c!==null&&(c.return=i);c!==null;){var g=c.dependencies;if(g!==null){d=c.child;for(var _=g.firstContext;_!==null;){if(_.context===o){if(c.tag===1){_=ch(-1,s&-s),_.tag=2;var b=c.updateQueue;if(b!==null){b=b.shared;var _e=b.pending;_e===null?_.next=_:(_.next=_e.next,_e.next=_),b.pending=_}}c.lanes|=s,_=c.alternate,_!==null&&(_.lanes|=s),Sg(c.return,s,i),g.lanes|=s;break}_=_.next}}else if(c.tag===10)d=c.type===i.type?null:c.child;else if(c.tag===18){if(d=c.return,d===null)throw Error(p(341));d.lanes|=s,g=d.alternate,g!==null&&(g.lanes|=s),Sg(d,s,i),d=c.sibling}else d=c.child;if(d!==null)d.return=c;else for(d=c;d!==null;){if(d===i){d=null;break}if(c=d.sibling,c!==null){c.return=d.return,d=c;break}d=d.return}c=d}Yi(e,i,a.children,s),i=i.child}return i;case 9:return a=i.type,o=i.pendingProps.children,Tg(i,s),a=Vg(a),o=o(a),i.flags|=1,Yi(e,i,o,s),i.child;case 14:return o=i.type,a=Lg(o,i.pendingProps),a=Lg(o.type,a),aj(e,i,o,a,s);case 15:return cj(e,i,i.type,i.pendingProps,s);case 17:return o=i.type,a=i.pendingProps,a=i.elementType===o?a:Lg(o,a),jj(e,i),i.tag=1,Zf(o)?(e=!0,cg(i)):e=!1,Tg(i,s),ph(i,o,a),rh(i,o,a,s),kj(null,i,o,!0,e,s);case 19:return yj(e,i,s);case 22:return ej(e,i,s)}throw Error(p(156,i.tag))};function Gk(e,i){return ac(e,i)}function al(e,i,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(e,i,s,o){return new al(e,i,s,o)}function bj(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $k(e){if(typeof e=="function")return bj(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Da)return 11;if(e===Ga)return 14}return 2}function wh(e,i){var s=e.alternate;return s===null?(s=Bg(e.tag,i,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=i,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,i=e.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function yh(e,i,s,o,a,c){var d=2;if(o=e,typeof e=="function")bj(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case ya:return Ah(s.children,a,c,i);case za:d=8,a|=8;break;case Aa:return e=Bg(12,s,i,a|2),e.elementType=Aa,e.lanes=c,e;case Ea:return e=Bg(13,s,i,a),e.elementType=Ea,e.lanes=c,e;case Fa:return e=Bg(19,s,i,a),e.elementType=Fa,e.lanes=c,e;case Ia:return qj(s,a,c,i);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ba:d=10;break e;case Ca:d=9;break e;case Da:d=11;break e;case Ga:d=14;break e;case Ha:d=16,o=null;break e}throw Error(p(130,e==null?e:typeof e,""))}return i=Bg(d,s,i,a),i.elementType=e,i.type=o,i.lanes=c,i}function Ah(e,i,s,o){return e=Bg(7,e,o,i),e.lanes=s,e}function qj(e,i,s,o){return e=Bg(22,e,o,i),e.elementType=Ia,e.lanes=s,e.stateNode={isHidden:!1},e}function xh(e,i,s){return e=Bg(6,e,null,i),e.lanes=s,e}function zh(e,i,s){return i=Bg(4,e.children!==null?e.children:[],e.key,i),i.lanes=s,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}function bl(e,i,s,o,a){this.tag=i,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=o,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function cl(e,i,s,o,a,c,d,g,_){return e=new bl(e,i,s,g,_),i===1?(i=1,c===!0&&(i|=8)):i=0,c=Bg(3,null,null,i),e.current=c,c.stateNode=e,c.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(c),e}function dl(e,i,s){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,m=reactDomExports;client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot;/** * @remix-run/router v1.6.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(e){for(var i=1;i"u")throw new Error(i)}function warning$2(e,i){if(!e){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(e,i){return{usr:e.state,key:e.key,idx:i}}function createLocation(e,i,s,o){return s===void 0&&(s=null),_extends$3({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof i=="string"?parsePath(i):i,{state:s,key:i&&i.key||o||createKey()})}function createPath(e){let{pathname:i="/",search:s="",hash:o=""}=e;return s&&s!=="?"&&(i+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(i+=o.charAt(0)==="#"?o:"#"+o),i}function parsePath(e){let i={};if(e){let s=e.indexOf("#");s>=0&&(i.hash=e.substr(s),e=e.substr(0,s));let o=e.indexOf("?");o>=0&&(i.search=e.substr(o),e=e.substr(0,o)),e&&(i.pathname=e)}return i}function getUrlBasedHistory(e,i,s,o){o===void 0&&(o={});let{window:a=document.defaultView,v5Compat:c=!1}=o,d=a.history,g=Action.Pop,_=null,b=_e();b==null&&(b=0,d.replaceState(_extends$3({},d.state,{idx:b}),""));function _e(){return(d.state||{idx:null}).idx}function rt(){g=Action.Pop;let ot=_e(),et=ot==null?null:ot-b;b=ot,_&&_({action:g,location:$.location,delta:et})}function st(ot,et){g=Action.Push;let it=createLocation($.location,ot,et);s&&s(it,ot),b=_e()+1;let nt=getHistoryState(it,b),at=$.createHref(it);try{d.pushState(nt,"",at)}catch{a.location.assign(at)}c&&_&&_({action:g,location:$.location,delta:1})}function lt(ot,et){g=Action.Replace;let it=createLocation($.location,ot,et);s&&s(it,ot),b=_e();let nt=getHistoryState(it,b),at=$.createHref(it);d.replaceState(nt,"",at),c&&_&&_({action:g,location:$.location,delta:0})}function tt(ot){let et=a.location.origin!=="null"?a.location.origin:a.location.href,it=typeof ot=="string"?ot:createPath(ot);return invariant$2(et,"No window.location.(origin|href) available to create URL for href: "+it),new URL(it,et)}let $={get action(){return g},get location(){return e(a,d)},listen(ot){if(_)throw new Error("A history only accepts one active listener");return a.addEventListener(PopStateEventType,rt),_=ot,()=>{a.removeEventListener(PopStateEventType,rt),_=null}},createHref(ot){return i(a,ot)},createURL:tt,encodeLocation(ot){let et=tt(ot);return{pathname:et.pathname,search:et.search,hash:et.hash}},push:st,replace:lt,go(ot){return d.go(ot)}};return $}var ResultType;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ResultType||(ResultType={}));function matchRoutes(e,i,s){s===void 0&&(s="/");let o=typeof i=="string"?parsePath(i):i,a=stripBasename(o.pathname||"/",s);if(a==null)return null;let c=flattenRoutes(e);rankRouteBranches(c);let d=null;for(let g=0;d==null&&g{let _={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};_.relativePath.startsWith("/")&&(invariant$2(_.relativePath.startsWith(o),'Absolute route path "'+_.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),_.relativePath=_.relativePath.slice(o.length));let b=joinPaths([o,_.relativePath]),_e=s.concat(_);c.children&&c.children.length>0&&(invariant$2(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+b+'".')),flattenRoutes(c.children,i,_e,b)),!(c.path==null&&!c.index)&&i.push({path:b,score:computeScore(b,c.index),routesMeta:_e})};return e.forEach((c,d)=>{var g;if(c.path===""||!((g=c.path)!=null&&g.includes("?")))a(c,d);else for(let _ of explodeOptionalSegments(c.path))a(c,d,_)}),i}function explodeOptionalSegments(e){let i=e.split("/");if(i.length===0)return[];let[s,...o]=i,a=s.endsWith("?"),c=s.replace(/\?$/,"");if(o.length===0)return a?[c,""]:[c];let d=explodeOptionalSegments(o.join("/")),g=[];return g.push(...d.map(_=>_===""?c:[c,_].join("/"))),a&&g.push(...d),g.map(_=>e.startsWith("/")&&_===""?"/":_)}function rankRouteBranches(e){e.sort((i,s)=>i.score!==s.score?s.score-i.score:compareIndexes(i.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}const paramRe=/^:\w+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=e=>e==="*";function computeScore(e,i){let s=e.split("/"),o=s.length;return s.some(isSplat)&&(o+=splatPenalty),i&&(o+=indexRouteValue),s.filter(a=>!isSplat(a)).reduce((a,c)=>a+(paramRe.test(c)?dynamicSegmentValue:c===""?emptySegmentValue:staticSegmentValue),o)}function compareIndexes(e,i){return e.length===i.length&&e.slice(0,-1).every((o,a)=>o===i[a])?e[e.length-1]-i[i.length-1]:0}function matchRouteBranch(e,i){let{routesMeta:s}=e,o={},a="/",c=[];for(let d=0;d{if(_e==="*"){let st=g[rt]||"";d=c.slice(0,c.length-st.length).replace(/(.)\/+$/,"$1")}return b[_e]=safelyDecodeURIComponent(g[rt]||"",_e),b},{}),pathname:c,pathnameBase:d,pattern:e}}function compilePath(e,i,s){i===void 0&&(i=!1),s===void 0&&(s=!0),warning$2(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let o=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(d,g)=>(o.push(g),"/([^\\/]+)"));return e.endsWith("*")?(o.push("*"),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,i?void 0:"i"),o]}function safelyDecodeURI(e){try{return decodeURI(e)}catch(i){return warning$2(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+i+").")),e}}function safelyDecodeURIComponent(e,i){try{return decodeURIComponent(e)}catch(s){return warning$2(!1,'The value for the URL param "'+i+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+s+").")),e}}function stripBasename(e,i){if(i==="/")return e;if(!e.toLowerCase().startsWith(i.toLowerCase()))return null;let s=i.endsWith("/")?i.length-1:i.length,o=e.charAt(s);return o&&o!=="/"?null:e.slice(s)||"/"}function resolvePath(e,i){i===void 0&&(i="/");let{pathname:s,search:o="",hash:a=""}=typeof e=="string"?parsePath(e):e;return{pathname:s?s.startsWith("/")?s:resolvePathname(s,i):i,search:normalizeSearch(o),hash:normalizeHash(a)}}function resolvePathname(e,i){let s=i.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?s.length>1&&s.pop():a!=="."&&s.push(a)}),s.length>1?s.join("/"):"/"}function getInvalidPathError(e,i,s,o){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+i+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(e){return e.filter((i,s)=>s===0||i.route.path&&i.route.path.length>0)}function resolveTo(e,i,s,o){o===void 0&&(o=!1);let a;typeof e=="string"?a=parsePath(e):(a=_extends$3({},e),invariant$2(!a.pathname||!a.pathname.includes("?"),getInvalidPathError("?","pathname","search",a)),invariant$2(!a.pathname||!a.pathname.includes("#"),getInvalidPathError("#","pathname","hash",a)),invariant$2(!a.search||!a.search.includes("#"),getInvalidPathError("#","search","hash",a)));let c=e===""||a.pathname==="",d=c?"/":a.pathname,g;if(o||d==null)g=s;else{let rt=i.length-1;if(d.startsWith("..")){let st=d.split("/");for(;st[0]==="..";)st.shift(),rt-=1;a.pathname=st.join("/")}g=rt>=0?i[rt]:"/"}let _=resolvePath(a,g),b=d&&d!=="/"&&d.endsWith("/"),_e=(c||d===".")&&s.endsWith("/");return!_.pathname.endsWith("/")&&(b||_e)&&(_.pathname+="/"),_}const joinPaths=e=>e.join("/").replace(/\/\/+/g,"/"),normalizePathname=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,normalizeHash=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function isRouteErrorResponse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/** * React Router v6.11.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var i=1;ig.pathnameBase)),c=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{c.current=!0}),reactExports.useCallback(function(g,_){if(_===void 0&&(_={}),!c.current)return;if(typeof g=="number"){i.go(g);return}let b=resolveTo(g,JSON.parse(a),o,_.relative==="path");e!=="/"&&(b.pathname=b.pathname==="/"?e:joinPaths([e,b.pathname])),(_.replace?i.replace:i.push)(b,_.state,_)},[e,i,a,o])}function useResolvedPath(e,i){let{relative:s}=i===void 0?{}:i,{matches:o}=reactExports.useContext(RouteContext),{pathname:a}=useLocation(),c=JSON.stringify(getPathContributingMatches(o).map(d=>d.pathnameBase));return reactExports.useMemo(()=>resolveTo(e,JSON.parse(c),a,s==="path"),[e,c,a,s])}function useRoutes(e,i){return useRoutesImpl(e,i)}function useRoutesImpl(e,i,s){useInRouterContext()||invariant$2(!1);let{navigator:o}=reactExports.useContext(NavigationContext),{matches:a}=reactExports.useContext(RouteContext),c=a[a.length-1],d=c?c.params:{};c&&c.pathname;let g=c?c.pathnameBase:"/";c&&c.route;let _=useLocation(),b;if(i){var _e;let $=typeof i=="string"?parsePath(i):i;g==="/"||(_e=$.pathname)!=null&&_e.startsWith(g)||invariant$2(!1),b=$}else b=_;let rt=b.pathname||"/",st=g==="/"?rt:rt.slice(g.length)||"/",lt=matchRoutes(e,{pathname:st}),tt=_renderMatches(lt&<.map($=>Object.assign({},$,{params:Object.assign({},d,$.params),pathname:joinPaths([g,o.encodeLocation?o.encodeLocation($.pathname).pathname:$.pathname]),pathnameBase:$.pathnameBase==="/"?g:joinPaths([g,o.encodeLocation?o.encodeLocation($.pathnameBase).pathname:$.pathnameBase])})),a,s);return i&&tt?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$2({pathname:"/",search:"",hash:"",state:null,key:"default"},b),navigationType:Action.Pop}},tt):tt}function DefaultErrorComponent(){let e=useRouteError(),i=isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),s=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},c=null;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},i),s?reactExports.createElement("pre",{style:a},s):null,c)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,s){return s.location!==i.location||s.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error||s.error,location:s.location,revalidation:i.revalidation||s.revalidation}}componentDidCatch(i,s){console.error("React Router caught the following error during render",i,s)}render(){return this.state.error?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(e){let{routeContext:i,match:s,children:o}=e,a=reactExports.useContext(DataRouterContext);return a&&a.static&&a.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=s.route.id),reactExports.createElement(RouteContext.Provider,{value:i},o)}function _renderMatches(e,i,s){var o;if(i===void 0&&(i=[]),s===void 0&&(s=null),e==null){var a;if((a=s)!=null&&a.errors)e=s.matches;else return null}let c=e,d=(o=s)==null?void 0:o.errors;if(d!=null){let g=c.findIndex(_=>_.route.id&&(d==null?void 0:d[_.route.id]));g>=0||invariant$2(!1),c=c.slice(0,Math.min(c.length,g+1))}return c.reduceRight((g,_,b)=>{let _e=_.route.id?d==null?void 0:d[_.route.id]:null,rt=null;s&&(rt=_.route.errorElement||defaultErrorElement);let st=i.concat(c.slice(0,b+1)),lt=()=>{let tt;return _e?tt=rt:_.route.Component?tt=reactExports.createElement(_.route.Component,null):_.route.element?tt=_.route.element:tt=g,reactExports.createElement(RenderedRoute,{match:_,routeContext:{outlet:g,matches:st,isDataRoute:s!=null},children:tt})};return s&&(_.route.ErrorBoundary||_.route.errorElement||b===0)?reactExports.createElement(RenderErrorBoundary,{location:s.location,revalidation:s.revalidation,component:rt,error:_e,children:lt(),routeContext:{outlet:null,matches:st,isDataRoute:!0}}):lt()},null)}var DataRouterHook$1;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(DataRouterHook$1||(DataRouterHook$1={}));var DataRouterStateHook$1;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(DataRouterStateHook$1||(DataRouterStateHook$1={}));function useDataRouterContext(e){let i=reactExports.useContext(DataRouterContext);return i||invariant$2(!1),i}function useDataRouterState(e){let i=reactExports.useContext(DataRouterStateContext);return i||invariant$2(!1),i}function useRouteContext(e){let i=reactExports.useContext(RouteContext);return i||invariant$2(!1),i}function useCurrentRouteId(e){let i=useRouteContext(),s=i.matches[i.matches.length-1];return s.route.id||invariant$2(!1),s.route.id}function useRouteError(){var e;let i=reactExports.useContext(RouteErrorContext),s=useDataRouterState(DataRouterStateHook$1.UseRouteError),o=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return i||((e=s.errors)==null?void 0:e[o])}function useNavigateStable(){let{router:e}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),i=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),s=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{s.current=!0}),reactExports.useCallback(function(a,c){c===void 0&&(c={}),s.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,_extends$2({fromRouteId:i},c)))},[e,i])}function Navigate(e){let{to:i,replace:s,state:o,relative:a}=e;useInRouterContext()||invariant$2(!1);let{matches:c}=reactExports.useContext(RouteContext),{pathname:d}=useLocation(),g=useNavigate(),_=resolveTo(i,getPathContributingMatches(c).map(_e=>_e.pathnameBase),d,a==="path"),b=JSON.stringify(_);return reactExports.useEffect(()=>g(JSON.parse(b),{replace:s,state:o,relative:a}),[g,b,a,s,o]),null}function Route(e){invariant$2(!1)}function Router(e){let{basename:i="/",children:s=null,location:o,navigationType:a=Action.Pop,navigator:c,static:d=!1}=e;useInRouterContext()&&invariant$2(!1);let g=i.replace(/^\/*/,"/"),_=reactExports.useMemo(()=>({basename:g,navigator:c,static:d}),[g,c,d]);typeof o=="string"&&(o=parsePath(o));let{pathname:b="/",search:_e="",hash:rt="",state:st=null,key:lt="default"}=o,tt=reactExports.useMemo(()=>{let $=stripBasename(b,g);return $==null?null:{location:{pathname:$,search:_e,hash:rt,state:st,key:lt},navigationType:a}},[g,b,_e,rt,st,lt,a]);return tt==null?null:reactExports.createElement(NavigationContext.Provider,{value:_},reactExports.createElement(LocationContext.Provider,{children:s,value:tt}))}function Routes(e){let{children:i,location:s}=e;return useRoutes(createRoutesFromChildren(i),s)}var AwaitRenderStatus;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(AwaitRenderStatus||(AwaitRenderStatus={}));new Promise(()=>{});function createRoutesFromChildren(e,i){i===void 0&&(i=[]);let s=[];return reactExports.Children.forEach(e,(o,a)=>{if(!reactExports.isValidElement(o))return;let c=[...i,a];if(o.type===reactExports.Fragment){s.push.apply(s,createRoutesFromChildren(o.props.children,c));return}o.type!==Route&&invariant$2(!1),!o.props.index||!o.props.children||invariant$2(!1);let d={id:o.props.id||c.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=createRoutesFromChildren(o.props.children,c)),s.push(d)}),s}/** * React Router DOM v6.11.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var i=1;i=0)&&(s[a]=e[a]);return s}function isModifiedEvent(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function shouldProcessLinkClick(e,i){return e.button===0&&(!i||i==="_self")&&!isModifiedEvent(e)}const _excluded$1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function BrowserRouter(e){let{basename:i,children:s,window:o}=e,a=reactExports.useRef();a.current==null&&(a.current=createBrowserHistory({window:o,v5Compat:!0}));let c=a.current,[d,g]=reactExports.useState({action:c.action,location:c.location});return reactExports.useLayoutEffect(()=>c.listen(g),[c]),reactExports.createElement(Router,{basename:i,children:s,location:d.location,navigationType:d.action,navigator:c})}const isBrowser$2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(i,s){let{onClick:o,relative:a,reloadDocument:c,replace:d,state:g,target:_,to:b,preventScrollReset:_e}=i,rt=_objectWithoutPropertiesLoose$1(i,_excluded$1),{basename:st}=reactExports.useContext(NavigationContext),lt,tt=!1;if(typeof b=="string"&&ABSOLUTE_URL_REGEX.test(b)&&(lt=b,isBrowser$2))try{let it=new URL(window.location.href),nt=b.startsWith("//")?new URL(it.protocol+b):new URL(b),at=stripBasename(nt.pathname,st);nt.origin===it.origin&&at!=null?b=at+nt.search+nt.hash:tt=!0}catch{}let $=useHref(b,{relative:a}),ot=useLinkClickHandler(b,{replace:d,state:g,target:_,preventScrollReset:_e,relative:a});function et(it){o&&o(it),it.defaultPrevented||ot(it)}return reactExports.createElement("a",_extends$1({},rt,{href:lt||$,onClick:tt||c?o:et,ref:s,target:_}))});var DataRouterHook;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(e,i){let{target:s,replace:o,state:a,preventScrollReset:c,relative:d}=i===void 0?{}:i,g=useNavigate(),_=useLocation(),b=useResolvedPath(e,{relative:d});return reactExports.useCallback(_e=>{if(shouldProcessLinkClick(_e,s)){_e.preventDefault();let rt=o!==void 0?o:createPath(_)===createPath(b);g(e,{replace:rt,state:a,preventScrollReset:c,relative:d})}},[_,g,b,o,a,s,e,c,d])}const MotionConfigContext=reactExports.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser$1=typeof document<"u",useIsomorphicLayoutEffect=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1});function useVisualElement(e,i,s,o){const{visualElement:a}=reactExports.useContext(MotionContext),c=reactExports.useContext(LazyContext),d=reactExports.useContext(PresenceContext),g=reactExports.useContext(MotionConfigContext).reducedMotion,_=reactExports.useRef();o=o||c.renderer,!_.current&&o&&(_.current=o(e,{visualState:i,parent:a,props:s,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:g}));const b=_.current;return reactExports.useInsertionEffect(()=>{b&&b.update(s,d)}),useIsomorphicLayoutEffect(()=>{b&&b.render()}),reactExports.useEffect(()=>{b&&b.updateFeatures()}),(window.HandoffAppearAnimations?useIsomorphicLayoutEffect:reactExports.useEffect)(()=>{b&&b.animationState&&b.animationState.animateChanges()}),b}function isRefObject(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function useMotionRef(e,i,s){return reactExports.useCallback(o=>{o&&e.mount&&e.mount(o),i&&(o?i.mount(o):i.unmount()),s&&(typeof s=="function"?s(o):isRefObject(s)&&(s.current=o))},[i])}function isVariantLabel(e){return typeof e=="string"||Array.isArray(e)}function isAnimationControls(e){return typeof e=="object"&&typeof e.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(e){return isAnimationControls(e.animate)||variantProps.some(i=>isVariantLabel(e[i]))}function isVariantNode(e){return!!(isControllingVariants(e)||e.variants)}function getCurrentTreeVariants(e,i){if(isControllingVariants(e)){const{initial:s,animate:o}=e;return{initial:s===!1||isVariantLabel(s)?s:void 0,animate:isVariantLabel(o)?o:void 0}}return e.inherit!==!1?i:{}}function useCreateMotionContext(e){const{initial:i,animate:s}=getCurrentTreeVariants(e,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:i,animate:s}),[variantLabelsAsDependency(i),variantLabelsAsDependency(s)])}function variantLabelsAsDependency(e){return Array.isArray(e)?e.join(" "):e}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const e in featureProps)featureDefinitions[e]={isEnabled:i=>featureProps[e].some(s=>!!i[s])};function loadFeatures(e){for(const i in e)featureDefinitions[i]={...featureDefinitions[i],...e[i]}}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:e,createVisualElement:i,useRender:s,useVisualState:o,Component:a}){e&&loadFeatures(e);function c(g,_){let b;const _e={...reactExports.useContext(MotionConfigContext),...g,layoutId:useLayoutId(g)},{isStatic:rt}=_e,st=useCreateMotionContext(g),lt=o(g,rt);if(!rt&&isBrowser$1){st.visualElement=useVisualElement(a,lt,_e,i);const tt=reactExports.useContext(SwitchLayoutGroupContext),$=reactExports.useContext(LazyContext).strict;st.visualElement&&(b=st.visualElement.loadFeatures(_e,$,e,tt))}return reactExports.createElement(MotionContext.Provider,{value:st},b&&st.visualElement?reactExports.createElement(b,{visualElement:st.visualElement,..._e}):null,s(a,g,useMotionRef(lt,st.visualElement,_),lt,rt,st.visualElement))}const d=reactExports.forwardRef(c);return d[motionComponentSymbol]=a,d}function useLayoutId({layoutId:e}){const i=reactExports.useContext(LayoutGroupContext).id;return i&&e!==void 0?i+"-"+e:e}function createMotionProxy(e){function i(o,a={}){return createMotionComponent(e(o,a))}if(typeof Proxy>"u")return i;const s=new Map;return new Proxy(i,{get:(o,a)=>(s.has(a)||s.set(a,i(a)),s.get(a))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(e){return typeof e!="string"||e.includes("-")?!1:!!(lowercaseSVGElements.indexOf(e)>-1||/[A-Z]/.test(e))}const scaleCorrectors={};function addScaleCorrector(e){Object.assign(scaleCorrectors,e)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(e,{layout:i,layoutId:s}){return transformProps.has(e)||e.startsWith("origin")||(i||s!==void 0)&&(!!scaleCorrectors[e]||e==="opacity")}const isMotionValue=e=>!!(e&&e.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(e,{enableHardwareAcceleration:i=!0,allowTransformNone:s=!0},o,a){let c="";for(let d=0;di=>typeof i=="string"&&i.startsWith(e),isCSSVariableName=checkStringStartsWith("--"),isCSSVariableToken=checkStringStartsWith("var(--"),cssVariableRegex=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,getValueAsType=(e,i)=>i&&typeof e=="number"?i.transform(e):e,clamp=(e,i,s)=>Math.min(Math.max(s,e),i),number={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},alpha={...number,transform:e=>clamp(0,1,e)},scale={...number,default:1},sanitize=e=>Math.round(e*1e5)/1e5,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$2(e){return typeof e=="string"}const createUnitType=e=>({test:i=>isString$2(i)&&i.endsWith(e)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${e}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:e=>percent.parse(e)/100,transform:e=>percent.transform(e*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(e,i,s,o){const{style:a,vars:c,transform:d,transformOrigin:g}=e;let _=!1,b=!1,_e=!0;for(const rt in i){const st=i[rt];if(isCSSVariableName(rt)){c[rt]=st;continue}const lt=numberValueTypes[rt],tt=getValueAsType(st,lt);if(transformProps.has(rt)){if(_=!0,d[rt]=tt,!_e)continue;st!==(lt.default||0)&&(_e=!1)}else rt.startsWith("origin")?(b=!0,g[rt]=tt):a[rt]=tt}if(i.transform||(_||o?a.transform=buildTransform(e.transform,s,_e,o):a.transform&&(a.transform="none")),b){const{originX:rt="50%",originY:st="50%",originZ:lt=0}=g;a.transformOrigin=`${rt} ${st} ${lt}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(e,i,s){for(const o in i)!isMotionValue(i[o])&&!isForcedMotionValue(o,s)&&(e[o]=i[o])}function useInitialMotionValues({transformTemplate:e},i,s){return reactExports.useMemo(()=>{const o=createHtmlRenderState();return buildHTMLStyles(o,i,{enableHardwareAcceleration:!s},e),Object.assign({},o.vars,o.style)},[i])}function useStyle(e,i,s){const o=e.style||{},a={};return copyRawValuesOnly(a,o,e),Object.assign(a,useInitialMotionValues(e,i,s)),e.transformValues?e.transformValues(a):a}function useHTMLProps(e,i,s){const o={},a=useStyle(e,i,s);return e.drag&&e.dragListener!==!1&&(o.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(o.tabIndex=0),o.style=a,o}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function isValidMotionProp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||validMotionProps.has(e)}let shouldForward=e=>!isValidMotionProp(e);function loadExternalIsValidProp(e){e&&(shouldForward=i=>i.startsWith("on")?!isValidMotionProp(i):e(i))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(e,i,s){const o={};for(const a in e)a==="values"&&typeof e.values=="object"||(shouldForward(a)||s===!0&&isValidMotionProp(a)||!i&&!isValidMotionProp(a)||e.draggable&&a.startsWith("onDrag"))&&(o[a]=e[a]);return o}function calcOrigin$1(e,i,s){return typeof e=="string"?e:px.transform(i+s*e)}function calcSVGTransformOrigin(e,i,s){const o=calcOrigin$1(i,e.x,e.width),a=calcOrigin$1(s,e.y,e.height);return`${o} ${a}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(e,i,s=1,o=0,a=!0){e.pathLength=1;const c=a?dashKeys:camelKeys;e[c.offset]=px.transform(-o);const d=px.transform(i),g=px.transform(s);e[c.array]=`${d} ${g}`}function buildSVGAttrs(e,{attrX:i,attrY:s,attrScale:o,originX:a,originY:c,pathLength:d,pathSpacing:g=1,pathOffset:_=0,...b},_e,rt,st){if(buildHTMLStyles(e,b,_e,st),rt){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:lt,style:tt,dimensions:$}=e;lt.transform&&($&&(tt.transform=lt.transform),delete lt.transform),$&&(a!==void 0||c!==void 0||tt.transform)&&(tt.transformOrigin=calcSVGTransformOrigin($,a!==void 0?a:.5,c!==void 0?c:.5)),i!==void 0&&(lt.x=i),s!==void 0&&(lt.y=s),o!==void 0&&(lt.scale=o),d!==void 0&&buildSVGPath(lt,d,g,_,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=e=>typeof e=="string"&&e.toLowerCase()==="svg";function useSVGProps(e,i,s,o){const a=reactExports.useMemo(()=>{const c=createSvgRenderState();return buildSVGAttrs(c,i,{enableHardwareAcceleration:!1},isSVGTag(o),e.transformTemplate),{...c.attrs,style:{...c.style}}},[i]);if(e.style){const c={};copyRawValuesOnly(c,e.style,e),a.style={...c,...a.style}}return a}function createUseRender(e=!1){return(s,o,a,{latestValues:c},d)=>{const _=(isSVGComponent(s)?useSVGProps:useHTMLProps)(o,c,d,s),_e={...filterProps(o,typeof s=="string",e),..._,ref:a},{children:rt}=o,st=reactExports.useMemo(()=>isMotionValue(rt)?rt.get():rt,[rt]);return reactExports.createElement(s,{..._e,children:st})}}const camelToDash=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function renderHTML(e,{style:i,vars:s},o,a){Object.assign(e.style,i,a&&a.getProjectionStyles(o));for(const c in s)e.style.setProperty(c,s[c])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(e,i,s,o){renderHTML(e,i,void 0,o);for(const a in i.attrs)e.setAttribute(camelCaseAttributes.has(a)?a:camelToDash(a),i.attrs[a])}function scrapeMotionValuesFromProps$1(e,i){const{style:s}=e,o={};for(const a in s)(isMotionValue(s[a])||i.style&&isMotionValue(i.style[a])||isForcedMotionValue(a,e))&&(o[a]=s[a]);return o}function scrapeMotionValuesFromProps(e,i){const s=scrapeMotionValuesFromProps$1(e,i);for(const o in e)if(isMotionValue(e[o])||isMotionValue(i[o])){const a=transformPropOrder.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;s[a]=e[o]}return s}function resolveVariantFromProps(e,i,s,o={},a={}){return typeof i=="function"&&(i=i(s!==void 0?s:e.custom,o,a)),typeof i=="string"&&(i=e.variants&&e.variants[i]),typeof i=="function"&&(i=i(s!==void 0?s:e.custom,o,a)),i}function useConstant(e){const i=reactExports.useRef(null);return i.current===null&&(i.current=e()),i.current}const isKeyframesTarget=e=>Array.isArray(e),isCustomValue=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),resolveFinalValueInKeyframes=e=>isKeyframesTarget(e)?e[e.length-1]||0:e;function resolveMotionValue(e){const i=isMotionValue(e)?e.get():e;return isCustomValue(i)?i.toValue():i}function makeState({scrapeMotionValuesFromProps:e,createRenderState:i,onMount:s},o,a,c){const d={latestValues:makeLatestValues(o,a,c,e),renderState:i()};return s&&(d.mount=g=>s(o,g,d)),d}const makeUseVisualState=e=>(i,s)=>{const o=reactExports.useContext(MotionContext),a=reactExports.useContext(PresenceContext),c=()=>makeState(e,i,o,a);return s?c():useConstant(c)};function makeLatestValues(e,i,s,o){const a={},c=o(e,{});for(const st in c)a[st]=resolveMotionValue(c[st]);let{initial:d,animate:g}=e;const _=isControllingVariants(e),b=isVariantNode(e);i&&b&&!_&&e.inherit!==!1&&(d===void 0&&(d=i.initial),g===void 0&&(g=i.animate));let _e=s?s.initial===!1:!1;_e=_e||d===!1;const rt=_e?g:d;return rt&&typeof rt!="boolean"&&!isAnimationControls(rt)&&(Array.isArray(rt)?rt:[rt]).forEach(lt=>{const tt=resolveVariantFromProps(e,lt);if(!tt)return;const{transitionEnd:$,transition:ot,...et}=tt;for(const it in et){let nt=et[it];if(Array.isArray(nt)){const at=_e?nt.length-1:0;nt=nt[at]}nt!==null&&(a[it]=nt)}for(const it in $)a[it]=$[it]}),a}const svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(e,i,{renderState:s,latestValues:o})=>{try{s.dimensions=typeof i.getBBox=="function"?i.getBBox():i.getBoundingClientRect()}catch{s.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(s,o,{enableHardwareAcceleration:!1},isSVGTag(i.tagName),e.transformTemplate),renderSVG(i,s)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(e,{forwardMotionProps:i=!1},s,o){return{...isSVGComponent(e)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:s,useRender:createUseRender(i),createVisualElement:o,Component:e}}function addDomEvent(e,i,s,o={passive:!0}){return e.addEventListener(i,s,o),()=>e.removeEventListener(i,s)}const isPrimaryPointer=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function extractEventInfo(e,i="page"){return{point:{x:e[i+"X"],y:e[i+"Y"]}}}const addPointerInfo=e=>i=>isPrimaryPointer(i)&&e(i,extractEventInfo(i));function addPointerEvent(e,i,s,o){return addDomEvent(e,i,addPointerInfo(s),o)}const combineFunctions=(e,i)=>s=>i(e(s)),pipe=(...e)=>e.reduce(combineFunctions);function createLock(e){let i=null;return()=>{const s=()=>{i=null};return i===null?(i=e,s):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(e){let i=!1;if(e==="y")i=globalVerticalLock();else if(e==="x")i=globalHorizontalLock();else{const s=globalHorizontalLock(),o=globalVerticalLock();s&&o?i=()=>{s(),o()}:(s&&s(),o&&o())}return i}function isDragActive(){const e=getGlobalLock(!0);return e?(e(),!1):!0}class Feature{constructor(i){this.isMounted=!1,this.node=i}update(){}}function createRenderStep(e){let i=[],s=[],o=0,a=!1,c=!1;const d=new WeakSet,g={schedule:(_,b=!1,_e=!1)=>{const rt=_e&&a,st=rt?i:s;return b&&d.add(_),st.indexOf(_)===-1&&(st.push(_),rt&&a&&(o=i.length)),_},cancel:_=>{const b=s.indexOf(_);b!==-1&&s.splice(b,1),d.delete(_)},process:_=>{if(a){c=!0;return}if(a=!0,[i,s]=[s,i],s.length=0,o=i.length,o)for(let b=0;b(e[i]=createRenderStep(()=>runNextFrame=!0),e),{}),processStep=e=>steps[e].process(frameData),processFrame=e=>{runNextFrame=!1,frameData.delta=useDefaultElapsed?1e3/60:Math.max(Math.min(e-frameData.timestamp,maxElapsed),1),frameData.timestamp=e,frameData.isProcessing=!0,stepsOrder.forEach(processStep),frameData.isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,requestAnimationFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,frameData.isProcessing||requestAnimationFrame(processFrame)},frame=stepsOrder.reduce((e,i)=>{const s=steps[i];return e[i]=(o,a=!1,c=!1)=>(runNextFrame||startLoop(),s.schedule(o,a,c)),e},{});function cancelFrame(e){stepsOrder.forEach(i=>steps[i].cancel(e))}function addHoverEvent(e,i){const s="pointer"+(i?"enter":"leave"),o="onHover"+(i?"Start":"End"),a=(c,d)=>{if(c.type==="touch"||isDragActive())return;const g=e.getProps();e.animationState&&g.whileHover&&e.animationState.setActive("whileHover",i),g[o]&&frame.update(()=>g[o](c,d))};return addPointerEvent(e.current,s,a,{passive:!e.getProps()[o]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(e,i)=>i?e===i?!0:isNodeOrChild(e,i.parentElement):!1,noop$1=e=>e;function fireSyntheticPointerEvent(e,i){if(!i)return;const s=new PointerEvent("pointer"+e);i(s,extractEventInfo(s))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(i,s)=>{if(this.removeEndListeners(),this.isPressing)return;const o=this.node.getProps(),c=addPointerEvent(window,"pointerup",(g,_)=>{if(!this.checkPressEnd())return;const{onTap:b,onTapCancel:_e}=this.node.getProps();frame.update(()=>{isNodeOrChild(this.node.current,g.target)?b&&b(g,_):_e&&_e(g,_)})},{passive:!(o.onTap||o.onPointerUp)}),d=addPointerEvent(window,"pointercancel",(g,_)=>this.cancelPress(g,_),{passive:!(o.onTapCancel||o.onPointerCancel)});this.removeEndListeners=pipe(c,d),this.startPress(i,s)},this.startAccessiblePress=()=>{const i=c=>{if(c.key!=="Enter"||this.isPressing)return;const d=g=>{g.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(_,b)=>{const{onTap:_e}=this.node.getProps();_e&&frame.update(()=>_e(_,b))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",d),fireSyntheticPointerEvent("down",(g,_)=>{this.startPress(g,_)})},s=addDomEvent(this.node.current,"keydown",i),o=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(c,d)=>this.cancelPress(c,d))},a=addDomEvent(this.node.current,"blur",o);this.removeAccessibleListeners=pipe(s,a)}}startPress(i,s){this.isPressing=!0;const{onTapStart:o,whileTap:a}=this.node.getProps();a&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),o&&frame.update(()=>o(i,s))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(i,s){if(!this.checkPressEnd())return;const{onTapCancel:o}=this.node.getProps();o&&frame.update(()=>o(i,s))}mount(){const i=this.node.getProps(),s=addPointerEvent(this.node.current,"pointerdown",this.startPointerPress,{passive:!(i.onTapStart||i.onPointerStart)}),o=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(s,o)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=e=>{const i=observerCallbacks.get(e.target);i&&i(e)},fireAllObserverCallbacks=e=>{e.forEach(fireObserverCallback)};function initIntersectionObserver({root:e,...i}){const s=e||document;observers.has(s)||observers.set(s,{});const o=observers.get(s),a=JSON.stringify(i);return o[a]||(o[a]=new IntersectionObserver(fireAllObserverCallbacks,{root:e,...i})),o[a]}function observeIntersection(e,i,s){const o=initIntersectionObserver(i);return observerCallbacks.set(e,s),o.observe(e),()=>{observerCallbacks.delete(e),o.unobserve(e)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:i={}}=this.node.getProps(),{root:s,margin:o,amount:a="some",once:c}=i,d={root:s?s.current:void 0,rootMargin:o,threshold:typeof a=="number"?a:thresholdNames[a]},g=_=>{const{isIntersecting:b}=_;if(this.isInView===b||(this.isInView=b,c&&!b&&this.hasEnteredView))return;b&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",b);const{onViewportEnter:_e,onViewportLeave:rt}=this.node.getProps(),st=b?_e:rt;st&&st(_)};return observeIntersection(this.node.current,d,g)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:s}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(i,s))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:e={}},{viewport:i={}}={}){return s=>e[s]!==i[s]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(e,i){if(!Array.isArray(i))return!1;const s=i.length;if(s!==e.length)return!1;for(let o=0;oi[o]=s.get()),i}function getVelocity$1(e){const i={};return e.values.forEach((s,o)=>i[o]=s.getVelocity()),i}function resolveVariant(e,i,s){const o=e.getProps();return resolveVariantFromProps(o,i,s!==void 0?s:o.custom,getCurrent(e),getVelocity$1(e))}const optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);let warning$1=noop$1,invariant$1=noop$1;const secondsToMilliseconds=e=>e*1e3,millisecondsToSeconds=e=>e/1e3,instantAnimationState={current:!1},isBezierDefinition=e=>Array.isArray(e)&&typeof e[0]=="number";function isWaapiSupportedEasing(e){return!!(!e||typeof e=="string"&&supportedWaapiEasing[e]||isBezierDefinition(e)||Array.isArray(e)&&e.every(isWaapiSupportedEasing))}const cubicBezierAsString=([e,i,s,o])=>`cubic-bezier(${e}, ${i}, ${s}, ${o})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(e){if(e)return isBezierDefinition(e)?cubicBezierAsString(e):Array.isArray(e)?e.map(mapEasingToNativeEasing):supportedWaapiEasing[e]}function animateStyle(e,i,s,{delay:o=0,duration:a,repeat:c=0,repeatType:d="loop",ease:g,times:_}={}){const b={[i]:s};_&&(b.offset=_);const _e=mapEasingToNativeEasing(g);return Array.isArray(_e)&&(b.easing=_e),e.animate(b,{delay:o,duration:a,easing:Array.isArray(_e)?"linear":_e,fill:"both",iterations:c+1,direction:d==="reverse"?"alternate":"normal"})}const featureTests={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},results={},supports={};for(const e in featureTests)supports[e]=()=>(results[e]===void 0&&(results[e]=featureTests[e]()),results[e]);function getFinalKeyframe(e,{repeat:i,repeatType:s="loop"}){const o=i&&s!=="loop"&&i%2===1?0:e.length-1;return e[o]}const calcBezier=(e,i,s)=>(((1-3*s+3*i)*e+(3*s-6*i))*e+3*i)*e,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(e,i,s,o,a){let c,d,g=0;do d=i+(s-i)/2,c=calcBezier(d,o,a)-e,c>0?s=d:i=d;while(Math.abs(c)>subdivisionPrecision&&++gbinarySubdivide(c,0,1,e,s);return c=>c===0||c===1?c:calcBezier(a(c),i,o)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=e=>Array.isArray(e)&&typeof e[0]!="number",mirrorEasing=e=>i=>i<=.5?e(2*i)/2:(2-e(2*(1-i)))/2,reverseEasing=e=>i=>1-e(1-i),circIn=e=>1-Math.sin(Math.acos(e)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=e=>(e*=2)<1?.5*backIn(e):.5*(2-Math.pow(2,-10*(e-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=e=>{if(Array.isArray(e)){invariant$1(e.length===4);const[i,s,o,a]=e;return cubicBezier(i,s,o,a)}else if(typeof e=="string")return easingLookup[e];return e},isColorString=(e,i)=>s=>!!(isString$2(s)&&singleColorRegex.test(s)&&s.startsWith(e)||i&&Object.prototype.hasOwnProperty.call(s,i)),splitColor=(e,i,s)=>o=>{if(!isString$2(o))return o;const[a,c,d,g]=o.match(floatRegex);return{[e]:parseFloat(a),[i]:parseFloat(c),[s]:parseFloat(d),alpha:g!==void 0?parseFloat(g):1}},clampRgbUnit=e=>clamp(0,255,e),rgbUnit={...number,transform:e=>Math.round(clampRgbUnit(e))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:e,green:i,blue:s,alpha:o=1})=>"rgba("+rgbUnit.transform(e)+", "+rgbUnit.transform(i)+", "+rgbUnit.transform(s)+", "+sanitize(alpha.transform(o))+")"};function parseHex(e){let i="",s="",o="",a="";return e.length>5?(i=e.substring(1,3),s=e.substring(3,5),o=e.substring(5,7),a=e.substring(7,9)):(i=e.substring(1,2),s=e.substring(2,3),o=e.substring(3,4),a=e.substring(4,5),i+=i,s+=s,o+=o,a+=a),{red:parseInt(i,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:a?parseInt(a,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:e,saturation:i,lightness:s,alpha:o=1})=>"hsla("+Math.round(e)+", "+percent.transform(sanitize(i))+", "+percent.transform(sanitize(s))+", "+sanitize(alpha.transform(o))+")"},color={test:e=>rgba.test(e)||hex.test(e)||hsla.test(e),parse:e=>rgba.test(e)?rgba.parse(e):hsla.test(e)?hsla.parse(e):hex.parse(e),transform:e=>isString$2(e)?e:e.hasOwnProperty("red")?rgba.transform(e):hsla.transform(e)},mix=(e,i,s)=>-s*e+s*i+e;function hueToRgb(e,i,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(i-e)*6*s:s<1/2?i:s<2/3?e+(i-e)*(2/3-s)*6:e}function hslaToRgba({hue:e,saturation:i,lightness:s,alpha:o}){e/=360,i/=100,s/=100;let a=0,c=0,d=0;if(!i)a=c=d=s;else{const g=s<.5?s*(1+i):s+i-s*i,_=2*s-g;a=hueToRgb(_,g,e+1/3),c=hueToRgb(_,g,e),d=hueToRgb(_,g,e-1/3)}return{red:Math.round(a*255),green:Math.round(c*255),blue:Math.round(d*255),alpha:o}}const mixLinearColor=(e,i,s)=>{const o=e*e;return Math.sqrt(Math.max(0,s*(i*i-o)+o))},colorTypes=[hex,rgba,hsla],getColorType=e=>colorTypes.find(i=>i.test(e));function asRGBA(e){const i=getColorType(e);let s=i.parse(e);return i===hsla&&(s=hslaToRgba(s)),s}const mixColor=(e,i)=>{const s=asRGBA(e),o=asRGBA(i),a={...s};return c=>(a.red=mixLinearColor(s.red,o.red,c),a.green=mixLinearColor(s.green,o.green,c),a.blue=mixLinearColor(s.blue,o.blue,c),a.alpha=mix(s.alpha,o.alpha,c),rgba.transform(a))};function test(e){var i,s;return isNaN(e)&&isString$2(e)&&(((i=e.match(floatRegex))===null||i===void 0?void 0:i.length)||0)+(((s=e.match(colorRegex))===null||s===void 0?void 0:s.length)||0)>0}const cssVarTokeniser={regex:cssVariableRegex,countKey:"Vars",token:"${v}",parse:noop$1},colorTokeniser={regex:colorRegex,countKey:"Colors",token:"${c}",parse:color.parse},numberTokeniser={regex:floatRegex,countKey:"Numbers",token:"${n}",parse:number.parse};function tokenise(e,{regex:i,countKey:s,token:o,parse:a}){const c=e.tokenised.match(i);c&&(e["num"+s]=c.length,e.tokenised=e.tokenised.replace(i,o),e.values.push(...c.map(a)))}function analyseComplexValue(e){const i=e.toString(),s={value:i,tokenised:i,values:[],numVars:0,numColors:0,numNumbers:0};return s.value.includes("var(--")&&tokenise(s,cssVarTokeniser),tokenise(s,colorTokeniser),tokenise(s,numberTokeniser),s}function parseComplexValue(e){return analyseComplexValue(e).values}function createTransformer(e){const{values:i,numColors:s,numVars:o,tokenised:a}=analyseComplexValue(e),c=i.length;return d=>{let g=a;for(let _=0;_typeof e=="number"?0:e;function getAnimatableNone$1(e){const i=parseComplexValue(e);return createTransformer(e)(i.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},mixImmediate=(e,i)=>s=>`${s>0?i:e}`;function getMixer(e,i){return typeof e=="number"?s=>mix(e,i,s):color.test(e)?mixColor(e,i):e.startsWith("var(")?mixImmediate(e,i):mixComplex(e,i)}const mixArray=(e,i)=>{const s=[...e],o=s.length,a=e.map((c,d)=>getMixer(c,i[d]));return c=>{for(let d=0;d{const s={...e,...i},o={};for(const a in s)e[a]!==void 0&&i[a]!==void 0&&(o[a]=getMixer(e[a],i[a]));return a=>{for(const c in o)s[c]=o[c](a);return s}},mixComplex=(e,i)=>{const s=complex.createTransformer(i),o=analyseComplexValue(e),a=analyseComplexValue(i);return o.numVars===a.numVars&&o.numColors===a.numColors&&o.numNumbers>=a.numNumbers?pipe(mixArray(o.values,a.values),s):mixImmediate(e,i)},progress=(e,i,s)=>{const o=i-e;return o===0?1:(s-e)/o},mixNumber=(e,i)=>s=>mix(e,i,s);function detectMixerFactory(e){return typeof e=="number"?mixNumber:typeof e=="string"?color.test(e)?mixColor:mixComplex:Array.isArray(e)?mixArray:typeof e=="object"?mixObject:mixNumber}function createMixers(e,i,s){const o=[],a=s||detectMixerFactory(e[0]),c=e.length-1;for(let d=0;di[0];e[0]>e[c-1]&&(e=[...e].reverse(),i=[...i].reverse());const d=createMixers(i,o,a),g=d.length,_=b=>{let _e=0;if(g>1)for(;_e_(clamp(e[0],e[c-1],b)):_}function fillOffset(e,i){const s=e[e.length-1];for(let o=1;o<=i;o++){const a=progress(0,i,o);e.push(mix(s,1,a))}}function defaultOffset(e){const i=[0];return fillOffset(i,e.length-1),i}function convertOffsetToTimes(e,i){return e.map(s=>s*i)}function defaultEasing(e,i){return e.map(()=>i||easeInOut).splice(0,e.length-1)}function keyframes({duration:e=300,keyframes:i,times:s,ease:o="easeInOut"}){const a=isEasingArray(o)?o.map(easingDefinitionToFunction):easingDefinitionToFunction(o),c={done:!1,value:i[0]},d=convertOffsetToTimes(s&&s.length===i.length?s:defaultOffset(i),e),g=interpolate(d,i,{ease:Array.isArray(a)?a:defaultEasing(i,a)});return{calculatedDuration:e,next:_=>(c.value=g(_),c.done=_>=e,c)}}function velocityPerSecond(e,i){return i?e*(1e3/i):0}const velocitySampleDuration=5;function calcGeneratorVelocity(e,i,s){const o=Math.max(i-velocitySampleDuration,0);return velocityPerSecond(s-e(o),i-o)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:e=800,bounce:i=.25,velocity:s=0,mass:o=1}){let a,c;warning$1(e<=secondsToMilliseconds(maxDuration$1));let d=1-i;d=clamp(minDamping,maxDamping,d),e=clamp(minDuration,maxDuration$1,millisecondsToSeconds(e)),d<1?(a=b=>{const _e=b*d,rt=_e*e,st=_e-s,lt=calcAngularFreq(b,d),tt=Math.exp(-rt);return safeMin-st/lt*tt},c=b=>{const rt=b*d*e,st=rt*s+s,lt=Math.pow(d,2)*Math.pow(b,2)*e,tt=Math.exp(-rt),$=calcAngularFreq(Math.pow(b,2),d);return(-a(b)+safeMin>0?-1:1)*((st-lt)*tt)/$}):(a=b=>{const _e=Math.exp(-b*e),rt=(b-s)*e+1;return-safeMin+_e*rt},c=b=>{const _e=Math.exp(-b*e),rt=(s-b)*(e*e);return _e*rt});const g=5/e,_=approximateRoot(a,c,g);if(e=secondsToMilliseconds(e),isNaN(_))return{stiffness:100,damping:10,duration:e};{const b=Math.pow(_,2)*o;return{stiffness:b,damping:d*2*Math.sqrt(o*b),duration:e}}}const rootIterations=12;function approximateRoot(e,i,s){let o=s;for(let a=1;ae[s]!==void 0)}function getSpringOptions(e){let i={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!isSpringType(e,physicsKeys)&&isSpringType(e,durationKeys)){const s=findSpring(e);i={...i,...s,velocity:0,mass:1},i.isResolvedFromDuration=!0}return i}function spring({keyframes:e,restDelta:i,restSpeed:s,...o}){const a=e[0],c=e[e.length-1],d={done:!1,value:a},{stiffness:g,damping:_,mass:b,velocity:_e,duration:rt,isResolvedFromDuration:st}=getSpringOptions(o),lt=_e?-millisecondsToSeconds(_e):0,tt=_/(2*Math.sqrt(g*b)),$=c-a,ot=millisecondsToSeconds(Math.sqrt(g/b)),et=Math.abs($)<5;s||(s=et?.01:2),i||(i=et?.005:.5);let it;if(tt<1){const nt=calcAngularFreq(ot,tt);it=at=>{const yt=Math.exp(-tt*ot*at);return c-yt*((lt+tt*ot*$)/nt*Math.sin(nt*at)+$*Math.cos(nt*at))}}else if(tt===1)it=nt=>c-Math.exp(-ot*nt)*($+(lt+ot*$)*nt);else{const nt=ot*Math.sqrt(tt*tt-1);it=at=>{const yt=Math.exp(-tt*ot*at),vt=Math.min(nt*at,300);return c-yt*((lt+tt*ot*$)*Math.sinh(vt)+nt*$*Math.cosh(vt))/nt}}return{calculatedDuration:st&&rt||null,next:nt=>{const at=it(nt);if(st)d.done=nt>=rt;else{let yt=lt;nt!==0&&(tt<1?yt=calcGeneratorVelocity(it,nt,at):yt=0);const vt=Math.abs(yt)<=s,xt=Math.abs(c-at)<=i;d.done=vt&&xt}return d.value=d.done?c:at,d}}}function inertia({keyframes:e,velocity:i=0,power:s=.8,timeConstant:o=325,bounceDamping:a=10,bounceStiffness:c=500,modifyTarget:d,min:g,max:_,restDelta:b=.5,restSpeed:_e}){const rt=e[0],st={done:!1,value:rt},lt=ct=>g!==void 0&&ct_,tt=ct=>g===void 0?_:_===void 0||Math.abs(g-ct)-$*Math.exp(-ct/o),nt=ct=>et+it(ct),at=ct=>{const pt=it(ct),ht=nt(ct);st.done=Math.abs(pt)<=b,st.value=st.done?et:ht};let yt,vt;const xt=ct=>{lt(st.value)&&(yt=ct,vt=spring({keyframes:[st.value,tt(st.value)],velocity:calcGeneratorVelocity(nt,ct,st.value),damping:a,stiffness:c,restDelta:b,restSpeed:_e}))};return xt(0),{calculatedDuration:null,next:ct=>{let pt=!1;return!vt&&yt===void 0&&(pt=!0,at(ct),xt(ct)),yt!==void 0&&ct>yt?vt.next(ct-yt):(!pt&&at(ct),st)}}}const frameloopDriver=e=>{const i=({timestamp:s})=>e(s);return{start:()=>frame.update(i,!0),stop:()=>cancelFrame(i),now:()=>frameData.isProcessing?frameData.timestamp:performance.now()}},maxGeneratorDuration=2e4;function calcGeneratorDuration(e){let i=0;const s=50;let o=e.next(i);for(;!o.done&&i=maxGeneratorDuration?1/0:i}const types={decay:inertia,inertia,tween:keyframes,keyframes,spring};function animateValue({autoplay:e=!0,delay:i=0,driver:s=frameloopDriver,keyframes:o,type:a="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:g="loop",onPlay:_,onStop:b,onComplete:_e,onUpdate:rt,...st}){let lt=1,tt=!1,$,ot;const et=()=>{$&&$(),ot=new Promise(Xt=>{$=Xt})};et();let it;const nt=types[a]||keyframes;let at;nt!==keyframes&&typeof o[0]!="number"&&(at=interpolate([0,100],o,{clamp:!1}),o=[0,100]);const yt=nt({...st,keyframes:o});let vt;g==="mirror"&&(vt=nt({...st,keyframes:[...o].reverse(),velocity:-(st.velocity||0)}));let xt="idle",ct=null,pt=null,ht=null;yt.calculatedDuration===null&&c&&(yt.calculatedDuration=calcGeneratorDuration(yt));const{calculatedDuration:Et}=yt;let Ct=1/0,Bt=1/0;Et!==null&&(Ct=Et+d,Bt=Ct*(c+1)-d);let Lt=0;const Yt=Xt=>{if(pt===null)return;lt>0&&(pt=Math.min(pt,Xt)),ct!==null?Lt=ct:Lt=(Xt-pt)*lt;const Tt=Lt-i,gt=Tt<0;Lt=Math.max(Tt,0),xt==="finished"&&ct===null&&(Lt=Bt);let mt=Lt,At=yt;if(c){const $t=Lt/Ct;let zt=Math.floor($t),dt=$t%1;!dt&&$t>=1&&(dt=1),dt===1&&zt--,zt=Math.min(zt,c+1);const _t=!!(zt%2);_t&&(g==="reverse"?(dt=1-dt,d&&(dt-=d/Ct)):g==="mirror"&&(At=vt));let St=clamp(0,1,dt);Lt>Bt&&(St=g==="reverse"&&_t?1:0),mt=St*Ct}const Rt=gt?{done:!1,value:o[0]}:At.next(mt);at&&(Rt.value=at(Rt.value));let{done:Dt}=Rt;!gt&&Et!==null&&(Dt=Lt>=Bt);const Ot=ct===null&&(xt==="finished"||xt==="running"&&Dt||lt<0&&Lt<=0);return rt&&rt(Rt.value),Ot&&Ft(),Rt},Wt=()=>{it&&it.stop(),it=void 0},jt=()=>{xt="idle",Wt(),et(),pt=ht=null},Ft=()=>{xt="finished",_e&&_e(),Wt(),et()},Ht=()=>{if(tt)return;it||(it=s(Yt));const Xt=it.now();_&&_(),ct!==null?pt=Xt-ct:(!pt||xt==="finished")&&(pt=Xt),ht=pt,ct=null,xt="running",it.start()};e&&Ht();const qt={then(Xt,Tt){return ot.then(Xt,Tt)},get time(){return millisecondsToSeconds(Lt)},set time(Xt){Xt=secondsToMilliseconds(Xt),Lt=Xt,ct!==null||!it||lt===0?ct=Xt:pt=it.now()-Xt/lt},get duration(){const Xt=yt.calculatedDuration===null?calcGeneratorDuration(yt):yt.calculatedDuration;return millisecondsToSeconds(Xt)},get speed(){return lt},set speed(Xt){Xt===lt||!it||(lt=Xt,qt.time=millisecondsToSeconds(Lt))},get state(){return xt},play:Ht,pause:()=>{xt="paused",ct=Lt},stop:()=>{tt=!0,xt!=="idle"&&(xt="idle",b&&b(),jt())},cancel:()=>{ht!==null&&Yt(ht),jt()},complete:()=>{xt="finished"},sample:Xt=>(pt=0,Yt(Xt))};return qt}const acceleratedValues=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),sampleDelta=10,maxDuration=2e4,requiresPregeneratedKeyframes=(e,i)=>i.type==="spring"||e==="backgroundColor"||!isWaapiSupportedEasing(i.ease);function createAcceleratedAnimation(e,i,{onUpdate:s,onComplete:o,...a}){if(!(supports.waapi()&&acceleratedValues.has(i)&&!a.repeatDelay&&a.repeatType!=="mirror"&&a.damping!==0&&a.type!=="inertia"))return!1;let d=!1,g,_;const b=()=>{_=new Promise(et=>{g=et})};b();let{keyframes:_e,duration:rt=300,ease:st,times:lt}=a;if(requiresPregeneratedKeyframes(i,a)){const et=animateValue({...a,repeat:0,delay:0});let it={done:!1,value:_e[0]};const nt=[];let at=0;for(;!it.done&&attt.cancel(),ot=()=>{frame.update($),g(),b()};return tt.onfinish=()=>{e.set(getFinalKeyframe(_e,a)),o&&o(),ot()},{then(et,it){return _.then(et,it)},get time(){return millisecondsToSeconds(tt.currentTime||0)},set time(et){tt.currentTime=secondsToMilliseconds(et)},get speed(){return tt.playbackRate},set speed(et){tt.playbackRate=et},get duration(){return millisecondsToSeconds(rt)},play:()=>{d||(tt.play(),cancelFrame($))},pause:()=>tt.pause(),stop:()=>{if(d=!0,tt.playState==="idle")return;const{currentTime:et}=tt;if(et){const it=animateValue({...a,autoplay:!1});e.setWithVelocity(it.sample(et-sampleDelta).value,it.sample(et).value,sampleDelta)}ot()},complete:()=>tt.finish(),cancel:ot}}function createInstantAnimation({keyframes:e,delay:i,onUpdate:s,onComplete:o}){const a=()=>(s&&s(e[e.length-1]),o&&o(),{time:0,speed:1,duration:0,play:noop$1,pause:noop$1,stop:noop$1,then:c=>(c(),Promise.resolve()),cancel:noop$1,complete:noop$1});return i?animateValue({keyframes:[0,1],duration:0,delay:i,onComplete:a}):a()}const underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(e,{keyframes:i})=>i.length>2?keyframesTransition:transformProps.has(e)?e.startsWith("scale")?criticallyDampedSpring(i[1]):underDampedSpring:ease,isAnimatable=(e,i)=>e==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(complex.test(i)||i==="0")&&!i.startsWith("url(")),maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(e){const[i,s]=e.slice(0,-1).split("(");if(i==="drop-shadow")return e;const[o]=s.match(floatRegex)||[];if(!o)return e;const a=s.replace(o,"");let c=maxDefaults.has(i)?1:0;return o!==s&&(c*=100),i+"("+c+a+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter={...complex,getAnimatableNone:e=>{const i=e.match(functionRegex);return i?i.map(applyDefaultFilter).join(" "):e}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=e=>defaultValueTypes[e];function getAnimatableNone(e,i){let s=getDefaultValueType(e);return s!==filter&&(s=complex),s.getAnimatableNone?s.getAnimatableNone(i):void 0}const isZeroValueString=e=>/^0[^.\s]+$/.test(e);function isNone(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||isZeroValueString(e)}function getKeyframes(e,i,s,o){const a=isAnimatable(i,s);let c;Array.isArray(s)?c=[...s]:c=[null,s];const d=o.from!==void 0?o.from:e.get();let g;const _=[];for(let b=0;ba=>{const c=getValueTransition(o,e)||{},d=c.delay||o.delay||0;let{elapsed:g=0}=o;g=g-secondsToMilliseconds(d);const _=getKeyframes(i,e,s,c),b=_[0],_e=_[_.length-1],rt=isAnimatable(e,b),st=isAnimatable(e,_e);let lt={keyframes:_,velocity:i.getVelocity(),ease:"easeOut",...c,delay:-g,onUpdate:tt=>{i.set(tt),c.onUpdate&&c.onUpdate(tt)},onComplete:()=>{a(),c.onComplete&&c.onComplete()}};if(isTransitionDefined(c)||(lt={...lt,...getDefaultTransition(e,lt)}),lt.duration&&(lt.duration=secondsToMilliseconds(lt.duration)),lt.repeatDelay&&(lt.repeatDelay=secondsToMilliseconds(lt.repeatDelay)),!rt||!st||instantAnimationState.current||c.type===!1)return createInstantAnimation(lt);if(i.owner&&i.owner.current instanceof HTMLElement&&!i.owner.getProps().onUpdate){const tt=createAcceleratedAnimation(i,e,lt);if(tt)return tt}return animateValue(lt)};function isWillChangeMotionValue(e){return!!(isMotionValue(e)&&e.add)}const isNumericalString=e=>/^\-?\d*\.?\d+$/.test(e);function addUniqueItem(e,i){e.indexOf(i)===-1&&e.push(i)}function removeItem(e,i){const s=e.indexOf(i);s>-1&&e.splice(s,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(i){return addUniqueItem(this.subscriptions,i),()=>removeItem(this.subscriptions,i)}notify(i,s,o){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](i,s,o);else for(let c=0;c!isNaN(parseFloat(e));class MotionValue{constructor(i,s={}){this.version="10.12.10",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(o,a=!0)=>{this.prev=this.current,this.current=o;const{delta:c,timestamp:d}=frameData;this.lastUpdated!==d&&(this.timeDelta=c,this.lastUpdated=d,frame.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),a&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>frame.postRender(this.velocityCheck),this.velocityCheck=({timestamp:o})=>{o!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=i,this.canTrackVelocity=isFloat(this.current),this.owner=s.owner}onChange(i){return this.on("change",i)}on(i,s){this.events[i]||(this.events[i]=new SubscriptionManager);const o=this.events[i].add(s);return i==="change"?()=>{o(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,s){this.passiveEffect=i,this.stopPassiveEffect=s}set(i,s=!0){!s||!this.passiveEffect?this.updateAndNotify(i,s):this.passiveEffect(i,this.updateAndNotify)}setWithVelocity(i,s,o){this.set(s),this.prev=i,this.timeDelta=o}jump(i){this.updateAndNotify(i),this.prev=i,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(i){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=i(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(e,i){return new MotionValue(e,i)}const testValueType=e=>i=>i.test(e),auto={test:e=>e==="auto",parse:e=>e},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=e=>dimensionValueTypes.find(testValueType(e)),valueTypes=[...dimensionValueTypes,color,complex],findValueType=e=>valueTypes.find(testValueType(e));function setMotionValue(e,i,s){e.hasValue(i)?e.getValue(i).set(s):e.addValue(i,motionValue(s))}function setTarget(e,i){const s=resolveVariant(e,i);let{transitionEnd:o={},transition:a={},...c}=s?e.makeTargetAnimatable(s,!1):{};c={...c,...o};for(const d in c){const g=resolveFinalValueInKeyframes(c[d]);setMotionValue(e,d,g)}}function checkTargetForNewValues(e,i,s){var o,a;const c=Object.keys(i).filter(g=>!e.hasValue(g)),d=c.length;if(d)for(let g=0;g_.remove(rt))),b.push($)}return d&&Promise.all(b).then(()=>{d&&setTarget(e,d)}),b}function animateVariant(e,i,s={}){const o=resolveVariant(e,i,s.custom);let{transition:a=e.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(a=s.transitionOverride);const c=o?()=>Promise.all(animateTarget(e,o,s)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(_=0)=>{const{delayChildren:b=0,staggerChildren:_e,staggerDirection:rt}=a;return animateChildren(e,i,b+_,_e,rt,s)}:()=>Promise.resolve(),{when:g}=a;if(g){const[_,b]=g==="beforeChildren"?[c,d]:[d,c];return _().then(()=>b())}else return Promise.all([c(),d(s.delay)])}function animateChildren(e,i,s=0,o=0,a=1,c){const d=[],g=(e.variantChildren.size-1)*o,_=a===1?(b=0)=>b*o:(b=0)=>g-b*o;return Array.from(e.variantChildren).sort(sortByTreeOrder).forEach((b,_e)=>{b.notify("AnimationStart",i),d.push(animateVariant(b,i,{...c,delay:s+_(_e)}).then(()=>b.notify("AnimationComplete",i)))}),Promise.all(d)}function sortByTreeOrder(e,i){return e.sortNodePosition(i)}function animateVisualElement(e,i,s={}){e.notify("AnimationStart",i);let o;if(Array.isArray(i)){const a=i.map(c=>animateVariant(e,c,s));o=Promise.all(a)}else if(typeof i=="string")o=animateVariant(e,i,s);else{const a=typeof i=="function"?resolveVariant(e,i,s.custom):i;o=Promise.all(animateTarget(e,a,s))}return o.then(()=>e.notify("AnimationComplete",i))}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(e){return i=>Promise.all(i.map(({animation:s,options:o})=>animateVisualElement(e,s,o)))}function createAnimationState(e){let i=animateList(e);const s=createState();let o=!0;const a=(_,b)=>{const _e=resolveVariant(e,b);if(_e){const{transition:rt,transitionEnd:st,...lt}=_e;_={..._,...lt,...st}}return _};function c(_){i=_(e)}function d(_,b){const _e=e.getProps(),rt=e.getVariantContext(!0)||{},st=[],lt=new Set;let tt={},$=1/0;for(let et=0;et$&&yt;const ht=Array.isArray(at)?at:[at];let Et=ht.reduce(a,{});vt===!1&&(Et={});const{prevResolvedValues:Ct={}}=nt,Bt={...Ct,...Et},Lt=Yt=>{pt=!0,lt.delete(Yt),nt.needsAnimating[Yt]=!0};for(const Yt in Bt){const Wt=Et[Yt],jt=Ct[Yt];tt.hasOwnProperty(Yt)||(Wt!==jt?isKeyframesTarget(Wt)&&isKeyframesTarget(jt)?!shallowCompare(Wt,jt)||ct?Lt(Yt):nt.protectedKeys[Yt]=!0:Wt!==void 0?Lt(Yt):lt.add(Yt):Wt!==void 0&<.has(Yt)?Lt(Yt):nt.protectedKeys[Yt]=!0)}nt.prevProp=at,nt.prevResolvedValues=Et,nt.isActive&&(tt={...tt,...Et}),o&&e.blockInitialAnimation&&(pt=!1),pt&&!xt&&st.push(...ht.map(Yt=>({animation:Yt,options:{type:it,..._}})))}if(lt.size){const et={};lt.forEach(it=>{const nt=e.getBaseTarget(it);nt!==void 0&&(et[it]=nt)}),st.push({animation:et})}let ot=!!st.length;return o&&_e.initial===!1&&!e.manuallyAnimateOnMount&&(ot=!1),o=!1,ot?i(st):Promise.resolve()}function g(_,b,_e){var rt;if(s[_].isActive===b)return Promise.resolve();(rt=e.variantChildren)===null||rt===void 0||rt.forEach(lt=>{var tt;return(tt=lt.animationState)===null||tt===void 0?void 0:tt.setActive(_,b)}),s[_].isActive=b;const st=d(_e,_);for(const lt in s)s[lt].protectedKeys={};return st}return{animateChanges:d,setActive:g,setAnimateFunction:c,getState:()=>s}}function checkVariantsDidChange(e,i){return typeof i=="string"?i!==e:Array.isArray(i)?!shallowCompare(i,e):!1}function createTypeState(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(i){super(i),i.animationState||(i.animationState=createAnimationState(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();this.unmount(),isAnimationControls(i)&&(this.unmount=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:s}=this.node.prevProps||{};i!==s&&this.updateAnimationControlsSubscription()}unmount(){}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:s,custom:o}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===a)return;const c=this.node.animationState.setActive("exit",!i,{custom:o??this.node.getProps().custom});s&&!i&&c.then(()=>s(this.id))}mount(){const{register:i}=this.node.presenceContext||{};i&&(this.unmount=i(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(e,i)=>Math.abs(e-i);function distance2D(e,i){const s=distance(e.x,i.x),o=distance(e.y,i.y);return Math.sqrt(s**2+o**2)}class PanSession{constructor(i,s,{transformPagePoint:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=getPanInfo(this.lastMoveEventInfo,this.history),_e=this.startEvent!==null,rt=distance2D(b.offset,{x:0,y:0})>=3;if(!_e&&!rt)return;const{point:st}=b,{timestamp:lt}=frameData;this.history.push({...st,timestamp:lt});const{onStart:tt,onMove:$}=this.handlers;_e||(tt&&tt(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),$&&$(this.lastMoveEvent,b)},this.handlePointerMove=(b,_e)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=transformPoint(_e,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(b,_e)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:rt,onSessionEnd:st}=this.handlers,lt=getPanInfo(b.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(_e,this.transformPagePoint),this.history);this.startEvent&&rt&&rt(b,lt),st&&st(b,lt)},!isPrimaryPointer(i))return;this.handlers=s,this.transformPagePoint=o;const a=extractEventInfo(i),c=transformPoint(a,this.transformPagePoint),{point:d}=c,{timestamp:g}=frameData;this.history=[{...d,timestamp:g}];const{onSessionStart:_}=s;_&&_(i,getPanInfo(c,this.history)),this.removeListeners=pipe(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(e,i){return i?{point:i(e.point)}:e}function subtractPoint(e,i){return{x:e.x-i.x,y:e.y-i.y}}function getPanInfo({point:e},i){return{point:e,delta:subtractPoint(e,lastDevicePoint(i)),offset:subtractPoint(e,startDevicePoint(i)),velocity:getVelocity(i,.1)}}function startDevicePoint(e){return e[0]}function lastDevicePoint(e){return e[e.length-1]}function getVelocity(e,i){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const a=lastDevicePoint(e);for(;s>=0&&(o=e[s],!(a.timestamp-o.timestamp>secondsToMilliseconds(i)));)s--;if(!o)return{x:0,y:0};const c=millisecondsToSeconds(a.timestamp-o.timestamp);if(c===0)return{x:0,y:0};const d={x:(a.x-o.x)/c,y:(a.y-o.y)/c};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function calcLength(e){return e.max-e.min}function isNear(e,i=0,s=.01){return Math.abs(e-i)<=s}function calcAxisDelta(e,i,s,o=.5){e.origin=o,e.originPoint=mix(i.min,i.max,e.origin),e.scale=calcLength(s)/calcLength(i),(isNear(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=mix(s.min,s.max,e.origin)-e.originPoint,(isNear(e.translate)||isNaN(e.translate))&&(e.translate=0)}function calcBoxDelta(e,i,s,o){calcAxisDelta(e.x,i.x,s.x,o?o.originX:void 0),calcAxisDelta(e.y,i.y,s.y,o?o.originY:void 0)}function calcRelativeAxis(e,i,s){e.min=s.min+i.min,e.max=e.min+calcLength(i)}function calcRelativeBox(e,i,s){calcRelativeAxis(e.x,i.x,s.x),calcRelativeAxis(e.y,i.y,s.y)}function calcRelativeAxisPosition(e,i,s){e.min=i.min-s.min,e.max=e.min+calcLength(i)}function calcRelativePosition(e,i,s){calcRelativeAxisPosition(e.x,i.x,s.x),calcRelativeAxisPosition(e.y,i.y,s.y)}function applyConstraints(e,{min:i,max:s},o){return i!==void 0&&es&&(e=o?mix(s,e,o.max):Math.min(e,s)),e}function calcRelativeAxisConstraints(e,i,s){return{min:i!==void 0?e.min+i:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function calcRelativeConstraints(e,{top:i,left:s,bottom:o,right:a}){return{x:calcRelativeAxisConstraints(e.x,s,a),y:calcRelativeAxisConstraints(e.y,i,o)}}function calcViewportAxisConstraints(e,i){let s=i.min-e.min,o=i.max-e.max;return i.max-i.mino?s=progress(i.min,i.max-o,e.min):o>a&&(s=progress(e.min,e.max-a,i.min)),clamp(0,1,s)}function rebaseAxisConstraints(e,i){const s={};return i.min!==void 0&&(s.min=i.min-e.min),i.max!==void 0&&(s.max=i.max-e.min),s}const defaultElastic=.35;function resolveDragElastic(e=defaultElastic){return e===!1?e=0:e===!0&&(e=defaultElastic),{x:resolveAxisElastic(e,"left","right"),y:resolveAxisElastic(e,"top","bottom")}}function resolveAxisElastic(e,i,s){return{min:resolvePointElastic(e,i),max:resolvePointElastic(e,s)}}function resolvePointElastic(e,i){return typeof e=="number"?e:e[i]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(e){return[e("x"),e("y")]}function convertBoundingBoxToBox({top:e,left:i,right:s,bottom:o}){return{x:{min:i,max:s},y:{min:e,max:o}}}function convertBoxToBoundingBox({x:e,y:i}){return{top:i.min,right:e.max,bottom:i.max,left:e.min}}function transformBoxPoints(e,i){if(!i)return e;const s=i({x:e.left,y:e.top}),o=i({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function isIdentityScale(e){return e===void 0||e===1}function hasScale({scale:e,scaleX:i,scaleY:s}){return!isIdentityScale(e)||!isIdentityScale(i)||!isIdentityScale(s)}function hasTransform(e){return hasScale(e)||has2DTranslate(e)||e.z||e.rotate||e.rotateX||e.rotateY}function has2DTranslate(e){return is2DTranslate(e.x)||is2DTranslate(e.y)}function is2DTranslate(e){return e&&e!=="0%"}function scalePoint(e,i,s){const o=e-s,a=i*o;return s+a}function applyPointDelta(e,i,s,o,a){return a!==void 0&&(e=scalePoint(e,a,o)),scalePoint(e,s,o)+i}function applyAxisDelta(e,i=0,s=1,o,a){e.min=applyPointDelta(e.min,i,s,o,a),e.max=applyPointDelta(e.max,i,s,o,a)}function applyBoxDelta(e,{x:i,y:s}){applyAxisDelta(e.x,i.translate,i.scale,i.originPoint),applyAxisDelta(e.y,s.translate,s.scale,s.originPoint)}function applyTreeDeltas(e,i,s,o=!1){const a=s.length;if(!a)return;i.x=i.y=1;let c,d;for(let g=0;g1.0000000000001||e<.999999999999?e:1}function translateAxis(e,i){e.min=e.min+i,e.max=e.max+i}function transformAxis(e,i,[s,o,a]){const c=i[a]!==void 0?i[a]:.5,d=mix(e.min,e.max,c);applyAxisDelta(e,i[s],i[o],d,i.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(e,i){transformAxis(e.x,i,xKeys$1),transformAxis(e.y,i,yKeys$1)}function measureViewportBox(e,i){return convertBoundingBoxToBox(transformBoxPoints(e.getBoundingClientRect(),i))}function measurePageBox(e,i,s){const o=measureViewportBox(e,s),{scroll:a}=i;return a&&(translateAxis(o.x,a.offset.x),translateAxis(o.y,a.offset.y)),o}const elementDragControls=new WeakMap;class VisualElementDragControls{constructor(i){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=i}start(i,{snapToCursor:s=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const a=_=>{this.stopAnimation(),s&&this.snapToCursor(extractEventInfo(_,"page").point)},c=(_,b)=>{const{drag:_e,dragPropagation:rt,onDragStart:st}=this.getProps();if(_e&&!rt&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(_e),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(tt=>{let $=this.getAxisMotionValue(tt).get()||0;if(percent.test($)){const{projection:ot}=this.visualElement;if(ot&&ot.layout){const et=ot.layout.layoutBox[tt];et&&($=calcLength(et)*(parseFloat($)/100))}}this.originPoint[tt]=$}),st&&frame.update(()=>st(_,b),!1,!0);const{animationState:lt}=this.visualElement;lt&<.setActive("whileDrag",!0)},d=(_,b)=>{const{dragPropagation:_e,dragDirectionLock:rt,onDirectionLock:st,onDrag:lt}=this.getProps();if(!_e&&!this.openGlobalLock)return;const{offset:tt}=b;if(rt&&this.currentDirection===null){this.currentDirection=getCurrentDirection(tt),this.currentDirection!==null&&st&&st(this.currentDirection);return}this.updateAxis("x",b.point,tt),this.updateAxis("y",b.point,tt),this.visualElement.render(),lt&<(_,b)},g=(_,b)=>this.stop(_,b);this.panSession=new PanSession(i,{onSessionStart:a,onStart:c,onMove:d,onSessionEnd:g},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(i,s){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&frame.update(()=>c(i,s))}cancel(){this.isDragging=!1;const{projection:i,animationState:s}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(i,s,o){const{drag:a}=this.getProps();if(!o||!shouldDrag(i,a,this.currentDirection))return;const c=this.getAxisMotionValue(i);let d=this.originPoint[i]+o[i];this.constraints&&this.constraints[i]&&(d=applyConstraints(d,this.constraints[i],this.elastic[i])),c.set(d)}resolveConstraints(){const{dragConstraints:i,dragElastic:s}=this.getProps(),{layout:o}=this.visualElement.projection||{},a=this.constraints;i&&isRefObject(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&o?this.constraints=calcRelativeConstraints(o.layoutBox,i):this.constraints=!1,this.elastic=resolveDragElastic(s),a!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(c=>{this.getAxisMotionValue(c)&&(this.constraints[c]=rebaseAxisConstraints(o.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:s}=this.getProps();if(!i||!isRefObject(i))return!1;const o=i.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const c=measurePageBox(o,a.root,this.visualElement.getTransformPagePoint());let d=calcViewportConstraints(a.layout.layoutBox,c);if(s){const g=s(convertBoxToBoundingBox(d));this.hasMutatedConstraints=!!g,g&&(d=convertBoundingBoxToBox(g))}return d}startAnimation(i){const{drag:s,dragMomentum:o,dragElastic:a,dragTransition:c,dragSnapToOrigin:d,onDragTransitionEnd:g}=this.getProps(),_=this.constraints||{},b=eachAxis(_e=>{if(!shouldDrag(_e,s,this.currentDirection))return;let rt=_&&_[_e]||{};d&&(rt={min:0,max:0});const st=a?200:1e6,lt=a?40:1e7,tt={type:"inertia",velocity:o?i[_e]:0,bounceStiffness:st,bounceDamping:lt,timeConstant:750,restDelta:1,restSpeed:10,...c,...rt};return this.startAxisValueAnimation(_e,tt)});return Promise.all(b).then(g)}startAxisValueAnimation(i,s){const o=this.getAxisMotionValue(i);return o.start(animateMotionValue(i,o,0,s))}stopAnimation(){eachAxis(i=>this.getAxisMotionValue(i).stop())}getAxisMotionValue(i){const s="_drag"+i.toUpperCase(),o=this.visualElement.getProps(),a=o[s];return a||this.visualElement.getValue(i,(o.initial?o.initial[i]:void 0)||0)}snapToCursor(i){eachAxis(s=>{const{drag:o}=this.getProps();if(!shouldDrag(s,o,this.currentDirection))return;const{projection:a}=this.visualElement,c=this.getAxisMotionValue(s);if(a&&a.layout){const{min:d,max:g}=a.layout.layoutBox[s];c.set(i[s]-mix(d,g,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!isRefObject(s)||!o||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};eachAxis(d=>{const g=this.getAxisMotionValue(d);if(g){const _=g.get();a[d]=calcOrigin({min:_,max:_},this.constraints[d])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),eachAxis(d=>{if(!shouldDrag(d,i,null))return;const g=this.getAxisMotionValue(d),{min:_,max:b}=this.constraints[d];g.set(mix(_,b,a[d]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const i=this.visualElement.current,s=addPointerEvent(i,"pointerdown",_=>{const{drag:b,dragListener:_e=!0}=this.getProps();b&&_e&&this.start(_)}),o=()=>{const{dragConstraints:_}=this.getProps();isRefObject(_)&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,c=a.addEventListener("measure",o);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),o();const d=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),g=a.addEventListener("didUpdate",({delta:_,hasLayoutChanged:b})=>{this.isDragging&&b&&(eachAxis(_e=>{const rt=this.getAxisMotionValue(_e);rt&&(this.originPoint[_e]+=_[_e].translate,rt.set(rt.get()+_[_e].translate))}),this.visualElement.render())});return()=>{d(),s(),c(),g&&g()}}getProps(){const i=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:a=!1,dragConstraints:c=!1,dragElastic:d=defaultElastic,dragMomentum:g=!0}=i;return{...i,drag:s,dragDirectionLock:o,dragPropagation:a,dragConstraints:c,dragElastic:d,dragMomentum:g}}}function shouldDrag(e,i,s){return(i===!0||i===e)&&(s===null||s===e)}function getCurrentDirection(e,i=10){let s=null;return Math.abs(e.y)>i?s="y":Math.abs(e.x)>i&&(s="x"),s}class DragGesture extends Feature{constructor(i){super(i),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=e=>(i,s)=>{e&&frame.update(()=>e(i,s))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(i){this.session=new PanSession(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:s,onPan:o,onPanEnd:a}=this.node.getProps();return{onSessionStart:asyncHandler(i),onStart:asyncHandler(s),onMove:o,onEnd:(c,d)=>{delete this.session,a&&frame.update(()=>a(c,d))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const e=reactExports.useContext(PresenceContext);if(e===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=e,a=reactExports.useId();return reactExports.useEffect(()=>o(a),[]),!i&&s?[!1,()=>s&&s(a)]:[!0]}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(e,i){return i.max===i.min?0:e/(i.max-i.min)*100}const correctBorderRadius={correct:(e,i)=>{if(!i.target)return e;if(typeof e=="string")if(px.test(e))e=parseFloat(e);else return e;const s=pixelsToPercent(e,i.target.x),o=pixelsToPercent(e,i.target.y);return`${s}% ${o}%`}},correctBoxShadow={correct:(e,{treeScale:i,projectionDelta:s})=>{const o=e,a=complex.parse(e);if(a.length>5)return o;const c=complex.createTransformer(e),d=typeof a[0]!="number"?1:0,g=s.x.scale*i.x,_=s.y.scale*i.y;a[0+d]/=g,a[1+d]/=_;const b=mix(g,_,.5);return typeof a[2+d]=="number"&&(a[2+d]/=b),typeof a[3+d]=="number"&&(a[3+d]/=b),c(a)}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:o,layoutId:a}=this.props,{projection:c}=i;addScaleCorrector(defaultScaleCorrectors),c&&(s.group&&s.group.add(c),o&&o.register&&a&&o.register(c),c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:s,visualElement:o,drag:a,isPresent:c}=this.props,d=o.projection;return d&&(d.isPresent=c,a||i.layoutDependency!==s||s===void 0?d.willUpdate():this.safeToRemove(),i.isPresent!==c&&(c?d.promote():d.relegate()||frame.postRender(()=>{const g=d.getStack();(!g||!g.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),queueMicrotask(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:a}=i;a&&(a.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(a),o&&o.deregister&&o.deregister(a))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function MeasureLayout(e){const[i,s]=usePresence(),o=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...e,layoutGroup:o,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:i,safeToRemove:s})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=e=>typeof e=="string"?parseFloat(e):e,isPx=e=>typeof e=="number"||px.test(e);function mixValues(e,i,s,o,a,c){a?(e.opacity=mix(0,s.opacity!==void 0?s.opacity:1,easeCrossfadeIn(o)),e.opacityExit=mix(i.opacity!==void 0?i.opacity:1,0,easeCrossfadeOut(o))):c&&(e.opacity=mix(i.opacity!==void 0?i.opacity:1,s.opacity!==void 0?s.opacity:1,o));for(let d=0;doi?1:s(progress(e,i,o))}function copyAxisInto(e,i){e.min=i.min,e.max=i.max}function copyBoxInto(e,i){copyAxisInto(e.x,i.x),copyAxisInto(e.y,i.y)}function removePointDelta(e,i,s,o,a){return e-=i,e=scalePoint(e,1/s,o),a!==void 0&&(e=scalePoint(e,1/a,o)),e}function removeAxisDelta(e,i=0,s=1,o=.5,a,c=e,d=e){if(percent.test(i)&&(i=parseFloat(i),i=mix(d.min,d.max,i/100)-d.min),typeof i!="number")return;let g=mix(c.min,c.max,o);e===c&&(g-=i),e.min=removePointDelta(e.min,i,s,g,a),e.max=removePointDelta(e.max,i,s,g,a)}function removeAxisTransforms(e,i,[s,o,a],c,d){removeAxisDelta(e,i[s],i[o],i[a],i.scale,c,d)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(e,i,s,o){removeAxisTransforms(e.x,i,xKeys,s?s.x:void 0,o?o.x:void 0),removeAxisTransforms(e.y,i,yKeys,s?s.y:void 0,o?o.y:void 0)}function isAxisDeltaZero(e){return e.translate===0&&e.scale===1}function isDeltaZero(e){return isAxisDeltaZero(e.x)&&isAxisDeltaZero(e.y)}function boxEquals(e,i){return e.x.min===i.x.min&&e.x.max===i.x.max&&e.y.min===i.y.min&&e.y.max===i.y.max}function aspectRatio(e){return calcLength(e.x)/calcLength(e.y)}class NodeStack{constructor(){this.members=[]}add(i){addUniqueItem(this.members,i),i.scheduleRender()}remove(i){if(removeItem(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(i){const s=this.members.findIndex(a=>i===a);if(s===0)return!1;let o;for(let a=s;a>=0;a--){const c=this.members[a];if(c.isPresent!==!1){o=c;break}}return o?(this.promote(o),!0):!1}promote(i,s){const o=this.lead;if(i!==o&&(this.prevLead=o,this.lead=i,i.show(),o)){o.instance&&o.scheduleRender(),i.scheduleRender(),i.resumeFrom=o,s&&(i.resumeFrom.preserveOpacity=!0),o.snapshot&&(i.snapshot=o.snapshot,i.snapshot.latestValues=o.animationValues||o.latestValues),i.root&&i.root.isUpdating&&(i.isLayoutDirty=!0);const{crossfade:a}=i.options;a===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(i=>{const{options:s,resumingFrom:o}=i;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(i=>{i.instance&&i.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(e,i,s){let o="";const a=e.x.translate/i.x,c=e.y.translate/i.y;if((a||c)&&(o=`translate3d(${a}px, ${c}px, 0) `),(i.x!==1||i.y!==1)&&(o+=`scale(${1/i.x}, ${1/i.y}) `),s){const{rotate:_,rotateX:b,rotateY:_e}=s;_&&(o+=`rotate(${_}deg) `),b&&(o+=`rotateX(${b}deg) `),_e&&(o+=`rotateY(${_e}deg) `)}const d=e.x.scale*i.x,g=e.y.scale*i.y;return(d!==1||g!==1)&&(o+=`scale(${d}, ${g})`),o||"none"}const compareByDepth=(e,i)=>e.depth-i.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(i){addUniqueItem(this.children,i),this.isDirty=!0}remove(i){removeItem(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(i)}}function delay(e,i){const s=performance.now(),o=({timestamp:a})=>{const c=a-s;c>=i&&(cancelFrame(o),e(c-i))};return frame.read(o,!0),()=>cancelFrame(o)}function record(e){window.MotionDebug&&window.MotionDebug.record(e)}function isSVGElement(e){return e instanceof SVGElement&&e.tagName!=="svg"}function animateSingleValue(e,i,s){const o=isMotionValue(e)?e:motionValue(e);return o.start(animateMotionValue("",o,i,s)),o.animation}const transformAxes=["","X","Y","Z"],animationTarget=1e3;let id=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function createProjectionNode({attachResizeListener:e,defaultParent:i,measureScroll:s,checkIsScrollRoot:o,resetTransform:a}){return class{constructor(d={},g=i==null?void 0:i()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=g?g.root||g:this,this.path=g?[...g.path,g]:[],this.parent=g,this.depth=g?g.depth+1:0;for(let _=0;_this.root.updateBlockedByResize=!1;e(d,()=>{this.root.updateBlockedByResize=!0,rt&&rt(),rt=delay(st,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}_&&this.root.registerSharedNode(_,this),this.options.animate!==!1&&_e&&(_||b)&&this.addEventListener("didUpdate",({delta:rt,hasLayoutChanged:st,hasRelativeTargetChanged:lt,layout:tt})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const $=this.options.transition||_e.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:ot,onLayoutAnimationComplete:et}=_e.getProps(),it=!this.targetLayout||!boxEquals(this.targetLayout,tt)||lt,nt=!st&<if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||nt||st&&(it||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(rt,nt);const at={...getValueTransition($,"layout"),onPlay:ot,onComplete:et};(_e.shouldReduceMotion||this.options.layoutRoot)&&(at.delay=0,at.type=!1),this.startAnimation(at)}else st||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=tt})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetRotation),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let _e=0;_ethis.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){frame.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let _=0;_{const yt=at/1e3;mixAxisDelta(rt.x,d.x,yt),mixAxisDelta(rt.y,d.y,yt),this.setTargetDelta(rt),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(st,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,st,yt),nt&&boxEquals(this.relativeTarget,nt)&&(this.isProjectionDirty=!1),nt||(nt=createBox()),copyBoxInto(nt,this.relativeTarget)),$&&(this.animationValues=_e,mixValues(_e,b,this.latestValues,yt,it,et)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=yt},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...d,onUpdate:g=>{this.mixTargetDelta(g),d.onUpdate&&d.onUpdate(g)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:g,target:_,layout:b,latestValues:_e}=d;if(!(!g||!_||!b)){if(this!==d&&this.layout&&b&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,b.layoutBox)){_=this.target||createBox();const rt=calcLength(this.layout.layoutBox.x);_.x.min=d.target.x.min,_.x.max=_.x.min+rt;const st=calcLength(this.layout.layoutBox.y);_.y.min=d.target.y.min,_.y.max=_.y.min+st}copyBoxInto(g,_),transformBox(g,_e),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,g,_e)}}registerSharedNode(d,g){this.sharedNodes.has(d)||this.sharedNodes.set(d,new NodeStack),this.sharedNodes.get(d).add(g);const b=g.options.initialPromotionConfig;g.promote({transition:b?b.transition:void 0,preserveFollowOpacity:b&&b.shouldPreserveFollowOpacity?b.shouldPreserveFollowOpacity(g):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:g}=this.options;return g?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:g}=this.options;return g?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:g,preserveFollowOpacity:_}={}){const b=this.getStack();b&&b.promote(this,_),d&&(this.projectionDelta=void 0,this.needsReset=!0),g&&this.setOptions({transition:g})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetRotation(){const{visualElement:d}=this.options;if(!d)return;let g=!1;const{latestValues:_}=d;if((_.rotate||_.rotateX||_.rotateY||_.rotateZ)&&(g=!0),!g)return;const b={};for(let _e=0;_e{var g;return(g=d.currentAnimation)===null||g===void 0?void 0:g.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(e){e.updateLayout()}function notifyLayoutUpdate(e){var i;const s=((i=e.resumeFrom)===null||i===void 0?void 0:i.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&s&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:c}=e.options,d=s.source!==e.layout.source;c==="size"?eachAxis(rt=>{const st=d?s.measuredBox[rt]:s.layoutBox[rt],lt=calcLength(st);st.min=o[rt].min,st.max=st.min+lt}):shouldAnimatePositionOnly(c,s.layoutBox,o)&&eachAxis(rt=>{const st=d?s.measuredBox[rt]:s.layoutBox[rt],lt=calcLength(o[rt]);st.max=st.min+lt,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[rt].max=e.relativeTarget[rt].min+lt)});const g=createDelta();calcBoxDelta(g,o,s.layoutBox);const _=createDelta();d?calcBoxDelta(_,e.applyTransform(a,!0),s.measuredBox):calcBoxDelta(_,o,s.layoutBox);const b=!isDeltaZero(g);let _e=!1;if(!e.resumeFrom){const rt=e.getClosestProjectingParent();if(rt&&!rt.resumeFrom){const{snapshot:st,layout:lt}=rt;if(st&<){const tt=createBox();calcRelativePosition(tt,s.layoutBox,st.layoutBox);const $=createBox();calcRelativePosition($,o,lt.layoutBox),boxEquals(tt,$)||(_e=!0),rt.options.layoutRoot&&(e.relativeTarget=$,e.relativeTargetOrigin=tt,e.relativeParent=rt)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:s,delta:_,layoutDelta:g,hasLayoutChanged:b,hasRelativeTargetChanged:_e})}else if(e.isLead()){const{onExitComplete:o}=e.options;o&&o()}e.options.transition=void 0}function propagateDirtyNodes(e){projectionFrameData.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function cleanDirtyNodes(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function clearSnapshot(e){e.clearSnapshot()}function clearMeasurements(e){e.clearMeasurements()}function resetTransformStyle(e){const{visualElement:i}=e.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),e.resetTransform()}function finishAnimation(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function resolveTargetDelta(e){e.resolveTargetDelta()}function calcProjection(e){e.calcProjection()}function resetRotation(e){e.resetRotation()}function removeLeadSnapshots(e){e.removeLeadSnapshot()}function mixAxisDelta(e,i,s){e.translate=mix(i.translate,0,s),e.scale=mix(i.scale,1,s),e.origin=i.origin,e.originPoint=i.originPoint}function mixAxis(e,i,s,o){e.min=mix(i.min,s.min,o),e.max=mix(i.max,s.max,o)}function mixBox(e,i,s,o){mixAxis(e.x,i.x,s.x,o),mixAxis(e.y,i.y,s.y,o)}function hasOpacityCrossfade(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]};function roundAxis(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function roundBox(e){roundAxis(e.x),roundAxis(e.y)}function shouldAnimatePositionOnly(e,i,s){return e==="position"||e==="preserve-aspect"&&!isNear(aspectRatio(i),aspectRatio(s),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(e,i)=>addDomEvent(e,"resize",i),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const e=new DocumentProjectionNode({});e.mount(window),e.setOptions({layoutScroll:!0}),rootProjectionNode.current=e}return rootProjectionNode.current},resetTransform:(e,i)=>{e.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},splitCSSVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function parseCSSVariable(e){const i=splitCSSVariableRegex.exec(e);if(!i)return[,];const[,s,o]=i;return[s,o]}function getVariableValue(e,i,s=1){const[o,a]=parseCSSVariable(e);if(!o)return;const c=window.getComputedStyle(i).getPropertyValue(o);return c?c.trim():isCSSVariableToken(a)?getVariableValue(a,i,s+1):a}function resolveCSSVariables(e,{...i},s){const o=e.current;if(!(o instanceof Element))return{target:i,transitionEnd:s};s&&(s={...s}),e.values.forEach(a=>{const c=a.get();if(!isCSSVariableToken(c))return;const d=getVariableValue(c,o);d&&a.set(d)});for(const a in i){const c=i[a];if(!isCSSVariableToken(c))continue;const d=getVariableValue(c,o);d&&(i[a]=d,s||(s={}),s[a]===void 0&&(s[a]=c))}return{target:i,transitionEnd:s}}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y"]),isPositionalKey=e=>positionalKeys.has(e),hasPositionalKey=e=>Object.keys(e).some(isPositionalKey),isNumOrPxType=e=>e===number||e===px,getPosFromMatrix=(e,i)=>parseFloat(e.split(", ")[i]),getTranslateFromMatrix=(e,i)=>(s,{transform:o})=>{if(o==="none"||!o)return 0;const a=o.match(/^matrix3d\((.+)\)$/);if(a)return getPosFromMatrix(a[1],i);{const c=o.match(/^matrix\((.+)\)$/);return c?getPosFromMatrix(c[1],e):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(e=>!transformKeys.has(e));function removeNonTranslationalTransform(e){const i=[];return nonTranslationalTransformKeys.forEach(s=>{const o=e.getValue(s);o!==void 0&&(i.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),i.length&&e.render(),i}const positionalValues={width:({x:e},{paddingLeft:i="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(i)-parseFloat(s),height:({y:e},{paddingTop:i="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(i)-parseFloat(s),top:(e,{top:i})=>parseFloat(i),left:(e,{left:i})=>parseFloat(i),bottom:({y:e},{top:i})=>parseFloat(i)+(e.max-e.min),right:({x:e},{left:i})=>parseFloat(i)+(e.max-e.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)},convertChangedValueTypes=(e,i,s)=>{const o=i.measureViewportBox(),a=i.current,c=getComputedStyle(a),{display:d}=c,g={};d==="none"&&i.setStaticValue("display",e.display||"block"),s.forEach(b=>{g[b]=positionalValues[b](o,c)}),i.render();const _=i.measureViewportBox();return s.forEach(b=>{const _e=i.getValue(b);_e&&_e.jump(g[b]),e[b]=positionalValues[b](_,c)}),e},checkAndConvertChangedValueTypes=(e,i,s={},o={})=>{i={...i},o={...o};const a=Object.keys(i).filter(isPositionalKey);let c=[],d=!1;const g=[];if(a.forEach(_=>{const b=e.getValue(_);if(!e.hasValue(_))return;let _e=s[_],rt=findDimensionValueType(_e);const st=i[_];let lt;if(isKeyframesTarget(st)){const tt=st.length,$=st[0]===null?1:0;_e=st[$],rt=findDimensionValueType(_e);for(let ot=$;ot=0?window.pageYOffset:null,b=convertChangedValueTypes(i,e,g);return c.length&&c.forEach(([_e,rt])=>{e.getValue(_e).set(rt)}),e.render(),isBrowser$1&&_!==null&&window.scrollTo({top:_}),{target:b,transitionEnd:o}}else return{target:i,transitionEnd:o}};function unitConversion(e,i,s,o){return hasPositionalKey(i)?checkAndConvertChangedValueTypes(e,i,s,o):{target:i,transitionEnd:o}}const parseDomVariant=(e,i,s,o)=>{const a=resolveCSSVariables(e,i,o);return i=a.target,o=a.transitionEnd,unitConversion(e,i,s,o)},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser$1)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),i=()=>prefersReducedMotion.current=e.matches;e.addListener(i),i()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(e,i,s){const{willChange:o}=i;for(const a in i){const c=i[a],d=s[a];if(isMotionValue(c))e.addValue(a,c),isWillChangeMotionValue(o)&&o.add(a);else if(isMotionValue(d))e.addValue(a,motionValue(c,{owner:e})),isWillChangeMotionValue(o)&&o.remove(a);else if(d!==c)if(e.hasValue(a)){const g=e.getValue(a);!g.hasAnimated&&g.set(c)}else{const g=e.getStaticValue(a);e.addValue(a,motionValue(g!==void 0?g:c,{owner:e}))}}for(const a in s)i[a]===void 0&&e.removeValue(a);return i}const visualElementStore=new WeakMap,featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;class VisualElement{constructor({parent:i,props:s,presenceContext:o,reducedMotionConfig:a,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:g,renderState:_}=c;this.latestValues=g,this.baseTarget={...g},this.initialValues=s.initial?{...g}:{},this.renderState=_,this.parent=i,this.props=s,this.presenceContext=o,this.depth=i?i.depth+1:0,this.reducedMotionConfig=a,this.options=d,this.isControllingVariants=isControllingVariants(s),this.isVariantNode=isVariantNode(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:b,..._e}=this.scrapeMotionValuesFromProps(s,{});for(const rt in _e){const st=_e[rt];g[rt]!==void 0&&isMotionValue(st)&&(st.set(g[rt],!1),isWillChangeMotionValue(b)&&b.add(rt))}}scrapeMotionValuesFromProps(i,s){return{}}mount(i){this.current=i,visualElementStore.set(i,this),this.projection&&!this.projection.instance&&this.projection.mount(i),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(i=>i()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const i in this.events)this.events[i].clear();for(const i in this.features)this.features[i].unmount();this.current=null}bindToMotionValue(i,s){const o=transformProps.has(i),a=s.on("change",d=>{this.latestValues[i]=d,this.props.onUpdate&&frame.update(this.notifyUpdate,!1,!0),o&&this.projection&&(this.projection.isTransformDirty=!0)}),c=s.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(i,()=>{a(),c()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}loadFeatures({children:i,...s},o,a,c){let d,g;for(let _=0;_this.scheduleRender(),animationType:typeof b=="string"?b:"both",initialPromotionConfig:c,layoutScroll:st,layoutRoot:lt})}return g}updateFeatures(){for(const i in this.features){const s=this.features[i];s.isMounted?s.update(this.props,this.prevProps):(s.mount(),s.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,s){this.latestValues[i]=s}makeTargetAnimatable(i,s=!0){return this.makeTargetAnimatableFromInstance(i,this.props,s)}update(i,s){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;os.variantChildren.delete(i)}addValue(i,s){s!==this.values.get(i)&&(this.removeValue(i),this.bindToMotionValue(i,s)),this.values.set(i,s),this.latestValues[i]=s.get()}removeValue(i){this.values.delete(i);const s=this.valueSubscriptions.get(i);s&&(s(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,s){if(this.props.values&&this.props.values[i])return this.props.values[i];let o=this.values.get(i);return o===void 0&&s!==void 0&&(o=motionValue(s,{owner:this}),this.addValue(i,o)),o}readValue(i){return this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:this.readValueFromInstance(this.current,i,this.options)}setBaseTarget(i,s){this.baseTarget[i]=s}getBaseTarget(i){var s;const{initial:o}=this.props,a=typeof o=="string"||typeof o=="object"?(s=resolveVariantFromProps(this.props,o))===null||s===void 0?void 0:s[i]:void 0;if(o&&a!==void 0)return a;const c=this.getBaseTargetFromProps(this.props,i);return c!==void 0&&!isMotionValue(c)?c:this.initialValues[i]!==void 0&&a===void 0?void 0:this.baseTarget[i]}on(i,s){return this.events[i]||(this.events[i]=new SubscriptionManager),this.events[i].add(s)}notify(i,...s){this.events[i]&&this.events[i].notify(...s)}}class DOMVisualElement extends VisualElement{sortInstanceNodePosition(i,s){return i.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(i,s){return i.style?i.style[s]:void 0}removeValueFromRenderState(i,{vars:s,style:o}){delete s[i],delete o[i]}makeTargetAnimatableFromInstance({transition:i,transitionEnd:s,...o},{transformValues:a},c){let d=getOrigin(o,i||{},this);if(a&&(s&&(s=a(s)),o&&(o=a(o)),d&&(d=a(d))),c){checkTargetForNewValues(this,o,d);const g=parseDomVariant(this,o,d,s);s=g.transitionEnd,o=g.target}return{transition:i,transitionEnd:s,...o}}}function getComputedStyle$1(e){return window.getComputedStyle(e)}class HTMLVisualElement extends DOMVisualElement{readValueFromInstance(i,s){if(transformProps.has(s)){const o=getDefaultValueType(s);return o&&o.default||0}else{const o=getComputedStyle$1(i),a=(isCSSVariableName(s)?o.getPropertyValue(s):o[s])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(i,{transformPagePoint:s}){return measureViewportBox(i,s)}build(i,s,o,a){buildHTMLStyles(i,s,o,a.transformTemplate)}scrapeMotionValuesFromProps(i,s){return scrapeMotionValuesFromProps$1(i,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;isMotionValue(i)&&(this.childSubscription=i.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}renderInstance(i,s,o,a){renderHTML(i,s,o,a)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(i,s){return i[s]}readValueFromInstance(i,s){if(transformProps.has(s)){const o=getDefaultValueType(s);return o&&o.default||0}return s=camelCaseAttributes.has(s)?s:camelToDash(s),i.getAttribute(s)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(i,s){return scrapeMotionValuesFromProps(i,s)}build(i,s,o,a){buildSVGAttrs(i,s,o,this.isSVGTag,a.transformTemplate)}renderInstance(i,s,o,a){renderSVG(i,s,o,a)}mount(i){this.isSVGTag=isSVGTag(i.tagName),super.mount(i)}}const createDomVisualElement=(e,i)=>isSVGComponent(e)?new SVGVisualElement(i,{enableHardwareAcceleration:!1}):new HTMLVisualElement(i,{enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((e,i)=>createDomMotionConfig(e,i,preloadedFeatures,createDomVisualElement));function bind(e,i){return function(){return e.apply(i,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,kindOf=(e=>i=>{const s=toString.call(i);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),i=>kindOf(i)===e),typeOfTest=e=>i=>typeof i===e,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer$1=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let i;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?i=ArrayBuffer.isView(e):i=e&&e.buffer&&isArrayBuffer$1(e.buffer),i}const isString$1=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const i=getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},isDate=kindOfTest("Date"),isFile$2=kindOfTest("File"),isBlob$1=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let i;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction(e.append)&&((i=kindOf(e))==="formdata"||i==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,i,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let o,a;if(typeof e!="object"&&(e=[e]),isArray(e))for(o=0,a=e.length;o0;)if(a=s[o],i===a.toLowerCase())return a;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},i={},s=(o,a)=>{const c=e&&findKey(i,a)||a;isPlainObject(i[c])&&isPlainObject(o)?i[c]=merge(i[c],o):isPlainObject(o)?i[c]=merge({},o):isArray(o)?i[c]=o.slice():i[c]=o};for(let o=0,a=arguments.length;o(forEach(i,(a,c)=>{s&&isFunction(a)?e[c]=bind(a,s):e[c]=a},{allOwnKeys:o}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,i,s,o)=>{e.prototype=Object.create(i.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:i.prototype}),s&&Object.assign(e.prototype,s)},toFlatObject=(e,i,s,o)=>{let a,c,d;const g={};if(i=i||{},e==null)return i;do{for(a=Object.getOwnPropertyNames(e),c=a.length;c-- >0;)d=a[c],(!o||o(d,e,i))&&!g[d]&&(i[d]=e[d],g[d]=!0);e=s!==!1&&getPrototypeOf(e)}while(e&&(!s||s(e,i))&&e!==Object.prototype);return i},endsWith=(e,i,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=i.length;const o=e.indexOf(i,s);return o!==-1&&o===s},toArray=e=>{if(!e)return null;if(isArray(e))return e;let i=e.length;if(!isNumber(i))return null;const s=new Array(i);for(;i-- >0;)s[i]=e[i];return s},isTypedArray=(e=>i=>e&&i instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,i)=>{const o=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=o.next())&&!a.done;){const c=a.value;i.call(e,c[0],c[1])}},matchAll=(e,i)=>{let s;const o=[];for(;(s=e.exec(i))!==null;)o.push(s);return o},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,o,a){return o.toUpperCase()+a}),hasOwnProperty=(({hasOwnProperty:e})=>(i,s)=>e.call(i,s))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,i)=>{const s=Object.getOwnPropertyDescriptors(e),o={};forEach(s,(a,c)=>{i(a,c,e)!==!1&&(o[c]=a)}),Object.defineProperties(e,o)},freezeMethods=e=>{reduceDescriptors(e,(i,s)=>{if(isFunction(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const o=e[s];if(isFunction(o)){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},toObjectSet=(e,i)=>{const s={},o=a=>{a.forEach(c=>{s[c]=!0})};return isArray(e)?o(e):o(String(e).split(i)),s},noop=()=>{},toFiniteNumber=(e,i)=>(e=+e,Number.isFinite(e)?e:i),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(e=16,i=ALPHABET.ALPHA_DIGIT)=>{let s="";const{length:o}=i;for(;e--;)s+=i[Math.random()*o|0];return s};function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const toJSONObject=e=>{const i=new Array(10),s=(o,a)=>{if(isObject(o)){if(i.indexOf(o)>=0)return;if(!("toJSON"in o)){i[a]=o;const c=isArray(o)?[]:{};return forEach(o,(d,g)=>{const _=s(d,a+1);!isUndefined(_)&&(c[g]=_)}),i[a]=void 0,c}}return o};return s(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),utils={isArray,isArrayBuffer:isArrayBuffer$1,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean,isObject,isPlainObject,isUndefined,isDate,isFile:isFile$2,isBlob:isBlob$1,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(e,i,s,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",i&&(this.code=i),s&&(this.config=s),o&&(this.request=o),a&&(this.response=a)}utils.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(e,i,s,o,a,c)=>{const d=Object.create(prototype$1);return utils.toFlatObject(e,d,function(_){return _!==Error.prototype},g=>g!=="isAxiosError"),AxiosError.call(d,e.message,i,s,o,a),d.cause=e,d.name=e.name,c&&Object.assign(d,c),d};const httpAdapter=null;function isVisitable(e){return utils.isPlainObject(e)||utils.isArray(e)}function removeBrackets(e){return utils.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,i,s){return e?e.concat(i).map(function(a,c){return a=removeBrackets(a),!s&&c?"["+a+"]":a}).join(s?".":""):i}function isFlatArray(e){return utils.isArray(e)&&!e.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(i){return/^is[A-Z]/.test(i)});function toFormData(e,i,s){if(!utils.isObject(e))throw new TypeError("target must be an object");i=i||new FormData,s=utils.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function($,ot){return!utils.isUndefined(ot[$])});const o=s.metaTokens,a=s.visitor||_e,c=s.dots,d=s.indexes,_=(s.Blob||typeof Blob<"u"&&Blob)&&utils.isSpecCompliantForm(i);if(!utils.isFunction(a))throw new TypeError("visitor must be a function");function b(tt){if(tt===null)return"";if(utils.isDate(tt))return tt.toISOString();if(!_&&utils.isBlob(tt))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(tt)||utils.isTypedArray(tt)?_&&typeof Blob=="function"?new Blob([tt]):Buffer.from(tt):tt}function _e(tt,$,ot){let et=tt;if(tt&&!ot&&typeof tt=="object"){if(utils.endsWith($,"{}"))$=o?$:$.slice(0,-2),tt=JSON.stringify(tt);else if(utils.isArray(tt)&&isFlatArray(tt)||(utils.isFileList(tt)||utils.endsWith($,"[]"))&&(et=utils.toArray(tt)))return $=removeBrackets($),et.forEach(function(nt,at){!(utils.isUndefined(nt)||nt===null)&&i.append(d===!0?renderKey([$],at,c):d===null?$:$+"[]",b(nt))}),!1}return isVisitable(tt)?!0:(i.append(renderKey(ot,$,c),b(tt)),!1)}const rt=[],st=Object.assign(predicates,{defaultVisitor:_e,convertValue:b,isVisitable});function lt(tt,$){if(!utils.isUndefined(tt)){if(rt.indexOf(tt)!==-1)throw Error("Circular reference detected in "+$.join("."));rt.push(tt),utils.forEach(tt,function(et,it){(!(utils.isUndefined(et)||et===null)&&a.call(i,et,utils.isString(it)?it.trim():it,$,st))===!0&<(et,$?$.concat(it):[it])}),rt.pop()}}if(!utils.isObject(e))throw new TypeError("data must be an object");return lt(e),i}function encode$1(e){const i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return i[o]})}function AxiosURLSearchParams(e,i){this._pairs=[],e&&toFormData(e,this,i)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(i,s){this._pairs.push([i,s])};prototype.toString=function(i){const s=i?function(o){return i.call(this,o,encode$1)}:encode$1;return this._pairs.map(function(a){return s(a[0])+"="+s(a[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,i,s){if(!i)return e;const o=s&&s.encode||encode,a=s&&s.serialize;let c;if(a?c=a(i,s):c=utils.isURLSearchParams(i)?i.toString():new AxiosURLSearchParams(i,s).toString(o),c){const d=e.indexOf("#");d!==-1&&(e=e.slice(0,d)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}class InterceptorManager{constructor(){this.handlers=[]}use(i,s,o){return this.handlers.push({fulfilled:i,rejected:s,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(i){this.handlers[i]&&(this.handlers[i]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(i){utils.forEach(this.handlers,function(o){o!==null&&i(o)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,isStandardBrowserEnv=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},isStandardBrowserEnv,isStandardBrowserWebWorkerEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(e,i){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(s,o,a,c){return platform.isNode&&utils.isBuffer(s)?(this.append(o,s.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)}},i))}function parsePropPath(e){return utils.matchAll(/\w+|\[(\w*)]/g,e).map(i=>i[0]==="[]"?"":i[1]||i[0])}function arrayToObject(e){const i={},s=Object.keys(e);let o;const a=s.length;let c;for(o=0;o=s.length;return d=!d&&utils.isArray(a)?a.length:d,_?(utils.hasOwnProp(a,d)?a[d]=[a[d],o]:a[d]=o,!g):((!a[d]||!utils.isObject(a[d]))&&(a[d]=[]),i(s,o,a[d],c)&&utils.isArray(a[d])&&(a[d]=arrayToObject(a[d])),!g)}if(utils.isFormData(e)&&utils.isFunction(e.entries)){const s={};return utils.forEachEntry(e,(o,a)=>{i(parsePropPath(o),a,s,0)}),s}return null}const DEFAULT_CONTENT_TYPE={"Content-Type":void 0};function stringifySafely(e,i,s){if(utils.isString(e))try{return(i||JSON.parse)(e),utils.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(s||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(i,s){const o=s.getContentType()||"",a=o.indexOf("application/json")>-1,c=utils.isObject(i);if(c&&utils.isHTMLForm(i)&&(i=new FormData(i)),utils.isFormData(i))return a&&a?JSON.stringify(formDataToJSON(i)):i;if(utils.isArrayBuffer(i)||utils.isBuffer(i)||utils.isStream(i)||utils.isFile(i)||utils.isBlob(i))return i;if(utils.isArrayBufferView(i))return i.buffer;if(utils.isURLSearchParams(i))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let g;if(c){if(o.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(i,this.formSerializer).toString();if((g=utils.isFileList(i))||o.indexOf("multipart/form-data")>-1){const _=this.env&&this.env.FormData;return toFormData(g?{"files[]":i}:i,_&&new _,this.formSerializer)}}return c||a?(s.setContentType("application/json",!1),stringifySafely(i)):i}],transformResponse:[function(i){const s=this.transitional||defaults.transitional,o=s&&s.forcedJSONParsing,a=this.responseType==="json";if(i&&utils.isString(i)&&(o&&!this.responseType||a)){const d=!(s&&s.silentJSONParsing)&&a;try{return JSON.parse(i)}catch(g){if(d)throw g.name==="SyntaxError"?AxiosError.from(g,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):g}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],function(i){defaults.headers[i]={}});utils.forEach(["post","put","patch"],function(i){defaults.headers[i]=utils.merge(DEFAULT_CONTENT_TYPE)});const defaults$1=defaults,ignoreDuplicateOf=utils.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const i={};let s,o,a;return e&&e.split(` `).forEach(function(d){a=d.indexOf(":"),s=d.substring(0,a).trim().toLowerCase(),o=d.substring(a+1).trim(),!(!s||i[s]&&ignoreDuplicateOf[s])&&(s==="set-cookie"?i[s]?i[s].push(o):i[s]=[o]:i[s]=i[s]?i[s]+", "+o:o)}),i},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const i=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=s.exec(e);)i[o[1]]=o[2];return i}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,i,s,o,a){if(utils.isFunction(o))return o.call(this,i,s);if(a&&(i=s),!!utils.isString(i)){if(utils.isString(o))return i.indexOf(o)!==-1;if(utils.isRegExp(o))return o.test(i)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(i,s,o)=>s.toUpperCase()+o)}function buildAccessors(e,i){const s=utils.toCamelCase(" "+i);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+s,{value:function(a,c,d){return this[o].call(this,i,a,c,d)},configurable:!0})})}class AxiosHeaders{constructor(i){i&&this.set(i)}set(i,s,o){const a=this;function c(g,_,b){const _e=normalizeHeader(_);if(!_e)throw new Error("header name must be a non-empty string");const rt=utils.findKey(a,_e);(!rt||a[rt]===void 0||b===!0||b===void 0&&a[rt]!==!1)&&(a[rt||_]=normalizeValue(g))}const d=(g,_)=>utils.forEach(g,(b,_e)=>c(b,_e,_));return utils.isPlainObject(i)||i instanceof this.constructor?d(i,s):utils.isString(i)&&(i=i.trim())&&!isValidHeaderName(i)?d(parseHeaders(i),s):i!=null&&c(s,i,o),this}get(i,s){if(i=normalizeHeader(i),i){const o=utils.findKey(this,i);if(o){const a=this[o];if(!s)return a;if(s===!0)return parseTokens(a);if(utils.isFunction(s))return s.call(this,a,o);if(utils.isRegExp(s))return s.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(i,s){if(i=normalizeHeader(i),i){const o=utils.findKey(this,i);return!!(o&&this[o]!==void 0&&(!s||matchHeaderValue(this,this[o],o,s)))}return!1}delete(i,s){const o=this;let a=!1;function c(d){if(d=normalizeHeader(d),d){const g=utils.findKey(o,d);g&&(!s||matchHeaderValue(o,o[g],g,s))&&(delete o[g],a=!0)}}return utils.isArray(i)?i.forEach(c):c(i),a}clear(i){const s=Object.keys(this);let o=s.length,a=!1;for(;o--;){const c=s[o];(!i||matchHeaderValue(this,this[c],c,i,!0))&&(delete this[c],a=!0)}return a}normalize(i){const s=this,o={};return utils.forEach(this,(a,c)=>{const d=utils.findKey(o,c);if(d){s[d]=normalizeValue(a),delete s[c];return}const g=i?formatHeader(c):String(c).trim();g!==c&&delete s[c],s[g]=normalizeValue(a),o[g]=!0}),this}concat(...i){return this.constructor.concat(this,...i)}toJSON(i){const s=Object.create(null);return utils.forEach(this,(o,a)=>{o!=null&&o!==!1&&(s[a]=i&&utils.isArray(o)?o.join(", "):o)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([i,s])=>i+": "+s).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...s){const o=new this(i);return s.forEach(a=>o.set(a)),o}static accessor(i){const o=(this[$internals]=this[$internals]={accessors:{}}).accessors,a=this.prototype;function c(d){const g=normalizeHeader(d);o[g]||(buildAccessors(a,d),o[g]=!0)}return utils.isArray(i)?i.forEach(c):c(i),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.freezeMethods(AxiosHeaders.prototype);utils.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(e,i){const s=this||defaults$1,o=i||s,a=AxiosHeaders$1.from(o.headers);let c=o.data;return utils.forEach(e,function(g){c=g.call(s,c,a.normalize(),i?i.status:void 0)}),a.normalize(),c}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,i,s){AxiosError.call(this,e??"canceled",AxiosError.ERR_CANCELED,i,s),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(e,i,s){const o=s.config.validateStatus;!s.status||!o||o(s.status)?e(s):i(new AxiosError("Request failed with status code "+s.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(s,o,a,c,d,g){const _=[];_.push(s+"="+encodeURIComponent(o)),utils.isNumber(a)&&_.push("expires="+new Date(a).toGMTString()),utils.isString(c)&&_.push("path="+c),utils.isString(d)&&_.push("domain="+d),g===!0&&_.push("secure"),document.cookie=_.join("; ")},read:function(s){const o=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,i){return i?e.replace(/\/+$/,"")+"/"+i.replace(/^\/+/,""):e}function buildFullPath(e,i){return e&&!isAbsoluteURL(i)?combineURLs(e,i):i}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const i=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let o;function a(c){let d=c;return i&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return o=a(window.location.href),function(d){const g=utils.isString(d)?a(d):d;return g.protocol===o.protocol&&g.host===o.host}}():function(){return function(){return!0}}();function parseProtocol(e){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return i&&i[1]||""}function speedometer(e,i){e=e||10;const s=new Array(e),o=new Array(e);let a=0,c=0,d;return i=i!==void 0?i:1e3,function(_){const b=Date.now(),_e=o[c];d||(d=b),s[a]=_,o[a]=b;let rt=c,st=0;for(;rt!==a;)st+=s[rt++],rt=rt%e;if(a=(a+1)%e,a===c&&(c=(c+1)%e),b-d{const c=a.loaded,d=a.lengthComputable?a.total:void 0,g=c-s,_=o(g),b=c<=d;s=c;const _e={loaded:c,total:d,progress:d?c/d:void 0,bytes:g,rate:_||void 0,estimated:_&&d&&b?(d-c)/_:void 0,event:a};_e[i?"download":"upload"]=!0,e(_e)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(s,o){let a=e.data;const c=AxiosHeaders$1.from(e.headers).normalize(),d=e.responseType;let g;function _(){e.cancelToken&&e.cancelToken.unsubscribe(g),e.signal&&e.signal.removeEventListener("abort",g)}utils.isFormData(a)&&(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv?c.setContentType(!1):c.setContentType("multipart/form-data;",!1));let b=new XMLHttpRequest;if(e.auth){const lt=e.auth.username||"",tt=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";c.set("Authorization","Basic "+btoa(lt+":"+tt))}const _e=buildFullPath(e.baseURL,e.url);b.open(e.method.toUpperCase(),buildURL(_e,e.params,e.paramsSerializer),!0),b.timeout=e.timeout;function rt(){if(!b)return;const lt=AxiosHeaders$1.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),$={data:!d||d==="text"||d==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:lt,config:e,request:b};settle(function(et){s(et),_()},function(et){o(et),_()},$),b=null}if("onloadend"in b?b.onloadend=rt:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(rt)},b.onabort=function(){b&&(o(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,b)),b=null)},b.onerror=function(){o(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let tt=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const $=e.transitional||transitionalDefaults;e.timeoutErrorMessage&&(tt=e.timeoutErrorMessage),o(new AxiosError(tt,$.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,b)),b=null},platform.isStandardBrowserEnv){const lt=(e.withCredentials||isURLSameOrigin(_e))&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);lt&&c.set(e.xsrfHeaderName,lt)}a===void 0&&c.setContentType(null),"setRequestHeader"in b&&utils.forEach(c.toJSON(),function(tt,$){b.setRequestHeader($,tt)}),utils.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),d&&d!=="json"&&(b.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&b.addEventListener("progress",progressEventReducer(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress)),(e.cancelToken||e.signal)&&(g=lt=>{b&&(o(!lt||lt.type?new CanceledError(null,e,b):lt),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(g),e.signal&&(e.signal.aborted?g():e.signal.addEventListener("abort",g)));const st=parseProtocol(_e);if(st&&platform.protocols.indexOf(st)===-1){o(new AxiosError("Unsupported protocol "+st+":",AxiosError.ERR_BAD_REQUEST,e));return}b.send(a||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(e,i)=>{if(e){try{Object.defineProperty(e,"name",{value:i})}catch{}Object.defineProperty(e,"adapterName",{value:i})}});const adapters={getAdapter:e=>{e=utils.isArray(e)?e:[e];const{length:i}=e;let s,o;for(let a=0;ae instanceof AxiosHeaders$1?e.toJSON():e;function mergeConfig(e,i){i=i||{};const s={};function o(b,_e,rt){return utils.isPlainObject(b)&&utils.isPlainObject(_e)?utils.merge.call({caseless:rt},b,_e):utils.isPlainObject(_e)?utils.merge({},_e):utils.isArray(_e)?_e.slice():_e}function a(b,_e,rt){if(utils.isUndefined(_e)){if(!utils.isUndefined(b))return o(void 0,b,rt)}else return o(b,_e,rt)}function c(b,_e){if(!utils.isUndefined(_e))return o(void 0,_e)}function d(b,_e){if(utils.isUndefined(_e)){if(!utils.isUndefined(b))return o(void 0,b)}else return o(void 0,_e)}function g(b,_e,rt){if(rt in i)return o(b,_e);if(rt in e)return o(void 0,b)}const _={url:c,method:c,data:c,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:g,headers:(b,_e)=>a(headersToObject(b),headersToObject(_e),!0)};return utils.forEach(Object.keys(Object.assign({},e,i)),function(_e){const rt=_[_e]||a,st=rt(e[_e],i[_e],_e);utils.isUndefined(st)&&rt!==g||(s[_e]=st)}),s}const VERSION="1.4.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,i)=>{validators$1[e]=function(o){return typeof o===e||"a"+(i<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(i,s,o){function a(c,d){return"[Axios v"+VERSION+"] Transitional option '"+c+"'"+d+(o?". "+o:"")}return(c,d,g)=>{if(i===!1)throw new AxiosError(a(d," has been removed"+(s?" in "+s:"")),AxiosError.ERR_DEPRECATED);return s&&!deprecatedWarnings[d]&&(deprecatedWarnings[d]=!0,console.warn(a(d," has been deprecated since v"+s+" and will be removed in the near future"))),i?i(c,d,g):!0}};function assertOptions(e,i,s){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let a=o.length;for(;a-- >0;){const c=o[a],d=i[c];if(d){const g=e[c],_=g===void 0||d(g,c,e);if(_!==!0)throw new AxiosError("option "+c+" must be "+_,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new AxiosError("Unknown option "+c,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(i){this.defaults=i,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(i,s){typeof i=="string"?(s=s||{},s.url=i):s=i||{},s=mergeConfig(this.defaults,s);const{transitional:o,paramsSerializer:a,headers:c}=s;o!==void 0&&validator.assertOptions(o,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),a!=null&&(utils.isFunction(a)?s.paramsSerializer={serialize:a}:validator.assertOptions(a,{encode:validators.function,serialize:validators.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let d;d=c&&utils.merge(c.common,c[s.method]),d&&utils.forEach(["delete","get","head","post","put","patch","common"],tt=>{delete c[tt]}),s.headers=AxiosHeaders$1.concat(d,c);const g=[];let _=!0;this.interceptors.request.forEach(function($){typeof $.runWhen=="function"&&$.runWhen(s)===!1||(_=_&&$.synchronous,g.unshift($.fulfilled,$.rejected))});const b=[];this.interceptors.response.forEach(function($){b.push($.fulfilled,$.rejected)});let _e,rt=0,st;if(!_){const tt=[dispatchRequest.bind(this),void 0];for(tt.unshift.apply(tt,g),tt.push.apply(tt,b),st=tt.length,_e=Promise.resolve(s);rt{if(!o._listeners)return;let c=o._listeners.length;for(;c-- >0;)o._listeners[c](a);o._listeners=null}),this.promise.then=a=>{let c;const d=new Promise(g=>{o.subscribe(g),c=g}).then(a);return d.cancel=function(){o.unsubscribe(c)},d},i(function(c,d,g){o.reason||(o.reason=new CanceledError(c,d,g),s(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const s=this._listeners.indexOf(i);s!==-1&&this._listeners.splice(s,1)}static source(){let i;return{token:new CancelToken(function(a){i=a}),cancel:i}}}const CancelToken$1=CancelToken;function spread(e){return function(s){return e.apply(null,s)}}function isAxiosError(e){return utils.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([e,i])=>{HttpStatusCode[i]=e});const HttpStatusCode$1=HttpStatusCode;function createInstance(e){const i=new Axios$1(e),s=bind(Axios$1.prototype.request,i);return utils.extend(s,Axios$1.prototype,i,{allOwnKeys:!0}),utils.extend(s,i,null,{allOwnKeys:!0}),s.create=function(a){return createInstance(mergeConfig(e,a))},s}const axios=createInstance(defaults$1);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(i){return Promise.all(i)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=e=>formDataToJSON(utils.isHTMLForm(e)?new FormData(e):e);axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios,authBox="",uri="https://saimon-backend-gukinumu4q-ey.a.run.app/";function logInWithEmailAndPassword(e,i){let s=JSON.stringify({email:e,password:i}),o={method:"post",maxBodyLength:1/0,url:`${uri}auth/login/`,headers:{"Content-Type":"application/json"},data:s};axios$1.request(o).then(a=>{localStorage.setItem("access_token",a.data.result.access_token),alert("Login Successful")}).catch(a=>{console.log(a),alert("Username and password do not match")})}function registerWithEmailAndPassword(e,i,s){let o=JSON.stringify({email:i,name:e,password:s}),a={method:"post",maxBodyLength:1/0,url:`${uri}auth/register/`,headers:{"Content-Type":"application/json"},data:o};axios$1.request(a).then(c=>{console.log(JSON.stringify(c.data)),alert("Account created successfully! Please Sign in")}).catch(c=>{console.log(c),alert("An Error has Occurred, Please try again!")})}function AuthBox(){const[e,i]=reactExports.useState(""),[s,o]=reactExports.useState(""),[a,c]=reactExports.useState(""),[d,g]=reactExports.useState(!1),_=useNavigate();reactExports.useEffect(()=>{localStorage.getItem("access_token")&&_("/profile")},[]);const b=_e=>{_e.preventDefault(),g(!d),console.log(d)};return jsx(motion.div,{className:"messageContainer authBox",initial:{y:150,opacity:0},animate:{y:0,opacity:1},transition:{duration:.8,ease:[0,.71,.2,1.01]},children:jsx("div",{className:"message",children:jsxs("div",{className:"loginContainer",children:[d?jsx("p",{children:"Please Login to continue"}):jsxs(Fragment,{children:[jsx("p",{children:"Please Register to continue"}),jsx("input",{type:"text",className:"loginTextBox",value:s,onChange:_e=>o(_e.target.value),placeholder:"UserName"})]}),jsx("input",{type:"text",className:"loginTextBox",value:e,onChange:_e=>i(_e.target.value),placeholder:"E-mail Address"}),jsx("input",{type:"password",className:"loginTextBox",value:a,onChange:_e=>c(_e.target.value),placeholder:"Password"}),d?jsx("button",{className:"loginBtn",onClick:()=>logInWithEmailAndPassword(e,a),children:"Login"}):jsx("button",{className:"loginBtn",onClick:()=>registerWithEmailAndPassword(s,e,a),children:"Register"}),jsx("div",{children:jsx("a",{href:"",children:"Forgot Password"})}),d?jsxs("div",{children:["Don't have an account? ",jsx("a",{onClick:b,children:"Register"})," now."]}):jsxs("div",{children:["Already have an account? ",jsx("a",{onClick:b,children:"Login"})," now."]})]})})})}const logo="/assets/Grayscale Transparent-7bc54355.svg";function Register(){return jsxs("div",{className:"container register",children:[jsx(Link,{to:"/",children:jsx("img",{src:logo,alt:"Logo button leads to home page"})}),jsx(AuthBox,{})]})}const attach="/assets/attach-5af3fc89.svg",send="/assets/send-427a0944.svg",sidebar="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAEAQAAABQ8GUWAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAAAqo0jMgAAAAlwSFlzAAAAYAAAAGAA8GtCzwAAAAd0SU1FB+cGCAsXEJkAJ8YAAAK2SURBVHja7Zu9SjtBFMXPrCalhIhBkCBoRASTJo2FIH68Qhot9Bl8EMEU1qbzgyj4CGphoaBrY6OFHyARSbY0wT0Wg1n/4MbsujqJ//urZjczs+eemdm9xQ0gCIIg/L+oIJ3JZBLIZsFUyrTwz6OpVADbVqpajXReumNjdMtlstFgx9NokLu7dDOZiIJfWCAdx3RYwXEccm7uy03z1cpDnZ4CfX36jm0Dm5vg/X2kW+xTpqagVle1kLU14OTkyyEqnQYWF4F8Xt9wHCCfV+r6OuTql8ueoxsbdGOxnw/8/dmFQvPRbqHQ9jgqRRaL3tidnXACmEx6Z/78/DeD/44Bemw8Ttq2Hlyvk4mEX1/Lf5pcDujt1e1SSVmNxm8a8B2UVa8DpZK+isXAXC6EAf39XvvhwXRQwbm78xwZGPDr1es7npbVfEWSNB1OU5abSkFNT4M9Pf/8oF5fweNjZVUqTc1N/ZbvQvsb0Kmow0NgfPzz79fVFTAxEWQ6K0jnjqDVblTBd2r37QDMzAB+R+Do6M8boM/43l5U83XfEYgYMcC0ANN03Tug7TzgrxogeYDkAZIHSB4QJWKAaQGm6bp3gOQBkgdIHiB5gOQBESIGmBZgGjHAtADTiAGmBZhGDDAtwDRigGkBphEDTAswjRhgWoBp/A1Qruu1VaCa4o7go+aPsbRtAJ6fvfbQkOl4gpNON5t8egphwMUF8F4buLREds8uoBuPAysr+qpe17EENECXnB8c6Kt8Hlhf/+1q0dDBq2IRmJzUd/b3leU4vnG2niyTgTo784qlLy+BUgm8vf35UEIUS2N4GGp52Qu+VtPF0jc34R3l/DxZq5kufg9OtUrOzkayFuToKLm9rQuPO52XF3JrixwZaSe2gH+ZSSTAbBYYHIzE2ch5fARsu9WZFwRBEASPNzhb/5UixnFjAAAAAElFTkSuQmCC",profile$1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAEAQAAABQ8GUWAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAAAqo0jMgAAAAlwSFlzAAAAYAAAAGAA8GtCzwAAAAd0SU1FB+cGCAsWFx5/gyQAAARkSURBVHja7ZpNTxNdGIbvZ5qApRoSCaTRUFyYxo+6UDEqhliXEmOMP8BEt4qf7Iw7A/IXjAkkLtwQdeNW2elCjF+4INFoTRQtRSsWG7DndjHwSr+EcmbmEV6vXWfamee658z0nDNHEBA0LS2Qri4gmQQSCbCtDdLY6O7MZiHv3gEvXwLDw+C9e+Kk00HV5q84OzrIu3fJmRkumZkZ8s4dcv9+7fqXL25iMVfcltu3aWIxbZ/a5Hn8OPn1q738PF++kMeOaXstUf7iRdIY7+TnMYY8f17bbxH506e9Fy/lwgVtz8ry5sgRslDwP4BCgTx8WNu3WJ7RKDkx4b/8HCadpmlp0fZeEMDNm4HJ/8fAgLb3nPzWrcE0/VIKBXL7dtv6HfsEenoAx/44tZfuwIN/BbFyZ0MDMD4OrFsXfAAAkM0C0ahIPr/cI1heuWRSTx4AGhvBzk6bI1gGYHdyT5CDBxUD2LZN29+2BrsA2NqqrQ+0tekFIGvXauvbPoMsbwFjtPWBnz8VA8hmtfVBuxosA3jzRtsf8vq1YgDPnmn7A8+fKwYwPKytD96/r3duOg6ZSgU/EJrn7VvSbhxi9WMRY4DBQbUrgIEBtwZFaJqbab5/D/7qT02RTU229VsPY90XGNeuBR/91asimUzw560ATX09+fRpcFd/ZISmrk7buySEeNydv/ebyUmazZu1fauE0NlJ5nL+yedy5IED2p5/DoEdHWQm4738xMSKeVdIbtpE8+iRZ+7m4UMau2GvQgihENndTZNOL9/882f3bVMopO1jEUQkQnP2LM2TJ0sXHxkhu7vJSMTv+qxmhWsOw7S2AocOAYkEJBYD1693q5icBFMpd4HEgwfivH8fZF3/+Mf/GF+fAWQ4DMbjQDwOaWoC5hZFLUo2C2YywNgYZGxM5McP7aCWLm3a28m+PrcfMDtr3wmYnXX7Ab295O7d2n6VpRkO05w5Q46Oetb5qcroqNs3CIe1vX93djg+7r94KR8/qnaSyF27auvc+MXjx+TOncHKmxMnyOlpbfXf5PPkuXMBXPVQiLxxQ1u3Kub6dd9uCZq6OnJoSNtxcYaGPJ8tIkXIwUFttaVz65btdHlJAP392ko1Y3p7PZLv6vJn6avvCRjy6NHF/OTP8tGoO0S1n3/XIZ0Gd+wQ59Onat9Y5D7p71+58gDQ3Azp61vWT2n27l2ZTb/CrWD27KnmWb0FyJUrgAQ6Y+QPIpDLl6vurbTRXYL64sXqCMA1AhIJkVevSvdUbgE8dWr1yAOACHjyZMU9Ze50HCCVAjZu1C7bWz58AGIxkUJh4dbyFsD29tUnDwAbNqDCqLE8AEkmtUv1j3K3Cs+Affu0y/SP8neLFQLYskW7TN+QeLxs08IP7gNwehqor9eu1R/yeaChQYSc31LcAhiJrF55AFizBiieTC0O4K9Y/OwzLF5cXdICcjmg+H9ydVEouLd4lQDE+fYN6On5KxZBe042C1y6JM7U1MKtvwDFAy0jfpnpWQAAAABJRU5ErkJggg==",userPic="/assets/user-5917ac1f.jpg",chatPic="/assets/Original Logo Symbol-593f23ac.png",message="";function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var moment$1={exports:{}};(function(e,i){(function(s,o){e.exports=o()})(commonjsGlobal,function(){var s;function o(){return s.apply(null,arguments)}function a(h){s=h}function c(h){return h instanceof Array||Object.prototype.toString.call(h)==="[object Array]"}function d(h){return h!=null&&Object.prototype.toString.call(h)==="[object Object]"}function g(h,j){return Object.prototype.hasOwnProperty.call(h,j)}function _(h){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(h).length===0;var j;for(j in h)if(g(h,j))return!1;return!0}function b(h){return h===void 0}function _e(h){return typeof h=="number"||Object.prototype.toString.call(h)==="[object Number]"}function rt(h){return h instanceof Date||Object.prototype.toString.call(h)==="[object Date]"}function st(h,j){var ut=[],ft,bt=h.length;for(ft=0;ft>>0,ft;for(ft=0;ft0)for(ut=0;ut=0;return(Ut?ut?"+":"":"-")+Math.pow(10,Math.max(0,bt)).toString().substr(1)+ft}var Xt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Tt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gt={},mt={};function At(h,j,ut,ft){var bt=ft;typeof ft=="string"&&(bt=function(){return this[ft]()}),h&&(mt[h]=bt),j&&(mt[j[0]]=function(){return qt(bt.apply(this,arguments),j[1],j[2])}),ut&&(mt[ut]=function(){return this.localeData().ordinal(bt.apply(this,arguments),h)})}function Rt(h){return h.match(/\[[\s\S]/)?h.replace(/^\[|\]$/g,""):h.replace(/\\/g,"")}function Dt(h){var j=h.match(Xt),ut,ft;for(ut=0,ft=j.length;ut=0&&Tt.test(h);)h=h.replace(Tt,ft),Tt.lastIndex=0,ut-=1;return h}var zt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function dt(h){var j=this._longDateFormat[h],ut=this._longDateFormat[h.toUpperCase()];return j||!ut?j:(this._longDateFormat[h]=ut.match(Xt).map(function(ft){return ft==="MMMM"||ft==="MM"||ft==="DD"||ft==="dddd"?ft.slice(1):ft}).join(""),this._longDateFormat[h])}var _t="Invalid date";function St(){return this._invalidDate}var wt="%d",kt=/\d{1,2}/;function Nt(h){return this._ordinal.replace("%d",h)}var Zt={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function an(h,j,ut,ft){var bt=this._relativeTime[ut];return Bt(bt)?bt(h,j,ut,ft):bt.replace(/%d/i,h)}function Qt(h,j){var ut=this._relativeTime[h>0?"future":"past"];return Bt(ut)?ut(j):ut.replace(/%s/i,j)}var tn={};function Kt(h,j){var ut=h.toLowerCase();tn[ut]=tn[ut+"s"]=tn[j]=h}function nn(h){return typeof h=="string"?tn[h]||tn[h.toLowerCase()]:void 0}function ln(h){var j={},ut,ft;for(ft in h)g(h,ft)&&(ut=nn(ft),ut&&(j[ut]=h[ft]));return j}var Mt={};function sn(h,j){Mt[h]=j}function gn(h){var j=[],ut;for(ut in h)g(h,ut)&&j.push({unit:ut,priority:Mt[ut]});return j.sort(function(ft,bt){return ft.priority-bt.priority}),j}function vn(h){return h%4===0&&h%100!==0||h%400===0}function _n(h){return h<0?Math.ceil(h)||0:Math.floor(h)}function mn(h){var j=+h,ut=0;return j!==0&&isFinite(j)&&(ut=_n(j)),ut}function Mn(h,j){return function(ut){return ut!=null?(Qn(this,h,ut),o.updateOffset(this,j),this):Dn(this,h)}}function Dn(h,j){return h.isValid()?h._d["get"+(h._isUTC?"UTC":"")+j]():NaN}function Qn(h,j,ut){h.isValid()&&!isNaN(ut)&&(j==="FullYear"&&vn(h.year())&&h.month()===1&&h.date()===29?(ut=mn(ut),h._d["set"+(h._isUTC?"UTC":"")+j](ut,h.month(),Fr(ut,h.month()))):h._d["set"+(h._isUTC?"UTC":"")+j](ut))}function Pn(h){return h=nn(h),Bt(this[h])?this[h]():this}function jn(h,j){if(typeof h=="object"){h=ln(h);var ut=gn(h),ft,bt=ut.length;for(ft=0;ft68?1900:2e3)};var Ns=Mn("FullYear",!0);function Ko(){return vn(this.year())}function Xo(h,j,ut,ft,bt,Ut,en){var xn;return h<100&&h>=0?(xn=new Date(h+400,j,ut,ft,bt,Ut,en),isFinite(xn.getFullYear())&&xn.setFullYear(h)):xn=new Date(h,j,ut,ft,bt,Ut,en),xn}function Tr(h){var j,ut;return h<100&&h>=0?(ut=Array.prototype.slice.call(arguments),ut[0]=h+400,j=new Date(Date.UTC.apply(null,ut)),isFinite(j.getUTCFullYear())&&j.setUTCFullYear(h)):j=new Date(Date.UTC.apply(null,arguments)),j}function Lr(h,j,ut){var ft=7+j-ut,bt=(7+Tr(h,0,ft).getUTCDay()-j)%7;return-bt+ft-1}function js(h,j,ut,ft,bt){var Ut=(7+ut-ft)%7,en=Lr(h,ft,bt),xn=1+7*(j-1)+Ut+en,wn,On;return xn<=0?(wn=h-1,On=Pr(wn)+xn):xn>Pr(h)?(wn=h+1,On=xn-Pr(h)):(wn=h,On=xn),{year:wn,dayOfYear:On}}function kr(h,j,ut){var ft=Lr(h.year(),j,ut),bt=Math.floor((h.dayOfYear()-ft-1)/7)+1,Ut,en;return bt<1?(en=h.year()-1,Ut=bt+sr(en,j,ut)):bt>sr(h.year(),j,ut)?(Ut=bt-sr(h.year(),j,ut),en=h.year()+1):(en=h.year(),Ut=bt),{week:Ut,year:en}}function sr(h,j,ut){var ft=Lr(h,j,ut),bt=Lr(h+1,j,ut);return(Pr(h)-ft+bt)/7}At("w",["ww",2],"wo","week"),At("W",["WW",2],"Wo","isoWeek"),Kt("week","w"),Kt("isoWeek","W"),sn("week",5),sn("isoWeek",5),hn("w",It),hn("ww",It,Jt),hn("W",It),hn("WW",It,Jt),Hn(["w","ww","W","WW"],function(h,j,ut,ft){j[ft.substr(0,1)]=mn(h)});function Qo(h){return kr(h,this._week.dow,this._week.doy).week}var Zo={dow:0,doy:6};function Jo(){return this._week.dow}function na(){return this._week.doy}function ga(h){var j=this.localeData().week(this);return h==null?j:this.add((h-j)*7,"d")}function _a(h){var j=kr(this,1,4).week;return h==null?j:this.add((h-j)*7,"d")}At("d",0,"do","day"),At("dd",0,0,function(h){return this.localeData().weekdaysMin(this,h)}),At("ddd",0,0,function(h){return this.localeData().weekdaysShort(this,h)}),At("dddd",0,0,function(h){return this.localeData().weekdays(this,h)}),At("e",0,0,"weekday"),At("E",0,0,"isoWeekday"),Kt("day","d"),Kt("weekday","e"),Kt("isoWeekday","E"),sn("day",11),sn("weekday",11),sn("isoWeekday",11),hn("d",It),hn("e",It),hn("E",It),hn("dd",function(h,j){return j.weekdaysMinRegex(h)}),hn("ddd",function(h,j){return j.weekdaysShortRegex(h)}),hn("dddd",function(h,j){return j.weekdaysRegex(h)}),Hn(["dd","ddd","dddd"],function(h,j,ut,ft){var bt=ut._locale.weekdaysParse(h,ft,ut._strict);bt!=null?j.d=bt:ot(ut).invalidWeekday=h}),Hn(["d","e","E"],function(h,j,ut,ft){j[ft]=mn(h)});function xa(h,j){return typeof h!="string"?h:isNaN(h)?(h=j.weekdaysParse(h),typeof h=="number"?h:null):parseInt(h,10)}function ba(h,j){return typeof h=="string"?j.weekdaysParse(h)%7||7:isNaN(h)?null:h}function Qr(h,j){return h.slice(j,7).concat(h.slice(0,j))}var $a="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_l=Un,Sl=Un,xl=Un;function Al(h,j){var ut=c(this._weekdays)?this._weekdays:this._weekdays[h&&h!==!0&&this._weekdays.isFormat.test(j)?"format":"standalone"];return h===!0?Qr(ut,this._week.dow):h?ut[h.day()]:ut}function El(h){return h===!0?Qr(this._weekdaysShort,this._week.dow):h?this._weekdaysShort[h.day()]:this._weekdaysShort}function Pl(h){return h===!0?Qr(this._weekdaysMin,this._week.dow):h?this._weekdaysMin[h.day()]:this._weekdaysMin}function Tl(h,j,ut){var ft,bt,Ut,en=h.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],ft=0;ft<7;++ft)Ut=tt([2e3,1]).day(ft),this._minWeekdaysParse[ft]=this.weekdaysMin(Ut,"").toLocaleLowerCase(),this._shortWeekdaysParse[ft]=this.weekdaysShort(Ut,"").toLocaleLowerCase(),this._weekdaysParse[ft]=this.weekdays(Ut,"").toLocaleLowerCase();return ut?j==="dddd"?(bt=$n.call(this._weekdaysParse,en),bt!==-1?bt:null):j==="ddd"?(bt=$n.call(this._shortWeekdaysParse,en),bt!==-1?bt:null):(bt=$n.call(this._minWeekdaysParse,en),bt!==-1?bt:null):j==="dddd"?(bt=$n.call(this._weekdaysParse,en),bt!==-1||(bt=$n.call(this._shortWeekdaysParse,en),bt!==-1)?bt:(bt=$n.call(this._minWeekdaysParse,en),bt!==-1?bt:null)):j==="ddd"?(bt=$n.call(this._shortWeekdaysParse,en),bt!==-1||(bt=$n.call(this._weekdaysParse,en),bt!==-1)?bt:(bt=$n.call(this._minWeekdaysParse,en),bt!==-1?bt:null)):(bt=$n.call(this._minWeekdaysParse,en),bt!==-1||(bt=$n.call(this._weekdaysParse,en),bt!==-1)?bt:(bt=$n.call(this._shortWeekdaysParse,en),bt!==-1?bt:null))}function Cl(h,j,ut){var ft,bt,Ut;if(this._weekdaysParseExact)return Tl.call(this,h,j,ut);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),ft=0;ft<7;ft++){if(bt=tt([2e3,1]).day(ft),ut&&!this._fullWeekdaysParse[ft]&&(this._fullWeekdaysParse[ft]=new RegExp("^"+this.weekdays(bt,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[ft]=new RegExp("^"+this.weekdaysShort(bt,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[ft]=new RegExp("^"+this.weekdaysMin(bt,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[ft]||(Ut="^"+this.weekdays(bt,"")+"|^"+this.weekdaysShort(bt,"")+"|^"+this.weekdaysMin(bt,""),this._weekdaysParse[ft]=new RegExp(Ut.replace(".",""),"i")),ut&&j==="dddd"&&this._fullWeekdaysParse[ft].test(h))return ft;if(ut&&j==="ddd"&&this._shortWeekdaysParse[ft].test(h))return ft;if(ut&&j==="dd"&&this._minWeekdaysParse[ft].test(h))return ft;if(!ut&&this._weekdaysParse[ft].test(h))return ft}}function Rl(h){if(!this.isValid())return h!=null?this:NaN;var j=this._isUTC?this._d.getUTCDay():this._d.getDay();return h!=null?(h=xa(h,this.localeData()),this.add(h-j,"d")):j}function Dl(h){if(!this.isValid())return h!=null?this:NaN;var j=(this.day()+7-this.localeData()._week.dow)%7;return h==null?j:this.add(h-j,"d")}function Ml(h){if(!this.isValid())return h!=null?this:NaN;if(h!=null){var j=ba(h,this.localeData());return this.day(this.day()%7?j:j-7)}else return this.day()||7}function Ol(h){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Zr.call(this),h?this._weekdaysStrictRegex:this._weekdaysRegex):(g(this,"_weekdaysRegex")||(this._weekdaysRegex=_l),this._weekdaysStrictRegex&&h?this._weekdaysStrictRegex:this._weekdaysRegex)}function Fl(h){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Zr.call(this),h?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(g(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Sl),this._weekdaysShortStrictRegex&&h?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ll(h){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Zr.call(this),h?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(g(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xl),this._weekdaysMinStrictRegex&&h?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Zr(){function h(Gn,cr){return cr.length-Gn.length}var j=[],ut=[],ft=[],bt=[],Ut,en,xn,wn,On;for(Ut=0;Ut<7;Ut++)en=tt([2e3,1]).day(Ut),xn=Bn(this.weekdaysMin(en,"")),wn=Bn(this.weekdaysShort(en,"")),On=Bn(this.weekdays(en,"")),j.push(xn),ut.push(wn),ft.push(On),bt.push(xn),bt.push(wn),bt.push(On);j.sort(h),ut.sort(h),ft.sort(h),bt.sort(h),this._weekdaysRegex=new RegExp("^("+bt.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+ft.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+ut.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+j.join("|")+")","i")}function Jr(){return this.hours()%12||12}function Il(){return this.hours()||24}At("H",["HH",2],0,"hour"),At("h",["hh",2],0,Jr),At("k",["kk",2],0,Il),At("hmm",0,0,function(){return""+Jr.apply(this)+qt(this.minutes(),2)}),At("hmmss",0,0,function(){return""+Jr.apply(this)+qt(this.minutes(),2)+qt(this.seconds(),2)}),At("Hmm",0,0,function(){return""+this.hours()+qt(this.minutes(),2)}),At("Hmmss",0,0,function(){return""+this.hours()+qt(this.minutes(),2)+qt(this.seconds(),2)});function Bs(h,j){At(h,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),j)})}Bs("a",!0),Bs("A",!1),Kt("hour","h"),sn("hour",13);function Us(h,j){return j._meridiemParse}hn("a",Us),hn("A",Us),hn("H",It),hn("h",It),hn("k",It),hn("HH",It,Jt),hn("hh",It,Jt),hn("kk",It,Jt),hn("hmm",cn),hn("hmmss",pn),hn("Hmm",cn),hn("Hmmss",pn),An(["H","HH"],zn),An(["k","kk"],function(h,j,ut){var ft=mn(h);j[zn]=ft===24?0:ft}),An(["a","A"],function(h,j,ut){ut._isPm=ut._locale.isPM(h),ut._meridiem=h}),An(["h","hh"],function(h,j,ut){j[zn]=mn(h),ot(ut).bigHour=!0}),An("hmm",function(h,j,ut){var ft=h.length-2;j[zn]=mn(h.substr(0,ft)),j[Zn]=mn(h.substr(ft)),ot(ut).bigHour=!0}),An("hmmss",function(h,j,ut){var ft=h.length-4,bt=h.length-2;j[zn]=mn(h.substr(0,ft)),j[Zn]=mn(h.substr(ft,2)),j[ir]=mn(h.substr(bt)),ot(ut).bigHour=!0}),An("Hmm",function(h,j,ut){var ft=h.length-2;j[zn]=mn(h.substr(0,ft)),j[Zn]=mn(h.substr(ft))}),An("Hmmss",function(h,j,ut){var ft=h.length-4,bt=h.length-2;j[zn]=mn(h.substr(0,ft)),j[Zn]=mn(h.substr(ft,2)),j[ir]=mn(h.substr(bt))});function Nl(h){return(h+"").toLowerCase().charAt(0)==="p"}var Vl=/[ap]\.?m?\.?/i,Bl=Mn("Hours",!0);function Ul(h,j,ut){return h>11?ut?"pm":"PM":ut?"am":"AM"}var $s={calendar:Ft,longDateFormat:zt,invalidDate:_t,ordinal:wt,dayOfMonthOrdinalParse:kt,relativeTime:Zt,months:Vo,monthsShort:Ms,week:Zo,weekdays:$a,weekdaysMin:yl,weekdaysShort:Vs,meridiemParse:Vl},Nn={},Cr={},Rr;function $l(h,j){var ut,ft=Math.min(h.length,j.length);for(ut=0;ut0;){if(bt=Ir(Ut.slice(0,ut).join("-")),bt)return bt;if(ft&&ft.length>=ut&&$l(Ut,ft)>=ut-1)break;ut--}j++}return Rr}function zl(h){return h.match("^[^/\\\\]*$")!=null}function Ir(h){var j=null,ut;if(Nn[h]===void 0&&e&&e.exports&&zl(h))try{j=Rr._abbr,ut=commonjsRequire,ut("./locale/"+h),hr(j)}catch{Nn[h]=null}return Nn[h]}function hr(h,j){var ut;return h&&(b(j)?ut=or(h):ut=_i(h,j),ut?Rr=ut:typeof console<"u"&&console.warn&&console.warn("Locale "+h+" not found. Did you forget to load it?")),Rr._abbr}function _i(h,j){if(j!==null){var ut,ft=$s;if(j.abbr=h,Nn[h]!=null)Ct("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),ft=Nn[h]._config;else if(j.parentLocale!=null)if(Nn[j.parentLocale]!=null)ft=Nn[j.parentLocale]._config;else if(ut=Ir(j.parentLocale),ut!=null)ft=ut._config;else return Cr[j.parentLocale]||(Cr[j.parentLocale]=[]),Cr[j.parentLocale].push({name:h,config:j}),null;return Nn[h]=new Wt(Yt(ft,j)),Cr[h]&&Cr[h].forEach(function(bt){_i(bt.name,bt.config)}),hr(h),Nn[h]}else return delete Nn[h],null}function Hl(h,j){if(j!=null){var ut,ft,bt=$s;Nn[h]!=null&&Nn[h].parentLocale!=null?Nn[h].set(Yt(Nn[h]._config,j)):(ft=Ir(h),ft!=null&&(bt=ft._config),j=Yt(bt,j),ft==null&&(j.abbr=h),ut=new Wt(j),ut.parentLocale=Nn[h],Nn[h]=ut),hr(h)}else Nn[h]!=null&&(Nn[h].parentLocale!=null?(Nn[h]=Nn[h].parentLocale,h===hr()&&hr(h)):Nn[h]!=null&&delete Nn[h]);return Nn[h]}function or(h){var j;if(h&&h._locale&&h._locale._abbr&&(h=h._locale._abbr),!h)return Rr;if(!c(h)){if(j=Ir(h),j)return j;h=[h]}return Wl(h)}function Yl(){return jt(Nn)}function es(h){var j,ut=h._a;return ut&&ot(h).overflow===-2&&(j=ut[rr]<0||ut[rr]>11?rr:ut[tr]<1||ut[tr]>Fr(ut[Yn],ut[rr])?tr:ut[zn]<0||ut[zn]>24||ut[zn]===24&&(ut[Zn]!==0||ut[ir]!==0||ut[gr]!==0)?zn:ut[Zn]<0||ut[Zn]>59?Zn:ut[ir]<0||ut[ir]>59?ir:ut[gr]<0||ut[gr]>999?gr:-1,ot(h)._overflowDayOfYear&&(jtr)&&(j=tr),ot(h)._overflowWeeks&&j===-1&&(j=Io),ot(h)._overflowWeekday&&j===-1&&(j=No),ot(h).overflow=j),h}var Gl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Kl=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Xl=/Z|[+-]\d\d(?::?\d\d)?/,Nr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ts=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ql=/^\/?Date\((-?\d+)/i,Zl=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Jl={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function zs(h){var j,ut,ft=h._i,bt=Gl.exec(ft)||Kl.exec(ft),Ut,en,xn,wn,On=Nr.length,Gn=ts.length;if(bt){for(ot(h).iso=!0,j=0,ut=On;jPr(en)||h._dayOfYear===0)&&(ot(h)._overflowDayOfYear=!0),ut=Tr(en,0,h._dayOfYear),h._a[rr]=ut.getUTCMonth(),h._a[tr]=ut.getUTCDate()),j=0;j<3&&h._a[j]==null;++j)h._a[j]=ft[j]=bt[j];for(;j<7;j++)h._a[j]=ft[j]=h._a[j]==null?j===2?1:0:h._a[j];h._a[zn]===24&&h._a[Zn]===0&&h._a[ir]===0&&h._a[gr]===0&&(h._nextDay=!0,h._a[zn]=0),h._d=(h._useUTC?Tr:Xo).apply(null,ft),Ut=h._useUTC?h._d.getUTCDay():h._d.getDay(),h._tzm!=null&&h._d.setUTCMinutes(h._d.getUTCMinutes()-h._tzm),h._nextDay&&(h._a[zn]=24),h._w&&typeof h._w.d<"u"&&h._w.d!==Ut&&(ot(h).weekdayMismatch=!0)}}function au(h){var j,ut,ft,bt,Ut,en,xn,wn,On;j=h._w,j.GG!=null||j.W!=null||j.E!=null?(Ut=1,en=4,ut=_r(j.GG,h._a[Yn],kr(Ln(),1,4).year),ft=_r(j.W,1),bt=_r(j.E,1),(bt<1||bt>7)&&(wn=!0)):(Ut=h._locale._week.dow,en=h._locale._week.doy,On=kr(Ln(),Ut,en),ut=_r(j.gg,h._a[Yn],On.year),ft=_r(j.w,On.week),j.d!=null?(bt=j.d,(bt<0||bt>6)&&(wn=!0)):j.e!=null?(bt=j.e+Ut,(j.e<0||j.e>6)&&(wn=!0)):bt=Ut),ft<1||ft>sr(ut,Ut,en)?ot(h)._overflowWeeks=!0:wn!=null?ot(h)._overflowWeekday=!0:(xn=js(ut,ft,bt,Ut,en),h._a[Yn]=xn.year,h._dayOfYear=xn.dayOfYear)}o.ISO_8601=function(){},o.RFC_2822=function(){};function rs(h){if(h._f===o.ISO_8601){zs(h);return}if(h._f===o.RFC_2822){Hs(h);return}h._a=[],ot(h).empty=!0;var j=""+h._i,ut,ft,bt,Ut,en,xn=j.length,wn=0,On,Gn;for(bt=$t(h._f,h._locale).match(Xt)||[],Gn=bt.length,ut=0;ut0&&ot(h).unusedInput.push(en),j=j.slice(j.indexOf(ft)+ft.length),wn+=ft.length),mt[Ut]?(ft?ot(h).empty=!1:ot(h).unusedTokens.push(Ut),dr(Ut,ft,h)):h._strict&&!ft&&ot(h).unusedTokens.push(Ut);ot(h).charsLeftOver=xn-wn,j.length>0&&ot(h).unusedInput.push(j),h._a[zn]<=12&&ot(h).bigHour===!0&&h._a[zn]>0&&(ot(h).bigHour=void 0),ot(h).parsedDateParts=h._a.slice(0),ot(h).meridiem=h._meridiem,h._a[zn]=lu(h._locale,h._a[zn],h._meridiem),On=ot(h).era,On!==null&&(h._a[Yn]=h._locale.erasConvertYear(On,h._a[Yn])),ns(h),es(h)}function lu(h,j,ut){var ft;return ut==null?j:h.meridiemHour!=null?h.meridiemHour(j,ut):(h.isPM!=null&&(ft=h.isPM(ut),ft&&j<12&&(j+=12),!ft&&j===12&&(j=0)),j)}function uu(h){var j,ut,ft,bt,Ut,en,xn=!1,wn=h._f.length;if(wn===0){ot(h).invalidFormat=!0,h._d=new Date(NaN);return}for(bt=0;btthis?this:h:nt()});function qs(h,j){var ut,ft;if(j.length===1&&c(j[0])&&(j=j[0]),!j.length)return Ln();for(ut=j[0],ft=1;ftthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ru(){if(!b(this._isDSTShifted))return this._isDSTShifted;var h={},j;return vt(h,this),h=Ys(h),h._a?(j=h._isUTC?tt(h._a):Ln(h._a),this._isDSTShifted=this.isValid()&&xu(h._a,j.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Du(){return this.isValid()?!this._isUTC:!1}function Mu(){return this.isValid()?this._isUTC:!1}function Xs(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ou=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Fu=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Jn(h,j){var ut=h,ft=null,bt,Ut,en;return Vr(h)?ut={ms:h._milliseconds,d:h._days,M:h._months}:_e(h)||!isNaN(+h)?(ut={},j?ut[j]=+h:ut.milliseconds=+h):(ft=Ou.exec(h))?(bt=ft[1]==="-"?-1:1,ut={y:0,d:mn(ft[tr])*bt,h:mn(ft[zn])*bt,m:mn(ft[Zn])*bt,s:mn(ft[ir])*bt,ms:mn(is(ft[gr]*1e3))*bt}):(ft=Fu.exec(h))?(bt=ft[1]==="-"?-1:1,ut={y:yr(ft[2],bt),M:yr(ft[3],bt),w:yr(ft[4],bt),d:yr(ft[5],bt),h:yr(ft[6],bt),m:yr(ft[7],bt),s:yr(ft[8],bt)}):ut==null?ut={}:typeof ut=="object"&&("from"in ut||"to"in ut)&&(en=Lu(Ln(ut.from),Ln(ut.to)),ut={},ut.ms=en.milliseconds,ut.M=en.months),Ut=new jr(ut),Vr(h)&&g(h,"_locale")&&(Ut._locale=h._locale),Vr(h)&&g(h,"_isValid")&&(Ut._isValid=h._isValid),Ut}Jn.fn=jr.prototype,Jn.invalid=Su;function yr(h,j){var ut=h&&parseFloat(h.replace(",","."));return(isNaN(ut)?0:ut)*j}function Qs(h,j){var ut={};return ut.months=j.month()-h.month()+(j.year()-h.year())*12,h.clone().add(ut.months,"M").isAfter(j)&&--ut.months,ut.milliseconds=+j-+h.clone().add(ut.months,"M"),ut}function Lu(h,j){var ut;return h.isValid()&&j.isValid()?(j=os(j,h),h.isBefore(j)?ut=Qs(h,j):(ut=Qs(j,h),ut.milliseconds=-ut.milliseconds,ut.months=-ut.months),ut):{milliseconds:0,months:0}}function Zs(h,j){return function(ut,ft){var bt,Ut;return ft!==null&&!isNaN(+ft)&&(Ct(j,"moment()."+j+"(period, number) is deprecated. Please use moment()."+j+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),Ut=ut,ut=ft,ft=Ut),bt=Jn(ut,ft),Js(this,bt,h),this}}function Js(h,j,ut,ft){var bt=j._milliseconds,Ut=is(j._days),en=is(j._months);h.isValid()&&(ft=ft??!0,en&&Fs(h,Dn(h,"Month")+en*ut),Ut&&Qn(h,"Date",Dn(h,"Date")+Ut*ut),bt&&h._d.setTime(h._d.valueOf()+bt*ut),ft&&o.updateOffset(h,Ut||en))}var Iu=Zs(1,"add"),Nu=Zs(-1,"subtract");function eo(h){return typeof h=="string"||h instanceof String}function ju(h){return ct(h)||rt(h)||eo(h)||_e(h)||Bu(h)||Vu(h)||h===null||h===void 0}function Vu(h){var j=d(h)&&!_(h),ut=!1,ft=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],bt,Ut,en=ft.length;for(bt=0;btut.valueOf():ut.valueOf()9999?Ot(ut,j?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Bt(Date.prototype.toISOString)?j?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ot(ut,"Z")):Ot(ut,j?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function _c(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var h="moment",j="",ut,ft,bt,Ut;return this.isLocal()||(h=this.utcOffset()===0?"moment.utc":"moment.parseZone",j="Z"),ut="["+h+'("]',ft=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",bt="-MM-DD[T]HH:mm:ss.SSS",Ut=j+'[")]',this.format(ut+ft+bt+Ut)}function _d(h){h||(h=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var j=Ot(this,h);return this.localeData().postformat(j)}function _h(h,j){return this.isValid()&&(ct(h)&&h.isValid()||Ln(h).isValid())?Jn({to:this,from:h}).locale(this.locale()).humanize(!j):this.localeData().invalidDate()}function _f(h){return this.from(Ln(),h)}function ep(h,j){return this.isValid()&&(ct(h)&&h.isValid()||Ln(h).isValid())?Jn({from:this,to:h}).locale(this.locale()).humanize(!j):this.localeData().invalidDate()}function tp(h){return this.to(Ln(),h)}function to(h){var j;return h===void 0?this._locale._abbr:(j=or(h),j!=null&&(this._locale=j),this)}var no=ht("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(h){return h===void 0?this.localeData():this.locale(h)});function ro(){return this._locale}var Ur=1e3,Sr=60*Ur,$r=60*Sr,io=(365*400+97)*24*$r;function xr(h,j){return(h%j+j)%j}function so(h,j,ut){return h<100&&h>=0?new Date(h+400,j,ut)-io:new Date(h,j,ut).valueOf()}function oo(h,j,ut){return h<100&&h>=0?Date.UTC(h+400,j,ut)-io:Date.UTC(h,j,ut)}function np(h){var j,ut;if(h=nn(h),h===void 0||h==="millisecond"||!this.isValid())return this;switch(ut=this._isUTC?oo:so,h){case"year":j=ut(this.year(),0,1);break;case"quarter":j=ut(this.year(),this.month()-this.month()%3,1);break;case"month":j=ut(this.year(),this.month(),1);break;case"week":j=ut(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":j=ut(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":j=ut(this.year(),this.month(),this.date());break;case"hour":j=this._d.valueOf(),j-=xr(j+(this._isUTC?0:this.utcOffset()*Sr),$r);break;case"minute":j=this._d.valueOf(),j-=xr(j,Sr);break;case"second":j=this._d.valueOf(),j-=xr(j,Ur);break}return this._d.setTime(j),o.updateOffset(this,!0),this}function rp(h){var j,ut;if(h=nn(h),h===void 0||h==="millisecond"||!this.isValid())return this;switch(ut=this._isUTC?oo:so,h){case"year":j=ut(this.year()+1,0,1)-1;break;case"quarter":j=ut(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":j=ut(this.year(),this.month()+1,1)-1;break;case"week":j=ut(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":j=ut(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":j=ut(this.year(),this.month(),this.date()+1)-1;break;case"hour":j=this._d.valueOf(),j+=$r-xr(j+(this._isUTC?0:this.utcOffset()*Sr),$r)-1;break;case"minute":j=this._d.valueOf(),j+=Sr-xr(j,Sr)-1;break;case"second":j=this._d.valueOf(),j+=Ur-xr(j,Ur)-1;break}return this._d.setTime(j),o.updateOffset(this,!0),this}function ip(){return this._d.valueOf()-(this._offset||0)*6e4}function sp(){return Math.floor(this.valueOf()/1e3)}function op(){return new Date(this.valueOf())}function ap(){var h=this;return[h.year(),h.month(),h.date(),h.hour(),h.minute(),h.second(),h.millisecond()]}function lp(){var h=this;return{years:h.year(),months:h.month(),date:h.date(),hours:h.hours(),minutes:h.minutes(),seconds:h.seconds(),milliseconds:h.milliseconds()}}function up(){return this.isValid()?this.toISOString():null}function cp(){return it(this)}function dp(){return lt({},ot(this))}function hp(){return ot(this).overflow}function fp(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}At("N",0,0,"eraAbbr"),At("NN",0,0,"eraAbbr"),At("NNN",0,0,"eraAbbr"),At("NNNN",0,0,"eraName"),At("NNNNN",0,0,"eraNarrow"),At("y",["y",1],"yo","eraYear"),At("y",["yy",2],0,"eraYear"),At("y",["yyy",3],0,"eraYear"),At("y",["yyyy",4],0,"eraYear"),hn("N",ls),hn("NN",ls),hn("NNN",ls),hn("NNNN",Ep),hn("NNNNN",wp),An(["N","NN","NNN","NNNN","NNNNN"],function(h,j,ut,ft){var bt=ut._locale.erasParse(h,ft,ut._strict);bt?ot(ut).era=bt:ot(ut).invalidEra=h}),hn("y",Fn),hn("yy",Fn),hn("yyy",Fn),hn("yyyy",Fn),hn("yo",Pp),An(["y","yy","yyy","yyyy"],Yn),An(["yo"],function(h,j,ut,ft){var bt;ut._locale._eraYearOrdinalRegex&&(bt=h.match(ut._locale._eraYearOrdinalRegex)),ut._locale.eraYearOrdinalParse?j[Yn]=ut._locale.eraYearOrdinalParse(h,bt):j[Yn]=parseInt(h,10)});function pp(h,j){var ut,ft,bt,Ut=this._eras||or("en")._eras;for(ut=0,ft=Ut.length;ut=0)return Ut[ft]}function gp(h,j){var ut=h.since<=h.until?1:-1;return j===void 0?o(h.since).year():o(h.since).year()+(j-h.offset)*ut}function yp(){var h,j,ut,ft=this.localeData().eras();for(h=0,j=ft.length;hUt&&(j=Ut),Op.call(this,h,j,ut,ft,bt))}function Op(h,j,ut,ft,bt){var Ut=js(h,j,ut,ft,bt),en=Tr(Ut.year,0,Ut.dayOfYear);return this.year(en.getUTCFullYear()),this.month(en.getUTCMonth()),this.date(en.getUTCDate()),this}At("Q",0,"Qo","quarter"),Kt("quarter","Q"),sn("quarter",7),hn("Q",mr),An("Q",function(h,j){j[rr]=(mn(h)-1)*3});function Fp(h){return h==null?Math.ceil((this.month()+1)/3):this.month((h-1)*3+this.month()%3)}At("D",["DD",2],"Do","date"),Kt("date","D"),sn("date",9),hn("D",It),hn("DD",It,Jt),hn("Do",function(h,j){return h?j._dayOfMonthOrdinalParse||j._ordinalParse:j._dayOfMonthOrdinalParseLenient}),An(["D","DD"],tr),An("Do",function(h,j){j[tr]=mn(h.match(It)[0])});var lo=Mn("Date",!0);At("DDD",["DDDD",3],"DDDo","dayOfYear"),Kt("dayOfYear","DDD"),sn("dayOfYear",4),hn("DDD",yn),hn("DDDD",un),An(["DDD","DDDD"],function(h,j,ut){ut._dayOfYear=mn(h)});function Lp(h){var j=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return h==null?j:this.add(h-j,"d")}At("m",["mm",2],0,"minute"),Kt("minute","m"),sn("minute",14),hn("m",It),hn("mm",It,Jt),An(["m","mm"],Zn);var Ip=Mn("Minutes",!1);At("s",["ss",2],0,"second"),Kt("second","s"),sn("second",15),hn("s",It),hn("ss",It,Jt),An(["s","ss"],ir);var Np=Mn("Seconds",!1);At("S",0,0,function(){return~~(this.millisecond()/100)}),At(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),At(0,["SSS",3],0,"millisecond"),At(0,["SSSS",4],0,function(){return this.millisecond()*10}),At(0,["SSSSS",5],0,function(){return this.millisecond()*100}),At(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),At(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),At(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),At(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Kt("millisecond","ms"),sn("millisecond",16),hn("S",yn,mr),hn("SS",yn,Jt),hn("SSS",yn,un);var fr,uo;for(fr="SSSS";fr.length<=9;fr+="S")hn(fr,Fn);function jp(h,j){j[gr]=mn(("0."+h)*1e3)}for(fr="S";fr.length<=9;fr+="S")An(fr,jp);uo=Mn("Milliseconds",!1),At("z",0,0,"zoneAbbr"),At("zz",0,0,"zoneName");function Vp(){return this._isUTC?"UTC":""}function Bp(){return this._isUTC?"Coordinated Universal Time":""}var dn=xt.prototype;dn.add=Iu,dn.calendar=Wu,dn.clone=zu,dn.diff=Qu,dn.endOf=rp,dn.format=_d,dn.from=_h,dn.fromNow=_f,dn.to=ep,dn.toNow=tp,dn.get=Pn,dn.invalidAt=hp,dn.isAfter=Hu,dn.isBefore=Yu,dn.isBetween=Gu,dn.isSame=qu,dn.isSameOrAfter=Ku,dn.isSameOrBefore=Xu,dn.isValid=cp,dn.lang=no,dn.locale=to,dn.localeData=ro,dn.max=pu,dn.min=fu,dn.parsingFlags=dp,dn.set=jn,dn.startOf=np,dn.subtract=Nu,dn.toArray=ap,dn.toObject=lp,dn.toDate=op,dn.toISOString=Ju,dn.inspect=_c,typeof Symbol<"u"&&Symbol.for!=null&&(dn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),dn.toJSON=up,dn.toString=Zu,dn.unix=sp,dn.valueOf=ip,dn.creationData=fp,dn.eraName=yp,dn.eraNarrow=vp,dn.eraAbbr=_p,dn.eraYear=Sp,dn.year=Ns,dn.isLeapYear=Ko,dn.weekYear=Tp,dn.isoWeekYear=kp,dn.quarter=dn.quarters=Fp,dn.month=Ls,dn.daysInMonth=Yo,dn.week=dn.weeks=ga,dn.isoWeek=dn.isoWeeks=_a,dn.weeksInYear=Dp,dn.weeksInWeekYear=Mp,dn.isoWeeksInYear=Cp,dn.isoWeeksInISOWeekYear=Rp,dn.date=lo,dn.day=dn.days=Rl,dn.weekday=Dl,dn.isoWeekday=Ml,dn.dayOfYear=Lp,dn.hour=dn.hours=Bl,dn.minute=dn.minutes=Ip,dn.second=dn.seconds=Np,dn.millisecond=dn.milliseconds=uo,dn.utcOffset=bu,dn.utc=wu,dn.local=Pu,dn.parseZone=Tu,dn.hasAlignedHourOffset=ku,dn.isDST=Cu,dn.isLocal=Du,dn.isUtcOffset=Mu,dn.isUtc=Xs,dn.isUTC=Xs,dn.zoneAbbr=Vp,dn.zoneName=Bp,dn.dates=ht("dates accessor is deprecated. Use date instead.",lo),dn.months=ht("months accessor is deprecated. Use month instead",Ls),dn.years=ht("years accessor is deprecated. Use year instead",Ns),dn.zone=ht("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Eu),dn.isDSTShifted=ht("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ru);function Up(h){return Ln(h*1e3)}function $p(){return Ln.apply(null,arguments).parseZone()}function co(h){return h}var Rn=Wt.prototype;Rn.calendar=Ht,Rn.longDateFormat=dt,Rn.invalidDate=St,Rn.ordinal=Nt,Rn.preparse=co,Rn.postformat=co,Rn.relativeTime=an,Rn.pastFuture=Qt,Rn.set=Lt,Rn.eras=pp,Rn.erasParse=mp,Rn.erasConvertYear=gp,Rn.erasAbbrRegex=Ap,Rn.erasNameRegex=xp,Rn.erasNarrowRegex=bp,Rn.months=$o,Rn.monthsShort=Wo,Rn.monthsParse=Ho,Rn.monthsRegex=qo,Rn.monthsShortRegex=Go,Rn.week=Qo,Rn.firstDayOfYear=na,Rn.firstDayOfWeek=Jo,Rn.weekdays=Al,Rn.weekdaysMin=Pl,Rn.weekdaysShort=El,Rn.weekdaysParse=Cl,Rn.weekdaysRegex=Ol,Rn.weekdaysShortRegex=Fl,Rn.weekdaysMinRegex=Ll,Rn.isPM=Nl,Rn.meridiem=Ul;function zr(h,j,ut,ft){var bt=or(),Ut=tt().set(ft,j);return bt[ut](Ut,h)}function ho(h,j,ut){if(_e(h)&&(j=h,h=void 0),h=h||"",j!=null)return zr(h,j,ut,"month");var ft,bt=[];for(ft=0;ft<12;ft++)bt[ft]=zr(h,ft,ut,"month");return bt}function cs(h,j,ut,ft){typeof h=="boolean"?(_e(j)&&(ut=j,j=void 0),j=j||""):(j=h,ut=j,h=!1,_e(j)&&(ut=j,j=void 0),j=j||"");var bt=or(),Ut=h?bt._week.dow:0,en,xn=[];if(ut!=null)return zr(j,(ut+Ut)%7,ft,"day");for(en=0;en<7;en++)xn[en]=zr(j,(en+Ut)%7,ft,"day");return xn}function Wp(h,j){return ho(h,j,"months")}function zp(h,j){return ho(h,j,"monthsShort")}function Hp(h,j,ut){return cs(h,j,ut,"weekdays")}function Yp(h,j,ut){return cs(h,j,ut,"weekdaysShort")}function Gp(h,j,ut){return cs(h,j,ut,"weekdaysMin")}hr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(h){var j=h%10,ut=mn(h%100/10)===1?"th":j===1?"st":j===2?"nd":j===3?"rd":"th";return h+ut}}),o.lang=ht("moment.lang is deprecated. Use moment.locale instead.",hr),o.langData=ht("moment.langData is deprecated. Use moment.localeData instead.",or);var ar=Math.abs;function qp(){var h=this._data;return this._milliseconds=ar(this._milliseconds),this._days=ar(this._days),this._months=ar(this._months),h.milliseconds=ar(h.milliseconds),h.seconds=ar(h.seconds),h.minutes=ar(h.minutes),h.hours=ar(h.hours),h.months=ar(h.months),h.years=ar(h.years),this}function fo(h,j,ut,ft){var bt=Jn(j,ut);return h._milliseconds+=ft*bt._milliseconds,h._days+=ft*bt._days,h._months+=ft*bt._months,h._bubble()}function Kp(h,j){return fo(this,h,j,1)}function Xp(h,j){return fo(this,h,j,-1)}function po(h){return h<0?Math.floor(h):Math.ceil(h)}function Qp(){var h=this._milliseconds,j=this._days,ut=this._months,ft=this._data,bt,Ut,en,xn,wn;return h>=0&&j>=0&&ut>=0||h<=0&&j<=0&&ut<=0||(h+=po(ds(ut)+j)*864e5,j=0,ut=0),ft.milliseconds=h%1e3,bt=_n(h/1e3),ft.seconds=bt%60,Ut=_n(bt/60),ft.minutes=Ut%60,en=_n(Ut/60),ft.hours=en%24,j+=_n(en/24),wn=_n(mo(j)),ut+=wn,j-=po(ds(wn)),xn=_n(ut/12),ut%=12,ft.days=j,ft.months=ut,ft.years=xn,this}function mo(h){return h*4800/146097}function ds(h){return h*146097/4800}function Zp(h){if(!this.isValid())return NaN;var j,ut,ft=this._milliseconds;if(h=nn(h),h==="month"||h==="quarter"||h==="year")switch(j=this._days+ft/864e5,ut=this._months+mo(j),h){case"month":return ut;case"quarter":return ut/3;case"year":return ut/12}else switch(j=this._days+Math.round(ds(this._months)),h){case"week":return j/7+ft/6048e5;case"day":return j+ft/864e5;case"hour":return j*24+ft/36e5;case"minute":return j*1440+ft/6e4;case"second":return j*86400+ft/1e3;case"millisecond":return Math.floor(j*864e5)+ft;default:throw new Error("Unknown unit "+h)}}function Jp(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+mn(this._months/12)*31536e6:NaN}function lr(h){return function(){return this.as(h)}}var em=lr("ms"),tm=lr("s"),nm=lr("m"),rm=lr("h"),im=lr("d"),sm=lr("w"),om=lr("M"),am=lr("Q"),lm=lr("y");function um(){return Jn(this)}function cm(h){return h=nn(h),this.isValid()?this[h+"s"]():NaN}function vr(h){return function(){return this.isValid()?this._data[h]:NaN}}var dm=vr("milliseconds"),hm=vr("seconds"),fm=vr("minutes"),pm=vr("hours"),mm=vr("days"),gm=vr("months"),ym=vr("years");function vm(){return _n(this.days()/7)}var ur=Math.round,Ar={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _m(h,j,ut,ft,bt){return bt.relativeTime(j||1,!!ut,h,ft)}function Sm(h,j,ut,ft){var bt=Jn(h).abs(),Ut=ur(bt.as("s")),en=ur(bt.as("m")),xn=ur(bt.as("h")),wn=ur(bt.as("d")),On=ur(bt.as("M")),Gn=ur(bt.as("w")),cr=ur(bt.as("y")),pr=Ut<=ut.ss&&["s",Ut]||Ut0,pr[4]=ft,_m.apply(null,pr)}function xm(h){return h===void 0?ur:typeof h=="function"?(ur=h,!0):!1}function Am(h,j){return Ar[h]===void 0?!1:j===void 0?Ar[h]:(Ar[h]=j,h==="s"&&(Ar.ss=j-1),!0)}function bm(h,j){if(!this.isValid())return this.localeData().invalidDate();var ut=!1,ft=Ar,bt,Ut;return typeof h=="object"&&(j=h,h=!1),typeof h=="boolean"&&(ut=h),typeof j=="object"&&(ft=Object.assign({},Ar,j),j.s!=null&&j.ss==null&&(ft.ss=j.s-1)),bt=this.localeData(),Ut=Sm(this,!ut,ft,bt),ut&&(Ut=bt.pastFuture(+this,Ut)),bt.postformat(Ut)}var hs=Math.abs;function br(h){return(h>0)-(h<0)||+h}function Hr(){if(!this.isValid())return this.localeData().invalidDate();var h=hs(this._milliseconds)/1e3,j=hs(this._days),ut=hs(this._months),ft,bt,Ut,en,xn=this.asSeconds(),wn,On,Gn,cr;return xn?(ft=_n(h/60),bt=_n(ft/60),h%=60,ft%=60,Ut=_n(ut/12),ut%=12,en=h?h.toFixed(3).replace(/\.?0+$/,""):"",wn=xn<0?"-":"",On=br(this._months)!==br(xn)?"-":"",Gn=br(this._days)!==br(xn)?"-":"",cr=br(this._milliseconds)!==br(xn)?"-":"",wn+"P"+(Ut?On+Ut+"Y":"")+(ut?On+ut+"M":"")+(j?Gn+j+"D":"")+(bt||ft||h?"T":"")+(bt?cr+bt+"H":"")+(ft?cr+ft+"M":"")+(h?cr+en+"S":"")):"P0D"}var kn=jr.prototype;kn.isValid=_u,kn.abs=qp,kn.add=Kp,kn.subtract=Xp,kn.as=Zp,kn.asMilliseconds=em,kn.asSeconds=tm,kn.asMinutes=nm,kn.asHours=rm,kn.asDays=im,kn.asWeeks=sm,kn.asMonths=om,kn.asQuarters=am,kn.asYears=lm,kn.valueOf=Jp,kn._bubble=Qp,kn.clone=um,kn.get=cm,kn.milliseconds=dm,kn.seconds=hm,kn.minutes=fm,kn.hours=pm,kn.days=mm,kn.weeks=vm,kn.months=gm,kn.years=ym,kn.humanize=bm,kn.toISOString=Hr,kn.toString=Hr,kn.toJSON=Hr,kn.locale=to,kn.localeData=ro,kn.toIsoString=ht("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Hr),kn.lang=no,At("X",0,0,"unix"),At("x",0,0,"valueOf"),hn("x",Cn),hn("X",Vn),An("X",function(h,j,ut){ut._d=new Date(parseFloat(h)*1e3)}),An("x",function(h,j,ut){ut._d=new Date(mn(h))});//! moment.js return o.version="2.29.4",a(Ln),o.fn=dn,o.min=mu,o.max=gu,o.now=yu,o.utc=tt,o.unix=Up,o.months=Wp,o.isDate=rt,o.locale=hr,o.invalid=nt,o.duration=Jn,o.isMoment=ct,o.weekdays=Hp,o.parseZone=$p,o.localeData=or,o.isDuration=Vr,o.monthsShort=zp,o.weekdaysMin=Gp,o.defineLocale=_i,o.updateLocale=Hl,o.locales=Yl,o.weekdaysShort=Yp,o.normalizeUnits=nn,o.relativeTimeRounding=xm,o.relativeTimeThreshold=Am,o.calendarFormat=$u,o.prototype=dn,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o})})(moment$1);var momentExports=moment$1.exports;const moment=getDefaultExportFromCjs(momentExports);function Message$1({index:e,name:i,message:s,isUser:o}){return jsx(motion.div,{className:o?"userMessage messageContainer":"messageContainer",initial:{y:150,opacity:0},animate:{y:0,opacity:1},transition:{duration:.8,delay:e*.1,ease:[0,.71,.2,1.01]},children:jsxs("div",{className:"message",children:[jsx("img",{src:o?userPic:chatPic,className:"profilePic"}),jsx("div",{className:"messageContent",children:jsxs("span",{className:"messageDetails",children:[jsx("p",{className:"name",children:jsx("span",{className:"timestamp",children:moment().format("MM/DD/YYYY h:mm a")})}),jsx("p",{className:"messageText",children:s})]})})]})})}const chatbot="",typingBubble="";function TypingBubble(){return jsxs("div",{className:"typing",children:[jsx("div",{className:"typing__dot"}),jsx("div",{className:"typing__dot"}),jsx("div",{className:"typing__dot"})]})}function ChatBot({currentFile:e,setUploadedFiles:i,setCurrentFile:s,setPreview:o}){const a="https://saimon-backend-gukinumu4q-ey.a.run.app/",[c,d]=reactExports.useState([]);reactExports.useState("");const[g,_]=reactExports.useState(!1),[b,_e]=reactExports.useState("/register"),[rt,st]=reactExports.useState(null),lt=useNavigate();reactExports.useEffect(()=>{localStorage.getItem("access_token")?(_e("/profile"),st(localStorage.getItem("access_token"))):lt("/register")},[]);const tt=reactExports.useRef(),$=reactExports.useRef();reactExports.useRef();const ot=yt=>{var xt,ct;yt.preventDefault();const vt=tt.current.value;tt.current.value!==""&&(d(pt=>[...pt,{name:"User",message:vt,isUser:!0}]),nt(vt)),tt.current.value="",(ct=(xt=$.current)==null?void 0:xt.lastElementChild)==null||ct.scrollIntoView({behavior:"smooth"})},et=yt=>{let vt=new FormData;vt.append("document",yt);let xt={method:"post",maxBodyLength:1/0,url:`${a}users/document/`,headers:{Authorization:`Bearer ${rt}`},data:vt};axios$1.request(xt).then(ct=>{console.log(JSON.stringify(ct.data)),alert("File Uploaded")}).catch(ct=>{console.log(ct),alert("An Error has occurred or File Limit exceeded")})};function it(yt){const{files:vt}=yt.target;vt&&vt[0]&&(i(xt=>[...xt,vt]),s(vt[0]||null),et(vt[0]))}const nt=yt=>{axios$1.defaults.headers.post["Access-Control-Allow-Origin"]="*",_(!0);let vt=JSON.stringify({message:yt}),xt={method:"post",maxBodyLength:1/0,url:`${a}app/`,headers:{"Content-Type":"application/json",Authorization:`Bearer ${rt}`},data:vt};axios$1.request(xt).then(ct=>{console.log(JSON.stringify(ct.data.result)),_(!1),d(pt=>[...pt,{name:"Chat",message:ct.data.result,isUser:!1}])}).catch(ct=>{console.log(ct),ct.response.status===402?d(pt=>[...pt,{name:"Chat",message:"You have exceeded your usage limit, please upgrade your plan to continue!",isUser:!1}]):d(pt=>[...pt,{name:"Chat",message:"An Error has Occurred, Please Try again!",isUser:!1}])}).finally(()=>{_(!1)})},at=()=>{o(yt=>!yt)};return jsxs("div",{className:"chatBot",children:[jsxs("div",{className:"chatTitle",children:[jsx(Link,{to:b,children:jsx("button",{className:"titleBarButtons",children:jsx("img",{src:profile$1,alt:"Register or sign in"})})}),jsx("h4",{children:e&&e.name||"Title"}),jsx("button",{className:"titleBarButtons",onClick:at,children:jsx("img",{src:sidebar,alt:"toggle Side Preview"})})]}),jsxs("div",{className:"chatArea",ref:$,children:[c.map((yt,vt)=>jsx(Message$1,{index:vt,name:yt.name,message:yt.message,isUser:yt.isUser},vt)),jsx("div",{}),g?jsx(TypingBubble,{}):null]}),jsxs("form",{className:"inputBox",children:[jsx("input",{className:"textInput",placeholder:"Message",type:"text",ref:tt}),jsxs("div",{className:"uploadAndSubmit",children:[jsxs("div",{className:"fileInput",children:[jsx("input",{type:"file",id:"upload",onChange:it,multiple:!0,hidden:!0}),jsx("label",{className:"fileLabel",htmlFor:"upload",children:jsx("img",{src:attach,alt:"attachment"})})]}),jsx("button",{onClick:ot,className:"submit",children:jsx("img",{src:send,alt:"send"})})]})]})]})}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(i,s){module.exports=s()})(globalThis,()=>(()=>{var __webpack_modules__=[,(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VerbosityLevel=i.Util=i.UnknownErrorException=i.UnexpectedResponseException=i.UNSUPPORTED_FEATURES=i.TextRenderingMode=i.StreamType=i.RenderingIntentFlag=i.PermissionFlag=i.PasswordResponses=i.PasswordException=i.PageActionEventType=i.OPS=i.MissingPDFException=i.LINE_FACTOR=i.LINE_DESCENT_FACTOR=i.InvalidPDFException=i.ImageKind=i.IDENTITY_MATRIX=i.FormatError=i.FontType=i.FeatureTest=i.FONT_IDENTITY_MATRIX=i.DocumentActionEventType=i.CMapCompressionType=i.BaseException=i.AnnotationType=i.AnnotationStateModelType=i.AnnotationReviewState=i.AnnotationReplyType=i.AnnotationMode=i.AnnotationMarkedState=i.AnnotationFlag=i.AnnotationFieldFlag=i.AnnotationEditorType=i.AnnotationEditorPrefix=i.AnnotationEditorParamsType=i.AnnotationBorderStyleType=i.AnnotationActionEventType=i.AbortException=void 0,i.arrayByteLength=Zt,i.arraysToBytes=an,i.assert=gt,i.bytesToString=kt,i.createPromiseCapability=un,i.createValidAbsoluteUrl=At,i.escapeString=mn,i.getModificationDate=Jt,i.getVerbosityLevel=Ht,i.info=qt,i.isArrayBuffer=jn,i.isArrayEqual=mr,i.isAscii=Mn,i.objectFromMap=Kt,i.objectSize=tn,i.setVerbosityLevel=Ft,i.shadow=Rt,i.string32=Qt,i.stringToBytes=Nt,i.stringToPDFString=_n,i.stringToUTF16BEString=Dn,i.stringToUTF8String=Qn,i.unreachable=Tt,i.utf8StringToString=Pn,i.warn=Xt,s(2);const o=[1,0,0,1,0,0];i.IDENTITY_MATRIX=o;const a=[.001,0,0,.001,0,0];i.FONT_IDENTITY_MATRIX=a;const c=1.35;i.LINE_FACTOR=c;const d=.35;i.LINE_DESCENT_FACTOR=d;const g={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};i.RenderingIntentFlag=g;const _={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};i.AnnotationMode=_;const b="pdfjs_internal_editor_";i.AnnotationEditorPrefix=b;const _e={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};i.AnnotationEditorType=_e;const rt={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};i.AnnotationEditorParamsType=rt;const st={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};i.PermissionFlag=st;const lt={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};i.TextRenderingMode=lt;const tt={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};i.ImageKind=tt;const $={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};i.AnnotationType=$;const ot={MARKED:"Marked",REVIEW:"Review"};i.AnnotationStateModelType=ot;const et={MARKED:"Marked",UNMARKED:"Unmarked"};i.AnnotationMarkedState=et;const it={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};i.AnnotationReviewState=it;const nt={GROUP:"Group",REPLY:"R"};i.AnnotationReplyType=nt;const at={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};i.AnnotationFlag=at;const yt={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};i.AnnotationFieldFlag=yt;const vt={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};i.AnnotationBorderStyleType=vt;const xt={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};i.AnnotationActionEventType=xt;const ct={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};i.DocumentActionEventType=ct;const pt={O:"PageOpen",C:"PageClose"};i.PageActionEventType=pt;const ht={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};i.StreamType=ht;const Et={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};i.FontType=Et;const Ct={ERRORS:0,WARNINGS:1,INFOS:5};i.VerbosityLevel=Ct;const Bt={NONE:0,BINARY:1,STREAM:2};i.CMapCompressionType=Bt;const Lt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};i.OPS=Lt;const Yt={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};i.UNSUPPORTED_FEATURES=Yt;const Wt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};i.PasswordResponses=Wt;let jt=Ct.WARNINGS;function Ft(Gt){Number.isInteger(Gt)&&(jt=Gt)}function Ht(){return jt}function qt(Gt){jt>=Ct.INFOS&&console.log(`Info: ${Gt}`)}function Xt(Gt){jt>=Ct.WARNINGS&&console.log(`Warning: ${Gt}`)}function Tt(Gt){throw new Error(Gt)}function gt(Gt,Vt){Gt||Tt(Vt)}function mt(Gt){if(!Gt)return!1;switch(Gt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function At(Gt,Vt=null,It=null){if(!Gt)return null;try{if(It&&typeof Gt=="string"){if(It.addDefaultProtocol&&Gt.startsWith("www.")){const pn=Gt.match(/\./g);pn&&pn.length>=2&&(Gt=`http://${Gt}`)}if(It.tryConvertEncoding)try{Gt=Qn(Gt)}catch{}}const cn=Vt?new URL(Gt,Vt):new URL(Gt);if(mt(cn))return cn}catch{}return null}function Rt(Gt,Vt,It){return Object.defineProperty(Gt,Vt,{value:It,enumerable:!0,configurable:!0,writable:!1}),It}const Dt=function(){function Vt(It,cn){this.constructor===Vt&&Tt("Cannot initialize BaseException."),this.message=It,this.name=cn}return Vt.prototype=new Error,Vt.constructor=Vt,Vt}();i.BaseException=Dt;class Ot extends Dt{constructor(Vt,It){super(Vt,"PasswordException"),this.code=It}}i.PasswordException=Ot;class $t extends Dt{constructor(Vt,It){super(Vt,"UnknownErrorException"),this.details=It}}i.UnknownErrorException=$t;class zt extends Dt{constructor(Vt){super(Vt,"InvalidPDFException")}}i.InvalidPDFException=zt;class dt extends Dt{constructor(Vt){super(Vt,"MissingPDFException")}}i.MissingPDFException=dt;class _t extends Dt{constructor(Vt,It){super(Vt,"UnexpectedResponseException"),this.status=It}}i.UnexpectedResponseException=_t;class St extends Dt{constructor(Vt){super(Vt,"FormatError")}}i.FormatError=St;class wt extends Dt{constructor(Vt){super(Vt,"AbortException")}}i.AbortException=wt;function kt(Gt){(typeof Gt!="object"||Gt===null||Gt.length===void 0)&&Tt("Invalid argument for bytesToString");const Vt=Gt.length,It=8192;if(Vt>24&255,Gt>>16&255,Gt>>8&255,Gt&255)}function tn(Gt){return Object.keys(Gt).length}function Kt(Gt){const Vt=Object.create(null);for(const[It,cn]of Gt)Vt[It]=cn;return Vt}function nn(){const Gt=new Uint8Array(4);return Gt[0]=1,new Uint32Array(Gt.buffer,0,1)[0]===1}function ln(){try{return new Function(""),!0}catch{return!1}}class Mt{static get isLittleEndian(){return Rt(this,"isLittleEndian",nn())}static get isEvalSupported(){return Rt(this,"isEvalSupported",ln())}static get isOffscreenCanvasSupported(){return Rt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}}i.FeatureTest=Mt;const sn=[...Array(256).keys()].map(Gt=>Gt.toString(16).padStart(2,"0"));class gn{static makeHexColor(Vt,It,cn){return`#${sn[Vt]}${sn[It]}${sn[cn]}`}static scaleMinMax(Vt,It){let cn;Vt[0]?(Vt[0]<0&&(cn=It[0],It[0]=It[1],It[1]=cn),It[0]*=Vt[0],It[1]*=Vt[0],Vt[3]<0&&(cn=It[2],It[2]=It[3],It[3]=cn),It[2]*=Vt[3],It[3]*=Vt[3]):(cn=It[0],It[0]=It[2],It[2]=cn,cn=It[1],It[1]=It[3],It[3]=cn,Vt[1]<0&&(cn=It[2],It[2]=It[3],It[3]=cn),It[2]*=Vt[1],It[3]*=Vt[1],Vt[2]<0&&(cn=It[0],It[0]=It[1],It[1]=cn),It[0]*=Vt[2],It[1]*=Vt[2]),It[0]+=Vt[4],It[1]+=Vt[4],It[2]+=Vt[5],It[3]+=Vt[5]}static transform(Vt,It){return[Vt[0]*It[0]+Vt[2]*It[1],Vt[1]*It[0]+Vt[3]*It[1],Vt[0]*It[2]+Vt[2]*It[3],Vt[1]*It[2]+Vt[3]*It[3],Vt[0]*It[4]+Vt[2]*It[5]+Vt[4],Vt[1]*It[4]+Vt[3]*It[5]+Vt[5]]}static applyTransform(Vt,It){const cn=Vt[0]*It[0]+Vt[1]*It[2]+It[4],pn=Vt[0]*It[1]+Vt[1]*It[3]+It[5];return[cn,pn]}static applyInverseTransform(Vt,It){const cn=It[0]*It[3]-It[1]*It[2],pn=(Vt[0]*It[3]-Vt[1]*It[2]+It[2]*It[5]-It[4]*It[3])/cn,yn=(-Vt[0]*It[1]+Vt[1]*It[0]+It[4]*It[1]-It[5]*It[0])/cn;return[pn,yn]}static getAxialAlignedBoundingBox(Vt,It){const cn=gn.applyTransform(Vt,It),pn=gn.applyTransform(Vt.slice(2,4),It),yn=gn.applyTransform([Vt[0],Vt[3]],It),Sn=gn.applyTransform([Vt[2],Vt[1]],It);return[Math.min(cn[0],pn[0],yn[0],Sn[0]),Math.min(cn[1],pn[1],yn[1],Sn[1]),Math.max(cn[0],pn[0],yn[0],Sn[0]),Math.max(cn[1],pn[1],yn[1],Sn[1])]}static inverseTransform(Vt){const It=Vt[0]*Vt[3]-Vt[1]*Vt[2];return[Vt[3]/It,-Vt[1]/It,-Vt[2]/It,Vt[0]/It,(Vt[2]*Vt[5]-Vt[4]*Vt[3])/It,(Vt[4]*Vt[1]-Vt[5]*Vt[0])/It]}static apply3dTransform(Vt,It){return[Vt[0]*It[0]+Vt[1]*It[1]+Vt[2]*It[2],Vt[3]*It[0]+Vt[4]*It[1]+Vt[5]*It[2],Vt[6]*It[0]+Vt[7]*It[1]+Vt[8]*It[2]]}static singularValueDecompose2dScale(Vt){const It=[Vt[0],Vt[2],Vt[1],Vt[3]],cn=Vt[0]*It[0]+Vt[1]*It[2],pn=Vt[0]*It[1]+Vt[1]*It[3],yn=Vt[2]*It[0]+Vt[3]*It[2],Sn=Vt[2]*It[1]+Vt[3]*It[3],En=(cn+Sn)/2,Fn=Math.sqrt((cn+Sn)**2-4*(cn*Sn-yn*pn))/2,Cn=En+Fn||1,bn=En-Fn||1;return[Math.sqrt(Cn),Math.sqrt(bn)]}static normalizeRect(Vt){const It=Vt.slice(0);return Vt[0]>Vt[2]&&(It[0]=Vt[2],It[2]=Vt[0]),Vt[1]>Vt[3]&&(It[1]=Vt[3],It[3]=Vt[1]),It}static intersect(Vt,It){const cn=Math.max(Math.min(Vt[0],Vt[2]),Math.min(It[0],It[2])),pn=Math.min(Math.max(Vt[0],Vt[2]),Math.max(It[0],It[2]));if(cn>pn)return null;const yn=Math.max(Math.min(Vt[1],Vt[3]),Math.min(It[1],It[3])),Sn=Math.min(Math.max(Vt[1],Vt[3]),Math.max(It[1],It[3]));return yn>Sn?null:[cn,yn,pn,Sn]}static bezierBoundingBox(Vt,It,cn,pn,yn,Sn,En,Fn){const Cn=[],bn=[[],[]];let In,Vn,Un,Tn,hn,Kn,er,Bn;for(let dr=0;dr<2;++dr){if(dr===0?(Vn=6*Vt-12*cn+6*yn,In=-3*Vt+9*cn-9*yn+3*En,Un=3*cn-3*Vt):(Vn=6*It-12*pn+6*Sn,In=-3*It+9*pn-9*Sn+3*Fn,Un=3*pn-3*It),Math.abs(In)<1e-12){if(Math.abs(Vn)<1e-12)continue;Tn=-Un/Vn,0="ï"){let It;if(Gt[0]==="þ"&&Gt[1]==="ÿ"?It="utf-16be":Gt[0]==="ÿ"&&Gt[1]==="þ"?It="utf-16le":Gt[0]==="ï"&&Gt[1]==="»"&&Gt[2]==="¿"&&(It="utf-8"),It)try{const cn=new TextDecoder(It,{fatal:!0}),pn=Nt(Gt);return cn.decode(pn)}catch(cn){Xt(`stringToPDFString: "${cn}".`)}}const Vt=[];for(let It=0,cn=Gt.length;ItVt===` `?"\\n":Vt==="\r"?"\\r":`\\${Vt}`)}function Mn(Gt){return/^[\x00-\x7F]*$/.test(Gt)}function Dn(Gt){const Vt=["þÿ"];for(let It=0,cn=Gt.length;It>8&255),String.fromCharCode(pn&255))}return Vt.join("")}function Qn(Gt){return decodeURIComponent(escape(Gt))}function Pn(Gt){return unescape(encodeURIComponent(Gt))}function jn(Gt){return typeof Gt=="object"&&Gt!==null&&Gt.byteLength!==void 0}function mr(Gt,Vt){if(Gt.length!==Vt.length)return!1;for(let It=0,cn=Gt.length;It{s(3)},(e,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isNodeJS=void 0;const s=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");i.isNodeJS=s},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var e,s,o,a,c,d,g,_,b,ms,rt,st;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(5),_display_utils=__w_pdfjs_require__(8),_font_loader=__w_pdfjs_require__(11),_canvas=__w_pdfjs_require__(12),_worker_options=__w_pdfjs_require__(15),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(16),_metadata=__w_pdfjs_require__(17),_optional_content_config=__w_pdfjs_require__(18),_transport_stream=__w_pdfjs_require__(19),_xfa_text=__w_pdfjs_require__(20);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:tt,NodeCMapReaderFactory:$,NodeStandardFontDataFactory:ot}=__w_pdfjs_require__(21);exports.DefaultCanvasFactory=DefaultCanvasFactory=tt,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=$,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=ot}let createPDFNetworkStream;function setPDFNetworkStreamFactory(tt){createPDFNetworkStream=tt}function getDocument(tt){const $=new PDFDocumentLoadingTask;let ot;if(typeof tt=="string"||tt instanceof URL)ot={url:tt};else if((0,_util.isArrayBuffer)(tt))ot={data:tt};else if(tt instanceof PDFDataRangeTransport)ot={range:tt};else{if(typeof tt!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!tt.url&&!tt.data&&!tt.range)throw new Error("Invalid parameter object: need either .data, .range or .url");ot=tt}const et=Object.create(null);let it=null,nt=null;for(const yt in ot){const vt=ot[yt];switch(yt){case"url":if(typeof window<"u")try{et[yt]=new URL(vt,window.location).href;continue}catch(xt){(0,_util.warn)(`Cannot create valid URL: "${xt}".`)}else if(typeof vt=="string"||vt instanceof URL){et[yt]=vt.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":it=vt;continue;case"worker":nt=vt;continue;case"data":if(_is_node.isNodeJS&&typeof Buffer<"u"&&vt instanceof Buffer)et[yt]=new Uint8Array(vt);else{if(vt instanceof Uint8Array)break;if(typeof vt=="string")et[yt]=(0,_util.stringToBytes)(vt);else if(typeof vt=="object"&&vt!==null&&!isNaN(vt.length))et[yt]=new Uint8Array(vt);else if((0,_util.isArrayBuffer)(vt))et[yt]=new Uint8Array(vt);else throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}continue}et[yt]=vt}if(et.CMapReaderFactory=et.CMapReaderFactory||DefaultCMapReaderFactory,et.StandardFontDataFactory=et.StandardFontDataFactory||DefaultStandardFontDataFactory,et.ignoreErrors=et.stopAtErrors!==!0,et.fontExtraProperties=et.fontExtraProperties===!0,et.pdfBug=et.pdfBug===!0,et.enableXfa=et.enableXfa===!0,(!Number.isInteger(et.rangeChunkSize)||et.rangeChunkSize<1)&&(et.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),(typeof et.docBaseUrl!="string"||(0,_display_utils.isDataScheme)(et.docBaseUrl))&&(et.docBaseUrl=null),(!Number.isInteger(et.maxImageSize)||et.maxImageSize<-1)&&(et.maxImageSize=-1),typeof et.cMapUrl!="string"&&(et.cMapUrl=null),typeof et.standardFontDataUrl!="string"&&(et.standardFontDataUrl=null),typeof et.useWorkerFetch!="boolean"&&(et.useWorkerFetch=et.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&et.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),typeof et.isEvalSupported!="boolean"&&(et.isEvalSupported=!0),typeof et.disableFontFace!="boolean"&&(et.disableFontFace=_is_node.isNodeJS),typeof et.useSystemFonts!="boolean"&&(et.useSystemFonts=!_is_node.isNodeJS&&!et.disableFontFace),(typeof et.ownerDocument!="object"||et.ownerDocument===null)&&(et.ownerDocument=globalThis.document),typeof et.disableRange!="boolean"&&(et.disableRange=!1),typeof et.disableStream!="boolean"&&(et.disableStream=!1),typeof et.disableAutoFetch!="boolean"&&(et.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(et.verbosity),!nt){const yt={verbosity:et.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};nt=yt.port?PDFWorker.fromPort(yt):new PDFWorker(yt),$._worker=nt}const at=$.docId;return nt.promise.then(function(){if($.destroyed)throw new Error("Loading aborted");const yt=_fetchDocument(nt,et,it,at),vt=new Promise(function(xt){let ct;it?ct=new _transport_stream.PDFDataTransportStream({length:et.length,initialData:et.initialData,progressiveDone:et.progressiveDone,contentDispositionFilename:et.contentDispositionFilename,disableRange:et.disableRange,disableStream:et.disableStream},it):et.data||(ct=createPDFNetworkStream({url:et.url,length:et.length,httpHeaders:et.httpHeaders,withCredentials:et.withCredentials,rangeChunkSize:et.rangeChunkSize,disableRange:et.disableRange,disableStream:et.disableStream})),xt(ct)});return Promise.all([yt,vt]).then(function([xt,ct]){if($.destroyed)throw new Error("Loading aborted");const pt=new _message_handler.MessageHandler(at,xt,nt.port),ht=new WorkerTransport(pt,$,ct,et);$._transport=ht,pt.send("Ready",null)})}).catch($._capability.reject),$}async function _fetchDocument(tt,$,ot,et){if(tt.destroyed)throw new Error("Worker was destroyed");ot&&($.length=ot.length,$.initialData=ot.initialData,$.progressiveDone=ot.progressiveDone,$.contentDispositionFilename=ot.contentDispositionFilename);const it=await tt.messageHandler.sendWithPromise("GetDocRequest",{docId:et,apiVersion:"2.16.105",source:{data:$.data,url:$.url,password:$.password,disableAutoFetch:$.disableAutoFetch,rangeChunkSize:$.rangeChunkSize,length:$.length},maxImageSize:$.maxImageSize,disableFontFace:$.disableFontFace,docBaseUrl:$.docBaseUrl,ignoreErrors:$.ignoreErrors,isEvalSupported:$.isEvalSupported,fontExtraProperties:$.fontExtraProperties,enableXfa:$.enableXfa,useSystemFonts:$.useSystemFonts,cMapUrl:$.useWorkerFetch?$.cMapUrl:null,standardFontDataUrl:$.useWorkerFetch?$.standardFontDataUrl:null});if($.data&&($.data=null),tt.destroyed)throw new Error("Worker was destroyed");return it}const i=class{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId=`d${ps(i,e)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){var $;this.destroyed=!0,await(($=this._transport)==null?void 0:$.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let PDFDocumentLoadingTask=i;e=new WeakMap,rn(PDFDocumentLoadingTask,e,0),exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor($,ot,et=!1,it=null){this.length=$,this.initialData=ot,this.progressiveDone=et,this.contentDispositionFilename=it,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener($){this._rangeListeners.push($)}addProgressListener($){this._progressListeners.push($)}addProgressiveReadListener($){this._progressiveReadListeners.push($)}addProgressiveDoneListener($){this._progressiveDoneListeners.push($)}onDataRange($,ot){for(const et of this._rangeListeners)et($,ot)}onDataProgress($,ot){this._readyCapability.promise.then(()=>{for(const et of this._progressListeners)et($,ot)})}onDataProgressiveRead($){this._readyCapability.promise.then(()=>{for(const ot of this._progressiveReadListeners)ot($)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const $ of this._progressiveDoneListeners)$()})}transportReady(){this._readyCapability.resolve()}requestDataRange($,ot){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor($,ot){this._pdfInfo=$,this._transport=ot,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:async()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),this.stats||{streamTypes:{},fontTypes:{}})})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage($){return this._transport.getPage($)}getPageIndex($){return this._transport.getPageIndex($)}getDestinations(){return this._transport.getDestinations()}getDestination($){return this._transport.getDestination($)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup($=!1){return this._transport.startCleanup($||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor($,ot,et,it,nt=!1){this._pageIndex=$,this._pageInfo=ot,this._ownerDocument=it,this._transport=et,this._stats=nt?new _display_utils.StatTimer:null,this._pdfBug=nt,this.commonObjs=et.commonObjs,this.objs=new PDFObjects,this._bitmaps=new Set,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:$,rotation:ot=this.rotate,offsetX:et=0,offsetY:it=0,dontFlip:nt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:$,rotation:ot,offsetX:et,offsetY:it,dontFlip:nt})}getAnnotations({intent:$="display"}={}){const ot=this._transport.getRenderingIntent($);let et=this._annotationPromises.get(ot.cacheKey);return et||(et=this._transport.getAnnotations(this._pageIndex,ot.renderingIntent),this._annotationPromises.set(ot.cacheKey,et),et=et.then(it=>{for(const nt of it)nt.titleObj!==void 0&&Object.defineProperty(nt,"title",{get(){return(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),nt.titleObj.str}}),nt.contentsObj!==void 0&&Object.defineProperty(nt,"contents",{get(){return(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),nt.contentsObj.str}});return it})),et}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var $;return(($=this._transport._htmlForXfa)==null?void 0:$.children[this._pageIndex])||null}render({canvasContext:$,viewport:ot,intent:et="display",annotationMode:it=_util.AnnotationMode.ENABLE,transform:nt=null,imageLayer:at=null,canvasFactory:yt=null,background:vt=null,optionalContentConfigPromise:xt=null,annotationCanvasMap:ct=null,pageColors:pt=null,printAnnotationStorage:ht=null}){var Ft,Ht;((Ft=arguments[0])==null?void 0:Ft.renderInteractiveForms)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),arguments[0].renderInteractiveForms===!0&&it===_util.AnnotationMode.ENABLE&&(it=_util.AnnotationMode.ENABLE_FORMS)),((Ht=arguments[0])==null?void 0:Ht.includeAnnotationStorage)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),arguments[0].includeAnnotationStorage===!0&&it===_util.AnnotationMode.ENABLE&&(it=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const Et=this._transport.getRenderingIntent(et,it,ht);this.pendingCleanup=!1,xt||(xt=this._transport.getOptionalContentConfig());let Ct=this._intentStates.get(Et.cacheKey);Ct||(Ct=Object.create(null),this._intentStates.set(Et.cacheKey,Ct)),Ct.streamReaderCancelTimeout&&(clearTimeout(Ct.streamReaderCancelTimeout),Ct.streamReaderCancelTimeout=null);const Bt=yt||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),Lt=!!(Et.renderingIntent&_util.RenderingIntentFlag.PRINT);Ct.displayReadyCapability||(Ct.displayReadyCapability=(0,_util.createPromiseCapability)(),Ct.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(Et));const Yt=qt=>{Ct.renderTasks.delete(Wt),(this.cleanupAfterRender||Lt)&&(this.pendingCleanup=!0),this._tryCleanup(),qt?(Wt.capability.reject(qt),this._abortOperatorList({intentState:Ct,reason:qt instanceof Error?qt:new Error(qt)})):Wt.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},Wt=new InternalRenderTask({callback:Yt,params:{canvasContext:$,viewport:ot,transform:nt,imageLayer:at,background:vt},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:ct,operatorList:Ct.operatorList,pageIndex:this._pageIndex,canvasFactory:Bt,useRequestAnimationFrame:!Lt,pdfBug:this._pdfBug,pageColors:pt});(Ct.renderTasks||(Ct.renderTasks=new Set)).add(Wt);const jt=Wt.task;return Promise.all([Ct.displayReadyCapability.promise,xt]).then(([qt,Xt])=>{if(this.pendingCleanup){Yt();return}this._stats&&this._stats.time("Rendering"),Wt.initializeGraphics({transparency:qt,optionalContentConfig:Xt}),Wt.operatorListChanged()}).catch(Yt),jt}getOperatorList({intent:$="display",annotationMode:ot=_util.AnnotationMode.ENABLE,printAnnotationStorage:et=null}={}){function it(){at.operatorList.lastChunk&&(at.opListReadCapability.resolve(at.operatorList),at.renderTasks.delete(yt))}const nt=this._transport.getRenderingIntent($,ot,et,!0);let at=this._intentStates.get(nt.cacheKey);at||(at=Object.create(null),this._intentStates.set(nt.cacheKey,at));let yt;return at.opListReadCapability||(yt=Object.create(null),yt.operatorListChanged=it,at.opListReadCapability=(0,_util.createPromiseCapability)(),(at.renderTasks||(at.renderTasks=new Set)).add(yt),at.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(nt)),at.opListReadCapability.promise}streamTextContent({disableCombineTextItems:$=!1,includeMarkedContent:ot=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:$!==!0,includeMarkedContent:ot===!0},{highWaterMark:100,size(it){return it.items.length}})}getTextContent($={}){if(this._transport._htmlForXfa)return this.getXfa().then(et=>_xfa_text.XfaText.textContent(et));const ot=this.streamTextContent($);return new Promise(function(et,it){function nt(){at.read().then(function({value:vt,done:xt}){if(xt){et(yt);return}Object.assign(yt.styles,vt.styles),yt.items.push(...vt.items),nt()},it)}const at=ot.getReader(),yt={items:[],styles:Object.create(null)};nt()})}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;const $=[];for(const ot of this._intentStates.values())if(this._abortOperatorList({intentState:ot,reason:new Error("Page was destroyed."),force:!0}),!ot.opListReadCapability)for(const et of ot.renderTasks)$.push(et.completed),et.cancel();this.objs.clear();for(const ot of this._bitmaps)ot.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all($)}cleanup($=!1){return this.pendingCleanup=!0,this._tryCleanup($)}_tryCleanup($=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:ot,operatorList:et}of this._intentStates.values())if(ot.size>0||!et.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,$&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const ot of this._bitmaps)ot.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage($,ot){const et=this._intentStates.get(ot);et&&(this._stats&&this._stats.timeEnd("Page Request"),et.displayReadyCapability&&et.displayReadyCapability.resolve($))}_renderPageChunk($,ot){for(let et=0,it=$.length;et{nt.read().then(({value:vt,done:xt})=>{if(xt){at.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(vt,at),yt())},vt=>{if(at.streamReader=null,!this._transport.destroyed){if(at.operatorList){at.operatorList.lastChunk=!0;for(const xt of at.renderTasks)xt.operatorListChanged();this._tryCleanup()}if(at.displayReadyCapability)at.displayReadyCapability.reject(vt);else if(at.opListReadCapability)at.opListReadCapability.reject(vt);else throw vt}})};yt()}_abortOperatorList({intentState:$,reason:ot,force:et=!1}){if($.streamReader){if(!et){if($.renderTasks.size>0)return;if(ot instanceof _display_utils.RenderingCancelledException){$.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:$,reason:ot,force:!0}),$.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if($.streamReader.cancel(new _util.AbortException(ot.message)).catch(()=>{}),$.streamReader=null,!this._transport.destroyed){for(const[it,nt]of this._intentStates)if(nt===$){this._intentStates.delete(it);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage($,ot){const et={data:structuredClone($,ot)};this._deferred.then(()=>{for(const it of this._listeners)it.call(this,et)})}addEventListener($,ot){this._listeners.push(ot)}removeEventListener($,ot){const et=this._listeners.indexOf(ot);this._listeners.splice(et,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const tt=(s=document==null?void 0:document.currentScript)==null?void 0:s.src;tt&&(PDFWorkerUtil.fallbackWorkerSrc=tt.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(tt,$){let ot;try{if(ot=new URL(tt),!ot.origin||ot.origin==="null")return!1}catch{return!1}const et=new URL($,ot);return ot.origin===et.origin},PDFWorkerUtil.createCDNWrapper=function(tt){const $=`importScripts("${tt}");`;return URL.createObjectURL(new Blob([$]))}}const _PDFWorker=class{constructor({name:tt=null,port:$=null,verbosity:ot=(0,_util.getVerbosityLevel)()}={}){if($&&Pt(_PDFWorker,o).has($))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=tt,this.destroyed=!1,this.verbosity=ot,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,$){Pt(_PDFWorker,o).set($,this),this._initializeFromPort($);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(tt){this._port=tt,this._messageHandler=new _message_handler.MessageHandler("main","worker",tt),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:tt}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,tt)||(tt=PDFWorkerUtil.createCDNWrapper(new URL(tt,window.location).href));const $=new Worker(tt),ot=new _message_handler.MessageHandler("main","worker",$),et=()=>{$.removeEventListener("error",it),ot.destroy(),$.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},it=()=>{this._webWorker||et()};$.addEventListener("error",it),ot.on("test",at=>{if($.removeEventListener("error",it),this.destroyed){et();return}at?(this._messageHandler=ot,this._port=$,this._webWorker=$,this._readyCapability.resolve(),ot.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),ot.destroy(),$.terminate())}),ot.on("ready",at=>{if($.removeEventListener("error",it),this.destroyed){et();return}try{nt()}catch{this._setupFakeWorker()}});const nt=()=>{const at=new Uint8Array;ot.send("test",at,[at.buffer])};nt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(tt=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const $=new LoopbackPort;this._port=$;const ot=`fake${PDFWorkerUtil.fakeWorkerId++}`,et=new _message_handler.MessageHandler(ot+"_worker",ot,$);tt.setup(et,$);const it=new _message_handler.MessageHandler(ot,ot+"_worker",$);this._messageHandler=it,this._readyCapability.resolve(),it.send("configure",{verbosity:this.verbosity})}).catch(tt=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${tt.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Pt(_PDFWorker,o).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(tt){if(!(tt!=null&&tt.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Pt(this,o).has(tt.port)?Pt(this,o).get(tt.port):new _PDFWorker(tt)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var tt;try{return((tt=globalThis.pdfjsWorker)==null?void 0:tt.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};let PDFWorker=_PDFWorker;o=new WeakMap,rn(PDFWorker,o,new WeakMap),exports.PDFWorker=PDFWorker,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{constructor($,ot,et,it){rn(this,a,null);rn(this,c,new Map);rn(this,d,new Map);rn(this,g,null);this.messageHandler=$,this.loadingTask=ot,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:ot.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:it.ownerDocument,styleElement:it.styleElement}),this._params=it,it.useWorkerFetch||(this.CMapReaderFactory=new it.CMapReaderFactory({baseUrl:it.cMapUrl,isCompressed:it.cMapPacked}),this.StandardFontDataFactory=new it.StandardFontDataFactory({baseUrl:it.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=et,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return Pt(this,a)}getRenderingIntent($,ot=_util.AnnotationMode.ENABLE,et=null,it=!1){let nt=_util.RenderingIntentFlag.DISPLAY,at=null;switch($){case"any":nt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":nt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${$}`)}switch(ot){case _util.AnnotationMode.DISABLE:nt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:nt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:nt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,at=(nt&_util.RenderingIntentFlag.PRINT&&et instanceof _annotation_storage.PrintAnnotationStorage?et:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${ot}`)}return it&&(nt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:nt,cacheKey:`${nt}_${_annotation_storage.AnnotationStorage.getHash(at)}`,annotationStorageMap:at}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const $=[];for(const et of Pt(this,c).values())$.push(et._destroy());Pt(this,c).clear(),Pt(this,d).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const ot=this.messageHandler.sendWithPromise("Terminate",null);return $.push(ot),Promise.all($).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),fn(this,g,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:$,loadingTask:ot}=this;$.on("GetReader",(et,it)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=nt=>{this._lastProgress={loaded:nt.loaded,total:nt.total}},it.onPull=()=>{this._fullReader.read().then(function({value:nt,done:at}){if(at){it.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(nt),"GetReader - expected an ArrayBuffer."),it.enqueue(new Uint8Array(nt),1,[nt])}).catch(nt=>{it.error(nt)})},it.onCancel=nt=>{this._fullReader.cancel(nt),it.ready.catch(at=>{if(!this.destroyed)throw at})}}),$.on("ReaderHeadersReady",et=>{const it=(0,_util.createPromiseCapability)(),nt=this._fullReader;return nt.headersReady.then(()=>{var at;(!nt.isStreamingSupported||!nt.isRangeSupported)&&(this._lastProgress&&((at=ot.onProgress)==null||at.call(ot,this._lastProgress)),nt.onProgress=yt=>{var vt;(vt=ot.onProgress)==null||vt.call(ot,{loaded:yt.loaded,total:yt.total})}),it.resolve({isStreamingSupported:nt.isStreamingSupported,isRangeSupported:nt.isRangeSupported,contentLength:nt.contentLength})},it.reject),it.promise}),$.on("GetRangeReader",(et,it)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const nt=this._networkStream.getRangeReader(et.begin,et.end);if(!nt){it.close();return}it.onPull=()=>{nt.read().then(function({value:at,done:yt}){if(yt){it.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(at),"GetRangeReader - expected an ArrayBuffer."),it.enqueue(new Uint8Array(at),1,[at])}).catch(at=>{it.error(at)})},it.onCancel=at=>{nt.cancel(at),it.ready.catch(yt=>{if(!this.destroyed)throw yt})}}),$.on("GetDoc",({pdfInfo:et})=>{this._numPages=et.numPages,this._htmlForXfa=et.htmlForXfa,delete et.htmlForXfa,ot._capability.resolve(new PDFDocumentProxy(et,this))}),$.on("DocException",function(et){let it;switch(et.name){case"PasswordException":it=new _util.PasswordException(et.message,et.code);break;case"InvalidPDFException":it=new _util.InvalidPDFException(et.message);break;case"MissingPDFException":it=new _util.MissingPDFException(et.message);break;case"UnexpectedResponseException":it=new _util.UnexpectedResponseException(et.message,et.status);break;case"UnknownErrorException":it=new _util.UnknownErrorException(et.message,et.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}ot._capability.reject(it)}),$.on("PasswordRequest",et=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),ot.onPassword){const it=nt=>{nt instanceof Error?this._passwordCapability.reject(nt):this._passwordCapability.resolve({password:nt})};try{ot.onPassword(it,et.code)}catch(nt){this._passwordCapability.reject(nt)}}else this._passwordCapability.reject(new _util.PasswordException(et.message,et.code));return this._passwordCapability.promise}),$.on("DataLoaded",et=>{var it;(it=ot.onProgress)==null||it.call(ot,{loaded:et.length,total:et.length}),this.downloadInfoCapability.resolve(et)}),$.on("StartRenderPage",et=>{if(this.destroyed)return;Pt(this,c).get(et.pageIndex)._startRenderPage(et.transparency,et.cacheKey)}),$.on("commonobj",([et,it,nt])=>{var at;if(!this.destroyed&&!this.commonObjs.has(et))switch(it){case"Font":const yt=this._params;if("error"in nt){const ct=nt.error;(0,_util.warn)(`Error during font loading: ${ct}`),this.commonObjs.resolve(et,ct);break}let vt=null;yt.pdfBug&&((at=globalThis.FontInspector)!=null&&at.enabled)&&(vt={registerFont(ct,pt){globalThis.FontInspector.fontAdded(ct,pt)}});const xt=new _font_loader.FontFaceObject(nt,{isEvalSupported:yt.isEvalSupported,disableFontFace:yt.disableFontFace,ignoreErrors:yt.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:vt});this.fontLoader.bind(xt).catch(ct=>$.sendWithPromise("FontFallback",{id:et})).finally(()=>{!yt.fontExtraProperties&&xt.data&&(xt.data=null),this.commonObjs.resolve(et,xt)});break;case"FontPath":case"Image":this.commonObjs.resolve(et,nt);break;default:throw new Error(`Got unknown common object type ${it}`)}}),$.on("obj",([et,it,nt,at])=>{var vt;if(this.destroyed)return;const yt=Pt(this,c).get(it);if(!yt.objs.has(et))switch(nt){case"Image":yt.objs.resolve(et,at);const xt=8e6;if(at){let ct;if(at.bitmap){const{bitmap:pt,width:ht,height:Et}=at;ct=ht*Et*4,yt._bitmaps.add(pt)}else ct=((vt=at.data)==null?void 0:vt.length)||0;ct>xt&&(yt.cleanupAfterRender=!0)}break;case"Pattern":yt.objs.resolve(et,at);break;default:throw new Error(`Got unknown object type ${nt}`)}}),$.on("DocProgress",et=>{var it;this.destroyed||(it=ot.onProgress)==null||it.call(ot,{loaded:et.loaded,total:et.total})}),$.on("DocStats",et=>{this.destroyed||fn(this,a,Object.freeze({streamTypes:Object.freeze(et.streamTypes),fontTypes:Object.freeze(et.fontTypes)}))}),$.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),$.on("FetchBuiltInCMap",et=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(et):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),$.on("FetchStandardFontData",et=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(et):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:$}){var ot,et;this.destroyed||(et=(ot=this.loadingTask).onUnsupportedFeature)==null||et.call(ot,$)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage($){if(!Number.isInteger($)||$<=0||$>this._numPages)return Promise.reject(new Error("Invalid page request."));const ot=$-1,et=Pt(this,d).get(ot);if(et)return et;const it=this.messageHandler.sendWithPromise("GetPage",{pageIndex:ot}).then(nt=>{if(this.destroyed)throw new Error("Transport destroyed");const at=new PDFPageProxy(ot,nt,this,this._params.ownerDocument,this._params.pdfBug);return Pt(this,c).set(ot,at),at});return Pt(this,d).set(ot,it),it}getPageIndex($){return typeof $!="object"||$===null||!Number.isInteger($.num)||$.num<0||!Number.isInteger($.gen)||$.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:$.num,gen:$.gen})}getAnnotations($,ot){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:$,intent:ot})}saveDocument(){var $;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(($=this._fullReader)==null?void 0:$.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination($){return typeof $!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:$})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions($){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:$})}getStructTree($){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:$})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then($=>new _optional_content_config.OptionalContentConfig($))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return Pt(this,g)||fn(this,g,this.messageHandler.sendWithPromise("GetMetadata",null).then($=>{var ot,et;return{info:$[0],metadata:$[1]?new _metadata.Metadata($[1]):null,contentDispositionFilename:((ot=this._fullReader)==null?void 0:ot.filename)??null,contentLength:((et=this._fullReader)==null?void 0:et.contentLength)??null}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup($=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(const ot of Pt(this,c).values())if(!ot.cleanup())throw new Error(`startCleanup: Page ${ot.pageNumber} is currently rendering.`);this.commonObjs.clear(),$||this.fontLoader.clear(),fn(this,g,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const $=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:$.disableAutoFetch,enableXfa:$.enableXfa})}}a=new WeakMap,c=new WeakMap,d=new WeakMap,g=new WeakMap;class PDFObjects{constructor(){rn(this,b);rn(this,_,Object.create(null))}get($,ot=null){if(ot){const it=on(this,b,ms).call(this,$);return it.capability.promise.then(()=>ot(it.data)),null}const et=Pt(this,_)[$];if(!(et!=null&&et.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${$}.`);return et.data}has($){const ot=Pt(this,_)[$];return(ot==null?void 0:ot.capability.settled)||!1}resolve($,ot=null){const et=on(this,b,ms).call(this,$);et.data=ot,et.capability.resolve()}clear(){fn(this,_,Object.create(null))}}_=new WeakMap,b=new WeakSet,ms=function($){const ot=Pt(this,_)[$];return ot||(Pt(this,_)[$]={capability:(0,_util.createPromiseCapability)(),data:null})};class RenderTask{constructor($){rn(this,rt,null);fn(this,rt,$),this.onContinue=null}get promise(){return Pt(this,rt).capability.promise}cancel(){Pt(this,rt).cancel()}get separateAnnots(){const{separateAnnots:$}=Pt(this,rt).operatorList;if(!$)return!1;const{annotationCanvasMap:ot}=Pt(this,rt);return $.form||$.canvas&&(ot==null?void 0:ot.size)>0}}rt=new WeakMap,exports.RenderTask=RenderTask;const lt=class{constructor({callback:$,params:ot,objs:et,commonObjs:it,annotationCanvasMap:nt,operatorList:at,pageIndex:yt,canvasFactory:vt,useRequestAnimationFrame:xt=!1,pdfBug:ct=!1,pageColors:pt=null}){this.callback=$,this.params=ot,this.objs=et,this.commonObjs=it,this.annotationCanvasMap=nt,this.operatorListIdx=null,this.operatorList=at,this._pageIndex=yt,this.canvasFactory=vt,this._pdfBug=ct,this.pageColors=pt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=xt===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=ot.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:$=!1,optionalContentConfig:ot}){var vt;if(this.cancelled)return;if(this._canvas){if(Pt(lt,st).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Pt(lt,st).add(this._canvas)}this._pdfBug&&((vt=globalThis.StepperManager)!=null&&vt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:et,viewport:it,transform:nt,imageLayer:at,background:yt}=this.params;this.gfx=new _canvas.CanvasGraphics(et,this.commonObjs,this.objs,this.canvasFactory,at,ot,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:nt,viewport:it,transparency:$,background:yt}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel($=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&Pt(lt,st).delete(this._canvas),this.callback($||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&this.stepper.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&Pt(lt,st).delete(this._canvas),this.callback())))}};let InternalRenderTask=lt;st=new WeakMap,rn(InternalRenderTask,st,new WeakSet);const version="2.16.105";exports.version=version;const build="172ccdbe5";exports.build=build},(e,i,s)=>{var _,go,_e;Object.defineProperty(i,"__esModule",{value:!0}),i.PrintAnnotationStorage=i.AnnotationStorage=void 0;var o=s(1),a=s(6),c=s(10);class d{constructor(){rn(this,_);this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(st,lt){const tt=this._storage.get(st);return tt===void 0?lt:Object.assign(lt,tt)}getRawValue(st){return this._storage.get(st)}remove(st){if(this._storage.delete(st),this._storage.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const lt of this._storage.values())if(lt instanceof a.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(st,lt){const tt=this._storage.get(st);let $=!1;if(tt!==void 0)for(const[ot,et]of Object.entries(lt))tt[ot]!==et&&($=!0,tt[ot]=et);else $=!0,this._storage.set(st,lt);$&&on(this,_,go).call(this),lt instanceof a.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(lt.constructor._type)}has(st){return this._storage.has(st)}getAll(){return this._storage.size>0?(0,o.objectFromMap)(this._storage):null}get size(){return this._storage.size}resetModified(){this._modified&&(this._modified=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new g(this)}get serializable(){if(this._storage.size===0)return null;const st=new Map;for(const[lt,tt]of this._storage){const $=tt instanceof a.AnnotationEditor?tt.serialize():tt;$&&st.set(lt,$)}return st}static getHash(st){if(!st)return"";const lt=new c.MurmurHash3_64;for(const[tt,$]of st)lt.update(`${tt}:${JSON.stringify($)}`);return lt.hexdigest()}}_=new WeakSet,go=function(){this._modified||(this._modified=!0,typeof this.onSetModified=="function"&&this.onSetModified())},i.AnnotationStorage=d;class g extends d{constructor(lt){super();rn(this,_e,null);fn(this,_e,structuredClone(lt.serializable))}get print(){(0,o.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Pt(this,_e)}}_e=new WeakMap,i.PrintAnnotationStorage=g},(e,i,s)=>{var d,g,_,b,_e,rt;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationEditor=void 0;var o=s(7),a=s(1);const st=class{constructor(tt){rn(this,d,this.focusin.bind(this));rn(this,g,this.focusout.bind(this));rn(this,_,!1);rn(this,b,!1);rn(this,_e,!1);rn(this,rt,st._zIndex++);this.constructor===st&&(0,a.unreachable)("Cannot initialize AnnotationEditor."),this.parent=tt.parent,this.id=tt.id,this.width=this.height=null,this.pageIndex=tt.parent.pageIndex,this.name=tt.name,this.div=null;const[$,ot]=this.parent.viewportBaseDimensions;this.x=tt.x/$,this.y=tt.y/ot,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,a.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Pt(this,rt)}focusin(tt){Pt(this,_)?fn(this,_,!1):this.parent.setSelected(this)}focusout(tt){if(!this.isAttachedToDOM)return;const $=tt.relatedTarget;$!=null&&$.closest(`#${this.id}`)||(tt.preventDefault(),this.parent.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(tt){const $=this.parent.div.getBoundingClientRect();this.startX=tt.clientX-$.x,this.startY=tt.clientY-$.y,tt.dataTransfer.setData("text/plain",this.id),tt.dataTransfer.effectAllowed="move"}setAt(tt,$,ot,et){const[it,nt]=this.parent.viewportBaseDimensions;[ot,et]=this.screenToPageTranslation(ot,et),this.x=(tt+ot)/it,this.y=($+et)/nt,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(tt,$){const[ot,et]=this.parent.viewportBaseDimensions;[tt,$]=this.screenToPageTranslation(tt,$),this.x+=tt/ot,this.y+=$/et,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(tt,$){const{rotation:ot}=this.parent.viewport;switch(ot){case 90:return[$,-tt];case 180:return[-tt,-$];case 270:return[-$,tt];default:return[tt,$]}}setDims(tt,$){const[ot,et]=this.parent.viewportBaseDimensions;this.div.style.width=`${100*tt/ot}%`,this.div.style.height=`${100*$/et}%`}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Pt(this,d)),this.div.addEventListener("focusout",Pt(this,g));const[tt,$]=this.getInitialTranslation();return this.translate(tt,$),(0,o.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(tt){const $=o.KeyboardManager.platform.isMac;if(tt.button!==0||tt.ctrlKey&&$){tt.preventDefault();return}tt.ctrlKey&&!$||tt.shiftKey||tt.metaKey&&$?this.parent.toggleSelected(this):this.parent.setSelected(this),fn(this,_,!0)}getRect(tt,$){const[ot,et]=this.parent.viewportBaseDimensions,[it,nt]=this.parent.pageDimensions,at=it*tt/ot,yt=nt*$/et,vt=this.x*it,xt=this.y*nt,ct=this.width*it,pt=this.height*nt;switch(this.rotation){case 0:return[vt+at,nt-xt-yt-pt,vt+at+ct,nt-xt-yt];case 90:return[vt+yt,nt-xt+at,vt+yt+pt,nt-xt+at+ct];case 180:return[vt-at-ct,nt-xt+yt,vt-at,nt-xt+yt+pt];case 270:return[vt-yt-pt,nt-xt-at-ct,vt-yt,nt-xt-at];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(tt,$){const[ot,et,it,nt]=tt,at=it-ot,yt=nt-et;switch(this.rotation){case 0:return[ot,$-nt,at,yt];case 90:return[ot,$-et,yt,at];case 180:return[it,$-et,at,yt];case 270:return[it,$-nt,yt,at];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){fn(this,_e,!0)}disableEditMode(){fn(this,_e,!1)}isInEditMode(){return Pt(this,_e)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var tt;(tt=this.div)==null||tt.addEventListener("focusin",Pt(this,d))}serialize(){(0,a.unreachable)("An editor must be serializable")}static deserialize(tt,$){const ot=new this.prototype.constructor({parent:$,id:$.getNextId()});ot.rotation=tt.rotation;const[et,it]=$.pageDimensions,[nt,at,yt,vt]=ot.getRectInCurrentCoords(tt.rect,it);return ot.x=nt/et,ot.y=at/it,ot.width=yt/et,ot.height=vt/it,ot}remove(){this.div.removeEventListener("focusin",Pt(this,d)),this.div.removeEventListener("focusout",Pt(this,g)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var tt;(tt=this.div)==null||tt.classList.add("selectedEditor")}unselect(){var tt;(tt=this.div)==null||tt.classList.remove("selectedEditor")}updateParams(tt,$){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return Pt(this,b)}set isEditing(tt){fn(this,b,tt),tt?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};let c=st;d=new WeakMap,g=new WeakMap,_=new WeakMap,b=new WeakMap,_e=new WeakMap,rt=new WeakMap,Wn(c,"_colorManager",new o.ColorManager),Wn(c,"_zIndex",1),i.AnnotationEditor=c},(e,i,s)=>{var lt,tt,$,ot,et,it,yo,yt,xt,ct,pt,ht,Et,Ct,Bt,Lt,Yt,Wt,jt,Ft,Ht,qt,Xt,Tt,gt,mt,vo,Rt,gs,Ot,Xn,zt,Mr,_t,_o,wt,So,Nt,ys,an,Or,tn,Yr;Object.defineProperty(i,"__esModule",{value:!0}),i.KeyboardManager=i.CommandManager=i.ColorManager=i.AnnotationEditorUIManager=void 0,i.bindEvents=c,i.opacityToHex=d;var o=s(1),a=s(8);function c(ln,Mt,sn){for(const gn of sn)Mt.addEventListener(gn,ln[gn].bind(ln))}function d(ln){return Math.round(Math.min(255,Math.max(1,255*ln))).toString(16).padStart(2,"0")}class g{constructor(){rn(this,lt,0)}getId(){return`${o.AnnotationEditorPrefix}${ps(this,lt)._++}`}}lt=new WeakMap;class _{constructor(Mt=128){rn(this,tt,[]);rn(this,$,!1);rn(this,ot,void 0);rn(this,et,-1);fn(this,ot,Mt)}add({cmd:Mt,undo:sn,mustExec:gn,type:vn=NaN,overwriteIfSameType:_n=!1,keepUndo:mn=!1}){if(gn&&Mt(),Pt(this,$))return;const Mn={cmd:Mt,undo:sn,type:vn};if(Pt(this,et)===-1){Pt(this,tt).length>0&&(Pt(this,tt).length=0),fn(this,et,0),Pt(this,tt).push(Mn);return}if(_n&&Pt(this,tt)[Pt(this,et)].type===vn){mn&&(Mn.undo=Pt(this,tt)[Pt(this,et)].undo),Pt(this,tt)[Pt(this,et)]=Mn;return}const Dn=Pt(this,et)+1;Dn===Pt(this,ot)?Pt(this,tt).splice(0,1):(fn(this,et,Dn),Dnsn.serialize())):fn(this,yt,[Mt.serialize()]),fn(this,yt,Pt(this,yt).filter(sn=>!!sn)),Pt(this,yt).length===0&&fn(this,yt,null))}paste(){return Pt(this,yt)}isEmpty(){return Pt(this,yt)===null}destroy(){fn(this,yt,null)}}yt=new WeakMap;const vt=class{get _colors(){const Mt=new Map([["CanvasText",null],["Canvas",null]]);return(0,a.getColorValues)(Mt),(0,o.shadow)(this,"_colors",Mt)}convert(Mt){const sn=(0,a.getRGB)(Mt);if(!window.matchMedia("(forced-colors: active)").matches)return sn;for(const[gn,vn]of this._colors)if(vn.every((_n,mn)=>_n===sn[mn]))return vt._colorsMapping.get(gn);return sn}getHexCode(Mt){const sn=this._colors.get(Mt);return sn?o.Util.makeHexColor(...sn):Mt}};let rt=vt;Wn(rt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),i.ColorManager=rt;const nn=class{constructor(Mt,sn){rn(this,mt);rn(this,Rt);rn(this,Ot);rn(this,zt);rn(this,_t);rn(this,wt);rn(this,Nt);rn(this,an);rn(this,tn);rn(this,xt,null);rn(this,ct,new Map);rn(this,pt,new Map);rn(this,ht,new _e);rn(this,Et,new _);rn(this,Ct,0);rn(this,Bt,null);rn(this,Lt,null);rn(this,Yt,new g);rn(this,Wt,!1);rn(this,jt,o.AnnotationEditorType.NONE);rn(this,Ft,new Set);rn(this,Ht,this.keydown.bind(this));rn(this,qt,this.onEditingAction.bind(this));rn(this,Xt,this.onPageChanging.bind(this));rn(this,Tt,{isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});rn(this,gt,null);fn(this,gt,Mt),fn(this,Lt,sn),Pt(this,Lt)._on("editingaction",Pt(this,qt)),Pt(this,Lt)._on("pagechanging",Pt(this,Xt))}destroy(){on(this,Rt,gs).call(this),Pt(this,Lt)._off("editingaction",Pt(this,qt)),Pt(this,Lt)._off("pagechanging",Pt(this,Xt));for(const Mt of Pt(this,pt).values())Mt.destroy();Pt(this,pt).clear(),Pt(this,ct).clear(),fn(this,xt,null),Pt(this,Ft).clear(),Pt(this,ht).destroy(),Pt(this,Et).destroy()}onPageChanging({pageNumber:Mt}){fn(this,Ct,Mt-1)}focusMainContainer(){Pt(this,gt).focus()}keydown(Mt){var sn;(sn=this.getActive())!=null&&sn.shouldGetKeyboardEvents()||nn._keyboardManager.exec(this,Mt)}onEditingAction(Mt){["undo","redo","cut","copy","paste","delete","selectAll"].includes(Mt.name)&&this[Mt.name]()}setEditingState(Mt){Mt?(on(this,mt,vo).call(this),on(this,Ot,Xn).call(this,{isEditing:Pt(this,jt)!==o.AnnotationEditorType.NONE,isEmpty:on(this,an,Or).call(this),hasSomethingToUndo:Pt(this,Et).hasSomethingToUndo(),hasSomethingToRedo:Pt(this,Et).hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:Pt(this,ht).isEmpty()})):(on(this,Rt,gs).call(this),on(this,Ot,Xn).call(this,{isEditing:!1}))}registerEditorTypes(Mt){fn(this,Bt,Mt);for(const sn of Pt(this,Bt))on(this,zt,Mr).call(this,sn.defaultPropertiesToUpdate)}getId(){return Pt(this,Yt).getId()}addLayer(Mt){Pt(this,pt).set(Mt.pageIndex,Mt),Pt(this,Wt)?Mt.enable():Mt.disable()}removeLayer(Mt){Pt(this,pt).delete(Mt.pageIndex)}updateMode(Mt){if(fn(this,jt,Mt),Mt===o.AnnotationEditorType.NONE)this.setEditingState(!1),on(this,wt,So).call(this);else{this.setEditingState(!0),on(this,_t,_o).call(this);for(const sn of Pt(this,pt).values())sn.updateMode(Mt)}}updateToolbar(Mt){Mt!==Pt(this,jt)&&Pt(this,Lt).dispatch("switchannotationeditormode",{source:this,mode:Mt})}updateParams(Mt,sn){for(const gn of Pt(this,Ft))gn.updateParams(Mt,sn);for(const gn of Pt(this,Bt))gn.updateDefaultParams(Mt,sn)}getEditors(Mt){const sn=[];for(const gn of Pt(this,ct).values())gn.pageIndex===Mt&&sn.push(gn);return sn}getEditor(Mt){return Pt(this,ct).get(Mt)}addEditor(Mt){Pt(this,ct).set(Mt.id,Mt)}removeEditor(Mt){Pt(this,ct).delete(Mt.id),this.unselect(Mt)}setActiveEditor(Mt){Pt(this,xt)!==Mt&&(fn(this,xt,Mt),Mt&&on(this,zt,Mr).call(this,Mt.propertiesToUpdate))}toggleSelected(Mt){if(Pt(this,Ft).has(Mt)){Pt(this,Ft).delete(Mt),Mt.unselect(),on(this,Ot,Xn).call(this,{hasSelectedEditor:this.hasSelection});return}Pt(this,Ft).add(Mt),Mt.select(),on(this,zt,Mr).call(this,Mt.propertiesToUpdate),on(this,Ot,Xn).call(this,{hasSelectedEditor:!0})}setSelected(Mt){for(const sn of Pt(this,Ft))sn!==Mt&&sn.unselect();Pt(this,Ft).clear(),Pt(this,Ft).add(Mt),Mt.select(),on(this,zt,Mr).call(this,Mt.propertiesToUpdate),on(this,Ot,Xn).call(this,{hasSelectedEditor:!0})}isSelected(Mt){return Pt(this,Ft).has(Mt)}unselect(Mt){Mt.unselect(),Pt(this,Ft).delete(Mt),on(this,Ot,Xn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return Pt(this,Ft).size!==0}undo(){Pt(this,Et).undo(),on(this,Ot,Xn).call(this,{hasSomethingToUndo:Pt(this,Et).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:on(this,an,Or).call(this)})}redo(){Pt(this,Et).redo(),on(this,Ot,Xn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Pt(this,Et).hasSomethingToRedo(),isEmpty:on(this,an,Or).call(this)})}addCommands(Mt){Pt(this,Et).add(Mt),on(this,Ot,Xn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:on(this,an,Or).call(this)})}delete(){if(Pt(this,xt)&&Pt(this,xt).commitOrRemove(),!this.hasSelection)return;const Mt=[...Pt(this,Ft)],sn=()=>{for(const vn of Mt)vn.remove()},gn=()=>{for(const vn of Mt)on(this,Nt,ys).call(this,vn)};this.addCommands({cmd:sn,undo:gn,mustExec:!0})}copy(){if(Pt(this,xt)&&Pt(this,xt).commitOrRemove(),this.hasSelection){const Mt=[];for(const sn of Pt(this,Ft))sn.isEmpty()||Mt.push(sn);if(Mt.length===0)return;Pt(this,ht).copy(Mt),on(this,Ot,Xn).call(this,{hasEmptyClipboard:!1})}}cut(){this.copy(),this.delete()}paste(){if(Pt(this,ht).isEmpty())return;this.unselectAll();const Mt=Pt(this,pt).get(Pt(this,Ct)),sn=Pt(this,ht).paste().map(_n=>Mt.deserialize(_n)),gn=()=>{for(const _n of sn)on(this,Nt,ys).call(this,_n);on(this,tn,Yr).call(this,sn)},vn=()=>{for(const _n of sn)_n.remove()};this.addCommands({cmd:gn,undo:vn,mustExec:!0})}selectAll(){for(const Mt of Pt(this,Ft))Mt.commit();on(this,tn,Yr).call(this,Pt(this,ct).values())}unselectAll(){if(Pt(this,xt)){Pt(this,xt).commitOrRemove();return}if(on(this,tn,Yr).size!==0){for(const Mt of Pt(this,Ft))Mt.unselect();Pt(this,Ft).clear(),on(this,Ot,Xn).call(this,{hasSelectedEditor:!1})}}isActive(Mt){return Pt(this,xt)===Mt}getActive(){return Pt(this,xt)}getMode(){return Pt(this,jt)}};let st=nn;xt=new WeakMap,ct=new WeakMap,pt=new WeakMap,ht=new WeakMap,Et=new WeakMap,Ct=new WeakMap,Bt=new WeakMap,Lt=new WeakMap,Yt=new WeakMap,Wt=new WeakMap,jt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Xt=new WeakMap,Tt=new WeakMap,gt=new WeakMap,mt=new WeakSet,vo=function(){Pt(this,gt).addEventListener("keydown",Pt(this,Ht))},Rt=new WeakSet,gs=function(){Pt(this,gt).removeEventListener("keydown",Pt(this,Ht))},Ot=new WeakSet,Xn=function(Mt){Object.entries(Mt).some(([gn,vn])=>Pt(this,Tt)[gn]!==vn)&&Pt(this,Lt).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Pt(this,Tt),Mt)})},zt=new WeakSet,Mr=function(Mt){Pt(this,Lt).dispatch("annotationeditorparamschanged",{source:this,details:Mt})},_t=new WeakSet,_o=function(){if(!Pt(this,Wt)){fn(this,Wt,!0);for(const Mt of Pt(this,pt).values())Mt.enable()}},wt=new WeakSet,So=function(){if(this.unselectAll(),Pt(this,Wt)){fn(this,Wt,!1);for(const Mt of Pt(this,pt).values())Mt.disable()}},Nt=new WeakSet,ys=function(Mt){const sn=Pt(this,pt).get(Mt.pageIndex);sn?sn.addOrRebuild(Mt):this.addEditor(Mt)},an=new WeakSet,Or=function(){if(Pt(this,ct).size===0)return!0;if(Pt(this,ct).size===1)for(const Mt of Pt(this,ct).values())return Mt.isEmpty();return!1},tn=new WeakSet,Yr=function(Mt){Pt(this,Ft).clear();for(const sn of Mt)sn.isEmpty()||(Pt(this,Ft).add(sn),sn.select());on(this,Ot,Xn).call(this,{hasSelectedEditor:!0})},Wn(st,"_keyboardManager",new b([[["ctrl+a","mac+meta+a"],nn.prototype.selectAll],[["ctrl+c","mac+meta+c"],nn.prototype.copy],[["ctrl+v","mac+meta+v"],nn.prototype.paste],[["ctrl+x","mac+meta+x"],nn.prototype.cut],[["ctrl+z","mac+meta+z"],nn.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],nn.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],nn.prototype.delete],[["Escape","mac+Escape"],nn.prototype.unselectAll]])),i.AnnotationEditorUIManager=st},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.StatTimer=i.RenderingCancelledException=i.PixelsPerInch=i.PageViewport=i.PDFDateString=i.DOMStandardFontDataFactory=i.DOMSVGFactory=i.DOMCanvasFactory=i.DOMCMapReaderFactory=i.AnnotationPrefix=void 0,i.deprecated=vt,i.getColorValues=Et,i.getCurrentTransform=Ct,i.getCurrentTransformInverse=Bt,i.getFilenameFromUrl=et,i.getPdfFilenameFromUrl=it,i.getRGB=ht,i.getXfaPageViewport=pt,i.isDataScheme=$,i.isPdfFile=ot,i.isValidFetchUrl=at,i.loadScript=yt;var o=s(9),a=s(1);const c="http://www.w3.org/2000/svg",d="pdfjs_internal_id_";i.AnnotationPrefix=d;const Lt=class{};let g=Lt;Wn(g,"CSS",96),Wn(g,"PDF",72),Wn(g,"PDF_TO_CSS_UNITS",Lt.CSS/Lt.PDF),i.PixelsPerInch=g;class _ extends o.BaseCanvasFactory{constructor({ownerDocument:Wt=globalThis.document}={}){super(),this._document=Wt}_createCanvas(Wt,jt){const Ft=this._document.createElement("canvas");return Ft.width=Wt,Ft.height=jt,Ft}}i.DOMCanvasFactory=_;async function b(Yt,Wt=!1){if(at(Yt,document.baseURI)){const jt=await fetch(Yt);if(!jt.ok)throw new Error(jt.statusText);return Wt?new Uint8Array(await jt.arrayBuffer()):(0,a.stringToBytes)(await jt.text())}return new Promise((jt,Ft)=>{const Ht=new XMLHttpRequest;Ht.open("GET",Yt,!0),Wt&&(Ht.responseType="arraybuffer"),Ht.onreadystatechange=()=>{if(Ht.readyState===XMLHttpRequest.DONE){if(Ht.status===200||Ht.status===0){let qt;if(Wt&&Ht.response?qt=new Uint8Array(Ht.response):!Wt&&Ht.responseText&&(qt=(0,a.stringToBytes)(Ht.responseText)),qt){jt(qt);return}}Ft(new Error(Ht.statusText))}},Ht.send(null)})}class _e extends o.BaseCMapReaderFactory{_fetchData(Wt,jt){return b(Wt,this.isCompressed).then(Ft=>({cMapData:Ft,compressionType:jt}))}}i.DOMCMapReaderFactory=_e;class rt extends o.BaseStandardFontDataFactory{_fetchData(Wt){return b(Wt,!0)}}i.DOMStandardFontDataFactory=rt;class st extends o.BaseSVGFactory{_createSVG(Wt){return document.createElementNS(c,Wt)}}i.DOMSVGFactory=st;class lt{constructor({viewBox:Wt,scale:jt,rotation:Ft,offsetX:Ht=0,offsetY:qt=0,dontFlip:Xt=!1}){this.viewBox=Wt,this.scale=jt,this.rotation=Ft,this.offsetX=Ht,this.offsetY=qt;const Tt=(Wt[2]+Wt[0])/2,gt=(Wt[3]+Wt[1])/2;let mt,At,Rt,Dt;switch(Ft%=360,Ft<0&&(Ft+=360),Ft){case 180:mt=-1,At=0,Rt=0,Dt=1;break;case 90:mt=0,At=1,Rt=1,Dt=0;break;case 270:mt=0,At=-1,Rt=-1,Dt=0;break;case 0:mt=1,At=0,Rt=0,Dt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Xt&&(Rt=-Rt,Dt=-Dt);let Ot,$t,zt,dt;mt===0?(Ot=Math.abs(gt-Wt[1])*jt+Ht,$t=Math.abs(Tt-Wt[0])*jt+qt,zt=Math.abs(Wt[3]-Wt[1])*jt,dt=Math.abs(Wt[2]-Wt[0])*jt):(Ot=Math.abs(Tt-Wt[0])*jt+Ht,$t=Math.abs(gt-Wt[1])*jt+qt,zt=Math.abs(Wt[2]-Wt[0])*jt,dt=Math.abs(Wt[3]-Wt[1])*jt),this.transform=[mt*jt,At*jt,Rt*jt,Dt*jt,Ot-mt*jt*Tt-Rt*jt*gt,$t-At*jt*Tt-Dt*jt*gt],this.width=zt,this.height=dt}clone({scale:Wt=this.scale,rotation:jt=this.rotation,offsetX:Ft=this.offsetX,offsetY:Ht=this.offsetY,dontFlip:qt=!1}={}){return new lt({viewBox:this.viewBox.slice(),scale:Wt,rotation:jt,offsetX:Ft,offsetY:Ht,dontFlip:qt})}convertToViewportPoint(Wt,jt){return a.Util.applyTransform([Wt,jt],this.transform)}convertToViewportRectangle(Wt){const jt=a.Util.applyTransform([Wt[0],Wt[1]],this.transform),Ft=a.Util.applyTransform([Wt[2],Wt[3]],this.transform);return[jt[0],jt[1],Ft[0],Ft[1]]}convertToPdfPoint(Wt,jt){return a.Util.applyInverseTransform([Wt,jt],this.transform)}}i.PageViewport=lt;class tt extends a.BaseException{constructor(Wt,jt){super(Wt,"RenderingCancelledException"),this.type=jt}}i.RenderingCancelledException=tt;function $(Yt){const Wt=Yt.length;let jt=0;for(;jt0?Wt:Yt.length,jt>0?jt:Yt.length);return Yt.substring(Yt.lastIndexOf("/",Ft)+1,Ft)}function it(Yt,Wt="document.pdf"){if(typeof Yt!="string")return Wt;if($(Yt))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),Wt;const jt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ft=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Ht=jt.exec(Yt);let qt=Ft.exec(Ht[1])||Ft.exec(Ht[2])||Ft.exec(Ht[3]);if(qt&&(qt=qt[0],qt.includes("%")))try{qt=Ft.exec(decodeURIComponent(qt))[0]}catch{}return qt||Wt}class nt{constructor(){this.started=Object.create(null),this.times=[]}time(Wt){Wt in this.started&&(0,a.warn)(`Timer is already running for ${Wt}`),this.started[Wt]=Date.now()}timeEnd(Wt){Wt in this.started||(0,a.warn)(`Timer has not been started for ${Wt}`),this.times.push({name:Wt,start:this.started[Wt],end:Date.now()}),delete this.started[Wt]}toString(){const Wt=[];let jt=0;for(const Ft of this.times){const Ht=Ft.name;Ht.length>jt&&(jt=Ht.length)}for(const Ft of this.times){const Ht=Ft.end-Ft.start;Wt.push(`${Ft.name.padEnd(jt)} ${Ht}ms `)}return Wt.join("")}}i.StatTimer=nt;function at(Yt,Wt){try{const{protocol:jt}=Wt?new URL(Yt,Wt):new URL(Yt);return jt==="http:"||jt==="https:"}catch{return!1}}function yt(Yt,Wt=!1){return new Promise((jt,Ft)=>{const Ht=document.createElement("script");Ht.src=Yt,Ht.onload=function(qt){Wt&&Ht.remove(),jt(qt)},Ht.onerror=function(){Ft(new Error(`Cannot load script at: ${Ht.src}`))},(document.head||document.documentElement).append(Ht)})}function vt(Yt){console.log("Deprecated API usage: "+Yt)}let xt;class ct{static toDateObject(Wt){if(!Wt||typeof Wt!="string")return null;xt||(xt=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const jt=xt.exec(Wt);if(!jt)return null;const Ft=parseInt(jt[1],10);let Ht=parseInt(jt[2],10);Ht=Ht>=1&&Ht<=12?Ht-1:0;let qt=parseInt(jt[3],10);qt=qt>=1&&qt<=31?qt:1;let Xt=parseInt(jt[4],10);Xt=Xt>=0&&Xt<=23?Xt:0;let Tt=parseInt(jt[5],10);Tt=Tt>=0&&Tt<=59?Tt:0;let gt=parseInt(jt[6],10);gt=gt>=0&><=59?gt:0;const mt=jt[7]||"Z";let At=parseInt(jt[8],10);At=At>=0&&At<=23?At:0;let Rt=parseInt(jt[9],10)||0;return Rt=Rt>=0&&Rt<=59?Rt:0,mt==="-"?(Xt+=At,Tt+=Rt):mt==="+"&&(Xt-=At,Tt-=Rt),new Date(Date.UTC(Ft,Ht,qt,Xt,Tt,gt))}}i.PDFDateString=ct;function pt(Yt,{scale:Wt=1,rotation:jt=0}){const{width:Ft,height:Ht}=Yt.attributes.style,qt=[0,0,parseInt(Ft),parseInt(Ht)];return new lt({viewBox:qt,scale:Wt,rotation:jt})}function ht(Yt){if(Yt.startsWith("#")){const Wt=parseInt(Yt.slice(1),16);return[(Wt&16711680)>>16,(Wt&65280)>>8,Wt&255]}return Yt.startsWith("rgb(")?Yt.slice(4,-1).split(",").map(Wt=>parseInt(Wt)):Yt.startsWith("rgba(")?Yt.slice(5,-1).split(",").map(Wt=>parseInt(Wt)).slice(0,3):((0,a.warn)(`Not a valid color format: "${Yt}"`),[0,0,0])}function Et(Yt){const Wt=document.createElement("span");Wt.style.visibility="hidden",document.body.append(Wt);for(const jt of Yt.keys()){Wt.style.color=jt;const Ft=window.getComputedStyle(Wt).color;Yt.set(jt,ht(Ft))}Wt.remove()}function Ct(Yt){const{a:Wt,b:jt,c:Ft,d:Ht,e:qt,f:Xt}=Yt.getTransform();return[Wt,jt,Ft,Ht,qt,Xt]}function Bt(Yt){const{a:Wt,b:jt,c:Ft,d:Ht,e:qt,f:Xt}=Yt.getTransform().invertSelf();return[Wt,jt,Ft,Ht,qt,Xt]}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseStandardFontDataFactory=i.BaseSVGFactory=i.BaseCanvasFactory=i.BaseCMapReaderFactory=void 0;var o=s(1);class a{constructor(){this.constructor===a&&(0,o.unreachable)("Cannot initialize BaseCanvasFactory.")}create(b,_e){if(b<=0||_e<=0)throw new Error("Invalid canvas size");const rt=this._createCanvas(b,_e);return{canvas:rt,context:rt.getContext("2d")}}reset(b,_e,rt){if(!b.canvas)throw new Error("Canvas is not specified");if(_e<=0||rt<=0)throw new Error("Invalid canvas size");b.canvas.width=_e,b.canvas.height=rt}destroy(b){if(!b.canvas)throw new Error("Canvas is not specified");b.canvas.width=0,b.canvas.height=0,b.canvas=null,b.context=null}_createCanvas(b,_e){(0,o.unreachable)("Abstract method `_createCanvas` called.")}}i.BaseCanvasFactory=a;class c{constructor({baseUrl:b=null,isCompressed:_e=!1}){this.constructor===c&&(0,o.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=b,this.isCompressed=_e}async fetch({name:b}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!b)throw new Error("CMap name must be specified.");const _e=this.baseUrl+b+(this.isCompressed?".bcmap":""),rt=this.isCompressed?o.CMapCompressionType.BINARY:o.CMapCompressionType.NONE;return this._fetchData(_e,rt).catch(st=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${_e}`)})}_fetchData(b,_e){(0,o.unreachable)("Abstract method `_fetchData` called.")}}i.BaseCMapReaderFactory=c;class d{constructor({baseUrl:b=null}){this.constructor===d&&(0,o.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=b}async fetch({filename:b}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!b)throw new Error("Font filename must be specified.");const _e=`${this.baseUrl}${b}`;return this._fetchData(_e).catch(rt=>{throw new Error(`Unable to load font data at: ${_e}`)})}_fetchData(b){(0,o.unreachable)("Abstract method `_fetchData` called.")}}i.BaseStandardFontDataFactory=d;class g{constructor(){this.constructor===g&&(0,o.unreachable)("Cannot initialize BaseSVGFactory.")}create(b,_e,rt=!1){if(b<=0||_e<=0)throw new Error("Invalid SVG dimensions");const st=this._createSVG("svg:svg");return st.setAttribute("version","1.1"),rt||(st.setAttribute("width",`${b}px`),st.setAttribute("height",`${_e}px`)),st.setAttribute("preserveAspectRatio","none"),st.setAttribute("viewBox",`0 0 ${b} ${_e}`),st}createElement(b){if(typeof b!="string")throw new Error("Invalid SVG element type");return this._createSVG(b)}_createSVG(b){(0,o.unreachable)("Abstract method `_createSVG` called.")}}i.BaseSVGFactory=g},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.MurmurHash3_64=void 0;var o=s(1);const a=3285377520,c=4294901760,d=65535;class g{constructor(b){this.h1=b?b&4294967295:a,this.h2=b?b&4294967295:a}update(b){let _e,rt;if(typeof b=="string"){_e=new Uint8Array(b.length*2),rt=0;for(let xt=0,ct=b.length;xt>>8,_e[rt++]=pt&255)}}else if((0,o.isArrayBuffer)(b))_e=b.slice(),rt=_e.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const st=rt>>2,lt=rt-st*4,tt=new Uint32Array(_e.buffer,0,st);let $=0,ot=0,et=this.h1,it=this.h2;const nt=3432918353,at=461845907,yt=nt&d,vt=at&d;for(let xt=0;xt>>17,$=$*at&c|$*vt&d,et^=$,et=et<<13|et>>>19,et=et*5+3864292196):(ot=tt[xt],ot=ot*nt&c|ot*yt&d,ot=ot<<15|ot>>>17,ot=ot*at&c|ot*vt&d,it^=ot,it=it<<13|it>>>19,it=it*5+3864292196);switch($=0,lt){case 3:$^=_e[st*4+2]<<16;case 2:$^=_e[st*4+1]<<8;case 1:$^=_e[st*4],$=$*nt&c|$*yt&d,$=$<<15|$>>>17,$=$*at&c|$*vt&d,st&1?et^=$:it^=$}this.h1=et,this.h2=it}hexdigest(){let b=this.h1,_e=this.h2;b^=_e>>>1,b=b*3981806797&c|b*36045&d,_e=_e*4283543511&c|((_e<<16|b>>>16)*2950163797&c)>>>16,b^=_e>>>1,b=b*444984403&c|b*60499&d,_e=_e*3301882366&c|((_e<<16|b>>>16)*3120437893&c)>>>16,b^=_e>>>1;const rt=(b>>>0).toString(16),st=(_e>>>0).toString(16);return rt.padStart(8,"0")+st.padStart(8,"0")}}i.MurmurHash3_64=g},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FontLoader=i.FontFaceObject=void 0;var o=s(1);class a{constructor({docId:_,onUnsupportedFeature:b,ownerDocument:_e=globalThis.document,styleElement:rt=null}){this.constructor===a&&(0,o.unreachable)("Cannot initialize BaseFontLoader."),this.docId=_,this._onUnsupportedFeature=b,this._document=_e,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(_){this.nativeFontFaces.push(_),this._document.fonts.add(_)}insertRule(_){let b=this.styleElement;b||(b=this.styleElement=this._document.createElement("style"),b.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].append(b));const _e=b.sheet;_e.insertRule(_,_e.cssRules.length)}clear(){for(const _ of this.nativeFontFaces)this._document.fonts.delete(_);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(_){if(_.attached||_.missingFile)return;if(_.attached=!0,this.isFontLoadingAPISupported){const _e=_.createNativeFontFace();if(_e){this.addNativeFontFace(_e);try{await _e.loaded}catch(rt){throw this._onUnsupportedFeature({featureId:o.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,o.warn)(`Failed to load font '${_e.family}': '${rt}'.`),_.disableFontFace=!0,rt}}return}const b=_.createFontFaceRule();if(b){if(this.insertRule(b),this.isSyncFontLoadingSupported)return;await new Promise(_e=>{const rt=this._queueLoadingCallback(_e);this._prepareFontLoadEvent([b],[_],rt)})}}_queueLoadingCallback(_){(0,o.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){var b;const _=!!((b=this._document)!=null&&b.fonts);return(0,o.shadow)(this,"isFontLoadingAPISupported",_)}get isSyncFontLoadingSupported(){(0,o.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,o.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(_,b,_e){(0,o.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let c;i.FontLoader=c,i.FontLoader=c=class extends a{constructor(_){super(_),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let _=!1;if(typeof navigator>"u")_=!0;else{const b=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(b==null?void 0:b[1])>=14&&(_=!0)}return(0,o.shadow)(this,"isSyncFontLoadingSupported",_)}_queueLoadingCallback(_){function b(){for((0,o.assert)(!rt.done,"completeRequest() cannot be called twice."),rt.done=!0;_e.requests.length>0&&_e.requests[0].done;){const st=_e.requests.shift();setTimeout(st.callback,0)}}const _e=this.loadingContext,rt={id:`pdfjs-font-loading-${_e.nextRequestId++}`,done:!1,complete:b,callback:_};return _e.requests.push(rt),rt}get _loadTestFont(){const _=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,o.shadow)(this,"_loadTestFont",_())}_prepareFontLoadEvent(_,b,_e){function rt(Bt,Lt){return Bt.charCodeAt(Lt)<<24|Bt.charCodeAt(Lt+1)<<16|Bt.charCodeAt(Lt+2)<<8|Bt.charCodeAt(Lt+3)&255}function st(Bt,Lt,Yt,Wt){const jt=Bt.substring(0,Lt),Ft=Bt.substring(Lt+Yt);return jt+Wt+Ft}let lt,tt;const $=this._document.createElement("canvas");$.width=1,$.height=1;const ot=$.getContext("2d");let et=0;function it(Bt,Lt){if(et++,et>30){(0,o.warn)("Load test font never loaded."),Lt();return}if(ot.font="30px "+Bt,ot.fillText(".",0,20),ot.getImageData(0,0,1,1).data[3]>0){Lt();return}setTimeout(it.bind(null,Bt,Lt))}const nt=`lt${Date.now()}${this.loadTestFontId++}`;let at=this._loadTestFont;at=st(at,976,nt.length,nt);const vt=16,xt=1482184792;let ct=rt(at,vt);for(lt=0,tt=nt.length-3;lt{Ct.remove(),_e.complete()})}};class d{constructor(_,{isEvalSupported:b=!0,disableFontFace:_e=!1,ignoreErrors:rt=!1,onUnsupportedFeature:st,fontRegistry:lt=null}){this.compiledGlyphs=Object.create(null);for(const tt in _)this[tt]=_[tt];this.isEvalSupported=b!==!1,this.disableFontFace=_e===!0,this.ignoreErrors=rt===!0,this._onUnsupportedFeature=st,this.fontRegistry=lt}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let _;if(!this.cssFontInfo)_=new FontFace(this.loadedName,this.data,{});else{const b={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(b.style=`oblique ${this.cssFontInfo.italicAngle}deg`),_=new FontFace(this.cssFontInfo.fontFamily,this.data,b)}return this.fontRegistry&&this.fontRegistry.registerFont(this),_}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const _=(0,o.bytesToString)(this.data),b=`url(data:${this.mimetype};base64,${btoa(_)});`;let _e;if(!this.cssFontInfo)_e=`@font-face {font-family:"${this.loadedName}";src:${b}}`;else{let rt=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(rt+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),_e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${rt}src:${b}}`}return this.fontRegistry&&this.fontRegistry.registerFont(this,b),_e}getPathGenerator(_,b){if(this.compiledGlyphs[b]!==void 0)return this.compiledGlyphs[b];let _e;try{_e=_.get(this.loadedName+"_path_"+b)}catch(rt){if(!this.ignoreErrors)throw rt;return this._onUnsupportedFeature({featureId:o.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,o.warn)(`getPathGenerator - ignoring character: "${rt}".`),this.compiledGlyphs[b]=function(st,lt){}}if(this.isEvalSupported&&o.FeatureTest.isEvalSupported){const rt=[];for(const st of _e){const lt=st.args!==void 0?st.args.join(","):"";rt.push("c.",st.cmd,"(",lt,`); `)}return this.compiledGlyphs[b]=new Function("c","size",rt.join(""))}return this.compiledGlyphs[b]=function(rt,st){for(const lt of _e)lt.cmd==="scale"&&(lt.args=[st,-st]),rt[lt.cmd].apply(rt,lt.args)}}}i.FontFaceObject=d},(e,i,s)=>{var Ht,vs;Object.defineProperty(i,"__esModule",{value:!0}),i.CanvasGraphics=void 0;var o=s(8),a=s(1),c=s(13),d=s(14),g=s(3);const _=16,b=100,_e=4096,rt=15,st=10,lt=g.isNodeJS&&typeof Path2D>"u"?-1:1e3,tt=16;function $(Tt,gt){if(Tt._removeMirroring)throw new Error("Context is already forwarding operations.");Tt.__originalSave=Tt.save,Tt.__originalRestore=Tt.restore,Tt.__originalRotate=Tt.rotate,Tt.__originalScale=Tt.scale,Tt.__originalTranslate=Tt.translate,Tt.__originalTransform=Tt.transform,Tt.__originalSetTransform=Tt.setTransform,Tt.__originalResetTransform=Tt.resetTransform,Tt.__originalClip=Tt.clip,Tt.__originalMoveTo=Tt.moveTo,Tt.__originalLineTo=Tt.lineTo,Tt.__originalBezierCurveTo=Tt.bezierCurveTo,Tt.__originalRect=Tt.rect,Tt.__originalClosePath=Tt.closePath,Tt.__originalBeginPath=Tt.beginPath,Tt._removeMirroring=()=>{Tt.save=Tt.__originalSave,Tt.restore=Tt.__originalRestore,Tt.rotate=Tt.__originalRotate,Tt.scale=Tt.__originalScale,Tt.translate=Tt.__originalTranslate,Tt.transform=Tt.__originalTransform,Tt.setTransform=Tt.__originalSetTransform,Tt.resetTransform=Tt.__originalResetTransform,Tt.clip=Tt.__originalClip,Tt.moveTo=Tt.__originalMoveTo,Tt.lineTo=Tt.__originalLineTo,Tt.bezierCurveTo=Tt.__originalBezierCurveTo,Tt.rect=Tt.__originalRect,Tt.closePath=Tt.__originalClosePath,Tt.beginPath=Tt.__originalBeginPath,delete Tt._removeMirroring},Tt.save=function(){gt.save(),this.__originalSave()},Tt.restore=function(){gt.restore(),this.__originalRestore()},Tt.translate=function(At,Rt){gt.translate(At,Rt),this.__originalTranslate(At,Rt)},Tt.scale=function(At,Rt){gt.scale(At,Rt),this.__originalScale(At,Rt)},Tt.transform=function(At,Rt,Dt,Ot,$t,zt){gt.transform(At,Rt,Dt,Ot,$t,zt),this.__originalTransform(At,Rt,Dt,Ot,$t,zt)},Tt.setTransform=function(At,Rt,Dt,Ot,$t,zt){gt.setTransform(At,Rt,Dt,Ot,$t,zt),this.__originalSetTransform(At,Rt,Dt,Ot,$t,zt)},Tt.resetTransform=function(){gt.resetTransform(),this.__originalResetTransform()},Tt.rotate=function(At){gt.rotate(At),this.__originalRotate(At)},Tt.clip=function(At){gt.clip(At),this.__originalClip(At)},Tt.moveTo=function(mt,At){gt.moveTo(mt,At),this.__originalMoveTo(mt,At)},Tt.lineTo=function(mt,At){gt.lineTo(mt,At),this.__originalLineTo(mt,At)},Tt.bezierCurveTo=function(mt,At,Rt,Dt,Ot,$t){gt.bezierCurveTo(mt,At,Rt,Dt,Ot,$t),this.__originalBezierCurveTo(mt,At,Rt,Dt,Ot,$t)},Tt.rect=function(mt,At,Rt,Dt){gt.rect(mt,At,Rt,Dt),this.__originalRect(mt,At,Rt,Dt)},Tt.closePath=function(){gt.closePath(),this.__originalClosePath()},Tt.beginPath=function(){gt.beginPath(),this.__originalBeginPath()}}class ot{constructor(gt){this.canvasFactory=gt,this.cache=Object.create(null)}getCanvas(gt,mt,At){let Rt;return this.cache[gt]!==void 0?(Rt=this.cache[gt],this.canvasFactory.reset(Rt,mt,At)):(Rt=this.canvasFactory.create(mt,At),this.cache[gt]=Rt),Rt}delete(gt){delete this.cache[gt]}clear(){for(const gt in this.cache){const mt=this.cache[gt];this.canvasFactory.destroy(mt),delete this.cache[gt]}}}function et(Tt,gt,mt,At,Rt,Dt,Ot,$t,zt,dt){const[_t,St,wt,kt,Nt,Zt]=(0,o.getCurrentTransform)(Tt);if(St===0&&wt===0){const tn=Ot*_t+Nt,Kt=Math.round(tn),nn=$t*kt+Zt,ln=Math.round(nn),Mt=(Ot+zt)*_t+Nt,sn=Math.abs(Math.round(Mt)-Kt)||1,gn=($t+dt)*kt+Zt,vn=Math.abs(Math.round(gn)-ln)||1;return Tt.setTransform(Math.sign(_t),0,0,Math.sign(kt),Kt,ln),Tt.drawImage(gt,mt,At,Rt,Dt,0,0,sn,vn),Tt.setTransform(_t,St,wt,kt,Nt,Zt),[sn,vn]}if(_t===0&&kt===0){const tn=$t*wt+Nt,Kt=Math.round(tn),nn=Ot*St+Zt,ln=Math.round(nn),Mt=($t+dt)*wt+Nt,sn=Math.abs(Math.round(Mt)-Kt)||1,gn=(Ot+zt)*St+Zt,vn=Math.abs(Math.round(gn)-ln)||1;return Tt.setTransform(0,Math.sign(St),Math.sign(wt),0,Kt,ln),Tt.drawImage(gt,mt,At,Rt,Dt,0,0,vn,sn),Tt.setTransform(_t,St,wt,kt,Nt,Zt),[vn,sn]}Tt.drawImage(gt,mt,At,Rt,Dt,Ot,$t,zt,dt);const an=Math.hypot(_t,St),Qt=Math.hypot(wt,kt);return[an*zt,Qt*dt]}function it(Tt){const{width:gt,height:mt}=Tt;if(gt>lt||mt>lt)return null;const At=1e3,Rt=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),Dt=gt+1;let Ot=new Uint8Array(Dt*(mt+1)),$t,zt,dt;const _t=gt+7&-8;let St=new Uint8Array(_t*mt),wt=0;for(const Qt of Tt.data){let tn=128;for(;tn>0;)St[wt++]=Qt&tn?0:255,tn>>=1}let kt=0;for(wt=0,St[wt]!==0&&(Ot[0]=1,++kt),zt=1;zt>2)+(St[wt+1]?4:0)+(St[wt-_t+1]?8:0),Rt[Qt]&&(Ot[dt+zt]=Rt[Qt],++kt),wt++;if(St[wt-_t]!==St[wt]&&(Ot[dt+zt]=St[wt]?2:4,++kt),kt>At)return null}for(wt=_t*(mt-1),dt=$t*Dt,St[wt]!==0&&(Ot[dt]=8,++kt),zt=1;ztAt)return null;const Nt=new Int32Array([0,Dt,-1,0,-Dt,0,0,0,1]),Zt=new Path2D;for($t=0;kt&&$t<=mt;$t++){let Qt=$t*Dt;const tn=Qt+gt;for(;Qt>4,Ot[Qt]&=nn>>2|nn<<2),Zt.lineTo(Qt%Dt,Qt/Dt|0),Ot[Qt]||--kt}while(Kt!==Qt);--$t}return St=null,Ot=null,function(Qt){Qt.save(),Qt.scale(1/gt,-1/mt),Qt.translate(0,-mt),Qt.fill(Zt),Qt.beginPath(),Qt.restore()}}class nt{constructor(gt,mt){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=a.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=a.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,gt,mt])}clone(){const gt=Object.create(this);return gt.clipBox=this.clipBox.slice(),gt}setCurrentPoint(gt,mt){this.x=gt,this.y=mt}updatePathMinMax(gt,mt,At){[mt,At]=a.Util.applyTransform([mt,At],gt),this.minX=Math.min(this.minX,mt),this.minY=Math.min(this.minY,At),this.maxX=Math.max(this.maxX,mt),this.maxY=Math.max(this.maxY,At)}updateRectMinMax(gt,mt){const At=a.Util.applyTransform(mt,gt),Rt=a.Util.applyTransform(mt.slice(2),gt);this.minX=Math.min(this.minX,At[0],Rt[0]),this.minY=Math.min(this.minY,At[1],Rt[1]),this.maxX=Math.max(this.maxX,At[0],Rt[0]),this.maxY=Math.max(this.maxY,At[1],Rt[1])}updateScalingPathMinMax(gt,mt){a.Util.scaleMinMax(gt,mt),this.minX=Math.min(this.minX,mt[0]),this.maxX=Math.max(this.maxX,mt[1]),this.minY=Math.min(this.minY,mt[2]),this.maxY=Math.max(this.maxY,mt[3])}updateCurvePathMinMax(gt,mt,At,Rt,Dt,Ot,$t,zt,dt,_t){const St=a.Util.bezierBoundingBox(mt,At,Rt,Dt,Ot,$t,zt,dt);if(_t){_t[0]=Math.min(_t[0],St[0],St[2]),_t[1]=Math.max(_t[1],St[0],St[2]),_t[2]=Math.min(_t[2],St[1],St[3]),_t[3]=Math.max(_t[3],St[1],St[3]);return}this.updateRectMinMax(gt,St)}getPathBoundingBox(gt=c.PathType.FILL,mt=null){const At=[this.minX,this.minY,this.maxX,this.maxY];if(gt===c.PathType.STROKE){mt||(0,a.unreachable)("Stroke bounding box must include transform.");const Rt=a.Util.singularValueDecompose2dScale(mt),Dt=Rt[0]*this.lineWidth/2,Ot=Rt[1]*this.lineWidth/2;At[0]-=Dt,At[1]-=Ot,At[2]+=Dt,At[3]+=Ot}return At}updateClipFromPath(){const gt=a.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(gt||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(gt){this.clipBox=gt,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(gt=c.PathType.FILL,mt=null){return a.Util.intersect(this.clipBox,this.getPathBoundingBox(gt,mt))}}function at(Tt,gt,mt=null){if(typeof ImageData<"u"&> instanceof ImageData){Tt.putImageData(gt,0,0);return}const At=gt.height,Rt=gt.width,Dt=At%tt,Ot=(At-Dt)/tt,$t=Dt===0?Ot:Ot+1,zt=Tt.createImageData(Rt,tt);let dt=0,_t;const St=gt.data,wt=zt.data;let kt,Nt,Zt,an,Qt,tn,Kt,nn;if(mt)switch(mt.length){case 1:Qt=mt[0],tn=mt[0],Kt=mt[0],nn=mt[0];break;case 4:Qt=mt[0],tn=mt[1],Kt=mt[2],nn=mt[3];break}if(gt.kind===a.ImageKind.GRAYSCALE_1BPP){const ln=St.byteLength,Mt=new Uint32Array(wt.buffer,0,wt.byteLength>>2),sn=Mt.length,gn=Rt+7>>3;let vn=4294967295,_n=a.FeatureTest.isLittleEndian?4278190080:255;for(nn&&nn[0]===255&&nn[255]===0&&([vn,_n]=[_n,vn]),kt=0;kt<$t;kt++){for(Zt=ktgn?Rt:mn*8-7,Qn=Dn&-8;let Pn=0,jn=0;for(;Mn>=1}for(;_t=Ot&&(Zt=Dt,an=Rt*Zt),_t=0,Nt=an;Nt--;)wt[_t++]=St[dt++],wt[_t++]=St[dt++],wt[_t++]=St[dt++],wt[_t++]=255;if(ln)for(let Mt=0;Mt<_t;Mt+=4)Qt&&(wt[Mt+0]=Qt[wt[Mt+0]]),tn&&(wt[Mt+1]=tn[wt[Mt+1]]),Kt&&(wt[Mt+2]=Kt[wt[Mt+2]]);Tt.putImageData(zt,0,kt*tt)}}else throw new Error(`bad image kind: ${gt.kind}`)}function yt(Tt,gt){if(gt.bitmap){Tt.drawImage(gt.bitmap,0,0);return}const mt=gt.height,At=gt.width,Rt=mt%tt,Dt=(mt-Rt)/tt,Ot=Rt===0?Dt:Dt+1,$t=Tt.createImageData(At,tt);let zt=0;const dt=gt.data,_t=$t.data;for(let St=0;St>8,Tt[Dt-2]=Tt[Dt-2]*Ot+mt*$t>>8,Tt[Dt-1]=Tt[Dt-1]*Ot+At*$t>>8}}}function pt(Tt,gt,mt){const At=Tt.length,Rt=1/255;for(let Dt=3;Dt>8]>>8:gt[Rt]*Dt>>16}}function Et(Tt,gt,mt,At,Rt,Dt,Ot,$t,zt,dt,_t){const St=!!Dt,wt=St?Dt[0]:0,kt=St?Dt[1]:0,Nt=St?Dt[2]:0;let Zt;Rt==="Luminosity"?Zt=ht:Zt=pt;const Qt=Math.min(At,Math.ceil(1048576/mt));for(let tn=0;tn(Qt/=255,Qt<=.03928?Qt/12.92:((Qt+.055)/1.055)**2.4),an=Math.round(.2126*Zt(wt)+.7152*Zt(kt)+.0722*Zt(Nt));this.selectColor=(Qt,tn,Kt)=>{const nn=.2126*Zt(Qt)+.7152*Zt(tn)+.0722*Zt(Kt);return Math.round(nn)===an?dt:zt}}}if(this.ctx.fillStyle=this.backgroundColor||$t,this.ctx.fillRect(0,0,Dt,Ot),this.ctx.restore(),At){const zt=this.cachedCanvases.getCanvas("transparent",Dt,Ot);this.compositeCtx=this.ctx,this.transparentCanvas=zt.canvas,this.ctx=zt.context,this.ctx.save(),this.ctx.transform(...(0,o.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),xt(this.ctx,this.foregroundColor),gt&&(this.ctx.transform(...gt),this.outputScaleX=gt[0],this.outputScaleY=gt[0]),this.ctx.transform(...mt.transform),this.viewportScale=mt.scale,this.baseTransform=(0,o.getCurrentTransform)(this.ctx),this.imageLayer&&((0,o.deprecated)("The `imageLayer` functionality will be removed in the future."),this.imageLayer.beginLayout())}executeOperatorList(gt,mt,At,Rt){const Dt=gt.argsArray,Ot=gt.fnArray;let $t=mt||0;const zt=Dt.length;if(zt===$t)return $t;const dt=zt-$t>st&&typeof At=="function",_t=dt?Date.now()+rt:0;let St=0;const wt=this.commonObjs,kt=this.objs;let Nt;for(;;){if(Rt!==void 0&&$t===Rt.nextBreakPoint)return Rt.breakIt($t,At),$t;if(Nt=Ot[$t],Nt!==a.OPS.dependency)this[Nt].apply(this,Dt[$t]);else for(const Zt of Dt[$t]){const an=Zt.startsWith("g_")?wt:kt;if(!an.has(Zt))return an.get(Zt,At),$t}if($t++,$t===zt)return $t;if(dt&&++St>st){if(Date.now()>_t)return At(),$t;St=0}}}endDrawing(){on(this,Ht,vs).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const gt of this._cachedBitmapsMap.values()){for(const mt of gt.values())typeof HTMLCanvasElement<"u"&&mt instanceof HTMLCanvasElement&&(mt.width=mt.height=0);gt.clear()}this._cachedBitmapsMap.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(gt,mt){const At=gt.width,Rt=gt.height;let Dt=Math.max(Math.hypot(mt[0],mt[1]),1),Ot=Math.max(Math.hypot(mt[2],mt[3]),1),$t=At,zt=Rt,dt="prescale1",_t,St;for(;Dt>2&&$t>1||Ot>2&&zt>1;){let wt=$t,kt=zt;Dt>2&&$t>1&&(wt=Math.ceil($t/2),Dt/=$t/wt),Ot>2&&zt>1&&(kt=Math.ceil(zt/2),Ot/=zt/kt),_t=this.cachedCanvases.getCanvas(dt,wt,kt),St=_t.context,St.clearRect(0,0,wt,kt),St.drawImage(gt,0,0,$t,zt,0,0,wt,kt),gt=_t.canvas,$t=wt,zt=kt,dt=dt==="prescale1"?"prescale2":"prescale1"}return{img:gt,paintWidth:$t,paintHeight:zt}}_createMaskCanvas(gt){const mt=this.ctx,{width:At,height:Rt}=gt,Dt=this.current.fillColor,Ot=this.current.patternFill,$t=(0,o.getCurrentTransform)(mt);let zt,dt,_t,St;if((gt.bitmap||gt.data)&>.count>1){const sn=gt.bitmap||gt.data.buffer,gn=$t.slice(0,4);dt=JSON.stringify(Ot?gn:[gn,Dt]),zt=this._cachedBitmapsMap.get(sn),zt||(zt=new Map,this._cachedBitmapsMap.set(sn,zt));const vn=zt.get(dt);if(vn&&!Ot){const _n=Math.round(Math.min($t[0],$t[2])+$t[4]),mn=Math.round(Math.min($t[1],$t[3])+$t[5]);return{canvas:vn,offsetX:_n,offsetY:mn}}_t=vn}_t||(St=this.cachedCanvases.getCanvas("maskCanvas",At,Rt),yt(St.context,gt));let wt=a.Util.transform($t,[1/At,0,0,-1/Rt,0,0]);wt=a.Util.transform(wt,[1,0,0,1,0,-Rt]);const kt=a.Util.applyTransform([0,0],wt),Nt=a.Util.applyTransform([At,Rt],wt),Zt=a.Util.normalizeRect([kt[0],kt[1],Nt[0],Nt[1]]),an=Math.round(Zt[2]-Zt[0])||1,Qt=Math.round(Zt[3]-Zt[1])||1,tn=this.cachedCanvases.getCanvas("fillCanvas",an,Qt),Kt=tn.context,nn=Math.min(kt[0],Nt[0]),ln=Math.min(kt[1],Nt[1]);Kt.translate(-nn,-ln),Kt.transform(...wt),_t||(_t=this._scaleImage(St.canvas,(0,o.getCurrentTransformInverse)(Kt)),_t=_t.img,zt&&Ot&&zt.set(dt,_t)),Kt.imageSmoothingEnabled=Bt((0,o.getCurrentTransform)(Kt),gt.interpolate),et(Kt,_t,0,0,_t.width,_t.height,0,0,At,Rt),Kt.globalCompositeOperation="source-in";const Mt=a.Util.transform((0,o.getCurrentTransformInverse)(Kt),[1,0,0,1,-nn,-ln]);return Kt.fillStyle=Ot?Dt.getPattern(mt,this,Mt,c.PathType.FILL):Dt,Kt.fillRect(0,0,At,Rt),zt&&!Ot&&(this.cachedCanvases.delete("fillCanvas"),zt.set(dt,tn.canvas)),{canvas:tn.canvas,offsetX:Math.round(nn),offsetY:Math.round(ln)}}setLineWidth(gt){gt!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=gt,this.ctx.lineWidth=gt}setLineCap(gt){this.ctx.lineCap=Lt[gt]}setLineJoin(gt){this.ctx.lineJoin=Yt[gt]}setMiterLimit(gt){this.ctx.miterLimit=gt}setDash(gt,mt){const At=this.ctx;At.setLineDash!==void 0&&(At.setLineDash(gt),At.lineDashOffset=mt)}setRenderingIntent(gt){}setFlatness(gt){}setGState(gt){for(let mt=0,At=gt.length;mtb&&(dt=b),this.current.fontSizeScale=mt/dt,this.ctx.font=`${$t} ${Ot} ${dt}px ${zt}`}setTextRenderingMode(gt){this.current.textRenderingMode=gt}setTextRise(gt){this.current.textRise=gt}moveText(gt,mt){this.current.x=this.current.lineX+=gt,this.current.y=this.current.lineY+=mt}setLeadingMoveText(gt,mt){this.setLeading(-mt),this.moveText(gt,mt)}setTextMatrix(gt,mt,At,Rt,Dt,Ot){this.current.textMatrix=[gt,mt,At,Rt,Dt,Ot],this.current.textMatrixScale=Math.hypot(gt,mt),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(gt,mt,At,Rt){const Dt=this.ctx,Ot=this.current,$t=Ot.font,zt=Ot.textRenderingMode,dt=Ot.fontSize/Ot.fontSizeScale,_t=zt&a.TextRenderingMode.FILL_STROKE_MASK,St=!!(zt&a.TextRenderingMode.ADD_TO_PATH_FLAG),wt=Ot.patternFill&&!$t.missingFile;let kt;($t.disableFontFace||St||wt)&&(kt=$t.getPathGenerator(this.commonObjs,gt)),$t.disableFontFace||wt?(Dt.save(),Dt.translate(mt,At),Dt.beginPath(),kt(Dt,dt),Rt&&Dt.setTransform(...Rt),(_t===a.TextRenderingMode.FILL||_t===a.TextRenderingMode.FILL_STROKE)&&Dt.fill(),(_t===a.TextRenderingMode.STROKE||_t===a.TextRenderingMode.FILL_STROKE)&&Dt.stroke(),Dt.restore()):((_t===a.TextRenderingMode.FILL||_t===a.TextRenderingMode.FILL_STROKE)&&Dt.fillText(gt,mt,At),(_t===a.TextRenderingMode.STROKE||_t===a.TextRenderingMode.FILL_STROKE)&&Dt.strokeText(gt,mt,At)),St&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,o.getCurrentTransform)(Dt),x:mt,y:At,fontSize:dt,addToPath:kt})}get isFontSubpixelAAEnabled(){const{context:gt}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);gt.scale(1.5,1),gt.fillText("I",0,10);const mt=gt.getImageData(0,0,10,10).data;let At=!1;for(let Rt=3;Rt0&&mt[Rt]<255){At=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",At)}showText(gt){const mt=this.current,At=mt.font;if(At.isType3Font)return this.showType3Text(gt);const Rt=mt.fontSize;if(Rt===0)return;const Dt=this.ctx,Ot=mt.fontSizeScale,$t=mt.charSpacing,zt=mt.wordSpacing,dt=mt.fontDirection,_t=mt.textHScale*dt,St=gt.length,wt=At.vertical,kt=wt?1:-1,Nt=At.defaultVMetrics,Zt=Rt*mt.fontMatrix[0],an=mt.textRenderingMode===a.TextRenderingMode.FILL&&!At.disableFontFace&&!mt.patternFill;Dt.save(),Dt.transform(...mt.textMatrix),Dt.translate(mt.x,mt.y+mt.textRise),dt>0?Dt.scale(_t,-1):Dt.scale(_t,1);let Qt;if(mt.patternFill){Dt.save();const Mt=mt.fillColor.getPattern(Dt,this,(0,o.getCurrentTransformInverse)(Dt),c.PathType.FILL);Qt=(0,o.getCurrentTransform)(Dt),Dt.restore(),Dt.fillStyle=Mt}let tn=mt.lineWidth;const Kt=mt.textMatrixScale;if(Kt===0||tn===0){const Mt=mt.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;(Mt===a.TextRenderingMode.STROKE||Mt===a.TextRenderingMode.FILL_STROKE)&&(tn=this.getSinglePixelWidth())}else tn/=Kt;Ot!==1&&(Dt.scale(Ot,Ot),tn/=Ot),Dt.lineWidth=tn;let nn=0,ln;for(ln=0;ln0){const Pn=Dt.measureText(vn).width*1e3/Rt*Ot;if(Dnnew Xt(Ot,this.commonObjs,this.objs,this.canvasFactory)};mt=new c.TilingPattern(gt,At,this.ctx,Dt,Rt)}else mt=this._getPattern(gt[1],gt[2]);return mt}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(gt,mt,At){var Dt;const Rt=((Dt=this.selectColor)==null?void 0:Dt.call(this,gt,mt,At))||a.Util.makeHexColor(gt,mt,At);this.ctx.strokeStyle=Rt,this.current.strokeColor=Rt}setFillRGBColor(gt,mt,At){var Dt;const Rt=((Dt=this.selectColor)==null?void 0:Dt.call(this,gt,mt,At))||a.Util.makeHexColor(gt,mt,At);this.ctx.fillStyle=Rt,this.current.fillColor=Rt,this.current.patternFill=!1}_getPattern(gt,mt=null){let At;return this.cachedPatterns.has(gt)?At=this.cachedPatterns.get(gt):(At=(0,c.getShadingPattern)(this.objs.get(gt)),this.cachedPatterns.set(gt,At)),mt&&(At.matrix=mt),At}shadingFill(gt){if(!this.contentVisible)return;const mt=this.ctx;this.save();const At=this._getPattern(gt);mt.fillStyle=At.getPattern(mt,this,(0,o.getCurrentTransformInverse)(mt),c.PathType.SHADING);const Rt=(0,o.getCurrentTransformInverse)(mt);if(Rt){const Dt=mt.canvas,Ot=Dt.width,$t=Dt.height,zt=a.Util.applyTransform([0,0],Rt),dt=a.Util.applyTransform([0,$t],Rt),_t=a.Util.applyTransform([Ot,0],Rt),St=a.Util.applyTransform([Ot,$t],Rt),wt=Math.min(zt[0],dt[0],_t[0],St[0]),kt=Math.min(zt[1],dt[1],_t[1],St[1]),Nt=Math.max(zt[0],dt[0],_t[0],St[0]),Zt=Math.max(zt[1],dt[1],_t[1],St[1]);this.ctx.fillRect(wt,kt,Nt-wt,Zt-kt)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,a.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,a.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(gt,mt){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(gt)&>.length===6&&this.transform(...gt),this.baseTransform=(0,o.getCurrentTransform)(this.ctx),mt)){const At=mt[2]-mt[0],Rt=mt[3]-mt[1];this.ctx.rect(mt[0],mt[1],At,Rt),this.current.updateRectMinMax((0,o.getCurrentTransform)(this.ctx),mt),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(gt){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const mt=this.ctx;gt.isolated||(0,a.info)("TODO: Support non-isolated groups."),gt.knockout&&(0,a.warn)("Knockout groups not supported.");const At=(0,o.getCurrentTransform)(mt);if(gt.matrix&&mt.transform(...gt.matrix),!gt.bbox)throw new Error("Bounding box is required.");let Rt=a.Util.getAxialAlignedBoundingBox(gt.bbox,(0,o.getCurrentTransform)(mt));const Dt=[0,0,mt.canvas.width,mt.canvas.height];Rt=a.Util.intersect(Rt,Dt)||[0,0,0,0];const Ot=Math.floor(Rt[0]),$t=Math.floor(Rt[1]);let zt=Math.max(Math.ceil(Rt[2])-Ot,1),dt=Math.max(Math.ceil(Rt[3])-$t,1),_t=1,St=1;zt>_e&&(_t=zt/_e,zt=_e),dt>_e&&(St=dt/_e,dt=_e),this.current.startNewPathAndClipBox([0,0,zt,dt]);let wt="groupAt"+this.groupLevel;gt.smask&&(wt+="_smask_"+this.smaskCounter++%2);const kt=this.cachedCanvases.getCanvas(wt,zt,dt),Nt=kt.context;Nt.scale(1/_t,1/St),Nt.translate(-Ot,-$t),Nt.transform(...At),gt.smask?this.smaskStack.push({canvas:kt.canvas,context:Nt,offsetX:Ot,offsetY:$t,scaleX:_t,scaleY:St,subtype:gt.smask.subtype,backdrop:gt.smask.backdrop,transferMap:gt.smask.transferMap||null,startTransformInverse:null}):(mt.setTransform(1,0,0,1,0,0),mt.translate(Ot,$t),mt.scale(_t,St),mt.save()),vt(mt,Nt),this.ctx=Nt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(mt),this.groupLevel++}endGroup(gt){if(!this.contentVisible)return;this.groupLevel--;const mt=this.ctx,At=this.groupStack.pop();if(this.ctx=At,this.ctx.imageSmoothingEnabled=!1,gt.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Rt=(0,o.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Rt);const Dt=a.Util.getAxialAlignedBoundingBox([0,0,mt.canvas.width,mt.canvas.height],Rt);this.ctx.drawImage(mt.canvas,0,0),this.ctx.restore(),this.compose(Dt)}}beginAnnotation(gt,mt,At,Rt,Dt){if(on(this,Ht,vs).call(this),xt(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(mt)&&mt.length===4){const Ot=mt[2]-mt[0],$t=mt[3]-mt[1];if(Dt&&this.annotationCanvasMap){At=At.slice(),At[4]-=mt[0],At[5]-=mt[1],mt=mt.slice(),mt[0]=mt[1]=0,mt[2]=Ot,mt[3]=$t;const[zt,dt]=a.Util.singularValueDecompose2dScale((0,o.getCurrentTransform)(this.ctx)),{viewportScale:_t}=this,St=Math.ceil(Ot*this.outputScaleX*_t),wt=Math.ceil($t*this.outputScaleY*_t);this.annotationCanvas=this.canvasFactory.create(St,wt);const{canvas:kt,context:Nt}=this.annotationCanvas;this.annotationCanvasMap.set(gt,kt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Nt,this.ctx.setTransform(zt,0,0,-dt,0,$t*dt),xt(this.ctx,this.foregroundColor)}else xt(this.ctx,this.foregroundColor),this.ctx.rect(mt[0],mt[1],Ot,$t),this.ctx.clip(),this.endPath()}this.current=new nt(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...At),this.transform(...Rt)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(gt){if(!this.contentVisible)return;const mt=gt.count;gt=this.getObject(gt.data,gt),gt.count=mt;const At=this.ctx,Rt=this.processingType3;if(Rt&&(Rt.compiled===void 0&&(Rt.compiled=it(gt)),Rt.compiled)){Rt.compiled(At);return}const Dt=this._createMaskCanvas(gt),Ot=Dt.canvas;At.save(),At.setTransform(1,0,0,1,0,0),At.drawImage(Ot,Dt.offsetX,Dt.offsetY),At.restore(),this.compose()}paintImageMaskXObjectRepeat(gt,mt,At=0,Rt=0,Dt,Ot){if(!this.contentVisible)return;gt=this.getObject(gt.data,gt);const $t=this.ctx;$t.save();const zt=(0,o.getCurrentTransform)($t);$t.transform(mt,At,Rt,Dt,0,0);const dt=this._createMaskCanvas(gt);$t.setTransform(1,0,0,1,0,0);for(let _t=0,St=Ot.length;_tzt?$t/zt:1,Rt=Ot>zt?Ot/zt:1}}this._cachedScaleForStroking=[At,Rt]}return this._cachedScaleForStroking}rescaleAndStroke(gt){const{ctx:mt}=this,{lineWidth:At}=this.current,[Rt,Dt]=this.getScaleForStroking();if(mt.lineWidth=At||1,Rt===1&&Dt===1){mt.stroke();return}let Ot,$t,zt;gt&&(Ot=(0,o.getCurrentTransform)(mt),$t=mt.getLineDash().slice(),zt=mt.lineDashOffset),mt.scale(Rt,Dt);const dt=Math.max(Rt,Dt);mt.setLineDash(mt.getLineDash().map(_t=>_t/dt)),mt.lineDashOffset/=dt,mt.stroke(),gt&&(mt.setTransform(...Ot),mt.setLineDash($t),mt.lineDashOffset=zt)}isContentVisible(){for(let gt=this.markedContentStack.length-1;gt>=0;gt--)if(!this.markedContentStack[gt].visible)return!1;return!0}};let Ft=Xt;Ht=new WeakSet,vs=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},i.CanvasGraphics=Ft;for(const Tt in a.OPS)Ft.prototype[Tt]!==void 0&&(Ft.prototype[a.OPS[Tt]]=Ft.prototype[Tt])},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TilingPattern=i.PathType=void 0,i.getShadingPattern=tt;var o=s(1),a=s(8),c=s(3);const d={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};i.PathType=d;function g(et,it){if(!it||c.isNodeJS)return;const nt=it[2]-it[0],at=it[3]-it[1],yt=new Path2D;yt.rect(it[0],it[1],nt,at),et.clip(yt)}class _{constructor(){this.constructor===_&&(0,o.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,o.unreachable)("Abstract method `getPattern` called.")}}class b extends _{constructor(it){super(),this._type=it[1],this._bbox=it[2],this._colorStops=it[3],this._p0=it[4],this._p1=it[5],this._r0=it[6],this._r1=it[7],this.matrix=null}_createGradient(it){let nt;this._type==="axial"?nt=it.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(nt=it.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const at of this._colorStops)nt.addColorStop(at[0],at[1]);return nt}getPattern(it,nt,at,yt){let vt;if(yt===d.STROKE||yt===d.FILL){const xt=nt.current.getClippedPathBoundingBox(yt,(0,a.getCurrentTransform)(it))||[0,0,0,0],ct=Math.ceil(xt[2]-xt[0])||1,pt=Math.ceil(xt[3]-xt[1])||1,ht=nt.cachedCanvases.getCanvas("pattern",ct,pt,!0),Et=ht.context;Et.clearRect(0,0,Et.canvas.width,Et.canvas.height),Et.beginPath(),Et.rect(0,0,Et.canvas.width,Et.canvas.height),Et.translate(-xt[0],-xt[1]),at=o.Util.transform(at,[1,0,0,1,xt[0],xt[1]]),Et.transform(...nt.baseTransform),this.matrix&&Et.transform(...this.matrix),g(Et,this._bbox),Et.fillStyle=this._createGradient(Et),Et.fill(),vt=it.createPattern(ht.canvas,"no-repeat");const Ct=new DOMMatrix(at);try{vt.setTransform(Ct)}catch(Bt){(0,o.warn)(`RadialAxialShadingPattern.getPattern: "${Bt==null?void 0:Bt.message}".`)}}else g(it,this._bbox),vt=this._createGradient(it);return vt}}function _e(et,it,nt,at,yt,vt,xt,ct){const pt=it.coords,ht=it.colors,Et=et.data,Ct=et.width*4;let Bt;pt[nt+1]>pt[at+1]&&(Bt=nt,nt=at,at=Bt,Bt=vt,vt=xt,xt=Bt),pt[at+1]>pt[yt+1]&&(Bt=at,at=yt,yt=Bt,Bt=xt,xt=ct,ct=Bt),pt[nt+1]>pt[at+1]&&(Bt=nt,nt=at,at=Bt,Bt=vt,vt=xt,xt=Bt);const Lt=(pt[nt]+it.offsetX)*it.scaleX,Yt=(pt[nt+1]+it.offsetY)*it.scaleY,Wt=(pt[at]+it.offsetX)*it.scaleX,jt=(pt[at+1]+it.offsetY)*it.scaleY,Ft=(pt[yt]+it.offsetX)*it.scaleX,Ht=(pt[yt+1]+it.offsetY)*it.scaleY;if(Yt>=Ht)return;const qt=ht[vt],Xt=ht[vt+1],Tt=ht[vt+2],gt=ht[xt],mt=ht[xt+1],At=ht[xt+2],Rt=ht[ct],Dt=ht[ct+1],Ot=ht[ct+2],$t=Math.round(Yt),zt=Math.round(Ht);let dt,_t,St,wt,kt,Nt,Zt,an;for(let Qt=$t;Qt<=zt;Qt++){if(QtHt?Mt=1:jt===Ht?Mt=0:Mt=(jt-Qt)/(jt-Ht),dt=Wt-(Wt-Ft)*Mt,_t=gt-(gt-Rt)*Mt,St=mt-(mt-Dt)*Mt,wt=At-(At-Ot)*Mt}let tn;QtHt?tn=1:tn=(Yt-Qt)/(Yt-Ht),kt=Lt-(Lt-Ft)*tn,Nt=qt-(qt-Rt)*tn,Zt=Xt-(Xt-Dt)*tn,an=Tt-(Tt-Ot)*tn;const Kt=Math.round(Math.min(dt,kt)),nn=Math.round(Math.max(dt,kt));let ln=Ct*Qt+Kt*4;for(let Mt=Kt;Mt<=nn;Mt++)tn=(dt-Mt)/(dt-kt),tn<0?tn=0:tn>1&&(tn=1),Et[ln++]=_t-(_t-Nt)*tn|0,Et[ln++]=St-(St-Zt)*tn|0,Et[ln++]=wt-(wt-an)*tn|0,Et[ln++]=255}}function rt(et,it,nt){const at=it.coords,yt=it.colors;let vt,xt;switch(it.type){case"lattice":const ct=it.verticesPerRow,pt=Math.floor(at.length/ct)-1,ht=ct-1;for(vt=0;vt=yt?vt=yt:at=vt/it,{scale:at,size:vt}}clipBbox(it,nt,at,yt,vt){const xt=yt-nt,ct=vt-at;it.ctx.rect(nt,at,xt,ct),it.current.updateRectMinMax((0,a.getCurrentTransform)(it.ctx),[nt,at,yt,vt]),it.clip(),it.endPath()}setFillAndStrokeStyleToContext(it,nt,at){const yt=it.ctx,vt=it.current;switch(nt){case $.COLORED:const xt=this.ctx;yt.fillStyle=xt.fillStyle,yt.strokeStyle=xt.strokeStyle,vt.fillColor=xt.fillStyle,vt.strokeColor=xt.strokeStyle;break;case $.UNCOLORED:const ct=o.Util.makeHexColor(at[0],at[1],at[2]);yt.fillStyle=ct,yt.strokeStyle=ct,vt.fillColor=ct,vt.strokeColor=ct;break;default:throw new o.FormatError(`Unsupported paint type: ${nt}`)}}getPattern(it,nt,at,yt){let vt=at;yt!==d.SHADING&&(vt=o.Util.transform(vt,nt.baseTransform),this.matrix&&(vt=o.Util.transform(vt,this.matrix)));const xt=this.createPatternCanvas(nt);let ct=new DOMMatrix(vt);ct=ct.translate(xt.offsetX,xt.offsetY),ct=ct.scale(1/xt.scaleX,1/xt.scaleY);const pt=it.createPattern(xt.canvas,"repeat");try{pt.setTransform(ct)}catch(ht){(0,o.warn)(`TilingPattern.getPattern: "${ht==null?void 0:ht.message}".`)}return pt}}i.TilingPattern=ot},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMaskImageData=a;var o=s(1);function a({src:c,srcPos:d=0,dest:g,destPos:_=0,width:b,height:_e,inverseDecode:rt=!1}){const st=o.FeatureTest.isLittleEndian?4278190080:255,[lt,tt]=rt?[0,st]:[st,0],$=b>>3,ot=b&7,et=c.length;g=new Uint32Array(g.buffer);for(let it=0;it<_e;it++){for(const at=d+$;d{Object.defineProperty(i,"__esModule",{value:!0}),i.GlobalWorkerOptions=void 0;const s=Object.create(null);i.GlobalWorkerOptions=s,s.workerPort=s.workerPort===void 0?null:s.workerPort,s.workerSrc=s.workerSrc===void 0?"":s.workerSrc},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.MessageHandler=void 0;var o=s(1);const a={UNKNOWN:0,DATA:1,ERROR:2},c={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function d(_){switch(_ instanceof Error||typeof _=="object"&&_!==null||(0,o.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),_.name){case"AbortException":return new o.AbortException(_.message);case"MissingPDFException":return new o.MissingPDFException(_.message);case"PasswordException":return new o.PasswordException(_.message,_.code);case"UnexpectedResponseException":return new o.UnexpectedResponseException(_.message,_.status);case"UnknownErrorException":return new o.UnknownErrorException(_.message,_.details);default:return new o.UnknownErrorException(_.message,_.toString())}}class g{constructor(b,_e,rt){this.sourceName=b,this.targetName=_e,this.comObj=rt,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=st=>{const lt=st.data;if(lt.targetName!==this.sourceName)return;if(lt.stream){this._processStreamMessage(lt);return}if(lt.callback){const $=lt.callbackId,ot=this.callbackCapabilities[$];if(!ot)throw new Error(`Cannot resolve callback ${$}`);if(delete this.callbackCapabilities[$],lt.callback===a.DATA)ot.resolve(lt.data);else if(lt.callback===a.ERROR)ot.reject(d(lt.reason));else throw new Error("Unexpected callback case");return}const tt=this.actionHandler[lt.action];if(!tt)throw new Error(`Unknown action from worker: ${lt.action}`);if(lt.callbackId){const $=this.sourceName,ot=lt.sourceName;new Promise(function(et){et(tt(lt.data))}).then(function(et){rt.postMessage({sourceName:$,targetName:ot,callback:a.DATA,callbackId:lt.callbackId,data:et})},function(et){rt.postMessage({sourceName:$,targetName:ot,callback:a.ERROR,callbackId:lt.callbackId,reason:d(et)})});return}if(lt.streamId){this._createStreamSink(lt);return}tt(lt.data)},rt.addEventListener("message",this._onComObjOnMessage)}on(b,_e){const rt=this.actionHandler;if(rt[b])throw new Error(`There is already an actionName called "${b}"`);rt[b]=_e}send(b,_e,rt){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:b,data:_e},rt)}sendWithPromise(b,_e,rt){const st=this.callbackId++,lt=(0,o.createPromiseCapability)();this.callbackCapabilities[st]=lt;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:b,callbackId:st,data:_e},rt)}catch(tt){lt.reject(tt)}return lt.promise}sendWithStream(b,_e,rt,st){const lt=this.streamId++,tt=this.sourceName,$=this.targetName,ot=this.comObj;return new ReadableStream({start:et=>{const it=(0,o.createPromiseCapability)();return this.streamControllers[lt]={controller:et,startCall:it,pullCall:null,cancelCall:null,isClosed:!1},ot.postMessage({sourceName:tt,targetName:$,action:b,streamId:lt,data:_e,desiredSize:et.desiredSize},st),it.promise},pull:et=>{const it=(0,o.createPromiseCapability)();return this.streamControllers[lt].pullCall=it,ot.postMessage({sourceName:tt,targetName:$,stream:c.PULL,streamId:lt,desiredSize:et.desiredSize}),it.promise},cancel:et=>{(0,o.assert)(et instanceof Error,"cancel must have a valid reason");const it=(0,o.createPromiseCapability)();return this.streamControllers[lt].cancelCall=it,this.streamControllers[lt].isClosed=!0,ot.postMessage({sourceName:tt,targetName:$,stream:c.CANCEL,streamId:lt,reason:d(et)}),it.promise}},rt)}_createStreamSink(b){const _e=b.streamId,rt=this.sourceName,st=b.sourceName,lt=this.comObj,tt=this,$=this.actionHandler[b.action],ot={enqueue(et,it=1,nt){if(this.isCancelled)return;const at=this.desiredSize;this.desiredSize-=it,at>0&&this.desiredSize<=0&&(this.sinkCapability=(0,o.createPromiseCapability)(),this.ready=this.sinkCapability.promise),lt.postMessage({sourceName:rt,targetName:st,stream:c.ENQUEUE,streamId:_e,chunk:et},nt)},close(){this.isCancelled||(this.isCancelled=!0,lt.postMessage({sourceName:rt,targetName:st,stream:c.CLOSE,streamId:_e}),delete tt.streamSinks[_e])},error(et){(0,o.assert)(et instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,lt.postMessage({sourceName:rt,targetName:st,stream:c.ERROR,streamId:_e,reason:d(et)}))},sinkCapability:(0,o.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:b.desiredSize,ready:null};ot.sinkCapability.resolve(),ot.ready=ot.sinkCapability.promise,this.streamSinks[_e]=ot,new Promise(function(et){et($(b.data,ot))}).then(function(){lt.postMessage({sourceName:rt,targetName:st,stream:c.START_COMPLETE,streamId:_e,success:!0})},function(et){lt.postMessage({sourceName:rt,targetName:st,stream:c.START_COMPLETE,streamId:_e,reason:d(et)})})}_processStreamMessage(b){const _e=b.streamId,rt=this.sourceName,st=b.sourceName,lt=this.comObj,tt=this.streamControllers[_e],$=this.streamSinks[_e];switch(b.stream){case c.START_COMPLETE:b.success?tt.startCall.resolve():tt.startCall.reject(d(b.reason));break;case c.PULL_COMPLETE:b.success?tt.pullCall.resolve():tt.pullCall.reject(d(b.reason));break;case c.PULL:if(!$){lt.postMessage({sourceName:rt,targetName:st,stream:c.PULL_COMPLETE,streamId:_e,success:!0});break}$.desiredSize<=0&&b.desiredSize>0&&$.sinkCapability.resolve(),$.desiredSize=b.desiredSize,new Promise(function(ot){ot($.onPull&&$.onPull())}).then(function(){lt.postMessage({sourceName:rt,targetName:st,stream:c.PULL_COMPLETE,streamId:_e,success:!0})},function(ot){lt.postMessage({sourceName:rt,targetName:st,stream:c.PULL_COMPLETE,streamId:_e,reason:d(ot)})});break;case c.ENQUEUE:if((0,o.assert)(tt,"enqueue should have stream controller"),tt.isClosed)break;tt.controller.enqueue(b.chunk);break;case c.CLOSE:if((0,o.assert)(tt,"close should have stream controller"),tt.isClosed)break;tt.isClosed=!0,tt.controller.close(),this._deleteStreamController(tt,_e);break;case c.ERROR:(0,o.assert)(tt,"error should have stream controller"),tt.controller.error(d(b.reason)),this._deleteStreamController(tt,_e);break;case c.CANCEL_COMPLETE:b.success?tt.cancelCall.resolve():tt.cancelCall.reject(d(b.reason)),this._deleteStreamController(tt,_e);break;case c.CANCEL:if(!$)break;new Promise(function(ot){ot($.onCancel&&$.onCancel(d(b.reason)))}).then(function(){lt.postMessage({sourceName:rt,targetName:st,stream:c.CANCEL_COMPLETE,streamId:_e,success:!0})},function(ot){lt.postMessage({sourceName:rt,targetName:st,stream:c.CANCEL_COMPLETE,streamId:_e,reason:d(ot)})}),$.sinkCapability.reject(d(b.reason)),$.isCancelled=!0,delete this.streamSinks[_e];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(b,_e){await Promise.allSettled([b.startCall&&b.startCall.promise,b.pullCall&&b.pullCall.promise,b.cancelCall&&b.cancelCall.promise]),delete this.streamControllers[_e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}i.MessageHandler=g},(e,i,s)=>{var c,d;Object.defineProperty(i,"__esModule",{value:!0}),i.Metadata=void 0;var o=s(1);class a{constructor({parsedData:_,rawData:b}){rn(this,c,void 0);rn(this,d,void 0);fn(this,c,_),fn(this,d,b)}getRaw(){return Pt(this,d)}get(_){return Pt(this,c).get(_)??null}getAll(){return(0,o.objectFromMap)(Pt(this,c))}has(_){return Pt(this,c).has(_)}}c=new WeakMap,d=new WeakMap,i.Metadata=a},(e,i,s)=>{var g,_,b,_e,rt,st,_s;Object.defineProperty(i,"__esModule",{value:!0}),i.OptionalContentConfig=void 0;var o=s(1);const a=Symbol("INTERNAL");class c{constructor($,ot){rn(this,g,!0);this.name=$,this.intent=ot}get visible(){return Pt(this,g)}_setVisible($,ot){$!==a&&(0,o.unreachable)("Internal method `_setVisible` called."),fn(this,g,ot)}}g=new WeakMap;class d{constructor($){rn(this,st);rn(this,_,!0);rn(this,b,new Map);rn(this,_e,null);rn(this,rt,null);if(this.name=null,this.creator=null,$!==null){this.name=$.name,this.creator=$.creator,fn(this,rt,$.order);for(const ot of $.groups)Pt(this,b).set(ot.id,new c(ot.name,ot.intent));if($.baseState==="OFF")for(const ot of Pt(this,b).values())ot._setVisible(a,!1);for(const ot of $.on)Pt(this,b).get(ot)._setVisible(a,!0);for(const ot of $.off)Pt(this,b).get(ot)._setVisible(a,!1);fn(this,_e,new Map);for(const[ot,et]of Pt(this,b))Pt(this,_e).set(ot,et.visible)}}isVisible($){if(Pt(this,b).size===0)return!0;if(!$)return(0,o.warn)("Optional content group not defined."),!0;if($.type==="OCG")return Pt(this,b).has($.id)?Pt(this,b).get($.id).visible:((0,o.warn)(`Optional content group not found: ${$.id}`),!0);if($.type==="OCMD"){if($.expression)return on(this,st,_s).call(this,$.expression);if(!$.policy||$.policy==="AnyOn"){for(const ot of $.ids){if(!Pt(this,b).has(ot))return(0,o.warn)(`Optional content group not found: ${ot}`),!0;if(Pt(this,b).get(ot).visible)return!0}return!1}else if($.policy==="AllOn"){for(const ot of $.ids){if(!Pt(this,b).has(ot))return(0,o.warn)(`Optional content group not found: ${ot}`),!0;if(!Pt(this,b).get(ot).visible)return!1}return!0}else if($.policy==="AnyOff"){for(const ot of $.ids){if(!Pt(this,b).has(ot))return(0,o.warn)(`Optional content group not found: ${ot}`),!0;if(!Pt(this,b).get(ot).visible)return!0}return!1}else if($.policy==="AllOff"){for(const ot of $.ids){if(!Pt(this,b).has(ot))return(0,o.warn)(`Optional content group not found: ${ot}`),!0;if(Pt(this,b).get(ot).visible)return!1}return!0}return(0,o.warn)(`Unknown optional content policy ${$.policy}.`),!0}return(0,o.warn)(`Unknown group type ${$.type}.`),!0}setVisibility($,ot=!0){if(!Pt(this,b).has($)){(0,o.warn)(`Optional content group not found: ${$}`);return}Pt(this,b).get($)._setVisible(a,!!ot),fn(this,_,null)}get hasInitialVisibility(){if(Pt(this,_)!==null)return Pt(this,_);for(const[$,ot]of Pt(this,b)){const et=Pt(this,_e).get($);if(ot.visible!==et)return fn(this,_,!1)}return fn(this,_,!0)}getOrder(){return Pt(this,b).size?Pt(this,rt)?Pt(this,rt).slice():[...Pt(this,b).keys()]:null}getGroups(){return Pt(this,b).size>0?(0,o.objectFromMap)(Pt(this,b)):null}getGroup($){return Pt(this,b).get($)||null}}_=new WeakMap,b=new WeakMap,_e=new WeakMap,rt=new WeakMap,st=new WeakSet,_s=function($){const ot=$.length;if(ot<2)return!0;const et=$[0];for(let it=1;it{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFDataTransportStream=void 0;var o=s(1),a=s(8);class c{constructor(b,_e){(0,o.assert)(_e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=b.progressiveDone||!1,this._contentDispositionFilename=b.contentDispositionFilename||null;const rt=b.initialData;if((rt==null?void 0:rt.length)>0){const st=new Uint8Array(rt).buffer;this._queuedChunks.push(st)}this._pdfDataRangeTransport=_e,this._isStreamingSupported=!b.disableStream,this._isRangeSupported=!b.disableRange,this._contentLength=b.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((st,lt)=>{this._onReceiveData({begin:st,chunk:lt})}),this._pdfDataRangeTransport.addProgressListener((st,lt)=>{this._onProgress({loaded:st,total:lt})}),this._pdfDataRangeTransport.addProgressiveReadListener(st=>{this._onReceiveData({chunk:st})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(b){const _e=new Uint8Array(b.chunk).buffer;if(b.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(_e):this._queuedChunks.push(_e);else{const rt=this._rangeReaders.some(function(st){return st._begin!==b.begin?!1:(st._enqueue(_e),!0)});(0,o.assert)(rt,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var b;return((b=this._fullRequestReader)==null?void 0:b._loaded)??0}_onProgress(b){if(b.total===void 0){const _e=this._rangeReaders[0];_e!=null&&_e.onProgress&&_e.onProgress({loaded:b.loaded})}else{const _e=this._fullRequestReader;_e!=null&&_e.onProgress&&_e.onProgress({loaded:b.loaded,total:b.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(b){const _e=this._rangeReaders.indexOf(b);_e>=0&&this._rangeReaders.splice(_e,1)}getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const b=this._queuedChunks;return this._queuedChunks=null,new d(this,b,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(b,_e){if(_e<=this._progressiveDataLength)return null;const rt=new g(this,b,_e);return this._pdfDataRangeTransport.requestDataRange(b,_e),this._rangeReaders.push(rt),rt}cancelAllRequests(b){this._fullRequestReader&&this._fullRequestReader.cancel(b);for(const _e of this._rangeReaders.slice(0))_e.cancel(b);this._pdfDataRangeTransport.abort()}}i.PDFDataTransportStream=c;class d{constructor(b,_e,rt=!1,st=null){this._stream=b,this._done=rt||!1,this._filename=(0,a.isPdfFile)(st)?st:null,this._queuedChunks=_e||[],this._loaded=0;for(const lt of this._queuedChunks)this._loaded+=lt.byteLength;this._requests=[],this._headersReady=Promise.resolve(),b._fullRequestReader=this,this.onProgress=null}_enqueue(b){this._done||(this._requests.length>0?this._requests.shift().resolve({value:b,done:!1}):this._queuedChunks.push(b),this._loaded+=b.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const b=(0,o.createPromiseCapability)();return this._requests.push(b),b.promise}cancel(b){this._done=!0;for(const _e of this._requests)_e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class g{constructor(b,_e,rt){this._stream=b,this._begin=_e,this._end=rt,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(b){if(!this._done){if(this._requests.length===0)this._queuedChunk=b;else{this._requests.shift().resolve({value:b,done:!1});for(const rt of this._requests)rt.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const _e=this._queuedChunk;return this._queuedChunk=null,{value:_e,done:!1}}if(this._done)return{value:void 0,done:!0};const b=(0,o.createPromiseCapability)();return this._requests.push(b),b.promise}cancel(b){this._done=!0;for(const _e of this._requests)_e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.XfaText=void 0;class s{static textContent(a){const c=[],d={items:c,styles:Object.create(null)};function g(_){var rt;if(!_)return;let b=null;const _e=_.name;if(_e==="#text")b=_.value;else if(s.shouldBuildText(_e))(rt=_==null?void 0:_.attributes)!=null&&rt.textContent?b=_.attributes.textContent:_.value&&(b=_.value);else return;if(b!==null&&c.push({str:b}),!!_.children)for(const st of _.children)g(st)}return g(a),d}static shouldBuildText(a){return!(a==="textarea"||a==="input"||a==="option"||a==="select")}}i.XfaText=s},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.NodeStandardFontDataFactory=i.NodeCanvasFactory=i.NodeCMapReaderFactory=void 0;var o=s(9);const a=function(_){return new Promise((b,_e)=>{require$$5.readFile(_,(st,lt)=>{if(st||!lt){_e(new Error(st));return}b(new Uint8Array(lt))})})};class c extends o.BaseCanvasFactory{_createCanvas(b,_e){return require$$5.createCanvas(b,_e)}}i.NodeCanvasFactory=c;class d extends o.BaseCMapReaderFactory{_fetchData(b,_e){return a(b).then(rt=>({cMapData:rt,compressionType:_e}))}}i.NodeCMapReaderFactory=d;class g extends o.BaseStandardFontDataFactory{_fetchData(b){return a(b)}}i.NodeStandardFontDataFactory=g},(e,i,s)=>{var _,b,_e,rt,st,lt,tt,$,ot,Ss,it,xo,at,xs,vt,Ao;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationEditorLayer=void 0;var o=s(7),a=s(1),c=s(23),d=s(24);const ct=class{constructor(ht){rn(this,ot);rn(this,it);rn(this,at);rn(this,vt);rn(this,_,void 0);rn(this,b,!1);rn(this,_e,this.pointerup.bind(this));rn(this,rt,this.pointerdown.bind(this));rn(this,st,new Map);rn(this,lt,!1);rn(this,tt,!1);rn(this,$,void 0);ct._initialized||(ct._initialized=!0,c.FreeTextEditor.initialize(ht.l10n),d.InkEditor.initialize(ht.l10n),ht.uiManager.registerEditorTypes([c.FreeTextEditor,d.InkEditor])),fn(this,$,ht.uiManager),this.annotationStorage=ht.annotationStorage,this.pageIndex=ht.pageIndex,this.div=ht.div,fn(this,_,ht.accessibilityManager),Pt(this,$).addLayer(this)}updateToolbar(ht){Pt(this,$).updateToolbar(ht)}updateMode(ht=Pt(this,$).getMode()){on(this,vt,Ao).call(this),ht===a.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Pt(this,$).unselectAll()}addInkEditorIfNeeded(ht){if(!ht&&Pt(this,$).getMode()!==a.AnnotationEditorType.INK)return;if(!ht){for(const Ct of Pt(this,st).values())if(Ct.isEmpty()){Ct.setInBackground();return}}on(this,at,xs).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(ht){Pt(this,$).setEditingState(ht)}addCommands(ht){Pt(this,$).addCommands(ht)}enable(){this.div.style.pointerEvents="auto";for(const ht of Pt(this,st).values())ht.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const ht of Pt(this,st).values())ht.disableEditing()}setActiveEditor(ht){Pt(this,$).getActive()!==ht&&Pt(this,$).setActiveEditor(ht)}enableClick(){this.div.addEventListener("pointerdown",Pt(this,rt)),this.div.addEventListener("pointerup",Pt(this,_e))}disableClick(){this.div.removeEventListener("pointerdown",Pt(this,rt)),this.div.removeEventListener("pointerup",Pt(this,_e))}attach(ht){Pt(this,st).set(ht.id,ht)}detach(ht){var Et;Pt(this,st).delete(ht.id),(Et=Pt(this,_))==null||Et.removePointerInTextLayer(ht.contentDiv)}remove(ht){Pt(this,$).removeEditor(ht),this.detach(ht),this.annotationStorage.remove(ht.id),ht.div.style.display="none",setTimeout(()=>{ht.div.style.display="",ht.div.remove(),ht.isAttachedToDOM=!1,document.activeElement===document.body&&Pt(this,$).focusMainContainer()},0),Pt(this,tt)||this.addInkEditorIfNeeded(!1)}add(ht){if(on(this,ot,Ss).call(this,ht),Pt(this,$).addEditor(ht),this.attach(ht),!ht.isAttachedToDOM){const Et=ht.render();this.div.append(Et),ht.isAttachedToDOM=!0}this.moveEditorInDOM(ht),ht.onceAdded(),this.addToAnnotationStorage(ht)}moveEditorInDOM(ht){var Et;(Et=Pt(this,_))==null||Et.moveElementInDOM(this.div,ht.div,ht.contentDiv,!0)}addToAnnotationStorage(ht){!ht.isEmpty()&&!this.annotationStorage.has(ht.id)&&this.annotationStorage.setValue(ht.id,ht)}addOrRebuild(ht){ht.needsToBeRebuilt()?ht.rebuild():this.add(ht)}addANewEditor(ht){const Et=()=>{this.addOrRebuild(ht)},Ct=()=>{ht.remove()};this.addCommands({cmd:Et,undo:Ct,mustExec:!0})}addUndoableEditor(ht){const Et=()=>{this.addOrRebuild(ht)},Ct=()=>{ht.remove()};this.addCommands({cmd:Et,undo:Ct,mustExec:!1})}getNextId(){return Pt(this,$).getId()}deserialize(ht){switch(ht.annotationType){case a.AnnotationEditorType.FREETEXT:return c.FreeTextEditor.deserialize(ht,this);case a.AnnotationEditorType.INK:return d.InkEditor.deserialize(ht,this)}return null}setSelected(ht){Pt(this,$).setSelected(ht)}toggleSelected(ht){Pt(this,$).toggleSelected(ht)}isSelected(ht){return Pt(this,$).isSelected(ht)}unselect(ht){Pt(this,$).unselect(ht)}pointerup(ht){const Et=o.KeyboardManager.platform.isMac;if(!(ht.button!==0||ht.ctrlKey&&Et)&&ht.target===this.div&&Pt(this,lt)){if(fn(this,lt,!1),!Pt(this,b)){fn(this,b,!0);return}on(this,at,xs).call(this,ht)}}pointerdown(ht){const Et=o.KeyboardManager.platform.isMac;if(ht.button!==0||ht.ctrlKey&&Et||ht.target!==this.div)return;fn(this,lt,!0);const Ct=Pt(this,$).getActive();fn(this,b,!Ct||Ct.isEmpty())}drop(ht){const Et=ht.dataTransfer.getData("text/plain"),Ct=Pt(this,$).getEditor(Et);if(!Ct)return;ht.preventDefault(),ht.dataTransfer.dropEffect="move",on(this,ot,Ss).call(this,Ct);const Bt=this.div.getBoundingClientRect(),Lt=ht.clientX-Bt.x,Yt=ht.clientY-Bt.y;Ct.translate(Lt-Ct.startX,Yt-Ct.startY),this.moveEditorInDOM(Ct),Ct.div.focus()}dragover(ht){ht.preventDefault()}destroy(){var ht,Et;((ht=Pt(this,$).getActive())==null?void 0:ht.parent)===this&&Pt(this,$).setActiveEditor(null);for(const Ct of Pt(this,st).values())(Et=Pt(this,_))==null||Et.removePointerInTextLayer(Ct.contentDiv),Ct.isAttachedToDOM=!1,Ct.div.remove(),Ct.parent=null;this.div=null,Pt(this,st).clear(),Pt(this,$).removeLayer(this)}render(ht){this.viewport=ht.viewport,(0,o.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions();for(const Et of Pt(this,$).getEditors(this.pageIndex))this.add(Et);this.updateMode()}update(ht){this.viewport=ht.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[ht,Et,Ct,Bt]=this.viewport.viewBox,Lt=Ct-ht,Yt=Bt-Et;return[Lt,Yt]}get viewportBaseDimensions(){const{width:ht,height:Et,rotation:Ct}=this.viewport;return Ct%180===0?[ht,Et]:[Et,ht]}setDimensions(){const{width:ht,height:Et,rotation:Ct}=this.viewport,Bt=Ct%180!==0,Lt=Math.floor(ht)+"px",Yt=Math.floor(Et)+"px";this.div.style.width=Bt?Yt:Lt,this.div.style.height=Bt?Lt:Yt,this.div.setAttribute("data-main-rotation",Ct)}};let g=ct;_=new WeakMap,b=new WeakMap,_e=new WeakMap,rt=new WeakMap,st=new WeakMap,lt=new WeakMap,tt=new WeakMap,$=new WeakMap,ot=new WeakSet,Ss=function(ht){var Et;ht.parent!==this&&(this.attach(ht),ht.pageIndex=this.pageIndex,(Et=ht.parent)==null||Et.detach(ht),ht.parent=this,ht.div&&ht.isAttachedToDOM&&(ht.div.remove(),this.div.append(ht.div)))},it=new WeakSet,xo=function(ht){switch(Pt(this,$).getMode()){case a.AnnotationEditorType.FREETEXT:return new c.FreeTextEditor(ht);case a.AnnotationEditorType.INK:return new d.InkEditor(ht)}return null},at=new WeakSet,xs=function(ht){const Et=this.getNextId(),Ct=on(this,it,xo).call(this,{parent:this,id:Et,x:ht.offsetX,y:ht.offsetY});return Ct&&this.add(Ct),Ct},vt=new WeakSet,Ao=function(){fn(this,tt,!0);for(const ht of Pt(this,st).values())ht.isEmpty()&&ht.remove();fn(this,tt,!1)},Wn(g,"_initialized",!1),i.AnnotationEditorLayer=g},(e,i,s)=>{var g,_,b,_e,rt,st,lt,tt,bo,ot,Eo,it,wo,at,As;Object.defineProperty(i,"__esModule",{value:!0}),i.FreeTextEditor=void 0;var o=s(1),a=s(7),c=s(6);const vt=class extends c.AnnotationEditor{constructor(pt){super({...pt,name:"freeTextEditor"});rn(this,tt);rn(this,ot);rn(this,it);rn(this,at);rn(this,g,this.editorDivBlur.bind(this));rn(this,_,this.editorDivFocus.bind(this));rn(this,b,this.editorDivKeydown.bind(this));rn(this,_e,void 0);rn(this,rt,"");rn(this,st,!1);rn(this,lt,void 0);fn(this,_e,pt.color||vt._defaultColor||c.AnnotationEditor._defaultLineColor),fn(this,lt,pt.fontSize||vt._defaultFontSize)}static initialize(pt){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_aria_label"].map(Et=>[Et,pt.get(Et)]));const ht=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ht.getPropertyValue("--freetext-padding"))}static updateDefaultParams(pt,ht){switch(pt){case o.AnnotationEditorParamsType.FREETEXT_SIZE:vt._defaultFontSize=ht;break;case o.AnnotationEditorParamsType.FREETEXT_COLOR:vt._defaultColor=ht;break}}updateParams(pt,ht){switch(pt){case o.AnnotationEditorParamsType.FREETEXT_SIZE:on(this,tt,bo).call(this,ht);break;case o.AnnotationEditorParamsType.FREETEXT_COLOR:on(this,ot,Eo).call(this,ht);break}}static get defaultPropertiesToUpdate(){return[[o.AnnotationEditorParamsType.FREETEXT_SIZE,vt._defaultFontSize],[o.AnnotationEditorParamsType.FREETEXT_COLOR,vt._defaultColor||c.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[o.AnnotationEditorParamsType.FREETEXT_SIZE,Pt(this,lt)],[o.AnnotationEditorParamsType.FREETEXT_COLOR,Pt(this,_e)]]}getInitialTranslation(){return[-vt._internalPadding*this.parent.scaleFactor,-(vt._internalPadding+Pt(this,lt))*this.parent.scaleFactor]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(o.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.enableEditing(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.editorDiv.addEventListener("keydown",Pt(this,b)),this.editorDiv.addEventListener("focus",Pt(this,_)),this.editorDiv.addEventListener("blur",Pt(this,g)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.disableEditing(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",Pt(this,b)),this.editorDiv.removeEventListener("focus",Pt(this,_)),this.editorDiv.removeEventListener("blur",Pt(this,g)),this.div.focus(),this.isEditing=!1)}focusin(pt){super.focusin(pt),pt.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),super.remove()}commit(){super.commit(),Pt(this,st)||(fn(this,st,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),fn(this,rt,on(this,it,wo).call(this).trimEnd()),on(this,at,As).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(pt){this.enableEditMode(),this.editorDiv.focus()}keydown(pt){pt.target===this.div&&pt.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(pt){vt._keyboardManager.exec(this,pt)}editorDivFocus(pt){this.isEditing=!0}editorDivBlur(pt){this.isEditing=!1}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let pt,ht;this.width&&(pt=this.x,ht=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",`${this.id}-editor`),this.enableEditing(),vt._l10nPromise.get("editor_free_text_aria_label").then(Ct=>{var Bt;return(Bt=this.editorDiv)==null?void 0:Bt.setAttribute("aria-label",Ct)}),vt._l10nPromise.get("free_text_default_content").then(Ct=>{var Bt;return(Bt=this.editorDiv)==null?void 0:Bt.setAttribute("default-content",Ct)}),this.editorDiv.contentEditable=!0;const{style:Et}=this.editorDiv;if(Et.fontSize=`calc(${Pt(this,lt)}px * var(--scale-factor))`,Et.color=Pt(this,_e),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,a.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Ct,Bt]=this.parent.viewportBaseDimensions;this.setAt(pt*Ct,ht*Bt,this.width*Ct,this.height*Bt);for(const Lt of Pt(this,rt).split(` `)){const Yt=document.createElement("div");Yt.append(Lt?document.createTextNode(Lt):document.createElement("br")),this.editorDiv.append(Yt)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(pt,ht){const Et=super.deserialize(pt,ht);return fn(Et,lt,pt.fontSize),fn(Et,_e,o.Util.makeHexColor(...pt.color)),fn(Et,rt,pt.value),Et}serialize(){if(this.isEmpty())return null;const pt=vt._internalPadding*this.parent.scaleFactor,ht=this.getRect(pt,pt),Et=c.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:o.AnnotationEditorType.FREETEXT,color:Et,fontSize:Pt(this,lt),value:Pt(this,rt),pageIndex:this.parent.pageIndex,rect:ht,rotation:this.rotation}}};let d=vt;g=new WeakMap,_=new WeakMap,b=new WeakMap,_e=new WeakMap,rt=new WeakMap,st=new WeakMap,lt=new WeakMap,tt=new WeakSet,bo=function(pt){const ht=Ct=>{this.editorDiv.style.fontSize=`calc(${Ct}px * var(--scale-factor))`,this.translate(0,-(Ct-Pt(this,lt))*this.parent.scaleFactor),fn(this,lt,Ct),on(this,at,As).call(this)},Et=Pt(this,lt);this.parent.addCommands({cmd:()=>{ht(pt)},undo:()=>{ht(Et)},mustExec:!0,type:o.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},ot=new WeakSet,Eo=function(pt){const ht=Pt(this,_e);this.parent.addCommands({cmd:()=>{fn(this,_e,pt),this.editorDiv.style.color=pt},undo:()=>{fn(this,_e,ht),this.editorDiv.style.color=ht},mustExec:!0,type:o.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},it=new WeakSet,wo=function(){const pt=this.editorDiv.getElementsByTagName("div");if(pt.length===0)return this.editorDiv.innerText;const ht=[];for(let Et=0,Ct=pt.length;Et{var b,_e,rt,st,lt,tt,$,ot,et,it,nt,at,yt,vt,xt,Po,pt,To,Et,ko,Bt,Co,Yt,bs,jt,Ro,Ht,Do,Xt,Mo,gt,nr,At,Es,Dt,Gr,$t,qr,dt,Er,St,ws,kt,Kr,Zt,Ps,Qt,Oo,Kt,Fo,ln,Lo,sn,Ts,vn,Xr,mn,wr,Dn,ks;Object.defineProperty(i,"__esModule",{value:!0}),i.InkEditor=void 0,Object.defineProperty(i,"fitCurve",{enumerable:!0,get:function(){return c.fitCurve}});var o=s(1),a=s(6),c=s(25),d=s(7);const g=16,Pn=class extends a.AnnotationEditor{constructor(Jt){super({...Jt,name:"inkEditor"});rn(this,xt);rn(this,pt);rn(this,Et);rn(this,Bt);rn(this,Yt);rn(this,jt);rn(this,Ht);rn(this,Xt);rn(this,gt);rn(this,At);rn(this,Dt);rn(this,$t);rn(this,dt);rn(this,St);rn(this,kt);rn(this,Qt);rn(this,Kt);rn(this,ln);rn(this,sn);rn(this,vn);rn(this,mn);rn(this,Dn);rn(this,b,0);rn(this,_e,0);rn(this,rt,0);rn(this,st,this.canvasPointermove.bind(this));rn(this,lt,this.canvasPointerleave.bind(this));rn(this,tt,this.canvasPointerup.bind(this));rn(this,$,this.canvasPointerdown.bind(this));rn(this,ot,!1);rn(this,et,!1);rn(this,it,null);rn(this,nt,null);rn(this,at,0);rn(this,yt,0);rn(this,vt,null);this.color=Jt.color||null,this.thickness=Jt.thickness||null,this.opacity=Jt.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(Jt){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink_aria_label"].map(un=>[un,Jt.get(un)]))}static updateDefaultParams(Jt,un){switch(Jt){case o.AnnotationEditorParamsType.INK_THICKNESS:Pn._defaultThickness=un;break;case o.AnnotationEditorParamsType.INK_COLOR:Pn._defaultColor=un;break;case o.AnnotationEditorParamsType.INK_OPACITY:Pn._defaultOpacity=un/100;break}}updateParams(Jt,un){switch(Jt){case o.AnnotationEditorParamsType.INK_THICKNESS:on(this,xt,Po).call(this,un);break;case o.AnnotationEditorParamsType.INK_COLOR:on(this,pt,To).call(this,un);break;case o.AnnotationEditorParamsType.INK_OPACITY:on(this,Et,ko).call(this,un);break}}static get defaultPropertiesToUpdate(){return[[o.AnnotationEditorParamsType.INK_THICKNESS,Pn._defaultThickness],[o.AnnotationEditorParamsType.INK_COLOR,Pn._defaultColor||a.AnnotationEditor._defaultLineColor],[o.AnnotationEditorParamsType.INK_OPACITY,Math.round(Pn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[o.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||Pn._defaultThickness],[o.AnnotationEditorParamsType.INK_COLOR,this.color||Pn._defaultColor||a.AnnotationEditor._defaultLineColor],[o.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??Pn._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(on(this,Dt,Gr).call(this),on(this,$t,qr).call(this)),this.isAttachedToDOM||(this.parent.add(this),on(this,dt,Er).call(this)),on(this,mn,wr).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,Pt(this,nt).disconnect(),fn(this,nt,null),super.remove())}enableEditMode(){Pt(this,ot)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",Pt(this,$)),this.canvas.addEventListener("pointerup",Pt(this,tt)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",Pt(this,$)),this.canvas.removeEventListener("pointerup",Pt(this,tt)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){Pt(this,ot)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),fn(this,ot,!0),this.div.classList.add("disabled"),on(this,mn,wr).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus())}focusin(Jt){super.focusin(Jt),this.enableEditMode()}canvasPointerdown(Jt){Jt.button!==0||!this.isInEditMode()||Pt(this,ot)||(this.setInForeground(),Jt.type!=="mouse"&&this.div.focus(),Jt.stopPropagation(),this.canvas.addEventListener("pointerleave",Pt(this,lt)),this.canvas.addEventListener("pointermove",Pt(this,st)),on(this,jt,Ro).call(this,Jt.offsetX,Jt.offsetY))}canvasPointermove(Jt){Jt.stopPropagation(),on(this,Ht,Do).call(this,Jt.offsetX,Jt.offsetY)}canvasPointerup(Jt){Jt.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(Jt.stopPropagation(),on(this,At,Es).call(this,Jt),this.setInBackground())}canvasPointerleave(Jt){on(this,At,Es).call(this,Jt),this.setInBackground()}render(){if(this.div)return this.div;let Jt,un;this.width&&(Jt=this.x,un=this.y),super.render(),Pn._l10nPromise.get("editor_ink_aria_label").then(pn=>{var yn;return(yn=this.div)==null?void 0:yn.setAttribute("aria-label",pn)});const[Gt,Vt,It,cn]=on(this,Bt,Co).call(this);if(this.setAt(Gt,Vt,0,0),this.setDims(It,cn),on(this,Dt,Gr).call(this),this.width){const[pn,yn]=this.parent.viewportBaseDimensions;this.setAt(Jt*pn,un*yn,this.width*pn,this.height*yn),fn(this,et,!0),on(this,dt,Er).call(this),this.setDims(this.width*pn,this.height*yn),on(this,gt,nr).call(this),on(this,Dn,ks).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return on(this,$t,qr).call(this),this.div}setDimensions(Jt,un){const Gt=Math.round(Jt),Vt=Math.round(un);if(Pt(this,at)===Gt&&Pt(this,yt)===Vt)return;fn(this,at,Gt),fn(this,yt,Vt),this.canvas.style.visibility="hidden",Pt(this,b)&&Math.abs(Pt(this,b)-Jt/un)>.01&&(un=Math.ceil(Jt/Pt(this,b)),this.setDims(Jt,un));const[It,cn]=this.parent.viewportBaseDimensions;this.width=Jt/It,this.height=un/cn,Pt(this,ot)&&on(this,St,ws).call(this,Jt,un),on(this,dt,Er).call(this),on(this,gt,nr).call(this),this.canvas.style.visibility="visible"}static deserialize(Jt,un){var Fn,Cn;const Gt=super.deserialize(Jt,un);Gt.thickness=Jt.thickness,Gt.color=o.Util.makeHexColor(...Jt.color),Gt.opacity=Jt.opacity;const[Vt,It]=un.pageDimensions,cn=Gt.width*Vt,pn=Gt.height*It,yn=un.scaleFactor,Sn=Jt.thickness/2;fn(Gt,b,cn/pn),fn(Gt,ot,!0),fn(Gt,at,Math.round(cn)),fn(Gt,yt,Math.round(pn));for(const{bezier:bn}of Jt.paths){const In=[];Gt.paths.push(In);let Vn=yn*(bn[0]-Sn),Un=yn*(pn-bn[1]-Sn);for(let hn=2,Kn=bn.length;hn{this.thickness=Jt,on(this,mn,wr).call(this)},undo:()=>{this.thickness=un,on(this,mn,wr).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},pt=new WeakSet,To=function(Jt){const un=this.color;this.parent.addCommands({cmd:()=>{this.color=Jt,on(this,gt,nr).call(this)},undo:()=>{this.color=un,on(this,gt,nr).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Et=new WeakSet,ko=function(Jt){Jt/=100;const un=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=Jt,on(this,gt,nr).call(this)},undo:()=>{this.opacity=un,on(this,gt,nr).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Bt=new WeakSet,Co=function(){const{width:Jt,height:un,rotation:Gt}=this.parent.viewport;switch(Gt){case 90:return[0,Jt,Jt,un];case 180:return[Jt,un,Jt,un];case 270:return[un,0,Jt,un];default:return[0,0,Jt,un]}},Yt=new WeakSet,bs=function(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.miterLimit=10,this.ctx.strokeStyle=`${this.color}${(0,d.opacityToHex)(this.opacity)}`},jt=new WeakSet,Ro=function(Jt,un){this.isEditing=!0,Pt(this,et)||(fn(this,et,!0),on(this,dt,Er).call(this),this.thickness||(this.thickness=Pn._defaultThickness),this.color||(this.color=Pn._defaultColor||a.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=Pn._defaultOpacity)),this.currentPath.push([Jt,un]),fn(this,it,null),on(this,Yt,bs).call(this),this.ctx.beginPath(),this.ctx.moveTo(Jt,un),fn(this,vt,()=>{Pt(this,vt)&&(Pt(this,it)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):on(this,gt,nr).call(this),this.ctx.lineTo(...Pt(this,it)),fn(this,it,null),this.ctx.stroke()),window.requestAnimationFrame(Pt(this,vt)))}),window.requestAnimationFrame(Pt(this,vt))},Ht=new WeakSet,Do=function(Jt,un){const[Gt,Vt]=this.currentPath.at(-1);Jt===Gt&&un===Vt||(this.currentPath.push([Jt,un]),fn(this,it,[Jt,un]))},Xt=new WeakSet,Mo=function(Jt,un){var Sn;this.ctx.closePath(),fn(this,vt,null),Jt=Math.min(Math.max(Jt,0),this.canvas.width),un=Math.min(Math.max(un,0),this.canvas.height);const[Gt,Vt]=this.currentPath.at(-1);(Jt!==Gt||un!==Vt)&&this.currentPath.push([Jt,un]);let It;if(this.currentPath.length!==1)It=(0,c.fitCurve)(this.currentPath,30,null);else{const En=[Jt,un];It=[[En,En.slice(),En.slice(),En]]}const cn=on(Sn=Pn,Zt,Ps).call(Sn,It);this.currentPath.length=0;const pn=()=>{this.paths.push(It),this.bezierPath2D.push(cn),this.rebuild()},yn=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(on(this,Dt,Gr).call(this),on(this,$t,qr).call(this)),on(this,mn,wr).call(this))};this.parent.addCommands({cmd:pn,undo:yn,mustExec:!0})},gt=new WeakSet,nr=function(){if(this.isEmpty()){on(this,kt,Kr).call(this);return}on(this,Yt,bs).call(this);const{canvas:Jt,ctx:un}=this;un.setTransform(1,0,0,1,0,0),un.clearRect(0,0,Jt.width,Jt.height),on(this,kt,Kr).call(this);for(const Gt of this.bezierPath2D)un.stroke(Gt)},At=new WeakSet,Es=function(Jt){on(this,Xt,Mo).call(this,Jt.offsetX,Jt.offsetY),this.canvas.removeEventListener("pointerleave",Pt(this,lt)),this.canvas.removeEventListener("pointermove",Pt(this,st)),this.parent.addToAnnotationStorage(this)},Dt=new WeakSet,Gr=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",Pn._l10nPromise.get("editor_ink_canvas_aria_label").then(Jt=>{var un;return(un=this.canvas)==null?void 0:un.setAttribute("aria-label",Jt)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},$t=new WeakSet,qr=function(){fn(this,nt,new ResizeObserver(Jt=>{const un=Jt[0].contentRect;un.width&&un.height&&this.setDimensions(un.width,un.height)})),Pt(this,nt).observe(this.div)},dt=new WeakSet,Er=function(){if(!Pt(this,et))return;const[Jt,un]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*Jt),this.canvas.height=Math.ceil(this.height*un),on(this,kt,Kr).call(this)},St=new WeakSet,ws=function(Jt,un){const Gt=on(this,vn,Xr).call(this),Vt=(Jt-Gt)/Pt(this,rt),It=(un-Gt)/Pt(this,_e);this.scaleFactor=Math.min(Vt,It)},kt=new WeakSet,Kr=function(){const Jt=on(this,vn,Xr).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Jt,this.translationY*this.scaleFactor+Jt)},Zt=new WeakSet,Ps=function(Jt){const un=new Path2D;for(let Gt=0,Vt=Jt.length;Gt=1?(Jt.minHeight=`${g}px`,Jt.minWidth=`${Math.round(Pt(this,b)*g)}px`):(Jt.minWidth=`${g}px`,Jt.minHeight=`${Math.round(g/Pt(this,b))}px`)},rn(_,Zt),Wn(_,"_defaultColor",null),Wn(_,"_defaultOpacity",1),Wn(_,"_defaultThickness",1),Wn(_,"_l10nPromise"),Wn(_,"_type","ink"),i.InkEditor=_},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.fitCurve=void 0;const o=s(26);i.fitCurve=o},e=>{function i(tt,$,ot){if(!Array.isArray(tt))throw new TypeError("First argument should be an array");if(tt.forEach(at=>{if(!Array.isArray(at)||at.some(yt=>typeof yt!="number")||at.length!==tt[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),tt=tt.filter((at,yt)=>yt===0||!at.every((vt,xt)=>vt===tt[yt-1][xt])),tt.length<2)return[];const et=tt.length,it=rt(tt[1],tt[0]),nt=rt(tt[et-2],tt[et-1]);return s(tt,it,nt,$,ot)}function s(tt,$,ot,et,it){var at,yt,vt,xt,ct,pt,ht,Et,Ct,Bt,Lt,Yt,Wt;if(tt.length===2)return Yt=st.vectorLen(st.subtract(tt[0],tt[1]))/3,at=[tt[0],st.addArrays(tt[0],st.mulItems($,Yt)),st.addArrays(tt[1],st.mulItems(ot,Yt)),tt[1]],[at];if(yt=g(tt),[at,xt,pt]=o(tt,yt,yt,$,ot,it),xt===0||xt.9999&&jt<1.0001)break}ct=xt,ht=pt}return Lt=[],Et=st.subtract(tt[pt-1],tt[pt+1]),Et.every(jt=>jt===0)&&(Et=st.subtract(tt[pt-1],tt[pt]),[Et[0],Et[1]]=[-Et[1],Et[0]]),Ct=st.normalize(Et),Bt=st.mulItems(Ct,-1),Lt=Lt.concat(s(tt.slice(0,pt+1),$,Ct,et,it)),Lt=Lt.concat(s(tt.slice(pt),Bt,ot,et,it)),Lt}function o(tt,$,ot,et,it,nt){var at,yt,vt;return at=a(tt,ot,et,it),[yt,vt]=_(tt,at,$),nt&&nt({bez:at,points:tt,params:$,maxErr:yt,maxPoint:vt}),[at,yt,vt]}function a(tt,$,ot,et){var it,nt,at,yt,vt,xt,ct,pt,ht,Et,Ct,Bt,Lt,Yt,Wt,jt,Ft,Ht=tt[0],qt=tt[tt.length-1];for(it=[Ht,null,null,qt],nt=st.zeros_Xx2x2($.length),Lt=0,Yt=$.length;Ltd(tt,$[it],et))}function d(tt,$,ot){var et=st.subtract(lt.q(tt,ot),$),it=lt.qprime(tt,ot),nt=st.mulMatrix(et,it),at=st.sum(st.squareItems(it))+2*st.mulMatrix(et,lt.qprimeprime(tt,ot));return at===0?ot:ot-nt/at}function g(tt){var $=[],ot,et,it;return tt.forEach((nt,at)=>{ot=at?et+st.vectorLen(st.subtract(nt,it)):0,$.push(ot),et=ot,it=nt}),$=$.map(nt=>nt/et),$}function _(tt,$,ot){var et,it,nt,at,yt,vt,xt,ct;it=0,nt=Math.floor(tt.length/2);const pt=b($,10);for(yt=0,vt=tt.length;ytit&&(it=et,nt=yt);return[it,nt]}var b=function(tt,$){for(var ot,et=[0],it=tt[0],nt=0,at=1;at<=$;at++)ot=lt.q(tt,at/$),nt+=st.vectorLen(st.subtract(ot,it)),et.push(nt),it=ot;return et=et.map(yt=>yt/nt),et};function _e(tt,$,ot,et){if($<0)return 0;if($>1)return 1;for(var it,nt,at,yt,vt,xt=1;xt<=et;xt++)if($<=ot[xt]){yt=(xt-1)/et,at=xt/et,nt=ot[xt-1],it=ot[xt],vt=($-nt)/(it-nt)*(at-yt)+yt;break}return vt}function rt(tt,$){return st.normalize(st.subtract(tt,$))}class st{static zeros_Xx2x2($){for(var ot=[];$--;)ot.push([0,0]);return ot}static mulItems($,ot){return $.map(et=>et*ot)}static mulMatrix($,ot){return $.reduce((et,it,nt)=>et+it*ot[nt],0)}static subtract($,ot){return $.map((et,it)=>et-ot[it])}static addArrays($,ot){return $.map((et,it)=>et+ot[it])}static addItems($,ot){return $.map(et=>et+ot)}static sum($){return $.reduce((ot,et)=>ot+et)}static dot($,ot){return st.mulMatrix($,ot)}static vectorLen($){return Math.hypot(...$)}static divItems($,ot){return $.map(et=>et/ot)}static squareItems($){return $.map(ot=>ot*ot)}static normalize($){return this.divItems($,this.vectorLen($))}}class lt{static q($,ot){var et=1-ot,it=st.mulItems($[0],et*et*et),nt=st.mulItems($[1],3*et*et*ot),at=st.mulItems($[2],3*et*ot*ot),yt=st.mulItems($[3],ot*ot*ot);return st.addArrays(st.addArrays(it,nt),st.addArrays(at,yt))}static qprime($,ot){var et=1-ot,it=st.mulItems(st.subtract($[1],$[0]),3*et*et),nt=st.mulItems(st.subtract($[2],$[1]),6*et*ot),at=st.mulItems(st.subtract($[3],$[2]),3*ot*ot);return st.addArrays(st.addArrays(it,nt),at)}static qprimeprime($,ot){return st.addArrays(st.mulItems(st.addArrays(st.subtract($[2],st.mulItems($[1],2)),$[0]),6*(1-ot)),st.mulItems(st.addArrays(st.subtract($[3],st.mulItems($[2],2)),$[1]),6*ot))}}e.exports=i,e.exports.fitCubic=s,e.exports.createTangent=rt},(e,i,s)=>{var gt,Cs,At,Rs,Dt,Ds;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationLayer=void 0;var o=s(1),a=s(8),c=s(5),d=s(28),g=s(29);const _=1e3,b=9,_e=new WeakSet;function rt(zt){return{width:zt[2]-zt[0],height:zt[3]-zt[1]}}class st{static create(dt){switch(dt.data.annotationType){case o.AnnotationType.LINK:return new tt(dt);case o.AnnotationType.TEXT:return new $(dt);case o.AnnotationType.WIDGET:switch(dt.data.fieldType){case"Tx":return new et(dt);case"Btn":return dt.data.radioButton?new nt(dt):dt.data.checkBox?new it(dt):new at(dt);case"Ch":return new yt(dt)}return new ot(dt);case o.AnnotationType.POPUP:return new vt(dt);case o.AnnotationType.FREETEXT:return new ct(dt);case o.AnnotationType.LINE:return new pt(dt);case o.AnnotationType.SQUARE:return new ht(dt);case o.AnnotationType.CIRCLE:return new Et(dt);case o.AnnotationType.POLYLINE:return new Ct(dt);case o.AnnotationType.CARET:return new Lt(dt);case o.AnnotationType.INK:return new Yt(dt);case o.AnnotationType.POLYGON:return new Bt(dt);case o.AnnotationType.HIGHLIGHT:return new Wt(dt);case o.AnnotationType.UNDERLINE:return new jt(dt);case o.AnnotationType.SQUIGGLY:return new Ft(dt);case o.AnnotationType.STRIKEOUT:return new Ht(dt);case o.AnnotationType.STAMP:return new qt(dt);case o.AnnotationType.FILEATTACHMENT:return new Xt(dt);default:return new lt(dt)}}}class lt{constructor(dt,{isRenderable:_t=!1,ignoreBorder:St=!1,createQuadrilaterals:wt=!1}={}){this.isRenderable=_t,this.data=dt.data,this.layer=dt.layer,this.page=dt.page,this.viewport=dt.viewport,this.linkService=dt.linkService,this.downloadManager=dt.downloadManager,this.imageResourcesPath=dt.imageResourcesPath,this.renderForms=dt.renderForms,this.svgFactory=dt.svgFactory,this.annotationStorage=dt.annotationStorage,this.enableScripting=dt.enableScripting,this.hasJSActions=dt.hasJSActions,this._fieldObjects=dt.fieldObjects,this._mouseState=dt.mouseState,_t&&(this.container=this._createContainer(St)),wt&&(this.quadrilaterals=this._createQuadrilaterals(St))}_createContainer(dt=!1){const _t=this.data,St=this.page,wt=this.viewport,kt=document.createElement("section"),{width:Nt,height:Zt}=rt(_t.rect),[an,Qt,tn,Kt]=wt.viewBox,nn=tn-an,ln=Kt-Qt;kt.setAttribute("data-annotation-id",_t.id);const Mt=o.Util.normalizeRect([_t.rect[0],St.view[3]-_t.rect[1]+St.view[1],_t.rect[2],St.view[3]-_t.rect[3]+St.view[1]]);if(!dt&&_t.borderStyle.width>0){kt.style.borderWidth=`${_t.borderStyle.width}px`;const gn=_t.borderStyle.horizontalCornerRadius,vn=_t.borderStyle.verticalCornerRadius;if(gn>0||vn>0){const mn=`calc(${gn}px * var(--scale-factor)) / calc(${vn}px * var(--scale-factor))`;kt.style.borderRadius=mn}else if(this instanceof nt){const mn=`calc(${Nt}px * var(--scale-factor)) / calc(${Zt}px * var(--scale-factor))`;kt.style.borderRadius=mn}switch(_t.borderStyle.style){case o.AnnotationBorderStyleType.SOLID:kt.style.borderStyle="solid";break;case o.AnnotationBorderStyleType.DASHED:kt.style.borderStyle="dashed";break;case o.AnnotationBorderStyleType.BEVELED:(0,o.warn)("Unimplemented border style: beveled");break;case o.AnnotationBorderStyleType.INSET:(0,o.warn)("Unimplemented border style: inset");break;case o.AnnotationBorderStyleType.UNDERLINE:kt.style.borderBottomStyle="solid";break}const _n=_t.borderColor||null;_n?kt.style.borderColor=o.Util.makeHexColor(_n[0]|0,_n[1]|0,_n[2]|0):kt.style.borderWidth=0}kt.style.left=`${100*(Mt[0]-an)/nn}%`,kt.style.top=`${100*(Mt[1]-Qt)/ln}%`;const{rotation:sn}=_t;return _t.hasOwnCanvas||sn===0?(kt.style.width=`${100*Nt/nn}%`,kt.style.height=`${100*Zt/ln}%`):this.setRotation(sn,kt),kt}setRotation(dt,_t=this.container){const[St,wt,kt,Nt]=this.viewport.viewBox,Zt=kt-St,an=Nt-wt,{width:Qt,height:tn}=rt(this.data.rect);let Kt,nn;dt%180===0?(Kt=100*Qt/Zt,nn=100*tn/an):(Kt=100*tn/Zt,nn=100*Qt/an),_t.style.width=`${Kt}%`,_t.style.height=`${nn}%`,_t.setAttribute("data-main-rotation",(360-dt)%360)}get _commonActions(){const dt=(_t,St,wt)=>{const kt=wt.detail[_t];wt.target.style[St]=d.ColorConverters[`${kt[0]}_HTML`](kt.slice(1))};return(0,o.shadow)(this,"_commonActions",{display:_t=>{const St=_t.detail.display%2===1;this.container.style.visibility=St?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:St,print:_t.detail.display===0||_t.detail.display===3})},print:_t=>{this.annotationStorage.setValue(this.data.id,{print:_t.detail.print})},hidden:_t=>{this.container.style.visibility=_t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:_t.detail.hidden})},focus:_t=>{setTimeout(()=>_t.target.focus({preventScroll:!1}),0)},userName:_t=>{_t.target.title=_t.detail.userName},readonly:_t=>{_t.detail.readonly?_t.target.setAttribute("readonly",""):_t.target.removeAttribute("readonly")},required:_t=>{this._setRequired(_t.target,_t.detail.required)},bgColor:_t=>{dt("bgColor","backgroundColor",_t)},fillColor:_t=>{dt("fillColor","backgroundColor",_t)},fgColor:_t=>{dt("fgColor","color",_t)},textColor:_t=>{dt("textColor","color",_t)},borderColor:_t=>{dt("borderColor","borderColor",_t)},strokeColor:_t=>{dt("strokeColor","borderColor",_t)},rotation:_t=>{const St=_t.detail.rotation;this.setRotation(St),this.annotationStorage.setValue(this.data.id,{rotation:St})}})}_dispatchEventFromSandbox(dt,_t){const St=this._commonActions;for(const wt of Object.keys(_t.detail)){const kt=dt[wt]||St[wt];kt&&kt(_t)}}_setDefaultPropertiesFromJS(dt){if(!this.enableScripting)return;const _t=this.annotationStorage.getRawValue(this.data.id);if(!_t)return;const St=this._commonActions;for(const[wt,kt]of Object.entries(_t)){const Nt=St[wt];if(Nt){const Zt={detail:{[wt]:kt},target:dt};Nt(Zt),delete _t[wt]}}}_createQuadrilaterals(dt=!1){if(!this.data.quadPoints)return null;const _t=[],St=this.data.rect;for(const wt of this.data.quadPoints)this.data.rect=[wt[2].x,wt[2].y,wt[1].x,wt[1].y],_t.push(this._createContainer(dt));return this.data.rect=St,_t}_createPopup(dt,_t){let St=this.container;this.quadrilaterals&&(dt=dt||this.quadrilaterals,St=this.quadrilaterals[0]),dt||(dt=document.createElement("div"),dt.className="popupTriggerArea",St.append(dt));const kt=new xt({container:St,trigger:dt,color:_t.color,titleObj:_t.titleObj,modificationDate:_t.modificationDate,contentsObj:_t.contentsObj,richText:_t.richText,hideWrapper:!0}).render();kt.style.left="100%",St.append(kt)}_renderQuadrilaterals(dt){for(const _t of this.quadrilaterals)_t.className=dt;return this.quadrilaterals}render(){(0,o.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(dt,_t=null){const St=[];if(this._fieldObjects){const wt=this._fieldObjects[dt];if(wt)for(const{page:kt,id:Nt,exportValues:Zt}of wt){if(kt===-1||Nt===_t)continue;const an=typeof Zt=="string"?Zt:null,Qt=document.querySelector(`[data-element-id="${Nt}"]`);if(Qt&&!_e.has(Qt)){(0,o.warn)(`_getElementsByName - element not allowed: ${Nt}`);continue}St.push({id:Nt,exportValue:an,domElement:Qt})}return St}for(const wt of document.getElementsByName(dt)){const{id:kt,exportValue:Nt}=wt;kt!==_t&&_e.has(wt)&&St.push({id:kt,exportValue:Nt,domElement:wt})}return St}static get platform(){const dt=typeof navigator<"u"?navigator.platform:"";return(0,o.shadow)(this,"platform",{isWin:dt.includes("Win"),isMac:dt.includes("Mac")})}}class tt extends lt{constructor(dt,_t=null){super(dt,{isRenderable:!0,ignoreBorder:!!(_t!=null&&_t.ignoreBorder),createQuadrilaterals:!0}),this.isTooltipOnly=dt.data.isTooltipOnly}render(){const{data:dt,linkService:_t}=this,St=document.createElement("a");St.setAttribute("data-element-id",dt.id);let wt=!1;return dt.url?(_t.addLinkAttributes(St,dt.url,dt.newWindow),wt=!0):dt.action?(this._bindNamedAction(St,dt.action),wt=!0):dt.dest?(this._bindLink(St,dt.dest),wt=!0):(dt.actions&&(dt.actions.Action||dt.actions["Mouse Up"]||dt.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(St,dt),wt=!0),dt.resetForm?(this._bindResetFormAction(St,dt.resetForm),wt=!0):this.isTooltipOnly&&!wt&&(this._bindLink(St,""),wt=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((kt,Nt)=>{const Zt=Nt===0?St:St.cloneNode();return kt.append(Zt),kt}):(this.container.className="linkAnnotation",wt&&this.container.append(St),this.container)}_bindLink(dt,_t){dt.href=this.linkService.getDestinationHash(_t),dt.onclick=()=>(_t&&this.linkService.goToDestination(_t),!1),(_t||_t==="")&&(dt.className="internalLink")}_bindNamedAction(dt,_t){dt.href=this.linkService.getAnchorUrl(""),dt.onclick=()=>(this.linkService.executeNamedAction(_t),!1),dt.className="internalLink"}_bindJSAction(dt,_t){dt.href=this.linkService.getAnchorUrl("");const St=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const wt of Object.keys(_t.actions)){const kt=St.get(wt);kt&&(dt[kt]=()=>{var Nt;return(Nt=this.linkService.eventBus)==null||Nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t.id,name:wt}}),!1})}dt.onclick||(dt.onclick=()=>!1),dt.className="internalLink"}_bindResetFormAction(dt,_t){const St=dt.onclick;if(St||(dt.href=this.linkService.getAnchorUrl("")),dt.className="internalLink",!this._fieldObjects){(0,o.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),St||(dt.onclick=()=>!1);return}dt.onclick=()=>{var tn;St&&St();const{fields:wt,refs:kt,include:Nt}=_t,Zt=[];if(wt.length!==0||kt.length!==0){const Kt=new Set(kt);for(const nn of wt){const ln=this._fieldObjects[nn]||[];for(const{id:Mt}of ln)Kt.add(Mt)}for(const nn of Object.values(this._fieldObjects))for(const ln of nn)Kt.has(ln.id)===Nt&&Zt.push(ln)}else for(const Kt of Object.values(this._fieldObjects))Zt.push(...Kt);const an=this.annotationStorage,Qt=[];for(const Kt of Zt){const{id:nn}=Kt;switch(Qt.push(nn),Kt.type){case"text":{const Mt=Kt.defaultValue||"";an.setValue(nn,{value:Mt});break}case"checkbox":case"radiobutton":{const Mt=Kt.defaultValue===Kt.exportValues;an.setValue(nn,{value:Mt});break}case"combobox":case"listbox":{const Mt=Kt.defaultValue||"";an.setValue(nn,{value:Mt});break}default:continue}const ln=document.querySelector(`[data-element-id="${nn}"]`);if(ln){if(!_e.has(ln)){(0,o.warn)(`_bindResetFormAction - element not allowed: ${nn}`);continue}}else continue;ln.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((tn=this.linkService.eventBus)==null||tn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Qt,name:"ResetForm"}})),!1}}}class $ extends lt{constructor(dt){var St,wt,kt;const _t=!!(dt.data.hasPopup||(St=dt.data.titleObj)!=null&&St.str||(wt=dt.data.contentsObj)!=null&&wt.str||(kt=dt.data.richText)!=null&&kt.str);super(dt,{isRenderable:_t})}render(){this.container.className="textAnnotation";const dt=document.createElement("img");return dt.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",dt.alt="[{{type}} Annotation]",dt.dataset.l10nId="text_annotation_type",dt.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(dt,this.data),this.container.append(dt),this.container}}class ot extends lt{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(dt){const{isWin:_t,isMac:St}=lt.platform;return _t&&dt.ctrlKey||St&&dt.metaKey}_setEventListener(dt,_t,St,wt){_t.includes("mouse")?dt.addEventListener(_t,kt=>{var Nt;(Nt=this.linkService.eventBus)==null||Nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:St,value:wt(kt),shift:kt.shiftKey,modifier:this._getKeyModifier(kt)}})}):dt.addEventListener(_t,kt=>{var Nt;(Nt=this.linkService.eventBus)==null||Nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:St,value:wt(kt)}})})}_setEventListeners(dt,_t,St){var wt;for(const[kt,Nt]of _t)(Nt==="Action"||(wt=this.data.actions)!=null&&wt[Nt])&&this._setEventListener(dt,kt,Nt,St)}_setBackgroundColor(dt){const _t=this.data.backgroundColor||null;dt.style.backgroundColor=_t===null?"transparent":o.Util.makeHexColor(_t[0],_t[1],_t[2])}_setTextStyle(dt){const _t=["left","center","right"],{fontColor:St}=this.data.defaultAppearanceData,wt=this.data.defaultAppearanceData.fontSize||b,kt=dt.style;let Nt;if(this.data.multiLine){const Zt=Math.abs(this.data.rect[3]-this.data.rect[1]),an=Math.round(Zt/(o.LINE_FACTOR*wt))||1,Qt=Zt/an;Nt=Math.min(wt,Math.round(Qt/o.LINE_FACTOR))}else{const Zt=Math.abs(this.data.rect[3]-this.data.rect[1]);Nt=Math.min(wt,Math.round(Zt/o.LINE_FACTOR))}kt.fontSize=`calc(${Nt}px * var(--scale-factor))`,kt.color=o.Util.makeHexColor(St[0],St[1],St[2]),this.data.textAlignment!==null&&(kt.textAlign=_t[this.data.textAlignment])}_setRequired(dt,_t){_t?dt.setAttribute("required",!0):dt.removeAttribute("required"),dt.setAttribute("aria-required",_t)}}class et extends ot{constructor(dt){const _t=dt.renderForms||!dt.data.hasAppearance&&!!dt.data.fieldValue;super(dt,{isRenderable:_t})}setPropertyOnSiblings(dt,_t,St,wt){const kt=this.annotationStorage;for(const Nt of this._getElementsByName(dt.name,dt.id))Nt.domElement&&(Nt.domElement[_t]=St),kt.setValue(Nt.id,{[wt]:St})}render(){var wt;const dt=this.annotationStorage,_t=this.data.id;this.container.className="textWidgetAnnotation";let St=null;if(this.renderForms){const kt=dt.getValue(_t,{value:this.data.fieldValue});let Nt=kt.formattedValue||kt.value||"";const Zt=dt.getValue(_t,{charLimit:this.data.maxLen}).charLimit;Zt&&Nt.length>Zt&&(Nt=Nt.slice(0,Zt));const an={userValue:Nt,formattedValue:null,valueOnFocus:""};this.data.multiLine?(St=document.createElement("textarea"),St.textContent=Nt,this.data.doNotScroll&&(St.style.overflowY="hidden")):(St=document.createElement("input"),St.type="text",St.setAttribute("value",Nt),this.data.doNotScroll&&(St.style.overflowX="hidden")),_e.add(St),St.setAttribute("data-element-id",_t),St.disabled=this.data.readOnly,St.name=this.data.fieldName,St.tabIndex=_,this._setRequired(St,this.data.required),Zt&&(St.maxLength=Zt),St.addEventListener("input",tn=>{dt.setValue(_t,{value:tn.target.value}),this.setPropertyOnSiblings(St,"value",tn.target.value,"value")}),St.addEventListener("resetform",tn=>{const Kt=this.data.defaultFieldValue??"";St.value=an.userValue=Kt,an.formattedValue=null});let Qt=tn=>{const{formattedValue:Kt}=an;Kt!=null&&(tn.target.value=Kt),tn.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){St.addEventListener("focus",Kt=>{an.userValue&&(Kt.target.value=an.userValue),an.valueOnFocus=Kt.target.value}),St.addEventListener("updatefromsandbox",Kt=>{const nn={value(ln){an.userValue=ln.detail.value??"",dt.setValue(_t,{value:an.userValue.toString()}),ln.target.value=an.userValue},formattedValue(ln){const{formattedValue:Mt}=ln.detail;an.formattedValue=Mt,Mt!=null&&ln.target!==document.activeElement&&(ln.target.value=Mt),dt.setValue(_t,{formattedValue:Mt})},selRange(ln){ln.target.setSelectionRange(...ln.detail.selRange)},charLimit:ln=>{var vn;const{charLimit:Mt}=ln.detail,{target:sn}=ln;if(Mt===0){sn.removeAttribute("maxLength");return}sn.setAttribute("maxLength",Mt);let gn=an.userValue;!gn||gn.length<=Mt||(gn=gn.slice(0,Mt),sn.value=an.userValue=gn,dt.setValue(_t,{value:gn}),(vn=this.linkService.eventBus)==null||vn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t,name:"Keystroke",value:gn,willCommit:!0,commitKey:1,selStart:sn.selectionStart,selEnd:sn.selectionEnd}}))}};this._dispatchEventFromSandbox(nn,Kt)}),St.addEventListener("keydown",Kt=>{var Mt;let nn=-1;if(Kt.key==="Escape"?nn=0:Kt.key==="Enter"?nn=2:Kt.key==="Tab"&&(nn=3),nn===-1)return;const{value:ln}=Kt.target;an.valueOnFocus!==ln&&(an.userValue=ln,(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t,name:"Keystroke",value:ln,willCommit:!0,commitKey:nn,selStart:Kt.target.selectionStart,selEnd:Kt.target.selectionEnd}}))});const tn=Qt;Qt=null,St.addEventListener("blur",Kt=>{var ln;const{value:nn}=Kt.target;an.userValue=nn,this._mouseState.isDown&&an.valueOnFocus!==nn&&((ln=this.linkService.eventBus)==null||ln.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t,name:"Keystroke",value:nn,willCommit:!0,commitKey:1,selStart:Kt.target.selectionStart,selEnd:Kt.target.selectionEnd}})),tn(Kt)}),(wt=this.data.actions)!=null&&wt.Keystroke&&St.addEventListener("beforeinput",Kt=>{var mn;const{data:nn,target:ln}=Kt,{value:Mt,selectionStart:sn,selectionEnd:gn}=ln;let vn=sn,_n=gn;switch(Kt.inputType){case"deleteWordBackward":{const Mn=Mt.substring(0,sn).match(/\w*[^\w]*$/);Mn&&(vn-=Mn[0].length);break}case"deleteWordForward":{const Mn=Mt.substring(sn).match(/^[^\w]*\w*/);Mn&&(_n+=Mn[0].length);break}case"deleteContentBackward":sn===gn&&(vn-=1);break;case"deleteContentForward":sn===gn&&(_n+=1);break}Kt.preventDefault(),(mn=this.linkService.eventBus)==null||mn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t,name:"Keystroke",value:Mt,change:nn||"",willCommit:!1,selStart:vn,selEnd:_n}})}),this._setEventListeners(St,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Kt=>Kt.target.value)}if(Qt&&St.addEventListener("blur",Qt),this.data.comb){const Kt=(this.data.rect[2]-this.data.rect[0])/Zt;St.classList.add("comb"),St.style.letterSpacing=`calc(${Kt}px * var(--scale-factor) - 1ch)`}}else St=document.createElement("div"),St.textContent=this.data.fieldValue,St.style.verticalAlign="middle",St.style.display="table-cell";return this._setTextStyle(St),this._setBackgroundColor(St),this._setDefaultPropertiesFromJS(St),this.container.append(St),this.container}}class it extends ot{constructor(dt){super(dt,{isRenderable:dt.renderForms})}render(){const dt=this.annotationStorage,_t=this.data,St=_t.id;let wt=dt.getValue(St,{value:_t.exportValue===_t.fieldValue}).value;typeof wt=="string"&&(wt=wt!=="Off",dt.setValue(St,{value:wt})),this.container.className="buttonWidgetAnnotation checkBox";const kt=document.createElement("input");return _e.add(kt),kt.setAttribute("data-element-id",St),kt.disabled=_t.readOnly,this._setRequired(kt,this.data.required),kt.type="checkbox",kt.name=_t.fieldName,wt&&kt.setAttribute("checked",!0),kt.setAttribute("exportValue",_t.exportValue),kt.tabIndex=_,kt.addEventListener("change",Nt=>{const{name:Zt,checked:an}=Nt.target;for(const Qt of this._getElementsByName(Zt,St)){const tn=an&&Qt.exportValue===_t.exportValue;Qt.domElement&&(Qt.domElement.checked=tn),dt.setValue(Qt.id,{value:tn})}dt.setValue(St,{value:an})}),kt.addEventListener("resetform",Nt=>{const Zt=_t.defaultFieldValue||"Off";Nt.target.checked=Zt===_t.exportValue}),this.enableScripting&&this.hasJSActions&&(kt.addEventListener("updatefromsandbox",Nt=>{const Zt={value(an){an.target.checked=an.detail.value!=="Off",dt.setValue(St,{value:an.target.checked})}};this._dispatchEventFromSandbox(Zt,Nt)}),this._setEventListeners(kt,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Nt=>Nt.target.checked)),this._setBackgroundColor(kt),this._setDefaultPropertiesFromJS(kt),this.container.append(kt),this.container}}class nt extends ot{constructor(dt){super(dt,{isRenderable:dt.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const dt=this.annotationStorage,_t=this.data,St=_t.id;let wt=dt.getValue(St,{value:_t.fieldValue===_t.buttonValue}).value;typeof wt=="string"&&(wt=wt!==_t.buttonValue,dt.setValue(St,{value:wt}));const kt=document.createElement("input");if(_e.add(kt),kt.setAttribute("data-element-id",St),kt.disabled=_t.readOnly,this._setRequired(kt,this.data.required),kt.type="radio",kt.name=_t.fieldName,wt&&kt.setAttribute("checked",!0),kt.tabIndex=_,kt.addEventListener("change",Nt=>{const{name:Zt,checked:an}=Nt.target;for(const Qt of this._getElementsByName(Zt,St))dt.setValue(Qt.id,{value:!1});dt.setValue(St,{value:an})}),kt.addEventListener("resetform",Nt=>{const Zt=_t.defaultFieldValue;Nt.target.checked=Zt!=null&&Zt===_t.buttonValue}),this.enableScripting&&this.hasJSActions){const Nt=_t.buttonValue;kt.addEventListener("updatefromsandbox",Zt=>{const an={value:Qt=>{const tn=Nt===Qt.detail.value;for(const Kt of this._getElementsByName(Qt.target.name)){const nn=tn&&Kt.id===St;Kt.domElement&&(Kt.domElement.checked=nn),dt.setValue(Kt.id,{value:nn})}}};this._dispatchEventFromSandbox(an,Zt)}),this._setEventListeners(kt,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Zt=>Zt.target.checked)}return this._setBackgroundColor(kt),this._setDefaultPropertiesFromJS(kt),this.container.append(kt),this.container}}class at extends tt{constructor(dt){super(dt,{ignoreBorder:dt.data.hasAppearance})}render(){const dt=super.render();dt.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(dt.title=this.data.alternativeText);const _t=dt.lastChild;return this.enableScripting&&this.hasJSActions&&_t&&(this._setDefaultPropertiesFromJS(_t),_t.addEventListener("updatefromsandbox",St=>{this._dispatchEventFromSandbox({},St)})),dt}}class yt extends ot{constructor(dt){super(dt,{isRenderable:dt.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const dt=this.annotationStorage,_t=this.data.id,St=dt.getValue(_t,{value:this.data.fieldValue}),wt=document.createElement("select");_e.add(wt),wt.setAttribute("data-element-id",_t),wt.disabled=this.data.readOnly,this._setRequired(wt,this.data.required),wt.name=this.data.fieldName,wt.tabIndex=_;let kt=this.data.combo&&this.data.options.length>0;this.data.combo||(wt.size=this.data.options.length,this.data.multiSelect&&(wt.multiple=!0)),wt.addEventListener("resetform",Qt=>{const tn=this.data.defaultFieldValue;for(const Kt of wt.options)Kt.selected=Kt.value===tn});for(const Qt of this.data.options){const tn=document.createElement("option");tn.textContent=Qt.displayValue,tn.value=Qt.exportValue,St.value.includes(Qt.exportValue)&&(tn.setAttribute("selected",!0),kt=!1),wt.append(tn)}let Nt=null;if(kt){const Qt=document.createElement("option");Qt.value=" ",Qt.setAttribute("hidden",!0),Qt.setAttribute("selected",!0),wt.prepend(Qt),Nt=()=>{Qt.remove(),wt.removeEventListener("input",Nt),Nt=null},wt.addEventListener("input",Nt)}const Zt=(Qt,tn)=>{const Kt=tn?"value":"textContent",nn=Qt.target.options;return Qt.target.multiple?Array.prototype.filter.call(nn,ln=>ln.selected).map(ln=>ln[Kt]):nn.selectedIndex===-1?null:nn[nn.selectedIndex][Kt]},an=Qt=>{const tn=Qt.target.options;return Array.prototype.map.call(tn,Kt=>({displayValue:Kt.textContent,exportValue:Kt.value}))};return this.enableScripting&&this.hasJSActions?(wt.addEventListener("updatefromsandbox",Qt=>{const tn={value(Kt){Nt==null||Nt();const nn=Kt.detail.value,ln=new Set(Array.isArray(nn)?nn:[nn]);for(const Mt of wt.options)Mt.selected=ln.has(Mt.value);dt.setValue(_t,{value:Zt(Kt,!0)})},multipleSelection(Kt){wt.multiple=!0},remove(Kt){const nn=wt.options,ln=Kt.detail.remove;nn[ln].selected=!1,wt.remove(ln),nn.length>0&&Array.prototype.findIndex.call(nn,sn=>sn.selected)===-1&&(nn[0].selected=!0),dt.setValue(_t,{value:Zt(Kt,!0),items:an(Kt)})},clear(Kt){for(;wt.length!==0;)wt.remove(0);dt.setValue(_t,{value:null,items:[]})},insert(Kt){const{index:nn,displayValue:ln,exportValue:Mt}=Kt.detail.insert,sn=wt.children[nn],gn=document.createElement("option");gn.textContent=ln,gn.value=Mt,sn?sn.before(gn):wt.append(gn),dt.setValue(_t,{value:Zt(Kt,!0),items:an(Kt)})},items(Kt){const{items:nn}=Kt.detail;for(;wt.length!==0;)wt.remove(0);for(const ln of nn){const{displayValue:Mt,exportValue:sn}=ln,gn=document.createElement("option");gn.textContent=Mt,gn.value=sn,wt.append(gn)}wt.options.length>0&&(wt.options[0].selected=!0),dt.setValue(_t,{value:Zt(Kt,!0),items:an(Kt)})},indices(Kt){const nn=new Set(Kt.detail.indices);for(const ln of Kt.target.options)ln.selected=nn.has(ln.index);dt.setValue(_t,{value:Zt(Kt,!0)})},editable(Kt){Kt.target.disabled=!Kt.detail.editable}};this._dispatchEventFromSandbox(tn,Qt)}),wt.addEventListener("input",Qt=>{var nn;const tn=Zt(Qt,!0),Kt=Zt(Qt,!1);dt.setValue(_t,{value:tn}),(nn=this.linkService.eventBus)==null||nn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_t,name:"Keystroke",value:Kt,changeEx:tn,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(wt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],Qt=>Qt.target.checked)):wt.addEventListener("input",function(Qt){dt.setValue(_t,{value:Zt(Qt,!0)})}),this.data.combo&&this._setTextStyle(wt),this._setBackgroundColor(wt),this._setDefaultPropertiesFromJS(wt),this.container.append(wt),this.container}}class vt extends lt{constructor(dt){var St,wt,kt;const _t=!!((St=dt.data.titleObj)!=null&&St.str||(wt=dt.data.contentsObj)!=null&&wt.str||(kt=dt.data.richText)!=null&&kt.str);super(dt,{isRenderable:_t})}render(){const dt=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",dt.includes(this.data.parentType))return this.container;const _t=`[data-annotation-id="${this.data.parentId}"]`,St=this.layer.querySelectorAll(_t);if(St.length===0)return this.container;const wt=new xt({container:this.container,trigger:Array.from(St),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),kt=this.page,Nt=o.Util.normalizeRect([this.data.parentRect[0],kt.view[3]-this.data.parentRect[1]+kt.view[1],this.data.parentRect[2],kt.view[3]-this.data.parentRect[3]+kt.view[1]]),Zt=Nt[0]+this.data.parentRect[2]-this.data.parentRect[0],an=Nt[1],[Qt,tn,Kt,nn]=this.viewport.viewBox,ln=Kt-Qt,Mt=nn-tn;return this.container.style.left=`${100*(Zt-Qt)/ln}%`,this.container.style.top=`${100*(an-tn)/Mt}%`,this.container.append(wt.render()),this.container}}class xt{constructor(dt){this.container=dt.container,this.trigger=dt.trigger,this.color=dt.color,this.titleObj=dt.titleObj,this.modificationDate=dt.modificationDate,this.contentsObj=dt.contentsObj,this.richText=dt.richText,this.hideWrapper=dt.hideWrapper||!1,this.pinned=!1}render(){var Zt,an;const _t=document.createElement("div");_t.className="popupWrapper",this.hideElement=this.hideWrapper?_t:this.container,this.hideElement.hidden=!0;const St=document.createElement("div");St.className="popup";const wt=this.color;if(wt){const Qt=.7*(255-wt[0])+wt[0],tn=.7*(255-wt[1])+wt[1],Kt=.7*(255-wt[2])+wt[2];St.style.backgroundColor=o.Util.makeHexColor(Qt|0,tn|0,Kt|0)}const kt=document.createElement("h1");kt.dir=this.titleObj.dir,kt.textContent=this.titleObj.str,St.append(kt);const Nt=a.PDFDateString.toDateObject(this.modificationDate);if(Nt){const Qt=document.createElement("span");Qt.className="popupDate",Qt.textContent="{{date}}, {{time}}",Qt.dataset.l10nId="annotation_date_string",Qt.dataset.l10nArgs=JSON.stringify({date:Nt.toLocaleDateString(),time:Nt.toLocaleTimeString()}),St.append(Qt)}if((Zt=this.richText)!=null&&Zt.str&&(!((an=this.contentsObj)!=null&&an.str)||this.contentsObj.str===this.richText.str))g.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:St}),St.lastChild.className="richText popupContent";else{const Qt=this._formatContents(this.contentsObj);St.append(Qt)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const Qt of this.trigger)Qt.addEventListener("click",this._toggle.bind(this)),Qt.addEventListener("mouseover",this._show.bind(this,!1)),Qt.addEventListener("mouseout",this._hide.bind(this,!1));return St.addEventListener("click",this._hide.bind(this,!0)),_t.append(St),_t}_formatContents({str:dt,dir:_t}){const St=document.createElement("p");St.className="popupContent",St.dir=_t;const wt=dt.split(/(?:\r\n?|\n)/);for(let kt=0,Nt=wt.length;kt{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorConverters=void 0;function s(a){return Math.floor(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")}class o{static CMYK_G([c,d,g,_]){return["G",1-Math.min(1,.3*c+.59*g+.11*d+_)]}static G_CMYK([c]){return["CMYK",0,0,0,1-c]}static G_RGB([c]){return["RGB",c,c,c]}static G_HTML([c]){const d=s(c);return`#${d}${d}${d}`}static RGB_G([c,d,g]){return["G",.3*c+.59*d+.11*g]}static RGB_HTML([c,d,g]){const _=s(c),b=s(d),_e=s(g);return`#${_}${b}${_e}`}static T_HTML(){return"#00000000"}static CMYK_RGB([c,d,g,_]){return["RGB",1-Math.min(1,c+_),1-Math.min(1,g+_),1-Math.min(1,d+_)]}static CMYK_HTML(c){const d=this.CMYK_RGB(c).slice(1);return this.RGB_HTML(d)}static RGB_CMYK([c,d,g]){const _=1-c,b=1-d,_e=1-g,rt=Math.min(_,b,_e);return["CMYK",_,b,_e,rt]}}i.ColorConverters=o},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.XfaLayer=void 0;var o=s(20);class a{static setupStorage(d,g,_,b,_e){const rt=b.getValue(g,{value:null});switch(_.name){case"textarea":if(rt.value!==null&&(d.textContent=rt.value),_e==="print")break;d.addEventListener("input",st=>{b.setValue(g,{value:st.target.value})});break;case"input":if(_.attributes.type==="radio"||_.attributes.type==="checkbox"){if(rt.value===_.attributes.xfaOn?d.setAttribute("checked",!0):rt.value===_.attributes.xfaOff&&d.removeAttribute("checked"),_e==="print")break;d.addEventListener("change",st=>{b.setValue(g,{value:st.target.checked?st.target.getAttribute("xfaOn"):st.target.getAttribute("xfaOff")})})}else{if(rt.value!==null&&d.setAttribute("value",rt.value),_e==="print")break;d.addEventListener("input",st=>{b.setValue(g,{value:st.target.value})})}break;case"select":if(rt.value!==null)for(const st of _.children)st.attributes.value===rt.value&&(st.attributes.selected=!0);d.addEventListener("input",st=>{const lt=st.target.options,tt=lt.selectedIndex===-1?"":lt[lt.selectedIndex].value;b.setValue(g,{value:tt})});break}}static setAttributes({html:d,element:g,storage:_=null,intent:b,linkService:_e}){const{attributes:rt}=g,st=d instanceof HTMLAnchorElement;rt.type==="radio"&&(rt.name=`${rt.name}-${b}`);for(const[lt,tt]of Object.entries(rt))if(tt!=null)switch(lt){case"class":tt.length&&d.setAttribute(lt,tt.join(" "));break;case"dataId":break;case"id":d.setAttribute("data-element-id",tt);break;case"style":Object.assign(d.style,tt);break;case"textContent":d.textContent=tt;break;default:(!st||lt!=="href"&<!=="newWindow")&&d.setAttribute(lt,tt)}st&&_e.addLinkAttributes(d,rt.href,rt.newWindow),_&&rt.dataId&&this.setupStorage(d,rt.dataId,g,_)}static render(d){var $;const g=d.annotationStorage,_=d.linkService,b=d.xfaHtml,_e=d.intent||"display",rt=document.createElement(b.name);b.attributes&&this.setAttributes({html:rt,element:b,intent:_e,linkService:_});const st=[[b,-1,rt]],lt=d.div;if(lt.append(rt),d.viewport){const ot=`matrix(${d.viewport.transform.join(",")})`;lt.style.transform=ot}_e!=="richText"&<.setAttribute("class","xfaLayer xfaFont");const tt=[];for(;st.length>0;){const[ot,et,it]=st.at(-1);if(et+1===ot.children.length){st.pop();continue}const nt=ot.children[++st.at(-1)[1]];if(nt===null)continue;const{name:at}=nt;if(at==="#text"){const vt=document.createTextNode(nt.value);tt.push(vt),it.append(vt);continue}let yt;if(($=nt==null?void 0:nt.attributes)!=null&&$.xmlns?yt=document.createElementNS(nt.attributes.xmlns,at):yt=document.createElement(at),it.append(yt),nt.attributes&&this.setAttributes({html:yt,element:nt,storage:g,intent:_e,linkService:_}),nt.children&&nt.children.length>0)st.push([nt,-1,yt]);else if(nt.value){const vt=document.createTextNode(nt.value);o.XfaText.shouldBuildText(at)&&tt.push(vt),yt.append(vt)}}for(const ot of lt.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))ot.setAttribute("readOnly",!0);return{textDivs:tt}}static update(d){const g=`matrix(${d.viewport.transform.join(",")})`;d.div.style.transform=g,d.div.hidden=!1}}i.XfaLayer=a},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextLayerRenderTask=void 0,i.renderTextLayer=it;var o=s(1),a=s(8);const c=1e5,d=30,g=.8,_=new Map,b=/^\s+$/g;function _e(nt,at){const yt=_.get(nt);if(yt)return yt;at.save(),at.font=`${d}px ${nt}`;const vt=at.measureText("");let xt=vt.fontBoundingBoxAscent,ct=Math.abs(vt.fontBoundingBoxDescent);if(xt){at.restore();const ht=xt/(xt+ct);return _.set(nt,ht),ht}at.strokeStyle="red",at.clearRect(0,0,d,d),at.strokeText("g",0,0);let pt=at.getImageData(0,0,d,d).data;ct=0;for(let ht=pt.length-1-3;ht>=0;ht-=4)if(pt[ht]>0){ct=Math.ceil(ht/4/d);break}at.clearRect(0,0,d,d),at.strokeText("A",0,d),pt=at.getImageData(0,0,d,d).data,xt=0;for(let ht=0,Et=pt.length;ht0){xt=d-Math.floor(ht/4/d);break}if(at.restore(),xt){const ht=xt/(xt+ct);return _.set(nt,ht),ht}return _.set(nt,g),g}function rt(nt,at,yt,vt){const xt=document.createElement("span"),ct=nt._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:at.str!=="",hasEOL:at.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:at.str!=="",hasEOL:at.hasEOL,fontSize:0};nt._textDivs.push(xt);const pt=o.Util.transform(nt._viewport.transform,at.transform);let ht=Math.atan2(pt[1],pt[0]);const Et=yt[at.fontName];Et.vertical&&(ht+=Math.PI/2);const Ct=Math.hypot(pt[2],pt[3]),Bt=Ct*_e(Et.fontFamily,vt);let Lt,Yt;ht===0?(Lt=pt[4],Yt=pt[5]-Bt):(Lt=pt[4]+Bt*Math.sin(ht),Yt=pt[5]-Bt*Math.cos(ht)),xt.style.left=`${Lt}px`,xt.style.top=`${Yt}px`,xt.style.fontSize=`${Ct}px`,xt.style.fontFamily=Et.fontFamily,ct.fontSize=Ct,xt.setAttribute("role","presentation"),xt.textContent=at.str,xt.dir=at.dir,nt._fontInspectorEnabled&&(xt.dataset.fontName=at.fontName),ht!==0&&(ct.angle=ht*(180/Math.PI));let Wt=!1;if(at.str.length>1||nt._enhanceTextSelection&&b.test(at.str))Wt=!0;else if(at.str!==" "&&at.transform[0]!==at.transform[3]){const jt=Math.abs(at.transform[0]),Ft=Math.abs(at.transform[3]);jt!==Ft&&Math.max(jt,Ft)/Math.min(jt,Ft)>1.5&&(Wt=!0)}if(Wt&&(Et.vertical?ct.canvasWidth=at.height*nt._viewport.scale:ct.canvasWidth=at.width*nt._viewport.scale),nt._textDivProperties.set(xt,ct),nt._textContentStream&&nt._layoutText(xt),nt._enhanceTextSelection&&ct.hasText){let jt=1,Ft=0;ht!==0&&(jt=Math.cos(ht),Ft=Math.sin(ht));const Ht=(Et.vertical?at.height:at.width)*nt._viewport.scale,qt=Ct;let Xt,Tt;ht!==0?(Xt=[jt,Ft,-Ft,jt,Lt,Yt],Tt=o.Util.getAxialAlignedBoundingBox([0,0,Ht,qt],Xt)):Tt=[Lt,Yt,Lt+Ht,Yt+qt],nt._bounds.push({left:Tt[0],top:Tt[1],right:Tt[2],bottom:Tt[3],div:xt,size:[Ht,qt],m:Xt})}}function st(nt){if(nt._canceled)return;const at=nt._textDivs,yt=nt._capability,vt=at.length;if(vt>c){nt._renderingDone=!0,yt.resolve();return}if(!nt._textContentStream)for(let xt=0;xt0&&(vt=vt?Math.min(ct,vt):ct)}return vt}function tt(nt){const at=nt._bounds,yt=nt._viewport,vt=$(yt.width,yt.height,at);for(let xt=0;xt=0&&vt[pt].start>=xt.y2;)pt--;let ht,Et,Ct,Bt,Lt=-1/0;for(Ct=ct;Ct<=pt;Ct++){ht=vt[Ct],Et=ht.boundary;let jt;Et.x2>xt.x1?jt=Et.index>xt.index?Et.x1New:xt.x1:Et.x2New===void 0?jt=(Et.x2+xt.x1)/2:jt=Et.x2New,jt>Lt&&(Lt=jt)}for(xt.x1New=Lt,Ct=ct;Ct<=pt;Ct++)ht=vt[Ct],Et=ht.boundary,Et.x2New===void 0?Et.x2>xt.x1?Et.index>xt.index&&(Et.x2New=Et.x2):Et.x2New=Lt:Et.x2New>Lt&&(Et.x2New=Math.max(Lt,Et.x2));const Yt=[];let Wt=null;for(Ct=ct;Ct<=pt;Ct++){ht=vt[Ct],Et=ht.boundary;const jt=Et.x2>xt.x2?Et:xt;Wt===jt?Yt.at(-1).end=ht.end:(Yt.push({start:ht.start,end:ht.end,boundary:jt}),Wt=jt)}for(vt[ct].start=0&&vt[Bt].start>=Et.y1;Bt--)jt=vt[Bt].boundary===Et;for(Bt=pt+1;!jt&&Bt{this._enhanceTextSelection||(this._textDivProperties=null),this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new o.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(at,yt){for(let vt=0,xt=at.length;vt0){const ht=this._devicePixelRatio*yt.canvasWidth/pt;this._enhanceTextSelection&&(yt.scale=ht),vt=`scaleX(${ht})`}}if(yt.angle!==0&&(vt=`rotate(${yt.angle}deg) ${vt}`),vt.length>0&&(this._enhanceTextSelection&&(yt.originalTransform=vt),at.style.transform=vt),yt.hasText&&this._container.append(at),yt.hasEOL){const xt=document.createElement("br");xt.setAttribute("role","presentation"),this._container.append(xt)}}_render(at=0){const yt=(0,o.createPromiseCapability)();let vt=Object.create(null);const xt=this._document.createElement("canvas");if(xt.height=xt.width=d,this._layoutTextCtx=xt.getContext("2d",{alpha:!1}),this._textContent){const ct=this._textContent.items,pt=this._textContent.styles;this._processItems(ct,pt),yt.resolve()}else if(this._textContentStream){const ct=()=>{this._reader.read().then(({value:pt,done:ht})=>{if(ht){yt.resolve();return}Object.assign(vt,pt.styles),this._processItems(pt.items,vt),ct()},yt.reject)};this._reader=this._textContentStream.getReader(),ct()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');yt.promise.then(()=>{vt=null,at?this._renderTimer=setTimeout(()=>{st(this),this._renderTimer=null},at):st(this)},this._capability.reject)}expandTextDivs(at=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(tt(this),this._bounds=null);const yt=[],vt=[];for(let xt=0,ct=this._textDivs.length;xt0?(vt.push(`${ht.paddingTop}px`),yt.push(`translateY(${-ht.paddingTop}px)`)):vt.push(0),ht.paddingRight>0?vt.push(`${ht.paddingRight/ht.scale}px`):vt.push(0),ht.paddingBottom>0?vt.push(`${ht.paddingBottom}px`):vt.push(0),ht.paddingLeft>0?(vt.push(`${ht.paddingLeft/ht.scale}px`),yt.push(`translateX(${-ht.paddingLeft/ht.scale}px)`)):vt.push(0),pt.style.padding=vt.join(" "),yt.length&&(pt.style.transform=yt.join(" "))):(pt.style.padding=null,pt.style.transform=ht.originalTransform))}}}i.TextLayerRenderTask=et;function it(nt){const at=new et({textContent:nt.textContent,textContentStream:nt.textContentStream,container:nt.container,viewport:nt.viewport,textDivs:nt.textDivs,textContentItemsStr:nt.textContentItemsStr,enhanceTextSelection:nt.enhanceTextSelection});return at._render(nt.timeout),at}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SVGGraphics=void 0;var o=s(8),a=s(1),c=s(3);let d=class{constructor(){(0,a.unreachable)("Not implemented: SVGGraphics")}};i.SVGGraphics=d;{let it=function(ct){let pt=[];const ht=[];for(const Et of ct){if(Et.fn==="save"){pt.push({fnId:92,fn:"group",items:[]}),ht.push(pt),pt=pt.at(-1).items;continue}Et.fn==="restore"?pt=ht.pop():pt.push(Et)}return pt},nt=function(ct){if(Number.isInteger(ct))return ct.toString();const pt=ct.toFixed(10);let ht=pt.length-1;if(pt[ht]!=="0")return pt;do ht--;while(pt[ht]==="0");return pt.substring(0,pt[ht]==="."?ht:ht+1)},at=function(ct){if(ct[4]===0&&ct[5]===0){if(ct[1]===0&&ct[2]===0)return ct[0]===1&&ct[3]===1?"":`scale(${nt(ct[0])} ${nt(ct[3])})`;if(ct[0]===ct[3]&&ct[1]===-ct[2]){const pt=Math.acos(ct[0])*180/Math.PI;return`rotate(${nt(pt)})`}}else if(ct[0]===1&&ct[1]===0&&ct[2]===0&&ct[3]===1)return`translate(${nt(ct[4])} ${nt(ct[5])})`;return`matrix(${nt(ct[0])} ${nt(ct[1])} ${nt(ct[2])} ${nt(ct[3])} ${nt(ct[4])} ${nt(ct[5])})`};var g=it,_=nt,b=at;const _e={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},rt="http://www.w3.org/XML/1998/namespace",st="http://www.w3.org/1999/xlink",lt=["butt","round","square"],tt=["miter","round","bevel"],$=function(ct,pt="",ht=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!ht)return URL.createObjectURL(new Blob([ct],{type:pt}));const Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let Ct=`data:${pt};base64,`;for(let Bt=0,Lt=ct.length;Bt>2,Ht=(Yt&3)<<4|Wt>>4,qt=Bt+1>6:64,Xt=Bt+2>1&2147483647:Ft=Ft>>1&2147483647;ht[jt]=Ft}function Et(jt,Ft,Ht){let qt=-1;for(let Xt=Ft;Xt>>8^gt}return qt^-1}function Ct(jt,Ft,Ht,qt){let Xt=qt;const Tt=Ft.length;Ht[Xt]=Tt>>24&255,Ht[Xt+1]=Tt>>16&255,Ht[Xt+2]=Tt>>8&255,Ht[Xt+3]=Tt&255,Xt+=4,Ht[Xt]=jt.charCodeAt(0)&255,Ht[Xt+1]=jt.charCodeAt(1)&255,Ht[Xt+2]=jt.charCodeAt(2)&255,Ht[Xt+3]=jt.charCodeAt(3)&255,Xt+=4,Ht.set(Ft,Xt),Xt+=Ft.length;const gt=Et(Ht,qt+4,Xt);Ht[Xt]=gt>>24&255,Ht[Xt+1]=gt>>16&255,Ht[Xt+2]=gt>>8&255,Ht[Xt+3]=gt&255}function Bt(jt,Ft,Ht){let qt=1,Xt=0;for(let Tt=Ft;Tt=8?Ft=jt:Ft=Buffer.from(jt);const Ht=require$$5.deflateSync(Ft,{level:9});return Ht instanceof Uint8Array?Ht:new Uint8Array(Ht)}catch(Ft){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Ft)}return Yt(jt)}function Yt(jt){let Ft=jt.length;const Ht=65535,qt=Math.ceil(Ft/Ht),Xt=new Uint8Array(2+Ft+qt*5+4);let Tt=0;Xt[Tt++]=120,Xt[Tt++]=156;let gt=0;for(;Ft>Ht;)Xt[Tt++]=0,Xt[Tt++]=255,Xt[Tt++]=255,Xt[Tt++]=0,Xt[Tt++]=0,Xt.set(jt.subarray(gt,gt+Ht),Tt),Tt+=Ht,gt+=Ht,Ft-=Ht;Xt[Tt++]=1,Xt[Tt++]=Ft&255,Xt[Tt++]=Ft>>8&255,Xt[Tt++]=~Ft&65535&255,Xt[Tt++]=(~Ft&65535)>>8&255,Xt.set(jt.subarray(gt),Tt),Tt+=jt.length-gt;const mt=Bt(jt,0,jt.length);return Xt[Tt++]=mt>>24&255,Xt[Tt++]=mt>>16&255,Xt[Tt++]=mt>>8&255,Xt[Tt++]=mt&255,Xt}function Wt(jt,Ft,Ht,qt){const Xt=jt.width,Tt=jt.height;let gt,mt,At;const Rt=jt.data;switch(Ft){case a.ImageKind.GRAYSCALE_1BPP:mt=0,gt=1,At=Xt+7>>3;break;case a.ImageKind.RGB_24BPP:mt=2,gt=8,At=Xt*3;break;case a.ImageKind.RGBA_32BPP:mt=6,gt=8,At=Xt*4;break;default:throw new Error("invalid format")}const Dt=new Uint8Array((1+At)*Tt);let Ot=0,$t=0;for(let kt=0;kt>24&255,Xt>>16&255,Xt>>8&255,Xt&255,Tt>>24&255,Tt>>16&255,Tt>>8&255,Tt&255,gt,mt,0,0,0]),dt=Lt(Dt),_t=ct.length+pt*3+zt.length+dt.length,St=new Uint8Array(_t);let wt=0;return St.set(ct,wt),wt+=ct.length,Ct("IHDR",zt,St,wt),wt+=pt+zt.length,Ct("IDATA",dt,St,wt),wt+=pt+dt.length,Ct("IEND",new Uint8Array(0),St,wt),$(St,"image/png",Ht)}return function(Ft,Ht,qt){const Xt=Ft.kind===void 0?a.ImageKind.GRAYSCALE_1BPP:Ft.kind;return Wt(Ft,Xt,Ht,qt)}}();class et{constructor(){this.fontSizeScale=1,this.fontWeight=_e.fontWeight,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=_e.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(pt,ht){this.x=pt,this.y=ht}}let yt=0,vt=0,xt=0;i.SVGGraphics=d=class{constructor(ct,pt,ht=!1){(0,o.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new o.DOMSVGFactory,this.current=new et,this.transformMatrix=a.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ct,this.objs=pt,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!ht,this._operatorIdMapping=[];for(const Et in a.OPS)this._operatorIdMapping[a.OPS[Et]]=Et}save(){this.transformStack.push(this.transformMatrix);const ct=this.current;this.extraStack.push(ct),this.current=ct.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ct){this.save(),this.executeOpTree(ct),this.restore()}loadDependencies(ct){const pt=ct.fnArray,ht=ct.argsArray;for(let Et=0,Ct=pt.length;Et{Lt.get(Bt,Wt)});this.current.dependencies.push(Yt)}return Promise.all(this.current.dependencies)}transform(ct,pt,ht,Et,Ct,Bt){const Lt=[ct,pt,ht,Et,Ct,Bt];this.transformMatrix=a.Util.transform(this.transformMatrix,Lt),this.tgrp=null}getSVG(ct,pt){this.viewport=pt;const ht=this._initialize(pt);return this.loadDependencies(ct).then(()=>(this.transformMatrix=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ct)),ht))}convertOpList(ct){const pt=this._operatorIdMapping,ht=ct.argsArray,Et=ct.fnArray,Ct=[];for(let Bt=0,Lt=Et.length;Bt0&&(this.current.lineWidth=ct)}setLineCap(ct){this.current.lineCap=lt[ct]}setLineJoin(ct){this.current.lineJoin=tt[ct]}setMiterLimit(ct){this.current.miterLimit=ct}setStrokeAlpha(ct){this.current.strokeAlpha=ct}setStrokeRGBColor(ct,pt,ht){this.current.strokeColor=a.Util.makeHexColor(ct,pt,ht)}setFillAlpha(ct){this.current.fillAlpha=ct}setFillRGBColor(ct,pt,ht){this.current.fillColor=a.Util.makeHexColor(ct,pt,ht),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ct){this.current.strokeColor=this._makeColorN_Pattern(ct)}setFillColorN(ct){this.current.fillColor=this._makeColorN_Pattern(ct)}shadingFill(ct){const pt=this.viewport.width,ht=this.viewport.height,Et=a.Util.inverseTransform(this.transformMatrix),Ct=a.Util.applyTransform([0,0],Et),Bt=a.Util.applyTransform([0,ht],Et),Lt=a.Util.applyTransform([pt,0],Et),Yt=a.Util.applyTransform([pt,ht],Et),Wt=Math.min(Ct[0],Bt[0],Lt[0],Yt[0]),jt=Math.min(Ct[1],Bt[1],Lt[1],Yt[1]),Ft=Math.max(Ct[0],Bt[0],Lt[0],Yt[0]),Ht=Math.max(Ct[1],Bt[1],Lt[1],Yt[1]),qt=this.svgFactory.createElement("svg:rect");qt.setAttributeNS(null,"x",Wt),qt.setAttributeNS(null,"y",jt),qt.setAttributeNS(null,"width",Ft-Wt),qt.setAttributeNS(null,"height",Ht-jt),qt.setAttributeNS(null,"fill",this._makeShadingPattern(ct)),this.current.fillAlpha<1&&qt.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(qt)}_makeColorN_Pattern(ct){return ct[0]==="TilingPattern"?this._makeTilingPattern(ct):this._makeShadingPattern(ct)}_makeTilingPattern(ct){const pt=ct[1],ht=ct[2],Et=ct[3]||a.IDENTITY_MATRIX,[Ct,Bt,Lt,Yt]=ct[4],Wt=ct[5],jt=ct[6],Ft=ct[7],Ht=`shading${xt++}`,[qt,Xt,Tt,gt]=a.Util.normalizeRect([...a.Util.applyTransform([Ct,Bt],Et),...a.Util.applyTransform([Lt,Yt],Et)]),[mt,At]=a.Util.singularValueDecompose2dScale(Et),Rt=Wt*mt,Dt=jt*At,Ot=this.svgFactory.createElement("svg:pattern");Ot.setAttributeNS(null,"id",Ht),Ot.setAttributeNS(null,"patternUnits","userSpaceOnUse"),Ot.setAttributeNS(null,"width",Rt),Ot.setAttributeNS(null,"height",Dt),Ot.setAttributeNS(null,"x",`${qt}`),Ot.setAttributeNS(null,"y",`${Xt}`);const $t=this.svg,zt=this.transformMatrix,dt=this.current.fillColor,_t=this.current.strokeColor,St=this.svgFactory.create(Tt-qt,gt-Xt);if(this.svg=St,this.transformMatrix=Et,Ft===2){const wt=a.Util.makeHexColor(...pt);this.current.fillColor=wt,this.current.strokeColor=wt}return this.executeOpTree(this.convertOpList(ht)),this.svg=$t,this.transformMatrix=zt,this.current.fillColor=dt,this.current.strokeColor=_t,Ot.append(St.childNodes[0]),this.defs.append(Ot),`url(#${Ht})`}_makeShadingPattern(ct){switch(typeof ct=="string"&&(ct=this.objs.get(ct)),ct[0]){case"RadialAxial":const pt=`shading${xt++}`,ht=ct[3];let Et;switch(ct[1]){case"axial":const Ct=ct[4],Bt=ct[5];Et=this.svgFactory.createElement("svg:linearGradient"),Et.setAttributeNS(null,"id",pt),Et.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Et.setAttributeNS(null,"x1",Ct[0]),Et.setAttributeNS(null,"y1",Ct[1]),Et.setAttributeNS(null,"x2",Bt[0]),Et.setAttributeNS(null,"y2",Bt[1]);break;case"radial":const Lt=ct[4],Yt=ct[5],Wt=ct[6],jt=ct[7];Et=this.svgFactory.createElement("svg:radialGradient"),Et.setAttributeNS(null,"id",pt),Et.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Et.setAttributeNS(null,"cx",Yt[0]),Et.setAttributeNS(null,"cy",Yt[1]),Et.setAttributeNS(null,"r",jt),Et.setAttributeNS(null,"fx",Lt[0]),Et.setAttributeNS(null,"fy",Lt[1]),Et.setAttributeNS(null,"fr",Wt);break;default:throw new Error(`Unknown RadialAxial type: ${ct[1]}`)}for(const Ct of ht){const Bt=this.svgFactory.createElement("svg:stop");Bt.setAttributeNS(null,"offset",Ct[0]),Bt.setAttributeNS(null,"stop-color",Ct[1]),Et.append(Bt)}return this.defs.append(Et),`url(#${pt})`;case"Mesh":return(0,a.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${ct[0]}`)}}setDash(ct,pt){this.current.dashArray=ct,this.current.dashPhase=pt}constructPath(ct,pt){const ht=this.current;let Et=ht.x,Ct=ht.y,Bt=[],Lt=0;for(const Yt of ct)switch(Yt|0){case a.OPS.rectangle:Et=pt[Lt++],Ct=pt[Lt++];const Wt=pt[Lt++],jt=pt[Lt++],Ft=Et+Wt,Ht=Ct+jt;Bt.push("M",nt(Et),nt(Ct),"L",nt(Ft),nt(Ct),"L",nt(Ft),nt(Ht),"L",nt(Et),nt(Ht),"Z");break;case a.OPS.moveTo:Et=pt[Lt++],Ct=pt[Lt++],Bt.push("M",nt(Et),nt(Ct));break;case a.OPS.lineTo:Et=pt[Lt++],Ct=pt[Lt++],Bt.push("L",nt(Et),nt(Ct));break;case a.OPS.curveTo:Et=pt[Lt+4],Ct=pt[Lt+5],Bt.push("C",nt(pt[Lt]),nt(pt[Lt+1]),nt(pt[Lt+2]),nt(pt[Lt+3]),nt(Et),nt(Ct)),Lt+=6;break;case a.OPS.curveTo2:Bt.push("C",nt(Et),nt(Ct),nt(pt[Lt]),nt(pt[Lt+1]),nt(pt[Lt+2]),nt(pt[Lt+3])),Et=pt[Lt+2],Ct=pt[Lt+3],Lt+=4;break;case a.OPS.curveTo3:Et=pt[Lt+2],Ct=pt[Lt+3],Bt.push("C",nt(pt[Lt]),nt(pt[Lt+1]),nt(Et),nt(Ct),nt(Et),nt(Ct)),Lt+=4;break;case a.OPS.closePath:Bt.push("Z");break}Bt=Bt.join(" "),ht.path&&ct.length>0&&ct[0]!==a.OPS.rectangle&&ct[0]!==a.OPS.moveTo?Bt=ht.path.getAttributeNS(null,"d")+Bt:(ht.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(ht.path)),ht.path.setAttributeNS(null,"d",Bt),ht.path.setAttributeNS(null,"fill","none"),ht.element=ht.path,ht.setCurrentPoint(Et,Ct)}endPath(){const ct=this.current;if(ct.path=null,!this.pendingClip)return;if(!ct.element){this.pendingClip=null;return}const pt=`clippath${yt++}`,ht=this.svgFactory.createElement("svg:clipPath");ht.setAttributeNS(null,"id",pt),ht.setAttributeNS(null,"transform",at(this.transformMatrix));const Et=ct.element.cloneNode(!0);if(this.pendingClip==="evenodd"?Et.setAttributeNS(null,"clip-rule","evenodd"):Et.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,ht.append(Et),this.defs.append(ht),ct.activeClipUrl){ct.clipGroup=null;for(const Ct of this.extraStack)Ct.clipGroup=null;ht.setAttributeNS(null,"clip-path",ct.activeClipUrl)}ct.activeClipUrl=`url(#${pt})`,this.tgrp=null}clip(ct){this.pendingClip=ct}closePath(){const ct=this.current;if(ct.path){const pt=`${ct.path.getAttributeNS(null,"d")}Z`;ct.path.setAttributeNS(null,"d",pt)}}setLeading(ct){this.current.leading=-ct}setTextRise(ct){this.current.textRise=ct}setTextRenderingMode(ct){this.current.textRenderingMode=ct}setHScale(ct){this.current.textHScale=ct/100}setRenderingIntent(ct){}setFlatness(ct){}setGState(ct){for(const[pt,ht]of ct)switch(pt){case"LW":this.setLineWidth(ht);break;case"LC":this.setLineCap(ht);break;case"LJ":this.setLineJoin(ht);break;case"ML":this.setMiterLimit(ht);break;case"D":this.setDash(ht[0],ht[1]);break;case"RI":this.setRenderingIntent(ht);break;case"FL":this.setFlatness(ht);break;case"Font":this.setFont(ht);break;case"CA":this.setStrokeAlpha(ht);break;case"ca":this.setFillAlpha(ht);break;default:(0,a.warn)(`Unimplemented graphic state operator ${pt}`);break}}fill(){const ct=this.current;ct.element&&(ct.element.setAttributeNS(null,"fill",ct.fillColor),ct.element.setAttributeNS(null,"fill-opacity",ct.fillAlpha),this.endPath())}stroke(){const ct=this.current;ct.element&&(this._setStrokeAttributes(ct.element),ct.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ct,pt=1){const ht=this.current;let Et=ht.dashArray;pt!==1&&Et.length>0&&(Et=Et.map(function(Ct){return pt*Ct})),ct.setAttributeNS(null,"stroke",ht.strokeColor),ct.setAttributeNS(null,"stroke-opacity",ht.strokeAlpha),ct.setAttributeNS(null,"stroke-miterlimit",nt(ht.miterLimit)),ct.setAttributeNS(null,"stroke-linecap",ht.lineCap),ct.setAttributeNS(null,"stroke-linejoin",ht.lineJoin),ct.setAttributeNS(null,"stroke-width",nt(pt*ht.lineWidth)+"px"),ct.setAttributeNS(null,"stroke-dasharray",Et.map(nt).join(" ")),ct.setAttributeNS(null,"stroke-dashoffset",nt(pt*ht.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ct=this.svgFactory.createElement("svg:rect");ct.setAttributeNS(null,"x","0"),ct.setAttributeNS(null,"y","0"),ct.setAttributeNS(null,"width","1px"),ct.setAttributeNS(null,"height","1px"),ct.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ct)}paintImageXObject(ct){const pt=ct.startsWith("g_")?this.commonObjs.get(ct):this.objs.get(ct);if(!pt){(0,a.warn)(`Dependent image with object ID ${ct} is not ready yet`);return}this.paintInlineImageXObject(pt)}paintInlineImageXObject(ct,pt){const ht=ct.width,Et=ct.height,Ct=ot(ct,this.forceDataSchema,!!pt),Bt=this.svgFactory.createElement("svg:rect");Bt.setAttributeNS(null,"x","0"),Bt.setAttributeNS(null,"y","0"),Bt.setAttributeNS(null,"width",nt(ht)),Bt.setAttributeNS(null,"height",nt(Et)),this.current.element=Bt,this.clip("nonzero");const Lt=this.svgFactory.createElement("svg:image");Lt.setAttributeNS(st,"xlink:href",Ct),Lt.setAttributeNS(null,"x","0"),Lt.setAttributeNS(null,"y",nt(-Et)),Lt.setAttributeNS(null,"width",nt(ht)+"px"),Lt.setAttributeNS(null,"height",nt(Et)+"px"),Lt.setAttributeNS(null,"transform",`scale(${nt(1/ht)} ${nt(-1/Et)})`),pt?pt.append(Lt):this._ensureTransformGroup().append(Lt)}paintImageMaskXObject(ct){const pt=this.current,ht=ct.width,Et=ct.height,Ct=pt.fillColor;pt.maskId=`mask${vt++}`;const Bt=this.svgFactory.createElement("svg:mask");Bt.setAttributeNS(null,"id",pt.maskId);const Lt=this.svgFactory.createElement("svg:rect");Lt.setAttributeNS(null,"x","0"),Lt.setAttributeNS(null,"y","0"),Lt.setAttributeNS(null,"width",nt(ht)),Lt.setAttributeNS(null,"height",nt(Et)),Lt.setAttributeNS(null,"fill",Ct),Lt.setAttributeNS(null,"mask",`url(#${pt.maskId})`),this.defs.append(Bt),this._ensureTransformGroup().append(Lt),this.paintInlineImageXObject(ct,Bt)}paintFormXObjectBegin(ct,pt){if(Array.isArray(ct)&&ct.length===6&&this.transform(ct[0],ct[1],ct[2],ct[3],ct[4],ct[5]),pt){const ht=pt[2]-pt[0],Et=pt[3]-pt[1],Ct=this.svgFactory.createElement("svg:rect");Ct.setAttributeNS(null,"x",pt[0]),Ct.setAttributeNS(null,"y",pt[1]),Ct.setAttributeNS(null,"width",nt(ht)),Ct.setAttributeNS(null,"height",nt(Et)),this.current.element=Ct,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ct){const pt=this.svgFactory.create(ct.width,ct.height),ht=this.svgFactory.createElement("svg:defs");pt.append(ht),this.defs=ht;const Et=this.svgFactory.createElement("svg:g");return Et.setAttributeNS(null,"transform",at(ct.transform)),pt.append(Et),this.svg=Et,pt}_ensureClipGroup(){if(!this.current.clipGroup){const ct=this.svgFactory.createElement("svg:g");ct.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ct),this.current.clipGroup=ct}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",at(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFNodeStream=void 0;var o=s(1),a=s(33);const c=require$$5,d=require$$5,g=require$$5,_=require$$5,b=/^file:\/\/\/[a-zA-Z]:\//;function _e(nt){const at=_.parse(nt);return at.protocol==="file:"||at.host?at:/^[a-z]:[/\\]/i.test(nt)?_.parse(`file:///${nt}`):(at.host||(at.protocol="file:"),at)}class rt{constructor(at){this.source=at,this.url=_e(at.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&at.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var at;return((at=this._fullRequestReader)==null?void 0:at._loaded)??0}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new et(this):new $(this),this._fullRequestReader}getRangeReader(at,yt){if(yt<=this._progressiveDataLength)return null;const vt=this.isFsUrl?new it(this,at,yt):new ot(this,at,yt);return this._rangeRequestReaders.push(vt),vt}cancelAllRequests(at){this._fullRequestReader&&this._fullRequestReader.cancel(at);for(const yt of this._rangeRequestReaders.slice(0))yt.cancel(at)}}i.PDFNodeStream=rt;class st{constructor(at){this._url=at.url,this._done=!1,this._storedError=null,this.onProgress=null;const yt=at.source;this._contentLength=yt.length,this._loaded=0,this._filename=null,this._disableRange=yt.disableRange||!1,this._rangeChunkSize=yt.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!yt.disableStream,this._isRangeSupported=!yt.disableRange,this._readableStream=null,this._readCapability=(0,o.createPromiseCapability)(),this._headersCapability=(0,o.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const at=this._readableStream.read();return at===null?(this._readCapability=(0,o.createPromiseCapability)(),this.read()):(this._loaded+=at.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(at).buffer,done:!1})}cancel(at){if(!this._readableStream){this._error(at);return}this._readableStream.destroy(at)}_error(at){this._storedError=at,this._readCapability.resolve()}_setReadableStream(at){this._readableStream=at,at.on("readable",()=>{this._readCapability.resolve()}),at.on("end",()=>{at.destroy(),this._done=!0,this._readCapability.resolve()}),at.on("error",yt=>{this._error(yt)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new o.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class lt{constructor(at){this._url=at.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,o.createPromiseCapability)();const yt=at.source;this._isStreamingSupported=!yt.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const at=this._readableStream.read();return at===null?(this._readCapability=(0,o.createPromiseCapability)(),this.read()):(this._loaded+=at.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(at).buffer,done:!1})}cancel(at){if(!this._readableStream){this._error(at);return}this._readableStream.destroy(at)}_error(at){this._storedError=at,this._readCapability.resolve()}_setReadableStream(at){this._readableStream=at,at.on("readable",()=>{this._readCapability.resolve()}),at.on("end",()=>{at.destroy(),this._done=!0,this._readCapability.resolve()}),at.on("error",yt=>{this._error(yt)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function tt(nt,at){return{protocol:nt.protocol,auth:nt.auth,host:nt.hostname,port:nt.port,path:nt.path,method:"GET",headers:at}}class $ extends st{constructor(at){super(at);const yt=vt=>{if(vt.statusCode===404){const ht=new o.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=ht,this._headersCapability.reject(ht);return}this._headersCapability.resolve(),this._setReadableStream(vt);const xt=ht=>this._readableStream.headers[ht.toLowerCase()],{allowRangeRequests:ct,suggestedLength:pt}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:xt,isHttp:at.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=ct,this._contentLength=pt||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(xt)};this._request=null,this._url.protocol==="http:"?this._request=d.request(tt(this._url,at.httpHeaders),yt):this._request=g.request(tt(this._url,at.httpHeaders),yt),this._request.on("error",vt=>{this._storedError=vt,this._headersCapability.reject(vt)}),this._request.end()}}class ot extends lt{constructor(at,yt,vt){super(at),this._httpHeaders={};for(const ct in at.httpHeaders){const pt=at.httpHeaders[ct];typeof pt>"u"||(this._httpHeaders[ct]=pt)}this._httpHeaders.Range=`bytes=${yt}-${vt-1}`;const xt=ct=>{if(ct.statusCode===404){const pt=new o.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=pt;return}this._setReadableStream(ct)};this._request=null,this._url.protocol==="http:"?this._request=d.request(tt(this._url,this._httpHeaders),xt):this._request=g.request(tt(this._url,this._httpHeaders),xt),this._request.on("error",ct=>{this._storedError=ct}),this._request.end()}}class et extends st{constructor(at){super(at);let yt=decodeURIComponent(this._url.path);b.test(this._url.href)&&(yt=yt.replace(/^\//,"")),c.lstat(yt,(vt,xt)=>{if(vt){vt.code==="ENOENT"&&(vt=new o.MissingPDFException(`Missing PDF "${yt}".`)),this._storedError=vt,this._headersCapability.reject(vt);return}this._contentLength=xt.size,this._setReadableStream(c.createReadStream(yt)),this._headersCapability.resolve()})}}class it extends lt{constructor(at,yt,vt){super(at);let xt=decodeURIComponent(this._url.path);b.test(this._url.href)&&(xt=xt.replace(/^\//,"")),this._setReadableStream(c.createReadStream(xt,{start:yt,end:vt-1}))}}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createResponseStatusError=_,i.extractFilenameFromHeader=g,i.validateRangeRequestCapabilities=d,i.validateResponseStatus=b;var o=s(1),a=s(34),c=s(8);function d({getResponseHeader:_e,isHttp:rt,rangeChunkSize:st,disableRange:lt}){const tt={allowRangeRequests:!1,suggestedLength:void 0},$=parseInt(_e("Content-Length"),10);return!Number.isInteger($)||(tt.suggestedLength=$,$<=2*st)||lt||!rt||_e("Accept-Ranges")!=="bytes"||(_e("Content-Encoding")||"identity")!=="identity"||(tt.allowRangeRequests=!0),tt}function g(_e){const rt=_e("Content-Disposition");if(rt){let st=(0,a.getFilenameFromContentDispositionHeader)(rt);if(st.includes("%"))try{st=decodeURIComponent(st)}catch{}if((0,c.isPdfFile)(st))return st}return null}function _(_e,rt){return _e===404||_e===0&&rt.startsWith("file:")?new o.MissingPDFException('Missing PDF "'+rt+'".'):new o.UnexpectedResponseException(`Unexpected server response (${_e}) while retrieving PDF "${rt}".`,_e)}function b(_e){return _e===200||_e===206}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getFilenameFromContentDispositionHeader=a;var o=s(1);function a(c){let d=!0,g=_("filename\\*","i").exec(c);if(g){g=g[1];let $=st(g);return $=unescape($),$=lt($),$=tt($),_e($)}if(g=rt(c),g){const $=tt(g);return _e($)}if(g=_("filename","i").exec(c),g){g=g[1];let $=st(g);return $=tt($),_e($)}function _($,ot){return new RegExp("(?:^|;)\\s*"+$+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',ot)}function b($,ot){if($){if(!/^[\x00-\xFF]+$/.test(ot))return ot;try{const et=new TextDecoder($,{fatal:!0}),it=(0,o.stringToBytes)(ot);ot=et.decode(it),d=!1}catch{}}return ot}function _e($){return d&&/[\x80-\xff]/.test($)&&($=b("utf-8",$),d&&($=b("iso-8859-1",$))),$}function rt($){const ot=[];let et;const it=_("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(et=it.exec($))!==null;){let[,at,yt,vt]=et;if(at=parseInt(at,10),at in ot){if(at===0)break;continue}ot[at]=[yt,vt]}const nt=[];for(let at=0;at{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFNetworkStream=void 0;var o=s(1),a=s(33);const c=200,d=206;function g(st){const lt=st.response;return typeof lt!="string"?lt:(0,o.stringToBytes)(lt).buffer}class _{constructor(lt,tt={}){this.url=lt,this.isHttp=/^https?:/i.test(lt),this.httpHeaders=this.isHttp&&tt.httpHeaders||Object.create(null),this.withCredentials=tt.withCredentials||!1,this.getXhr=tt.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(lt,tt,$){const ot={begin:lt,end:tt};for(const et in $)ot[et]=$[et];return this.request(ot)}requestFull(lt){return this.request(lt)}request(lt){const tt=this.getXhr(),$=this.currXhrId++,ot=this.pendingRequests[$]={xhr:tt};tt.open("GET",this.url),tt.withCredentials=this.withCredentials;for(const et in this.httpHeaders){const it=this.httpHeaders[et];typeof it>"u"||tt.setRequestHeader(et,it)}return this.isHttp&&"begin"in lt&&"end"in lt?(tt.setRequestHeader("Range",`bytes=${lt.begin}-${lt.end-1}`),ot.expectedStatus=d):ot.expectedStatus=c,tt.responseType="arraybuffer",lt.onError&&(tt.onerror=function(et){lt.onError(tt.status)}),tt.onreadystatechange=this.onStateChange.bind(this,$),tt.onprogress=this.onProgress.bind(this,$),ot.onHeadersReceived=lt.onHeadersReceived,ot.onDone=lt.onDone,ot.onError=lt.onError,ot.onProgress=lt.onProgress,tt.send(null),$}onProgress(lt,tt){var ot;const $=this.pendingRequests[lt];$&&((ot=$.onProgress)==null||ot.call($,tt))}onStateChange(lt,tt){var at,yt,vt;const $=this.pendingRequests[lt];if(!$)return;const ot=$.xhr;if(ot.readyState>=2&&$.onHeadersReceived&&($.onHeadersReceived(),delete $.onHeadersReceived),ot.readyState!==4||!(lt in this.pendingRequests))return;if(delete this.pendingRequests[lt],ot.status===0&&this.isHttp){(at=$.onError)==null||at.call($,ot.status);return}const et=ot.status||c;if(!(et===c&&$.expectedStatus===d)&&et!==$.expectedStatus){(yt=$.onError)==null||yt.call($,ot.status);return}const nt=g(ot);if(et===d){const xt=ot.getResponseHeader("Content-Range"),ct=/bytes (\d+)-(\d+)\/(\d+)/.exec(xt);$.onDone({begin:parseInt(ct[1],10),chunk:nt})}else nt?$.onDone({begin:0,chunk:nt}):(vt=$.onError)==null||vt.call($,ot.status)}getRequestXhr(lt){return this.pendingRequests[lt].xhr}isPendingRequest(lt){return lt in this.pendingRequests}abortRequest(lt){const tt=this.pendingRequests[lt].xhr;delete this.pendingRequests[lt],tt.abort()}}class b{constructor(lt){this._source=lt,this._manager=new _(lt.url,{httpHeaders:lt.httpHeaders,withCredentials:lt.withCredentials}),this._rangeChunkSize=lt.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(lt){const tt=this._rangeRequestReaders.indexOf(lt);tt>=0&&this._rangeRequestReaders.splice(tt,1)}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new _e(this._manager,this._source),this._fullRequestReader}getRangeReader(lt,tt){const $=new rt(this._manager,lt,tt);return $.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push($),$}cancelAllRequests(lt){var tt;(tt=this._fullRequestReader)==null||tt.cancel(lt);for(const $ of this._rangeRequestReaders.slice(0))$.cancel(lt)}}i.PDFNetworkStream=b;class _e{constructor(lt,tt){this._manager=lt;const $={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=tt.url,this._fullRequestId=lt.requestFull($),this._headersReceivedCapability=(0,o.createPromiseCapability)(),this._disableRange=tt.disableRange||!1,this._contentLength=tt.length,this._rangeChunkSize=tt.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const lt=this._fullRequestId,tt=this._manager.getRequestXhr(lt),$=it=>tt.getResponseHeader(it),{allowRangeRequests:ot,suggestedLength:et}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:$,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});ot&&(this._isRangeSupported=!0),this._contentLength=et||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)($),this._isRangeSupported&&this._manager.abortRequest(lt),this._headersReceivedCapability.resolve()}_onDone(lt){if(lt&&(this._requests.length>0?this._requests.shift().resolve({value:lt.chunk,done:!1}):this._cachedChunks.push(lt.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const tt of this._requests)tt.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(lt){this._storedError=(0,a.createResponseStatusError)(lt,this._url),this._headersReceivedCapability.reject(this._storedError);for(const tt of this._requests)tt.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(lt){var tt;(tt=this.onProgress)==null||tt.call(this,{loaded:lt.loaded,total:lt.lengthComputable?lt.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const lt=(0,o.createPromiseCapability)();return this._requests.push(lt),lt.promise}cancel(lt){this._done=!0,this._headersReceivedCapability.reject(lt);for(const tt of this._requests)tt.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class rt{constructor(lt,tt,$){this._manager=lt;const ot={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=lt.url,this._requestId=lt.requestRange(tt,$,ot),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var lt;(lt=this.onClosed)==null||lt.call(this,this)}_onDone(lt){const tt=lt.chunk;this._requests.length>0?this._requests.shift().resolve({value:tt,done:!1}):this._queuedChunk=tt,this._done=!0;for(const $ of this._requests)$.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(lt){this._storedError=(0,a.createResponseStatusError)(lt,this._url);for(const tt of this._requests)tt.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(lt){var tt;this.isStreamingSupported||(tt=this.onProgress)==null||tt.call(this,{loaded:lt.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const tt=this._queuedChunk;return this._queuedChunk=null,{value:tt,done:!1}}if(this._done)return{value:void 0,done:!0};const lt=(0,o.createPromiseCapability)();return this._requests.push(lt),lt.promise}cancel(lt){this._done=!0;for(const tt of this._requests)tt.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,i,s)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFFetchStream=void 0;var o=s(1),a=s(33);function c(_e,rt,st){return{method:"GET",headers:_e,signal:st.signal,mode:"cors",credentials:rt?"include":"same-origin",redirect:"follow"}}function d(_e){const rt=new Headers;for(const st in _e){const lt=_e[st];typeof lt>"u"||rt.append(st,lt)}return rt}class g{constructor(rt){this.source=rt,this.isHttp=/^https?:/i.test(rt.url),this.httpHeaders=this.isHttp&&rt.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var rt;return((rt=this._fullRequestReader)==null?void 0:rt._loaded)??0}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new _(this),this._fullRequestReader}getRangeReader(rt,st){if(st<=this._progressiveDataLength)return null;const lt=new b(this,rt,st);return this._rangeRequestReaders.push(lt),lt}cancelAllRequests(rt){this._fullRequestReader&&this._fullRequestReader.cancel(rt);for(const st of this._rangeRequestReaders.slice(0))st.cancel(rt)}}i.PDFFetchStream=g;class _{constructor(rt){this._stream=rt,this._reader=null,this._loaded=0,this._filename=null;const st=rt.source;this._withCredentials=st.withCredentials||!1,this._contentLength=st.length,this._headersCapability=(0,o.createPromiseCapability)(),this._disableRange=st.disableRange||!1,this._rangeChunkSize=st.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!st.disableStream,this._isRangeSupported=!st.disableRange,this._headers=d(this._stream.httpHeaders);const lt=st.url;fetch(lt,c(this._headers,this._withCredentials,this._abortController)).then(tt=>{if(!(0,a.validateResponseStatus)(tt.status))throw(0,a.createResponseStatusError)(tt.status,lt);this._reader=tt.body.getReader(),this._headersCapability.resolve();const $=it=>tt.headers.get(it),{allowRangeRequests:ot,suggestedLength:et}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:$,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=ot,this._contentLength=et||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)($),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new o.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:rt,done:st}=await this._reader.read();return st?{value:rt,done:st}:(this._loaded+=rt.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(rt).buffer,done:!1})}cancel(rt){this._reader&&this._reader.cancel(rt),this._abortController.abort()}}class b{constructor(rt,st,lt){this._stream=rt,this._reader=null,this._loaded=0;const tt=rt.source;this._withCredentials=tt.withCredentials||!1,this._readCapability=(0,o.createPromiseCapability)(),this._isStreamingSupported=!tt.disableStream,this._abortController=new AbortController,this._headers=d(this._stream.httpHeaders),this._headers.append("Range",`bytes=${st}-${lt-1}`);const $=tt.url;fetch($,c(this._headers,this._withCredentials,this._abortController)).then(ot=>{if(!(0,a.validateResponseStatus)(ot.status))throw(0,a.createResponseStatusError)(ot.status,$);this._readCapability.resolve(),this._reader=ot.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:rt,done:st}=await this._reader.read();return st?{value:rt,done:st}:(this._loaded+=rt.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(rt).buffer,done:!1})}cancel(rt){this._reader&&this._reader.cancel(rt),this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var i=__webpack_module_cache__[e];if(i!==void 0)return i.exports;var s=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](s,s.exports,__w_pdfjs_require__),s.exports}var __webpack_exports__={};return(()=>{var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return i.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return i.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return c.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return d.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return i.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return i.CMapCompressionType}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return g.GlobalWorkerOptions}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return i.InvalidPDFException}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return s.LoopbackPort}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return i.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return i.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return o.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return i.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return i.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return o.PixelsPerInch}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return o.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return _e.SVGGraphics}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return i.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return i.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return i.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return i.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return rt.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return i.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return i.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return o.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return o.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return o.getXfaPageViewport}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return o.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return o.loadScript}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return b.renderTextLayer}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return i.shadow}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return s.version}});var i=__w_pdfjs_require__(1),s=__w_pdfjs_require__(4),o=__w_pdfjs_require__(8),a=__w_pdfjs_require__(22),c=__w_pdfjs_require__(7),d=__w_pdfjs_require__(27),g=__w_pdfjs_require__(15),_=__w_pdfjs_require__(3),b=__w_pdfjs_require__(30),_e=__w_pdfjs_require__(31),rt=__w_pdfjs_require__(29);if(_.isNodeJS){const{PDFNodeStream:st}=__w_pdfjs_require__(32);(0,s.setPDFNetworkStreamFactory)(lt=>new st(lt))}else{const{PDFNetworkStream:st}=__w_pdfjs_require__(35),{PDFFetchStream:lt}=__w_pdfjs_require__(36);(0,s.setPDFNetworkStreamFactory)(tt=>(0,o.isValidFetchUrl)(tt.url)?new lt(tt):new st(tt))}})(),__webpack_exports__})())})(pdf);var pdfExports=pdf.exports;function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var i=1;i=0)&&(s[a]=e[a]);return s}function _objectWithoutProperties(e,i){if(e==null)return{};var s=_objectWithoutPropertiesLoose(e,i),o,a;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function _typeof(e){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},_typeof(e)}function _classCallCheck(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function _toPrimitive(e,i){if(_typeof(e)!=="object"||e===null)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,i||"default");if(_typeof(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(e)}function _toPropertyKey(e){var i=_toPrimitive(e,"string");return _typeof(i)==="symbol"?i:String(i)}function _defineProperties(e,i){for(var s=0;s=1&&g<=o.pagesCount,'"'.concat(g,'" is not a valid page number.')),o.pdfViewer.scrollPageIntoView({dest:s,pageIndex:d,pageNumber:g})})})}},{key:"navigateTo",value:function(s){this.goToDestination(s)}},{key:"goToPage",value:function(){}},{key:"addLinkAttributes",value:function(s,o,a){s.href=o,s.rel=this.externalLinkRel||DEFAULT_LINK_REL,s.target=a?"_blank":this.externalLinkTarget||""}},{key:"getDestinationHash",value:function(){return"#"}},{key:"getAnchorUrl",value:function(){return"#"}},{key:"setHash",value:function(){}},{key:"executeNamedAction",value:function(){}},{key:"cachePageRef",value:function(){}},{key:"isPageVisible",value:function(){return!0}},{key:"isPageCached",value:function(){return!0}}]),e}(),PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,i){var s=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(s!=null){var o,a,c,d,g=[],_=!0,b=!1;try{if(c=(s=s.call(e)).next,i===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(o=c.call(s)).done)&&(g.push(o.value),g.length!==i);_=!0);}catch(_e){b=!0,a=_e}finally{try{if(!_&&s.return!=null&&(d=s.return(),Object(d)!==d))return}finally{if(b)throw a}}return g}}function _arrayLikeToArray(e,i){(i==null||i>e.length)&&(i=e.length);for(var s=0,o=new Array(i);sg)return new Error("Expected `".concat(s,"` to be less or equal to ").concat(g-1,"."))}else if(!isDefined(c))return new Error("`".concat(s,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(o,"`."));return null},isPageNumber=function e(i,s,o){var a=i[s],c=i.pageIndex,d=i.pdf;if(!isDefined(d))return null;if(isDefined(a)){if(typeof a!="number")return new Error("`".concat(s,"` of type `").concat(_typeof(a),"` supplied to `").concat(o,"`, expected `number`."));if(a<1)return new Error("Expected `".concat(s,"` to be greater or equal to 1."));var g=d.numPages;if(a>g)return new Error("Expected `".concat(s,"` to be less or equal to ").concat(g,"."))}else if(!isDefined(c))return new Error("`".concat(s,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(o,"`."));return null},isPdf=PropTypes.oneOfType([PropTypes.shape({getDestination:PropTypes.func.isRequired,getOutline:PropTypes.func.isRequired,getPage:PropTypes.func.isRequired,numPages:PropTypes.number.isRequired}),PropTypes.bool]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.shape({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]),_excluded=["url"];function ownKeys$3(e,i){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);i&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),s.push.apply(s,o)}return s}function _objectSpread$3(e){for(var i=1;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var PDFDataRangeTransport=pdfExports.PDFDataRangeTransport,Document=function(e){_inherits(s,e);var i=_createSuper$5(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to and handle navigating by yourself or ensure that all pages are rendered within ."))}}),_defineProperty(_assertThisInitialized(o),"linkService",new LinkService),_defineProperty(_assertThisInitialized(o),"loadDocument",function(){cancelRunningTask(o.runningTask),o.loadingTask&&o.loadingTask.destroy();var g=makeCancellablePromise(o.findDocumentSource());o.runningTask=g,g.promise.then(function(_){if(o.onSourceSuccess(),!!_){o.setState(function(tt){return tt.pdf?{pdf:null}:null});var b=o.props,_e=b.options,rt=b.onLoadProgress,st=b.onPassword,lt=pdfExports.getDocument(_objectSpread$3(_objectSpread$3({},_),_e));lt.onPassword=st,rt&&(lt.onProgress=rt),o.loadingTask=lt,lt.promise.then(function(tt){o.setState(function($){return $.pdf&&$.pdf.fingerprint===tt.fingerprint?null:{pdf:tt}},o.onLoadSuccess)}).catch(function(tt){o.onLoadError(tt)})}}).catch(function(_){o.onSourceError(_)})}),_defineProperty(_assertThisInitialized(o),"setupLinkService",function(){var g=o.props,_=g.externalLinkRel,b=g.externalLinkTarget;o.linkService.setViewer(o.viewer),o.linkService.setExternalLinkRel(_),o.linkService.setExternalLinkTarget(b)}),_defineProperty(_assertThisInitialized(o),"onSourceSuccess",function(){var g=o.props.onSourceSuccess;g&&g()}),_defineProperty(_assertThisInitialized(o),"onSourceError",function(g){warning(g);var _=o.props.onSourceError;_&&_(g)}),_defineProperty(_assertThisInitialized(o),"onLoadSuccess",function(){var g=o.props.onLoadSuccess,_=o.state.pdf;g&&g(_),o.pages=new Array(_.numPages),o.linkService.setDocument(_)}),_defineProperty(_assertThisInitialized(o),"onLoadError",function(g){o.setState({pdf:!1}),warning(g);var _=o.props.onLoadError;_&&_(g)}),_defineProperty(_assertThisInitialized(o),"findDocumentSource",function(){return new Promise(function(g){var _=o.props.file;if(_||g(null),typeof _=="string"){if(isDataURI(_)){var b=dataURItoByteString(_);g({data:b})}displayCORSWarning(),g({url:_})}if(_ instanceof PDFDataRangeTransport&&g({range:_}),isArrayBuffer(_)&&g({data:_}),isBrowser&&(isBlob(_)||isFile$1(_))){loadFromFile(_).then(function(lt){g({data:lt})});return}if(invariant(_typeof(_)==="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant(_.url||_.data||_.range,"Invalid parameter object: need either .data, .range or .url"),typeof _.url=="string"){if(isDataURI(_.url)){var _e=_.url,rt=_objectWithoutProperties(_,_excluded),st=dataURItoByteString(_e);g(_objectSpread$3({data:st},rt))}displayCORSWarning()}g(_)})}),_defineProperty(_assertThisInitialized(o),"registerPage",function(g,_){o.pages[g]=_}),_defineProperty(_assertThisInitialized(o),"unregisterPage",function(g){delete o.pages[g]}),o}return _createClass(s,[{key:"componentDidMount",value:function(){this.loadDocument(),this.setupLinkService()}},{key:"componentDidUpdate",value:function(a){var c=this.props.file;c!==a.file&&this.loadDocument()}},{key:"componentWillUnmount",value:function(){cancelRunningTask(this.runningTask),this.loadingTask&&this.loadingTask.destroy()}},{key:"childContext",get:function(){var a=this.linkService,c=this.registerPage,d=this.unregisterPage,g=this.props,_=g.imageResourcesPath,b=g.renderMode,_e=g.rotate,rt=this.state.pdf;return{imageResourcesPath:_,linkService:a,pdf:rt,registerPage:c,renderMode:b,rotate:_e,unregisterPage:d}}},{key:"eventProps",get:function(){var a=this;return makeEventProps(this.props,function(){return a.state.pdf})}},{key:"renderChildren",value:function(){var a=this.props.children;return React.createElement(DocumentContext.Provider,{value:this.childContext},a)}},{key:"renderContent",value:function(){var a=this.props.file,c=this.state.pdf;if(!a){var d=this.props.noData;return React.createElement(Message,{type:"no-data"},typeof d=="function"?d():d)}if(c===null){var g=this.props.loading;return React.createElement(Message,{type:"loading"},typeof g=="function"?g():g)}if(c===!1){var _=this.props.error;return React.createElement(Message,{type:"error"},typeof _=="function"?_():_)}return this.renderChildren()}},{key:"render",value:function(){var a=this.props,c=a.className,d=a.inputRef;return React.createElement("div",_extends({className:clsx("react-pdf__Document",c),ref:d},this.eventProps),this.renderContent())}}]),s}(reactExports.PureComponent);Document.defaultProps={error:"Failed to load PDF file.",loading:"Loading PDF…",noData:"No PDF file specified.",onPassword:function e(i,s){switch(s){case PasswordResponses.NEED_PASSWORD:{var o=prompt("Enter the password to open this PDF file.");i(o);break}case PasswordResponses.INCORRECT_PASSWORD:{var a=prompt("Invalid password. Please try again.");i(a);break}}}};var isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=_objectSpread$3(_objectSpread$3({},eventProps),{},{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.string,file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,rotate:PropTypes.number});var isDestination=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.any)]);PropTypes.shape({dest:isDestination,items:PropTypes.arrayOf(PropTypes.shape({dest:isDestination,title:PropTypes.string})),title:PropTypes.string}).isRequired,PropTypes.func,isPdf.isRequired;function ownKeys$2(e,i){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);i&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),s.push.apply(s,o)}return s}function _objectSpread$2(e){for(var i=1;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ANNOTATION_MODE=pdfExports.AnnotationMode,PageCanvasInternal=function(e){_inherits(s,e);var i=_createSuper$4(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var PageSVGInternal=function(e){_inherits(s,e);var i=_createSuper$3(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var TextLayerInternal=function(e){_inherits(s,e);var i=_createSuper$2(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var AnnotationLayerInternal=function(e){_inherits(s,e);var i=_createSuper$1(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var defaultScale=1,PageInternal=function(e){_inherits(s,e);var i=_createSuper(s);function s(){var o;_classCallCheck(this,s);for(var a=arguments.length,c=new Array(a),d=0;d0&&arguments[0]!==void 0?arguments[0]:this.props;return isProvided(a.pageNumber)?a.pageNumber-1:isProvided(a.pageIndex)?a.pageIndex:null}},{key:"getPageNumber",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return isProvided(a.pageNumber)?a.pageNumber:isProvided(a.pageIndex)?a.pageIndex+1:null}},{key:"pageIndex",get:function(){return this.getPageIndex()}},{key:"pageNumber",get:function(){return this.getPageNumber()}},{key:"rotate",get:function(){var a=this.props.rotate;if(isProvided(a))return a;var c=this.state.page;return c?c.rotate:null}},{key:"scale",get:function(){var a=this.state.page;if(!a)return null;var c=this.props,d=c.scale,g=c.width,_=c.height,b=this.rotate,_e=1,rt=d===null?defaultScale:d;if(g||_){var st=a.getViewport({scale:1,rotation:b});_e=g?g/st.width:_/st.height}return rt*_e}},{key:"eventProps",get:function(){var a=this;return makeEventProps(this.props,function(){var c=a.state.page;return c&&makePageCallback(c,a.scale)})}},{key:"pageKey",get:function(){return"".concat(this.pageIndex,"@").concat(this.scale,"/").concat(this.rotate)}},{key:"pageKeyNoScale",get:function(){return"".concat(this.pageIndex,"/").concat(this.rotate)}},{key:"renderMainLayer",value:function(){var a=this.props,c=a.canvasRef,d=a.renderMode;switch(d){case"none":return null;case"svg":return React.createElement(PageSVG,{key:"".concat(this.pageKeyNoScale,"_svg")});case"canvas":default:return React.createElement(PageCanvas,{key:"".concat(this.pageKey,"_canvas"),canvasRef:c})}}},{key:"renderTextLayer",value:function(){var a=this.props.renderTextLayer;return a?React.createElement(TextLayer$1,{key:"".concat(this.pageKey,"_text")}):null}},{key:"renderAnnotationLayer",value:function(){var a=this.props.renderAnnotationLayer;return a?React.createElement(AnnotationLayer$1,{key:"".concat(this.pageKey,"_annotations")}):null}},{key:"renderChildren",value:function(){var a=this.props.children;return React.createElement(PageContext.Provider,{value:this.childContext},this.renderMainLayer(),this.renderTextLayer(),this.renderAnnotationLayer(),a)}},{key:"renderContent",value:function(){var a=this.pageNumber,c=this.props.pdf,d=this.state.page;if(!a){var g=this.props.noData;return React.createElement(Message,{type:"no-data"},typeof g=="function"?g():g)}if(c===null||d===null){var _=this.props.loading;return React.createElement(Message,{type:"loading"},typeof _=="function"?_():_)}if(c===!1||d===!1){var b=this.props.error;return React.createElement(Message,{type:"error"},typeof b=="function"?b():b)}return this.renderChildren()}},{key:"render",value:function(){var a=this.pageNumber,c=this.props,d=c.className,g=c.inputRef;return React.createElement("div",_extends({className:clsx("react-pdf__Page",d),"data-page-number":a,ref:mergeRefs(g,this.pageElement),style:{position:"relative",minWidth:"min-content",minHeight:"min-content"}},this.eventProps),this.renderContent())}}]),s}(reactExports.PureComponent);PageInternal.defaultProps={error:"Failed to load the page.",loading:"Loading page…",noData:"No page specified.",renderAnnotationLayer:!0,renderMode:"canvas",renderTextLayer:!0,scale:defaultScale};var isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);PageInternal.propTypes=_objectSpread(_objectSpread({},eventProps),{},{canvasBackground:PropTypes.string,children:PropTypes.node,className:isClassName,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,registerPage:PropTypes.func,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderInteractiveForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,unregisterPage:PropTypes.func,width:PropTypes.number});function Page(e,i){return React.createElement(DocumentContext.Consumer,null,function(s){return React.createElement(PageInternal,_extends({ref:i},s,e))})}const Page$1=React.forwardRef(Page);displayWorkerWarning();pdfExports.GlobalWorkerOptions.workerSrc="pdf.worker.js";const AnnotationLayer="",TextLayer="";function FilePreview({currentFile:e,showPreview:i}){const[s,o]=reactExports.useState(null),[a,c]=reactExports.useState(1),[d,g]=reactExports.useState(!0);pdfExports.GlobalWorkerOptions.workerSrc=new URL("/assets/pdf.worker.min-99732130.js",self.location).toString();const _={cMapUrl:"cmaps/",standardFontDataUrl:"standard_fonts/"};function b({numPages:_e}){g(!1),o(_e),c(1)}return jsx("div",{className:i?"filePreview":"filePreview closed",children:e&&jsxs(Fragment,{children:[jsxs(Document,{file:e,onLoadSuccess:b,onLoadError:console.error,options:_,children:[jsx(Page$1,{pageNumber:a}),jsx("button",{onClick:()=>c(_e=>_e-1),children:"<"}),jsx("button",{onClick:()=>c(_e=>_e+1),children:">"})]}),jsxs("p",{children:["Page ",a," of ",s]})]})})}function ChatApp(){const[e,i]=reactExports.useState(null),[s,o]=reactExports.useState([]),[a,c]=reactExports.useState(!0);return jsxs(Fragment,{children:[jsx("div",{className:"container",children:jsx(ChatBot,{currentFile:e,setUploadedFiles:o,setCurrentFile:i,setPreview:c})}),jsx(FilePreview,{currentFile:e,showPreview:a})]})}const App$1="",profile="";function Profile(){const[e,i]=reactExports.useState({}),s="https://saimon-backend-gukinumu4q-ey.a.run.app/",o=async a=>{let c={method:"get",maxBodyLength:1/0,url:`${s}users/`,headers:{Authorization:`Bearer ${a}`}};axios$1.request(c).then(d=>{console.log(JSON.stringify(d.data)),i(d.data.result)}).catch(d=>{console.log(d)})};return reactExports.useEffect(()=>{const a=localStorage.getItem("access_token");o(a)},[]),jsxs("div",{className:"container",children:[jsx("header",{className:"my-header",children:jsx("nav",{className:"my-navbar navbar navbar-expand-lg navbar-light bg-white",children:jsx(Link,{to:"/",children:jsx("img",{src:logo,alt:"Logo button leads to home page"})})})}),jsxs("main",{children:[jsxs("div",{className:"profile-container",children:[jsx("div",{className:"profile-header",children:jsx("h1",{children:"Profile"})}),jsxs("div",{className:"profile-body",children:[jsxs("div",{className:"profile-name",children:[jsx("h3",{children:"Name: "}),jsx("p",{children:e.name})]}),jsxs("div",{className:"profile-email",children:[jsx("h3",{children:"Email: "}),jsx("p",{children:e.email})]}),jsxs("div",{className:"profile-tier",children:[jsx("h3",{children:"Tier: "}),jsx("p",{children:e.tier})]})]})]}),jsxs("section",{className:"tier-selection",children:[jsx("h1",{children:"Select Tier"}),jsxs("div",{className:"tier-selection-container",children:[jsx("div",{className:"tier-selection-basic",children:jsxs("a",{target:"_blank",href:"https://buy.stripe.com/test_7sIeYx6dpaOv9Gw147",children:[jsx("h3",{children:"Basic"}),jsx("p",{children:"Basic tier is for those who want to use the service for free. This tier is free of cost and does not require any payment."})]})}),jsx("div",{className:"tier-selection-premium",children:jsxs("a",{target:"_blank",href:"https://buy.stripe.com/test_5kA2bLbxJ8Gn9Gw6oq",children:[jsx("h3",{children:"Premium"}),jsx("p",{children:"Premium tier is for those who want to use the service for a small amount. This tier is free of cost and does not require any payment."})]})}),jsx("div",{className:"tier-selection-pro",children:jsxs("a",{target:"_blank",href:"https://buy.stripe.com/test_6oE7w5eJV3m3cSI7st",children:[jsx("h3",{children:"Pro"}),jsx("p",{children:"Pro tier is for those who want to use the service for a large amount. This tier is free of cost and does not require any payment."})]})})]})]})]})]})}function App(){return jsx(BrowserRouter,{children:jsx("div",{className:"App",children:jsxs(Routes,{children:[jsx(Route,{path:"/",element:jsx(ChatApp,{})}),jsx(Route,{path:"/register",element:jsx(Register,{})}),jsx(Route,{path:"/profile",element:jsx(Profile,{})}),jsx(Route,{path:"*",element:jsx(Navigate,{to:"/"})})]})})})}const index="";client.createRoot(document.getElementById("root")).render(jsx(React.StrictMode,{children:jsx(App,{})}));