diff --git a/media/js/bundle.js b/media/js/bundle.js index f1c4ab509..360984986 100644 --- a/media/js/bundle.js +++ b/media/js/bundle.js @@ -1,5 +1,5 @@ /*! For license information please see bundle.js.LICENSE.txt */ -(()=>{var __webpack_modules__={3969:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},4744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=r;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=r(e[t],n)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(o,n)(e[o],t[o],n):i[o]=r(t[o],n))})),i}(e,n,l):r(n,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return a(e,n,t)}),{})};var l=a;e.exports=l},8251:function(e){e.exports=function(e,t){if(null==t&&(t={fuzzy:!0}),/youtu\.?be/.test(e)){var n,r=[/youtu\.be\/([^#\&\?]{11})/,/\?v=([^#\&\?]{11})/,/\&v=([^#\&\?]{11})/,/embed\/([^#\&\?]{11})/,/\/v\/([^#\&\?]{11})/];for(n=0;n{"use strict";var r=n(3404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var s=u(n);h&&(s=s.concat(h(n)));for(var a=l(t),g=l(n),m=0;m{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case h:case o:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case g:case l:return e;default:return t}}case i:return t}}}function x(e){return w(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===h||e===a||e===s||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===v||e.$$typeof===b||e.$$typeof===_||e.$$typeof===y)},t.typeOf=w},3404:(e,t,n)=>{"use strict";e.exports=n(3072)},311:e=>{"use strict";e.exports=function(e,t,n,r,i,o,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},6147:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,i){var o=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");"function"==typeof r&&(i=r,r={}),r=r||{},i=i||function(){},s.type=r.type||"text/javascript",s.charset=r.charset||"utf8",s.async=!("async"in r)||!!r.async,s.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(s,r.attrs),r.text&&(s.text=""+r.text),("onload"in s?t:n)(s,i),s.onload||t(s,i),o.appendChild(s)}},5580:(e,t,n)=>{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),s=n(2749),a=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),s=n(8655),a=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),s=n(4509),a=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),s=n(3605),a=n(9817),l=n(945);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},9770:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(8096),i=n(2428),o=n(6449),s=n(3656),a=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&i(e),h=!n&&!u&&s(e),d=!n&&!u&&!h&&l(e),f=n||u||h||d,p=f?r(e.length,String):[],g=p.length;for(var m in e)!t&&!c.call(e,m)||f&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g))||p.push(m);return p}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e){return e.split("")}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},6574:(e,t,n)=>{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,s,e,a))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),s=n(689),a=n(5861),l=n(6449),c=n(3656),u=n(7167),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var v=l(e),b=l(t),_=v?d:a(e),w=b?d:a(t),x=(_=_==h?f:_)==f,S=(w=w==h?f:w)==f,E=_==w;if(E&&c(e)){if(!c(t))return!1;v=!0,x=!1}if(E&&!x)return y||(y=new r),v||u(e)?i(e,t,n,g,m,y):o(e,t,_,n,g,m,y);if(!(1&n)){var C=x&&p.call(e,"__wrapped__"),k=S&&p.call(t,"__wrapped__");if(C||k){var P=C?e.value():e,A=k?t.value():t;return y||(y=new r),m(P,A,n,g,y)}}return!!E&&(y||(y=new r),s(e,t,n,g,m,y))}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var s=n.length,a=s,l=!o;if(null==e)return!a;for(e=Object(e);s--;){var c=n[s];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s{var r=n(1882),i=n(7296),o=n(3805),s=n(7473),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:a).test(s(e))}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),s=n(6449),a=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),s=n(8586),a=n(756),l=n(7197),c=n(7797);e.exports=function(e,t){return s(e)&&a(t)?l(c(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},7237:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},5160:e=>{e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),s=n(4394),a=r?r.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},9219:e=>{e.exports=function(e,t){return e.has(t)}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),s=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},8754:(e,t,n)=>{var r=n(5160);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},8329:(e,t,n)=>{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}},2507:(e,t,n)=>{var r=n(8754),i=n(9698),o=n(3912),s=n(3222);e.exports=function(e){return function(t){t=s(t);var n=i(t)?o(t):void 0,a=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return a[e]()+l}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,s){var a=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(a[e],e,a)}}var c=e(t,n,s);return c>-1?a[l?t[c]:c]:void 0}}},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,s,a,l){var c=1&n,u=e.length,h=t.length;if(u!=h&&!(c&&h>u))return!1;var d=l.get(e),f=l.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p{var r=n(1873),i=n(7828),o=n(5288),s=n(5911),a=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)return!1;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=s(f(e),f(t),r,c,h,d);return d.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var h=u;h--;){var d=c[h];if(!(l?d in t:i.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=l;++h{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),s=n(6545),a=n(8303),l=n(2552),c=n(7473),u="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=c(r),m=c(i),y=c(o),v=c(s),b=c(a),_=l;(r&&_(new r(new ArrayBuffer(1)))!=p||i&&_(new i)!=u||o&&_(o.resolve())!=h||s&&_(new s)!=d||a&&_(new a)!=f)&&(_=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case g:return p;case m:return u;case y:return h;case v:return d;case b:return f}return t}),e.exports=_},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),s=n(361),a=n(294),l=n(7797);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,h=!1;++c{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},9325:(e,t,n)=>{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},3912:(e,t,n)=>{var r=n(1074),i=n(9698),o=n(2054);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=s},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},2054:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[o,s,a].join("|")+")"+c+l+")*",h="(?:"+[o+r+"?",r,s,a,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+h+u,"g");e.exports=function(e){return e.match(d)||[]}},4792:(e,t,n)=>{var r=n(3222),i=n(5808);e.exports=function(e){return i(r(e).toLowerCase())}},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),s=n(6449);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),s=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var l=null==n?0:o(n);return l<0&&(l=s(a+l,0)),r(e,i(t,3),l)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},2297:(e,t,n)=>{var r=n(9325).isFinite;e.exports=function(e){return"number"==typeof e&&r(e)}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},2543:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,h=9007199254740991,d=NaN,f=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",E="[object Object]",C="[object Promise]",k="[object RegExp]",P="[object Set]",A="[object String]",T="[object Symbol]",R="[object WeakMap]",O="[object ArrayBuffer]",M="[object DataView]",I="[object Float32Array]",D="[object Float64Array]",F="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",z="[object Uint8ClampedArray]",B="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,G=RegExp(H.source),X=RegExp(q.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+we+"]",Te="["+Pe+"]",Re="["+xe+"]",Oe="\\d+",Me="["+Se+"]",Ie="["+Ee+"]",De="[^"+we+Pe+Oe+Se+Ee+Ce+"]",Fe="\\ud83c[\\udffb-\\udfff]",Le="[^"+we+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Ce+"]",Be="\\u200d",Ue="(?:"+Ie+"|"+De+")",Ve="(?:"+ze+"|"+De+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Re+"|"+Fe+")?",qe="["+ke+"]?",Ge=qe+He+"(?:"+Be+"(?:"+[Le,Ne,je].join("|")+")"+qe+He+")*",Xe="(?:"+[Me,Ne,je].join("|")+")"+Ge,Ye="(?:"+[Le+Re+"?",Re,Ne,je,Ae].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(Re,"g"),Qe=RegExp(Fe+"(?="+Fe+")|"+Ye+Ge,"g"),Je=RegExp([ze+"?"+Ie+"+"+We+"(?="+[Te,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Te,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+We,ze+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Xe].join("|"),"g"),et=RegExp("["+Be+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[I]=it[D]=it[F]=it[L]=it[N]=it[j]=it[z]=it[B]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[M]=it[v]=it[b]=it[_]=it[x]=it[S]=it[E]=it[k]=it[P]=it[A]=it[R]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[M]=ot[y]=ot[v]=ot[I]=ot[D]=ot[F]=ot[L]=ot[N]=ot[x]=ot[S]=ot[E]=ot[k]=ot[P]=ot[A]=ot[T]=ot[j]=ot[z]=ot[B]=ot[U]=!0,ot[b]=ot[_]=ot[R]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,pt=ft&&ft.exports===dt,gt=pt&&ct.process,mt=function(){try{return ft&&ft.require&&ft.require("util").types||gt&>.binding&>.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,xt=mt&&mt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Jt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=$t({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?ht:pn.defaults(ht.Object(),t,pn.pick(ht,nt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Se=t.Math,Ee=t.Object,Ce=t.RegExp,ke=t.String,Pe=t.TypeError,Ae=r.prototype,Te=xe.prototype,Re=Ee.prototype,Oe=t["__core-js_shared__"],Me=Te.toString,Ie=Re.hasOwnProperty,De=0,Fe=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Le=Re.toString,Ne=Me.call(Ee),je=ht._,ze=Ce("^"+Me.call(Ie).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,We=Be?Be.allocUnsafe:i,$e=sn(Ee.getPrototypeOf,Ee),He=Ee.create,qe=Re.propertyIsEnumerable,Ge=Ae.splice,Xe=Ue?Ue.isConcatSpreadable:i,Ye=Ue?Ue.iterator:i,Qe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ht.Date.now&&ie.now,ut=t.setTimeout!==ht.setTimeout&&t.setTimeout,dt=Se.ceil,ft=Se.floor,gt=Ee.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Lt=t.isFinite,$t=Ae.join,gn=sn(Ee.keys,Ee),mn=Se.max,yn=Se.min,vn=ie.now,bn=t.parseInt,_n=Se.random,wn=Ae.reverse,xn=lo(t,"DataView"),Sn=lo(t,"Map"),En=lo(t,"Promise"),Cn=lo(t,"Set"),kn=lo(t,"WeakMap"),Pn=lo(Ee,"create"),An=kn&&new kn,Tn={},Rn=No(xn),On=No(Sn),Mn=No(En),In=No(Cn),Dn=No(kn),Fn=Ue?Ue.prototype:i,Ln=Fn?Fn.valueOf:i,Nn=Fn?Fn.toString:i;function jn(e){if(ea(e)&&!Ws(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(Ie.call(e,"__wrapped__"))return jo(e)}return new Un(e)}var zn=function(){function e(){}return function(t){if(!Js(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Js(e))return e;var h=Ws(e);if(h){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ie.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return ki(e,a)}else{var d=ho(e),f=d==_||d==w;if(Gs(e))return _i(e,l);if(d==E||d==g||f&&!o){if(a=c||f?{}:po(e),!l)return c?function(e,t){return Pi(e,uo(e),t)}(e,function(e,t){return e&&Pi(t,Oa(t),e)}(a,e)):function(e,t){return Pi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[d])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case M:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case D:case F:case L:case N:case j:case z:case B:case U:return xi(e,n);case x:return new i;case S:case A:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return new i;case T:return r=e,Ln?Ee(Ln.call(r)):{}}}(e,d,l)}}s||(s=new Gn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=h?i:(u?c?to:eo:c?Oa:Ra)(e);return Ct(m||e,(function(r,i){m&&(r=e[i=r]),Jn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Pe(o);return Ao((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Tt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Yt(n))),r?(o=Rt,s=!1):t.length>=200&&(o=Zt,s=!1,t=new qn(t));e:for(;++i-1},$n.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Sn||$n),string:new Wn}},Hn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return so(this,e).get(e)},Hn.prototype.has=function(e){return so(this,e).has(e)},Hn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,s),this},qn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new $n,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(e,t),this.size=n.size,this};var ur=Ri(vr),hr=Ri(br,!0);function dr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function fr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?gr(a,t-1,n,r,i):Mt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ra)}function br(e,t){return e&&yr(e,t,Ra)}function _r(e,t){return At(t,(function(t){return Ks(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&Ie.call(e,t)}function kr(e,t){return null!=e&&t in Ee(e)}function Pr(e,t,n){for(var o=n?Rt:Tt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,h=[];l--;){var d=e[l];l&&t&&(d=Ot(d,Yt(t))),u=yn(d.length,u),c[l]=!n&&(t||s>=120&&d.length>=120)?new qn(l&&d):i}d=e[0];var f=-1,p=c[0];e:for(;++f=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ge.call(a,l,1),Ge.call(e,l,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?Ge.call(e,i,1):li(e,i)}}return e}function Hr(e,t){return e+ft(_n()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return To(Eo(e,t,nl),e+"")}function Xr(e){return Yn(za(e))}function Yr(e,t){var n=za(e);return Mo(n,or(t,0,n.length))}function Kr(e,t,n,r){if(!Js(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s=200){var c=t?null:qi(e);if(c)return ln(c);s=!1,i=Zt,l=new qn}else l=t?[]:a;e:for(;++r=r?e:ei(e,t,n)}var bi=st||function(e){return ht.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ee(t);++r-1?o[s?t[a]:a]:i}}function Li(e){return Ji((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Pe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r1&&_.reverse(),f&&hl))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&n?new qn:i;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(p,(function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Mo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function hs(e){var t=jn(e);return t.__chain__=!0,t}function ds(e,t){return t(e)}var fs=Ji((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ds,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Ai((function(e,t,n){Ie.call(e,n)?++e[n]:rr(e,n,1)})),gs=Fi(Vo),ms=Fi(Wo);function ys(e,t){return(Ws(e)?Ct:ur)(e,oo(t,3))}function vs(e,t){return(Ws(e)?kt:hr)(e,oo(t,3))}var bs=Ai((function(e,t,n){Ie.call(e,n)?e[n].push(t):rr(e,n,[t])})),_s=Gr((function(e,t,n){var i=-1,o="function"==typeof t,s=Hs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?St(t,e,n):Ar(e,t,n)})),s})),ws=Ai((function(e,t,n){rr(e,n,t)}));function xs(e,t){return(Ws(e)?Ot:Lr)(e,oo(t,3))}var Ss=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Es=Gr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Cs=ct||function(){return ht.Date.now()};function ks(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Xi(e,c,i,i,i,i,t)}function Ps(e,t){var n;if("function"!=typeof t)throw new Pe(o);return e=fa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var As=Gr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(As));r|=l}return Xi(e,r,t,n,i)})),Ts=Gr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Ts));r|=l}return Xi(t,r,e,n,i)}));function Rs(e,t,n){var r,s,a,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Pe(o);function g(t){var n=r,o=s;return r=s=i,h=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||f&&e-h>=a}function y(){var e=Cs();if(m(e))return v(e);c=Ao(y,function(e){var n=t-(e-u);return f?yn(n,a-(e-h)):n}(e))}function v(e){return c=i,p&&r?g(e):(r=s=i,l)}function b(){var e=Cs(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return h=e,c=Ao(y,t),d?g(e):l}(u);if(f)return bi(c),c=Ao(y,t),g(u)}return c===i&&(c=Ao(y,t)),l}return t=ga(t)||0,Js(n)&&(d=!!n.leading,a=(f="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){c!==i&&bi(c),h=0,r=u=s=c=i},b.flush=function(){return c===i?l:v(Cs())},b}var Os=Gr((function(e,t){return lr(e,1,t)})),Ms=Gr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Is(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Is.Cache||Hn),n}function Ds(e){if("function"!=typeof e)throw new Pe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Is.Cache=Hn;var Fs=yi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Ot(t[0],Yt(oo())):Ot(gr(t,1),Yt(oo()))).length;return Gr((function(r){for(var i=-1,o=yn(r.length,n);++i=t})),Vs=Tr(function(){return arguments}())?Tr:function(e){return ea(e)&&Ie.call(e,"callee")&&!qe.call(e,"callee")},Ws=r.isArray,$s=yt?Yt(yt):function(e){return ea(e)&&Sr(e)==O};function Hs(e){return null!=e&&Qs(e.length)&&!Ks(e)}function qs(e){return ea(e)&&Hs(e)}var Gs=mt||gl,Xs=vt?Yt(vt):function(e){return ea(e)&&Sr(e)==v};function Ys(e){if(!ea(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ks(e){if(!Js(e))return!1;var t=Sr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==fa(e)}function Qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function Js(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Yt(bt):function(e){return ea(e)&&ho(e)==x};function na(e){return"number"==typeof e||ea(e)&&Sr(e)==S}function ra(e){if(!ea(e)||Sr(e)!=E)return!1;var t=$e(e);if(null===t)return!0;var n=Ie.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Ne}var ia=_t?Yt(_t):function(e){return ea(e)&&Sr(e)==k},oa=wt?Yt(wt):function(e){return ea(e)&&ho(e)==P};function sa(e){return"string"==typeof e||!Ws(e)&&ea(e)&&Sr(e)==A}function aa(e){return"symbol"==typeof e||ea(e)&&Sr(e)==T}var la=xt?Yt(xt):function(e){return ea(e)&&Qs(e.length)&&!!it[Sr(e)]},ca=Wi(Fr),ua=Wi((function(e,t){return e<=t}));function ha(e){if(!e)return[];if(Hs(e))return sa(e)?hn(e):ki(e);if(Ye&&e[Ye])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ye]());var t=ho(e);return(t==x?on:t==P?ln:za)(e)}function da(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fa(e){var t=da(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(fa(e),0,f):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return d;if(Js(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Js(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=pe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):fe.test(e)?d:+e}function ma(e){return Pi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=Ti((function(e,t){if(wo(t)||Hs(t))Pi(t,Ra(t),e);else for(var n in t)Ie.call(t,n)&&Jn(e,n,t[n])})),ba=Ti((function(e,t){Pi(t,Oa(t),e)})),_a=Ti((function(e,t,n,r){Pi(t,Oa(t),e,r)})),wa=Ti((function(e,t,n,r){Pi(t,Ra(t),e,r)})),xa=Ji(ir),Sa=Gr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n1),t})),Pi(e,to(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)li(n,t[i]);return n})),Fa=Ji((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return ka(e,n)}))}(e,t)}));function La(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Na=Gi(Ra),ja=Gi(Oa);function za(e){return null==e?[]:Kt(e,Ra(e))}var Ba=Ii((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Ya(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Ze,"")}var Wa=Ii((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),$a=Ii((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ha=Mi("toLowerCase"),qa=Ii((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ga=Ii((function(e,t,n){return e+(n?" ":"")+Ya(t)})),Xa=Ii((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ya=Mi("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Za=Gr((function(e,t){try{return St(e,i,t)}catch(e){return Ys(e)?e:new we(e)}})),Qa=Ji((function(e,t){return Ct(t,(function(t){t=Lo(t),rr(e,t,As(e[t],e))})),e}));function Ja(e){return function(){return e}}var el=Li(),tl=Li(!0);function nl(e){return e}function rl(e){return Ir("function"==typeof e?e:sr(e,1))}var il=Gr((function(e,t){return function(n){return Ar(n,e,t)}})),ol=Gr((function(e,t){return function(n){return Ar(e,n,t)}}));function sl(e,t,n){var r=Ra(t),i=_r(t,r);null!=n||Js(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(t,Ra(t)));var o=!(Js(n)&&"chain"in n&&!n.chain),s=Ks(e);return Ct(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function al(){}var ll=Bi(Ot),cl=Bi(Pt),ul=Bi(Ft);function hl(e){return vo(e)?Wt(Lo(e)):function(e){return function(t){return wr(t,e)}}(e)}var dl=Vi(),fl=Vi(!0);function pl(){return[]}function gl(){return!1}var ml,yl=zi((function(e,t){return e+t}),0),vl=Hi("ceil"),bl=zi((function(e,t){return e/t}),1),_l=Hi("floor"),wl=zi((function(e,t){return e*t}),1),xl=Hi("round"),Sl=zi((function(e,t){return e-t}),0);return jn.after=function(e,t){if("function"!=typeof t)throw new Pe(o);return e=fa(e),function(){if(--e<1)return t.apply(this,arguments)}},jn.ary=ks,jn.assign=va,jn.assignIn=ba,jn.assignInWith=_a,jn.assignWith=wa,jn.at=xa,jn.before=Ps,jn.bind=As,jn.bindAll=Qa,jn.bindKey=Ts,jn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},jn.chain=hs,jn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(fa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(dt(o/t));so?0:o+n),(r=r===i||r>o?o:fa(r))<0&&(r+=o),r=n>r?0:pa(r);n>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(hn(e),0,n):e.split(t,n):[]},jn.spread=function(e,t){if("function"!=typeof e)throw new Pe(o);return t=null==t?0:mn(fa(t),0),Gr((function(n){var r=n[t],i=vi(n,0,t);return r&&Mt(i,r),St(e,this,i)}))},jn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},jn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:fa(t))<0?0:t):[]},jn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:fa(t)))<0?0:t,r):[]},jn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},jn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},jn.tap=function(e,t){return t(e),e},jn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Pe(o);return Js(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Rs(e,t,{leading:r,maxWait:t,trailing:i})},jn.thru=ds,jn.toArray=ha,jn.toPairs=Na,jn.toPairsIn=ja,jn.toPath=function(e){return Ws(e)?Ot(e,Lo):aa(e)?[e]:ki(Fo(ya(e)))},jn.toPlainObject=ma,jn.transform=function(e,t,n){var r=Ws(e),i=r||Gs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Js(e)&&Ks(o)?zn($e(e)):{}}return(i?Ct:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},jn.unary=function(e){return ks(e,1)},jn.union=es,jn.unionBy=ts,jn.unionWith=ns,jn.uniq=function(e){return e&&e.length?ai(e):[]},jn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},jn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},jn.unset=function(e,t){return null==e||li(e,t)},jn.unzip=rs,jn.unzipWith=is,jn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},jn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},jn.values=za,jn.valuesIn=function(e){return null==e?[]:Kt(e,Oa(e))},jn.without=os,jn.words=Ka,jn.wrap=function(e,t){return Ls(gi(t),e)},jn.xor=ss,jn.xorBy=as,jn.xorWith=ls,jn.zip=cs,jn.zipObject=function(e,t){return fi(e||[],t||[],Jn)},jn.zipObjectDeep=function(e,t){return fi(e||[],t||[],Kr)},jn.zipWith=us,jn.entries=Na,jn.entriesIn=ja,jn.extend=ba,jn.extendWith=_a,sl(jn,jn),jn.add=yl,jn.attempt=Za,jn.camelCase=Ba,jn.capitalize=Ua,jn.ceil=vl,jn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},jn.clone=function(e){return sr(e,4)},jn.cloneDeep=function(e){return sr(e,5)},jn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},jn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},jn.conformsTo=function(e,t){return null==t||ar(e,t,Ra(t))},jn.deburr=Va,jn.defaultTo=function(e,t){return null==e||e!=e?t:e},jn.divide=bl,jn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(fa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},jn.eq=zs,jn.escape=function(e){return(e=ya(e))&&X.test(e)?e.replace(q,tn):e},jn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},jn.every=function(e,t,n){var r=Ws(e)?Pt:dr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},jn.find=gs,jn.findIndex=Vo,jn.findKey=function(e,t){return Nt(e,oo(t,3),vr)},jn.findLast=ms,jn.findLastIndex=Wo,jn.findLastKey=function(e,t){return Nt(e,oo(t,3),br)},jn.floor=_l,jn.forEach=ys,jn.forEachRight=vs,jn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},jn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},jn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},jn.forOwnRight=function(e,t){return e&&br(e,oo(t,3))},jn.get=Ca,jn.gt=Bs,jn.gte=Us,jn.has=function(e,t){return null!=e&&fo(e,t,Cr)},jn.hasIn=ka,jn.head=Ho,jn.identity=nl,jn.includes=function(e,t,n,r){e=Hs(e)?e:za(e),n=n&&!r?fa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&zt(e,t,n)>-1},jn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fa(n);return i<0&&(i=mn(r+i,0)),zt(e,t,i)},jn.inRange=function(e,t,n){return t=da(t),n===i?(n=t,t=0):n=da(n),function(e,t,n){return e>=yn(t,n)&&e=-9007199254740991&&e<=h},jn.isSet=oa,jn.isString=sa,jn.isSymbol=aa,jn.isTypedArray=la,jn.isUndefined=function(e){return e===i},jn.isWeakMap=function(e){return ea(e)&&ho(e)==R},jn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sr(e)},jn.join=function(e,t){return null==e?"":$t.call(e,t)},jn.kebabCase=Wa,jn.last=Yo,jn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=fa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):jt(e,Ut,o,!0)},jn.lowerCase=$a,jn.lowerFirst=Ha,jn.lt=ca,jn.lte=ua,jn.max=function(e){return e&&e.length?fr(e,nl,Er):i},jn.maxBy=function(e,t){return e&&e.length?fr(e,oo(t,2),Er):i},jn.mean=function(e){return Vt(e,nl)},jn.meanBy=function(e,t){return Vt(e,oo(t,2))},jn.min=function(e){return e&&e.length?fr(e,nl,Fr):i},jn.minBy=function(e,t){return e&&e.length?fr(e,oo(t,2),Fr):i},jn.stubArray=pl,jn.stubFalse=gl,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=wl,jn.nth=function(e,t){return e&&e.length?Br(e,fa(t)):i},jn.noConflict=function(){return ht._===this&&(ht._=je),this},jn.noop=al,jn.now=Cs,jn.pad=function(e,t,n){e=ya(e);var r=(t=fa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(ft(i),n)+e+Ui(dt(i),n)},jn.padEnd=function(e,t,n){e=ya(e);var r=(t=fa(t))?un(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=_n();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hr(e,t)},jn.reduce=function(e,t,n){var r=Ws(e)?It:Ht,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},jn.reduceRight=function(e,t,n){var r=Ws(e)?Dt:Ht,i=arguments.length<3;return r(e,oo(t,4),n,i,hr)},jn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:fa(t),qr(ya(e),t)},jn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=f,r=yn(e,f);t=oo(t),e-=f;for(var i=Gt(r,t);++n=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Ce(o.source,ya(de.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===i?l:d)}}else if(e.indexOf(si(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+r},jn.unescape=function(e){return(e=ya(e))&&G.test(e)?e.replace(H,fn):e},jn.uniqueId=function(e){var t=++De;return ya(e)+t},jn.upperCase=Xa,jn.upperFirst=Ya,jn.each=ys,jn.eachRight=vs,jn.first=Ho,sl(jn,(ml={},vr(jn,(function(e,t){Ie.call(jn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),jn.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jn[e].placeholder=jn})),Ct(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(fa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Gr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Ar(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(Ds(oo(e)))},Vn.prototype.slice=function(e,t){e=fa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=fa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(f)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=jn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(jn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ws(t),h=function(e){var t=o.apply(jn,Mt([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,g=l&&!f;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:ds,args:[h],thisArg:i}),new Un(m,d)}return p&&g?e.apply(this,a):(m=this.thru(h),p?r?m.value()[0]:m.value():m)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);jn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=jn[t];if(n){var r=n.name+"";Ie.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}})),Tn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},jn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=jo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},jn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ds,args:[Jo],thisArg:i}),new Un(t,this.__chain__)}return this.thru(Jo)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,Ye&&(jn.prototype[Ye]=function(){return this}),jn}();ht._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),s=n(7797);e.exports=function(e){return o(e)?r(s(e)):i(e)}},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?NaN:+e}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},5808:(e,t,n)=>{var r=n(2507)("toUpperCase");e.exports=r},1811:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function i(e,t){if(e.length!==t.length)return!1;for(var n=0;n{var factory;globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.StreamType=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.arrayByteLength=u,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let n=0;for(let r=0;rt}),e.promise=new Promise((function(n,r){e.resolve=function(e){t=!0,n(e)},e.reject=function(e){t=!0,r(e)}})),e},t.createValidAbsoluteUrl=function(e,t=null,n=null){if(!e)return null;try{if(n&&"string"==typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=p(e)}catch(e){}}const r=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null},t.escapeString=function(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=r.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=c,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),r=c(e);return n.decode(r)}catch(e){o(`stringToPDFString: "${e}".`)}}const t=[];for(let n=0,r=e.length;n>8&255),String.fromCharCode(255&r))}return t.join("")},t.stringToUTF8String=p,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=o,n(2),t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15},t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},t.TextRenderingMode={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},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.AnnotationType={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},t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.AnnotationFieldFlag={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},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.AnnotationActionEventType={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"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"},t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const r={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=r,t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},t.OPS={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},t.UNSUPPORTED_FEATURES={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"},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=r.WARNINGS;function o(e){i>=r.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const l=function(){function e(t,n){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function c(e){"string"!=typeof e&&s("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;re.toString(16).padStart(2,"0")));class d{static makeHexColor(e,t,n){return`#${h[e]}${h[t]}${h[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=d.applyTransform(e,t),r=d.applyTransform(e.slice(2,4),t),i=d.applyTransform([e[0],e[3]],t),o=d.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],o=e[2]*t[1]+e[3]*t[3],s=(n+o)/2,a=Math.sqrt((n+o)**2-4*(n*o-i*r))/2,l=s+a||1,c=s-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),o=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>o?null:[n,i,r,o]}static bezierBoundingBox(e,t,n,r,i,o,s,a){const l=[],c=[[],[]];let u,h,d,f,p,g,m,y;for(let c=0;c<2;++c)if(0===c?(h=6*e-12*n+6*i,u=-3*e+9*n-9*i+3*s,d=3*n-3*e):(h=6*t-12*r+6*o,u=-3*t+9*r-9*o+3*a,d=3*r-3*t),Math.abs(u)<1e-12){if(Math.abs(h)<1e-12)continue;f=-d/h,0{n(3)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{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,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:e,NodeCMapReaderFactory:t,NodeStandardFontDataFactory:n}=__w_pdfjs_require__(21);exports.DefaultCanvasFactory=DefaultCanvasFactory=e,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=t,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=n}function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){const t=new PDFDocumentLoadingTask;let n;if("string"==typeof e||e instanceof URL)n={url:e};else if((0,_util.isArrayBuffer)(e))n={data:e};else if(e instanceof PDFDataRangeTransport)n={range:e};else{if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");n=e}const r=Object.create(null);let i=null,o=null;for(const e in n){const t=n[e];switch(e){case"url":if("undefined"!=typeof window)try{r[e]=new URL(t,window.location).href;continue}catch(e){(0,_util.warn)(`Cannot create valid URL: "${e}".`)}else if("string"==typeof t||t instanceof URL){r[e]=t.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":i=t;continue;case"worker":o=t;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)r[e]=new Uint8Array(t);else{if(t instanceof Uint8Array)break;if("string"==typeof t)r[e]=(0,_util.stringToBytes)(t);else if("object"!=typeof t||null===t||isNaN(t.length)){if(!(0,_util.isArrayBuffer)(t))throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");r[e]=new Uint8Array(t)}else r[e]=new Uint8Array(t)}continue}r[e]=t}if(r.CMapReaderFactory=r.CMapReaderFactory||DefaultCMapReaderFactory,r.StandardFontDataFactory=r.StandardFontDataFactory||DefaultStandardFontDataFactory,r.ignoreErrors=!0!==r.stopAtErrors,r.fontExtraProperties=!0===r.fontExtraProperties,r.pdfBug=!0===r.pdfBug,r.enableXfa=!0===r.enableXfa,(!Number.isInteger(r.rangeChunkSize)||r.rangeChunkSize<1)&&(r.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),("string"!=typeof r.docBaseUrl||(0,_display_utils.isDataScheme)(r.docBaseUrl))&&(r.docBaseUrl=null),(!Number.isInteger(r.maxImageSize)||r.maxImageSize<-1)&&(r.maxImageSize=-1),"string"!=typeof r.cMapUrl&&(r.cMapUrl=null),"string"!=typeof r.standardFontDataUrl&&(r.standardFontDataUrl=null),"boolean"!=typeof r.useWorkerFetch&&(r.useWorkerFetch=r.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&r.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof r.isEvalSupported&&(r.isEvalSupported=!0),"boolean"!=typeof r.disableFontFace&&(r.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof r.useSystemFonts&&(r.useSystemFonts=!_is_node.isNodeJS&&!r.disableFontFace),"object"==typeof r.ownerDocument&&null!==r.ownerDocument||(r.ownerDocument=globalThis.document),"boolean"!=typeof r.disableRange&&(r.disableRange=!1),"boolean"!=typeof r.disableStream&&(r.disableStream=!1),"boolean"!=typeof r.disableAutoFetch&&(r.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(r.verbosity),!o){const e={verbosity:r.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};o=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=o}const s=t.docId;return o.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(o,r,i,s),n=new Promise((function(e){let t;i?t=new _transport_stream.PDFDataTransportStream({length:r.length,initialData:r.initialData,progressiveDone:r.progressiveDone,contentDispositionFilename:r.contentDispositionFilename,disableRange:r.disableRange,disableStream:r.disableStream},i):r.data||(t=createPDFNetworkStream({url:r.url,length:r.length,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials,rangeChunkSize:r.rangeChunkSize,disableRange:r.disableRange,disableStream:r.disableStream})),e(t)}));return Promise.all([e,n]).then((function([e,n]){if(t.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(s,e,o.port),a=new WorkerTransport(i,t,n,r);t._transport=a,i.send("Ready",null)}))})).catch(t._capability.reject),t}async function _fetchDocument(e,t,n,r){if(e.destroyed)throw new Error("Worker was destroyed");n&&(t.length=n.length,t.initialData=n.initialData,t.progressiveDone=n.progressiveDone,t.contentDispositionFilename=n.contentDispositionFilename);const i=await e.messageHandler.sendWithPromise("GetDocRequest",{docId:r,apiVersion:"2.16.105",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,docBaseUrl:t.docBaseUrl,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,enableXfa:t.enableXfa,useSystemFonts:t.useSystemFonts,cMapUrl:t.useWorkerFetch?t.cMapUrl:null,standardFontDataUrl:t.useWorkerFetch?t.standardFontDataUrl:null});if(t.data&&(t.data=null),e.destroyed)throw new Error("Worker was destroyed");return i}class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await(this._transport?.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,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(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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(e=!1){return this._transport.startCleanup(e||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(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._ownerDocument=r,this._transport=n,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=n.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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e="display"}={}){const t=this._transport.getRenderingIntent(e);let n=this._annotationPromises.get(t.cacheKey);return n||(n=this._transport.getAnnotations(this._pageIndex,t.renderingIntent),this._annotationPromises.set(t.cacheKey,n),n=n.then((e=>{for(const t of e)void 0!==t.titleObj&&Object.defineProperty(t,"title",{get:()=>((0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),t.titleObj.str)}),void 0!==t.contentsObj&&Object.defineProperty(t,"contents",{get:()=>((0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),t.contentsObj.str)});return e}))),n}getJSActions(){return this._jsActionsPromise||=this._transport.getPageJSActions(this._pageIndex)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:i=null,imageLayer:o=null,canvasFactory:s=null,background:a=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:h=null}){void 0!==arguments[0]?.renderInteractiveForms&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&r===_util.AnnotationMode.ENABLE&&(r=_util.AnnotationMode.ENABLE_FORMS)),void 0!==arguments[0]?.includeAnnotationStorage&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&r===_util.AnnotationMode.ENABLE&&(r=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const d=this._transport.getRenderingIntent(n,r,h);this.pendingCleanup=!1,l||(l=this._transport.getOptionalContentConfig());let f=this._intentStates.get(d.cacheKey);f||(f=Object.create(null),this._intentStates.set(d.cacheKey,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const p=s||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),g=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);f.displayReadyCapability||(f.displayReadyCapability=(0,_util.createPromiseCapability)(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(d));const m=e=>{f.renderTasks.delete(y),(this.cleanupAfterRender||g)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(y.capability.reject(e),this._abortOperatorList({intentState:f,reason:e instanceof Error?e:new Error(e)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},y=new InternalRenderTask({callback:m,params:{canvasContext:e,viewport:t,transform:i,imageLayer:o,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:p,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:u});(f.renderTasks||=new Set).add(y);const v=y.task;return Promise.all([f.displayReadyCapability.promise,l]).then((([e,t])=>{this.pendingCleanup?m():(this._stats&&this._stats.time("Rendering"),y.initializeGraphics({transparency:e,optionalContentConfig:t}),y.operatorListChanged())})).catch(m),v}getOperatorList({intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const r=this._transport.getRenderingIntent(e,t,n,!0);let i,o=this._intentStates.get(r.cacheKey);return o||(o=Object.create(null),this._intentStates.set(r.cacheKey,o)),o.opListReadCapability||(i=Object.create(null),i.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(i))},o.opListReadCapability=(0,_util.createPromiseCapability)(),(o.renderTasks||=new Set).add(i),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(r)),o.opListReadCapability.promise}streamTextContent({disableCombineTextItems:e=!1,includeMarkedContent:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==e,includeMarkedContent:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,n){const r=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){r.read().then((function({value:n,done:r}){r?e(i):(Object.assign(i.styles,n.styles),i.items.push(...n.items),t())}),n)}()}))}getStructTree(){return this._structTreePromise||=this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();this.objs.clear();for(const e of this._bitmaps)e.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const e of this._bitmaps)e.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats&&this._stats.timeEnd("Page Request"),n.displayReadyCapability&&n.displayReadyCapability.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n{r.read().then((({value:e,done:t})=>{t?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,i),o())}),(e=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const e of i.renderTasks)e.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(e);else{if(!i.opListReadCapability)throw e;i.opListReadCapability.reject(e)}}}))};o()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}if(e.streamReader.cancel(new _util.AbortException(t.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(e,t){const n={data:structuredClone(e,t)};this._deferred.then((()=>{for(const e of this._listeners)e.call(this,n)}))}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const n=this._listeners.indexOf(t);this._listeners.splice(n,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const e=document?.currentScript?.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const r=new URL(t,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};class PDFWorker{static#t=new WeakMap;constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&PDFWorker.#t.has(t))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return PDFWorker.#t.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),r=()=>{t.removeEventListener("error",i),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||r()};t.addEventListener("error",i),n.on("test",(e=>{t.removeEventListener("error",i),this.destroyed?r():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",i),this.destroyed)r();else try{o()}catch(e){this._setupFakeWorker()}}));const o=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void o()}catch(e){(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((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+PDFWorkerUtil.fakeWorkerId++,r=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(r,t);const i=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#t.has(e.port)?this.#t.get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){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())}}exports.PDFWorker=PDFWorker,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{#n=null;#r=new Map;#i=new Map;#o=null;constructor(e,t,n,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,r.useWorkerFetch||(this.CMapReaderFactory=new r.CMapReaderFactory({baseUrl:r.cMapUrl,isCompressed:r.cMapPacked}),this.StandardFontDataFactory=new r.StandardFontDataFactory({baseUrl:r.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,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 this.#n}getRenderingIntent(e,t=_util.AnnotationMode.ENABLE,n=null,r=!1){let i=_util.RenderingIntentFlag.DISPLAY,o=null;switch(e){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,o=(i&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return r&&(i+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:i,cacheKey:`${i}_${_annotation_storage.AnnotationStorage.getHash(o)}`,annotationStorageMap:o}}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 e=[];for(const t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#o=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:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then((()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),r.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const n=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.#r.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(([t,n,r])=>{if(!this.destroyed&&!this.commonObjs.has(t))switch(n){case"Font":const i=this._params;if("error"in r){const e=r.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let o=null;i.pdfBug&&globalThis.FontInspector?.enabled&&(o={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const s=new _font_loader.FontFaceObject(r,{isEvalSupported:i.isEvalSupported,disableFontFace:i.disableFontFace,ignoreErrors:i.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:o});this.fontLoader.bind(s).catch((n=>e.sendWithPromise("FontFallback",{id:t}))).finally((()=>{!i.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(t,s)}));break;case"FontPath":case"Image":this.commonObjs.resolve(t,r);break;default:throw new Error(`Got unknown common object type ${n}`)}})),e.on("obj",(([e,t,n,r])=>{if(this.destroyed)return;const i=this.#r.get(t);if(!i.objs.has(e))switch(n){case"Image":i.objs.resolve(e,r);const t=8e6;if(r){let e;if(r.bitmap){const{bitmap:t,width:n,height:o}=r;e=n*o*4,i._bitmaps.add(t)}else e=r.data?.length||0;e>t&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(e,r);break;default:throw new Error(`Got unknown object type ${n}`)}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})})),e.on("DocStats",(e=>{this.destroyed||(this.#n=Object.freeze({streamTypes:Object.freeze(e.streamTypes),fontTypes:Object.freeze(e.fontTypes)}))})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#i.get(t);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.ownerDocument,this._params.pdfBug);return this.#r.set(t,n),n}));return this.#i.set(t,r),r}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getFieldObjects(){return this._getFieldObjectsPromise||=this.messageHandler.sendWithPromise("GetFieldObjects",null)}hasJSActions(){return this._hasJSActionsPromise||=this.messageHandler.sendWithPromise("HasJSActions",null)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.#o||=this.messageHandler.sendWithPromise("GetMetadata",null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(const e of this.#r.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#o=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,enableXfa:e.enableXfa})}}class PDFObjects{#s=Object.create(null);#a(e){return this.#s[e]||(this.#s[e]={capability:(0,_util.createPromiseCapability)(),data:null})}get(e,t=null){if(t){const n=this.#a(e);return n.capability.promise.then((()=>t(n.data))),null}const n=this.#s[e];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#s[e];return t?.capability.settled||!1}resolve(e,t=null){const n=this.#a(e);n.data=t,n.capability.resolve()}clear(){this.#s=Object.create(null)}}class RenderTask{#l=null;constructor(e){this.#l=e,this.onContinue=null}get promise(){return this.#l.capability.promise}cancel(){this.#l.cancel()}get separateAnnots(){const{separateAnnots:e}=this.#l.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#l;return e.form||e.canvas&&t?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#c=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:o,pageIndex:s,canvasFactory:a,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:u=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=s,this.canvasFactory=a,this._pdfBug=c,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,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=t.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#c.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.");InternalRenderTask.#c.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:r,transform:i,imageLayer:o,background:s}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,o,t,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:r,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(e=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.#c.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_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&&InternalRenderTask.#c.delete(this._canvas),this.callback())))}}const version="2.16.105";exports.version=version;const build="172ccdbe5";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var r=n(1),i=n(6),o=n(10);class s{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this._storage.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this._storage.get(e)}remove(e){if(this._storage.delete(e),0===this._storage.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this._storage.values())if(e instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this._storage.get(e);let r=!1;if(void 0!==n)for(const[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this._storage.set(e,t);r&&this.#u(),t instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this._storage.has(e)}getAll(){return this._storage.size>0?(0,r.objectFromMap)(this._storage):null}get size(){return this._storage.size}#u(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new a(this)}get serializable(){if(0===this._storage.size)return null;const e=new Map;for(const[t,n]of this._storage){const r=n instanceof i.AnnotationEditor?n.serialize():n;r&&e.set(t,r)}return e}static getHash(e){if(!e)return"";const t=new o.MurmurHash3_64;for(const[n,r]of e)t.update(`${n}:${JSON.stringify(r)}`);return t.hexdigest()}}t.AnnotationStorage=s;class a extends s{#h=null;constructor(e){super(),this.#h=structuredClone(e.serializable)}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#h}}t.PrintAnnotationStorage=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var r=n(7),i=n(1);class o{#d=this.focusin.bind(this);#f=this.focusout.bind(this);#p=!1;#g=!1;#m=!1;#y=o._zIndex++;static _colorManager=new r.ColorManager;static _zIndex=1;constructor(e){this.constructor===o&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null;const[t,n]=this.parent.viewportBaseDimensions;this.x=e.x/t,this.y=e.y/n,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#y}focusin(e){this.#p?this.#p=!1:this.parent.setSelected(this)}focusout(e){if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x,this.startY=e.clientY-t.y,e.dataTransfer.setData("text/plain",this.id),e.dataTransfer.effectAllowed="move"}setAt(e,t,n,r){const[i,o]=this.parent.viewportBaseDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/o,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(e,t){const[n,r]=this.parent.viewportBaseDimensions;[e,t]=this.screenToPageTranslation(e,t),this.x+=e/n,this.y+=t/r,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){const{rotation:n}=this.parent.viewport;switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}setDims(e,t){const[n,r]=this.parent.viewportBaseDimensions;this.div.style.width=100*e/n+"%",this.div.style.height=100*t/r+"%"}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",this.#d),this.div.addEventListener("focusout",this.#f);const[e,t]=this.getInitialTranslation();return this.translate(e,t),(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(e){const t=r.KeyboardManager.platform.isMac;0!==e.button||e.ctrlKey&&t?e.preventDefault():(e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#p=!0)}getRect(e,t){const[n,r]=this.parent.viewportBaseDimensions,[i,o]=this.parent.pageDimensions,s=i*e/n,a=o*t/r,l=this.x*i,c=this.y*o,u=this.width*i,h=this.height*o;switch(this.rotation){case 0:return[l+s,o-c-a-h,l+s+u,o-c-a];case 90:return[l+a,o-c+s,l+a+h,o-c+s+u];case 180:return[l-s-u,o-c+a,l-s,o-c+a+h];case 270:return[l-a-h,o-c-s-u,l-a,o-c-s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,r,i,o]=e,s=i-n,a=o-r;switch(this.rotation){case 0:return[n,t-o,s,a];case 90:return[n,t-r,a,s];case 180:return[i,t-r,s,a];case 270:return[i,t-o,a,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#m=!0}disableEditMode(){this.#m=!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#d)}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t){const n=new this.prototype.constructor({parent:t,id:t.getNextId()});n.rotation=e.rotation;const[r,i]=t.pageDimensions,[o,s,a,l]=n.getRectInCurrentCoords(e.rect,i);return n.x=o/r,n.y=s/i,n.width=a/r,n.height=l/i,n}remove(){this.div.removeEventListener("focusin",this.#d),this.div.removeEventListener("focusout",this.#f),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}t.AnnotationEditor=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var r=n(1),i=n(8);class o{#v=0;getId(){return`${r.AnnotationEditorPrefix}${this.#v++}`}}class s{#b=[];#_=!1;#w;#x=-1;constructor(e=128){this.#w=e}add({cmd:e,undo:t,mustExec:n,type:r=NaN,overwriteIfSameType:i=!1,keepUndo:o=!1}){if(n&&e(),this.#_)return;const s={cmd:e,undo:t,type:r};if(-1===this.#x)return this.#b.length>0&&(this.#b.length=0),this.#x=0,void this.#b.push(s);if(i&&this.#b[this.#x].type===r)return o&&(s.undo=this.#b[this.#x].undo),void(this.#b[this.#x]=s);const a=this.#x+1;a===this.#w?this.#b.splice(0,1):(this.#x=a,ae.serialize())):this.#E=[e.serialize()],this.#E=this.#E.filter((e=>!!e)),0===this.#E.length&&(this.#E=null))}paste(){return this.#E}isEmpty(){return null===this.#E}destroy(){this.#E=null}}class c{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,r.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,n]of this._colors)if(n.every(((e,n)=>e===t[n])))return c._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?r.Util.makeHexColor(...t):e}}t.ColorManager=c;class u{#C=null;#k=new Map;#P=new Map;#A=new l;#T=new s;#R=0;#O=null;#M=null;#I=new o;#D=!1;#F=r.AnnotationEditorType.NONE;#L=new Set;#N=this.keydown.bind(this);#j=this.onEditingAction.bind(this);#z=this.onPageChanging.bind(this);#B={isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#U=null;static _keyboardManager=new a([[["ctrl+a","mac+meta+a"],u.prototype.selectAll],[["ctrl+c","mac+meta+c"],u.prototype.copy],[["ctrl+v","mac+meta+v"],u.prototype.paste],[["ctrl+x","mac+meta+x"],u.prototype.cut],[["ctrl+z","mac+meta+z"],u.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],u.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],u.prototype.delete],[["Escape","mac+Escape"],u.prototype.unselectAll]]);constructor(e,t){this.#U=e,this.#M=t,this.#M._on("editingaction",this.#j),this.#M._on("pagechanging",this.#z)}destroy(){this.#V(),this.#M._off("editingaction",this.#j),this.#M._off("pagechanging",this.#z);for(const e of this.#P.values())e.destroy();this.#P.clear(),this.#k.clear(),this.#C=null,this.#L.clear(),this.#A.destroy(),this.#T.destroy()}onPageChanging({pageNumber:e}){this.#R=e-1}focusMainContainer(){this.#U.focus()}#W(){this.#U.addEventListener("keydown",this.#N)}#V(){this.#U.removeEventListener("keydown",this.#N)}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||u._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","cut","copy","paste","delete","selectAll"].includes(e.name)&&this[e.name]()}#$(e){Object.entries(e).some((([e,t])=>this.#B[e]!==t))&&this.#M.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#B,e)})}#H(e){this.#M.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#W(),this.#$({isEditing:this.#F!==r.AnnotationEditorType.NONE,isEmpty:this.#q(),hasSomethingToUndo:this.#T.hasSomethingToUndo(),hasSomethingToRedo:this.#T.hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:this.#A.isEmpty()})):(this.#V(),this.#$({isEditing:!1}))}registerEditorTypes(e){this.#O=e;for(const e of this.#O)this.#H(e.defaultPropertiesToUpdate)}getId(){return this.#I.getId()}addLayer(e){this.#P.set(e.pageIndex,e),this.#D?e.enable():e.disable()}removeLayer(e){this.#P.delete(e.pageIndex)}updateMode(e){if(this.#F=e,e===r.AnnotationEditorType.NONE)this.setEditingState(!1),this.#G();else{this.setEditingState(!0),this.#X();for(const t of this.#P.values())t.updateMode(e)}}updateToolbar(e){e!==this.#F&&this.#M.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){for(const n of this.#L)n.updateParams(e,t);for(const n of this.#O)n.updateDefaultParams(e,t)}#X(){if(!this.#D){this.#D=!0;for(const e of this.#P.values())e.enable()}}#G(){if(this.unselectAll(),this.#D){this.#D=!1;for(const e of this.#P.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#k.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#k.get(e)}addEditor(e){this.#k.set(e.id,e)}removeEditor(e){this.#k.delete(e.id),this.unselect(e)}#Y(e){const t=this.#P.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#C!==e&&(this.#C=e,e&&this.#H(e.propertiesToUpdate))}toggleSelected(e){if(this.#L.has(e))return this.#L.delete(e),e.unselect(),void this.#$({hasSelectedEditor:this.hasSelection});this.#L.add(e),e.select(),this.#H(e.propertiesToUpdate),this.#$({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#L)t!==e&&t.unselect();this.#L.clear(),this.#L.add(e),e.select(),this.#H(e.propertiesToUpdate),this.#$({hasSelectedEditor:!0})}isSelected(e){return this.#L.has(e)}unselect(e){e.unselect(),this.#L.delete(e),this.#$({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#L.size}undo(){this.#T.undo(),this.#$({hasSomethingToUndo:this.#T.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#q()})}redo(){this.#T.redo(),this.#$({hasSomethingToUndo:!0,hasSomethingToRedo:this.#T.hasSomethingToRedo(),isEmpty:this.#q()})}addCommands(e){this.#T.add(e),this.#$({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#q()})}#q(){if(0===this.#k.size)return!0;if(1===this.#k.size)for(const e of this.#k.values())return e.isEmpty();return!1}delete(){if(this.#C&&this.#C.commitOrRemove(),!this.hasSelection)return;const e=[...this.#L];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#Y(t)},mustExec:!0})}copy(){if(this.#C&&this.#C.commitOrRemove(),this.hasSelection){const e=[];for(const t of this.#L)t.isEmpty()||e.push(t);if(0===e.length)return;this.#A.copy(e),this.#$({hasEmptyClipboard:!1})}}cut(){this.copy(),this.delete()}paste(){if(this.#A.isEmpty())return;this.unselectAll();const e=this.#P.get(this.#R),t=this.#A.paste().map((t=>e.deserialize(t)));this.addCommands({cmd:()=>{for(const e of t)this.#Y(e);this.#K(t)},undo:()=>{for(const e of t)e.remove()},mustExec:!0})}#K(e){this.#L.clear();for(const t of e)t.isEmpty()||(this.#L.add(t),t.select());this.#$({hasSelectedEditor:!0})}selectAll(){for(const e of this.#L)e.commit();this.#K(this.#k.values())}unselectAll(){if(this.#C)this.#C.commitOrRemove();else if(0!==this.#K.size){for(const e of this.#L)e.unselect();this.#L.clear(),this.#$({hasSelectedEditor:!1})}}isActive(e){return this.#C===e}getActive(){return this.#C}getMode(){return this.#F}}t.AnnotationEditorUIManager=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,m(r))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:r,d:i,e:o,f:s}=e.getTransform();return[t,n,r,i,o,s]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:r,d:i,e:o,f:s}=e.getTransform().invertSelf();return[t,n,r,i,o,s]},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),n=e.indexOf("?"),r=Math.min(t>0?t:e.length,n>0?n:e.length);return e.substring(e.lastIndexOf("/",r)+1,r)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(f(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let o=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(o&&(o=o[0],o.includes("%")))try{o=n.exec(decodeURIComponent(o))[0]}catch(e){}return o||t},t.getRGB=m,t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:r,height:i}=e.attributes.style,o=[0,0,parseInt(r),parseInt(i)];return new h({viewBox:o,scale:t,rotation:n})},t.isDataScheme=f,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=p,t.loadScript=function(e,t=!1){return new Promise(((n,r)=>{const i=document.createElement("script");i.src=e,i.onload=function(e){t&&i.remove(),n(e)},i.onerror=function(){r(new Error(`Cannot load script at: ${i.src}`))},(document.head||document.documentElement).append(i)}))};var r=n(9),i=n(1);t.AnnotationPrefix="pdfjs_internal_id_";class o{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=o;class s extends r.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function a(e,t=!1){if(p(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,i.stringToBytes)(await n.text())}return new Promise(((n,r)=>{const o=new XMLHttpRequest;o.open("GET",e,!0),t&&(o.responseType="arraybuffer"),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){let e;if(t&&o.response?e=new Uint8Array(o.response):!t&&o.responseText&&(e=(0,i.stringToBytes)(o.responseText)),e)return void n(e)}r(new Error(o.statusText))}},o.send(null)}))}t.DOMCanvasFactory=s;class l extends r.BaseCMapReaderFactory{_fetchData(e,t){return a(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=l;class c extends r.BaseStandardFontDataFactory{_fetchData(e){return a(e,!0)}}t.DOMStandardFontDataFactory=c;class u extends r.BaseSVGFactory{_createSVG(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}}t.DOMSVGFactory=u;class h{constructor({viewBox:e,scale:t,rotation:n,offsetX:r=0,offsetY:i=0,dontFlip:o=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=r,this.offsetY=i;const s=(e[2]+e[0])/2,a=(e[3]+e[1])/2;let l,c,u,h,d,f,p,g;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,u=0,h=1;break;case 90:l=0,c=1,u=1,h=0;break;case 270:l=0,c=-1,u=-1,h=0;break;case 0:l=1,c=0,u=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,h=-h),0===l?(d=Math.abs(a-e[1])*t+r,f=Math.abs(s-e[0])*t+i,p=Math.abs(e[3]-e[1])*t,g=Math.abs(e[2]-e[0])*t):(d=Math.abs(s-e[0])*t+r,f=Math.abs(a-e[1])*t+i,p=Math.abs(e[2]-e[0])*t,g=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,h*t,d-l*t*s-u*t*a,f-c*t*s-h*t*a],this.width=p,this.height=g}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}={}){return new h({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=h;class d extends i.BaseException{constructor(e,t){super(e,"RenderingCancelledException"),this.type=t}}function f(e){const t=e.length;let n=0;for(;n>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,i.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.RenderingCancelledException=d,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,i.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const e of this.times){const n=e.name;n.length>t&&(t=n.length)}for(const n of this.times){const r=n.end-n.start;e.push(`${n.name.padEnd(t)} ${r}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;g||(g=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=g.exec(e);if(!t)return null;const n=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;let s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;let a=parseInt(t[6],10);a=a>=0&&a<=59?a:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(o+=c,s+=u):"+"===l&&(o-=c,s-=u),new Date(Date.UTC(n,r,i,o,s,a))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var r=n(1);class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class o{constructor({baseUrl:e=null,isCompressed:t=!1}){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(t,n).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)}))}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=o;class s{constructor({baseUrl:e=null}){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch((e=>{throw new Error(`Unable to load font data at: ${t}`)}))}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=s;class a{constructor(){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${t}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${t}`),r}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var r=n(1);const i=3285377520,o=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:i,this.h2=e?4294967295&e:i}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let r=0,i=e.length;r>>8,t[n++]=255&i)}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const i=n>>2,a=n-4*i,l=new Uint32Array(t.buffer,0,i);let c=0,u=0,h=this.h1,d=this.h2;const f=3432918353,p=461845907,g=11601,m=13715;for(let e=0;e>>17,c=c*p&o|c*m&s,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(u=l[e],u=u*f&o|u*g&s,u=u<<15|u>>>17,u=u*p&o|u*m&s,d^=u,d=d<<13|d>>>19,d=5*d+3864292196);switch(c=0,a){case 3:c^=t[4*i+2]<<16;case 2:c^=t[4*i+1]<<8;case 1:c^=t[4*i],c=c*f&o|c*g&s,c=c<<15|c>>>17,c=c*p&o|c*m&s,1&i?h^=c:d^=c}this.h1=h,this.h2=d}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1,e=3981806797*e&o|36045*e&s,t=4283543511*t&o|(2950163797*(t<<16|e>>>16)&o)>>>16,e^=t>>>1,e=444984403*e&o|60499*e&s,t=3301882366*t&o|(3120437893*(t<<16|e>>>16)&o)>>>16,e^=t>>>1;const n=(e>>>0).toString(16),r=(t>>>0).toString(16);return n.padStart(8,"0")+r.padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(1);class i{constructor({docId:e,onUnsupportedFeature:t,ownerDocument:n=globalThis.document,styleElement:o=null}){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this._document=n,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=this._document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].append(t));const n=t.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((n=>{const r=this._queueLoadingCallback(n);this._prepareFontLoadEvent([t],[e],r)}))}}_queueLoadingCallback(e){(0,r.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,r.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,r.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,n){(0,r.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let o;t.FontLoader=o,t.FontLoader=o=class extends i{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;if("undefined"==typeof navigator)e=!0;else{const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t?.[1]>=14&&(e=!0)}return(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,n={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(n),n}get _loadTestFont(){return(0,r.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,n){function i(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function o(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let s,a;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let u=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=o(d,976,h.length,h);const f=1482184792;let p=i(d,16);for(s=0,a=h.length-3;s30)return(0,r.warn)("Load test font never loaded."),void n();c.font="30px "+t,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(h,(()=>{y.remove(),n.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:r=!1,onUnsupportedFeature:i,fontRegistry:o=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===n,this.ignoreErrors=!0===r,this._onUnsupportedFeature=i,this.fontRegistry=o}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const r of n)"scale"===r.cmd&&(r.args=[t,-t]),e[r.cmd].apply(e,r.args)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(8),i=n(1),o=n(13),s=n(14),a=n(3);const l=4096,c=a.isNodeJS&&"undefined"==typeof Path2D?-1:1e3,u=16;class h{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return void 0!==this.cache[e]?(r=this.cache[e],this.canvasFactory.reset(r,t,n)):(r=this.canvasFactory.create(t,n),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function d(e,t,n,i,o,s,a,l,c,u){const[h,d,f,p,g,m]=(0,r.getCurrentTransform)(e);if(0===d&&0===f){const r=a*h+g,y=Math.round(r),v=l*p+m,b=Math.round(v),_=(a+c)*h+g,w=Math.abs(Math.round(_)-y)||1,x=(l+u)*p+m,S=Math.abs(Math.round(x)-b)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(p),y,b),e.drawImage(t,n,i,o,s,0,0,w,S),e.setTransform(h,d,f,p,g,m),[w,S]}if(0===h&&0===p){const r=l*f+g,y=Math.round(r),v=a*d+m,b=Math.round(v),_=(l+u)*f+g,w=Math.abs(Math.round(_)-y)||1,x=(a+c)*d+m,S=Math.abs(Math.round(x)-b)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,y,b),e.drawImage(t,n,i,o,s,0,0,S,w),e.setTransform(h,d,f,p,g,m),[S,w]}return e.drawImage(t,n,i,o,s,a,l,c,u),[Math.hypot(h,d)*c,Math.hypot(f,p)*u]}class f{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.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=i.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,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=i.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=i.Util.applyTransform(t,e),r=i.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],r[0]),this.minY=Math.min(this.minY,n[1],r[1]),this.maxX=Math.max(this.maxX,n[0],r[0]),this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(e,t){i.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,o,s,a,l,c,u){const h=i.Util.bezierBoundingBox(t,n,r,o,s,a,l,c);if(u)return u[0]=Math.min(u[0],h[0],h[2]),u[1]=Math.max(u[1],h[0],h[2]),u[2]=Math.min(u[2],h[1],h[3]),void(u[3]=Math.max(u[3],h[1],h[3]));this.updateRectMinMax(e,h)}getPathBoundingBox(e=o.PathType.FILL,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===o.PathType.STROKE){t||(0,i.unreachable)("Stroke bounding box must include transform.");const e=i.Util.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,o=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=o,n[2]+=r,n[3]+=o}return n}updateClipFromPath(){const e=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=o.PathType.FILL,t=null){return i.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function p(e,t,n=null){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const r=t.height,o=t.width,s=r%u,a=(r-s)/u,l=0===s?a:a+1,c=e.createImageData(o,u);let h,d=0;const f=t.data,p=c.data;let g,m,y,v,b,_,w,x;if(n)switch(n.length){case 1:b=n[0],_=n[0],w=n[0],x=n[0];break;case 4:b=n[0],_=n[1],w=n[2],x=n[3]}if(t.kind===i.ImageKind.GRAYSCALE_1BPP){const t=f.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),r=n.length,v=o+7>>3;let b=4294967295,_=i.FeatureTest.isLittleEndian?4278190080:255;for(x&&255===x[0]&&0===x[255]&&([b,_]=[_,b]),g=0;gv?o:8*e-7,s=-8&i;let a=0,l=0;for(;r>=1}for(;h=a&&(y=s,v=o*y),h=0,m=v;m--;)p[h++]=f[d++],p[h++]=f[d++],p[h++]=f[d++],p[h++]=255;if(t)for(let e=0;e>8,e[o-2]=e[o-2]*i+n*s>>8,e[o-1]=e[o-1]*i+r*s>>8}}}function b(e,t,n){const r=e.length,i=1/255;for(let o=3;o>8]>>8:t[i]*r>>16}}function w(e,t){const n=i.Util.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const o=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:n[0]<=o||n[1]<=o}const x=["butt","round","square"],S=["miter","round","bevel"],E={},C={};class k{constructor(e,t,n,r,i,o,s,a){this.ctx=e,this.current=new f(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.imageLayer=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=[],this.optionalContentConfig=o,this.cachedCanvases=new h(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=a?.background||null,this.foregroundColor=a?.foreground||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){const o=this.ctx.canvas.width,s=this.ctx.canvas.height,a=i||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const e=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const t=this.backgroundColor=this.ctx.fillStyle;let n=!0,i=a;if(this.ctx.fillStyle=a,i=this.ctx.fillStyle,n="string"==typeof i&&/^#[0-9A-Fa-f]{6}$/.test(i),"#000000"===e&&"#ffffff"===t||e===t||!n)this.foregroundColor=this.backgroundColor=null;else{const[n,o,s]=(0,r.getRGB)(i),a=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,l=Math.round(.2126*a(n)+.7152*a(o)+.0722*a(s));this.selectColor=(n,r,i)=>{const o=.2126*a(n)+.7152*a(r)+.0722*a(i);return Math.round(o)===l?t:e}}}if(this.ctx.fillStyle=this.backgroundColor||a,this.ctx.fillRect(0,0,o,s),this.ctx.restore(),n){const e=this.cachedCanvases.getCanvas("transparent",o,s);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),y(this.ctx,this.foregroundColor),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,r.getCurrentTransform)(this.ctx),this.imageLayer&&((0,r.deprecated)("The `imageLayer` functionality will be removed in the future."),this.imageLayer.beginLayout())}executeOperatorList(e,t,n,r){const o=e.argsArray,s=e.fnArray;let a=t||0;const l=o.length;if(l===a)return a;const c=l-a>10&&"function"==typeof n,u=c?Date.now()+15:0;let h=0;const d=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==r&&a===r.nextBreakPoint)return r.breakIt(a,n),a;if(p=s[a],p!==i.OPS.dependency)this[p].apply(this,o[a]);else for(const e of o[a]){const t=e.startsWith("g_")?d:f;if(!t.has(e))return t.get(e,n),a}if(a++,a===l)return a;if(c&&++h>10){if(Date.now()>u)return n(),a;h=0}}}#Z(){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)}endDrawing(){this.#Z(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(e,t){const n=e.width,r=e.height;let i,o,s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=r,u="prescale1";for(;s>2&&l>1||a>2&&c>1;){let t=l,n=c;s>2&&l>1&&(t=Math.ceil(l/2),s/=l/t),a>2&&c>1&&(n=Math.ceil(c/2),a/=c/n),i=this.cachedCanvases.getCanvas(u,t,n),o=i.context,o.clearRect(0,0,t,n),o.drawImage(e,0,0,l,c,0,0,t,n),e=i.canvas,l=t,c=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:s}=e,a=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(t);let u,h,f,p;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer,n=c.slice(0,4);h=JSON.stringify(l?n:[n,a]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const r=u.get(h);if(r&&!l)return{canvas:r,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};f=r}f||(p=this.cachedCanvases.getCanvas("maskCanvas",n,s),g(p.context,e));let m=i.Util.transform(c,[1/n,0,0,-1/s,0,0]);m=i.Util.transform(m,[1,0,0,1,0,-s]);const y=i.Util.applyTransform([0,0],m),v=i.Util.applyTransform([n,s],m),b=i.Util.normalizeRect([y[0],y[1],v[0],v[1]]),_=Math.round(b[2]-b[0])||1,x=Math.round(b[3]-b[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",_,x),E=S.context,C=Math.min(y[0],v[0]),k=Math.min(y[1],v[1]);E.translate(-C,-k),E.transform(...m),f||(f=this._scaleImage(p.canvas,(0,r.getCurrentTransformInverse)(E)),f=f.img,u&&l&&u.set(h,f)),E.imageSmoothingEnabled=w((0,r.getCurrentTransform)(E),e.interpolate),d(E,f,0,0,f.width,f.height,0,0,n,s),E.globalCompositeOperation="source-in";const P=i.Util.transform((0,r.getCurrentTransformInverse)(E),[1,0,0,1,-C,-k]);return E.fillStyle=l?a.getPattern(t,this,P,o.PathType.FILL):a,E.fillRect(0,0,n,s),u&&!l&&(this.cachedCanvases.delete("fillCanvas"),u.set(h,S.canvas)),{canvas:S.canvas,offsetX:Math.round(C),offsetY:Math.round(k)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=x[e]}setLineJoin(e){this.ctx.lineJoin=S[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let t=0,n=e.length;t{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,o,s){t.transform(e,n,r,i,o,s),this.__originalTransform(e,n,r,i,o,s)},e.setTransform=function(e,n,r,i,o,s){t.setTransform(e,n,r,i,o,s),this.__originalSetTransform(e,n,r,i,o,s)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,o,s){t.bezierCurveTo(e,n,r,i,o,s),this.__originalBezierCurveTo(e,n,r,i,o,s)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(o,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),m(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;(function(e,t,n,r){const i=r[0],o=r[1],s=r[2]-i,a=r[3]-o;0!==s&&0!==a&&(function(e,t,n,r,i,o,s,a,l,c,u){const h=!!o,d=h?o[0]:0,f=h?o[1]:0,p=h?o[2]:0;let g;g="Luminosity"===i?_:b;const m=Math.min(r,Math.ceil(1048576/n));for(let i=0;i100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${a} ${s} ${c}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,o){this.current.textMatrix=[e,t,n,r,i,o],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,o){const s=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,u=a.fontSize/a.fontSizeScale,h=c&i.TextRenderingMode.FILL_STROKE_MASK,d=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),f=a.patternFill&&!l.missingFile;let p;(l.disableFontFace||d||f)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||f?(s.save(),s.translate(t,n),s.beginPath(),p(s,u),o&&s.setTransform(...o),h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||s.fill(),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||s.fillText(e,t,n),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||s.strokeText(e,t,n)),d&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,r.getCurrentTransform)(s),x:t,y:n,fontSize:u,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e0&&t[e]<255){n=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const s=t.fontSize;if(0===s)return;const a=this.ctx,l=t.fontSizeScale,c=t.charSpacing,u=t.wordSpacing,h=t.fontDirection,d=t.textHScale*h,f=e.length,p=n.vertical,g=p?1:-1,m=n.defaultVMetrics,y=s*t.fontMatrix[0],v=t.textRenderingMode===i.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(a.save(),a.transform(...t.textMatrix),a.translate(t.x,t.y+t.textRise),h>0?a.scale(d,-1):a.scale(d,1),t.patternFill){a.save();const e=t.fillColor.getPattern(a,this,(0,r.getCurrentTransformInverse)(a),o.PathType.FILL);b=(0,r.getCurrentTransform)(a),a.restore(),a.fillStyle=e}let _=t.lineWidth;const w=t.textMatrixScale;if(0===w||0===_){const e=t.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;e!==i.TextRenderingMode.STROKE&&e!==i.TextRenderingMode.FILL_STROKE||(_=this.getSinglePixelWidth())}else _/=w;1!==l&&(a.scale(l,l),_/=l),a.lineWidth=_;let x,S=0;for(x=0;x0){const e=1e3*a.measureText(o).width/s*l;if(Enew k(e,this.commonObjs,this.objs,this.canvasFactory)};t=new o.TilingPattern(e,n,this.ctx,s,i)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const r=this.selectColor?.(e,t,n)||i.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,t,n){const r=this.selectColor?.(e,t,n)||i.Util.makeHexColor(e,t,n);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=(0,o.getShadingPattern)(this.objs.get(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),o.PathType.SHADING);const s=(0,r.getCurrentTransformInverse)(t);if(s){const e=t.canvas,n=e.width,r=e.height,o=i.Util.applyTransform([0,0],s),a=i.Util.applyTransform([0,r],s),l=i.Util.applyTransform([n,0],s),c=i.Util.applyTransform([n,r],s),u=Math.min(o[0],a[0],l[0],c[0]),h=Math.min(o[1],a[1],l[1],c[1]),d=Math.max(o[0],a[0],l[0],c[0]),f=Math.max(o[1],a[1],l[1],c[1]);this.ctx.fillRect(u,h,d-u,f-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,r.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,i.info)("TODO: Support non-isolated groups."),e.knockout&&(0,i.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=i.Util.getAxialAlignedBoundingBox(e.bbox,(0,r.getCurrentTransform)(t));const s=[0,0,t.canvas.width,t.canvas.height];o=i.Util.intersect(o,s)||[0,0,0,0];const a=Math.floor(o[0]),c=Math.floor(o[1]);let u=Math.max(Math.ceil(o[2])-a,1),h=Math.max(Math.ceil(o[3])-c,1),d=1,f=1;u>l&&(d=u/l,u=l),h>l&&(f=h/l,h=l),this.current.startNewPathAndClipBox([0,0,u,h]);let p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(p,u,h),y=g.context;y.scale(1/d,1/f),y.translate(-a,-c),y.transform(...n),e.smask?this.smaskStack.push({canvas:g.canvas,context:y,offsetX:a,offsetY:c,scaleX:d,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,c),t.scale(d,f),t.save()),m(t,y),this.ctx=y,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,r.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=i.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,o,s){if(this.#Z(),y(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const o=t[2]-t[0],a=t[3]-t[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=o,t[3]=a;const[s,l]=i.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),h=Math.ceil(a*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,h);const{canvas:d,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.setTransform(s,0,0,-l,0,a*l),y(this.ctx,this.foregroundColor)}else y(this.ctx,this.foregroundColor),this.ctx.rect(t[0],t[1],o,a),this.ctx.clip(),this.endPath()}this.current=new f(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){const{width:t,height:n}=e;if(t>c||n>c)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let o,s,a,l=new Uint8Array(i*(n+1));const u=t+7&-8;let h=new Uint8Array(u*n),d=0;for(const t of e.data){let e=128;for(;e>0;)h[d++]=t&e?0:255,e>>=1}let f=0;for(d=0,0!==h[d]&&(l[0]=1,++f),s=1;s>2)+(h[d+1]?4:0)+(h[d-u+1]?8:0),r[e]&&(l[a+s]=r[e],++f),d++;if(h[d-u]!==h[d]&&(l[a+s]=h[d]?2:4,++f),f>1e3)return null}for(d=u*(n-1),a=o*i,0!==h[d]&&(l[a]=8,++f),s=1;s1e3)return null;const p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),g=new Path2D;for(o=0;f&&o<=n;o++){let e=o*i;const n=e+t;for(;e>4,l[e]&=s>>2|s<<2),g.lineTo(e%i,e/i|0),l[e]||--f}while(r!==e);--o}return h=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(g),e.beginPath(),e.restore()}}(e)),r.compiled))return void r.compiled(n);const i=this._createMaskCanvas(e),o=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,o=0,s,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(t,n,o,s,0,0);const u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,0,0);for(let e=0,r=a.length;et?s/t:1,i=o>t?o/t:1}}this._cachedScaleForStroking=[n,i]}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[i,o]=this.getScaleForStroking();if(t.lineWidth=n||1,1===i&&1===o)return void t.stroke();let s,a,l;e&&(s=(0,r.getCurrentTransform)(t),a=t.getLineDash().slice(),l=t.lineDashOffset),t.scale(i,o);const c=Math.max(i,o);t.setLineDash(t.getLineDash().map((e=>e/c))),t.lineDashOffset/=c,t.stroke(),e&&(t.setTransform(...s),t.setLineDash(a),t.lineDashOffset=l)}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=k;for(const e in i.OPS)void 0!==k.prototype[e]&&(k.prototype[i.OPS[e]]=k.prototype[e])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new c(e);case"Mesh":return new d(e);case"Dummy":return new f}throw new Error(`Unknown IR type: ${e[0]}`)};var r=n(1),i=n(8),o=n(3);const s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(e,t){if(!t||o.isNodeJS)return;const n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}t.PathType=s;class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class c extends l{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,o){let l;if(o===s.STROKE||o===s.FILL){const s=t.current.getClippedPathBoundingBox(o,(0,i.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(s[2]-s[0])||1,u=Math.ceil(s[3]-s[1])||1,h=t.cachedCanvases.getCanvas("pattern",c,u,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),n=r.Util.transform(n,[1,0,0,1,s[0],s[1]]),d.transform(...t.baseTransform),this.matrix&&d.transform(...this.matrix),a(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),l=e.createPattern(h.canvas,"no-repeat");const f=new DOMMatrix(n);try{l.setTransform(f)}catch(e){(0,r.warn)(`RadialAxialShadingPattern.getPattern: "${e?.message}".`)}}else a(e,this._bbox),l=this._createGradient(e);return l}}function u(e,t,n,r,i,o,s,a){const l=t.coords,c=t.colors,u=e.data,h=4*e.width;let d;l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=o,o=s,s=d),l[r+1]>l[i+1]&&(d=r,r=i,i=d,d=s,s=a,a=d),l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=o,o=s,s=d);const f=(l[n]+t.offsetX)*t.scaleX,p=(l[n+1]+t.offsetY)*t.scaleY,g=(l[r]+t.offsetX)*t.scaleX,m=(l[r+1]+t.offsetY)*t.scaleY,y=(l[i]+t.offsetX)*t.scaleX,v=(l[i+1]+t.offsetY)*t.scaleY;if(p>=v)return;const b=c[o],_=c[o+1],w=c[o+2],x=c[s],S=c[s+1],E=c[s+2],C=c[a],k=c[a+1],P=c[a+2],A=Math.round(p),T=Math.round(v);let R,O,M,I,D,F,L,N;for(let e=A;e<=T;e++){if(ev?1:m===v?0:(m-e)/(m-v),R=g-(g-y)*t,O=x-(x-C)*t,M=S-(S-k)*t,I=E-(E-P)*t}let t;t=ev?1:(p-e)/(p-v),D=f-(f-y)*t,F=b-(b-C)*t,L=_-(_-k)*t,N=w-(w-P)*t;const n=Math.round(Math.min(R,D)),r=Math.round(Math.max(R,D));let i=h*e+4*n;for(let e=n;e<=r;e++)t=(R-e)/(R-D),t<0?t=0:t>1&&(t=1),u[i++]=O-(O-F)*t|0,u[i++]=M-(M-L)*t|0,u[i++]=I-(I-N)*t|0,u[i++]=255}}function h(e,t,n){const r=t.coords,i=t.colors;let o,s;switch(t.type){case"lattice":const a=t.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(o=0;o=r?i=r:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,r,o){const s=r-t,a=o-n;e.ctx.rect(t,n,s,a),e.current.updateRectMinMax((0,i.getCurrentTransform)(e.ctx),[t,n,r,o]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,o=e.current;switch(t){case 1:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,o.fillColor=e.fillStyle,o.strokeColor=e.strokeStyle;break;case 2:const s=r.Util.makeHexColor(n[0],n[1],n[2]);i.fillStyle=s,i.strokeStyle=s,o.fillColor=s,o.strokeColor=s;break;default:throw new r.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,i){let o=n;i!==s.SHADING&&(o=r.Util.transform(o,t.baseTransform),this.matrix&&(o=r.Util.transform(o,this.matrix)));const a=this.createPatternCanvas(t);let l=new DOMMatrix(o);l=l.translate(a.offsetX,a.offsetY),l=l.scale(1/a.scaleX,1/a.scaleY);const c=e.createPattern(a.canvas,"repeat");try{c.setTransform(l)}catch(e){(0,r.warn)(`TilingPattern.getPattern: "${e?.message}".`)}return c}}t.TilingPattern=p},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.applyMaskImageData=function({src:e,srcPos:t=0,dest:n,destPos:i=0,width:o,height:s,inverseDecode:a=!1}){const l=r.FeatureTest.isLittleEndian?4278190080:255,[c,u]=a?[0,l]:[l,0],h=o>>3,d=7&o,f=e.length;n=new Uint32Array(n.buffer);for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(1);function i(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,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=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(i(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,o=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){n.postMessage({sourceName:e,targetName:o,callback:1,callbackId:t.callbackId,data:r})}),(function(r){n.postMessage({sourceName:e,targetName:o,callback:2,callbackId:t.callbackId,reason:i(r)})}))}else t.streamId?this._createStreamSink(t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const i=this.callbackId++,o=(0,r.createPromiseCapability)();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(e){o.reject(e)}return o.promise}sendWithStream(e,t,n,o){const s=this.streamId++,a=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const i=(0,r.createPromiseCapability)();return this.streamControllers[s]={controller:n,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:l,action:e,streamId:s,data:t,desiredSize:n.desiredSize},o),i.promise},pull:e=>{const t=(0,r.createPromiseCapability)();return this.streamControllers[s].pullCall=t,c.postMessage({sourceName:a,targetName:l,stream:6,streamId:s,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();return this.streamControllers[s].cancelCall=t,this.streamControllers[s].isClosed=!0,c.postMessage({sourceName:a,targetName:l,stream:1,streamId:s,reason:i(e)}),t.promise}},n)}_createStreamSink(e){const t=e.streamId,n=this.sourceName,o=e.sourceName,s=this.comObj,a=this,l=this.actionHandler[e.action],c={enqueue(e,i=1,a){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=i,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,r.createPromiseCapability)(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:n,targetName:o,stream:4,streamId:t,chunk:e},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:o,stream:3,streamId:t}),delete a.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:o,stream:5,streamId:t,reason:i(e)}))},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[t]=c,new Promise((function(t){t(l(e.data,c))})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:8,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:8,streamId:t,reason:i(e)})}))}_processStreamMessage(e){const t=e.streamId,n=this.sourceName,o=e.sourceName,s=this.comObj,a=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case 8:e.success?a.startCall.resolve():a.startCall.reject(i(e.reason));break;case 7:e.success?a.pullCall.resolve():a.pullCall.reject(i(e.reason));break;case 6:if(!l){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,new Promise((function(e){e(l.onPull&&l.onPull())})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,reason:i(e)})}));break;case 4:if((0,r.assert)(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case 3:if((0,r.assert)(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this._deleteStreamController(a,t);break;case 5:(0,r.assert)(a,"error should have stream controller"),a.controller.error(i(e.reason)),this._deleteStreamController(a,t);break;case 2:e.success?a.cancelCall.resolve():a.cancelCall.reject(i(e.reason)),this._deleteStreamController(a,t);break;case 1:if(!l)break;new Promise((function(t){t(l.onCancel&&l.onCancel(i(e.reason)))})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:2,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:2,streamId:t,reason:i(e)})})),l.sinkCapability.reject(i(e.reason)),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1);t.Metadata=class{#Q;#J;constructor({parsedData:e,rawData:t}){this.#Q=e,this.#J=t}getRaw(){return this.#J}get(e){return this.#Q.get(e)??null}getAll(){return(0,r.objectFromMap)(this.#Q)}has(e){return this.#Q.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1);const i=Symbol("INTERNAL");class o{#ee=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#ee}_setVisible(e,t){e!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#ee=t}}t.OptionalContentConfig=class{#te=!0;#ne=new Map;#re=null;#ie=null;constructor(e){if(this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#ie=e.order;for(const t of e.groups)this.#ne.set(t.id,new o(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#ne.values())e._setVisible(i,!1);for(const t of e.on)this.#ne.get(t)._setVisible(i,!0);for(const t of e.off)this.#ne.get(t)._setVisible(i,!1);this.#re=new Map;for(const[e,t]of this.#ne)this.#re.set(e,t.visible)}}#oe(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i0?(0,r.objectFromMap)(this.#ne):null}getGroup(e){return this.#ne.get(e)||null}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(1),i=n(8);t.PDFDataTransportStream=class{constructor(e,t){(0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1,this._contentDispositionFilename=e.contentDispositionFilename||null;const n=e.initialData;if(n?.length>0){const e=new Uint8Array(n).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const n=this._rangeReaders.some((function(n){return n._begin===e.begin&&(n._enqueue(t),!0)}));(0,r.assert)(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t?.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t?.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new o(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class o{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=(0,i.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){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 s{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){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,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){if(!r)return;let i=null;const o=r.name;if("#text"===o)i=r.value;else{if(!n.shouldBuildText(o))return;r?.attributes?.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(null!==i&&t.push({str:i}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var r=n(9);const i=function(e){return new Promise(((t,n)=>{__webpack_require__(3237).readFile(e,((e,r)=>{!e&&r?t(new Uint8Array(r)):n(new Error(e))}))}))};class o extends r.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(7640).createCanvas(e,t)}}t.NodeCanvasFactory=o;class s extends r.BaseCMapReaderFactory{_fetchData(e,t){return i(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=s;class a extends r.BaseStandardFontDataFactory{_fetchData(e){return i(e)}}t.NodeStandardFontDataFactory=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(7),i=n(1),o=n(23),s=n(24);class a{#se;#ae=!1;#le=this.pointerup.bind(this);#ce=this.pointerdown.bind(this);#ue=new Map;#he=!1;#de=!1;#fe;static _initialized=!1;constructor(e){a._initialized||(a._initialized=!0,o.FreeTextEditor.initialize(e.l10n),s.InkEditor.initialize(e.l10n),e.uiManager.registerEditorTypes([o.FreeTextEditor,s.InkEditor])),this.#fe=e.uiManager,this.annotationStorage=e.annotationStorage,this.pageIndex=e.pageIndex,this.div=e.div,this.#se=e.accessibilityManager,this.#fe.addLayer(this)}updateToolbar(e){this.#fe.updateToolbar(e)}updateMode(e=this.#fe.getMode()){this.#pe(),e===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#fe.unselectAll()}addInkEditorIfNeeded(e){if(e||this.#fe.getMode()===i.AnnotationEditorType.INK){if(!e)for(const e of this.#ue.values())if(e.isEmpty())return void e.setInBackground();this.#ge({offsetX:0,offsetY:0}).setInBackground()}}setEditingState(e){this.#fe.setEditingState(e)}addCommands(e){this.#fe.addCommands(e)}enable(){this.div.style.pointerEvents="auto";for(const e of this.#ue.values())e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const e of this.#ue.values())e.disableEditing()}setActiveEditor(e){this.#fe.getActive()!==e&&this.#fe.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#ce),this.div.addEventListener("pointerup",this.#le)}disableClick(){this.div.removeEventListener("pointerdown",this.#ce),this.div.removeEventListener("pointerup",this.#le)}attach(e){this.#ue.set(e.id,e)}detach(e){this.#ue.delete(e.id),this.#se?.removePointerInTextLayer(e.contentDiv)}remove(e){this.#fe.removeEditor(e),this.detach(e),this.annotationStorage.remove(e.id),e.div.style.display="none",setTimeout((()=>{e.div.style.display="",e.div.remove(),e.isAttachedToDOM=!1,document.activeElement===document.body&&this.#fe.focusMainContainer()}),0),this.#de||this.addInkEditorIfNeeded(!1)}#me(e){e.parent!==this&&(this.attach(e),e.pageIndex=this.pageIndex,e.parent?.detach(e),e.parent=this,e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.#me(e),this.#fe.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}this.moveEditorInDOM(e),e.onceAdded(),this.addToAnnotationStorage(e)}moveEditorInDOM(e){this.#se?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addToAnnotationStorage(e){e.isEmpty()||this.annotationStorage.has(e.id)||this.annotationStorage.setValue(e.id,e)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addANewEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!0})}addUndoableEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#fe.getId()}#ye(e){switch(this.#fe.getMode()){case i.AnnotationEditorType.FREETEXT:return new o.FreeTextEditor(e);case i.AnnotationEditorType.INK:return new s.InkEditor(e)}return null}deserialize(e){switch(e.annotationType){case i.AnnotationEditorType.FREETEXT:return o.FreeTextEditor.deserialize(e,this);case i.AnnotationEditorType.INK:return s.InkEditor.deserialize(e,this)}return null}#ge(e){const t=this.getNextId(),n=this.#ye({parent:this,id:t,x:e.offsetX,y:e.offsetY});return n&&this.add(n),n}setSelected(e){this.#fe.setSelected(e)}toggleSelected(e){this.#fe.toggleSelected(e)}isSelected(e){return this.#fe.isSelected(e)}unselect(e){this.#fe.unselect(e)}pointerup(e){const t=r.KeyboardManager.platform.isMac;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#he&&(this.#he=!1,this.#ae?this.#ge(e):this.#ae=!0)}pointerdown(e){const t=r.KeyboardManager.platform.isMac;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#he=!0;const n=this.#fe.getActive();this.#ae=!n||n.isEmpty()}drop(e){const t=e.dataTransfer.getData("text/plain"),n=this.#fe.getEditor(t);if(!n)return;e.preventDefault(),e.dataTransfer.dropEffect="move",this.#me(n);const r=this.div.getBoundingClientRect(),i=e.clientX-r.x,o=e.clientY-r.y;n.translate(i-n.startX,o-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(e){e.preventDefault()}destroy(){this.#fe.getActive()?.parent===this&&this.#fe.setActiveEditor(null);for(const e of this.#ue.values())this.#se?.removePointerInTextLayer(e.contentDiv),e.isAttachedToDOM=!1,e.div.remove(),e.parent=null;this.div=null,this.#ue.clear(),this.#fe.removeLayer(this)}#pe(){this.#de=!0;for(const e of this.#ue.values())e.isEmpty()&&e.remove();this.#de=!1}render(e){this.viewport=e.viewport,(0,r.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions();for(const e of this.#fe.getEditors(this.pageIndex))this.add(e);this.updateMode()}update(e){this.viewport=e.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[e,t,n,r]=this.viewport.viewBox;return[n-e,r-t]}get viewportBaseDimensions(){const{width:e,height:t,rotation:n}=this.viewport;return n%180==0?[e,t]:[t,e]}setDimensions(){const{width:e,height:t,rotation:n}=this.viewport,r=n%180!=0,i=Math.floor(e)+"px",o=Math.floor(t)+"px";this.div.style.width=r?o:i,this.div.style.height=r?i:o,this.div.setAttribute("data-main-rotation",n)}}t.AnnotationEditorLayer=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var r=n(1),i=n(7),o=n(6);class s extends o.AnnotationEditor{#ve=this.editorDivBlur.bind(this);#be=this.editorDivFocus.bind(this);#_e=this.editorDivKeydown.bind(this);#we;#xe="";#Se=!1;#Ee;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new i.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],s.prototype.commitOrRemove]]);static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#we=e.color||s._defaultColor||o.AnnotationEditor._defaultLineColor,this.#Ee=e.fontSize||s._defaultFontSize}static initialize(e){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_aria_label"].map((t=>[t,e.get(t)])));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:s._defaultFontSize=t;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:s._defaultColor=t}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ce(t);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#ke(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,s._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,s._defaultColor||o.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#Ee],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#we]]}#Ce(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#Ee)*this.parent.scaleFactor),this.#Ee=e,this.#Pe()},n=this.#Ee;this.parent.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ke(e){const t=this.#we;this.parent.addCommands({cmd:()=>{this.#we=e,this.editorDiv.style.color=e},undo:()=>{this.#we=t,this.editorDiv.style.color=t},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){return[-s._internalPadding*this.parent.scaleFactor,-(s._internalPadding+this.#Ee)*this.parent.scaleFactor]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.enableEditing(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.editorDiv.addEventListener("keydown",this.#_e),this.editorDiv.addEventListener("focus",this.#be),this.editorDiv.addEventListener("blur",this.#ve))}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",this.#_e),this.editorDiv.removeEventListener("focus",this.#be),this.editorDiv.removeEventListener("blur",this.#ve),this.div.focus(),this.isEditing=!1)}focusin(e){super.focusin(e),e.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()}#Ae(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(let n=0,r=e.length;nthis.editorDiv?.setAttribute("aria-label",e))),s._l10nPromise.get("free_text_default_content").then((e=>this.editorDiv?.setAttribute("default-content",e))),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#Ee}px * var(--scale-factor))`,n.color=this.#we,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parent.viewportBaseDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r);for(const e of this.#xe.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}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(e,t){const n=super.deserialize(e,t);return n.#Ee=e.fontSize,n.#we=r.Util.makeHexColor(...e.color),n.#xe=e.value,n}serialize(){if(this.isEmpty())return null;const e=s._internalPadding*this.parent.scaleFactor,t=this.getRect(e,e),n=o.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#Ee,value:this.#xe,pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}t.FreeTextEditor=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return o.fitCurve}});var r=n(1),i=n(6),o=n(25),s=n(7);const a=16;class l extends i.AnnotationEditor{#Te=0;#Re=0;#Oe=0;#Me=this.canvasPointermove.bind(this);#Ie=this.canvasPointerleave.bind(this);#De=this.canvasPointerup.bind(this);#Fe=this.canvasPointerdown.bind(this);#Le=!1;#Ne=!1;#je=null;#ze=null;#Be=0;#Ue=0;#Ve=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink_aria_label"].map((t=>[t,e.get(t)])))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=t;break;case r.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=t;break;case r.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=t/100}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#We(t);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#ke(t);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#$e(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#We(e){const t=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=e,this.#He()},undo:()=>{this.thickness=t,this.#He()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ke(e){const t=this.color;this.parent.addCommands({cmd:()=>{this.color=e,this.#qe()},undo:()=>{this.color=t,this.#qe()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#$e(e){e/=100;const t=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=e,this.#qe()},undo:()=>{this.opacity=t,this.#qe()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#Ge(),this.#Xe()),this.isAttachedToDOM||(this.parent.add(this),this.#Ye()),this.#He())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#ze.disconnect(),this.#ze=null,super.remove())}enableEditMode(){this.#Le||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#Fe),this.canvas.addEventListener("pointerup",this.#De))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Fe),this.canvas.removeEventListener("pointerup",this.#De))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Ke(){const{width:e,height:t,rotation:n}=this.parent.viewport;switch(n){case 90:return[0,e,e,t];case 180:return[e,t,e,t];case 270:return[t,0,e,t];default:return[0,0,e,t]}}#Ze(){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,s.opacityToHex)(this.opacity)}`}#Qe(e,t){this.isEditing=!0,this.#Ne||(this.#Ne=!0,this.#Ye(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||i.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([e,t]),this.#je=null,this.#Ze(),this.ctx.beginPath(),this.ctx.moveTo(e,t),this.#Ve=()=>{this.#Ve&&(this.#je&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):this.#qe(),this.ctx.lineTo(...this.#je),this.#je=null,this.ctx.stroke()),window.requestAnimationFrame(this.#Ve))},window.requestAnimationFrame(this.#Ve)}#Je(e,t){const[n,r]=this.currentPath.at(-1);e===n&&t===r||(this.currentPath.push([e,t]),this.#je=[e,t])}#et(e,t){this.ctx.closePath(),this.#Ve=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height);const[n,r]=this.currentPath.at(-1);let i;if(e===n&&t===r||this.currentPath.push([e,t]),1!==this.currentPath.length)i=(0,o.fitCurve)(this.currentPath,30,null);else{const n=[e,t];i=[[n,n.slice(),n.slice(),n]]}const s=l.#tt(i);this.currentPath.length=0,this.parent.addCommands({cmd:()=>{this.paths.push(i),this.bezierPath2D.push(s),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Ge(),this.#Xe()),this.#He())},mustExec:!0})}#qe(){if(this.isEmpty())return void this.#nt();this.#Ze();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#nt();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#Le||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Le=!0,this.div.classList.add("disabled"),this.#He(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus())}focusin(e){super.focusin(e),this.enableEditMode()}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#Le&&(this.setInForeground(),"mouse"!==e.type&&this.div.focus(),e.stopPropagation(),this.canvas.addEventListener("pointerleave",this.#Ie),this.canvas.addEventListener("pointermove",this.#Me),this.#Qe(e.offsetX,e.offsetY))}canvasPointermove(e){e.stopPropagation(),this.#Je(e.offsetX,e.offsetY)}canvasPointerup(e){0===e.button&&this.isInEditMode()&&0!==this.currentPath.length&&(e.stopPropagation(),this.#rt(e),this.setInBackground())}canvasPointerleave(e){this.#rt(e),this.setInBackground()}#rt(e){this.#et(e.offsetX,e.offsetY),this.canvas.removeEventListener("pointerleave",this.#Ie),this.canvas.removeEventListener("pointermove",this.#Me),this.parent.addToAnnotationStorage(this)}#Ge(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>this.canvas?.setAttribute("aria-label",e))),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Xe(){this.#ze=new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)})),this.#ze.observe(this.div)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),l._l10nPromise.get("editor_ink_aria_label").then((e=>this.div?.setAttribute("aria-label",e)));const[n,r,i,o]=this.#Ke();if(this.setAt(n,r,0,0),this.setDims(i,o),this.#Ge(),this.width){const[n,r]=this.parent.viewportBaseDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this.#Ne=!0,this.#Ye(),this.setDims(this.width*n,this.height*r),this.#qe(),this.#it(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#Xe(),this.div}#Ye(){if(!this.#Ne)return;const[e,t]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#nt()}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if(this.#Be===n&&this.#Ue===r)return;this.#Be=n,this.#Ue=r,this.canvas.style.visibility="hidden",this.#Te&&Math.abs(this.#Te-e/t)>.01&&(t=Math.ceil(e/this.#Te),this.setDims(e,t));const[i,o]=this.parent.viewportBaseDimensions;this.width=e/i,this.height=t/o,this.#Le&&this.#ot(e,t),this.#Ye(),this.#qe(),this.canvas.style.visibility="visible"}#ot(e,t){const n=this.#st(),r=(e-n)/this.#Oe,i=(t-n)/this.#Re;this.scaleFactor=Math.min(r,i)}#nt(){const e=this.#st()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#tt(e){const t=new Path2D;for(let n=0,r=e.length;n=1?(e.minHeight="16px",e.minWidth=`${Math.round(this.#Te*a)}px`):(e.minWidth="16px",e.minHeight=`${Math.round(a/this.#Te)}px`)}static deserialize(e,t){const n=super.deserialize(e,t);n.thickness=e.thickness,n.color=r.Util.makeHexColor(...e.color),n.opacity=e.opacity;const[i,o]=t.pageDimensions,s=n.width*i,l=n.height*o,c=t.scaleFactor,u=e.thickness/2;n.#Te=s/l,n.#Le=!0,n.#Be=Math.round(s),n.#Ue=Math.round(l);for(const{bezier:t}of e.paths){const e=[];n.paths.push(e);let r=c*(t[0]-u),i=c*(l-t[1]-u);for(let n=2,o=t.length;n{Object.defineProperty(t,"__esModule",{value:!0}),t.fitCurve=void 0;const r=n(26);t.fitCurve=r},e=>{function t(e,i,o,s,a){var c,u,h,d,f,p,g,m,y,v,b,_,w;if(2===e.length)return _=l.vectorLen(l.subtract(e[0],e[1]))/3,[c=[e[0],l.addArrays(e[0],l.mulItems(i,_)),l.addArrays(e[1],l.mulItems(o,_)),e[1]]];if(u=function(e){var t,n,r,i=[];return e.forEach(((e,o)=>{t=o?n+l.vectorLen(l.subtract(e,r)):0,i.push(t),n=t,r=e})),i=i.map((e=>e/n))}(e),[c,d,p]=n(e,u,u,i,o,a),0===d||d.9999&&e<1.0001)break}f=d,g=p}return b=[],(m=l.subtract(e[p-1],e[p+1])).every((e=>0===e))&&(m=l.subtract(e[p-1],e[p]),[m[0],m[1]]=[-m[1],m[0]]),y=l.normalize(m),v=l.mulItems(y,-1),(b=b.concat(t(e.slice(0,p+1),i,y,s,a))).concat(t(e.slice(p),v,o,s,a))}function n(e,t,n,r,i,a){var u,h,d;return u=function(e,t,n,r){var i,o,s,a,u,h,d,f,p,g,m,y,v,b,_,w,x,S=e[0],E=e[e.length-1];for(i=[S,null,null,E],o=l.zeros_Xx2x2(t.length),v=0,b=t.length;vi&&(i=r,a=h);return[i,a]}(e,u,t),a&&a({bez:u,points:e,params:t,maxErr:h,maxPoint:d}),[u,h,d]}function r(e,t,n){return n.map(((n,r)=>i(e,t[r],n)))}function i(e,t,n){var r=l.subtract(c.q(e,n),t),i=c.qprime(e,n),o=l.mulMatrix(r,i),s=l.sum(l.squareItems(i))+2*l.mulMatrix(r,c.qprimeprime(e,n));return 0===s?n:n-o/s}var o=function(e,t){for(var n,r=[0],i=e[0],o=0,s=1;s<=t;s++)n=c.q(e,s/t),o+=l.vectorLen(l.subtract(n,i)),r.push(o),i=n;return r.map((e=>e/o))};function s(e,t,n,r){if(t<0)return 0;if(t>1)return 1;for(var i,o,s,a,l=1;l<=r;l++)if(t<=n[l]){s=(l-1)/r,o=l/r,a=(t-(i=n[l-1]))/(n[l]-i)*(o-s)+s;break}return a}function a(e,t){return l.normalize(l.subtract(e,t))}class l{static zeros_Xx2x2(e){for(var t=[];e--;)t.push([0,0]);return t}static mulItems(e,t){return e.map((e=>e*t))}static mulMatrix(e,t){return e.reduce(((e,n,r)=>e+n*t[r]),0)}static subtract(e,t){return e.map(((e,n)=>e-t[n]))}static addArrays(e,t){return e.map(((e,n)=>e+t[n]))}static addItems(e,t){return e.map((e=>e+t))}static sum(e){return e.reduce(((e,t)=>e+t))}static dot(e,t){return l.mulMatrix(e,t)}static vectorLen(e){return Math.hypot(...e)}static divItems(e,t){return e.map((e=>e/t))}static squareItems(e){return e.map((e=>e*e))}static normalize(e){return this.divItems(e,this.vectorLen(e))}}class c{static q(e,t){var n=1-t,r=l.mulItems(e[0],n*n*n),i=l.mulItems(e[1],3*n*n*t),o=l.mulItems(e[2],3*n*t*t),s=l.mulItems(e[3],t*t*t);return l.addArrays(l.addArrays(r,i),l.addArrays(o,s))}static qprime(e,t){var n=1-t,r=l.mulItems(l.subtract(e[1],e[0]),3*n*n),i=l.mulItems(l.subtract(e[2],e[1]),6*n*t),o=l.mulItems(l.subtract(e[3],e[2]),3*t*t);return l.addArrays(l.addArrays(r,i),o)}static qprimeprime(e,t){return l.addArrays(l.mulItems(l.addArrays(l.subtract(e[2],l.mulItems(e[1],2)),e[0]),6*(1-t)),l.mulItems(l.addArrays(l.subtract(e[3],l.mulItems(e[2],2)),e[1]),6*t))}}e.exports=function(e,n,r){if(!Array.isArray(e))throw new TypeError("First argument should be an array");if(e.forEach((t=>{if(!Array.isArray(t)||t.some((e=>"number"!=typeof e))||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")})),(e=e.filter(((t,n)=>0===n||!t.every(((t,r)=>t===e[n-1][r]))))).length<2)return[];const i=e.length,o=a(e[1],e[0]),s=a(e[i-2],e[i-1]);return t(e,o,s,n,r)},e.exports.fitCubic=t,e.exports.createTangent=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var r=n(1),i=n(8),o=n(5),s=n(28),a=n(29);const l=1e3,c=new WeakSet;function u(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class h{static create(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new f(e);case r.AnnotationType.TEXT:return new p(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new m(e);case"Btn":return e.data.radioButton?new v(e):e.data.checkBox?new y(e):new b(e);case"Ch":return new _(e)}return new g(e);case r.AnnotationType.POPUP:return new w(e);case r.AnnotationType.FREETEXT:return new S(e);case r.AnnotationType.LINE:return new E(e);case r.AnnotationType.SQUARE:return new C(e);case r.AnnotationType.CIRCLE:return new k(e);case r.AnnotationType.POLYLINE:return new P(e);case r.AnnotationType.CARET:return new T(e);case r.AnnotationType.INK:return new R(e);case r.AnnotationType.POLYGON:return new A(e);case r.AnnotationType.HIGHLIGHT:return new O(e);case r.AnnotationType.UNDERLINE:return new M(e);case r.AnnotationType.SQUIGGLY:return new I(e);case r.AnnotationType.STRIKEOUT:return new D(e);case r.AnnotationType.STAMP:return new F(e);case r.AnnotationType.FILEATTACHMENT:return new L(e);default:return new d(e)}}}class d{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this._mouseState=e.mouseState,t&&(this.container=this._createContainer(n)),r&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e=!1){const t=this.data,n=this.page,i=this.viewport,o=document.createElement("section"),{width:s,height:a}=u(t.rect),[l,c,h,d]=i.viewBox,f=h-l,p=d-c;o.setAttribute("data-annotation-id",t.id);const g=r.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){o.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;o.style.borderRadius=t}else if(this instanceof v){const e=`calc(${s}px * var(--scale-factor)) / calc(${a}px * var(--scale-factor))`;o.style.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid"}const i=t.borderColor||null;i?o.style.borderColor=r.Util.makeHexColor(0|i[0],0|i[1],0|i[2]):o.style.borderWidth=0}o.style.left=100*(g[0]-l)/f+"%",o.style.top=100*(g[1]-c)/p+"%";const{rotation:m}=t;return t.hasOwnCanvas||0===m?(o.style.width=100*s/f+"%",o.style.height=100*a/p+"%"):this.setRotation(m,o),o}setRotation(e,t=this.container){const[n,r,i,o]=this.viewport.viewBox,s=i-n,a=o-r,{width:l,height:c}=u(this.data.rect);let h,d;e%180==0?(h=100*l/s,d=100*c/a):(h=100*c/s,d=100*l/a),t.style.width=`${h}%`,t.style.height=`${d}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e];n.target.style[t]=s.ColorConverters[`${r[0]}_HTML`](r.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const r of Object.keys(t.detail)){const i=e[r]||n[r];i&&i(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[r,i]of Object.entries(t)){const o=n[r];o&&(o({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(e=!1){if(!this.data.quadPoints)return null;const t=[],n=this.data.rect;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],t.push(this._createContainer(e));return this.data.rect=n,t}_createPopup(e,t){let n=this.container;this.quadrilaterals&&(e=e||this.quadrilaterals,n=this.quadrilaterals[0]),e||((e=document.createElement("div")).className="popupTriggerArea",n.append(e));const r=new x({container:n,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:!0}).render();r.style.left="100%",n.append(r)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.className=e;return this.quadrilaterals}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:e,id:o,exportValues:s}of i){if(-1===e)continue;if(o===t)continue;const i="string"==typeof s?s:null,a=document.querySelector(`[data-element-id="${o}"]`);!a||c.has(a)?n.push({id:o,exportValue:i,domElement:a}):(0,r.warn)(`_getElementsByName - element not allowed: ${o}`)}return n}for(const r of document.getElementsByName(e)){const{id:e,exportValue:i}=r;e!==t&&c.has(r)&&n.push({id:e,exportValue:i,domElement:r})}return n}static get platform(){const e="undefined"!=typeof navigator?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:e.includes("Win"),isMac:e.includes("Mac")})}}class f extends d{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((e,t)=>{const r=0===t?n:n.cloneNode();return e.append(r),e})):(this.container.className="linkAnnotation",r&&this.container.append(n),this.container)}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),e.className="internalLink"}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),e.className="internalLink",!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{n&&n();const{fields:e,refs:i,include:o}=t,s=[];if(0!==e.length||0!==i.length){const t=new Set(i);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===o&&s.push(n)}else for(const e of Object.values(this._fieldObjects))s.push(...e);const a=this.annotationStorage,l=[];for(const e of s){const{id:t}=e;switch(l.push(t),e.type){case"text":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;a.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class p extends d{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(e,this.data),this.container.append(e),this.container}}class g extends d{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(e){const{isWin:t,isMac:n}=d.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,r){t.includes("mouse")?e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e)}})}))}_setEventListeners(e,t,n){for(const[r,i]of t)("Action"===i||this.data.actions?.[i])&&this._setEventListener(e,r,i,n)}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":r.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:t}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,i=e.style;let o;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]),t=e/(Math.round(e/(r.LINE_FACTOR*n))||1);o=Math.min(n,Math.round(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]);o=Math.min(n,Math.round(e/r.LINE_FACTOR))}i.fontSize=`calc(${o}px * var(--scale-factor))`,i.color=r.Util.makeHexColor(t[0],t[1],t[2]),null!==this.data.textAlignment&&(i.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class m extends g{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const i=this.annotationStorage;for(const o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[t]=n),i.setValue(o.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let n=null;if(this.renderForms){const r=e.getValue(t,{value:this.data.fieldValue});let i=r.formattedValue||r.value||"";const o=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;o&&i.length>o&&(i=i.slice(0,o));const s={userValue:i,formattedValue:null,valueOnFocus:""};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",i),this.data.doNotScroll&&(n.style.overflowX="hidden")),c.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",(r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value")})),n.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue??"";n.value=s.userValue=t,s.formattedValue=null}));let a=e=>{const{formattedValue:t}=s;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(e=>{s.userValue&&(e.target.value=s.userValue),s.valueOnFocus=e.target.value})),n.addEventListener("updatefromsandbox",(n=>{const r={value(n){s.userValue=n.detail.value??"",e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){const{formattedValue:r}=n.detail;s.formattedValue=r,null!=r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:r}=n.detail,{target:i}=n;if(0===r)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",r);let o=s.userValue;!o||o.length<=r||(o=o.slice(0,r),i.value=s.userValue=o,e.setValue(t,{value:o}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(e=>{let n=-1;if("Escape"===e.key?n=0:"Enter"===e.key?n=2:"Tab"===e.key&&(n=3),-1===n)return;const{value:r}=e.target;s.valueOnFocus!==r&&(s.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const r=a;a=null,n.addEventListener("blur",(e=>{const{value:n}=e.target;s.userValue=n,this._mouseState.isDown&&s.valueOnFocus!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:1,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)})),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",(e=>{const{data:n,target:r}=e,{value:i,selectionStart:o,selectionEnd:s}=r;let a=o,l=s;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,o).match(/\w*[^\w]*$/);e&&(a-=e[0].length);break}case"deleteWordForward":{const e=i.substring(o).match(/^[^\w]*\w*/);e&&(l+=e[0].length);break}case"deleteContentBackward":o===s&&(a-=1);break;case"deleteContentForward":o===s&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:n||"",willCommit:!1,selStart:a,selEnd:l}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(a&&n.addEventListener("blur",a),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/o;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class y extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");return c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=l,i.addEventListener("change",(r=>{const{name:i,checked:o}=r.target;for(const r of this._getElementsByName(i,n)){const n=o&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:o})})),i.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",(t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class v extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r}));const i=document.createElement("input");if(c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.tabIndex=l,i.addEventListener("change",(t=>{const{name:r,checked:i}=t.target;for(const t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})})),i.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",(t=>{const i={value:t=>{const i=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class b extends f{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class _ extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=l;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const e of r.options)e.selected=e.value===t}));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),r.append(t)}let o=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener("input",o),o=null},r.addEventListener("input",o)}const s=(e,t)=>{const n=t?"value":"textContent",r=e.target.options;return e.target.multiple?Array.prototype.filter.call(r,(e=>e.selected)).map((e=>e[n])):-1===r.selectedIndex?null:r[r.selectedIndex][n]},a=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",(n=>{const i={value(n){o?.();const i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(const e of r.options)e.selected=a.has(e.value);e.setValue(t,{value:s(n,!0)})},multipleSelection(e){r.multiple=!0},remove(n){const i=r.options,o=n.detail.remove;i[o].selected=!1,r.remove(o),i.length>0&&-1===Array.prototype.findIndex.call(i,(e=>e.selected))&&(i[0].selected=!0),e.setValue(t,{value:s(n,!0),items:a(n)})},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]})},insert(n){const{index:i,displayValue:o,exportValue:l}=n.detail.insert,c=r.children[i],u=document.createElement("option");u.textContent=o,u.value=l,c?c.before(u):r.append(u),e.setValue(t,{value:s(n,!0),items:a(n)})},items(n){const{items:i}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of i){const{displayValue:t,exportValue:n}=e,i=document.createElement("option");i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(n,!0),items:a(n)})},indices(n){const r=new Set(n.detail.indices);for(const e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(n,!0)})},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,n)})),r.addEventListener("input",(n=>{const r=s(n,!0),i=s(n,!1);e.setValue(t,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,changeEx:r,willCommit:!0,commitKey:1,keyDown:!1}})})),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(e=>e.target.checked))):r.addEventListener("input",(function(n){e.setValue(t,{value:s(n,!0)})})),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class w extends d{constructor(e){super(e,{isRenderable:!!(e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelectorAll(e);if(0===t.length)return this.container;const n=new x({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,o=r.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),s=o[0]+this.data.parentRect[2]-this.data.parentRect[0],a=o[1],[l,c,u,h]=this.viewport.viewBox,d=u-l,f=h-c;return this.container.style.left=100*(s-l)/d+"%",this.container.style.top=100*(a-c)/f+"%",this.container.append(n.render()),this.container}}class x{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.titleObj=e.titleObj,this.modificationDate=e.modificationDate,this.contentsObj=e.contentsObj,this.richText=e.richText,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.hidden=!0;const t=document.createElement("div");t.className="popup";const n=this.color;if(n){const e=.7*(255-n[0])+n[0],i=.7*(255-n[1])+n[1],o=.7*(255-n[2])+n[2];t.style.backgroundColor=r.Util.makeHexColor(0|e,0|i,0|o)}const o=document.createElement("h1");o.dir=this.titleObj.dir,o.textContent=this.titleObj.str,t.append(o);const s=i.PDFDateString.toDateObject(this.modificationDate);if(s){const e=document.createElement("span");e.className="popupDate",e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:s.toLocaleDateString(),time:s.toLocaleTimeString()}),t.append(e)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const e=this._formatContents(this.contentsObj);t.append(e)}else a.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:t}),t.lastChild.className="richText popupContent";Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger)e.addEventListener("click",this._toggle.bind(this)),e.addEventListener("mouseover",this._show.bind(this,!1)),e.addEventListener("mouseout",this._hide.bind(this,!1));return t.addEventListener("click",this._hide.bind(this,!0)),e.append(t),e}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.className="popupContent",n.dir=t;const r=e.split(/(?:\r\n?|\n)/);for(let e=0,t=r.length;e{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G([e,t,n,r]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_HTML([e]){const t=n(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_HTML([e,t,r]){return`#${n(e)}${n(t)}${n(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const r=1-e,i=1-t,o=1-n;return["CMYK",r,i,o,Math.min(r,i,o)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(20);t.XfaLayer=class{static setupStorage(e,t,n,r,i){const o=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(e.textContent=o.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?e.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",(e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==o.value&&e.setAttribute("value",o.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==o.value)for(const e of n.children)e.attributes.value===o.value&&(e.attributes.selected=!0);e.addEventListener("input",(e=>{const n=e.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:i})}))}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){const{attributes:o}=t,s=e instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=`${o.name}-${r}`);for(const[t,n]of Object.entries(o))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!s||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}s&&i.addLinkAttributes(e,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(e,o.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,o=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:o,linkService:n});const a=[[i,-1,s]],l=e.div;if(l.append(s),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;a.length>0;){const[e,i,s]=a.at(-1);if(i+1===e.children.length){a.pop();continue}const l=e.children[++a.at(-1)[1]];if(null===l)continue;const{name:u}=l;if("#text"===u){const e=document.createTextNode(l.value);c.push(e),s.append(e);continue}let h;if(h=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,u):document.createElement(u),s.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:o,linkService:n}),l.children&&l.children.length>0)a.push([l,-1,h]);else if(l.value){const e=document.createTextNode(l.value);r.XfaText.shouldBuildText(u)&&c.push(e),h.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){const t=new d({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t};var r=n(1),i=n(8);const o=30,s=new Map,a=/^\s+$/g;function l(e,t,n,i){const l=document.createElement("span"),c=e._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(l);const u=r.Util.transform(e._viewport.transform,t.transform);let h=Math.atan2(u[1],u[0]);const d=n[t.fontName];d.vertical&&(h+=Math.PI/2);const f=Math.hypot(u[2],u[3]),p=f*function(e,t){const n=s.get(e);if(n)return n;t.save(),t.font=`30px ${e}`;const r=t.measureText("");let i=r.fontBoundingBoxAscent,a=Math.abs(r.fontBoundingBoxDescent);if(i){t.restore();const n=i/(i+a);return s.set(e,n),n}t.strokeStyle="red",t.clearRect(0,0,o,o),t.strokeText("g",0,0);let l=t.getImageData(0,0,o,o).data;a=0;for(let e=l.length-1-3;e>=0;e-=4)if(l[e]>0){a=Math.ceil(e/4/o);break}t.clearRect(0,0,o,o),t.strokeText("A",0,o),l=t.getImageData(0,0,o,o).data,i=0;for(let e=0,t=l.length;e0){i=o-Math.floor(e/4/o);break}if(t.restore(),i){const t=i/(i+a);return s.set(e,t),t}return s.set(e,.8),.8}(d.fontFamily,i);let g,m;0===h?(g=u[4],m=u[5]-p):(g=u[4]+p*Math.sin(h),m=u[5]-p*Math.cos(h)),l.style.left=`${g}px`,l.style.top=`${m}px`,l.style.fontSize=`${f}px`,l.style.fontFamily=d.fontFamily,c.fontSize=f,l.setAttribute("role","presentation"),l.textContent=t.str,l.dir=t.dir,e._fontInspectorEnabled&&(l.dataset.fontName=t.fontName),0!==h&&(c.angle=h*(180/Math.PI));let y=!1;if(t.str.length>1||e._enhanceTextSelection&&a.test(t.str))y=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(y=!0)}if(y&&(d.vertical?c.canvasWidth=t.height*e._viewport.scale:c.canvasWidth=t.width*e._viewport.scale),e._textDivProperties.set(l,c),e._textContentStream&&e._layoutText(l),e._enhanceTextSelection&&c.hasText){let n=1,i=0;0!==h&&(n=Math.cos(h),i=Math.sin(h));const o=(d.vertical?t.height:t.width)*e._viewport.scale,s=f;let a,c;0!==h?(a=[n,i,-i,n,g,m],c=r.Util.getAxialAlignedBoundingBox([0,0,o,s],a)):c=[g,m,g+o,m+s],e._bounds.push({left:c[0],top:c[1],right:c[2],bottom:c[3],div:l,size:[o,s],m:a})}}function c(e){if(e._canceled)return;const t=e._textDivs,n=e._capability,r=t.length;if(r>1e5)return e._renderingDone=!0,void n.resolve();if(!e._textContentStream)for(let n=0;n0&&(r=r?Math.min(n,r):n)}return r}function h(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));const n=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(const e of t){let t=0;for(;t=0&&n[o].start>=e.y2;)o--;let s,a,l=-1/0;for(s=t;s<=o;s++){let t;r=n[s],i=r.boundary,t=i.x2>e.x1?i.index>e.index?i.x1New:e.x1:void 0===i.x2New?(i.x2+e.x1)/2:i.x2New,t>l&&(l=t)}for(e.x1New=l,s=t;s<=o;s++)r=n[s],i=r.boundary,void 0===i.x2New?i.x2>e.x1?i.index>e.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));const c=[];let u=null;for(s=t;s<=o;s++){r=n[s],i=r.boundary;const t=i.x2>e.x2?i:e;u===t?c.at(-1).end=r.end:(c.push({start:r.start,end:r.end,boundary:t}),u=t)}for(n[t].start=0&&n[a].start>=i.y1;a--)e=n[a].boundary===i;for(a=o+1;!e&&a{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 r.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(e,t){for(let n=0,r=e.length;n0){const e=this._devicePixelRatio*t.canvasWidth/o;this._enhanceTextSelection&&(t.scale=e),n=`scaleX(${e})`}}if(0!==t.angle&&(n=`rotate(${t.angle}deg) ${n}`),n.length>0&&(this._enhanceTextSelection&&(t.originalTransform=n),e.style.transform=n),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(e=0){const t=(0,r.createPromiseCapability)();let n=Object.create(null);const i=this._document.createElement("canvas");if(i.height=i.width=o,this._layoutTextCtx=i.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,n=this._textContent.styles;this._processItems(e,n),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then((({value:r,done:i})=>{i?t.resolve():(Object.assign(n,r.styles),this._processItems(r.items,n),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{n=null,e?this._renderTimer=setTimeout((()=>{c(this),this._renderTimer=null}),e):c(this)}),this._capability.reject)}expandTextDivs(e=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(function(e){const t=e._bounds,n=e._viewport,i=function(e,t,n){const r=n.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));h(e,r);const i=new Array(n.length);for(const e of r){const t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}n.map((function(t,n){const o=i[n],s=r[n];s.x1=t.top,s.y1=e-o.right,s.x2=t.bottom,s.y2=e-o.left,s.index=n,s.x1New=void 0,s.x2New=void 0})),h(t,r);for(const e of r){const t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New}return i}(n.width,n.height,t);for(let n=0;n0?(n.push(`${o.paddingTop}px`),t.push(`translateY(${-o.paddingTop}px)`)):n.push(0),o.paddingRight>0?n.push(o.paddingRight/o.scale+"px"):n.push(0),o.paddingBottom>0?n.push(`${o.paddingBottom}px`):n.push(0),o.paddingLeft>0?(n.push(o.paddingLeft/o.scale+"px"),t.push(`translateX(${-o.paddingLeft/o.scale}px)`)):n.push(0),i.style.padding=n.join(" "),t.length&&(i.style.transform=t.join(" "))):(i.style.padding=null,i.style.transform=o.originalTransform))}}}t.TextLayerRenderTask=d},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(8),i=n(1),o=n(3);let s=class{constructor(){(0,i.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=s;{const a={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",u=["butt","round","square"],h=["miter","round","bevel"],d=function(e,t="",n=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${t};base64,`;for(let t=0,n=e.length;t>2]+r[(3&o)<<4|s>>4]+r[t+1>6:64]+r[t+2>1&2147483647:n>>1&2147483647;t[e]=n}function n(e,n,r,i){let o=i;const s=n.length;r[o]=s>>24&255,r[o+1]=s>>16&255,r[o+2]=s>>8&255,r[o+3]=255&s,o+=4,r[o]=255&e.charCodeAt(0),r[o+1]=255&e.charCodeAt(1),r[o+2]=255&e.charCodeAt(2),r[o+3]=255&e.charCodeAt(3),o+=4,r.set(n,o),o+=n.length;const a=function(e,n,r){let i=-1;for(let o=n;o>>8^t[n]}return~i}(r,i+4,o);r[o]=a>>24&255,r[o+1]=a>>16&255,r[o+2]=a>>8&255,r[o+3]=255&a}function r(e){let t=e.length;const n=65535,r=Math.ceil(t/n),i=new Uint8Array(2+t+5*r+4);let o=0;i[o++]=120,i[o++]=156;let s=0;for(;t>n;)i[o++]=0,i[o++]=255,i[o++]=255,i[o++]=0,i[o++]=0,i.set(e.subarray(s,s+n),o),o+=n,s+=n,t-=n;i[o++]=1,i[o++]=255&t,i[o++]=t>>8&255,i[o++]=255&~t,i[o++]=(65535&~t)>>8&255,i.set(e.subarray(s),o),o+=e.length-s;const a=function(e,t,n){let r=1,i=0;for(let t=0;t>24&255,i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a,i}return function(t,s,a){return function(t,s,a,l){const c=t.width,u=t.height;let h,f,p;const g=t.data;switch(s){case i.ImageKind.GRAYSCALE_1BPP:f=0,h=1,p=c+7>>3;break;case i.ImageKind.RGB_24BPP:f=2,h=8,p=3*c;break;case i.ImageKind.RGBA_32BPP:f=6,h=8,p=4*c;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+p)*u);let y=0,v=0;for(let e=0;e>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,h,f,0,0,0]),_=function(e){if(!o.isNodeJS)return r(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return r(e)}(m),w=e.length+36+b.length+_.length,x=new Uint8Array(w);let S=0;return x.set(e,S),S+=e.length,n("IHDR",b,x,S),S+=12+b.length,n("IDATA",_,x,S),S+=12+_.length,n("IEND",new Uint8Array(0),x,S),d(x,"image/png",a)}(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,s,a)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=a.fontWeight,this.fontSize=0,this.textMatrix=i.IDENTITY_MATRIX,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=i.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=a.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(e,t){this.x=e,this.y=t}}function g(e){let t=[];const n=[];for(const r of e)"save"!==r.fn?"restore"===r.fn?t=n.pop():t.push(r):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t.at(-1).items);return t}function m(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function y(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${m(e[0])} ${m(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${m(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${m(e[4])} ${m(e[5])})`;return`matrix(${m(e[0])} ${m(e[1])} ${m(e[2])} ${m(e[3])} ${m(e[4])} ${m(e[5])})`}let v=0,b=0,_=0;t.SVGGraphics=s=class{constructor(e,t,n=!1){(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new p,this.transformMatrix=i.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const e in i.OPS)this._operatorIdMapping[i.OPS[e]]=e}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let e=0,r=t.length;e{e.get(t,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,r,o,s){const a=[e,t,n,r,o,s];this.transformMatrix=i.Util.transform(this.transformMatrix,a),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=i.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,i=[];for(let e=0,o=r.length;e0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=u[e]}setLineJoin(e){this.current.lineJoin=h[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=i.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=i.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,n=this.viewport.height,r=i.Util.inverseTransform(this.transformMatrix),o=i.Util.applyTransform([0,0],r),s=i.Util.applyTransform([0,n],r),a=i.Util.applyTransform([t,0],r),l=i.Util.applyTransform([t,n],r),c=Math.min(o[0],s[0],a[0],l[0]),u=Math.min(o[1],s[1],a[1],l[1]),h=Math.max(o[0],s[0],a[0],l[0]),d=Math.max(o[1],s[1],a[1],l[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",c),f.setAttributeNS(null,"y",u),f.setAttributeNS(null,"width",h-c),f.setAttributeNS(null,"height",d-u),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(f)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],r=e[3]||i.IDENTITY_MATRIX,[o,s,a,l]=e[4],c=e[5],u=e[6],h=e[7],d="shading"+_++,[f,p,g,m]=i.Util.normalizeRect([...i.Util.applyTransform([o,s],r),...i.Util.applyTransform([a,l],r)]),[y,v]=i.Util.singularValueDecompose2dScale(r),b=c*y,w=u*v,x=this.svgFactory.createElement("svg:pattern");x.setAttributeNS(null,"id",d),x.setAttributeNS(null,"patternUnits","userSpaceOnUse"),x.setAttributeNS(null,"width",b),x.setAttributeNS(null,"height",w),x.setAttributeNS(null,"x",`${f}`),x.setAttributeNS(null,"y",`${p}`);const S=this.svg,E=this.transformMatrix,C=this.current.fillColor,k=this.current.strokeColor,P=this.svgFactory.create(g-f,m-p);if(this.svg=P,this.transformMatrix=r,2===h){const e=i.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=E,this.current.fillColor=C,this.current.strokeColor=k,x.append(P.childNodes[0]),this.defs.append(x),`url(#${d})`}_makeShadingPattern(e){switch("string"==typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading"+_++,n=e[3];let r;switch(e[1]){case"axial":const n=e[4],i=e[5];r=this.svgFactory.createElement("svg:linearGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",n[0]),r.setAttributeNS(null,"y1",n[1]),r.setAttributeNS(null,"x2",i[0]),r.setAttributeNS(null,"y2",i[1]);break;case"radial":const o=e[4],s=e[5],a=e[6],l=e[7];r=this.svgFactory.createElement("svg:radialGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",s[0]),r.setAttributeNS(null,"cy",s[1]),r.setAttributeNS(null,"r",l),r.setAttributeNS(null,"fx",o[0]),r.setAttributeNS(null,"fy",o[1]),r.setAttributeNS(null,"fr",a);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),r.append(t)}return this.defs.append(r),`url(#${t})`;case"Mesh":return(0,i.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let r=n.x,o=n.y,s=[],a=0;for(const n of e)switch(0|n){case i.OPS.rectangle:r=t[a++],o=t[a++];const e=r+t[a++],n=o+t[a++];s.push("M",m(r),m(o),"L",m(e),m(o),"L",m(e),m(n),"L",m(r),m(n),"Z");break;case i.OPS.moveTo:r=t[a++],o=t[a++],s.push("M",m(r),m(o));break;case i.OPS.lineTo:r=t[a++],o=t[a++],s.push("L",m(r),m(o));break;case i.OPS.curveTo:r=t[a+4],o=t[a+5],s.push("C",m(t[a]),m(t[a+1]),m(t[a+2]),m(t[a+3]),m(r),m(o)),a+=6;break;case i.OPS.curveTo2:s.push("C",m(r),m(o),m(t[a]),m(t[a+1]),m(t[a+2]),m(t[a+3])),r=t[a+2],o=t[a+3],a+=4;break;case i.OPS.curveTo3:r=t[a+2],o=t[a+3],s.push("C",m(t[a]),m(t[a+1]),m(r),m(o),m(r),m(o)),a+=4;break;case i.OPS.closePath:s.push("Z")}s=s.join(" "),n.path&&e.length>0&&e[0]!==i.OPS.rectangle&&e[0]!==i.OPS.moveTo?s=n.path.getAttributeNS(null,"d")+s:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",s),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(r,o)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+v++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",y(this.transformMatrix));const r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,i.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const n=this.current;let r=n.dashArray;1!==t&&r.length>0&&(r=r.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",m(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",m(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(m).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",m(t*n.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 e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,i.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,r=e.height,i=f(e,this.forceDataSchema,!!t),o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",m(n)),o.setAttributeNS(null,"height",m(r)),this.current.element=o,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS(c,"xlink:href",i),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",m(-r)),s.setAttributeNS(null,"width",m(n)+"px"),s.setAttributeNS(null,"height",m(r)+"px"),s.setAttributeNS(null,"transform",`scale(${m(1/n)} ${m(-1/r)})`),t?t.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(e){const t=this.current,n=e.width,r=e.height,i=t.fillColor;t.maskId="mask"+b++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",t.maskId);const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",m(n)),s.setAttributeNS(null,"height",m(r)),s.setAttributeNS(null,"fill",i),s.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(s),this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",t[0]),r.setAttributeNS(null,"y",t[1]),r.setAttributeNS(null,"width",m(e)),r.setAttributeNS(null,"height",m(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",y(e.transform)),t.append(r),this.svg=r,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(1),i=n(33);const o=__webpack_require__(3237),s=__webpack_require__(7492),a=__webpack_require__(1815),l=__webpack_require__(6671),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new f(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new m(this,e,t):new p(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)(),this._headersCapability=(0,r.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 e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.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 e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function d(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class f extends u{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:o,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,e.httpHeaders),t):this._request=a.request(d(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class p extends h{constructor(e,t,n){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const n=e.httpHeaders[t];void 0!==n&&(this._httpHeaders[t]=n)}this._httpHeaders.Range=`bytes=${t}-${n-1}`;const i=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,this._httpHeaders),i):this._request=a.request(d(this._url,this._httpHeaders),i),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class g extends u{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),o.lstat(t,((e,n)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(o.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends h{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(o.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,i.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if((0,o.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(e("Content-Length"),10);return Number.isInteger(o)?(i.suggestedLength=o,o<=2*n||r||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),i=n(34),o=n(8)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=i("filename\\*","i").exec(e);if(n){n=n[1];let e=a(n);return e=unescape(e),e=l(e),e=c(e),s(e)}if(n=function(e){const t=[];let n;const r=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,i]}const o=[];for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(1),i=n(33);class o{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const e in n)r[e]=n[e];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const n=this.httpHeaders[e];void 0!==n&&t.setRequestHeader(e,n)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void n.onError?.(i.status);const o=i.status||200;if((200!==o||206!==n.expectedStatus)&&o!==n.expectedStatus)return void n.onError?.(i.status);const s=function(e){const t=e.response;return"string"!=typeof t?t:(0,r.stringToBytes)(t).buffer}(i);if(206===o){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:s})}else s?n.onDone({begin:0,chunk:s}):n.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new o(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new a(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class s{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class a{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),i=n(33);function o(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function s(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new a(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new l(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class a{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=s(this._stream.httpHeaders);const n=t.url;fetch(n,o(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:o,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.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:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController.abort()}}class l{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const a=e.source;this._withCredentials=a.withCredentials||!1,this._readCapability=(0,r.createPromiseCapability)(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=s(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=a.url;fetch(l,o(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return o.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return a.GlobalWorkerOptions}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(4),r=__w_pdfjs_require__(8),i=__w_pdfjs_require__(22),o=__w_pdfjs_require__(7),s=__w_pdfjs_require__(27),a=__w_pdfjs_require__(15),l=__w_pdfjs_require__(3),c=__w_pdfjs_require__(30),u=__w_pdfjs_require__(31),h=__w_pdfjs_require__(29);if(l.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(32);(0,n.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(35),{PDFFetchStream:t}=__w_pdfjs_require__(36);(0,n.setPDFNetworkStreamFactory)((n=>(0,r.isValidFetchUrl)(n.url)?new t(n):new e(n)))}})(),__nested_webpack_exports__})(),module.exports=factory()},2816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,i,o,s){var a=i||"<>",l=s||r;if(null==n[r])return t?new Error("Required "+o+" `"+l+"` was not specified in `"+a+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),h=6;h{"use strict";var r=n(6925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5341:function(e){e.exports=function(){"use strict";function e(e,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/a+h)),Math.min(o,Math.floor(r+(a-l)*u/a+h)),s)}var d=n[r],f=i,p=o;for(t(n,i,r),s(n[o],d)>0&&t(n,i,o);f0;)p--}0===s(n[i],d)?t(n,i,p):t(n,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}(e,r,i||0,o||e.length-1,s||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;e(t,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!f(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=p(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,l,c,h,d=1/0,f=1/0,p=t;p<=n-t;p++){var g=s(e,0,p,this.toBBox),m=s(e,p,n,this.toBBox),y=(i=g,o=m,void 0,void 0,void 0,void 0,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,h-l)),v=u(g)+u(m);y=t;f--){var p=e.children[f];a(l,e.leaf?i(p):p),c+=h(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)a(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}()},3757:(e,t,n)=>{"use strict";var r=n(6540),i=n(3185);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,a=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}(r),l=o(r),c=o(i);function u(e,t){return e[t]}function h(e=[],t,n=0){return[...e.slice(0,n),t,...e.slice(n)]}function d(e=[],t,n="id"){const r=e.slice(),i=u(t,n);return i?r.splice(r.findIndex((e=>u(e,n)===i)),1):r.splice(r.findIndex((e=>e===t)),1),r}function f(e){return e.map(((e,t)=>{const n=Object.assign(Object.assign({},e),{sortable:e.sortable||!!e.sortFunction||void 0});return e.id||(n.id=t+1),n}))}function p(e,t){return Math.ceil(e/t)}function g(e,t){return Math.min(e,t)}!function(e){e.ASC="asc",e.DESC="desc"}(s||(s={}));const m=()=>null;function y(e,t=[],n=[]){let r={},i=[...n];return t.length&&t.forEach((t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(r=t.style||{},t.classNames&&(i=[...i,...t.classNames]),"function"==typeof t.style&&(r=t.style(e)||{}))})),{conditionalStyle:r,classNames:i.join(" ")}}function v(e,t=[],n="id"){const r=u(e,n);return r?t.some((e=>u(e,n)===r)):t.some((t=>t===e))}function b(e,t){return t?e.findIndex((e=>_(e.id,t))):-1}function _(e,t){return e==t}function w(e,t){const n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:n,rows:r,rowCount:i,mergeSelections:o}=t,s=!e.allSelected,a=!e.toggleOnSelectedRowsChange;if(o){const t=s?[...e.selectedRows,...r.filter((t=>!v(t,e.selectedRows,n)))]:e.selectedRows.filter((e=>!v(e,r,n)));return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:a})}return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:s?i:0,selectedRows:s?r:[],toggleOnSelectedRowsChange:a})}case"SELECT_SINGLE_ROW":{const{keyField:r,row:i,isSelected:o,rowCount:s,singleSelect:a}=t;return a?o?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[i],toggleOnSelectedRowsChange:n}):o?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:d(e.selectedRows,i,r),toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:h(e.selectedRows,i),toggleOnSelectedRowsChange:n})}case"SELECT_MULTIPLE_ROWS":{const{keyField:r,selectedRows:i,totalRows:o,mergeSelections:s}=t;if(s){const t=[...e.selectedRows,...i.filter((t=>!v(t,e.selectedRows,r)))];return Object.assign(Object.assign({},e),{selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n})}return Object.assign(Object.assign({},e),{selectedCount:i.length,allSelected:i.length===o,selectedRows:i,toggleOnSelectedRowsChange:n})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:n}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n})}case"SORT_CHANGE":{const{sortDirection:r,selectedColumn:i,clearSelectedOnSort:o}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:i,sortDirection:r,currentPage:1}),o&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_PAGE":{const{page:r,paginationServer:i,visibleOnly:o,persistSelectedOnPageChange:s}=t,a=i&&s,l=i&&!s||o;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:r}),a&&{allSelected:!1}),l&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:n,page:r}=t;return Object.assign(Object.assign({},e),{currentPage:r,rowsPerPage:n})}}}const x=i.css` +(()=>{var __webpack_modules__={3969:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},4744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=r;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=r(e[t],n)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(o,n)(e[o],t[o],n):i[o]=r(t[o],n))})),i}(e,n,l):r(n,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return a(e,n,t)}),{})};var l=a;e.exports=l},8251:function(e){e.exports=function(e,t){if(null==t&&(t={fuzzy:!0}),/youtu\.?be/.test(e)){var n,r=[/youtu\.be\/([^#\&\?]{11})/,/\?v=([^#\&\?]{11})/,/\&v=([^#\&\?]{11})/,/embed\/([^#\&\?]{11})/,/\/v\/([^#\&\?]{11})/];for(n=0;n{"use strict";var r=n(3404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var s=u(n);h&&(s=s.concat(h(n)));for(var a=l(t),g=l(n),m=0;m{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case h:case o:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case g:case l:return e;default:return t}}case i:return t}}}function x(e){return w(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===h||e===a||e===s||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===v||e.$$typeof===b||e.$$typeof===_||e.$$typeof===y)},t.typeOf=w},3404:(e,t,n)=>{"use strict";e.exports=n(3072)},311:e=>{"use strict";e.exports=function(e,t,n,r,i,o,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},6147:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,i){var o=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");"function"==typeof r&&(i=r,r={}),r=r||{},i=i||function(){},s.type=r.type||"text/javascript",s.charset=r.charset||"utf8",s.async=!("async"in r)||!!r.async,s.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(s,r.attrs),r.text&&(s.text=""+r.text),("onload"in s?t:n)(s,i),s.onload||t(s,i),o.appendChild(s)}},5580:(e,t,n)=>{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),s=n(2749),a=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),s=n(8655),a=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),s=n(4509),a=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),s=n(3605),a=n(9817),l=n(945);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},9770:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(8096),i=n(2428),o=n(6449),s=n(3656),a=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&i(e),h=!n&&!u&&s(e),d=!n&&!u&&!h&&l(e),f=n||u||h||d,p=f?r(e.length,String):[],g=p.length;for(var m in e)!t&&!c.call(e,m)||f&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g))||p.push(m);return p}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e){return e.split("")}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},6574:(e,t,n)=>{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,s,e,a))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),s=n(689),a=n(5861),l=n(6449),c=n(3656),u=n(7167),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var v=l(e),b=l(t),_=v?d:a(e),w=b?d:a(t),x=(_=_==h?f:_)==f,S=(w=w==h?f:w)==f,C=_==w;if(C&&c(e)){if(!c(t))return!1;v=!0,x=!1}if(C&&!x)return y||(y=new r),v||u(e)?i(e,t,n,g,m,y):o(e,t,_,n,g,m,y);if(!(1&n)){var E=x&&p.call(e,"__wrapped__"),k=S&&p.call(t,"__wrapped__");if(E||k){var P=E?e.value():e,A=k?t.value():t;return y||(y=new r),m(P,A,n,g,y)}}return!!C&&(y||(y=new r),s(e,t,n,g,m,y))}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var s=n.length,a=s,l=!o;if(null==e)return!a;for(e=Object(e);s--;){var c=n[s];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s{var r=n(1882),i=n(7296),o=n(3805),s=n(7473),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:a).test(s(e))}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),s=n(6449),a=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),s=n(8586),a=n(756),l=n(7197),c=n(7797);e.exports=function(e,t){return s(e)&&a(t)?l(c(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},7237:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},5160:e=>{e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),s=n(4394),a=r?r.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},9219:e=>{e.exports=function(e,t){return e.has(t)}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),s=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},8754:(e,t,n)=>{var r=n(5160);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},8329:(e,t,n)=>{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}},2507:(e,t,n)=>{var r=n(8754),i=n(9698),o=n(3912),s=n(3222);e.exports=function(e){return function(t){t=s(t);var n=i(t)?o(t):void 0,a=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return a[e]()+l}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,s){var a=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(a[e],e,a)}}var c=e(t,n,s);return c>-1?a[l?t[c]:c]:void 0}}},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,s,a,l){var c=1&n,u=e.length,h=t.length;if(u!=h&&!(c&&h>u))return!1;var d=l.get(e),f=l.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p{var r=n(1873),i=n(7828),o=n(5288),s=n(5911),a=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)return!1;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=s(f(e),f(t),r,c,h,d);return d.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var h=u;h--;){var d=c[h];if(!(l?d in t:i.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=l;++h{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),s=n(6545),a=n(8303),l=n(2552),c=n(7473),u="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=c(r),m=c(i),y=c(o),v=c(s),b=c(a),_=l;(r&&_(new r(new ArrayBuffer(1)))!=p||i&&_(new i)!=u||o&&_(o.resolve())!=h||s&&_(new s)!=d||a&&_(new a)!=f)&&(_=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case g:return p;case m:return u;case y:return h;case v:return d;case b:return f}return t}),e.exports=_},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),s=n(361),a=n(294),l=n(7797);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,h=!1;++c{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},9325:(e,t,n)=>{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},3912:(e,t,n)=>{var r=n(1074),i=n(9698),o=n(2054);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=s},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},2054:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[o,s,a].join("|")+")"+c+l+")*",h="(?:"+[o+r+"?",r,s,a,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+h+u,"g");e.exports=function(e){return e.match(d)||[]}},4792:(e,t,n)=>{var r=n(3222),i=n(5808);e.exports=function(e){return i(r(e).toLowerCase())}},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),s=n(6449);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),s=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var l=null==n?0:o(n);return l<0&&(l=s(a+l,0)),r(e,i(t,3),l)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},2297:(e,t,n)=>{var r=n(9325).isFinite;e.exports=function(e){return"number"==typeof e&&r(e)}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},2543:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,h=9007199254740991,d=NaN,f=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",C="[object Object]",E="[object Promise]",k="[object RegExp]",P="[object Set]",A="[object String]",T="[object Symbol]",R="[object WeakMap]",O="[object ArrayBuffer]",M="[object DataView]",I="[object Float32Array]",D="[object Float64Array]",F="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",z="[object Uint8ClampedArray]",B="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,G=RegExp(q.source),X=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+we+"]",Te="["+Pe+"]",Re="["+xe+"]",Oe="\\d+",Me="["+Se+"]",Ie="["+Ce+"]",De="[^"+we+Pe+Oe+Se+Ce+Ee+"]",Fe="\\ud83c[\\udffb-\\udfff]",Le="[^"+we+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Ee+"]",Be="\\u200d",Ue="(?:"+Ie+"|"+De+")",Ve="(?:"+ze+"|"+De+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Re+"|"+Fe+")?",He="["+ke+"]?",Ge=He+qe+"(?:"+Be+"(?:"+[Le,Ne,je].join("|")+")"+He+qe+")*",Xe="(?:"+[Me,Ne,je].join("|")+")"+Ge,Ye="(?:"+[Le+Re+"?",Re,Ne,je,Ae].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(Re,"g"),Qe=RegExp(Fe+"(?="+Fe+")|"+Ye+Ge,"g"),Je=RegExp([ze+"?"+Ie+"+"+We+"(?="+[Te,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Te,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+We,ze+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Xe].join("|"),"g"),et=RegExp("["+Be+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[I]=it[D]=it[F]=it[L]=it[N]=it[j]=it[z]=it[B]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[M]=it[v]=it[b]=it[_]=it[x]=it[S]=it[C]=it[k]=it[P]=it[A]=it[R]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[M]=ot[y]=ot[v]=ot[I]=ot[D]=ot[F]=ot[L]=ot[N]=ot[x]=ot[S]=ot[C]=ot[k]=ot[P]=ot[A]=ot[T]=ot[j]=ot[z]=ot[B]=ot[U]=!0,ot[b]=ot[_]=ot[R]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,pt=ft&&ft.exports===dt,gt=pt&&ct.process,mt=function(){try{return ft&&ft.require&&ft.require("util").types||gt&>.binding&>.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,xt=mt&&mt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Jt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=$t({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?ht:pn.defaults(ht.Object(),t,pn.pick(ht,nt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Se=t.Math,Ce=t.Object,Ee=t.RegExp,ke=t.String,Pe=t.TypeError,Ae=r.prototype,Te=xe.prototype,Re=Ce.prototype,Oe=t["__core-js_shared__"],Me=Te.toString,Ie=Re.hasOwnProperty,De=0,Fe=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Le=Re.toString,Ne=Me.call(Ce),je=ht._,ze=Ee("^"+Me.call(Ie).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,We=Be?Be.allocUnsafe:i,$e=sn(Ce.getPrototypeOf,Ce),qe=Ce.create,He=Re.propertyIsEnumerable,Ge=Ae.splice,Xe=Ue?Ue.isConcatSpreadable:i,Ye=Ue?Ue.iterator:i,Qe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ht.Date.now&&ie.now,ut=t.setTimeout!==ht.setTimeout&&t.setTimeout,dt=Se.ceil,ft=Se.floor,gt=Ce.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Lt=t.isFinite,$t=Ae.join,gn=sn(Ce.keys,Ce),mn=Se.max,yn=Se.min,vn=ie.now,bn=t.parseInt,_n=Se.random,wn=Ae.reverse,xn=lo(t,"DataView"),Sn=lo(t,"Map"),Cn=lo(t,"Promise"),En=lo(t,"Set"),kn=lo(t,"WeakMap"),Pn=lo(Ce,"create"),An=kn&&new kn,Tn={},Rn=No(xn),On=No(Sn),Mn=No(Cn),In=No(En),Dn=No(kn),Fn=Ue?Ue.prototype:i,Ln=Fn?Fn.valueOf:i,Nn=Fn?Fn.toString:i;function jn(e){if(ea(e)&&!Ws(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(Ie.call(e,"__wrapped__"))return jo(e)}return new Un(e)}var zn=function(){function e(){}return function(t){if(!Js(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Js(e))return e;var h=Ws(e);if(h){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ie.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return ki(e,a)}else{var d=ho(e),f=d==_||d==w;if(Gs(e))return _i(e,l);if(d==C||d==g||f&&!o){if(a=c||f?{}:po(e),!l)return c?function(e,t){return Pi(e,uo(e),t)}(e,function(e,t){return e&&Pi(t,Oa(t),e)}(a,e)):function(e,t){return Pi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[d])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case M:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case D:case F:case L:case N:case j:case z:case B:case U:return xi(e,n);case x:return new i;case S:case A:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return new i;case T:return r=e,Ln?Ce(Ln.call(r)):{}}}(e,d,l)}}s||(s=new Gn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=h?i:(u?c?to:eo:c?Oa:Ra)(e);return Et(m||e,(function(r,i){m&&(r=e[i=r]),Jn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Pe(o);return Ao((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Tt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Yt(n))),r?(o=Rt,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Hn(t));e:for(;++i-1},$n.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Sn||$n),string:new Wn}},qn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return so(this,e).get(e)},qn.prototype.has=function(e){return so(this,e).has(e)},qn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(e){return this.__data__.set(e,s),this},Hn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new $n,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!Sn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var ur=Ri(vr),hr=Ri(br,!0);function dr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function fr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?gr(a,t-1,n,r,i):Mt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ra)}function br(e,t){return e&&yr(e,t,Ra)}function _r(e,t){return At(t,(function(t){return Ks(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&nt}function Er(e,t){return null!=e&&Ie.call(e,t)}function kr(e,t){return null!=e&&t in Ce(e)}function Pr(e,t,n){for(var o=n?Rt:Tt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,h=[];l--;){var d=e[l];l&&t&&(d=Ot(d,Yt(t))),u=yn(d.length,u),c[l]=!n&&(t||s>=120&&d.length>=120)?new Hn(l&&d):i}d=e[0];var f=-1,p=c[0];e:for(;++f=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ge.call(a,l,1),Ge.call(e,l,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?Ge.call(e,i,1):li(e,i)}}return e}function qr(e,t){return e+ft(_n()*(t-e+1))}function Hr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return To(Co(e,t,nl),e+"")}function Xr(e){return Yn(za(e))}function Yr(e,t){var n=za(e);return Mo(n,or(t,0,n.length))}function Kr(e,t,n,r){if(!Js(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s=200){var c=t?null:Hi(e);if(c)return ln(c);s=!1,i=Zt,l=new Hn}else l=t?[]:a;e:for(;++r=r?e:ei(e,t,n)}var bi=st||function(e){return ht.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ce(t);++r-1?o[s?t[a]:a]:i}}function Li(e){return Ji((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Pe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r1&&_.reverse(),f&&hl))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&n?new Hn:i;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Et(p,(function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Mo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function hs(e){var t=jn(e);return t.__chain__=!0,t}function ds(e,t){return t(e)}var fs=Ji((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ds,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Ai((function(e,t,n){Ie.call(e,n)?++e[n]:rr(e,n,1)})),gs=Fi(Vo),ms=Fi(Wo);function ys(e,t){return(Ws(e)?Et:ur)(e,oo(t,3))}function vs(e,t){return(Ws(e)?kt:hr)(e,oo(t,3))}var bs=Ai((function(e,t,n){Ie.call(e,n)?e[n].push(t):rr(e,n,[t])})),_s=Gr((function(e,t,n){var i=-1,o="function"==typeof t,s=qs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?St(t,e,n):Ar(e,t,n)})),s})),ws=Ai((function(e,t,n){rr(e,n,t)}));function xs(e,t){return(Ws(e)?Ot:Lr)(e,oo(t,3))}var Ss=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Cs=Gr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Es=ct||function(){return ht.Date.now()};function ks(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Xi(e,c,i,i,i,i,t)}function Ps(e,t){var n;if("function"!=typeof t)throw new Pe(o);return e=fa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var As=Gr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(As));r|=l}return Xi(e,r,t,n,i)})),Ts=Gr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Ts));r|=l}return Xi(t,r,e,n,i)}));function Rs(e,t,n){var r,s,a,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Pe(o);function g(t){var n=r,o=s;return r=s=i,h=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||f&&e-h>=a}function y(){var e=Es();if(m(e))return v(e);c=Ao(y,function(e){var n=t-(e-u);return f?yn(n,a-(e-h)):n}(e))}function v(e){return c=i,p&&r?g(e):(r=s=i,l)}function b(){var e=Es(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return h=e,c=Ao(y,t),d?g(e):l}(u);if(f)return bi(c),c=Ao(y,t),g(u)}return c===i&&(c=Ao(y,t)),l}return t=ga(t)||0,Js(n)&&(d=!!n.leading,a=(f="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){c!==i&&bi(c),h=0,r=u=s=c=i},b.flush=function(){return c===i?l:v(Es())},b}var Os=Gr((function(e,t){return lr(e,1,t)})),Ms=Gr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Is(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Is.Cache||qn),n}function Ds(e){if("function"!=typeof e)throw new Pe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Is.Cache=qn;var Fs=yi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Ot(t[0],Yt(oo())):Ot(gr(t,1),Yt(oo()))).length;return Gr((function(r){for(var i=-1,o=yn(r.length,n);++i=t})),Vs=Tr(function(){return arguments}())?Tr:function(e){return ea(e)&&Ie.call(e,"callee")&&!He.call(e,"callee")},Ws=r.isArray,$s=yt?Yt(yt):function(e){return ea(e)&&Sr(e)==O};function qs(e){return null!=e&&Qs(e.length)&&!Ks(e)}function Hs(e){return ea(e)&&qs(e)}var Gs=mt||gl,Xs=vt?Yt(vt):function(e){return ea(e)&&Sr(e)==v};function Ys(e){if(!ea(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ks(e){if(!Js(e))return!1;var t=Sr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==fa(e)}function Qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function Js(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Yt(bt):function(e){return ea(e)&&ho(e)==x};function na(e){return"number"==typeof e||ea(e)&&Sr(e)==S}function ra(e){if(!ea(e)||Sr(e)!=C)return!1;var t=$e(e);if(null===t)return!0;var n=Ie.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Ne}var ia=_t?Yt(_t):function(e){return ea(e)&&Sr(e)==k},oa=wt?Yt(wt):function(e){return ea(e)&&ho(e)==P};function sa(e){return"string"==typeof e||!Ws(e)&&ea(e)&&Sr(e)==A}function aa(e){return"symbol"==typeof e||ea(e)&&Sr(e)==T}var la=xt?Yt(xt):function(e){return ea(e)&&Qs(e.length)&&!!it[Sr(e)]},ca=Wi(Fr),ua=Wi((function(e,t){return e<=t}));function ha(e){if(!e)return[];if(qs(e))return sa(e)?hn(e):ki(e);if(Ye&&e[Ye])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ye]());var t=ho(e);return(t==x?on:t==P?ln:za)(e)}function da(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fa(e){var t=da(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(fa(e),0,f):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return d;if(Js(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Js(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=pe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):fe.test(e)?d:+e}function ma(e){return Pi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=Ti((function(e,t){if(wo(t)||qs(t))Pi(t,Ra(t),e);else for(var n in t)Ie.call(t,n)&&Jn(e,n,t[n])})),ba=Ti((function(e,t){Pi(t,Oa(t),e)})),_a=Ti((function(e,t,n,r){Pi(t,Oa(t),e,r)})),wa=Ti((function(e,t,n,r){Pi(t,Ra(t),e,r)})),xa=Ji(ir),Sa=Gr((function(e,t){e=Ce(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n1),t})),Pi(e,to(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)li(n,t[i]);return n})),Fa=Ji((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return ka(e,n)}))}(e,t)}));function La(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Na=Gi(Ra),ja=Gi(Oa);function za(e){return null==e?[]:Kt(e,Ra(e))}var Ba=Ii((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Ya(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Ze,"")}var Wa=Ii((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),$a=Ii((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),qa=Mi("toLowerCase"),Ha=Ii((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ga=Ii((function(e,t,n){return e+(n?" ":"")+Ya(t)})),Xa=Ii((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ya=Mi("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Za=Gr((function(e,t){try{return St(e,i,t)}catch(e){return Ys(e)?e:new we(e)}})),Qa=Ji((function(e,t){return Et(t,(function(t){t=Lo(t),rr(e,t,As(e[t],e))})),e}));function Ja(e){return function(){return e}}var el=Li(),tl=Li(!0);function nl(e){return e}function rl(e){return Ir("function"==typeof e?e:sr(e,1))}var il=Gr((function(e,t){return function(n){return Ar(n,e,t)}})),ol=Gr((function(e,t){return function(n){return Ar(e,n,t)}}));function sl(e,t,n){var r=Ra(t),i=_r(t,r);null!=n||Js(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(t,Ra(t)));var o=!(Js(n)&&"chain"in n&&!n.chain),s=Ks(e);return Et(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function al(){}var ll=Bi(Ot),cl=Bi(Pt),ul=Bi(Ft);function hl(e){return vo(e)?Wt(Lo(e)):function(e){return function(t){return wr(t,e)}}(e)}var dl=Vi(),fl=Vi(!0);function pl(){return[]}function gl(){return!1}var ml,yl=zi((function(e,t){return e+t}),0),vl=qi("ceil"),bl=zi((function(e,t){return e/t}),1),_l=qi("floor"),wl=zi((function(e,t){return e*t}),1),xl=qi("round"),Sl=zi((function(e,t){return e-t}),0);return jn.after=function(e,t){if("function"!=typeof t)throw new Pe(o);return e=fa(e),function(){if(--e<1)return t.apply(this,arguments)}},jn.ary=ks,jn.assign=va,jn.assignIn=ba,jn.assignInWith=_a,jn.assignWith=wa,jn.at=xa,jn.before=Ps,jn.bind=As,jn.bindAll=Qa,jn.bindKey=Ts,jn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},jn.chain=hs,jn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(fa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(dt(o/t));so?0:o+n),(r=r===i||r>o?o:fa(r))<0&&(r+=o),r=n>r?0:pa(r);n>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(hn(e),0,n):e.split(t,n):[]},jn.spread=function(e,t){if("function"!=typeof e)throw new Pe(o);return t=null==t?0:mn(fa(t),0),Gr((function(n){var r=n[t],i=vi(n,0,t);return r&&Mt(i,r),St(e,this,i)}))},jn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},jn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:fa(t))<0?0:t):[]},jn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:fa(t)))<0?0:t,r):[]},jn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},jn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},jn.tap=function(e,t){return t(e),e},jn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Pe(o);return Js(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Rs(e,t,{leading:r,maxWait:t,trailing:i})},jn.thru=ds,jn.toArray=ha,jn.toPairs=Na,jn.toPairsIn=ja,jn.toPath=function(e){return Ws(e)?Ot(e,Lo):aa(e)?[e]:ki(Fo(ya(e)))},jn.toPlainObject=ma,jn.transform=function(e,t,n){var r=Ws(e),i=r||Gs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Js(e)&&Ks(o)?zn($e(e)):{}}return(i?Et:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},jn.unary=function(e){return ks(e,1)},jn.union=es,jn.unionBy=ts,jn.unionWith=ns,jn.uniq=function(e){return e&&e.length?ai(e):[]},jn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},jn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},jn.unset=function(e,t){return null==e||li(e,t)},jn.unzip=rs,jn.unzipWith=is,jn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},jn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},jn.values=za,jn.valuesIn=function(e){return null==e?[]:Kt(e,Oa(e))},jn.without=os,jn.words=Ka,jn.wrap=function(e,t){return Ls(gi(t),e)},jn.xor=ss,jn.xorBy=as,jn.xorWith=ls,jn.zip=cs,jn.zipObject=function(e,t){return fi(e||[],t||[],Jn)},jn.zipObjectDeep=function(e,t){return fi(e||[],t||[],Kr)},jn.zipWith=us,jn.entries=Na,jn.entriesIn=ja,jn.extend=ba,jn.extendWith=_a,sl(jn,jn),jn.add=yl,jn.attempt=Za,jn.camelCase=Ba,jn.capitalize=Ua,jn.ceil=vl,jn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},jn.clone=function(e){return sr(e,4)},jn.cloneDeep=function(e){return sr(e,5)},jn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},jn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},jn.conformsTo=function(e,t){return null==t||ar(e,t,Ra(t))},jn.deburr=Va,jn.defaultTo=function(e,t){return null==e||e!=e?t:e},jn.divide=bl,jn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(fa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},jn.eq=zs,jn.escape=function(e){return(e=ya(e))&&X.test(e)?e.replace(H,tn):e},jn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},jn.every=function(e,t,n){var r=Ws(e)?Pt:dr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},jn.find=gs,jn.findIndex=Vo,jn.findKey=function(e,t){return Nt(e,oo(t,3),vr)},jn.findLast=ms,jn.findLastIndex=Wo,jn.findLastKey=function(e,t){return Nt(e,oo(t,3),br)},jn.floor=_l,jn.forEach=ys,jn.forEachRight=vs,jn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},jn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},jn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},jn.forOwnRight=function(e,t){return e&&br(e,oo(t,3))},jn.get=Ea,jn.gt=Bs,jn.gte=Us,jn.has=function(e,t){return null!=e&&fo(e,t,Er)},jn.hasIn=ka,jn.head=qo,jn.identity=nl,jn.includes=function(e,t,n,r){e=qs(e)?e:za(e),n=n&&!r?fa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&zt(e,t,n)>-1},jn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fa(n);return i<0&&(i=mn(r+i,0)),zt(e,t,i)},jn.inRange=function(e,t,n){return t=da(t),n===i?(n=t,t=0):n=da(n),function(e,t,n){return e>=yn(t,n)&&e=-9007199254740991&&e<=h},jn.isSet=oa,jn.isString=sa,jn.isSymbol=aa,jn.isTypedArray=la,jn.isUndefined=function(e){return e===i},jn.isWeakMap=function(e){return ea(e)&&ho(e)==R},jn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sr(e)},jn.join=function(e,t){return null==e?"":$t.call(e,t)},jn.kebabCase=Wa,jn.last=Yo,jn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=fa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):jt(e,Ut,o,!0)},jn.lowerCase=$a,jn.lowerFirst=qa,jn.lt=ca,jn.lte=ua,jn.max=function(e){return e&&e.length?fr(e,nl,Cr):i},jn.maxBy=function(e,t){return e&&e.length?fr(e,oo(t,2),Cr):i},jn.mean=function(e){return Vt(e,nl)},jn.meanBy=function(e,t){return Vt(e,oo(t,2))},jn.min=function(e){return e&&e.length?fr(e,nl,Fr):i},jn.minBy=function(e,t){return e&&e.length?fr(e,oo(t,2),Fr):i},jn.stubArray=pl,jn.stubFalse=gl,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=wl,jn.nth=function(e,t){return e&&e.length?Br(e,fa(t)):i},jn.noConflict=function(){return ht._===this&&(ht._=je),this},jn.noop=al,jn.now=Es,jn.pad=function(e,t,n){e=ya(e);var r=(t=fa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(ft(i),n)+e+Ui(dt(i),n)},jn.padEnd=function(e,t,n){e=ya(e);var r=(t=fa(t))?un(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=_n();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return qr(e,t)},jn.reduce=function(e,t,n){var r=Ws(e)?It:qt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},jn.reduceRight=function(e,t,n){var r=Ws(e)?Dt:qt,i=arguments.length<3;return r(e,oo(t,4),n,i,hr)},jn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:fa(t),Hr(ya(e),t)},jn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=f,r=yn(e,f);t=oo(t),e-=f;for(var i=Gt(r,t);++n=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Ee(o.source,ya(de.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===i?l:d)}}else if(e.indexOf(si(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+r},jn.unescape=function(e){return(e=ya(e))&&G.test(e)?e.replace(q,fn):e},jn.uniqueId=function(e){var t=++De;return ya(e)+t},jn.upperCase=Xa,jn.upperFirst=Ya,jn.each=ys,jn.eachRight=vs,jn.first=qo,sl(jn,(ml={},vr(jn,(function(e,t){Ie.call(jn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),jn.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jn[e].placeholder=jn})),Et(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(fa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Et(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Et(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),Et(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Gr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Ar(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(Ds(oo(e)))},Vn.prototype.slice=function(e,t){e=fa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=fa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(f)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=jn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(jn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ws(t),h=function(e){var t=o.apply(jn,Mt([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,g=l&&!f;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:ds,args:[h],thisArg:i}),new Un(m,d)}return p&&g?e.apply(this,a):(m=this.thru(h),p?r?m.value()[0]:m.value():m)})})),Et(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);jn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=jn[t];if(n){var r=n.name+"";Ie.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}})),Tn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},jn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=jo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},jn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ds,args:[Jo],thisArg:i}),new Un(t,this.__chain__)}return this.thru(Jo)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,Ye&&(jn.prototype[Ye]=function(){return this}),jn}();ht._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),s=n(7797);e.exports=function(e){return o(e)?r(s(e)):i(e)}},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?NaN:+e}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},5808:(e,t,n)=>{var r=n(2507)("toUpperCase");e.exports=r},1811:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function i(e,t){if(e.length!==t.length)return!1;for(var n=0;n{var factory;globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.StreamType=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.arrayByteLength=u,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let n=0;for(let r=0;rt}),e.promise=new Promise((function(n,r){e.resolve=function(e){t=!0,n(e)},e.reject=function(e){t=!0,r(e)}})),e},t.createValidAbsoluteUrl=function(e,t=null,n=null){if(!e)return null;try{if(n&&"string"==typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=p(e)}catch(e){}}const r=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null},t.escapeString=function(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=r.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=c,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),r=c(e);return n.decode(r)}catch(e){o(`stringToPDFString: "${e}".`)}}const t=[];for(let n=0,r=e.length;n>8&255),String.fromCharCode(255&r))}return t.join("")},t.stringToUTF8String=p,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=o,n(2),t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15},t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},t.TextRenderingMode={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},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.AnnotationType={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},t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.AnnotationFieldFlag={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},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.AnnotationActionEventType={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"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"},t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const r={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=r,t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},t.OPS={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},t.UNSUPPORTED_FEATURES={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"},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=r.WARNINGS;function o(e){i>=r.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const l=function(){function e(t,n){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function c(e){"string"!=typeof e&&s("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;re.toString(16).padStart(2,"0")));class d{static makeHexColor(e,t,n){return`#${h[e]}${h[t]}${h[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=d.applyTransform(e,t),r=d.applyTransform(e.slice(2,4),t),i=d.applyTransform([e[0],e[3]],t),o=d.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],o=e[2]*t[1]+e[3]*t[3],s=(n+o)/2,a=Math.sqrt((n+o)**2-4*(n*o-i*r))/2,l=s+a||1,c=s-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),o=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>o?null:[n,i,r,o]}static bezierBoundingBox(e,t,n,r,i,o,s,a){const l=[],c=[[],[]];let u,h,d,f,p,g,m,y;for(let c=0;c<2;++c)if(0===c?(h=6*e-12*n+6*i,u=-3*e+9*n-9*i+3*s,d=3*n-3*e):(h=6*t-12*r+6*o,u=-3*t+9*r-9*o+3*a,d=3*r-3*t),Math.abs(u)<1e-12){if(Math.abs(h)<1e-12)continue;f=-d/h,0{n(3)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{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,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:e,NodeCMapReaderFactory:t,NodeStandardFontDataFactory:n}=__w_pdfjs_require__(21);exports.DefaultCanvasFactory=DefaultCanvasFactory=e,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=t,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=n}function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){const t=new PDFDocumentLoadingTask;let n;if("string"==typeof e||e instanceof URL)n={url:e};else if((0,_util.isArrayBuffer)(e))n={data:e};else if(e instanceof PDFDataRangeTransport)n={range:e};else{if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");n=e}const r=Object.create(null);let i=null,o=null;for(const e in n){const t=n[e];switch(e){case"url":if("undefined"!=typeof window)try{r[e]=new URL(t,window.location).href;continue}catch(e){(0,_util.warn)(`Cannot create valid URL: "${e}".`)}else if("string"==typeof t||t instanceof URL){r[e]=t.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":i=t;continue;case"worker":o=t;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)r[e]=new Uint8Array(t);else{if(t instanceof Uint8Array)break;if("string"==typeof t)r[e]=(0,_util.stringToBytes)(t);else if("object"!=typeof t||null===t||isNaN(t.length)){if(!(0,_util.isArrayBuffer)(t))throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");r[e]=new Uint8Array(t)}else r[e]=new Uint8Array(t)}continue}r[e]=t}if(r.CMapReaderFactory=r.CMapReaderFactory||DefaultCMapReaderFactory,r.StandardFontDataFactory=r.StandardFontDataFactory||DefaultStandardFontDataFactory,r.ignoreErrors=!0!==r.stopAtErrors,r.fontExtraProperties=!0===r.fontExtraProperties,r.pdfBug=!0===r.pdfBug,r.enableXfa=!0===r.enableXfa,(!Number.isInteger(r.rangeChunkSize)||r.rangeChunkSize<1)&&(r.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),("string"!=typeof r.docBaseUrl||(0,_display_utils.isDataScheme)(r.docBaseUrl))&&(r.docBaseUrl=null),(!Number.isInteger(r.maxImageSize)||r.maxImageSize<-1)&&(r.maxImageSize=-1),"string"!=typeof r.cMapUrl&&(r.cMapUrl=null),"string"!=typeof r.standardFontDataUrl&&(r.standardFontDataUrl=null),"boolean"!=typeof r.useWorkerFetch&&(r.useWorkerFetch=r.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&r.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof r.isEvalSupported&&(r.isEvalSupported=!0),"boolean"!=typeof r.disableFontFace&&(r.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof r.useSystemFonts&&(r.useSystemFonts=!_is_node.isNodeJS&&!r.disableFontFace),"object"==typeof r.ownerDocument&&null!==r.ownerDocument||(r.ownerDocument=globalThis.document),"boolean"!=typeof r.disableRange&&(r.disableRange=!1),"boolean"!=typeof r.disableStream&&(r.disableStream=!1),"boolean"!=typeof r.disableAutoFetch&&(r.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(r.verbosity),!o){const e={verbosity:r.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};o=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=o}const s=t.docId;return o.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(o,r,i,s),n=new Promise((function(e){let t;i?t=new _transport_stream.PDFDataTransportStream({length:r.length,initialData:r.initialData,progressiveDone:r.progressiveDone,contentDispositionFilename:r.contentDispositionFilename,disableRange:r.disableRange,disableStream:r.disableStream},i):r.data||(t=createPDFNetworkStream({url:r.url,length:r.length,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials,rangeChunkSize:r.rangeChunkSize,disableRange:r.disableRange,disableStream:r.disableStream})),e(t)}));return Promise.all([e,n]).then((function([e,n]){if(t.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(s,e,o.port),a=new WorkerTransport(i,t,n,r);t._transport=a,i.send("Ready",null)}))})).catch(t._capability.reject),t}async function _fetchDocument(e,t,n,r){if(e.destroyed)throw new Error("Worker was destroyed");n&&(t.length=n.length,t.initialData=n.initialData,t.progressiveDone=n.progressiveDone,t.contentDispositionFilename=n.contentDispositionFilename);const i=await e.messageHandler.sendWithPromise("GetDocRequest",{docId:r,apiVersion:"2.16.105",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,docBaseUrl:t.docBaseUrl,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,enableXfa:t.enableXfa,useSystemFonts:t.useSystemFonts,cMapUrl:t.useWorkerFetch?t.cMapUrl:null,standardFontDataUrl:t.useWorkerFetch?t.standardFontDataUrl:null});if(t.data&&(t.data=null),e.destroyed)throw new Error("Worker was destroyed");return i}class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await(this._transport?.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,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(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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(e=!1){return this._transport.startCleanup(e||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(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._ownerDocument=r,this._transport=n,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=n.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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e="display"}={}){const t=this._transport.getRenderingIntent(e);let n=this._annotationPromises.get(t.cacheKey);return n||(n=this._transport.getAnnotations(this._pageIndex,t.renderingIntent),this._annotationPromises.set(t.cacheKey,n),n=n.then((e=>{for(const t of e)void 0!==t.titleObj&&Object.defineProperty(t,"title",{get:()=>((0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),t.titleObj.str)}),void 0!==t.contentsObj&&Object.defineProperty(t,"contents",{get:()=>((0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),t.contentsObj.str)});return e}))),n}getJSActions(){return this._jsActionsPromise||=this._transport.getPageJSActions(this._pageIndex)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:i=null,imageLayer:o=null,canvasFactory:s=null,background:a=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:h=null}){void 0!==arguments[0]?.renderInteractiveForms&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&r===_util.AnnotationMode.ENABLE&&(r=_util.AnnotationMode.ENABLE_FORMS)),void 0!==arguments[0]?.includeAnnotationStorage&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&r===_util.AnnotationMode.ENABLE&&(r=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const d=this._transport.getRenderingIntent(n,r,h);this.pendingCleanup=!1,l||(l=this._transport.getOptionalContentConfig());let f=this._intentStates.get(d.cacheKey);f||(f=Object.create(null),this._intentStates.set(d.cacheKey,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const p=s||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),g=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);f.displayReadyCapability||(f.displayReadyCapability=(0,_util.createPromiseCapability)(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(d));const m=e=>{f.renderTasks.delete(y),(this.cleanupAfterRender||g)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(y.capability.reject(e),this._abortOperatorList({intentState:f,reason:e instanceof Error?e:new Error(e)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},y=new InternalRenderTask({callback:m,params:{canvasContext:e,viewport:t,transform:i,imageLayer:o,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:p,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:u});(f.renderTasks||=new Set).add(y);const v=y.task;return Promise.all([f.displayReadyCapability.promise,l]).then((([e,t])=>{this.pendingCleanup?m():(this._stats&&this._stats.time("Rendering"),y.initializeGraphics({transparency:e,optionalContentConfig:t}),y.operatorListChanged())})).catch(m),v}getOperatorList({intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const r=this._transport.getRenderingIntent(e,t,n,!0);let i,o=this._intentStates.get(r.cacheKey);return o||(o=Object.create(null),this._intentStates.set(r.cacheKey,o)),o.opListReadCapability||(i=Object.create(null),i.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(i))},o.opListReadCapability=(0,_util.createPromiseCapability)(),(o.renderTasks||=new Set).add(i),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(r)),o.opListReadCapability.promise}streamTextContent({disableCombineTextItems:e=!1,includeMarkedContent:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==e,includeMarkedContent:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,n){const r=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){r.read().then((function({value:n,done:r}){r?e(i):(Object.assign(i.styles,n.styles),i.items.push(...n.items),t())}),n)}()}))}getStructTree(){return this._structTreePromise||=this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();this.objs.clear();for(const e of this._bitmaps)e.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const e of this._bitmaps)e.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats&&this._stats.timeEnd("Page Request"),n.displayReadyCapability&&n.displayReadyCapability.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n{r.read().then((({value:e,done:t})=>{t?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,i),o())}),(e=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const e of i.renderTasks)e.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(e);else{if(!i.opListReadCapability)throw e;i.opListReadCapability.reject(e)}}}))};o()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}if(e.streamReader.cancel(new _util.AbortException(t.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(e,t){const n={data:structuredClone(e,t)};this._deferred.then((()=>{for(const e of this._listeners)e.call(this,n)}))}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const n=this._listeners.indexOf(t);this._listeners.splice(n,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const e=document?.currentScript?.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const r=new URL(t,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};class PDFWorker{static#t=new WeakMap;constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&PDFWorker.#t.has(t))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return PDFWorker.#t.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),r=()=>{t.removeEventListener("error",i),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||r()};t.addEventListener("error",i),n.on("test",(e=>{t.removeEventListener("error",i),this.destroyed?r():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",i),this.destroyed)r();else try{o()}catch(e){this._setupFakeWorker()}}));const o=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void o()}catch(e){(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((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+PDFWorkerUtil.fakeWorkerId++,r=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(r,t);const i=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#t.has(e.port)?this.#t.get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){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())}}exports.PDFWorker=PDFWorker,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{#n=null;#r=new Map;#i=new Map;#o=null;constructor(e,t,n,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,r.useWorkerFetch||(this.CMapReaderFactory=new r.CMapReaderFactory({baseUrl:r.cMapUrl,isCompressed:r.cMapPacked}),this.StandardFontDataFactory=new r.StandardFontDataFactory({baseUrl:r.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,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 this.#n}getRenderingIntent(e,t=_util.AnnotationMode.ENABLE,n=null,r=!1){let i=_util.RenderingIntentFlag.DISPLAY,o=null;switch(e){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,o=(i&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return r&&(i+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:i,cacheKey:`${i}_${_annotation_storage.AnnotationStorage.getHash(o)}`,annotationStorageMap:o}}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 e=[];for(const t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#o=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:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then((()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),r.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const n=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.#r.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(([t,n,r])=>{if(!this.destroyed&&!this.commonObjs.has(t))switch(n){case"Font":const i=this._params;if("error"in r){const e=r.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let o=null;i.pdfBug&&globalThis.FontInspector?.enabled&&(o={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const s=new _font_loader.FontFaceObject(r,{isEvalSupported:i.isEvalSupported,disableFontFace:i.disableFontFace,ignoreErrors:i.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:o});this.fontLoader.bind(s).catch((n=>e.sendWithPromise("FontFallback",{id:t}))).finally((()=>{!i.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(t,s)}));break;case"FontPath":case"Image":this.commonObjs.resolve(t,r);break;default:throw new Error(`Got unknown common object type ${n}`)}})),e.on("obj",(([e,t,n,r])=>{if(this.destroyed)return;const i=this.#r.get(t);if(!i.objs.has(e))switch(n){case"Image":i.objs.resolve(e,r);const t=8e6;if(r){let e;if(r.bitmap){const{bitmap:t,width:n,height:o}=r;e=n*o*4,i._bitmaps.add(t)}else e=r.data?.length||0;e>t&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(e,r);break;default:throw new Error(`Got unknown object type ${n}`)}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})})),e.on("DocStats",(e=>{this.destroyed||(this.#n=Object.freeze({streamTypes:Object.freeze(e.streamTypes),fontTypes:Object.freeze(e.fontTypes)}))})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#i.get(t);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.ownerDocument,this._params.pdfBug);return this.#r.set(t,n),n}));return this.#i.set(t,r),r}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getFieldObjects(){return this._getFieldObjectsPromise||=this.messageHandler.sendWithPromise("GetFieldObjects",null)}hasJSActions(){return this._hasJSActionsPromise||=this.messageHandler.sendWithPromise("HasJSActions",null)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.#o||=this.messageHandler.sendWithPromise("GetMetadata",null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(const e of this.#r.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#o=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,enableXfa:e.enableXfa})}}class PDFObjects{#s=Object.create(null);#a(e){return this.#s[e]||(this.#s[e]={capability:(0,_util.createPromiseCapability)(),data:null})}get(e,t=null){if(t){const n=this.#a(e);return n.capability.promise.then((()=>t(n.data))),null}const n=this.#s[e];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#s[e];return t?.capability.settled||!1}resolve(e,t=null){const n=this.#a(e);n.data=t,n.capability.resolve()}clear(){this.#s=Object.create(null)}}class RenderTask{#l=null;constructor(e){this.#l=e,this.onContinue=null}get promise(){return this.#l.capability.promise}cancel(){this.#l.cancel()}get separateAnnots(){const{separateAnnots:e}=this.#l.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#l;return e.form||e.canvas&&t?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#c=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:o,pageIndex:s,canvasFactory:a,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:u=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=s,this.canvasFactory=a,this._pdfBug=c,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,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=t.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#c.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.");InternalRenderTask.#c.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:r,transform:i,imageLayer:o,background:s}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,o,t,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:r,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(e=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.#c.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_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&&InternalRenderTask.#c.delete(this._canvas),this.callback())))}}const version="2.16.105";exports.version=version;const build="172ccdbe5";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var r=n(1),i=n(6),o=n(10);class s{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this._storage.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this._storage.get(e)}remove(e){if(this._storage.delete(e),0===this._storage.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this._storage.values())if(e instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this._storage.get(e);let r=!1;if(void 0!==n)for(const[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this._storage.set(e,t);r&&this.#u(),t instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this._storage.has(e)}getAll(){return this._storage.size>0?(0,r.objectFromMap)(this._storage):null}get size(){return this._storage.size}#u(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new a(this)}get serializable(){if(0===this._storage.size)return null;const e=new Map;for(const[t,n]of this._storage){const r=n instanceof i.AnnotationEditor?n.serialize():n;r&&e.set(t,r)}return e}static getHash(e){if(!e)return"";const t=new o.MurmurHash3_64;for(const[n,r]of e)t.update(`${n}:${JSON.stringify(r)}`);return t.hexdigest()}}t.AnnotationStorage=s;class a extends s{#h=null;constructor(e){super(),this.#h=structuredClone(e.serializable)}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#h}}t.PrintAnnotationStorage=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var r=n(7),i=n(1);class o{#d=this.focusin.bind(this);#f=this.focusout.bind(this);#p=!1;#g=!1;#m=!1;#y=o._zIndex++;static _colorManager=new r.ColorManager;static _zIndex=1;constructor(e){this.constructor===o&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null;const[t,n]=this.parent.viewportBaseDimensions;this.x=e.x/t,this.y=e.y/n,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#y}focusin(e){this.#p?this.#p=!1:this.parent.setSelected(this)}focusout(e){if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x,this.startY=e.clientY-t.y,e.dataTransfer.setData("text/plain",this.id),e.dataTransfer.effectAllowed="move"}setAt(e,t,n,r){const[i,o]=this.parent.viewportBaseDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/o,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(e,t){const[n,r]=this.parent.viewportBaseDimensions;[e,t]=this.screenToPageTranslation(e,t),this.x+=e/n,this.y+=t/r,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){const{rotation:n}=this.parent.viewport;switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}setDims(e,t){const[n,r]=this.parent.viewportBaseDimensions;this.div.style.width=100*e/n+"%",this.div.style.height=100*t/r+"%"}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",this.#d),this.div.addEventListener("focusout",this.#f);const[e,t]=this.getInitialTranslation();return this.translate(e,t),(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(e){const t=r.KeyboardManager.platform.isMac;0!==e.button||e.ctrlKey&&t?e.preventDefault():(e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#p=!0)}getRect(e,t){const[n,r]=this.parent.viewportBaseDimensions,[i,o]=this.parent.pageDimensions,s=i*e/n,a=o*t/r,l=this.x*i,c=this.y*o,u=this.width*i,h=this.height*o;switch(this.rotation){case 0:return[l+s,o-c-a-h,l+s+u,o-c-a];case 90:return[l+a,o-c+s,l+a+h,o-c+s+u];case 180:return[l-s-u,o-c+a,l-s,o-c+a+h];case 270:return[l-a-h,o-c-s-u,l-a,o-c-s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,r,i,o]=e,s=i-n,a=o-r;switch(this.rotation){case 0:return[n,t-o,s,a];case 90:return[n,t-r,a,s];case 180:return[i,t-r,s,a];case 270:return[i,t-o,a,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#m=!0}disableEditMode(){this.#m=!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#d)}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t){const n=new this.prototype.constructor({parent:t,id:t.getNextId()});n.rotation=e.rotation;const[r,i]=t.pageDimensions,[o,s,a,l]=n.getRectInCurrentCoords(e.rect,i);return n.x=o/r,n.y=s/i,n.width=a/r,n.height=l/i,n}remove(){this.div.removeEventListener("focusin",this.#d),this.div.removeEventListener("focusout",this.#f),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}t.AnnotationEditor=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var r=n(1),i=n(8);class o{#v=0;getId(){return`${r.AnnotationEditorPrefix}${this.#v++}`}}class s{#b=[];#_=!1;#w;#x=-1;constructor(e=128){this.#w=e}add({cmd:e,undo:t,mustExec:n,type:r=NaN,overwriteIfSameType:i=!1,keepUndo:o=!1}){if(n&&e(),this.#_)return;const s={cmd:e,undo:t,type:r};if(-1===this.#x)return this.#b.length>0&&(this.#b.length=0),this.#x=0,void this.#b.push(s);if(i&&this.#b[this.#x].type===r)return o&&(s.undo=this.#b[this.#x].undo),void(this.#b[this.#x]=s);const a=this.#x+1;a===this.#w?this.#b.splice(0,1):(this.#x=a,ae.serialize())):this.#C=[e.serialize()],this.#C=this.#C.filter((e=>!!e)),0===this.#C.length&&(this.#C=null))}paste(){return this.#C}isEmpty(){return null===this.#C}destroy(){this.#C=null}}class c{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,r.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,n]of this._colors)if(n.every(((e,n)=>e===t[n])))return c._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?r.Util.makeHexColor(...t):e}}t.ColorManager=c;class u{#E=null;#k=new Map;#P=new Map;#A=new l;#T=new s;#R=0;#O=null;#M=null;#I=new o;#D=!1;#F=r.AnnotationEditorType.NONE;#L=new Set;#N=this.keydown.bind(this);#j=this.onEditingAction.bind(this);#z=this.onPageChanging.bind(this);#B={isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#U=null;static _keyboardManager=new a([[["ctrl+a","mac+meta+a"],u.prototype.selectAll],[["ctrl+c","mac+meta+c"],u.prototype.copy],[["ctrl+v","mac+meta+v"],u.prototype.paste],[["ctrl+x","mac+meta+x"],u.prototype.cut],[["ctrl+z","mac+meta+z"],u.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],u.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],u.prototype.delete],[["Escape","mac+Escape"],u.prototype.unselectAll]]);constructor(e,t){this.#U=e,this.#M=t,this.#M._on("editingaction",this.#j),this.#M._on("pagechanging",this.#z)}destroy(){this.#V(),this.#M._off("editingaction",this.#j),this.#M._off("pagechanging",this.#z);for(const e of this.#P.values())e.destroy();this.#P.clear(),this.#k.clear(),this.#E=null,this.#L.clear(),this.#A.destroy(),this.#T.destroy()}onPageChanging({pageNumber:e}){this.#R=e-1}focusMainContainer(){this.#U.focus()}#W(){this.#U.addEventListener("keydown",this.#N)}#V(){this.#U.removeEventListener("keydown",this.#N)}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||u._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","cut","copy","paste","delete","selectAll"].includes(e.name)&&this[e.name]()}#$(e){Object.entries(e).some((([e,t])=>this.#B[e]!==t))&&this.#M.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#B,e)})}#q(e){this.#M.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#W(),this.#$({isEditing:this.#F!==r.AnnotationEditorType.NONE,isEmpty:this.#H(),hasSomethingToUndo:this.#T.hasSomethingToUndo(),hasSomethingToRedo:this.#T.hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:this.#A.isEmpty()})):(this.#V(),this.#$({isEditing:!1}))}registerEditorTypes(e){this.#O=e;for(const e of this.#O)this.#q(e.defaultPropertiesToUpdate)}getId(){return this.#I.getId()}addLayer(e){this.#P.set(e.pageIndex,e),this.#D?e.enable():e.disable()}removeLayer(e){this.#P.delete(e.pageIndex)}updateMode(e){if(this.#F=e,e===r.AnnotationEditorType.NONE)this.setEditingState(!1),this.#G();else{this.setEditingState(!0),this.#X();for(const t of this.#P.values())t.updateMode(e)}}updateToolbar(e){e!==this.#F&&this.#M.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){for(const n of this.#L)n.updateParams(e,t);for(const n of this.#O)n.updateDefaultParams(e,t)}#X(){if(!this.#D){this.#D=!0;for(const e of this.#P.values())e.enable()}}#G(){if(this.unselectAll(),this.#D){this.#D=!1;for(const e of this.#P.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#k.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#k.get(e)}addEditor(e){this.#k.set(e.id,e)}removeEditor(e){this.#k.delete(e.id),this.unselect(e)}#Y(e){const t=this.#P.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#E!==e&&(this.#E=e,e&&this.#q(e.propertiesToUpdate))}toggleSelected(e){if(this.#L.has(e))return this.#L.delete(e),e.unselect(),void this.#$({hasSelectedEditor:this.hasSelection});this.#L.add(e),e.select(),this.#q(e.propertiesToUpdate),this.#$({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#L)t!==e&&t.unselect();this.#L.clear(),this.#L.add(e),e.select(),this.#q(e.propertiesToUpdate),this.#$({hasSelectedEditor:!0})}isSelected(e){return this.#L.has(e)}unselect(e){e.unselect(),this.#L.delete(e),this.#$({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#L.size}undo(){this.#T.undo(),this.#$({hasSomethingToUndo:this.#T.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#H()})}redo(){this.#T.redo(),this.#$({hasSomethingToUndo:!0,hasSomethingToRedo:this.#T.hasSomethingToRedo(),isEmpty:this.#H()})}addCommands(e){this.#T.add(e),this.#$({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#H()})}#H(){if(0===this.#k.size)return!0;if(1===this.#k.size)for(const e of this.#k.values())return e.isEmpty();return!1}delete(){if(this.#E&&this.#E.commitOrRemove(),!this.hasSelection)return;const e=[...this.#L];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#Y(t)},mustExec:!0})}copy(){if(this.#E&&this.#E.commitOrRemove(),this.hasSelection){const e=[];for(const t of this.#L)t.isEmpty()||e.push(t);if(0===e.length)return;this.#A.copy(e),this.#$({hasEmptyClipboard:!1})}}cut(){this.copy(),this.delete()}paste(){if(this.#A.isEmpty())return;this.unselectAll();const e=this.#P.get(this.#R),t=this.#A.paste().map((t=>e.deserialize(t)));this.addCommands({cmd:()=>{for(const e of t)this.#Y(e);this.#K(t)},undo:()=>{for(const e of t)e.remove()},mustExec:!0})}#K(e){this.#L.clear();for(const t of e)t.isEmpty()||(this.#L.add(t),t.select());this.#$({hasSelectedEditor:!0})}selectAll(){for(const e of this.#L)e.commit();this.#K(this.#k.values())}unselectAll(){if(this.#E)this.#E.commitOrRemove();else if(0!==this.#K.size){for(const e of this.#L)e.unselect();this.#L.clear(),this.#$({hasSelectedEditor:!1})}}isActive(e){return this.#E===e}getActive(){return this.#E}getMode(){return this.#F}}t.AnnotationEditorUIManager=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,m(r))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:r,d:i,e:o,f:s}=e.getTransform();return[t,n,r,i,o,s]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:r,d:i,e:o,f:s}=e.getTransform().invertSelf();return[t,n,r,i,o,s]},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),n=e.indexOf("?"),r=Math.min(t>0?t:e.length,n>0?n:e.length);return e.substring(e.lastIndexOf("/",r)+1,r)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(f(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let o=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(o&&(o=o[0],o.includes("%")))try{o=n.exec(decodeURIComponent(o))[0]}catch(e){}return o||t},t.getRGB=m,t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:r,height:i}=e.attributes.style,o=[0,0,parseInt(r),parseInt(i)];return new h({viewBox:o,scale:t,rotation:n})},t.isDataScheme=f,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=p,t.loadScript=function(e,t=!1){return new Promise(((n,r)=>{const i=document.createElement("script");i.src=e,i.onload=function(e){t&&i.remove(),n(e)},i.onerror=function(){r(new Error(`Cannot load script at: ${i.src}`))},(document.head||document.documentElement).append(i)}))};var r=n(9),i=n(1);t.AnnotationPrefix="pdfjs_internal_id_";class o{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=o;class s extends r.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function a(e,t=!1){if(p(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,i.stringToBytes)(await n.text())}return new Promise(((n,r)=>{const o=new XMLHttpRequest;o.open("GET",e,!0),t&&(o.responseType="arraybuffer"),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){let e;if(t&&o.response?e=new Uint8Array(o.response):!t&&o.responseText&&(e=(0,i.stringToBytes)(o.responseText)),e)return void n(e)}r(new Error(o.statusText))}},o.send(null)}))}t.DOMCanvasFactory=s;class l extends r.BaseCMapReaderFactory{_fetchData(e,t){return a(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=l;class c extends r.BaseStandardFontDataFactory{_fetchData(e){return a(e,!0)}}t.DOMStandardFontDataFactory=c;class u extends r.BaseSVGFactory{_createSVG(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}}t.DOMSVGFactory=u;class h{constructor({viewBox:e,scale:t,rotation:n,offsetX:r=0,offsetY:i=0,dontFlip:o=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=r,this.offsetY=i;const s=(e[2]+e[0])/2,a=(e[3]+e[1])/2;let l,c,u,h,d,f,p,g;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,u=0,h=1;break;case 90:l=0,c=1,u=1,h=0;break;case 270:l=0,c=-1,u=-1,h=0;break;case 0:l=1,c=0,u=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,h=-h),0===l?(d=Math.abs(a-e[1])*t+r,f=Math.abs(s-e[0])*t+i,p=Math.abs(e[3]-e[1])*t,g=Math.abs(e[2]-e[0])*t):(d=Math.abs(s-e[0])*t+r,f=Math.abs(a-e[1])*t+i,p=Math.abs(e[2]-e[0])*t,g=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,h*t,d-l*t*s-u*t*a,f-c*t*s-h*t*a],this.width=p,this.height=g}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}={}){return new h({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=h;class d extends i.BaseException{constructor(e,t){super(e,"RenderingCancelledException"),this.type=t}}function f(e){const t=e.length;let n=0;for(;n>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,i.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.RenderingCancelledException=d,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,i.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const e of this.times){const n=e.name;n.length>t&&(t=n.length)}for(const n of this.times){const r=n.end-n.start;e.push(`${n.name.padEnd(t)} ${r}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;g||(g=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=g.exec(e);if(!t)return null;const n=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;let s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;let a=parseInt(t[6],10);a=a>=0&&a<=59?a:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(o+=c,s+=u):"+"===l&&(o-=c,s-=u),new Date(Date.UTC(n,r,i,o,s,a))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var r=n(1);class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class o{constructor({baseUrl:e=null,isCompressed:t=!1}){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(t,n).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)}))}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=o;class s{constructor({baseUrl:e=null}){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch((e=>{throw new Error(`Unable to load font data at: ${t}`)}))}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=s;class a{constructor(){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${t}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${t}`),r}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var r=n(1);const i=3285377520,o=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:i,this.h2=e?4294967295&e:i}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let r=0,i=e.length;r>>8,t[n++]=255&i)}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const i=n>>2,a=n-4*i,l=new Uint32Array(t.buffer,0,i);let c=0,u=0,h=this.h1,d=this.h2;const f=3432918353,p=461845907,g=11601,m=13715;for(let e=0;e>>17,c=c*p&o|c*m&s,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(u=l[e],u=u*f&o|u*g&s,u=u<<15|u>>>17,u=u*p&o|u*m&s,d^=u,d=d<<13|d>>>19,d=5*d+3864292196);switch(c=0,a){case 3:c^=t[4*i+2]<<16;case 2:c^=t[4*i+1]<<8;case 1:c^=t[4*i],c=c*f&o|c*g&s,c=c<<15|c>>>17,c=c*p&o|c*m&s,1&i?h^=c:d^=c}this.h1=h,this.h2=d}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1,e=3981806797*e&o|36045*e&s,t=4283543511*t&o|(2950163797*(t<<16|e>>>16)&o)>>>16,e^=t>>>1,e=444984403*e&o|60499*e&s,t=3301882366*t&o|(3120437893*(t<<16|e>>>16)&o)>>>16,e^=t>>>1;const n=(e>>>0).toString(16),r=(t>>>0).toString(16);return n.padStart(8,"0")+r.padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(1);class i{constructor({docId:e,onUnsupportedFeature:t,ownerDocument:n=globalThis.document,styleElement:o=null}){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this._document=n,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=this._document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].append(t));const n=t.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((n=>{const r=this._queueLoadingCallback(n);this._prepareFontLoadEvent([t],[e],r)}))}}_queueLoadingCallback(e){(0,r.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,r.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,r.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,n){(0,r.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let o;t.FontLoader=o,t.FontLoader=o=class extends i{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;if("undefined"==typeof navigator)e=!0;else{const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t?.[1]>=14&&(e=!0)}return(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,n={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(n),n}get _loadTestFont(){return(0,r.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,n){function i(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function o(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let s,a;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let u=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=o(d,976,h.length,h);const f=1482184792;let p=i(d,16);for(s=0,a=h.length-3;s30)return(0,r.warn)("Load test font never loaded."),void n();c.font="30px "+t,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(h,(()=>{y.remove(),n.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:r=!1,onUnsupportedFeature:i,fontRegistry:o=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===n,this.ignoreErrors=!0===r,this._onUnsupportedFeature=i,this.fontRegistry=o}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const r of n)"scale"===r.cmd&&(r.args=[t,-t]),e[r.cmd].apply(e,r.args)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(8),i=n(1),o=n(13),s=n(14),a=n(3);const l=4096,c=a.isNodeJS&&"undefined"==typeof Path2D?-1:1e3,u=16;class h{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return void 0!==this.cache[e]?(r=this.cache[e],this.canvasFactory.reset(r,t,n)):(r=this.canvasFactory.create(t,n),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function d(e,t,n,i,o,s,a,l,c,u){const[h,d,f,p,g,m]=(0,r.getCurrentTransform)(e);if(0===d&&0===f){const r=a*h+g,y=Math.round(r),v=l*p+m,b=Math.round(v),_=(a+c)*h+g,w=Math.abs(Math.round(_)-y)||1,x=(l+u)*p+m,S=Math.abs(Math.round(x)-b)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(p),y,b),e.drawImage(t,n,i,o,s,0,0,w,S),e.setTransform(h,d,f,p,g,m),[w,S]}if(0===h&&0===p){const r=l*f+g,y=Math.round(r),v=a*d+m,b=Math.round(v),_=(l+u)*f+g,w=Math.abs(Math.round(_)-y)||1,x=(a+c)*d+m,S=Math.abs(Math.round(x)-b)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,y,b),e.drawImage(t,n,i,o,s,0,0,S,w),e.setTransform(h,d,f,p,g,m),[S,w]}return e.drawImage(t,n,i,o,s,a,l,c,u),[Math.hypot(h,d)*c,Math.hypot(f,p)*u]}class f{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.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=i.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,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=i.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=i.Util.applyTransform(t,e),r=i.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],r[0]),this.minY=Math.min(this.minY,n[1],r[1]),this.maxX=Math.max(this.maxX,n[0],r[0]),this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(e,t){i.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,o,s,a,l,c,u){const h=i.Util.bezierBoundingBox(t,n,r,o,s,a,l,c);if(u)return u[0]=Math.min(u[0],h[0],h[2]),u[1]=Math.max(u[1],h[0],h[2]),u[2]=Math.min(u[2],h[1],h[3]),void(u[3]=Math.max(u[3],h[1],h[3]));this.updateRectMinMax(e,h)}getPathBoundingBox(e=o.PathType.FILL,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===o.PathType.STROKE){t||(0,i.unreachable)("Stroke bounding box must include transform.");const e=i.Util.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,o=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=o,n[2]+=r,n[3]+=o}return n}updateClipFromPath(){const e=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=o.PathType.FILL,t=null){return i.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function p(e,t,n=null){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const r=t.height,o=t.width,s=r%u,a=(r-s)/u,l=0===s?a:a+1,c=e.createImageData(o,u);let h,d=0;const f=t.data,p=c.data;let g,m,y,v,b,_,w,x;if(n)switch(n.length){case 1:b=n[0],_=n[0],w=n[0],x=n[0];break;case 4:b=n[0],_=n[1],w=n[2],x=n[3]}if(t.kind===i.ImageKind.GRAYSCALE_1BPP){const t=f.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),r=n.length,v=o+7>>3;let b=4294967295,_=i.FeatureTest.isLittleEndian?4278190080:255;for(x&&255===x[0]&&0===x[255]&&([b,_]=[_,b]),g=0;gv?o:8*e-7,s=-8&i;let a=0,l=0;for(;r>=1}for(;h=a&&(y=s,v=o*y),h=0,m=v;m--;)p[h++]=f[d++],p[h++]=f[d++],p[h++]=f[d++],p[h++]=255;if(t)for(let e=0;e>8,e[o-2]=e[o-2]*i+n*s>>8,e[o-1]=e[o-1]*i+r*s>>8}}}function b(e,t,n){const r=e.length,i=1/255;for(let o=3;o>8]>>8:t[i]*r>>16}}function w(e,t){const n=i.Util.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const o=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:n[0]<=o||n[1]<=o}const x=["butt","round","square"],S=["miter","round","bevel"],C={},E={};class k{constructor(e,t,n,r,i,o,s,a){this.ctx=e,this.current=new f(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.imageLayer=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=[],this.optionalContentConfig=o,this.cachedCanvases=new h(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=a?.background||null,this.foregroundColor=a?.foreground||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){const o=this.ctx.canvas.width,s=this.ctx.canvas.height,a=i||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const e=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const t=this.backgroundColor=this.ctx.fillStyle;let n=!0,i=a;if(this.ctx.fillStyle=a,i=this.ctx.fillStyle,n="string"==typeof i&&/^#[0-9A-Fa-f]{6}$/.test(i),"#000000"===e&&"#ffffff"===t||e===t||!n)this.foregroundColor=this.backgroundColor=null;else{const[n,o,s]=(0,r.getRGB)(i),a=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,l=Math.round(.2126*a(n)+.7152*a(o)+.0722*a(s));this.selectColor=(n,r,i)=>{const o=.2126*a(n)+.7152*a(r)+.0722*a(i);return Math.round(o)===l?t:e}}}if(this.ctx.fillStyle=this.backgroundColor||a,this.ctx.fillRect(0,0,o,s),this.ctx.restore(),n){const e=this.cachedCanvases.getCanvas("transparent",o,s);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),y(this.ctx,this.foregroundColor),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,r.getCurrentTransform)(this.ctx),this.imageLayer&&((0,r.deprecated)("The `imageLayer` functionality will be removed in the future."),this.imageLayer.beginLayout())}executeOperatorList(e,t,n,r){const o=e.argsArray,s=e.fnArray;let a=t||0;const l=o.length;if(l===a)return a;const c=l-a>10&&"function"==typeof n,u=c?Date.now()+15:0;let h=0;const d=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==r&&a===r.nextBreakPoint)return r.breakIt(a,n),a;if(p=s[a],p!==i.OPS.dependency)this[p].apply(this,o[a]);else for(const e of o[a]){const t=e.startsWith("g_")?d:f;if(!t.has(e))return t.get(e,n),a}if(a++,a===l)return a;if(c&&++h>10){if(Date.now()>u)return n(),a;h=0}}}#Z(){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)}endDrawing(){this.#Z(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(e,t){const n=e.width,r=e.height;let i,o,s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=r,u="prescale1";for(;s>2&&l>1||a>2&&c>1;){let t=l,n=c;s>2&&l>1&&(t=Math.ceil(l/2),s/=l/t),a>2&&c>1&&(n=Math.ceil(c/2),a/=c/n),i=this.cachedCanvases.getCanvas(u,t,n),o=i.context,o.clearRect(0,0,t,n),o.drawImage(e,0,0,l,c,0,0,t,n),e=i.canvas,l=t,c=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:s}=e,a=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(t);let u,h,f,p;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer,n=c.slice(0,4);h=JSON.stringify(l?n:[n,a]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const r=u.get(h);if(r&&!l)return{canvas:r,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};f=r}f||(p=this.cachedCanvases.getCanvas("maskCanvas",n,s),g(p.context,e));let m=i.Util.transform(c,[1/n,0,0,-1/s,0,0]);m=i.Util.transform(m,[1,0,0,1,0,-s]);const y=i.Util.applyTransform([0,0],m),v=i.Util.applyTransform([n,s],m),b=i.Util.normalizeRect([y[0],y[1],v[0],v[1]]),_=Math.round(b[2]-b[0])||1,x=Math.round(b[3]-b[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",_,x),C=S.context,E=Math.min(y[0],v[0]),k=Math.min(y[1],v[1]);C.translate(-E,-k),C.transform(...m),f||(f=this._scaleImage(p.canvas,(0,r.getCurrentTransformInverse)(C)),f=f.img,u&&l&&u.set(h,f)),C.imageSmoothingEnabled=w((0,r.getCurrentTransform)(C),e.interpolate),d(C,f,0,0,f.width,f.height,0,0,n,s),C.globalCompositeOperation="source-in";const P=i.Util.transform((0,r.getCurrentTransformInverse)(C),[1,0,0,1,-E,-k]);return C.fillStyle=l?a.getPattern(t,this,P,o.PathType.FILL):a,C.fillRect(0,0,n,s),u&&!l&&(this.cachedCanvases.delete("fillCanvas"),u.set(h,S.canvas)),{canvas:S.canvas,offsetX:Math.round(E),offsetY:Math.round(k)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=x[e]}setLineJoin(e){this.ctx.lineJoin=S[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let t=0,n=e.length;t{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,o,s){t.transform(e,n,r,i,o,s),this.__originalTransform(e,n,r,i,o,s)},e.setTransform=function(e,n,r,i,o,s){t.setTransform(e,n,r,i,o,s),this.__originalSetTransform(e,n,r,i,o,s)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,o,s){t.bezierCurveTo(e,n,r,i,o,s),this.__originalBezierCurveTo(e,n,r,i,o,s)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(o,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),m(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;(function(e,t,n,r){const i=r[0],o=r[1],s=r[2]-i,a=r[3]-o;0!==s&&0!==a&&(function(e,t,n,r,i,o,s,a,l,c,u){const h=!!o,d=h?o[0]:0,f=h?o[1]:0,p=h?o[2]:0;let g;g="Luminosity"===i?_:b;const m=Math.min(r,Math.ceil(1048576/n));for(let i=0;i100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${a} ${s} ${c}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,o){this.current.textMatrix=[e,t,n,r,i,o],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,o){const s=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,u=a.fontSize/a.fontSizeScale,h=c&i.TextRenderingMode.FILL_STROKE_MASK,d=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),f=a.patternFill&&!l.missingFile;let p;(l.disableFontFace||d||f)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||f?(s.save(),s.translate(t,n),s.beginPath(),p(s,u),o&&s.setTransform(...o),h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||s.fill(),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||s.fillText(e,t,n),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||s.strokeText(e,t,n)),d&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,r.getCurrentTransform)(s),x:t,y:n,fontSize:u,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e0&&t[e]<255){n=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const s=t.fontSize;if(0===s)return;const a=this.ctx,l=t.fontSizeScale,c=t.charSpacing,u=t.wordSpacing,h=t.fontDirection,d=t.textHScale*h,f=e.length,p=n.vertical,g=p?1:-1,m=n.defaultVMetrics,y=s*t.fontMatrix[0],v=t.textRenderingMode===i.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(a.save(),a.transform(...t.textMatrix),a.translate(t.x,t.y+t.textRise),h>0?a.scale(d,-1):a.scale(d,1),t.patternFill){a.save();const e=t.fillColor.getPattern(a,this,(0,r.getCurrentTransformInverse)(a),o.PathType.FILL);b=(0,r.getCurrentTransform)(a),a.restore(),a.fillStyle=e}let _=t.lineWidth;const w=t.textMatrixScale;if(0===w||0===_){const e=t.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;e!==i.TextRenderingMode.STROKE&&e!==i.TextRenderingMode.FILL_STROKE||(_=this.getSinglePixelWidth())}else _/=w;1!==l&&(a.scale(l,l),_/=l),a.lineWidth=_;let x,S=0;for(x=0;x0){const e=1e3*a.measureText(o).width/s*l;if(Cnew k(e,this.commonObjs,this.objs,this.canvasFactory)};t=new o.TilingPattern(e,n,this.ctx,s,i)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const r=this.selectColor?.(e,t,n)||i.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,t,n){const r=this.selectColor?.(e,t,n)||i.Util.makeHexColor(e,t,n);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=(0,o.getShadingPattern)(this.objs.get(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),o.PathType.SHADING);const s=(0,r.getCurrentTransformInverse)(t);if(s){const e=t.canvas,n=e.width,r=e.height,o=i.Util.applyTransform([0,0],s),a=i.Util.applyTransform([0,r],s),l=i.Util.applyTransform([n,0],s),c=i.Util.applyTransform([n,r],s),u=Math.min(o[0],a[0],l[0],c[0]),h=Math.min(o[1],a[1],l[1],c[1]),d=Math.max(o[0],a[0],l[0],c[0]),f=Math.max(o[1],a[1],l[1],c[1]);this.ctx.fillRect(u,h,d-u,f-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,r.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,i.info)("TODO: Support non-isolated groups."),e.knockout&&(0,i.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=i.Util.getAxialAlignedBoundingBox(e.bbox,(0,r.getCurrentTransform)(t));const s=[0,0,t.canvas.width,t.canvas.height];o=i.Util.intersect(o,s)||[0,0,0,0];const a=Math.floor(o[0]),c=Math.floor(o[1]);let u=Math.max(Math.ceil(o[2])-a,1),h=Math.max(Math.ceil(o[3])-c,1),d=1,f=1;u>l&&(d=u/l,u=l),h>l&&(f=h/l,h=l),this.current.startNewPathAndClipBox([0,0,u,h]);let p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(p,u,h),y=g.context;y.scale(1/d,1/f),y.translate(-a,-c),y.transform(...n),e.smask?this.smaskStack.push({canvas:g.canvas,context:y,offsetX:a,offsetY:c,scaleX:d,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,c),t.scale(d,f),t.save()),m(t,y),this.ctx=y,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,r.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=i.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,o,s){if(this.#Z(),y(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const o=t[2]-t[0],a=t[3]-t[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=o,t[3]=a;const[s,l]=i.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),h=Math.ceil(a*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,h);const{canvas:d,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.setTransform(s,0,0,-l,0,a*l),y(this.ctx,this.foregroundColor)}else y(this.ctx,this.foregroundColor),this.ctx.rect(t[0],t[1],o,a),this.ctx.clip(),this.endPath()}this.current=new f(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){const{width:t,height:n}=e;if(t>c||n>c)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let o,s,a,l=new Uint8Array(i*(n+1));const u=t+7&-8;let h=new Uint8Array(u*n),d=0;for(const t of e.data){let e=128;for(;e>0;)h[d++]=t&e?0:255,e>>=1}let f=0;for(d=0,0!==h[d]&&(l[0]=1,++f),s=1;s>2)+(h[d+1]?4:0)+(h[d-u+1]?8:0),r[e]&&(l[a+s]=r[e],++f),d++;if(h[d-u]!==h[d]&&(l[a+s]=h[d]?2:4,++f),f>1e3)return null}for(d=u*(n-1),a=o*i,0!==h[d]&&(l[a]=8,++f),s=1;s1e3)return null;const p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),g=new Path2D;for(o=0;f&&o<=n;o++){let e=o*i;const n=e+t;for(;e>4,l[e]&=s>>2|s<<2),g.lineTo(e%i,e/i|0),l[e]||--f}while(r!==e);--o}return h=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(g),e.beginPath(),e.restore()}}(e)),r.compiled))return void r.compiled(n);const i=this._createMaskCanvas(e),o=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,o=0,s,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(t,n,o,s,0,0);const u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,0,0);for(let e=0,r=a.length;et?s/t:1,i=o>t?o/t:1}}this._cachedScaleForStroking=[n,i]}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[i,o]=this.getScaleForStroking();if(t.lineWidth=n||1,1===i&&1===o)return void t.stroke();let s,a,l;e&&(s=(0,r.getCurrentTransform)(t),a=t.getLineDash().slice(),l=t.lineDashOffset),t.scale(i,o);const c=Math.max(i,o);t.setLineDash(t.getLineDash().map((e=>e/c))),t.lineDashOffset/=c,t.stroke(),e&&(t.setTransform(...s),t.setLineDash(a),t.lineDashOffset=l)}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=k;for(const e in i.OPS)void 0!==k.prototype[e]&&(k.prototype[i.OPS[e]]=k.prototype[e])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new c(e);case"Mesh":return new d(e);case"Dummy":return new f}throw new Error(`Unknown IR type: ${e[0]}`)};var r=n(1),i=n(8),o=n(3);const s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(e,t){if(!t||o.isNodeJS)return;const n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}t.PathType=s;class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class c extends l{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,o){let l;if(o===s.STROKE||o===s.FILL){const s=t.current.getClippedPathBoundingBox(o,(0,i.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(s[2]-s[0])||1,u=Math.ceil(s[3]-s[1])||1,h=t.cachedCanvases.getCanvas("pattern",c,u,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),n=r.Util.transform(n,[1,0,0,1,s[0],s[1]]),d.transform(...t.baseTransform),this.matrix&&d.transform(...this.matrix),a(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),l=e.createPattern(h.canvas,"no-repeat");const f=new DOMMatrix(n);try{l.setTransform(f)}catch(e){(0,r.warn)(`RadialAxialShadingPattern.getPattern: "${e?.message}".`)}}else a(e,this._bbox),l=this._createGradient(e);return l}}function u(e,t,n,r,i,o,s,a){const l=t.coords,c=t.colors,u=e.data,h=4*e.width;let d;l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=o,o=s,s=d),l[r+1]>l[i+1]&&(d=r,r=i,i=d,d=s,s=a,a=d),l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=o,o=s,s=d);const f=(l[n]+t.offsetX)*t.scaleX,p=(l[n+1]+t.offsetY)*t.scaleY,g=(l[r]+t.offsetX)*t.scaleX,m=(l[r+1]+t.offsetY)*t.scaleY,y=(l[i]+t.offsetX)*t.scaleX,v=(l[i+1]+t.offsetY)*t.scaleY;if(p>=v)return;const b=c[o],_=c[o+1],w=c[o+2],x=c[s],S=c[s+1],C=c[s+2],E=c[a],k=c[a+1],P=c[a+2],A=Math.round(p),T=Math.round(v);let R,O,M,I,D,F,L,N;for(let e=A;e<=T;e++){if(ev?1:m===v?0:(m-e)/(m-v),R=g-(g-y)*t,O=x-(x-E)*t,M=S-(S-k)*t,I=C-(C-P)*t}let t;t=ev?1:(p-e)/(p-v),D=f-(f-y)*t,F=b-(b-E)*t,L=_-(_-k)*t,N=w-(w-P)*t;const n=Math.round(Math.min(R,D)),r=Math.round(Math.max(R,D));let i=h*e+4*n;for(let e=n;e<=r;e++)t=(R-e)/(R-D),t<0?t=0:t>1&&(t=1),u[i++]=O-(O-F)*t|0,u[i++]=M-(M-L)*t|0,u[i++]=I-(I-N)*t|0,u[i++]=255}}function h(e,t,n){const r=t.coords,i=t.colors;let o,s;switch(t.type){case"lattice":const a=t.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(o=0;o=r?i=r:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,r,o){const s=r-t,a=o-n;e.ctx.rect(t,n,s,a),e.current.updateRectMinMax((0,i.getCurrentTransform)(e.ctx),[t,n,r,o]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,o=e.current;switch(t){case 1:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,o.fillColor=e.fillStyle,o.strokeColor=e.strokeStyle;break;case 2:const s=r.Util.makeHexColor(n[0],n[1],n[2]);i.fillStyle=s,i.strokeStyle=s,o.fillColor=s,o.strokeColor=s;break;default:throw new r.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,i){let o=n;i!==s.SHADING&&(o=r.Util.transform(o,t.baseTransform),this.matrix&&(o=r.Util.transform(o,this.matrix)));const a=this.createPatternCanvas(t);let l=new DOMMatrix(o);l=l.translate(a.offsetX,a.offsetY),l=l.scale(1/a.scaleX,1/a.scaleY);const c=e.createPattern(a.canvas,"repeat");try{c.setTransform(l)}catch(e){(0,r.warn)(`TilingPattern.getPattern: "${e?.message}".`)}return c}}t.TilingPattern=p},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.applyMaskImageData=function({src:e,srcPos:t=0,dest:n,destPos:i=0,width:o,height:s,inverseDecode:a=!1}){const l=r.FeatureTest.isLittleEndian?4278190080:255,[c,u]=a?[0,l]:[l,0],h=o>>3,d=7&o,f=e.length;n=new Uint32Array(n.buffer);for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(1);function i(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,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=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(i(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,o=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){n.postMessage({sourceName:e,targetName:o,callback:1,callbackId:t.callbackId,data:r})}),(function(r){n.postMessage({sourceName:e,targetName:o,callback:2,callbackId:t.callbackId,reason:i(r)})}))}else t.streamId?this._createStreamSink(t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const i=this.callbackId++,o=(0,r.createPromiseCapability)();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(e){o.reject(e)}return o.promise}sendWithStream(e,t,n,o){const s=this.streamId++,a=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const i=(0,r.createPromiseCapability)();return this.streamControllers[s]={controller:n,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:l,action:e,streamId:s,data:t,desiredSize:n.desiredSize},o),i.promise},pull:e=>{const t=(0,r.createPromiseCapability)();return this.streamControllers[s].pullCall=t,c.postMessage({sourceName:a,targetName:l,stream:6,streamId:s,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();return this.streamControllers[s].cancelCall=t,this.streamControllers[s].isClosed=!0,c.postMessage({sourceName:a,targetName:l,stream:1,streamId:s,reason:i(e)}),t.promise}},n)}_createStreamSink(e){const t=e.streamId,n=this.sourceName,o=e.sourceName,s=this.comObj,a=this,l=this.actionHandler[e.action],c={enqueue(e,i=1,a){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=i,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,r.createPromiseCapability)(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:n,targetName:o,stream:4,streamId:t,chunk:e},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:o,stream:3,streamId:t}),delete a.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:o,stream:5,streamId:t,reason:i(e)}))},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[t]=c,new Promise((function(t){t(l(e.data,c))})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:8,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:8,streamId:t,reason:i(e)})}))}_processStreamMessage(e){const t=e.streamId,n=this.sourceName,o=e.sourceName,s=this.comObj,a=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case 8:e.success?a.startCall.resolve():a.startCall.reject(i(e.reason));break;case 7:e.success?a.pullCall.resolve():a.pullCall.reject(i(e.reason));break;case 6:if(!l){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,new Promise((function(e){e(l.onPull&&l.onPull())})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:7,streamId:t,reason:i(e)})}));break;case 4:if((0,r.assert)(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case 3:if((0,r.assert)(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this._deleteStreamController(a,t);break;case 5:(0,r.assert)(a,"error should have stream controller"),a.controller.error(i(e.reason)),this._deleteStreamController(a,t);break;case 2:e.success?a.cancelCall.resolve():a.cancelCall.reject(i(e.reason)),this._deleteStreamController(a,t);break;case 1:if(!l)break;new Promise((function(t){t(l.onCancel&&l.onCancel(i(e.reason)))})).then((function(){s.postMessage({sourceName:n,targetName:o,stream:2,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:n,targetName:o,stream:2,streamId:t,reason:i(e)})})),l.sinkCapability.reject(i(e.reason)),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1);t.Metadata=class{#Q;#J;constructor({parsedData:e,rawData:t}){this.#Q=e,this.#J=t}getRaw(){return this.#J}get(e){return this.#Q.get(e)??null}getAll(){return(0,r.objectFromMap)(this.#Q)}has(e){return this.#Q.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1);const i=Symbol("INTERNAL");class o{#ee=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#ee}_setVisible(e,t){e!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#ee=t}}t.OptionalContentConfig=class{#te=!0;#ne=new Map;#re=null;#ie=null;constructor(e){if(this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#ie=e.order;for(const t of e.groups)this.#ne.set(t.id,new o(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#ne.values())e._setVisible(i,!1);for(const t of e.on)this.#ne.get(t)._setVisible(i,!0);for(const t of e.off)this.#ne.get(t)._setVisible(i,!1);this.#re=new Map;for(const[e,t]of this.#ne)this.#re.set(e,t.visible)}}#oe(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i0?(0,r.objectFromMap)(this.#ne):null}getGroup(e){return this.#ne.get(e)||null}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(1),i=n(8);t.PDFDataTransportStream=class{constructor(e,t){(0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1,this._contentDispositionFilename=e.contentDispositionFilename||null;const n=e.initialData;if(n?.length>0){const e=new Uint8Array(n).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const n=this._rangeReaders.some((function(n){return n._begin===e.begin&&(n._enqueue(t),!0)}));(0,r.assert)(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t?.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t?.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new o(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class o{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=(0,i.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){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 s{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){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,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){if(!r)return;let i=null;const o=r.name;if("#text"===o)i=r.value;else{if(!n.shouldBuildText(o))return;r?.attributes?.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(null!==i&&t.push({str:i}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var r=n(9);const i=function(e){return new Promise(((t,n)=>{__webpack_require__(3237).readFile(e,((e,r)=>{!e&&r?t(new Uint8Array(r)):n(new Error(e))}))}))};class o extends r.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(7640).createCanvas(e,t)}}t.NodeCanvasFactory=o;class s extends r.BaseCMapReaderFactory{_fetchData(e,t){return i(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=s;class a extends r.BaseStandardFontDataFactory{_fetchData(e){return i(e)}}t.NodeStandardFontDataFactory=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(7),i=n(1),o=n(23),s=n(24);class a{#se;#ae=!1;#le=this.pointerup.bind(this);#ce=this.pointerdown.bind(this);#ue=new Map;#he=!1;#de=!1;#fe;static _initialized=!1;constructor(e){a._initialized||(a._initialized=!0,o.FreeTextEditor.initialize(e.l10n),s.InkEditor.initialize(e.l10n),e.uiManager.registerEditorTypes([o.FreeTextEditor,s.InkEditor])),this.#fe=e.uiManager,this.annotationStorage=e.annotationStorage,this.pageIndex=e.pageIndex,this.div=e.div,this.#se=e.accessibilityManager,this.#fe.addLayer(this)}updateToolbar(e){this.#fe.updateToolbar(e)}updateMode(e=this.#fe.getMode()){this.#pe(),e===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#fe.unselectAll()}addInkEditorIfNeeded(e){if(e||this.#fe.getMode()===i.AnnotationEditorType.INK){if(!e)for(const e of this.#ue.values())if(e.isEmpty())return void e.setInBackground();this.#ge({offsetX:0,offsetY:0}).setInBackground()}}setEditingState(e){this.#fe.setEditingState(e)}addCommands(e){this.#fe.addCommands(e)}enable(){this.div.style.pointerEvents="auto";for(const e of this.#ue.values())e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const e of this.#ue.values())e.disableEditing()}setActiveEditor(e){this.#fe.getActive()!==e&&this.#fe.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#ce),this.div.addEventListener("pointerup",this.#le)}disableClick(){this.div.removeEventListener("pointerdown",this.#ce),this.div.removeEventListener("pointerup",this.#le)}attach(e){this.#ue.set(e.id,e)}detach(e){this.#ue.delete(e.id),this.#se?.removePointerInTextLayer(e.contentDiv)}remove(e){this.#fe.removeEditor(e),this.detach(e),this.annotationStorage.remove(e.id),e.div.style.display="none",setTimeout((()=>{e.div.style.display="",e.div.remove(),e.isAttachedToDOM=!1,document.activeElement===document.body&&this.#fe.focusMainContainer()}),0),this.#de||this.addInkEditorIfNeeded(!1)}#me(e){e.parent!==this&&(this.attach(e),e.pageIndex=this.pageIndex,e.parent?.detach(e),e.parent=this,e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.#me(e),this.#fe.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}this.moveEditorInDOM(e),e.onceAdded(),this.addToAnnotationStorage(e)}moveEditorInDOM(e){this.#se?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addToAnnotationStorage(e){e.isEmpty()||this.annotationStorage.has(e.id)||this.annotationStorage.setValue(e.id,e)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addANewEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!0})}addUndoableEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#fe.getId()}#ye(e){switch(this.#fe.getMode()){case i.AnnotationEditorType.FREETEXT:return new o.FreeTextEditor(e);case i.AnnotationEditorType.INK:return new s.InkEditor(e)}return null}deserialize(e){switch(e.annotationType){case i.AnnotationEditorType.FREETEXT:return o.FreeTextEditor.deserialize(e,this);case i.AnnotationEditorType.INK:return s.InkEditor.deserialize(e,this)}return null}#ge(e){const t=this.getNextId(),n=this.#ye({parent:this,id:t,x:e.offsetX,y:e.offsetY});return n&&this.add(n),n}setSelected(e){this.#fe.setSelected(e)}toggleSelected(e){this.#fe.toggleSelected(e)}isSelected(e){return this.#fe.isSelected(e)}unselect(e){this.#fe.unselect(e)}pointerup(e){const t=r.KeyboardManager.platform.isMac;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#he&&(this.#he=!1,this.#ae?this.#ge(e):this.#ae=!0)}pointerdown(e){const t=r.KeyboardManager.platform.isMac;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#he=!0;const n=this.#fe.getActive();this.#ae=!n||n.isEmpty()}drop(e){const t=e.dataTransfer.getData("text/plain"),n=this.#fe.getEditor(t);if(!n)return;e.preventDefault(),e.dataTransfer.dropEffect="move",this.#me(n);const r=this.div.getBoundingClientRect(),i=e.clientX-r.x,o=e.clientY-r.y;n.translate(i-n.startX,o-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(e){e.preventDefault()}destroy(){this.#fe.getActive()?.parent===this&&this.#fe.setActiveEditor(null);for(const e of this.#ue.values())this.#se?.removePointerInTextLayer(e.contentDiv),e.isAttachedToDOM=!1,e.div.remove(),e.parent=null;this.div=null,this.#ue.clear(),this.#fe.removeLayer(this)}#pe(){this.#de=!0;for(const e of this.#ue.values())e.isEmpty()&&e.remove();this.#de=!1}render(e){this.viewport=e.viewport,(0,r.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions();for(const e of this.#fe.getEditors(this.pageIndex))this.add(e);this.updateMode()}update(e){this.viewport=e.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[e,t,n,r]=this.viewport.viewBox;return[n-e,r-t]}get viewportBaseDimensions(){const{width:e,height:t,rotation:n}=this.viewport;return n%180==0?[e,t]:[t,e]}setDimensions(){const{width:e,height:t,rotation:n}=this.viewport,r=n%180!=0,i=Math.floor(e)+"px",o=Math.floor(t)+"px";this.div.style.width=r?o:i,this.div.style.height=r?i:o,this.div.setAttribute("data-main-rotation",n)}}t.AnnotationEditorLayer=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var r=n(1),i=n(7),o=n(6);class s extends o.AnnotationEditor{#ve=this.editorDivBlur.bind(this);#be=this.editorDivFocus.bind(this);#_e=this.editorDivKeydown.bind(this);#we;#xe="";#Se=!1;#Ce;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new i.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],s.prototype.commitOrRemove]]);static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#we=e.color||s._defaultColor||o.AnnotationEditor._defaultLineColor,this.#Ce=e.fontSize||s._defaultFontSize}static initialize(e){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_aria_label"].map((t=>[t,e.get(t)])));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:s._defaultFontSize=t;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:s._defaultColor=t}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ee(t);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#ke(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,s._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,s._defaultColor||o.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#Ce],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#we]]}#Ee(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#Ce)*this.parent.scaleFactor),this.#Ce=e,this.#Pe()},n=this.#Ce;this.parent.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ke(e){const t=this.#we;this.parent.addCommands({cmd:()=>{this.#we=e,this.editorDiv.style.color=e},undo:()=>{this.#we=t,this.editorDiv.style.color=t},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){return[-s._internalPadding*this.parent.scaleFactor,-(s._internalPadding+this.#Ce)*this.parent.scaleFactor]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.enableEditing(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.editorDiv.addEventListener("keydown",this.#_e),this.editorDiv.addEventListener("focus",this.#be),this.editorDiv.addEventListener("blur",this.#ve))}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",this.#_e),this.editorDiv.removeEventListener("focus",this.#be),this.editorDiv.removeEventListener("blur",this.#ve),this.div.focus(),this.isEditing=!1)}focusin(e){super.focusin(e),e.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()}#Ae(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(let n=0,r=e.length;nthis.editorDiv?.setAttribute("aria-label",e))),s._l10nPromise.get("free_text_default_content").then((e=>this.editorDiv?.setAttribute("default-content",e))),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#Ce}px * var(--scale-factor))`,n.color=this.#we,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parent.viewportBaseDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r);for(const e of this.#xe.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}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(e,t){const n=super.deserialize(e,t);return n.#Ce=e.fontSize,n.#we=r.Util.makeHexColor(...e.color),n.#xe=e.value,n}serialize(){if(this.isEmpty())return null;const e=s._internalPadding*this.parent.scaleFactor,t=this.getRect(e,e),n=o.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#Ce,value:this.#xe,pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}t.FreeTextEditor=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return o.fitCurve}});var r=n(1),i=n(6),o=n(25),s=n(7);const a=16;class l extends i.AnnotationEditor{#Te=0;#Re=0;#Oe=0;#Me=this.canvasPointermove.bind(this);#Ie=this.canvasPointerleave.bind(this);#De=this.canvasPointerup.bind(this);#Fe=this.canvasPointerdown.bind(this);#Le=!1;#Ne=!1;#je=null;#ze=null;#Be=0;#Ue=0;#Ve=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink_aria_label"].map((t=>[t,e.get(t)])))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=t;break;case r.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=t;break;case r.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=t/100}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#We(t);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#ke(t);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#$e(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#We(e){const t=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=e,this.#qe()},undo:()=>{this.thickness=t,this.#qe()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ke(e){const t=this.color;this.parent.addCommands({cmd:()=>{this.color=e,this.#He()},undo:()=>{this.color=t,this.#He()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#$e(e){e/=100;const t=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=e,this.#He()},undo:()=>{this.opacity=t,this.#He()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#Ge(),this.#Xe()),this.isAttachedToDOM||(this.parent.add(this),this.#Ye()),this.#qe())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#ze.disconnect(),this.#ze=null,super.remove())}enableEditMode(){this.#Le||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#Fe),this.canvas.addEventListener("pointerup",this.#De))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Fe),this.canvas.removeEventListener("pointerup",this.#De))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Ke(){const{width:e,height:t,rotation:n}=this.parent.viewport;switch(n){case 90:return[0,e,e,t];case 180:return[e,t,e,t];case 270:return[t,0,e,t];default:return[0,0,e,t]}}#Ze(){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,s.opacityToHex)(this.opacity)}`}#Qe(e,t){this.isEditing=!0,this.#Ne||(this.#Ne=!0,this.#Ye(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||i.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([e,t]),this.#je=null,this.#Ze(),this.ctx.beginPath(),this.ctx.moveTo(e,t),this.#Ve=()=>{this.#Ve&&(this.#je&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):this.#He(),this.ctx.lineTo(...this.#je),this.#je=null,this.ctx.stroke()),window.requestAnimationFrame(this.#Ve))},window.requestAnimationFrame(this.#Ve)}#Je(e,t){const[n,r]=this.currentPath.at(-1);e===n&&t===r||(this.currentPath.push([e,t]),this.#je=[e,t])}#et(e,t){this.ctx.closePath(),this.#Ve=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height);const[n,r]=this.currentPath.at(-1);let i;if(e===n&&t===r||this.currentPath.push([e,t]),1!==this.currentPath.length)i=(0,o.fitCurve)(this.currentPath,30,null);else{const n=[e,t];i=[[n,n.slice(),n.slice(),n]]}const s=l.#tt(i);this.currentPath.length=0,this.parent.addCommands({cmd:()=>{this.paths.push(i),this.bezierPath2D.push(s),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Ge(),this.#Xe()),this.#qe())},mustExec:!0})}#He(){if(this.isEmpty())return void this.#nt();this.#Ze();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#nt();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#Le||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Le=!0,this.div.classList.add("disabled"),this.#qe(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus())}focusin(e){super.focusin(e),this.enableEditMode()}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#Le&&(this.setInForeground(),"mouse"!==e.type&&this.div.focus(),e.stopPropagation(),this.canvas.addEventListener("pointerleave",this.#Ie),this.canvas.addEventListener("pointermove",this.#Me),this.#Qe(e.offsetX,e.offsetY))}canvasPointermove(e){e.stopPropagation(),this.#Je(e.offsetX,e.offsetY)}canvasPointerup(e){0===e.button&&this.isInEditMode()&&0!==this.currentPath.length&&(e.stopPropagation(),this.#rt(e),this.setInBackground())}canvasPointerleave(e){this.#rt(e),this.setInBackground()}#rt(e){this.#et(e.offsetX,e.offsetY),this.canvas.removeEventListener("pointerleave",this.#Ie),this.canvas.removeEventListener("pointermove",this.#Me),this.parent.addToAnnotationStorage(this)}#Ge(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>this.canvas?.setAttribute("aria-label",e))),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Xe(){this.#ze=new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)})),this.#ze.observe(this.div)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),l._l10nPromise.get("editor_ink_aria_label").then((e=>this.div?.setAttribute("aria-label",e)));const[n,r,i,o]=this.#Ke();if(this.setAt(n,r,0,0),this.setDims(i,o),this.#Ge(),this.width){const[n,r]=this.parent.viewportBaseDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this.#Ne=!0,this.#Ye(),this.setDims(this.width*n,this.height*r),this.#He(),this.#it(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#Xe(),this.div}#Ye(){if(!this.#Ne)return;const[e,t]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#nt()}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if(this.#Be===n&&this.#Ue===r)return;this.#Be=n,this.#Ue=r,this.canvas.style.visibility="hidden",this.#Te&&Math.abs(this.#Te-e/t)>.01&&(t=Math.ceil(e/this.#Te),this.setDims(e,t));const[i,o]=this.parent.viewportBaseDimensions;this.width=e/i,this.height=t/o,this.#Le&&this.#ot(e,t),this.#Ye(),this.#He(),this.canvas.style.visibility="visible"}#ot(e,t){const n=this.#st(),r=(e-n)/this.#Oe,i=(t-n)/this.#Re;this.scaleFactor=Math.min(r,i)}#nt(){const e=this.#st()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#tt(e){const t=new Path2D;for(let n=0,r=e.length;n=1?(e.minHeight="16px",e.minWidth=`${Math.round(this.#Te*a)}px`):(e.minWidth="16px",e.minHeight=`${Math.round(a/this.#Te)}px`)}static deserialize(e,t){const n=super.deserialize(e,t);n.thickness=e.thickness,n.color=r.Util.makeHexColor(...e.color),n.opacity=e.opacity;const[i,o]=t.pageDimensions,s=n.width*i,l=n.height*o,c=t.scaleFactor,u=e.thickness/2;n.#Te=s/l,n.#Le=!0,n.#Be=Math.round(s),n.#Ue=Math.round(l);for(const{bezier:t}of e.paths){const e=[];n.paths.push(e);let r=c*(t[0]-u),i=c*(l-t[1]-u);for(let n=2,o=t.length;n{Object.defineProperty(t,"__esModule",{value:!0}),t.fitCurve=void 0;const r=n(26);t.fitCurve=r},e=>{function t(e,i,o,s,a){var c,u,h,d,f,p,g,m,y,v,b,_,w;if(2===e.length)return _=l.vectorLen(l.subtract(e[0],e[1]))/3,[c=[e[0],l.addArrays(e[0],l.mulItems(i,_)),l.addArrays(e[1],l.mulItems(o,_)),e[1]]];if(u=function(e){var t,n,r,i=[];return e.forEach(((e,o)=>{t=o?n+l.vectorLen(l.subtract(e,r)):0,i.push(t),n=t,r=e})),i=i.map((e=>e/n))}(e),[c,d,p]=n(e,u,u,i,o,a),0===d||d.9999&&e<1.0001)break}f=d,g=p}return b=[],(m=l.subtract(e[p-1],e[p+1])).every((e=>0===e))&&(m=l.subtract(e[p-1],e[p]),[m[0],m[1]]=[-m[1],m[0]]),y=l.normalize(m),v=l.mulItems(y,-1),(b=b.concat(t(e.slice(0,p+1),i,y,s,a))).concat(t(e.slice(p),v,o,s,a))}function n(e,t,n,r,i,a){var u,h,d;return u=function(e,t,n,r){var i,o,s,a,u,h,d,f,p,g,m,y,v,b,_,w,x,S=e[0],C=e[e.length-1];for(i=[S,null,null,C],o=l.zeros_Xx2x2(t.length),v=0,b=t.length;vi&&(i=r,a=h);return[i,a]}(e,u,t),a&&a({bez:u,points:e,params:t,maxErr:h,maxPoint:d}),[u,h,d]}function r(e,t,n){return n.map(((n,r)=>i(e,t[r],n)))}function i(e,t,n){var r=l.subtract(c.q(e,n),t),i=c.qprime(e,n),o=l.mulMatrix(r,i),s=l.sum(l.squareItems(i))+2*l.mulMatrix(r,c.qprimeprime(e,n));return 0===s?n:n-o/s}var o=function(e,t){for(var n,r=[0],i=e[0],o=0,s=1;s<=t;s++)n=c.q(e,s/t),o+=l.vectorLen(l.subtract(n,i)),r.push(o),i=n;return r.map((e=>e/o))};function s(e,t,n,r){if(t<0)return 0;if(t>1)return 1;for(var i,o,s,a,l=1;l<=r;l++)if(t<=n[l]){s=(l-1)/r,o=l/r,a=(t-(i=n[l-1]))/(n[l]-i)*(o-s)+s;break}return a}function a(e,t){return l.normalize(l.subtract(e,t))}class l{static zeros_Xx2x2(e){for(var t=[];e--;)t.push([0,0]);return t}static mulItems(e,t){return e.map((e=>e*t))}static mulMatrix(e,t){return e.reduce(((e,n,r)=>e+n*t[r]),0)}static subtract(e,t){return e.map(((e,n)=>e-t[n]))}static addArrays(e,t){return e.map(((e,n)=>e+t[n]))}static addItems(e,t){return e.map((e=>e+t))}static sum(e){return e.reduce(((e,t)=>e+t))}static dot(e,t){return l.mulMatrix(e,t)}static vectorLen(e){return Math.hypot(...e)}static divItems(e,t){return e.map((e=>e/t))}static squareItems(e){return e.map((e=>e*e))}static normalize(e){return this.divItems(e,this.vectorLen(e))}}class c{static q(e,t){var n=1-t,r=l.mulItems(e[0],n*n*n),i=l.mulItems(e[1],3*n*n*t),o=l.mulItems(e[2],3*n*t*t),s=l.mulItems(e[3],t*t*t);return l.addArrays(l.addArrays(r,i),l.addArrays(o,s))}static qprime(e,t){var n=1-t,r=l.mulItems(l.subtract(e[1],e[0]),3*n*n),i=l.mulItems(l.subtract(e[2],e[1]),6*n*t),o=l.mulItems(l.subtract(e[3],e[2]),3*t*t);return l.addArrays(l.addArrays(r,i),o)}static qprimeprime(e,t){return l.addArrays(l.mulItems(l.addArrays(l.subtract(e[2],l.mulItems(e[1],2)),e[0]),6*(1-t)),l.mulItems(l.addArrays(l.subtract(e[3],l.mulItems(e[2],2)),e[1]),6*t))}}e.exports=function(e,n,r){if(!Array.isArray(e))throw new TypeError("First argument should be an array");if(e.forEach((t=>{if(!Array.isArray(t)||t.some((e=>"number"!=typeof e))||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")})),(e=e.filter(((t,n)=>0===n||!t.every(((t,r)=>t===e[n-1][r]))))).length<2)return[];const i=e.length,o=a(e[1],e[0]),s=a(e[i-2],e[i-1]);return t(e,o,s,n,r)},e.exports.fitCubic=t,e.exports.createTangent=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var r=n(1),i=n(8),o=n(5),s=n(28),a=n(29);const l=1e3,c=new WeakSet;function u(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class h{static create(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new f(e);case r.AnnotationType.TEXT:return new p(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new m(e);case"Btn":return e.data.radioButton?new v(e):e.data.checkBox?new y(e):new b(e);case"Ch":return new _(e)}return new g(e);case r.AnnotationType.POPUP:return new w(e);case r.AnnotationType.FREETEXT:return new S(e);case r.AnnotationType.LINE:return new C(e);case r.AnnotationType.SQUARE:return new E(e);case r.AnnotationType.CIRCLE:return new k(e);case r.AnnotationType.POLYLINE:return new P(e);case r.AnnotationType.CARET:return new T(e);case r.AnnotationType.INK:return new R(e);case r.AnnotationType.POLYGON:return new A(e);case r.AnnotationType.HIGHLIGHT:return new O(e);case r.AnnotationType.UNDERLINE:return new M(e);case r.AnnotationType.SQUIGGLY:return new I(e);case r.AnnotationType.STRIKEOUT:return new D(e);case r.AnnotationType.STAMP:return new F(e);case r.AnnotationType.FILEATTACHMENT:return new L(e);default:return new d(e)}}}class d{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this._mouseState=e.mouseState,t&&(this.container=this._createContainer(n)),r&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e=!1){const t=this.data,n=this.page,i=this.viewport,o=document.createElement("section"),{width:s,height:a}=u(t.rect),[l,c,h,d]=i.viewBox,f=h-l,p=d-c;o.setAttribute("data-annotation-id",t.id);const g=r.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){o.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;o.style.borderRadius=t}else if(this instanceof v){const e=`calc(${s}px * var(--scale-factor)) / calc(${a}px * var(--scale-factor))`;o.style.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid"}const i=t.borderColor||null;i?o.style.borderColor=r.Util.makeHexColor(0|i[0],0|i[1],0|i[2]):o.style.borderWidth=0}o.style.left=100*(g[0]-l)/f+"%",o.style.top=100*(g[1]-c)/p+"%";const{rotation:m}=t;return t.hasOwnCanvas||0===m?(o.style.width=100*s/f+"%",o.style.height=100*a/p+"%"):this.setRotation(m,o),o}setRotation(e,t=this.container){const[n,r,i,o]=this.viewport.viewBox,s=i-n,a=o-r,{width:l,height:c}=u(this.data.rect);let h,d;e%180==0?(h=100*l/s,d=100*c/a):(h=100*c/s,d=100*l/a),t.style.width=`${h}%`,t.style.height=`${d}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e];n.target.style[t]=s.ColorConverters[`${r[0]}_HTML`](r.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const r of Object.keys(t.detail)){const i=e[r]||n[r];i&&i(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[r,i]of Object.entries(t)){const o=n[r];o&&(o({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(e=!1){if(!this.data.quadPoints)return null;const t=[],n=this.data.rect;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],t.push(this._createContainer(e));return this.data.rect=n,t}_createPopup(e,t){let n=this.container;this.quadrilaterals&&(e=e||this.quadrilaterals,n=this.quadrilaterals[0]),e||((e=document.createElement("div")).className="popupTriggerArea",n.append(e));const r=new x({container:n,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:!0}).render();r.style.left="100%",n.append(r)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.className=e;return this.quadrilaterals}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:e,id:o,exportValues:s}of i){if(-1===e)continue;if(o===t)continue;const i="string"==typeof s?s:null,a=document.querySelector(`[data-element-id="${o}"]`);!a||c.has(a)?n.push({id:o,exportValue:i,domElement:a}):(0,r.warn)(`_getElementsByName - element not allowed: ${o}`)}return n}for(const r of document.getElementsByName(e)){const{id:e,exportValue:i}=r;e!==t&&c.has(r)&&n.push({id:e,exportValue:i,domElement:r})}return n}static get platform(){const e="undefined"!=typeof navigator?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:e.includes("Win"),isMac:e.includes("Mac")})}}class f extends d{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((e,t)=>{const r=0===t?n:n.cloneNode();return e.append(r),e})):(this.container.className="linkAnnotation",r&&this.container.append(n),this.container)}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),e.className="internalLink"}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),e.className="internalLink",!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{n&&n();const{fields:e,refs:i,include:o}=t,s=[];if(0!==e.length||0!==i.length){const t=new Set(i);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===o&&s.push(n)}else for(const e of Object.values(this._fieldObjects))s.push(...e);const a=this.annotationStorage,l=[];for(const e of s){const{id:t}=e;switch(l.push(t),e.type){case"text":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;a.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class p extends d{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(e,this.data),this.container.append(e),this.container}}class g extends d{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(e){const{isWin:t,isMac:n}=d.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,r){t.includes("mouse")?e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e)}})}))}_setEventListeners(e,t,n){for(const[r,i]of t)("Action"===i||this.data.actions?.[i])&&this._setEventListener(e,r,i,n)}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":r.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:t}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,i=e.style;let o;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]),t=e/(Math.round(e/(r.LINE_FACTOR*n))||1);o=Math.min(n,Math.round(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]);o=Math.min(n,Math.round(e/r.LINE_FACTOR))}i.fontSize=`calc(${o}px * var(--scale-factor))`,i.color=r.Util.makeHexColor(t[0],t[1],t[2]),null!==this.data.textAlignment&&(i.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class m extends g{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const i=this.annotationStorage;for(const o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[t]=n),i.setValue(o.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let n=null;if(this.renderForms){const r=e.getValue(t,{value:this.data.fieldValue});let i=r.formattedValue||r.value||"";const o=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;o&&i.length>o&&(i=i.slice(0,o));const s={userValue:i,formattedValue:null,valueOnFocus:""};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",i),this.data.doNotScroll&&(n.style.overflowX="hidden")),c.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",(r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value")})),n.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue??"";n.value=s.userValue=t,s.formattedValue=null}));let a=e=>{const{formattedValue:t}=s;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(e=>{s.userValue&&(e.target.value=s.userValue),s.valueOnFocus=e.target.value})),n.addEventListener("updatefromsandbox",(n=>{const r={value(n){s.userValue=n.detail.value??"",e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){const{formattedValue:r}=n.detail;s.formattedValue=r,null!=r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:r}=n.detail,{target:i}=n;if(0===r)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",r);let o=s.userValue;!o||o.length<=r||(o=o.slice(0,r),i.value=s.userValue=o,e.setValue(t,{value:o}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(e=>{let n=-1;if("Escape"===e.key?n=0:"Enter"===e.key?n=2:"Tab"===e.key&&(n=3),-1===n)return;const{value:r}=e.target;s.valueOnFocus!==r&&(s.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const r=a;a=null,n.addEventListener("blur",(e=>{const{value:n}=e.target;s.userValue=n,this._mouseState.isDown&&s.valueOnFocus!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:1,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)})),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",(e=>{const{data:n,target:r}=e,{value:i,selectionStart:o,selectionEnd:s}=r;let a=o,l=s;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,o).match(/\w*[^\w]*$/);e&&(a-=e[0].length);break}case"deleteWordForward":{const e=i.substring(o).match(/^[^\w]*\w*/);e&&(l+=e[0].length);break}case"deleteContentBackward":o===s&&(a-=1);break;case"deleteContentForward":o===s&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:n||"",willCommit:!1,selStart:a,selEnd:l}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(a&&n.addEventListener("blur",a),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/o;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class y extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");return c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=l,i.addEventListener("change",(r=>{const{name:i,checked:o}=r.target;for(const r of this._getElementsByName(i,n)){const n=o&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:o})})),i.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",(t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class v extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r}));const i=document.createElement("input");if(c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.tabIndex=l,i.addEventListener("change",(t=>{const{name:r,checked:i}=t.target;for(const t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})})),i.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",(t=>{const i={value:t=>{const i=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class b extends f{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class _ extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=l;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const e of r.options)e.selected=e.value===t}));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),r.append(t)}let o=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener("input",o),o=null},r.addEventListener("input",o)}const s=(e,t)=>{const n=t?"value":"textContent",r=e.target.options;return e.target.multiple?Array.prototype.filter.call(r,(e=>e.selected)).map((e=>e[n])):-1===r.selectedIndex?null:r[r.selectedIndex][n]},a=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",(n=>{const i={value(n){o?.();const i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(const e of r.options)e.selected=a.has(e.value);e.setValue(t,{value:s(n,!0)})},multipleSelection(e){r.multiple=!0},remove(n){const i=r.options,o=n.detail.remove;i[o].selected=!1,r.remove(o),i.length>0&&-1===Array.prototype.findIndex.call(i,(e=>e.selected))&&(i[0].selected=!0),e.setValue(t,{value:s(n,!0),items:a(n)})},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]})},insert(n){const{index:i,displayValue:o,exportValue:l}=n.detail.insert,c=r.children[i],u=document.createElement("option");u.textContent=o,u.value=l,c?c.before(u):r.append(u),e.setValue(t,{value:s(n,!0),items:a(n)})},items(n){const{items:i}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of i){const{displayValue:t,exportValue:n}=e,i=document.createElement("option");i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(n,!0),items:a(n)})},indices(n){const r=new Set(n.detail.indices);for(const e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(n,!0)})},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,n)})),r.addEventListener("input",(n=>{const r=s(n,!0),i=s(n,!1);e.setValue(t,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,changeEx:r,willCommit:!0,commitKey:1,keyDown:!1}})})),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(e=>e.target.checked))):r.addEventListener("input",(function(n){e.setValue(t,{value:s(n,!0)})})),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class w extends d{constructor(e){super(e,{isRenderable:!!(e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelectorAll(e);if(0===t.length)return this.container;const n=new x({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,o=r.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),s=o[0]+this.data.parentRect[2]-this.data.parentRect[0],a=o[1],[l,c,u,h]=this.viewport.viewBox,d=u-l,f=h-c;return this.container.style.left=100*(s-l)/d+"%",this.container.style.top=100*(a-c)/f+"%",this.container.append(n.render()),this.container}}class x{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.titleObj=e.titleObj,this.modificationDate=e.modificationDate,this.contentsObj=e.contentsObj,this.richText=e.richText,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.hidden=!0;const t=document.createElement("div");t.className="popup";const n=this.color;if(n){const e=.7*(255-n[0])+n[0],i=.7*(255-n[1])+n[1],o=.7*(255-n[2])+n[2];t.style.backgroundColor=r.Util.makeHexColor(0|e,0|i,0|o)}const o=document.createElement("h1");o.dir=this.titleObj.dir,o.textContent=this.titleObj.str,t.append(o);const s=i.PDFDateString.toDateObject(this.modificationDate);if(s){const e=document.createElement("span");e.className="popupDate",e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:s.toLocaleDateString(),time:s.toLocaleTimeString()}),t.append(e)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const e=this._formatContents(this.contentsObj);t.append(e)}else a.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:t}),t.lastChild.className="richText popupContent";Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger)e.addEventListener("click",this._toggle.bind(this)),e.addEventListener("mouseover",this._show.bind(this,!1)),e.addEventListener("mouseout",this._hide.bind(this,!1));return t.addEventListener("click",this._hide.bind(this,!0)),e.append(t),e}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.className="popupContent",n.dir=t;const r=e.split(/(?:\r\n?|\n)/);for(let e=0,t=r.length;e{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G([e,t,n,r]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_HTML([e]){const t=n(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_HTML([e,t,r]){return`#${n(e)}${n(t)}${n(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const r=1-e,i=1-t,o=1-n;return["CMYK",r,i,o,Math.min(r,i,o)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(20);t.XfaLayer=class{static setupStorage(e,t,n,r,i){const o=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(e.textContent=o.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?e.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",(e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==o.value&&e.setAttribute("value",o.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==o.value)for(const e of n.children)e.attributes.value===o.value&&(e.attributes.selected=!0);e.addEventListener("input",(e=>{const n=e.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:i})}))}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){const{attributes:o}=t,s=e instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=`${o.name}-${r}`);for(const[t,n]of Object.entries(o))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!s||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}s&&i.addLinkAttributes(e,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(e,o.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,o=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:o,linkService:n});const a=[[i,-1,s]],l=e.div;if(l.append(s),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;a.length>0;){const[e,i,s]=a.at(-1);if(i+1===e.children.length){a.pop();continue}const l=e.children[++a.at(-1)[1]];if(null===l)continue;const{name:u}=l;if("#text"===u){const e=document.createTextNode(l.value);c.push(e),s.append(e);continue}let h;if(h=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,u):document.createElement(u),s.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:o,linkService:n}),l.children&&l.children.length>0)a.push([l,-1,h]);else if(l.value){const e=document.createTextNode(l.value);r.XfaText.shouldBuildText(u)&&c.push(e),h.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){const t=new d({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t};var r=n(1),i=n(8);const o=30,s=new Map,a=/^\s+$/g;function l(e,t,n,i){const l=document.createElement("span"),c=e._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(l);const u=r.Util.transform(e._viewport.transform,t.transform);let h=Math.atan2(u[1],u[0]);const d=n[t.fontName];d.vertical&&(h+=Math.PI/2);const f=Math.hypot(u[2],u[3]),p=f*function(e,t){const n=s.get(e);if(n)return n;t.save(),t.font=`30px ${e}`;const r=t.measureText("");let i=r.fontBoundingBoxAscent,a=Math.abs(r.fontBoundingBoxDescent);if(i){t.restore();const n=i/(i+a);return s.set(e,n),n}t.strokeStyle="red",t.clearRect(0,0,o,o),t.strokeText("g",0,0);let l=t.getImageData(0,0,o,o).data;a=0;for(let e=l.length-1-3;e>=0;e-=4)if(l[e]>0){a=Math.ceil(e/4/o);break}t.clearRect(0,0,o,o),t.strokeText("A",0,o),l=t.getImageData(0,0,o,o).data,i=0;for(let e=0,t=l.length;e0){i=o-Math.floor(e/4/o);break}if(t.restore(),i){const t=i/(i+a);return s.set(e,t),t}return s.set(e,.8),.8}(d.fontFamily,i);let g,m;0===h?(g=u[4],m=u[5]-p):(g=u[4]+p*Math.sin(h),m=u[5]-p*Math.cos(h)),l.style.left=`${g}px`,l.style.top=`${m}px`,l.style.fontSize=`${f}px`,l.style.fontFamily=d.fontFamily,c.fontSize=f,l.setAttribute("role","presentation"),l.textContent=t.str,l.dir=t.dir,e._fontInspectorEnabled&&(l.dataset.fontName=t.fontName),0!==h&&(c.angle=h*(180/Math.PI));let y=!1;if(t.str.length>1||e._enhanceTextSelection&&a.test(t.str))y=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(y=!0)}if(y&&(d.vertical?c.canvasWidth=t.height*e._viewport.scale:c.canvasWidth=t.width*e._viewport.scale),e._textDivProperties.set(l,c),e._textContentStream&&e._layoutText(l),e._enhanceTextSelection&&c.hasText){let n=1,i=0;0!==h&&(n=Math.cos(h),i=Math.sin(h));const o=(d.vertical?t.height:t.width)*e._viewport.scale,s=f;let a,c;0!==h?(a=[n,i,-i,n,g,m],c=r.Util.getAxialAlignedBoundingBox([0,0,o,s],a)):c=[g,m,g+o,m+s],e._bounds.push({left:c[0],top:c[1],right:c[2],bottom:c[3],div:l,size:[o,s],m:a})}}function c(e){if(e._canceled)return;const t=e._textDivs,n=e._capability,r=t.length;if(r>1e5)return e._renderingDone=!0,void n.resolve();if(!e._textContentStream)for(let n=0;n0&&(r=r?Math.min(n,r):n)}return r}function h(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));const n=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(const e of t){let t=0;for(;t=0&&n[o].start>=e.y2;)o--;let s,a,l=-1/0;for(s=t;s<=o;s++){let t;r=n[s],i=r.boundary,t=i.x2>e.x1?i.index>e.index?i.x1New:e.x1:void 0===i.x2New?(i.x2+e.x1)/2:i.x2New,t>l&&(l=t)}for(e.x1New=l,s=t;s<=o;s++)r=n[s],i=r.boundary,void 0===i.x2New?i.x2>e.x1?i.index>e.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));const c=[];let u=null;for(s=t;s<=o;s++){r=n[s],i=r.boundary;const t=i.x2>e.x2?i:e;u===t?c.at(-1).end=r.end:(c.push({start:r.start,end:r.end,boundary:t}),u=t)}for(n[t].start=0&&n[a].start>=i.y1;a--)e=n[a].boundary===i;for(a=o+1;!e&&a{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 r.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(e,t){for(let n=0,r=e.length;n0){const e=this._devicePixelRatio*t.canvasWidth/o;this._enhanceTextSelection&&(t.scale=e),n=`scaleX(${e})`}}if(0!==t.angle&&(n=`rotate(${t.angle}deg) ${n}`),n.length>0&&(this._enhanceTextSelection&&(t.originalTransform=n),e.style.transform=n),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(e=0){const t=(0,r.createPromiseCapability)();let n=Object.create(null);const i=this._document.createElement("canvas");if(i.height=i.width=o,this._layoutTextCtx=i.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,n=this._textContent.styles;this._processItems(e,n),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then((({value:r,done:i})=>{i?t.resolve():(Object.assign(n,r.styles),this._processItems(r.items,n),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{n=null,e?this._renderTimer=setTimeout((()=>{c(this),this._renderTimer=null}),e):c(this)}),this._capability.reject)}expandTextDivs(e=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(function(e){const t=e._bounds,n=e._viewport,i=function(e,t,n){const r=n.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));h(e,r);const i=new Array(n.length);for(const e of r){const t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}n.map((function(t,n){const o=i[n],s=r[n];s.x1=t.top,s.y1=e-o.right,s.x2=t.bottom,s.y2=e-o.left,s.index=n,s.x1New=void 0,s.x2New=void 0})),h(t,r);for(const e of r){const t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New}return i}(n.width,n.height,t);for(let n=0;n0?(n.push(`${o.paddingTop}px`),t.push(`translateY(${-o.paddingTop}px)`)):n.push(0),o.paddingRight>0?n.push(o.paddingRight/o.scale+"px"):n.push(0),o.paddingBottom>0?n.push(`${o.paddingBottom}px`):n.push(0),o.paddingLeft>0?(n.push(o.paddingLeft/o.scale+"px"),t.push(`translateX(${-o.paddingLeft/o.scale}px)`)):n.push(0),i.style.padding=n.join(" "),t.length&&(i.style.transform=t.join(" "))):(i.style.padding=null,i.style.transform=o.originalTransform))}}}t.TextLayerRenderTask=d},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(8),i=n(1),o=n(3);let s=class{constructor(){(0,i.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=s;{const a={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",u=["butt","round","square"],h=["miter","round","bevel"],d=function(e,t="",n=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${t};base64,`;for(let t=0,n=e.length;t>2]+r[(3&o)<<4|s>>4]+r[t+1>6:64]+r[t+2>1&2147483647:n>>1&2147483647;t[e]=n}function n(e,n,r,i){let o=i;const s=n.length;r[o]=s>>24&255,r[o+1]=s>>16&255,r[o+2]=s>>8&255,r[o+3]=255&s,o+=4,r[o]=255&e.charCodeAt(0),r[o+1]=255&e.charCodeAt(1),r[o+2]=255&e.charCodeAt(2),r[o+3]=255&e.charCodeAt(3),o+=4,r.set(n,o),o+=n.length;const a=function(e,n,r){let i=-1;for(let o=n;o>>8^t[n]}return~i}(r,i+4,o);r[o]=a>>24&255,r[o+1]=a>>16&255,r[o+2]=a>>8&255,r[o+3]=255&a}function r(e){let t=e.length;const n=65535,r=Math.ceil(t/n),i=new Uint8Array(2+t+5*r+4);let o=0;i[o++]=120,i[o++]=156;let s=0;for(;t>n;)i[o++]=0,i[o++]=255,i[o++]=255,i[o++]=0,i[o++]=0,i.set(e.subarray(s,s+n),o),o+=n,s+=n,t-=n;i[o++]=1,i[o++]=255&t,i[o++]=t>>8&255,i[o++]=255&~t,i[o++]=(65535&~t)>>8&255,i.set(e.subarray(s),o),o+=e.length-s;const a=function(e,t,n){let r=1,i=0;for(let t=0;t>24&255,i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a,i}return function(t,s,a){return function(t,s,a,l){const c=t.width,u=t.height;let h,f,p;const g=t.data;switch(s){case i.ImageKind.GRAYSCALE_1BPP:f=0,h=1,p=c+7>>3;break;case i.ImageKind.RGB_24BPP:f=2,h=8,p=3*c;break;case i.ImageKind.RGBA_32BPP:f=6,h=8,p=4*c;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+p)*u);let y=0,v=0;for(let e=0;e>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,h,f,0,0,0]),_=function(e){if(!o.isNodeJS)return r(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return r(e)}(m),w=e.length+36+b.length+_.length,x=new Uint8Array(w);let S=0;return x.set(e,S),S+=e.length,n("IHDR",b,x,S),S+=12+b.length,n("IDATA",_,x,S),S+=12+_.length,n("IEND",new Uint8Array(0),x,S),d(x,"image/png",a)}(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,s,a)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=a.fontWeight,this.fontSize=0,this.textMatrix=i.IDENTITY_MATRIX,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=i.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=a.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(e,t){this.x=e,this.y=t}}function g(e){let t=[];const n=[];for(const r of e)"save"!==r.fn?"restore"===r.fn?t=n.pop():t.push(r):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t.at(-1).items);return t}function m(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function y(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${m(e[0])} ${m(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${m(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${m(e[4])} ${m(e[5])})`;return`matrix(${m(e[0])} ${m(e[1])} ${m(e[2])} ${m(e[3])} ${m(e[4])} ${m(e[5])})`}let v=0,b=0,_=0;t.SVGGraphics=s=class{constructor(e,t,n=!1){(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new p,this.transformMatrix=i.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const e in i.OPS)this._operatorIdMapping[i.OPS[e]]=e}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let e=0,r=t.length;e{e.get(t,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,r,o,s){const a=[e,t,n,r,o,s];this.transformMatrix=i.Util.transform(this.transformMatrix,a),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=i.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,i=[];for(let e=0,o=r.length;e0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=u[e]}setLineJoin(e){this.current.lineJoin=h[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=i.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=i.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,n=this.viewport.height,r=i.Util.inverseTransform(this.transformMatrix),o=i.Util.applyTransform([0,0],r),s=i.Util.applyTransform([0,n],r),a=i.Util.applyTransform([t,0],r),l=i.Util.applyTransform([t,n],r),c=Math.min(o[0],s[0],a[0],l[0]),u=Math.min(o[1],s[1],a[1],l[1]),h=Math.max(o[0],s[0],a[0],l[0]),d=Math.max(o[1],s[1],a[1],l[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",c),f.setAttributeNS(null,"y",u),f.setAttributeNS(null,"width",h-c),f.setAttributeNS(null,"height",d-u),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(f)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],r=e[3]||i.IDENTITY_MATRIX,[o,s,a,l]=e[4],c=e[5],u=e[6],h=e[7],d="shading"+_++,[f,p,g,m]=i.Util.normalizeRect([...i.Util.applyTransform([o,s],r),...i.Util.applyTransform([a,l],r)]),[y,v]=i.Util.singularValueDecompose2dScale(r),b=c*y,w=u*v,x=this.svgFactory.createElement("svg:pattern");x.setAttributeNS(null,"id",d),x.setAttributeNS(null,"patternUnits","userSpaceOnUse"),x.setAttributeNS(null,"width",b),x.setAttributeNS(null,"height",w),x.setAttributeNS(null,"x",`${f}`),x.setAttributeNS(null,"y",`${p}`);const S=this.svg,C=this.transformMatrix,E=this.current.fillColor,k=this.current.strokeColor,P=this.svgFactory.create(g-f,m-p);if(this.svg=P,this.transformMatrix=r,2===h){const e=i.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=C,this.current.fillColor=E,this.current.strokeColor=k,x.append(P.childNodes[0]),this.defs.append(x),`url(#${d})`}_makeShadingPattern(e){switch("string"==typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading"+_++,n=e[3];let r;switch(e[1]){case"axial":const n=e[4],i=e[5];r=this.svgFactory.createElement("svg:linearGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",n[0]),r.setAttributeNS(null,"y1",n[1]),r.setAttributeNS(null,"x2",i[0]),r.setAttributeNS(null,"y2",i[1]);break;case"radial":const o=e[4],s=e[5],a=e[6],l=e[7];r=this.svgFactory.createElement("svg:radialGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",s[0]),r.setAttributeNS(null,"cy",s[1]),r.setAttributeNS(null,"r",l),r.setAttributeNS(null,"fx",o[0]),r.setAttributeNS(null,"fy",o[1]),r.setAttributeNS(null,"fr",a);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),r.append(t)}return this.defs.append(r),`url(#${t})`;case"Mesh":return(0,i.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let r=n.x,o=n.y,s=[],a=0;for(const n of e)switch(0|n){case i.OPS.rectangle:r=t[a++],o=t[a++];const e=r+t[a++],n=o+t[a++];s.push("M",m(r),m(o),"L",m(e),m(o),"L",m(e),m(n),"L",m(r),m(n),"Z");break;case i.OPS.moveTo:r=t[a++],o=t[a++],s.push("M",m(r),m(o));break;case i.OPS.lineTo:r=t[a++],o=t[a++],s.push("L",m(r),m(o));break;case i.OPS.curveTo:r=t[a+4],o=t[a+5],s.push("C",m(t[a]),m(t[a+1]),m(t[a+2]),m(t[a+3]),m(r),m(o)),a+=6;break;case i.OPS.curveTo2:s.push("C",m(r),m(o),m(t[a]),m(t[a+1]),m(t[a+2]),m(t[a+3])),r=t[a+2],o=t[a+3],a+=4;break;case i.OPS.curveTo3:r=t[a+2],o=t[a+3],s.push("C",m(t[a]),m(t[a+1]),m(r),m(o),m(r),m(o)),a+=4;break;case i.OPS.closePath:s.push("Z")}s=s.join(" "),n.path&&e.length>0&&e[0]!==i.OPS.rectangle&&e[0]!==i.OPS.moveTo?s=n.path.getAttributeNS(null,"d")+s:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",s),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(r,o)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+v++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",y(this.transformMatrix));const r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,i.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const n=this.current;let r=n.dashArray;1!==t&&r.length>0&&(r=r.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",m(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",m(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(m).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",m(t*n.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 e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,i.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,r=e.height,i=f(e,this.forceDataSchema,!!t),o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",m(n)),o.setAttributeNS(null,"height",m(r)),this.current.element=o,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS(c,"xlink:href",i),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",m(-r)),s.setAttributeNS(null,"width",m(n)+"px"),s.setAttributeNS(null,"height",m(r)+"px"),s.setAttributeNS(null,"transform",`scale(${m(1/n)} ${m(-1/r)})`),t?t.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(e){const t=this.current,n=e.width,r=e.height,i=t.fillColor;t.maskId="mask"+b++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",t.maskId);const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",m(n)),s.setAttributeNS(null,"height",m(r)),s.setAttributeNS(null,"fill",i),s.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(s),this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",t[0]),r.setAttributeNS(null,"y",t[1]),r.setAttributeNS(null,"width",m(e)),r.setAttributeNS(null,"height",m(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",y(e.transform)),t.append(r),this.svg=r,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(1),i=n(33);const o=__webpack_require__(3237),s=__webpack_require__(7492),a=__webpack_require__(1815),l=__webpack_require__(6671),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new f(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new m(this,e,t):new p(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)(),this._headersCapability=(0,r.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 e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.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 e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function d(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class f extends u{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:o,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,e.httpHeaders),t):this._request=a.request(d(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class p extends h{constructor(e,t,n){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const n=e.httpHeaders[t];void 0!==n&&(this._httpHeaders[t]=n)}this._httpHeaders.Range=`bytes=${t}-${n-1}`;const i=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,this._httpHeaders),i):this._request=a.request(d(this._url,this._httpHeaders),i),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class g extends u{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),o.lstat(t,((e,n)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(o.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends h{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(o.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,i.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if((0,o.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(e("Content-Length"),10);return Number.isInteger(o)?(i.suggestedLength=o,o<=2*n||r||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),i=n(34),o=n(8)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=i("filename\\*","i").exec(e);if(n){n=n[1];let e=a(n);return e=unescape(e),e=l(e),e=c(e),s(e)}if(n=function(e){const t=[];let n;const r=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,i]}const o=[];for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(1),i=n(33);class o{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const e in n)r[e]=n[e];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const n=this.httpHeaders[e];void 0!==n&&t.setRequestHeader(e,n)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void n.onError?.(i.status);const o=i.status||200;if((200!==o||206!==n.expectedStatus)&&o!==n.expectedStatus)return void n.onError?.(i.status);const s=function(e){const t=e.response;return"string"!=typeof t?t:(0,r.stringToBytes)(t).buffer}(i);if(206===o){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:s})}else s?n.onDone({begin:0,chunk:s}):n.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new o(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new a(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class s{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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 e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class a{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),i=n(33);function o(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function s(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new a(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new l(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class a{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=s(this._stream.httpHeaders);const n=t.url;fetch(n,o(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:o,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.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:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController.abort()}}class l{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const a=e.source;this._withCredentials=a.withCredentials||!1,this._readCapability=(0,r.createPromiseCapability)(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=s(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=a.url;fetch(l,o(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return o.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return a.GlobalWorkerOptions}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(4),r=__w_pdfjs_require__(8),i=__w_pdfjs_require__(22),o=__w_pdfjs_require__(7),s=__w_pdfjs_require__(27),a=__w_pdfjs_require__(15),l=__w_pdfjs_require__(3),c=__w_pdfjs_require__(30),u=__w_pdfjs_require__(31),h=__w_pdfjs_require__(29);if(l.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(32);(0,n.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(35),{PDFFetchStream:t}=__w_pdfjs_require__(36);(0,n.setPDFNetworkStreamFactory)((n=>(0,r.isValidFetchUrl)(n.url)?new t(n):new e(n)))}})(),__nested_webpack_exports__})(),module.exports=factory()},2816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,i,o,s){var a=i||"<>",l=s||r;if(null==n[r])return t?new Error("Required "+o+" `"+l+"` was not specified in `"+a+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),h=6;h{"use strict";var r=n(6925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5341:function(e){e.exports=function(){"use strict";function e(e,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/a+h)),Math.min(o,Math.floor(r+(a-l)*u/a+h)),s)}var d=n[r],f=i,p=o;for(t(n,i,r),s(n[o],d)>0&&t(n,i,o);f0;)p--}0===s(n[i],d)?t(n,i,p):t(n,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}(e,r,i||0,o||e.length-1,s||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;e(t,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!f(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=p(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,l,c,h,d=1/0,f=1/0,p=t;p<=n-t;p++){var g=s(e,0,p,this.toBBox),m=s(e,p,n,this.toBBox),y=(i=g,o=m,void 0,void 0,void 0,void 0,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,h-l)),v=u(g)+u(m);y=t;f--){var p=e.children[f];a(l,e.leaf?i(p):p),c+=h(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)a(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}()},3757:(e,t,n)=>{"use strict";var r=n(6540),i=n(3185);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,a=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}(r),l=o(r),c=o(i);function u(e,t){return e[t]}function h(e=[],t,n=0){return[...e.slice(0,n),t,...e.slice(n)]}function d(e=[],t,n="id"){const r=e.slice(),i=u(t,n);return i?r.splice(r.findIndex((e=>u(e,n)===i)),1):r.splice(r.findIndex((e=>e===t)),1),r}function f(e){return e.map(((e,t)=>{const n=Object.assign(Object.assign({},e),{sortable:e.sortable||!!e.sortFunction||void 0});return e.id||(n.id=t+1),n}))}function p(e,t){return Math.ceil(e/t)}function g(e,t){return Math.min(e,t)}!function(e){e.ASC="asc",e.DESC="desc"}(s||(s={}));const m=()=>null;function y(e,t=[],n=[]){let r={},i=[...n];return t.length&&t.forEach((t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(r=t.style||{},t.classNames&&(i=[...i,...t.classNames]),"function"==typeof t.style&&(r=t.style(e)||{}))})),{conditionalStyle:r,classNames:i.join(" ")}}function v(e,t=[],n="id"){const r=u(e,n);return r?t.some((e=>u(e,n)===r)):t.some((t=>t===e))}function b(e,t){return t?e.findIndex((e=>_(e.id,t))):-1}function _(e,t){return e==t}function w(e,t){const n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:n,rows:r,rowCount:i,mergeSelections:o}=t,s=!e.allSelected,a=!e.toggleOnSelectedRowsChange;if(o){const t=s?[...e.selectedRows,...r.filter((t=>!v(t,e.selectedRows,n)))]:e.selectedRows.filter((e=>!v(e,r,n)));return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:a})}return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:s?i:0,selectedRows:s?r:[],toggleOnSelectedRowsChange:a})}case"SELECT_SINGLE_ROW":{const{keyField:r,row:i,isSelected:o,rowCount:s,singleSelect:a}=t;return a?o?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[i],toggleOnSelectedRowsChange:n}):o?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:d(e.selectedRows,i,r),toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:h(e.selectedRows,i),toggleOnSelectedRowsChange:n})}case"SELECT_MULTIPLE_ROWS":{const{keyField:r,selectedRows:i,totalRows:o,mergeSelections:s}=t;if(s){const t=[...e.selectedRows,...i.filter((t=>!v(t,e.selectedRows,r)))];return Object.assign(Object.assign({},e),{selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n})}return Object.assign(Object.assign({},e),{selectedCount:i.length,allSelected:i.length===o,selectedRows:i,toggleOnSelectedRowsChange:n})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:n}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n})}case"SORT_CHANGE":{const{sortDirection:r,selectedColumn:i,clearSelectedOnSort:o}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:i,sortDirection:r,currentPage:1}),o&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_PAGE":{const{page:r,paginationServer:i,visibleOnly:o,persistSelectedOnPageChange:s}=t,a=i&&s,l=i&&!s||o;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:r}),a&&{allSelected:!1}),l&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:n,page:r}=t;return Object.assign(Object.assign({},e),{currentPage:r,rowsPerPage:n})}}}const x=i.css` pointer-events: none; opacity: 0.4; `,S=c.default.div` @@ -12,15 +12,15 @@ max-width: 100%; ${({disabled:e})=>e&&x}; ${({theme:e})=>e.table.style}; -`,E=i.css` +`,C=i.css` position: sticky; position: -webkit-sticky; /* Safari */ top: 0; z-index: 1; -`,C=c.default.div` +`,E=c.default.div` display: flex; width: 100%; - ${({$fixedHeader:e})=>e&&E}; + ${({$fixedHeader:e})=>e&&C}; ${({theme:e})=>e.head.style}; `,k=c.default.div` display: flex; @@ -114,7 +114,7 @@ box-sizing: border-box; ${({theme:e})=>e.expanderRow.style}; ${({$extendedRowStyle:e})=>e}; -`;var $=a.memo((function({data:e,ExpanderComponent:t,expanderComponentProps:n,extendedRowStyle:r,extendedClassNames:i}){const o=["rdt_ExpanderRow",...i.split(" ").filter((e=>"rdt_TableRow"!==e))].join(" ");return a.createElement(W,{className:o,$extendedRowStyle:r},a.createElement(t,Object.assign({data:e},n)))}));const H="allowRowEvents";var q,G,X;t.OP=void 0,(q=t.OP||(t.OP={})).LTR="ltr",q.RTL="rtl",q.AUTO="auto",t.C1=void 0,(G=t.C1||(t.C1={})).LEFT="left",G.RIGHT="right",G.CENTER="center",t.$U=void 0,(X=t.$U||(t.$U={})).SM="sm",X.MD="md",X.LG="lg";const Y=i.css` +`;var $=a.memo((function({data:e,ExpanderComponent:t,expanderComponentProps:n,extendedRowStyle:r,extendedClassNames:i}){const o=["rdt_ExpanderRow",...i.split(" ").filter((e=>"rdt_TableRow"!==e))].join(" ");return a.createElement(W,{className:o,$extendedRowStyle:r},a.createElement(t,Object.assign({data:e},n)))}));const q="allowRowEvents";var H,G,X;t.OP=void 0,(H=t.OP||(t.OP={})).LTR="ltr",H.RTL="rtl",H.AUTO="auto",t.C1=void 0,(G=t.C1||(t.C1={})).LEFT="left",G.RIGHT="right",G.CENTER="center",t.$U=void 0,(X=t.$U||(t.$U={})).SM="sm",X.MD="md",X.LG="lg";const Y=i.css` &:hover { ${({$highlightOnHover:e,theme:t})=>e&&t.rows.highlightOnHoverStyle}; } @@ -135,7 +135,7 @@ ${({$pointerOnHover:e})=>e&&K}; ${({$selected:e,theme:t})=>e&&t.rows.selectedHighlightStyle}; ${({$conditionalStyle:e})=>e}; -`;function Q({columns:e=[],conditionalRowStyles:t=[],defaultExpanded:n=!1,defaultExpanderDisabled:r=!1,dense:i=!1,expandableIcon:o,expandableRows:s=!1,expandableRowsComponent:l,expandableRowsComponentProps:c,expandableRowsHideExpander:h,expandOnRowClicked:d=!1,expandOnRowDoubleClicked:f=!1,highlightOnHover:p=!1,id:g,expandableInheritConditionalStyles:v,keyField:b,onRowClicked:w=m,onRowDoubleClicked:x=m,onRowMouseEnter:S=m,onRowMouseLeave:E=m,onRowExpandToggled:C=m,onSelectedRow:k=m,pointerOnHover:P=!1,row:A,rowCount:T,rowIndex:R,selectableRowDisabled:O=null,selectableRows:M=!1,selectableRowsComponent:I,selectableRowsComponentProps:F,selectableRowsHighlight:L=!1,selectableRowsSingle:N=!1,selected:z,striped:B=!1,draggingColumnId:U,onDragStart:W,onDragOver:q,onDragEnd:G,onDragEnter:X,onDragLeave:Y}){const[K,Q]=a.useState(n);a.useEffect((()=>{Q(n)}),[n]);const J=a.useCallback((()=>{Q(!K),C(!K,A)}),[K,C,A]),ee=P||s&&(d||f),te=a.useCallback((e=>{e.target.getAttribute("data-tag")===H&&(w(A,e),!r&&s&&d&&J())}),[r,d,s,J,w,A]),ne=a.useCallback((e=>{e.target.getAttribute("data-tag")===H&&(x(A,e),!r&&s&&f&&J())}),[r,f,s,J,x,A]),re=a.useCallback((e=>{S(A,e)}),[S,A]),ie=a.useCallback((e=>{E(A,e)}),[E,A]),oe=u(A,b),{conditionalStyle:se,classNames:ae}=y(A,t,["rdt_TableRow"]),le=L&&z,ce=v?se:{},ue=B&&R%2==0;return a.createElement(a.Fragment,null,a.createElement(Z,{id:`row-${g}`,role:"row",$striped:ue,$highlightOnHover:p,$pointerOnHover:!r&&ee,$dense:i,onClick:te,onDoubleClick:ne,onMouseEnter:re,onMouseLeave:ie,className:ae,$selected:le,$conditionalStyle:se},M&&a.createElement(j,{name:`select-row-${oe}`,keyField:b,row:A,rowCount:T,selected:z,selectableRowsComponent:I,selectableRowsComponentProps:F,selectableRowDisabled:O,selectableRowsSingle:N,onSelectedRow:k}),s&&!h&&a.createElement(V,{id:oe,expandableIcon:o,expanded:K,row:A,onToggled:J,disabled:r}),e.map((e=>e.omit?null:a.createElement(D,{id:`cell-${e.id}-${oe}`,key:`cell-${e.id}-${oe}`,dataTag:e.ignoreRowClick||e.button?null:H,column:e,row:A,rowIndex:R,isDragging:_(U,e.id),onDragStart:W,onDragOver:q,onDragEnd:G,onDragEnter:X,onDragLeave:Y})))),s&&K&&a.createElement($,{key:`expander-${oe}`,data:A,extendedRowStyle:ce,extendedClassNames:ae,ExpanderComponent:l,expanderComponentProps:c}))}const J=c.default.span` +`;function Q({columns:e=[],conditionalRowStyles:t=[],defaultExpanded:n=!1,defaultExpanderDisabled:r=!1,dense:i=!1,expandableIcon:o,expandableRows:s=!1,expandableRowsComponent:l,expandableRowsComponentProps:c,expandableRowsHideExpander:h,expandOnRowClicked:d=!1,expandOnRowDoubleClicked:f=!1,highlightOnHover:p=!1,id:g,expandableInheritConditionalStyles:v,keyField:b,onRowClicked:w=m,onRowDoubleClicked:x=m,onRowMouseEnter:S=m,onRowMouseLeave:C=m,onRowExpandToggled:E=m,onSelectedRow:k=m,pointerOnHover:P=!1,row:A,rowCount:T,rowIndex:R,selectableRowDisabled:O=null,selectableRows:M=!1,selectableRowsComponent:I,selectableRowsComponentProps:F,selectableRowsHighlight:L=!1,selectableRowsSingle:N=!1,selected:z,striped:B=!1,draggingColumnId:U,onDragStart:W,onDragOver:H,onDragEnd:G,onDragEnter:X,onDragLeave:Y}){const[K,Q]=a.useState(n);a.useEffect((()=>{Q(n)}),[n]);const J=a.useCallback((()=>{Q(!K),E(!K,A)}),[K,E,A]),ee=P||s&&(d||f),te=a.useCallback((e=>{e.target.getAttribute("data-tag")===q&&(w(A,e),!r&&s&&d&&J())}),[r,d,s,J,w,A]),ne=a.useCallback((e=>{e.target.getAttribute("data-tag")===q&&(x(A,e),!r&&s&&f&&J())}),[r,f,s,J,x,A]),re=a.useCallback((e=>{S(A,e)}),[S,A]),ie=a.useCallback((e=>{C(A,e)}),[C,A]),oe=u(A,b),{conditionalStyle:se,classNames:ae}=y(A,t,["rdt_TableRow"]),le=L&&z,ce=v?se:{},ue=B&&R%2==0;return a.createElement(a.Fragment,null,a.createElement(Z,{id:`row-${g}`,role:"row",$striped:ue,$highlightOnHover:p,$pointerOnHover:!r&&ee,$dense:i,onClick:te,onDoubleClick:ne,onMouseEnter:re,onMouseLeave:ie,className:ae,$selected:le,$conditionalStyle:se},M&&a.createElement(j,{name:`select-row-${oe}`,keyField:b,row:A,rowCount:T,selected:z,selectableRowsComponent:I,selectableRowsComponentProps:F,selectableRowDisabled:O,selectableRowsSingle:N,onSelectedRow:k}),s&&!h&&a.createElement(V,{id:oe,expandableIcon:o,expanded:K,row:A,onToggled:J,disabled:r}),e.map((e=>e.omit?null:a.createElement(D,{id:`cell-${e.id}-${oe}`,key:`cell-${e.id}-${oe}`,dataTag:e.ignoreRowClick||e.button?null:q,column:e,row:A,rowIndex:R,isDragging:_(U,e.id),onDragStart:W,onDragOver:H,onDragEnd:G,onDragEnter:X,onDragLeave:Y})))),s&&K&&a.createElement($,{key:`expander-${oe}`,data:A,extendedRowStyle:ce,extendedClassNames:ae,ExpanderComponent:l,expanderComponentProps:c}))}const J=c.default.span` padding: 2px; color: inherit; flex-grow: 0; @@ -193,7 +193,7 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -`;var oe=a.memo((function({column:e,disabled:t,draggingColumnId:n,selectedColumn:r={},sortDirection:i,sortIcon:o,sortServer:l,pagination:c,paginationServer:u,persistSelectedOnSort:h,selectableRowsVisibleOnly:d,onSort:f,onDragStart:p,onDragOver:g,onDragEnd:m,onDragEnter:y,onDragLeave:v}){a.useEffect((()=>{"string"==typeof e.selector&&console.error(`Warning: ${e.selector} is a string based column selector which has been deprecated as of v7 and will be removed in v8. Instead, use a selector function e.g. row => row[field]...`)}),[]);const[b,w]=a.useState(!1),x=a.useRef(null);if(a.useEffect((()=>{x.current&&w(x.current.scrollWidth>x.current.clientWidth)}),[b]),e.omit)return null;const S=()=>{if(!e.sortable&&!e.selector)return;let t=i;_(r.id,e.id)&&(t=i===s.ASC?s.DESC:s.ASC),f({type:"SORT_CHANGE",sortDirection:t,selectedColumn:e,clearSelectedOnSort:c&&u&&!h||l||d})},E=e=>a.createElement(ee,{sortActive:e,sortDirection:i}),C=()=>a.createElement("span",{className:[i,"__rdt_custom_sort_icon__"].join(" ")},o),k=!(!e.sortable||!_(r.id,e.id)),P=!e.sortable||t,A=e.sortable&&!o&&!e.right,T=e.sortable&&!o&&e.right,R=e.sortable&&o&&!e.right,O=e.sortable&&o&&e.right;return a.createElement(te,{"data-column-id":e.id,className:"rdt_TableCol",$headCell:!0,allowOverflow:e.allowOverflow,button:e.button,compact:e.compact,grow:e.grow,hide:e.hide,maxWidth:e.maxWidth,minWidth:e.minWidth,right:e.right,center:e.center,width:e.width,draggable:e.reorder,$isDragging:_(e.id,n),onDragStart:p,onDragOver:g,onDragEnd:m,onDragEnter:y,onDragLeave:v},e.name&&a.createElement(re,{"data-column-id":e.id,"data-sort-id":e.id,role:"columnheader",tabIndex:0,className:"rdt_TableCol_Sortable",onClick:P?void 0:S,onKeyPress:P?void 0:e=>{"Enter"===e.key&&S()},$sortActive:!P&&k,disabled:P},!P&&O&&C(),!P&&T&&E(k),"string"==typeof e.name?a.createElement(ie,{title:b?e.name:void 0,ref:x,"data-column-id":e.id},e.name):e.name,!P&&R&&C(),!P&&A&&E(k)))}));const se=c.default(R)` +`;var oe=a.memo((function({column:e,disabled:t,draggingColumnId:n,selectedColumn:r={},sortDirection:i,sortIcon:o,sortServer:l,pagination:c,paginationServer:u,persistSelectedOnSort:h,selectableRowsVisibleOnly:d,onSort:f,onDragStart:p,onDragOver:g,onDragEnd:m,onDragEnter:y,onDragLeave:v}){a.useEffect((()=>{"string"==typeof e.selector&&console.error(`Warning: ${e.selector} is a string based column selector which has been deprecated as of v7 and will be removed in v8. Instead, use a selector function e.g. row => row[field]...`)}),[]);const[b,w]=a.useState(!1),x=a.useRef(null);if(a.useEffect((()=>{x.current&&w(x.current.scrollWidth>x.current.clientWidth)}),[b]),e.omit)return null;const S=()=>{if(!e.sortable&&!e.selector)return;let t=i;_(r.id,e.id)&&(t=i===s.ASC?s.DESC:s.ASC),f({type:"SORT_CHANGE",sortDirection:t,selectedColumn:e,clearSelectedOnSort:c&&u&&!h||l||d})},C=e=>a.createElement(ee,{sortActive:e,sortDirection:i}),E=()=>a.createElement("span",{className:[i,"__rdt_custom_sort_icon__"].join(" ")},o),k=!(!e.sortable||!_(r.id,e.id)),P=!e.sortable||t,A=e.sortable&&!o&&!e.right,T=e.sortable&&!o&&e.right,R=e.sortable&&o&&!e.right,O=e.sortable&&o&&e.right;return a.createElement(te,{"data-column-id":e.id,className:"rdt_TableCol",$headCell:!0,allowOverflow:e.allowOverflow,button:e.button,compact:e.compact,grow:e.grow,hide:e.hide,maxWidth:e.maxWidth,minWidth:e.minWidth,right:e.right,center:e.center,width:e.width,draggable:e.reorder,$isDragging:_(e.id,n),onDragStart:p,onDragOver:g,onDragEnd:m,onDragEnter:y,onDragLeave:v},e.name&&a.createElement(re,{"data-column-id":e.id,"data-sort-id":e.id,role:"columnheader",tabIndex:0,className:"rdt_TableCol_Sortable",onClick:P?void 0:S,onKeyPress:P?void 0:e=>{"Enter"===e.key&&S()},$sortActive:!P&&k,disabled:P},!P&&O&&E(),!P&&T&&C(k),"string"==typeof e.name?a.createElement(ie,{title:b?e.name:void 0,ref:x,"data-column-id":e.id},e.name):e.name,!P&&R&&E(),!P&&A&&C(k)))}));const se=c.default(R)` flex: 0 0 48px; justify-content: center; align-items: center; @@ -290,11 +290,11 @@ width: 100%; height: 100%; ${e=>e.theme.progress.style}; -`,Ee=c.default.div` +`,Ce=c.default.div` position: relative; width: 100%; ${({theme:e})=>e.tableWrapper.style}; -`,Ce=c.default(R)` +`,Ee=c.default(R)` white-space: nowrap; ${({theme:e})=>e.expanderCell.style}; `,ke=c.default.div` @@ -381,4 +381,4 @@ margin: 0 24px; `,je=c.default(Le)` margin: 0 4px; -`;var ze=a.memo((function({rowsPerPage:e,rowCount:t,currentPage:n,direction:r=Oe.direction,paginationRowsPerPageOptions:i=Oe.paginationRowsPerPageOptions,paginationIconLastPage:o=Oe.paginationIconLastPage,paginationIconFirstPage:s=Oe.paginationIconFirstPage,paginationIconNext:l=Oe.paginationIconNext,paginationIconPrevious:c=Oe.paginationIconPrevious,paginationComponentOptions:u=Oe.paginationComponentOptions,onChangeRowsPerPage:h=Oe.onChangeRowsPerPage,onChangePage:d=Oe.onChangePage}){const f=(()=>{const e="object"==typeof window;function t(){return{width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0}}const[n,r]=a.useState(t);return a.useEffect((()=>{if(!e)return()=>null;function n(){r(t())}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[]),n})(),g=le(r),m=f.width&&f.width>599,y=p(t,e),v=n*e,b=v-e+1,_=1===n,w=n===y,x=Object.assign(Object.assign({},Me),u),S=n===y?`${b}-${t} ${x.rangeSeparatorText} ${t}`:`${b}-${v} ${x.rangeSeparatorText} ${t}`,E=a.useCallback((()=>d(n-1)),[n,d]),C=a.useCallback((()=>d(n+1)),[n,d]),k=a.useCallback((()=>d(1)),[d]),P=a.useCallback((()=>d(p(t,e))),[d,t,e]),A=a.useCallback((e=>h(Number(e.target.value),n)),[n,h]),T=i.map((e=>a.createElement("option",{key:e,value:e},e)));x.selectAllRowsItem&&T.push(a.createElement("option",{key:-1,value:t},x.selectAllRowsItemText));const R=a.createElement(Re,{onChange:A,defaultValue:e,"aria-label":x.rowsPerPageText},T);return a.createElement(Ie,{className:"rdt_Pagination"},!x.noRowsPerPage&&m&&a.createElement(a.Fragment,null,a.createElement(je,null,x.rowsPerPageText),R),m&&a.createElement(Ne,null,S),a.createElement(Fe,null,a.createElement(De,{id:"pagination-first-page",type:"button","aria-label":"First Page","aria-disabled":_,onClick:k,disabled:_,$isRTL:g},s),a.createElement(De,{id:"pagination-previous-page",type:"button","aria-label":"Previous Page","aria-disabled":_,onClick:E,disabled:_,$isRTL:g},c),!x.noRowsPerPage&&!m&&R,a.createElement(De,{id:"pagination-next-page",type:"button","aria-label":"Next Page","aria-disabled":w,onClick:C,disabled:w,$isRTL:g},l),a.createElement(De,{id:"pagination-last-page",type:"button","aria-label":"Last Page","aria-disabled":w,onClick:P,disabled:w,$isRTL:g},o)))}));const Be=(e,t)=>{const n=a.useRef(!0);a.useEffect((()=>{n.current?n.current=!1:e()}),t)};var Ue=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ve}(e)}(e)},Ve="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function We(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ge((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function $e(e,t,n){return e.concat(t).map((function(e){return We(e,n)}))}function He(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function qe(e,t){try{return t in e}catch(e){return!1}}function Ge(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||$e,n.isMergeableObject=n.isMergeableObject||Ue,n.cloneUnlessOtherwiseSpecified=We;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&He(e).forEach((function(t){r[t]=We(e[t],n)})),He(t).forEach((function(i){(function(e,t){return qe(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(qe(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Ge;var n=t.customMerge(e);return"function"==typeof n?n:Ge}(i,n)(e[i],t[i],n):r[i]=We(t[i],n))})),r}(e,t,n):We(t,n)}Ge.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ge(e,n,t)}),{})};var Xe=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Ge);const Ye={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)"},background:{default:"#FFFFFF"},context:{background:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},divider:{default:"rgba(0,0,0,.12)"},button:{default:"rgba(0,0,0,.54)",focus:"rgba(0,0,0,.12)",hover:"rgba(0,0,0,.12)",disabled:"rgba(0, 0, 0, .18)"},selected:{default:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},highlightOnHover:{default:"#EEEEEE",text:"rgba(0, 0, 0, 0.87)"},striped:{default:"#FAFAFA",text:"rgba(0, 0, 0, 0.87)"}},Ke={default:Ye,light:Ye,dark:{text:{primary:"#FFFFFF",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(0,0,0,.12)"},background:{default:"#424242"},context:{background:"#E91E63",text:"#FFFFFF"},divider:{default:"rgba(81, 81, 81, 1)"},button:{default:"#FFFFFF",focus:"rgba(255, 255, 255, .54)",hover:"rgba(255, 255, 255, .12)",disabled:"rgba(255, 255, 255, .18)"},selected:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},highlightOnHover:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},striped:{default:"rgba(0, 0, 0, .87)",text:"#FFFFFF"}}};function Ze(e,t,n,r){const[i,o]=a.useState((()=>f(e))),[l,c]=a.useState(""),u=a.useRef("");Be((()=>{o(f(e))}),[e]);const h=a.useCallback((e=>{var t,n,r;const{attributes:o}=e.target,s=null===(t=o.getNamedItem("data-column-id"))||void 0===t?void 0:t.value;s&&(u.current=(null===(r=null===(n=i[b(i,s)])||void 0===n?void 0:n.id)||void 0===r?void 0:r.toString())||"",c(u.current))}),[i]),d=a.useCallback((e=>{var n;const{attributes:r}=e.target,s=null===(n=r.getNamedItem("data-column-id"))||void 0===n?void 0:n.value;if(s&&u.current&&s!==u.current){const e=b(i,u.current),n=b(i,s),r=[...i];r[e]=i[n],r[n]=i[e],o(r),t(r)}}),[t,i]),p=a.useCallback((e=>{e.preventDefault()}),[]),g=a.useCallback((e=>{e.preventDefault()}),[]),m=a.useCallback((e=>{e.preventDefault(),u.current="",c("")}),[]),y=function(e=!1){return e?s.ASC:s.DESC}(r),v=a.useMemo((()=>i[b(i,null==n?void 0:n.toString())]||{}),[n,i]);return{tableColumns:i,draggingColumnId:l,handleDragStart:h,handleDragEnter:d,handleDragOver:p,handleDragLeave:g,handleDragEnd:m,defaultSortDirection:y,defaultSortColumn:v}}var Qe=a.memo((function(e){const{data:t=Oe.data,columns:n=Oe.columns,title:r=Oe.title,actions:o=Oe.actions,keyField:l=Oe.keyField,striped:c=Oe.striped,highlightOnHover:h=Oe.highlightOnHover,pointerOnHover:d=Oe.pointerOnHover,dense:f=Oe.dense,selectableRows:m=Oe.selectableRows,selectableRowsSingle:y=Oe.selectableRowsSingle,selectableRowsHighlight:b=Oe.selectableRowsHighlight,selectableRowsNoSelectAll:_=Oe.selectableRowsNoSelectAll,selectableRowsVisibleOnly:x=Oe.selectableRowsVisibleOnly,selectableRowSelected:E=Oe.selectableRowSelected,selectableRowDisabled:P=Oe.selectableRowDisabled,selectableRowsComponent:A=Oe.selectableRowsComponent,selectableRowsComponentProps:T=Oe.selectableRowsComponentProps,onRowExpandToggled:O=Oe.onRowExpandToggled,onSelectedRowsChange:M=Oe.onSelectedRowsChange,expandableIcon:I=Oe.expandableIcon,onChangeRowsPerPage:D=Oe.onChangeRowsPerPage,onChangePage:F=Oe.onChangePage,paginationServer:L=Oe.paginationServer,paginationServerOptions:N=Oe.paginationServerOptions,paginationTotalRows:j=Oe.paginationTotalRows,paginationDefaultPage:z=Oe.paginationDefaultPage,paginationResetDefaultPage:B=Oe.paginationResetDefaultPage,paginationPerPage:U=Oe.paginationPerPage,paginationRowsPerPageOptions:V=Oe.paginationRowsPerPageOptions,paginationIconLastPage:W=Oe.paginationIconLastPage,paginationIconFirstPage:$=Oe.paginationIconFirstPage,paginationIconNext:H=Oe.paginationIconNext,paginationIconPrevious:q=Oe.paginationIconPrevious,paginationComponent:G=Oe.paginationComponent,paginationComponentOptions:X=Oe.paginationComponentOptions,responsive:Y=Oe.responsive,progressPending:K=Oe.progressPending,progressComponent:Z=Oe.progressComponent,persistTableHead:J=Oe.persistTableHead,noDataComponent:ee=Oe.noDataComponent,disabled:te=Oe.disabled,noTableHead:ne=Oe.noTableHead,noHeader:re=Oe.noHeader,fixedHeader:ie=Oe.fixedHeader,fixedHeaderScrollHeight:se=Oe.fixedHeaderScrollHeight,pagination:le=Oe.pagination,subHeader:ce=Oe.subHeader,subHeaderAlign:ue=Oe.subHeaderAlign,subHeaderWrap:he=Oe.subHeaderWrap,subHeaderComponent:de=Oe.subHeaderComponent,noContextMenu:fe=Oe.noContextMenu,contextMessage:pe=Oe.contextMessage,contextActions:ge=Oe.contextActions,contextComponent:ye=Oe.contextComponent,expandableRows:ve=Oe.expandableRows,onRowClicked:be=Oe.onRowClicked,onRowDoubleClicked:Pe=Oe.onRowDoubleClicked,onRowMouseEnter:Ae=Oe.onRowMouseEnter,onRowMouseLeave:Te=Oe.onRowMouseLeave,sortIcon:Re=Oe.sortIcon,onSort:Me=Oe.onSort,sortFunction:Ie=Oe.sortFunction,sortServer:De=Oe.sortServer,expandableRowsComponent:Fe=Oe.expandableRowsComponent,expandableRowsComponentProps:Le=Oe.expandableRowsComponentProps,expandableRowDisabled:Ne=Oe.expandableRowDisabled,expandableRowsHideExpander:je=Oe.expandableRowsHideExpander,expandOnRowClicked:Ue=Oe.expandOnRowClicked,expandOnRowDoubleClicked:Ve=Oe.expandOnRowDoubleClicked,expandableRowExpanded:We=Oe.expandableRowExpanded,expandableInheritConditionalStyles:$e=Oe.expandableInheritConditionalStyles,defaultSortFieldId:He=Oe.defaultSortFieldId,defaultSortAsc:qe=Oe.defaultSortAsc,clearSelectedRows:Ge=Oe.clearSelectedRows,conditionalRowStyles:Ye=Oe.conditionalRowStyles,theme:Qe=Oe.theme,customStyles:Je=Oe.customStyles,direction:et=Oe.direction,onColumnOrderChange:tt=Oe.onColumnOrderChange,className:nt}=e,{tableColumns:rt,draggingColumnId:it,handleDragStart:ot,handleDragEnter:st,handleDragOver:at,handleDragLeave:lt,handleDragEnd:ct,defaultSortDirection:ut,defaultSortColumn:ht}=Ze(n,tt,He,qe),[{rowsPerPage:dt,currentPage:ft,selectedRows:pt,allSelected:gt,selectedCount:mt,selectedColumn:yt,sortDirection:vt,toggleOnSelectedRowsChange:bt},_t]=a.useReducer(w,{allSelected:!1,selectedCount:0,selectedRows:[],selectedColumn:ht,toggleOnSelectedRowsChange:!1,sortDirection:ut,currentPage:z,rowsPerPage:U,selectedRowsFlag:!1,contextMessage:Oe.contextMessage}),{persistSelectedOnSort:wt=!1,persistSelectedOnPageChange:xt=!1}=N,St=!(!L||!xt&&!wt),Et=le&&!K&&t.length>0,Ct=G||ze,kt=a.useMemo((()=>((e={},t="default",n="default")=>{const r=Ke[t]?t:n;return Xe({table:{style:{color:(i=Ke[r]).text.primary,backgroundColor:i.background.default}},tableWrapper:{style:{display:"table"}},responsiveWrapper:{style:{}},header:{style:{fontSize:"22px",color:i.text.primary,backgroundColor:i.background.default,minHeight:"56px",paddingLeft:"16px",paddingRight:"8px"}},subHeader:{style:{backgroundColor:i.background.default,minHeight:"52px"}},head:{style:{color:i.text.primary,fontSize:"12px",fontWeight:500}},headRow:{style:{backgroundColor:i.background.default,minHeight:"52px",borderBottomWidth:"1px",borderBottomColor:i.divider.default,borderBottomStyle:"solid"},denseStyle:{minHeight:"32px"}},headCells:{style:{paddingLeft:"16px",paddingRight:"16px"},draggingStyle:{cursor:"move"}},contextMenu:{style:{backgroundColor:i.context.background,fontSize:"18px",fontWeight:400,color:i.context.text,paddingLeft:"16px",paddingRight:"8px",transform:"translate3d(0, -100%, 0)",transitionDuration:"125ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",willChange:"transform"},activeStyle:{transform:"translate3d(0, 0, 0)"}},cells:{style:{paddingLeft:"16px",paddingRight:"16px",wordBreak:"break-word"},draggingStyle:{}},rows:{style:{fontSize:"13px",fontWeight:400,color:i.text.primary,backgroundColor:i.background.default,minHeight:"48px","&:not(:last-of-type)":{borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:i.divider.default}},denseStyle:{minHeight:"32px"},selectedHighlightStyle:{"&:nth-of-type(n)":{color:i.selected.text,backgroundColor:i.selected.default,borderBottomColor:i.background.default}},highlightOnHoverStyle:{color:i.highlightOnHover.text,backgroundColor:i.highlightOnHover.default,transitionDuration:"0.15s",transitionProperty:"background-color",borderBottomColor:i.background.default,outlineStyle:"solid",outlineWidth:"1px",outlineColor:i.background.default},stripedStyle:{color:i.striped.text,backgroundColor:i.striped.default}},expanderRow:{style:{color:i.text.primary,backgroundColor:i.background.default}},expanderCell:{style:{flex:"0 0 48px"}},expanderButton:{style:{color:i.button.default,fill:i.button.default,backgroundColor:"transparent",borderRadius:"2px",transition:"0.25s",height:"100%",width:"100%","&:hover:enabled":{cursor:"pointer"},"&:disabled":{color:i.button.disabled},"&:hover:not(:disabled)":{cursor:"pointer",backgroundColor:i.button.hover},"&:focus":{outline:"none",backgroundColor:i.button.focus},svg:{margin:"auto"}}},pagination:{style:{color:i.text.secondary,fontSize:"13px",minHeight:"56px",backgroundColor:i.background.default,borderTopStyle:"solid",borderTopWidth:"1px",borderTopColor:i.divider.default},pageButtonsStyle:{borderRadius:"50%",height:"40px",width:"40px",padding:"8px",margin:"px",cursor:"pointer",transition:"0.4s",color:i.button.default,fill:i.button.default,backgroundColor:"transparent","&:disabled":{cursor:"unset",color:i.button.disabled,fill:i.button.disabled},"&:hover:not(:disabled)":{backgroundColor:i.button.hover},"&:focus":{outline:"none",backgroundColor:i.button.focus}}},noData:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:i.text.primary,backgroundColor:i.background.default}},progress:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:i.text.primary,backgroundColor:i.background.default}}},e);var i})(Je,Qe)),[Je,Qe]),Pt=a.useMemo((()=>Object.assign({},"auto"!==et&&{dir:et})),[et]),At=a.useMemo((()=>{if(De)return t;if((null==yt?void 0:yt.sortFunction)&&"function"==typeof yt.sortFunction){const e=yt.sortFunction,n=vt===s.ASC?e:(t,n)=>-1*e(t,n);return[...t].sort(n)}return function(e,t,n,r){return t?r&&"function"==typeof r?r(e.slice(0),t,n):e.slice(0).sort(((e,r)=>{const i=t(e),o=t(r);if("asc"===n){if(io)return 1}if("desc"===n){if(i>o)return-1;if(i{if(le&&!L){const e=ft*dt,t=e-dt;return At.slice(t,e)}return At}),[ft,le,L,dt,At]),Rt=a.useCallback((e=>{_t(e)}),[]),Ot=a.useCallback((e=>{_t(e)}),[]),Mt=a.useCallback((e=>{_t(e)}),[]),It=a.useCallback(((e,t)=>be(e,t)),[be]),Dt=a.useCallback(((e,t)=>Pe(e,t)),[Pe]),Ft=a.useCallback(((e,t)=>Ae(e,t)),[Ae]),Lt=a.useCallback(((e,t)=>Te(e,t)),[Te]),Nt=a.useCallback((e=>_t({type:"CHANGE_PAGE",page:e,paginationServer:L,visibleOnly:x,persistSelectedOnPageChange:xt})),[L,xt,x]),jt=a.useCallback((e=>{const t=p(j||Tt.length,e),n=g(ft,t);L||Nt(n),_t({type:"CHANGE_ROWS_PER_PAGE",page:n,rowsPerPage:e})}),[ft,Nt,L,j,Tt.length]);if(le&&!L&&At.length>0&&0===Tt.length){const e=p(At.length,dt),t=g(ft,e);Nt(t)}Be((()=>{M({allSelected:gt,selectedCount:mt,selectedRows:pt.slice(0)})}),[bt]),Be((()=>{Me(yt,vt,At.slice(0))}),[yt,vt]),Be((()=>{F(ft,j||At.length)}),[ft]),Be((()=>{D(dt,ft)}),[dt]),Be((()=>{Nt(z)}),[z,B]),Be((()=>{if(le&&L&&j>0){const e=p(j,dt),t=g(ft,e);ft!==t&&Nt(t)}}),[j]),a.useEffect((()=>{_t({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:Ge})}),[y,Ge]),a.useEffect((()=>{if(!E)return;const e=At.filter((e=>E(e))),t=y?e.slice(0,1):e;_t({type:"SELECT_MULTIPLE_ROWS",keyField:l,selectedRows:t,totalRows:At.length,mergeSelections:St})}),[t,E]);const zt=x?Tt:At,Bt=xt||y||_;return a.createElement(i.ThemeProvider,{theme:kt},!re&&(!!r||!!o)&&a.createElement(me,{title:r,actions:o,showMenu:!fe,selectedCount:mt,direction:et,contextActions:ge,contextComponent:ye,contextMessage:pe}),ce&&a.createElement(_e,{align:ue,wrapContent:he},de),a.createElement(xe,Object.assign({$responsive:Y,$fixedHeader:ie,$fixedHeaderScrollHeight:se,className:nt},Pt),a.createElement(Ee,null,K&&!J&&a.createElement(Se,null,Z),a.createElement(S,{disabled:te,className:"rdt_Table",role:"table"},!ne&&(!!J||At.length>0&&!K)&&a.createElement(C,{className:"rdt_TableHead",role:"rowgroup",$fixedHeader:ie},a.createElement(k,{className:"rdt_TableHeadRow",role:"row",$dense:f},m&&(Bt?a.createElement(R,{style:{flex:"0 0 48px"}}):a.createElement(ae,{allSelected:gt,selectedRows:pt,selectableRowsComponent:A,selectableRowsComponentProps:T,selectableRowDisabled:P,rowData:zt,keyField:l,mergeSelections:St,onSelectAllRows:Ot})),ve&&!je&&a.createElement(Ce,null),rt.map((e=>a.createElement(oe,{key:e.id,column:e,selectedColumn:yt,disabled:K||0===At.length,pagination:le,paginationServer:L,persistSelectedOnSort:wt,selectableRowsVisibleOnly:x,sortDirection:vt,sortIcon:Re,sortServer:De,onSort:Rt,onDragStart:ot,onDragOver:at,onDragEnd:ct,onDragEnter:st,onDragLeave:lt,draggingColumnId:it}))))),!At.length&&!K&&a.createElement(ke,null,ee),K&&J&&a.createElement(Se,null,Z),!K&&At.length>0&&a.createElement(we,{className:"rdt_TableBody",role:"rowgroup"},Tt.map(((e,t)=>{const n=u(e,l),r=function(e=""){return"number"!=typeof e&&(!e||0===e.length)}(n)?t:n,i=v(e,pt,l),o=!!(ve&&We&&We(e)),s=!!(ve&&Ne&&Ne(e));return a.createElement(Q,{id:r,key:r,keyField:l,"data-row-id":r,columns:rt,row:e,rowCount:At.length,rowIndex:t,selectableRows:m,expandableRows:ve,expandableIcon:I,highlightOnHover:h,pointerOnHover:d,dense:f,expandOnRowClicked:Ue,expandOnRowDoubleClicked:Ve,expandableRowsComponent:Fe,expandableRowsComponentProps:Le,expandableRowsHideExpander:je,defaultExpanderDisabled:s,defaultExpanded:o,expandableInheritConditionalStyles:$e,conditionalRowStyles:Ye,selected:i,selectableRowsHighlight:b,selectableRowsComponent:A,selectableRowsComponentProps:T,selectableRowDisabled:P,selectableRowsSingle:y,striped:c,onRowExpandToggled:O,onRowClicked:It,onRowDoubleClicked:Dt,onRowMouseEnter:Ft,onRowMouseLeave:Lt,onSelectedRow:Mt,draggingColumnId:it,onDragStart:ot,onDragOver:at,onDragEnd:ct,onDragEnter:st,onDragLeave:lt})})))))),Et&&a.createElement("div",null,a.createElement(Ct,{onChangePage:Nt,onChangeRowsPerPage:jt,rowCount:j||At.length,currentPage:ft,rowsPerPage:dt,direction:et,paginationRowsPerPageOptions:V,paginationIconLastPage:W,paginationIconFirstPage:$,paginationIconNext:H,paginationIconPrevious:q,paginationComponentOptions:X})))}));t.an=function(e="default",t,n="default"){return Ke[e]||(Ke[e]=Xe(Ke[n],t||{})),Ke[e]=Xe(Ke[e],t||{}),Ke[e]},t.Ay=Qe},2551:(e,t,n)=>{"use strict";var r=n(6540),i=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n