x?1:g===x?0:(g-D)/(g-x),N=m-(m-v)*e,F=_-(_-P)*e,T=S-(S-k)*e,M=A-(A-C)*e}let e;e=Dx?1:(p-D)/(p-x),R=f-(f-v)*e,I=b-(b-P)*e,O=y-(y-k)*e,L=w-(w-C)*e;const t=Math.round(Math.min(N,R)),n=Math.round(Math.max(N,R));let r=u*D+4*t;for(let a=t;a<=n;a++)e=(N-a)/(N-R),e<0?e=0:e>1&&(e=1),d[r++]=F-(F-I)*e|0,d[r++]=T-(T-O)*e|0,d[r++]=M-(M-L)*e|0,d[r++]=255}}function d(e,t,n){const r=t.coords,a=t.colors;let i,s;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(r.length/o)-1,d=o-1;for(i=0;i=r?a=r:n=a/e,{scale:n,size:a}}clipBbox(e,t,n,r,i){const s=r-t,o=i-n;e.ctx.rect(t,n,s,o),e.current.updateRectMinMax((0,a.getCurrentTransform)(e.ctx),[t,n,r,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const a=e.ctx,i=e.current;switch(t){case f:const e=this.ctx;a.fillStyle=e.fillStyle,a.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case p:const s=r.Util.makeHexColor(n[0],n[1],n[2]);a.fillStyle=s,a.strokeStyle=s,i.fillColor=s,i.strokeColor=s;break;default:throw new r.FormatError("Unsupported paint type: ".concat(t))}}getPattern(e,t,n,a){let s=n;a!==i.SHADING&&(s=r.Util.transform(s,t.baseTransform),this.matrix&&(s=r.Util.transform(s,this.matrix)));const o=this.createPatternCanvas(t);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}_defineProperty(m,"MAX_PATTERN_SIZE",3e3),t.TilingPattern=m},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=a,t.convertToRGBA=function(e){switch(e.kind){case r.ImageKind.GRAYSCALE_1BPP:return a(e);case r.ImageKind.RGB_24BPP:return function(e){let{src:t,srcPos:n=0,dest:a,destPos:i=0,width:s,height:o}=e,l=0;const c=t.length>>2,d=new Uint32Array(t.buffer,n,c);if(r.FeatureTest.isLittleEndian){for(;l>>24|t<<8|4278190080,a[i+2]=t>>>16|n<<16|4278190080,a[i+3]=n>>>8|4278190080}for(let e=4*l,n=t.length;e>>8|255,a[i+2]=t<<16|n>>>16|255,a[i+3]=n<<8|255}for(let e=4*l,n=t.length;e>3,f=7&i,p=t.length;a=new Uint32Array(a.buffer);let m=0;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=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(1);const a=1,i=2,s=1,o=2,l=3,c=4,d=5,u=6,h=7,f=8;function p(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())}}var m=new WeakSet;function g(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,i=this.comObj,s=this,o=this.actionHandler[e.action],u={enqueue(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=s,l>0&&this.desiredSize<=0&&(this.sinkCapability=new r.PromiseCapability,this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:a,stream:c,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:l,streamId:t}),delete s.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:d,streamId:t,reason:p(e)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,new Promise((function(t){t(o(e.data,u))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,reason:p(e)})}))}function v(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,i=this.comObj,g=this.streamControllers[t],v=this.streamSinks[t];switch(e.stream){case f:e.success?g.startCall.resolve():g.startCall.reject(p(e.reason));break;case h:e.success?g.pullCall.resolve():g.pullCall.reject(p(e.reason));break;case u:if(!v){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,success:!0});break}v.desiredSize<=0&&e.desiredSize>0&&v.sinkCapability.resolve(),v.desiredSize=e.desiredSize,new Promise((function(e){var t;e(null===(t=v.onPull)||void 0===t?void 0:t.call(v))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,reason:p(e)})}));break;case c:if((0,r.assert)(g,"enqueue should have stream controller"),g.isClosed)break;g.controller.enqueue(e.chunk);break;case l:if((0,r.assert)(g,"close should have stream controller"),g.isClosed)break;g.isClosed=!0,g.controller.close(),_assertClassBrand(m,this,x).call(this,g,t);break;case d:(0,r.assert)(g,"error should have stream controller"),g.controller.error(p(e.reason)),_assertClassBrand(m,this,x).call(this,g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(p(e.reason)),_assertClassBrand(m,this,x).call(this,g,t);break;case s:if(!v)break;new Promise((function(t){var n;t(null===(n=v.onCancel)||void 0===n?void 0:n.call(v,p(e.reason)))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:o,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:o,streamId:t,reason:p(e)})})),v.sinkCapability.reject(p(e.reason)),v.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async function x(e,t){var n,r,a;await Promise.allSettled([null===(n=e.startCall)||void 0===n?void 0:n.promise,null===(r=e.pullCall)||void 0===r?void 0:r.promise,null===(a=e.cancelCall)||void 0===a?void 0:a.promise]),delete this.streamControllers[t]}t.MessageHandler=class{constructor(e,t,n){_classPrivateMethodInitSpec(this,m),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 _assertClassBrand(m,this,v).call(this,t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error("Cannot resolve callback ".concat(e));if(delete this.callbackCapabilities[e],t.callback===a)n.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");n.reject(p(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error("Unknown action from worker: ".concat(t.action));if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){n.postMessage({sourceName:e,targetName:s,callback:a,callbackId:t.callbackId,data:r})}),(function(r){n.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:p(r)})}))}else t.streamId?_assertClassBrand(m,this,g).call(this,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 "'.concat(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 a=this.callbackId++,i=new r.PromiseCapability;this.callbackCapabilities[a]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},n)}catch(s){i.reject(s)}return i.promise}sendWithStream(e,t,n,a){const i=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const s=new r.PromiseCapability;return this.streamControllers[i]={controller:n,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:e,streamId:i,data:t,desiredSize:n.desiredSize},a),s.promise},pull:e=>{const t=new r.PromiseCapability;return this.streamControllers[i].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:u,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=new r.PromiseCapability;return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:i,reason:p(e)}),t.promise}},n)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1),a=new WeakMap,i=new WeakMap;t.Metadata=class{constructor(e){let{parsedData:t,rawData:n}=e;_classPrivateFieldInitSpec(this,a,void 0),_classPrivateFieldInitSpec(this,i,void 0),_classPrivateFieldSet(a,this,t),_classPrivateFieldSet(i,this,n)}getRaw(){return _classPrivateFieldGet(i,this)}get(e){var t;return null!==(t=_classPrivateFieldGet(a,this).get(e))&&void 0!==t?t:null}getAll(){return(0,r.objectFromMap)(_classPrivateFieldGet(a,this))}has(e){return _classPrivateFieldGet(a,this).has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1),a=n(8);const i=Symbol("INTERNAL");var s=new WeakMap;class o{constructor(e,t){_classPrivateFieldInitSpec(this,s,!0),this.name=e,this.intent=t}get visible(){return _classPrivateFieldGet(s,this)}_setVisible(e,t){e!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(s,this,t)}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakSet;function f(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let a=1;a1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(c,this).has(e)?(_classPrivateFieldGet(c,this).get(e)._setVisible(i,!!t),_classPrivateFieldSet(l,this,null)):(0,r.warn)("Optional content group not found: ".concat(e))}get hasInitialVisibility(){return null===_classPrivateFieldGet(d,this)||this.getHash()===_classPrivateFieldGet(d,this)}getOrder(){return _classPrivateFieldGet(c,this).size?_classPrivateFieldGet(u,this)?_classPrivateFieldGet(u,this).slice():[..._classPrivateFieldGet(c,this).keys()]:null}getGroups(){return _classPrivateFieldGet(c,this).size>0?(0,r.objectFromMap)(_classPrivateFieldGet(c,this)):null}getGroup(e){return _classPrivateFieldGet(c,this).get(e)||null}getHash(){if(null!==_classPrivateFieldGet(l,this))return _classPrivateFieldGet(l,this);const e=new a.MurmurHash3_64;for(const[t,n]of _classPrivateFieldGet(c,this))e.update("".concat(t,":").concat(n.visible));return _classPrivateFieldSet(l,this,e.hexdigest())}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(1),a=n(6);t.PDFDataTransportStream=class{constructor(e,t){let{length:n,initialData:a,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:o=!1,disableStream:l=!1}=e;if((0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,(null===a||void 0===a?void 0:a.length)>0){const e=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=n,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){let{begin:t,chunk:n}=e;const a=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{const e=this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(a),!0)}));(0,r.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}_onProgress(e){var t,n,r,a;void 0===e.total?null===(t=this._rangeReaders[0])||void 0===t||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded}):null===(r=this._fullRequestReader)||void 0===r||null===(a=r.onProgress)||void 0===a||a.call(r,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;null===(e=this._fullRequestReader)||void 0===e||e.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 i(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){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}};class i{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=e,this._done=n||!1,this._filename=(0,a.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.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=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.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=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),a=n(20);function i(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}function o(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,r.warn)("getArrayBuffer - unexpected data format: ".concat(e)),new Uint8Array(e).buffer)}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(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class l{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=new r.PromiseCapability,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,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:i,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,a.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(){var e;await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:o(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=s(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(t,"-").concat(n-1));const l=o.url;fetch(l,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.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(){var e;await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:o(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}},(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 (".concat(e,') while retrieving PDF "').concat(t,'".'),e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,a.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,i.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function(e){let{getResponseHeader:t,isHttp:n,rangeChunkSize:r,disableRange:a}=e;const i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return Number.isInteger(s)?(i.suggestedLength=s,s<=2*r||a||!n||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),a=n(21),i=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=a("filename\\*","i").exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=l(e),e=c(e),s(e)}if(n=function(e){const t=[];let n;const r=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,a]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,a]}const i=[];for(let a=0;a{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(1),a=n(20);class i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const a in n)r[a]=n[a];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const a in this.httpHeaders){const e=this.httpHeaders[a];void 0!==e&&t.setRequestHeader(a,e)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(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){var n;const r=this.pendingRequests[e];r&&(null===(n=r.onProgress)||void 0===n||n.call(r,t))}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==a.readyState)return;if(!(e in this.pendingRequests))return;var i;if(delete this.pendingRequests[e],0===a.status&&this.isHttp)return void(null===(i=n.onError)||void 0===i||i.call(n,a.status));const s=a.status||200;var o;if((200!==s||206!==n.expectedStatus)&&s!==n.expectedStatus)return void(null===(o=n.onError)||void 0===o||o.call(n,a.status));const l=function(e){const t=e.response;return"string"!==typeof t?t:(0,r.stringToBytes)(t).buffer}(a);if(206===s){const e=a.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:l})}else if(l)n.onDone({begin:0,chunk:l});else{var c;null===(c=n.onError)||void 0===c||c.call(n,a.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 i(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 o(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.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=new r.PromiseCapability,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:i}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,a.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,a.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{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=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{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(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,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 n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,a.createResponseStatusError)(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||null===(t=this.onProgress)||void 0===t||t.call(this,{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=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.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.PDFNodeStream=void 0;var r=n(1),a=n(20);const i=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=__webpack_require__(9052),n=t.parse(e);return"file:"===n.protocol||n.host?n:/^[a-z]:[/\\]/i.test(e)?t.parse("file:///".concat(e)):(n.host||(n.protocol="file:"),n)}(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(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new u(this):new c(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new h(this,e,t):new d(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class s{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=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}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(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).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 o{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).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 l(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class c extends s{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException('Missing PDF "'.concat(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:i,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(n)};if(this._request=null,"http:"===this._url.protocol){const n=__webpack_require__(7492);this._request=n.request(l(this._url,e.httpHeaders),t)}else{const n=__webpack_require__(1815);this._request=n.request(l(this._url,e.httpHeaders),t)}this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class d extends o{constructor(e,t,n){super(e),this._httpHeaders={};for(const r in e.httpHeaders){const t=e.httpHeaders[r];void 0!==t&&(this._httpHeaders[r]=t)}this._httpHeaders.Range="bytes=".concat(t,"-").concat(n-1);const a=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=e}};if(this._request=null,"http:"===this._url.protocol){const e=__webpack_require__(7492);this._request=e.request(l(this._url,this._httpHeaders),a)}else{const e=__webpack_require__(1815);this._request=e.request(l(this._url,this._httpHeaders),a)}this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class u extends s{constructor(e){super(e);let t=decodeURIComponent(this._url.path);i.test(this._url.href)&&(t=t.replace(/^\//,""));const n=__webpack_require__(3237);n.lstat(t,((e,a)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException('Missing PDF "'.concat(t,'".'))),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=a.size,this._setReadableStream(n.createReadStream(t)),this._headersCapability.resolve()}))}}class h extends o{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);i.test(this._url.href)&&(r=r.replace(/^\//,""));const a=__webpack_require__(3237);this._setReadableStream(a.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(6),a=n(1);const i="normal",s="normal",o="#000000",l=["butt","round","square"],c=["miter","round","bevel"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let a="data:".concat(t,";base64,");for(let i=0,s=e.length;i>2]+r[(3&t)<<4|n>>4]+r[i+1>6:64]+r[i+2>1&2147483647:e>>1&2147483647;t[a]=e}function n(e,n,r,a){let i=a;const s=n.length;r[i]=s>>24&255,r[i+1]=s>>16&255,r[i+2]=s>>8&255,r[i+3]=255&s,i+=4,r[i]=255&e.charCodeAt(0),r[i+1]=255&e.charCodeAt(1),r[i+2]=255&e.charCodeAt(2),r[i+3]=255&e.charCodeAt(3),i+=4,r.set(n,i),i+=n.length;const o=function(e,n,r){let a=-1;for(let i=n;i>>8^t[n]}return~a}(r,a+4,i);r[i]=o>>24&255,r[i+1]=o>>16&255,r[i+2]=o>>8&255,r[i+3]=255&o}function r(e){let t=e.length;const n=65535,r=Math.ceil(t/n),a=new Uint8Array(2+t+5*r+4);let i=0;a[i++]=120,a[i++]=156;let s=0;for(;t>n;)a[i++]=0,a[i++]=255,a[i++]=255,a[i++]=0,a[i++]=0,a.set(e.subarray(s,s+n),i),i+=n,s+=n,t-=n;a[i++]=1,a[i++]=255&t,a[i++]=t>>8&255,a[i++]=255&~t,a[i++]=(65535&~t)>>8&255,a.set(e.subarray(s),i),i+=e.length-s;const o=function(e,t,n){let r=1,a=0;for(let i=t;i>24&255,a[i++]=o>>16&255,a[i++]=o>>8&255,a[i++]=255&o,a}function i(t,i,s,o){const l=t.width,c=t.height;let u,h,f;const p=t.data;switch(i){case a.ImageKind.GRAYSCALE_1BPP:h=0,u=1,f=l+7>>3;break;case a.ImageKind.RGB_24BPP:h=2,u=8,f=3*l;break;case a.ImageKind.RGBA_32BPP:h=6,u=8,f=4*l;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+f)*c);let g=0,v=0;for(let e=0;e>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,u,h,0,0,0]),b=function(e){if(!a.isNodeJS)return r(e);try{const t=parseInt(process.versions.node)>=8?e:Buffer.from(e),n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return r(e)}(m),y=e.length+36+x.length+b.length,w=new Uint8Array(y);let _=0;return w.set(e,_),_+=e.length,n("IHDR",x,w,_),_+=12+x.length,n("IDATA",b,w,_),_+=12+b.length,n("IEND",new Uint8Array(0),w,_),d(w,"image/png",s)}return function(e,t,n){return i(e,void 0===e.kind?a.ImageKind.GRAYSCALE_1BPP:e.kind,t,n)}}();class h{constructor(){this.fontSizeScale=1,this.fontWeight=s,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=o,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 f(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 p(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":"scale(".concat(f(e[0])," ").concat(f(e[3]),")");if(e[0]===e[3]&&e[1]===-e[2]){const t=180*Math.acos(e[0])/Math.PI;return"rotate(".concat(f(t),")")}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return"translate(".concat(f(e[4])," ").concat(f(e[5]),")");return"matrix(".concat(f(e[0])," ").concat(f(e[1])," ").concat(f(e[2])," ").concat(f(e[3])," ").concat(f(e[4])," ")+"".concat(f(e[5]),")")}let m=0,g=0,v=0;t.SVGGraphics=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(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 h,this.transformMatrix=a.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 r in a.OPS)this._operatorIdMapping[a.OPS[r]]=r}getObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}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 r=0,i=t.length;r{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,r,i,s){const o=[e,t,n,r,i,s];this.transformMatrix=a.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,a=[];for(let i=0,s=r.length;i0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=l[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=a.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=a.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{width:t,height:n}=this.viewport,r=a.Util.inverseTransform(this.transformMatrix),[i,s,o,l]=a.Util.getAxialAlignedBoundingBox([0,0,t,n],r),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",i),c.setAttributeNS(null,"y",s),c.setAttributeNS(null,"width",o-i),c.setAttributeNS(null,"height",l-s),c.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(c)}_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]||a.IDENTITY_MATRIX,[i,s,o,l]=e[4],c=e[5],d=e[6],u=e[7],h="shading".concat(v++),[f,p,m,g]=a.Util.normalizeRect([...a.Util.applyTransform([i,s],r),...a.Util.applyTransform([o,l],r)]),[x,b]=a.Util.singularValueDecompose2dScale(r),y=c*x,w=d*b,_=this.svgFactory.createElement("svg:pattern");_.setAttributeNS(null,"id",h),_.setAttributeNS(null,"patternUnits","userSpaceOnUse"),_.setAttributeNS(null,"width",y),_.setAttributeNS(null,"height",w),_.setAttributeNS(null,"x","".concat(f)),_.setAttributeNS(null,"y","".concat(p));const S=this.svg,A=this.transformMatrix,P=this.current.fillColor,k=this.current.strokeColor,C=this.svgFactory.create(m-f,g-p);if(this.svg=C,this.transformMatrix=r,2===u){const e=a.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=A,this.current.fillColor=P,this.current.strokeColor=k,_.append(C.childNodes[0]),this.defs.append(_),"url(#".concat(h,")")}_makeShadingPattern(e){switch("string"===typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading".concat(v++),n=e[3];let r;switch(e[1]){case"axial":const n=e[4],a=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",a[0]),r.setAttributeNS(null,"y2",a[1]);break;case"radial":const i=e[4],s=e[5],o=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",i[0]),r.setAttributeNS(null,"fy",i[1]),r.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: ".concat(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(#".concat(t,")");case"Mesh":return(0,a.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let r=n.x,i=n.y,s=[],o=0;for(const l of e)switch(0|l){case a.OPS.rectangle:r=t[o++],i=t[o++];const e=r+t[o++],n=i+t[o++];s.push("M",f(r),f(i),"L",f(e),f(i),"L",f(e),f(n),"L",f(r),f(n),"Z");break;case a.OPS.moveTo:r=t[o++],i=t[o++],s.push("M",f(r),f(i));break;case a.OPS.lineTo:r=t[o++],i=t[o++],s.push("L",f(r),f(i));break;case a.OPS.curveTo:r=t[o+4],i=t[o+5],s.push("C",f(t[o]),f(t[o+1]),f(t[o+2]),f(t[o+3]),f(r),f(i)),o+=6;break;case a.OPS.curveTo2:s.push("C",f(r),f(i),f(t[o]),f(t[o+1]),f(t[o+2]),f(t[o+3])),r=t[o+2],i=t[o+3],o+=4;break;case a.OPS.curveTo3:r=t[o+2],i=t[o+3],s.push("C",f(t[o]),f(t[o+1]),f(r),f(i),f(r),f(i)),o+=4;break;case a.OPS.closePath:s.push("Z")}s=s.join(" "),n.path&&e.length>0&&e[0]!==a.OPS.rectangle&&e[0]!==a.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,i)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath".concat(m++),n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",p(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(#".concat(t,")"),this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t="".concat(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,a.warn)("Unimplemented graphic state operator ".concat(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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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",f(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",f(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(f).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",f(t*n.dashPhase)+"px")}eoFill(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var e;null===(e=this.current.element)||void 0===e||e.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=this.getObject(e);t?this.paintInlineImageXObject(t):(0,a.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}paintInlineImageXObject(e,t){const n=e.width,r=e.height,a=u(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",f(n)),i.setAttributeNS(null,"height",f(r)),this.current.element=i,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",f(-r)),s.setAttributeNS(null,"width",f(n)+"px"),s.setAttributeNS(null,"height",f(r)+"px"),s.setAttributeNS(null,"transform","scale(".concat(f(1/n)," ").concat(f(-1/r),")")),t?t.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,r=t.width,i=t.height,s=n.fillColor;n.maskId="mask".concat(g++);const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",f(r)),l.setAttributeNS(null,"height",f(i)),l.setAttributeNS(null,"fill",s),l.setAttributeNS(null,"mask","url(#".concat(n.maskId,")")),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,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",f(e)),r.setAttributeNS(null,"height",f(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",p(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",p(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}},(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){var a;if(!r)return;let i=null;const s=r.name;if("#text"===s)i=r.value;else{if(!n.shouldBuildText(s))return;null!==r&&void 0!==r&&null!==(a=r.attributes)&&void 0!==a&&a.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.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,a.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const{container:t,viewport:n}=e,r=getComputedStyle(t),i=r.getPropertyValue("visibility"),s=parseFloat(r.getPropertyValue("--scale-factor"));"visible"===i&&(!s||Math.abs(s-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new u(e);return o._render(),o},t.updateTextLayer=function(e){let{container:t,viewport:n,textDivs:r,textDivProperties:i,isOffscreenCanvasSupported:s,mustRotate:o=!0,mustRescale:c=!0}=e;if(o&&(0,a.setLayerDimensions)(t,{rotation:n.rotation}),c){const e=l(0,s),t={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const n of r)t.properties=i.get(n),t.div=n,d(t)}};var r=n(1),a=n(6);const i=30,s=.8,o=new Map;function l(e,t){let n;if(t&&r.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function c(e,t,n){const a=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(a);const d=r.Util.transform(e._transform,t.transform);let u=Math.atan2(d[1],d[0]);const h=n[t.fontName];h.vertical&&(u+=Math.PI/2);const f=Math.hypot(d[2],d[3]),p=f*function(e,t){const n=o.get(e);if(n)return n;const r=l(i,t);r.font="".concat(i,"px ").concat(e);const a=r.measureText("");let c=a.fontBoundingBoxAscent,d=Math.abs(a.fontBoundingBoxDescent);if(c){const t=c/(c+d);return o.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle="red",r.clearRect(0,0,i,i),r.strokeText("g",0,0);let u=r.getImageData(0,0,i,i).data;d=0;for(let s=u.length-1-3;s>=0;s-=4)if(u[s]>0){d=Math.ceil(s/4/i);break}r.clearRect(0,0,i,i),r.strokeText("A",0,i),u=r.getImageData(0,0,i,i).data,c=0;for(let s=0,o=u.length;s0){c=i-Math.floor(s/4/i);break}if(r.canvas.width=r.canvas.height=0,c){const t=c/(c+d);return o.set(e,t),t}return o.set(e,s),s}(h.fontFamily,e._isOffscreenCanvasSupported);let m,g;0===u?(m=d[4],g=d[5]-p):(m=d[4]+p*Math.sin(u),g=d[5]-p*Math.cos(u));const v="calc(var(--scale-factor)*",x=a.style;e._container===e._rootContainer?(x.left="".concat((100*m/e._pageWidth).toFixed(2),"%"),x.top="".concat((100*g/e._pageHeight).toFixed(2),"%")):(x.left="".concat(v).concat(m.toFixed(2),"px)"),x.top="".concat(v).concat(g.toFixed(2),"px)")),x.fontSize="".concat(v).concat(f.toFixed(2),"px)"),x.fontFamily=h.fontFamily,c.fontSize=f,a.setAttribute("role","presentation"),a.textContent=t.str,a.dir=t.dir,e._fontInspectorEnabled&&(a.dataset.fontName=t.fontName),0!==u&&(c.angle=u*(180/Math.PI));let b=!1;if(t.str.length>1)b=!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&&(b=!0)}b&&(c.canvasWidth=h.vertical?t.height:t.width),e._textDivProperties.set(a,c),e._isReadableStream&&e._layoutText(a)}function d(e){const{div:t,scale:n,properties:r,ctx:a,prevFontSize:i,prevFontFamily:s}=e,{style:o}=t;let l="";if(0!==r.canvasWidth&&r.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:u}=r;i===u&&s===c||(a.font="".concat(u*n,"px ").concat(c),e.prevFontSize=u,e.prevFontFamily=c);const{width:h}=a.measureText(t.textContent);h>0&&(l="scaleX(".concat(d*n/h,")"))}0!==r.angle&&(l="rotate(".concat(r.angle,"deg) ").concat(l)),l.length>0&&(o.transform=l)}class u{constructor(e){var t;let{textContentSource:n,container:i,viewport:s,textDivs:o,textDivProperties:c,textContentItemsStr:d,isOffscreenCanvasSupported:u}=e;this._textContentSource=n,this._isReadableStream=n instanceof ReadableStream,this._container=this._rootContainer=i,this._textDivs=o||[],this._textContentItemsStr=d||[],this._isOffscreenCanvasSupported=u,this._fontInspectorEnabled=!(null===(t=globalThis.FontInspector)||void 0===t||!t.enabled),this._reader=null,this._textDivProperties=c||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l(0,u)};const{pageWidth:h,pageHeight:f,pageX:p,pageY:m}=s.rawDims;this._transform=[1,0,0,-1,-p,m+f],this._pageWidth=h,this._pageHeight=f,(0,a.setLayerDimensions)(i,s),this._capability.promise.finally((()=>{this._layoutTextParams=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),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),c(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id","".concat(n.id)),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,d(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=new r.PromiseCapability;let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then((r=>{let{value:a,done:i}=r;i?e.resolve():(Object.assign(t,a.styles),this._processItems(a.items,t),n())}),e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then((()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}t.TextLayerRenderTask=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(1),a=n(4),i=n(28),s=n(33),o=n(6),l=n(34),c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakSet;class y{constructor(e){let{uiManager:t,pageIndex:n,div:r,accessibilityManager:a,annotationLayer:o,viewport:w,l10n:_}=e;_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,!1),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,h,this.pointerup.bind(this)),_classPrivateFieldInitSpec(this,f,this.pointerdown.bind(this)),_classPrivateFieldInitSpec(this,p,new Map),_classPrivateFieldInitSpec(this,m,!1),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,x,void 0);const S=[i.FreeTextEditor,s.InkEditor,l.StampEditor];if(!y._initialized){y._initialized=!0;for(const e of S)e.initialize(_)}t.registerEditorTypes(S),_classPrivateFieldSet(x,this,t),this.pageIndex=n,this.div=r,_classPrivateFieldSet(c,this,a),_classPrivateFieldSet(u,this,o),this.viewport=w,_classPrivateFieldGet(x,this).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(p,this).size}updateToolbar(e){_classPrivateFieldGet(x,this).updateToolbar(e)}updateMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(x,this).getMode();_assertClassBrand(b,this,A).call(this),e===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),e!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===r.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",e===r.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||_classPrivateFieldGet(x,this).getMode()===r.AnnotationEditorType.INK){if(!e)for(const e of _classPrivateFieldGet(p,this).values())if(e.isEmpty())return void e.setInBackground();_assertClassBrand(b,this,_).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){_classPrivateFieldGet(x,this).setEditingState(e)}addCommands(e){_classPrivateFieldGet(x,this).addCommands(e)}enable(){this.div.style.pointerEvents="auto";const e=new Set;for(const n of _classPrivateFieldGet(p,this).values())n.enableEditing(),n.annotationElementId&&e.add(n.annotationElementId);if(!_classPrivateFieldGet(u,this))return;const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){if(n.hide(),_classPrivateFieldGet(x,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){_classPrivateFieldSet(v,this,!0),this.div.style.pointerEvents="none";const e=new Set;for(const n of _classPrivateFieldGet(p,this).values()){var t;n.disableEditing(),n.annotationElementId&&null===n.serialize()?(null===(t=this.getEditableAnnotation(n.annotationElementId))||void 0===t||t.show(),n.remove()):e.add(n.annotationElementId)}if(_classPrivateFieldGet(u,this)){const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){const{id:t}=n.data;e.has(t)||_classPrivateFieldGet(x,this).isDeletedAnnotationElement(t)||n.show()}}_assertClassBrand(b,this,A).call(this),this.isEmpty&&(this.div.hidden=!0),_classPrivateFieldSet(v,this,!1)}getEditableAnnotation(e){var t;return(null===(t=_classPrivateFieldGet(u,this))||void 0===t?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){_classPrivateFieldGet(x,this).getActive()!==e&&_classPrivateFieldGet(x,this).setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(f,this)),this.div.addEventListener("pointerup",_classPrivateFieldGet(h,this))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(f,this)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(h,this))}attach(e){_classPrivateFieldGet(p,this).set(e.id,e);const{annotationElementId:t}=e;t&&_classPrivateFieldGet(x,this).isDeletedAnnotationElement(t)&&_classPrivateFieldGet(x,this).removeDeletedAnnotationElement(e)}detach(e){var t;_classPrivateFieldGet(p,this).delete(e.id),null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(e.contentDiv),!_classPrivateFieldGet(v,this)&&e.annotationElementId&&_classPrivateFieldGet(x,this).addDeletedAnnotationElement(e)}remove(e){this.detach(e),_classPrivateFieldGet(x,this).removeEditor(e),e.div.contains(document.activeElement)&&setTimeout((()=>{_classPrivateFieldGet(x,this).focusMainContainer()}),0),e.div.remove(),e.isAttachedToDOM=!1,_classPrivateFieldGet(g,this)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.annotationElementId&&(_classPrivateFieldGet(x,this).addDeletedAnnotationElement(e.annotationElementId),a.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),null===(t=e.parent)||void 0===t||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.changeParent(e),_classPrivateFieldGet(x,this).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),_classPrivateFieldGet(x,this).addToAnnotationStorage(e)}moveEditorInDOM(e){var t;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&(e._focusEventsAllowed=!1,setTimeout((()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),n.focus())}),0)),e._structTreeParentId=null===(t=_classPrivateFieldGet(c,this))||void 0===t?void 0:t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(x,this).getId()}pasteEditor(e,t){_classPrivateFieldGet(x,this).updateToolbar(e),_classPrivateFieldGet(x,this).updateMode(e);const{offsetX:n,offsetY:r}=_assertClassBrand(b,this,S).call(this),a=this.getNextId(),i=_assertClassBrand(b,this,w).call(this,{parent:this,id:a,x:n,y:r,uiManager:_classPrivateFieldGet(x,this),isCentered:!0,...t});i&&this.add(i)}deserialize(e){var t;switch(null!==(t=e.annotationType)&&void 0!==t?t:e.annotationEditorType){case r.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(e,this,_classPrivateFieldGet(x,this));case r.AnnotationEditorType.INK:return s.InkEditor.deserialize(e,this,_classPrivateFieldGet(x,this));case r.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(e,this,_classPrivateFieldGet(x,this))}return null}addNewEditor(){_assertClassBrand(b,this,_).call(this,_assertClassBrand(b,this,S).call(this),!0)}setSelected(e){_classPrivateFieldGet(x,this).setSelected(e)}toggleSelected(e){_classPrivateFieldGet(x,this).toggleSelected(e)}isSelected(e){return _classPrivateFieldGet(x,this).isSelected(e)}unselect(e){_classPrivateFieldGet(x,this).unselect(e)}pointerup(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&_classPrivateFieldGet(m,this)&&(_classPrivateFieldSet(m,this,!1),_classPrivateFieldGet(d,this)?_classPrivateFieldGet(x,this).getMode()!==r.AnnotationEditorType.STAMP?_assertClassBrand(b,this,_).call(this,e,!1):_classPrivateFieldGet(x,this).unselectAll():_classPrivateFieldSet(d,this,!0))}pointerdown(e){if(_classPrivateFieldGet(m,this))return void _classPrivateFieldSet(m,this,!1);const{isMac:t}=r.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;_classPrivateFieldSet(m,this,!0);const n=_classPrivateFieldGet(x,this).getActive();_classPrivateFieldSet(d,this,!n||n.isEmpty())}findNewParent(e,t,n){const r=_classPrivateFieldGet(x,this).findParent(t,n);return null!==r&&r!==this&&(r.changeParent(e),!0)}destroy(){var e;(null===(e=_classPrivateFieldGet(x,this).getActive())||void 0===e?void 0:e.parent)===this&&(_classPrivateFieldGet(x,this).commitOrRemove(),_classPrivateFieldGet(x,this).setActiveEditor(null));for(const n of _classPrivateFieldGet(p,this).values()){var t;null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove()}this.div=null,_classPrivateFieldGet(p,this).clear(),_classPrivateFieldGet(x,this).removeLayer(this)}render(e){let{viewport:t}=e;this.viewport=t,(0,o.setLayerDimensions)(this.div,t);for(const n of _classPrivateFieldGet(x,this).getEditors(this.pageIndex))this.add(n);this.updateMode()}update(e){let{viewport:t}=e;_classPrivateFieldGet(x,this).commitOrRemove(),this.viewport=t,(0,o.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}function w(e){switch(_classPrivateFieldGet(x,this).getMode()){case r.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(e);case r.AnnotationEditorType.INK:return new s.InkEditor(e);case r.AnnotationEditorType.STAMP:return new l.StampEditor(e)}return null}function _(e,t){const n=this.getNextId(),r=_assertClassBrand(b,this,w).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:_classPrivateFieldGet(x,this),isCentered:t});return r&&this.add(r),r}function S(){const{x:e,y:t,width:n,height:r}=this.div.getBoundingClientRect(),a=Math.max(0,e),i=Math.max(0,t),s=(a+Math.min(window.innerWidth,e+n))/2-e,o=(i+Math.min(window.innerHeight,t+r))/2-t,[l,c]=this.viewport.rotation%180===0?[s,o]:[o,s];return{offsetX:l,offsetY:c}}function A(){_classPrivateFieldSet(g,this,!0);for(const e of _classPrivateFieldGet(p,this).values())e.isEmpty()&&e.remove();_classPrivateFieldSet(g,this,!1)}_defineProperty(y,"_initialized",!1),t.AnnotationEditorLayer=y},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var a=n(1),i=n(5),s=n(4),o=n(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakSet;class x extends s.AnnotationEditor{static get _keyboardManager(){const e=x.prototype,t=e=>e.isEmpty(),n=i.AnnotationEditorUIManager.TRANSLATE_SMALL,r=i.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,a.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}]]))}constructor(e){super({...e,name:"freeTextEditor"}),_classPrivateMethodInitSpec(this,v),_classPrivateFieldInitSpec(this,l,this.editorDivBlur.bind(this)),_classPrivateFieldInitSpec(this,c,this.editorDivFocus.bind(this)),_classPrivateFieldInitSpec(this,d,this.editorDivInput.bind(this)),_classPrivateFieldInitSpec(this,u,this.editorDivKeydown.bind(this)),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,f,""),_classPrivateFieldInitSpec(this,p,"".concat(this.id,"-editor")),_classPrivateFieldInitSpec(this,m,void 0),_classPrivateFieldInitSpec(this,g,null),_classPrivateFieldSet(h,this,e.color||x._defaultColor||s.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(m,this,e.fontSize||x._defaultFontSize)}static initialize(e){s.AnnotationEditor.initialize(e,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:x._defaultFontSize=t;break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:x._defaultColor=t}}updateParams(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:_assertClassBrand(v,this,b).call(this,t);break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:_assertClassBrand(v,this,y).call(this,t)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,x._defaultFontSize],[a.AnnotationEditorParamsType.FREETEXT_COLOR,x._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(m,this)],[a.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(h,this)]]}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-x._internalPadding*e,-(x._internalPadding+_classPrivateFieldGet(m,this))*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(a.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(d,this)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(p,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(d,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var e;this.width?_assertClassBrand(v,this,P).call(this):(this.enableEditMode(),this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=_classPrivateFieldGet(f,this),t=_classPrivateFieldSet(f,this,_assertClassBrand(v,this,w).call(this).trimEnd());if(e===t)return;const n=e=>{_classPrivateFieldSet(f,this,e),e?(_assertClassBrand(v,this,S).call(this),this._uiManager.rebuild(this),_assertClassBrand(v,this,_).call(this)):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),_assertClassBrand(v,this,_).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){x._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(p,this)),this.enableEditing(),s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("aria-label",e)})),s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)})),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize="calc(".concat(_classPrivateFieldGet(m,this),"px * var(--scale-factor))"),n.color=_classPrivateFieldGet(h,this),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.parentDimensions;if(this.annotationElementId){const{position:a}=_classPrivateFieldGet(g,this);let[i,s]=this.getInitialTranslation();[i,s]=this.pageTranslationToScreen(i,s);const[o,l]=this.pageDimensions,[c,d]=this.pageTranslation;let u,h;switch(this.rotation){case 0:u=e+(a[0]-c)/o,h=t+this.height-(a[1]-d)/l;break;case 90:u=e+(a[0]-c)/o,h=t-(a[1]-d)/l,[i,s]=[s,-i];break;case 180:u=e-this.width+(a[0]-c)/o,h=t-(a[1]-d)/l,[i,s]=[-i,-s];break;case 270:u=e+(a[0]-c-this.height*l)/o,h=t+(a[1]-d-this.width*o)/l,[i,s]=[-s,i]}this.setAt(u*n,h*r,i,s)}else this.setAt(e*n,t*r,this.width*n,this.height*r);_assertClassBrand(v,this,S).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){let r=null;if(e instanceof o.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:i,rotation:s,id:o},textContent:l,textPosition:c,parent:{page:{pageNumber:d}}}=e;if(!l||0===l.length)return null;r=e={annotationType:a.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),position:c,pageIndex:d-1,rect:i,rotation:s,id:o,deleted:!1}}const i=super.deserialize(e,t,n);return _classPrivateFieldSet(m,i,e.fontSize),_classPrivateFieldSet(h,i,a.Util.makeHexColor(...e.color)),_classPrivateFieldSet(f,i,e.value),i.annotationElementId=e.id||null,_classPrivateFieldSet(g,i,r),i}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=x._internalPadding*this.parentScale,n=this.getRect(t,t),r=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(h,this)),i={annotationType:a.AnnotationEditorType.FREETEXT,color:r,fontSize:_classPrivateFieldGet(m,this),value:_classPrivateFieldGet(f,this),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?i:this.annotationElementId&&!_assertClassBrand(v,this,A).call(this,i)?null:(i.id=this.annotationElementId,i)}}function b(e){const t=e=>{this.editorDiv.style.fontSize="calc(".concat(e,"px * var(--scale-factor))"),this.translate(0,-(e-_classPrivateFieldGet(m,this))*this.parentScale),_classPrivateFieldSet(m,this,e),_assertClassBrand(v,this,_).call(this)},n=_classPrivateFieldGet(m,this);this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function y(e){const t=_classPrivateFieldGet(h,this);this.addCommands({cmd:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=e)},undo:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=t)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function w(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}function _(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,r=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}function S(){if(this.editorDiv.replaceChildren(),_classPrivateFieldGet(f,this))for(const e of _classPrivateFieldGet(f,this).split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}function A(e){const{value:t,fontSize:n,color:r,rect:a,pageIndex:i}=_classPrivateFieldGet(g,this);return e.value!==t||e.fontSize!==n||e.rect.some(((e,t)=>Math.abs(e-a[t])>=1))||e.color.some(((e,t)=>e!==r[t]))||e.pageIndex!==i}function P(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(_assertClassBrand(v,this,_).call(this),!e&&(0===this.width||0===this.height))return void setTimeout((()=>_assertClassBrand(v,this,P).call(this,!0)),0);const t=r._internalPadding*this.parentScale;_classPrivateFieldGet(g,this).rect=this.getRect(t,t)}r=x,_defineProperty(x,"_freeTextDefaultContent",""),_defineProperty(x,"_internalPadding",0),_defineProperty(x,"_defaultColor",null),_defineProperty(x,"_defaultFontSize",10),_defineProperty(x,"_type","freetext"),t.FreeTextEditor=x},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0;var r=n(1),a=n(6),i=n(3),s=n(30),o=n(31),l=n(32);const c=1e3,d=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 g(e);case r.AnnotationType.TEXT:return new b(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new w(e);case"Btn":return e.data.radioButton?new A(e):e.data.checkBox?new S(e):new P(e);case"Ch":return new k(e);case"Sig":return new _(e)}return new y(e);case r.AnnotationType.POPUP:return new C(e);case r.AnnotationType.FREETEXT:return new Q(e);case r.AnnotationType.LINE:return new $(e);case r.AnnotationType.SQUARE:return new te(e);case r.AnnotationType.CIRCLE:return new re(e);case r.AnnotationType.POLYLINE:return new ie(e);case r.AnnotationType.CARET:return new oe(e);case r.AnnotationType.INK:return new ce(e);case r.AnnotationType.POLYGON:return new se(e);case r.AnnotationType.HIGHLIGHT:return new de(e);case r.AnnotationType.UNDERLINE:return new ue(e);case r.AnnotationType.SQUIGGLY:return new he(e);case r.AnnotationType.STRIKEOUT:return new fe(e);case r.AnnotationType.STAMP:return new pe(e);case r.AnnotationType.FILEATTACHMENT:return new ve(e);default:return new p(e)}}}var f=new WeakMap;class p{constructor(e){let{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classPrivateFieldInitSpec(this,f,!1),this.isRenderable=t,this.data=e.data,this.layer=e.layer,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.parent=e.parent,t&&(this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData(e){let{titleObj:t,contentsObj:n,richText:r}=e;return!!(null!==t&&void 0!==t&&t.str||null!==n&&void 0!==n&&n.str||null!==r&&void 0!==r&&r.str)}get hasPopupData(){return p._hasPopupData(this.data)}_createContainer(e){const{data:t,parent:{page:n,viewport:a}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),this instanceof y||(i.tabIndex=c),i.style.zIndex=this.parent.zIndex++,this.data.popupRef&&i.setAttribute("aria-haspopup","dialog"),t.noRotate&&i.classList.add("norotate");const{pageWidth:s,pageHeight:o,pageX:l,pageY:d}=a.rawDims;if(!t.rect||this instanceof C){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,i),i}const{width:h,height:p}=u(t.rect),m=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){i.style.borderWidth="".concat(t.borderStyle.width,"px");const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t="calc(".concat(e,"px * var(--scale-factor)) / calc(").concat(n,"px * var(--scale-factor))");i.style.borderRadius=t}else if(this instanceof A){const e="calc(".concat(h,"px * var(--scale-factor)) / calc(").concat(p,"px * var(--scale-factor))");i.style.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:i.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:i.style.borderBottomStyle="solid"}const a=t.borderColor||null;a?(_classPrivateFieldSet(f,this,!0),i.style.borderColor=r.Util.makeHexColor(0|a[0],0|a[1],0|a[2])):i.style.borderWidth=0}i.style.left="".concat(100*(m[0]-l)/s,"%"),i.style.top="".concat(100*(m[1]-d)/o,"%");const{rotation:g}=t;return t.hasOwnCanvas||0===g?(i.style.width="".concat(100*h/s,"%"),i.style.height="".concat(100*p/o,"%")):this.setRotation(g,i),i}setRotation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:a,height:i}=u(this.data.rect);let s,o;e%180===0?(s=100*a/n,o=100*i/r):(s=100*i/n,o=100*a/r),t.style.width="".concat(s,"%"),t.style.height="".concat(o,"%"),t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e],a=r[0],i=r.slice(1);n.target.style[t]=s.ColorConverters["".concat(a,"_HTML")](i),this.annotationStorage.setValue(this.data.id,{[t]:s.ColorConverters["".concat(a,"_rgb")](i)})};return(0,r.shadow)(this,"_commonActions",{display:e=>{const{display:t}=e.detail,n=t%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.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 a=e[r]||n[r];null===a||void 0===a||a(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,a]of Object.entries(t)){const i=n[r];i&&(i({detail:{[r]:a},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,r,a]=this.data.rect;if(1===e.length){const[,{x:i,y:s},{x:o,y:l}]=e[0];if(r===i&&a===s&&t===o&&n===l)return}const{style:i}=this.container;let s;if(_classPrivateFieldGet(f,this)){const{borderColor:e,borderWidth:t}=i;i.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'')"),i.backgroundImage=s.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const n=new C({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const a=this._fieldObjects[e];if(a)for(const{page:e,id:i,exportValues:s}of a){if(-1===e)continue;if(i===t)continue;const a="string"===typeof s?s:null,o=document.querySelector('[data-element-id="'.concat(i,'"]'));!o||d.has(o)?n.push({id:i,exportValue:a,domElement:o}):(0,r.warn)("_getElementsByName - element not allowed: ".concat(i))}return n}for(const r of document.getElementsByName(e)){const{exportValue:e}=r,a=r.getAttribute("data-element-id");a!==t&&d.has(r)&&n.push({id:a,exportValue:e,domElement:r})}return n}show(){var e;this.container&&(this.container.hidden=!1),null===(e=this.popup)||void 0===e||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),null===(e=this.popup)||void 0===e||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",(()=>{var n;null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})}))}}var m=new WeakSet;class g extends p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(e,{isRenderable:!0,ignoreBorder:!(null===t||void 0===t||!t.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(this,m),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.attachment?(this._bindAttachment(n,e.attachment),r=!0):e.setOCGState?(_assertClassBrand(m,this,x).call(this,n,e.setOCGState),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.container.classList.add("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)&&_assertClassBrand(m,this,v).call(this)}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),_assertClassBrand(m,this,v).call(this)}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>{var e;return null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,t.content,t.filename),!1},_assertClassBrand(m,this,v).call(this)}_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 a=n.get(r);a&&(e[a]=()=>{var e;return null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1})}e.onclick||(e.onclick=()=>!1),_assertClassBrand(m,this,v).call(this)}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),_assertClassBrand(m,this,v).call(this),!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=()=>{null===n||void 0===n||n();const{fields:e,refs:a,include:i}=t,s=[];if(0!==e.length||0!==a.length){const t=new Set(a);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)===i&&s.push(n)}else for(const t of Object.values(this._fieldObjects))s.push(...t);const o=this.annotationStorage,l=[];for(const t of s){const{id:e}=t;switch(l.push(e),t.type){case"text":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;o.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}default:continue}const n=document.querySelector('[data-element-id="'.concat(e,'"]'));n&&(d.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)("_bindResetFormAction - element not allowed: ".concat(e)))}var c;return this.enableScripting&&(null===(c=this.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}function v(){this.container.setAttribute("data-internal-link","")}function x(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),_assertClassBrand(m,this,v).call(this)}class b extends p{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("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.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class y extends p{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&("CANVAS"===(null===(t=e.previousSibling)||void 0===t?void 0:t.nodeName)&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){const{isWin:t,isMac:n}=r.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,r,a){n.includes("mouse")?e.addEventListener(n,(e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(n,(e=>{var i;if("blur"===n){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===n){if(t.focused)return;t.focused=!0}a&&(null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(e)}}))}))}_setEventListeners(e,t,n,r){for(const[o,l]of n){var a,i,s;("Action"===l||null!==(a=this.data.actions)&&void 0!==a&&a[l])&&("Focus"!==l&&"Blur"!==l||t||(t={focused:!1}),this._setEventListener(e,t,o,l,r),"Focus"!==l||null!==(i=this.data.actions)&&void 0!==i&&i.Blur?"Blur"!==l||null!==(s=this.data.actions)&&void 0!==s&&s.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}}_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 t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||9,i=e.style;let s;const o=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(r.LINE_FACTOR*a))||1);s=Math.min(a,o(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(a,o(e/r.LINE_FACTOR))}i.fontSize="calc(".concat(s,"px * var(--scale-factor))"),i.color=r.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class w extends y{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const a=this.annotationStorage;for(const i of this._getElementsByName(e.name,e.id))i.domElement&&(i.domElement[t]=n),a.setValue(i.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){var r;const o=e.getValue(t,{value:this.data.fieldValue});let l=o.value||"";const u=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;u&&l.length>u&&(l=l.slice(0,u));let h=o.formattedValue||(null===(r=this.data.textContent)||void 0===r?void 0:r.join("\n"))||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const f={userValue:l,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};var a,i;this.data.multiLine?(n=document.createElement("textarea"),n.textContent=null!==(a=h)&&void 0!==a?a:l,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",null!==(i=h)&&void 0!==i?i:l),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),d.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=c,this._setRequired(n,this.data.required),u&&(n.maxLength=u),n.addEventListener("input",(r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value"),f.formattedValue=null})),n.addEventListener("resetform",(e=>{var t;const r=null!==(t=this.data.defaultFieldValue)&&void 0!==t?t:"";n.value=f.userValue=r,f.formattedValue=null}));let p=e=>{const{formattedValue:t}=f;null!==t&&void 0!==t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;n.addEventListener("focus",(e=>{if(f.focused)return;const{target:t}=e;f.userValue&&(t.value=f.userValue),f.lastCommittedValue=t.value,f.commitKey=1,f.focused=!0})),n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const r={value(n){var r;f.userValue=null!==(r=n.detail.value)&&void 0!==r?r:"",e.setValue(t,{value:f.userValue.toString()}),n.target.value=f.userValue},formattedValue(n){const{formattedValue:r}=n.detail;f.formattedValue=r,null!==r&&void 0!==r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{var r;const{charLimit:a}=n.detail,{target:i}=n;if(0===a)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",a);let s=f.userValue;!s||s.length<=a||(s=s.slice(0,a),i.value=f.userValue=s,e.setValue(t,{value:s}),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(e=>{var n;f.commitKey=1;let r=-1;if("Escape"===e.key?r=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(f.commitKey=3):r=2,-1===r)return;const{value:a}=e.target;f.lastCommittedValue!==a&&(f.lastCommittedValue=a,f.userValue=a,null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:r,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const r=p;p=null,n.addEventListener("blur",(e=>{if(!f.focused||!e.relatedTarget)return;f.focused=!1;const{value:n}=e.target;var a;f.userValue=n,f.lastCommittedValue!==n&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:f.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),r(e)})),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&n.addEventListener("beforeinput",(e=>{var n;f.lastCommittedValue=null;const{data:r,target:a}=e,{value:i,selectionStart:s,selectionEnd:o}=a;let l=s,c=o;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,s).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=i.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===o&&(l-=1);break;case"deleteContentForward":s===o&&(c+=1)}e.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:r||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(n,f,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(p&&n.addEventListener("blur",p),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/u;n.classList.add("comb"),n.style.letterSpacing="calc(".concat(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 _ extends y{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class S extends y{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.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return d.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,r&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=c,a.addEventListener("change",(r=>{const{name:a,checked:i}=r.target;for(const s of this._getElementsByName(a,n)){const n=i&&s.exportValue===t.exportValue;s.domElement&&(s.domElement.checked=n),e.setValue(s.id,{value:n})}e.setValue(n,{value:i})})),a.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(a.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(a,null,[["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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class A extends y{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("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 a=document.createElement("input");if(d.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,r&&a.setAttribute("checked",!0),a.tabIndex=c,a.addEventListener("change",(t=>{const{name:r,checked:a}=t.target;for(const i of this._getElementsByName(r,n))e.setValue(i.id,{value:!1});e.setValue(n,{value:a})})),a.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!==n&&void 0!==n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;a.addEventListener("updatefromsandbox",(t=>{const a={value:t=>{const a=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=a&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(a,t)})),this._setEventListeners(a,null,[["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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class P extends g{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("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 k extends y{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");d.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=c;let a=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 n of r.options)n.selected=n.value===t}));for(const c of this.data.options){const e=document.createElement("option");e.textContent=c.displayValue,e.value=c.exportValue,n.value.includes(c.exportValue)&&(e.setAttribute("selected",!0),a=!1),r.append(e)}let i=null;if(a){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),i=()=>{e.remove(),r.removeEventListener("input",i),i=null},r.addEventListener("input",i)}const s=e=>{const t=e?"value":"textContent",{options:n,multiple:a}=r;return a?Array.prototype.filter.call(n,(e=>e.selected)).map((e=>e[t])):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let o=s(!1);const l=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 a={value(n){var a;null===(a=i)||void 0===a||a();const l=n.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const e of r.options)e.selected=c.has(e.value);e.setValue(t,{value:s(!0)}),o=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){const a=r.options,i=n.detail.remove;a[i].selected=!1,r.remove(i),a.length>0&&-1===Array.prototype.findIndex.call(a,(e=>e.selected))&&(a[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]}),o=s(!1)},insert(n){const{index:a,displayValue:i,exportValue:c}=n.detail.insert,d=r.children[a],u=document.createElement("option");u.textContent=i,u.value=c,d?d.before(u):r.append(u),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},items(n){const{items:a}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of a){const{displayValue:t,exportValue:n}=e,a=document.createElement("option");a.textContent=t,a.value=n,r.append(a)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},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(!0)}),o=s(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(a,n)})),r.addEventListener("input",(n=>{var r;const a=s(!0);e.setValue(t,{value:a}),n.preventDefault(),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,changeEx:a,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))):r.addEventListener("input",(function(n){e.setValue(t,{value:s(!0)})})),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class C extends p{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:p._hasPopupData(t)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const e=new V({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const n of this.elements)n.popup=e,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map((e=>"".concat(r.AnnotationPrefix).concat(e))).join(",")),this.container}}var j=new WeakMap,E=new WeakMap,N=new WeakMap,F=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,O=new WeakMap,L=new WeakMap,D=new WeakMap,G=new WeakMap,B=new WeakMap,z=new WeakMap,W=new WeakMap,U=new WeakMap,H=new WeakMap,q=new WeakSet;class V{constructor(e){let{container:t,color:n,elements:r,titleObj:i,modificationDate:s,contentsObj:o,richText:l,parent:c,rect:d,parentRect:u,open:h}=e;_classPrivateMethodInitSpec(this,q),_classPrivateFieldInitSpec(this,j,null),_classPrivateFieldInitSpec(this,E,_assertClassBrand(q,this,X).bind(this)),_classPrivateFieldInitSpec(this,N,_assertClassBrand(q,this,J).bind(this)),_classPrivateFieldInitSpec(this,F,_assertClassBrand(q,this,K).bind(this)),_classPrivateFieldInitSpec(this,T,_assertClassBrand(q,this,Y).bind(this)),_classPrivateFieldInitSpec(this,M,null),_classPrivateFieldInitSpec(this,R,null),_classPrivateFieldInitSpec(this,I,null),_classPrivateFieldInitSpec(this,O,null),_classPrivateFieldInitSpec(this,L,null),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,G,!1),_classPrivateFieldInitSpec(this,B,null),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,W,null),_classPrivateFieldInitSpec(this,U,null),_classPrivateFieldInitSpec(this,H,!1),_classPrivateFieldSet(R,this,t),_classPrivateFieldSet(U,this,i),_classPrivateFieldSet(I,this,o),_classPrivateFieldSet(W,this,l),_classPrivateFieldSet(L,this,c),_classPrivateFieldSet(M,this,n),_classPrivateFieldSet(z,this,d),_classPrivateFieldSet(D,this,u),_classPrivateFieldSet(O,this,r);const f=a.PDFDateString.toDateObject(s);f&&_classPrivateFieldSet(j,this,c.l10n.get("annotation_date_string",{date:f.toLocaleDateString(),time:f.toLocaleTimeString()})),this.trigger=r.flatMap((e=>e.getElementsToTriggerPopup()));for(const a of this.trigger)a.addEventListener("click",_classPrivateFieldGet(T,this)),a.addEventListener("mouseenter",_classPrivateFieldGet(F,this)),a.addEventListener("mouseleave",_classPrivateFieldGet(N,this)),a.classList.add("popupTriggerArea");for(const a of r){var p;null===(p=a.container)||void 0===p||p.addEventListener("keydown",_classPrivateFieldGet(E,this))}_classPrivateFieldGet(R,this).hidden=!0,h&&_assertClassBrand(q,this,Y).call(this)}render(){if(_classPrivateFieldGet(B,this))return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:i}}}=_classPrivateFieldGet(L,this),s=_classPrivateFieldSet(B,this,document.createElement("div"));if(s.className="popup",_classPrivateFieldGet(M,this)){const e=s.style.outlineColor=r.Util.makeHexColor(..._classPrivateFieldGet(M,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))s.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;s.style.backgroundColor=r.Util.makeHexColor(..._classPrivateFieldGet(M,this).map((t=>Math.floor(e*(255-t)+t))))}}const o=document.createElement("span");o.className="header";const c=document.createElement("h1");if(o.append(c),({dir:c.dir,str:c.textContent}=_classPrivateFieldGet(U,this)),s.append(o),_classPrivateFieldGet(j,this)){const e=document.createElement("span");e.classList.add("popupDate"),_classPrivateFieldGet(j,this).then((t=>{e.textContent=t})),o.append(e)}const d=_classPrivateFieldGet(I,this),u=_classPrivateFieldGet(W,this);if(null===u||void 0===u||!u.str||null!==d&&void 0!==d&&d.str&&d.str!==u.str){const e=this._formatContents(d);s.append(e)}else l.XfaLayer.render({xfaHtml:u.html,intent:"richText",div:s}),s.lastChild.classList.add("richText","popupContent");let h=!!_classPrivateFieldGet(D,this),f=_classPrivateFieldGet(h?D:z,this);for(const l of _classPrivateFieldGet(O,this))if(!f||null!==r.Util.intersect(l.data.rect,f)){f=l.data.rect,h=!0;break}const p=r.Util.normalizeRect([f[0],e[3]-f[1]+e[1],f[2],e[3]-f[3]+e[1]]),m=h?f[2]-f[0]+5:0,g=p[0]+m,v=p[1],{style:x}=_classPrivateFieldGet(R,this);x.left="".concat(100*(g-a)/t,"%"),x.top="".concat(100*(v-i)/n,"%"),_classPrivateFieldGet(R,this).append(s)}_formatContents(e){let{str:t,dir:n}=e;const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const a=t.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i{"Enter"===e.key&&(a?e.metaKey:e.ctrlKey)&&_assertClassBrand(ge,this,xe).call(this)})),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return _classPrivateFieldGet(me,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function xe(){var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,this.content,this.filename)}var be=new WeakMap,ye=new WeakMap,we=new WeakMap,_e=new WeakSet;function Se(e,t){var n;const a=e.firstChild||e;a.id="".concat(r.AnnotationPrefix).concat(t),this.div.append(e),null===(n=_classPrivateFieldGet(be,this))||void 0===n||n.moveElementInDOM(this.div,e,a,!1)}function Ae(){if(!_classPrivateFieldGet(ye,this))return;const e=this.div;for(const[t,n]of _classPrivateFieldGet(ye,this)){const r=e.querySelector('[data-annotation-id="'.concat(t,'"]'));if(!r)continue;const{firstChild:a}=r;a?"CANVAS"===a.nodeName?a.replaceWith(n):a.before(n):r.append(n)}_classPrivateFieldGet(ye,this).clear()}t.AnnotationLayer=class{constructor(e){let{div:t,accessibilityManager:n,annotationCanvasMap:r,l10n:a,page:i,viewport:s}=e;_classPrivateMethodInitSpec(this,_e),_classPrivateFieldInitSpec(this,be,null),_classPrivateFieldInitSpec(this,ye,null),_classPrivateFieldInitSpec(this,we,new Map),this.div=t,_classPrivateFieldSet(be,this,n),_classPrivateFieldSet(ye,this,r),this.l10n=a,this.page=i,this.viewport=s,this.zIndex=0,this.l10n||(this.l10n=o.NullL10n)}async render(e){const{annotations:t}=e,n=this.div;(0,a.setLayerDimensions)(n,this.viewport);const s=new Map,o={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new a.DOMSVGFactory,annotationStorage:e.annotationStorage||new i.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const a of t){if(a.noHTML)continue;const e=a.annotationType===r.AnnotationType.POPUP;if(e){const e=s.get(a.id);if(!e)continue;o.elements=e}else{const{width:e,height:t}=u(a.rect);if(e<=0||t<=0)continue}o.data=a;const t=h.create(o);if(!t.isRenderable)continue;if(!e&&a.popupRef){const e=s.get(a.popupRef);e?e.push(t):s.set(a.popupRef,[t])}t.annotationEditorType>0&&_classPrivateFieldGet(we,this).set(t.data.id,t);const n=t.render();a.hidden&&(n.style.visibility="hidden"),_assertClassBrand(_e,this,Se).call(this,n,a.id)}_assertClassBrand(_e,this,Ae).call(this),await this.l10n.translate(n)}update(e){let{viewport:t}=e;const n=this.div;this.viewport=t,(0,a.setLayerDimensions)(n,{rotation:t.rotation}),_assertClassBrand(_e,this,Ae).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(_classPrivateFieldGet(we,this).values())}getEditableAnnotation(e){return _classPrivateFieldGet(we,this).get(e)}}},(e,t)=>{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function r(e){return Math.max(0,Math.min(255,255*e))}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G(e){let[t,n,r,a]=e;return["G",1-Math.min(1,.3*t+.59*r+.11*n+a)]}static G_CMYK(e){let[t]=e;return["CMYK",0,0,0,1-t]}static G_RGB(e){let[t]=e;return["RGB",t,t,t]}static G_rgb(e){let[t]=e;return t=r(t),[t,t,t]}static G_HTML(e){let[t]=e;const r=n(t);return"#".concat(r).concat(r).concat(r)}static RGB_G(e){let[t,n,r]=e;return["G",.3*t+.59*n+.11*r]}static RGB_rgb(e){return e.map(r)}static RGB_HTML(e){return"#".concat(e.map(n).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(e){let[t,n,r,a]=e;return["RGB",1-Math.min(1,t+a),1-Math.min(1,r+a),1-Math.min(1,n+a)]}static CMYK_rgb(e){let[t,n,a,i]=e;return[r(1-Math.min(1,t+i)),r(1-Math.min(1,a+i)),r(1-Math.min(1,n+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(e){let[t,n,r]=e;const a=1-t,i=1-n,s=1-r;return["CMYK",a,i,s,Math.min(a,i,s)]}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=r;const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function r(e,t){switch(e){case"find_match_count":e="find_match_count[".concat(1===t.total?"one":"other","]");break;case"find_match_count_limit":e="find_match_count_limit[".concat(1===t.limit?"one":"other","]")}return n[e]||""}n.print_progress_percent="{{progress}}%";const a={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(e,t),t)},async translate(e){}};t.NullL10n=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(25);t.XfaLayer=class{static setupStorage(e,t,n,r,a){const i=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(e.textContent=i.value),"print"===a)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(i.value===n.attributes.xfaOn?e.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===a)break;e.addEventListener("change",(e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==i.value&&e.setAttribute("value",i.value),"print"===a)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==i.value){e.setAttribute("value",i.value);for(const e of n.children)e.attributes.value===i.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",(e=>{const n=e.target.options,a=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:a})}))}}static setAttributes(e){let{html:t,element:n,storage:r=null,intent:a,linkService:i}=e;const{attributes:s}=n,o=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name="".concat(s.name,"-").concat(a));for(const[l,c]of Object.entries(s))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&t.setAttribute(l,c)}o&&i.addLinkAttributes(t,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(t,s.dataId,n,r)}static render(e){const t=e.annotationStorage,n=e.linkService,a=e.xfaHtml,i=e.intent||"display",s=document.createElement(a.name);a.attributes&&this.setAttributes({html:s,element:a,intent:i,linkService:n});const o=[[a,-1,s]],l=e.div;if(l.append(s),e.viewport){const t="matrix(".concat(e.viewport.transform.join(","),")");l.style.transform=t}"richText"!==i&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[e,a,s]=o.at(-1);if(a+1===e.children.length){o.pop();continue}const l=e.children[++o.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}const h=null!==l&&void 0!==l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,u):document.createElement(u);if(s.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:i,linkService:n}),l.children&&l.children.length>0)o.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 r of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))r.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0;var a=n(1),i=n(4),s=n(29),o=n(6),l=n(5),c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,_=new WeakMap,S=new WeakSet;class A extends i.AnnotationEditor{constructor(e){super({...e,name:"inkEditor"}),_classPrivateMethodInitSpec(this,S),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,0),_classPrivateFieldInitSpec(this,u,this.canvasPointermove.bind(this)),_classPrivateFieldInitSpec(this,h,this.canvasPointerleave.bind(this)),_classPrivateFieldInitSpec(this,f,this.canvasPointerup.bind(this)),_classPrivateFieldInitSpec(this,p,this.canvasPointerdown.bind(this)),_classPrivateFieldInitSpec(this,m,new Path2D),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,x,!1),_classPrivateFieldInitSpec(this,b,null),_classPrivateFieldInitSpec(this,y,0),_classPrivateFieldInitSpec(this,w,0),_classPrivateFieldInitSpec(this,_,null),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e){i.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:A._defaultThickness=t;break;case a.AnnotationEditorParamsType.INK_COLOR:A._defaultColor=t;break;case a.AnnotationEditorParamsType.INK_OPACITY:A._defaultOpacity=t/100}}updateParams(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:_assertClassBrand(S,this,P).call(this,t);break;case a.AnnotationEditorParamsType.INK_COLOR:_assertClassBrand(S,this,k).call(this,t);break;case a.AnnotationEditorParamsType.INK_OPACITY:_assertClassBrand(S,this,C).call(this,t)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.INK_THICKNESS,A._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,A._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*A._defaultOpacity)]]}get propertiesToUpdate(){var e;return[[a.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||A._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,this.color||A._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(e=this.opacity)&&void 0!==e?e:A._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,B).call(this)),this.isAttachedToDOM||(this.parent.add(this),_assertClassBrand(S,this,z).call(this)),_assertClassBrand(S,this,J).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(b,this).disconnect(),_classPrivateFieldSet(b,this,null),super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,r=this.height*t;this.setDimensions(n,r)}enableEditMode(){_classPrivateFieldGet(g,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(p,this)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(p,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){_classPrivateFieldGet(g,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(g,this,!0),this.div.classList.add("disabled"),_assertClassBrand(S,this,J).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!_classPrivateFieldGet(g,this)&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),_assertClassBrand(S,this,N).call(this,e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),_assertClassBrand(S,this,F).call(this,e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),_assertClassBrand(S,this,D).call(this,e)}canvasPointerleave(e){_assertClassBrand(S,this,D).call(this,e)}get isResizable(){return!this.isEmpty()&&_classPrivateFieldGet(g,this)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),i.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((e=>{var t;return null===(t=this.div)||void 0===t?void 0:t.setAttribute("aria-label",e)}));const[n,r,a,s]=_assertClassBrand(S,this,j).call(this);if(this.setAt(n,r,0,0),this.setDims(a,s),_assertClassBrand(S,this,G).call(this),this.width){const[n,r]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*r),this.setAt(e*n,t*r,this.width*n,this.height*r),_classPrivateFieldSet(x,this,!0),_assertClassBrand(S,this,z).call(this),this.setDims(this.width*n,this.height*r),_assertClassBrand(S,this,L).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _assertClassBrand(S,this,B).call(this),this.div}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if(_classPrivateFieldGet(y,this)===n&&_classPrivateFieldGet(w,this)===r)return;_classPrivateFieldSet(y,this,n),_classPrivateFieldSet(w,this,r),this.canvas.style.visibility="hidden";const[a,i]=this.parentDimensions;this.width=e/a,this.height=t/i,this.fixAndSetPosition(),_classPrivateFieldGet(g,this)&&_assertClassBrand(S,this,W).call(this,e,t),_assertClassBrand(S,this,z).call(this),_assertClassBrand(S,this,L).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(e,t,n){if(e instanceof s.InkAnnotationElement)return null;const r=super.deserialize(e,t,n);r.thickness=e.thickness,r.color=a.Util.makeHexColor(...e.color),r.opacity=e.opacity;const[o,l]=r.pageDimensions,u=r.width*o,h=r.height*l,f=r.parentScale,p=e.thickness/2;_classPrivateFieldSet(g,r,!0),_classPrivateFieldSet(y,r,Math.round(u)),_classPrivateFieldSet(w,r,Math.round(h));const{paths:m,rect:v,rotation:x}=e;for(let{bezier:a}of m){a=V.call(A,a,v,x);const e=[];r.paths.push(e);let t=f*(a[0]-p),n=f*(a[1]-p);for(let r=2,s=a.length;r{this.thickness=e,_assertClassBrand(S,this,J).call(this)},undo:()=>{this.thickness=t,_assertClassBrand(S,this,J).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function k(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,_assertClassBrand(S,this,L).call(this)},undo:()=>{this.color=t,_assertClassBrand(S,this,L).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function C(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,_assertClassBrand(S,this,L).call(this)},undo:()=>{this.opacity=t,_assertClassBrand(S,this,L).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function j(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}function E(){const{ctx:e,color:t,opacity:n,thickness:r,parentScale:a,scaleFactor:i}=this;e.lineWidth=r*a/i,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle="".concat(t).concat((0,l.opacityToHex)(n))}function N(e,t){var n;this.canvas.addEventListener("contextmenu",o.noContextMenu),this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(h,this)),this.canvas.addEventListener("pointermove",_classPrivateFieldGet(u,this)),this.canvas.addEventListener("pointerup",_classPrivateFieldGet(f,this)),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(p,this)),this.isEditing=!0,_classPrivateFieldGet(x,this)||(_classPrivateFieldSet(x,this,!0),_assertClassBrand(S,this,z).call(this),this.thickness||(this.thickness=r._defaultThickness),this.color||(this.color=r._defaultColor||i.AnnotationEditor._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=r._defaultOpacity)),this.currentPath.push([e,t]),_classPrivateFieldSet(v,this,!1),_assertClassBrand(S,this,E).call(this),_classPrivateFieldSet(_,this,(()=>{_assertClassBrand(S,this,R).call(this),_classPrivateFieldGet(_,this)&&window.requestAnimationFrame(_classPrivateFieldGet(_,this))})),window.requestAnimationFrame(_classPrivateFieldGet(_,this))}function F(e,t){const[n,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===n&&t===r)return;const a=this.currentPath;let i=_classPrivateFieldGet(m,this);if(a.push([e,t]),_classPrivateFieldSet(v,this,!0),a.length<=2)return i.moveTo(...a[0]),void i.lineTo(e,t);3===a.length&&(_classPrivateFieldSet(m,this,i=new Path2D),i.moveTo(...a[0])),_assertClassBrand(S,this,I).call(this,i,...a.at(-3),...a.at(-2),e,t)}function T(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);_classPrivateFieldGet(m,this).lineTo(...e)}function M(e,t){let n;if(_classPrivateFieldSet(_,this,null),e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),_assertClassBrand(S,this,F).call(this,e,t),_assertClassBrand(S,this,T).call(this),1!==this.currentPath.length)n=_assertClassBrand(S,this,O).call(this);else{const r=[e,t];n=[[r,r.slice(),r.slice(),r]]}const r=_classPrivateFieldGet(m,this),a=this.currentPath;this.currentPath=[],_classPrivateFieldSet(m,this,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(a),this.paths.push(n),this.bezierPath2D.push(r),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,B).call(this)),_assertClassBrand(S,this,J).call(this))},mustExec:!0})}function R(){if(!_classPrivateFieldGet(v,this))return;_classPrivateFieldSet(v,this,!1);Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),t=e.map((e=>e[0])),n=e.map((e=>e[1])),{ctx:r}=(Math.min(...t),Math.max(...t),Math.min(...n),Math.max(...n),this);r.save(),r.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)r.stroke(a);r.stroke(_classPrivateFieldGet(m,this)),r.restore()}function I(e,t,n,r,a,i,s){const o=(t+r)/2,l=(n+a)/2,c=(r+i)/2,d=(a+s)/2;e.bezierCurveTo(o+2*(r-o)/3,l+2*(a-l)/3,c+2*(r-c)/3,d+2*(a-d)/3,c,d)}function O(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let n,[r,a]=e[0];for(n=1;n{this.canvas.removeEventListener("contextmenu",o.noContextMenu)}),10),_assertClassBrand(S,this,M).call(this,e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function G(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",i.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>{var t;return null===(t=this.canvas)||void 0===t?void 0:t.setAttribute("aria-label",e)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function B(){_classPrivateFieldSet(b,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}))),_classPrivateFieldGet(b,this).observe(this.div)}function z(){if(!_classPrivateFieldGet(x,this))return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),_assertClassBrand(S,this,U).call(this)}function W(e,t){const n=_assertClassBrand(S,this,K).call(this),r=(e-n)/_classPrivateFieldGet(d,this),a=(t-n)/_classPrivateFieldGet(c,this);this.scaleFactor=Math.min(r,a)}function U(){const e=_assertClassBrand(S,this,K).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}function H(e){const t=new Path2D;for(let n=0,r=e.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(g,this))return void _assertClassBrand(S,this,L).call(this);const t=_assertClassBrand(S,this,Y).call(this),n=_assertClassBrand(S,this,K).call(this);_classPrivateFieldSet(d,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[2]-t[0])),_classPrivateFieldSet(c,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[3]-t[1]));const r=Math.ceil(n+_classPrivateFieldGet(d,this)*this.scaleFactor),a=Math.ceil(n+_classPrivateFieldGet(c,this)*this.scaleFactor),[s,o]=this.parentDimensions;this.width=r/s,this.height=a/o,this.setAspectRatio(r,a);const l=this.translationX,u=this.translationY;this.translationX=-t[0],this.translationY=-t[1],_assertClassBrand(S,this,z).call(this),_assertClassBrand(S,this,L).call(this),_classPrivateFieldSet(y,this,r),_classPrivateFieldSet(w,this,a),this.setDims(r,a);const h=e?n/this.scaleFactor/2:0;this.translate(l-this.translationX-h,u-this.translationY-h)}r=A,_defineProperty(A,"_defaultColor",null),_defineProperty(A,"_defaultOpacity",1),_defineProperty(A,"_defaultThickness",1),_defineProperty(A,"_type","ink"),t.InkEditor=A},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StampEditor=void 0;var a=n(1),i=n(4),s=n(6),o=n(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakSet;class b extends i.AnnotationEditor{constructor(e){super({...e,name:"stampEditor"}),_classPrivateMethodInitSpec(this,x),_classPrivateFieldInitSpec(this,l,null),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,f,null),_classPrivateFieldInitSpec(this,p,null),_classPrivateFieldInitSpec(this,m,null),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldSet(u,this,e.bitmapUrl),_classPrivateFieldSet(h,this,e.bitmapFile)}static initialize(e){i.AnnotationEditor.initialize(e)}static get supportedTypes(){return(0,a.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((e=>"image/".concat(e))))}static get supportedTypesStr(){return(0,a.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(a.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}remove(){var e,t;_classPrivateFieldGet(c,this)&&(_classPrivateFieldSet(l,this,null),this._uiManager.imageManager.deleteId(_classPrivateFieldGet(c,this)),null===(e=_classPrivateFieldGet(f,this))||void 0===e||e.remove(),_classPrivateFieldSet(f,this,null),null===(t=_classPrivateFieldGet(p,this))||void 0===t||t.disconnect(),_classPrivateFieldSet(p,this,null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(_classPrivateFieldGet(c,this)&&_assertClassBrand(x,this,_).call(this),this.isAttachedToDOM||this.parent.add(this))):_classPrivateFieldGet(c,this)&&_assertClassBrand(x,this,_).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(_classPrivateFieldGet(d,this)||_classPrivateFieldGet(l,this)||_classPrivateFieldGet(u,this)||_classPrivateFieldGet(h,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,_classPrivateFieldGet(l,this)?_assertClassBrand(x,this,S).call(this):_assertClassBrand(x,this,_).call(this),this.width){const[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r)}return this.div}static deserialize(e,t,n){if(e instanceof o.StampAnnotationElement)return null;const r=super.deserialize(e,t,n),{rect:a,bitmapUrl:i,bitmapId:s,isSvg:l,accessibilityData:d}=e;s&&n.imageManager.isValidId(s)?_classPrivateFieldSet(c,r,s):_classPrivateFieldSet(u,r,i),_classPrivateFieldSet(g,r,l);const[h,f]=r.pageDimensions;return r.width=(a[2]-a[0])/h,r.height=(a[3]-a[1])/f,d&&(r.altTextData=d),r}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:a.AnnotationEditorType.STAMP,bitmapId:_classPrivateFieldGet(c,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_classPrivateFieldGet(g,this),structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=_assertClassBrand(x,this,C).call(this,!0),n.accessibilityData=this.altTextData,n;const{decorative:r,altText:i}=this.altTextData;if(!r&&i&&(n.accessibilityData={type:"Figure",alt:i}),null===t)return n;t.stamps||(t.stamps=new Map);const s=_classPrivateFieldGet(g,this)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has(_classPrivateFieldGet(c,this))){if(_classPrivateFieldGet(g,this)){const e=t.stamps.get(_classPrivateFieldGet(c,this));s>e.area&&(e.area=s,e.serialized.bitmap.close(),e.serialized.bitmap=_assertClassBrand(x,this,C).call(this,!1))}}else t.stamps.set(_classPrivateFieldGet(c,this),{area:s,serialized:n}),n.bitmap=_assertClassBrand(x,this,C).call(this,!1);return n}}function y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?(_classPrivateFieldSet(l,this,e.bitmap),t||(_classPrivateFieldSet(c,this,e.id),_classPrivateFieldSet(g,this,e.isSvg)),_assertClassBrand(x,this,S).call(this)):this.remove()}function w(){_classPrivateFieldSet(d,this,null),this._uiManager.enableWaiting(!1),_classPrivateFieldGet(f,this)&&this.div.focus()}function _(){if(_classPrivateFieldGet(c,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_classPrivateFieldGet(c,this)).then((e=>_assertClassBrand(x,this,y).call(this,e,!0))).finally((()=>_assertClassBrand(x,this,w).call(this)));if(_classPrivateFieldGet(u,this)){const e=_classPrivateFieldGet(u,this);return _classPrivateFieldSet(u,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromUrl(e).then((e=>_assertClassBrand(x,this,y).call(this,e))).finally((()=>_assertClassBrand(x,this,w).call(this))))}if(_classPrivateFieldGet(h,this)){const e=_classPrivateFieldGet(h,this);return _classPrivateFieldSet(h,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromFile(e).then((e=>_assertClassBrand(x,this,y).call(this,e))).finally((()=>_assertClassBrand(x,this,w).call(this))))}const e=document.createElement("input");e.type="file",e.accept=r.supportedTypesStr,_classPrivateFieldSet(d,this,new Promise((t=>{e.addEventListener("change",(async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);_assertClassBrand(x,this,y).call(this,t)}else this.remove();t()})),e.addEventListener("cancel",(()=>{this.remove(),t()}))})).finally((()=>_assertClassBrand(x,this,w).call(this)))),e.click()}function S(){const{div:e}=this;let{width:t,height:n}=_classPrivateFieldGet(l,this);const[r,a]=this.pageDimensions,i=.75;if(this.width)t=this.width*r,n=this.height*a;else if(t>i*r||n>i*a){const e=Math.min(i*r/t,i*a/n);t*=e,n*=e}const[s,o]=this.parentDimensions;this.setDims(t*s/r,n*o/a),this._uiManager.enableWaiting(!1);const c=_classPrivateFieldSet(f,this,document.createElement("canvas"));e.append(c),e.hidden=!1,_assertClassBrand(x,this,k).call(this,t,n),_assertClassBrand(x,this,j).call(this),_classPrivateFieldGet(v,this)||(this.parent.addUndoableEditor(this),_classPrivateFieldSet(v,this,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}function A(e,t){var n;const[r,a]=this.parentDimensions;this.width=e/r,this.height=t/a,this.setDims(e,t),null!==(n=this._initialOptions)&&void 0!==n&&n.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_classPrivateFieldGet(m,this)&&clearTimeout(_classPrivateFieldGet(m,this)),_classPrivateFieldSet(m,this,setTimeout((()=>{_classPrivateFieldSet(m,this,null),_assertClassBrand(x,this,k).call(this,e,t)}),200))}function P(e,t){const{width:n,height:r}=_classPrivateFieldGet(l,this);let a=n,i=r,s=_classPrivateFieldGet(l,this);for(;a>2*e||i>2*t;){const n=a,r=i;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2));const o=new OffscreenCanvas(a,i);o.getContext("2d").drawImage(s,0,0,n,r,0,0,a,i),s=o.transferToImageBitmap()}return s}function k(e,t){e=Math.ceil(e),t=Math.ceil(t);const n=_classPrivateFieldGet(f,this);if(!n||n.width===e&&n.height===t)return;n.width=e,n.height=t;const r=_classPrivateFieldGet(g,this)?_classPrivateFieldGet(l,this):_assertClassBrand(x,this,P).call(this,e,t),a=n.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(r,0,0,r.width,r.height,0,0,e,t)}function C(e){if(e){if(_classPrivateFieldGet(g,this)){const e=this._uiManager.imageManager.getSvgUrl(_classPrivateFieldGet(c,this));if(e)return e}const e=document.createElement("canvas");return({width:e.width,height:e.height}=_classPrivateFieldGet(l,this)),e.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0),e.toDataURL()}if(_classPrivateFieldGet(g,this)){const[e,t]=this.pageDimensions,n=Math.round(this.width*e*s.PixelsPerInch.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*s.PixelsPerInch.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(n,r);return a.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0,_classPrivateFieldGet(l,this).width,_classPrivateFieldGet(l,this).height,0,0,n,r),a.transferToImageBitmap()}return structuredClone(_classPrivateFieldGet(l,this))}function j(){_classPrivateFieldSet(p,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&_assertClassBrand(x,this,A).call(this,t.width,t.height)}))),_classPrivateFieldGet(p,this).observe(this.div)}r=b,_defineProperty(b,"_type","stamp"),t.StampEditor=b}],__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,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),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 s.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return o.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,"DOMSVGFactory",{enumerable:!0,get:function(){return r.DOMSVGFactory}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),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,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return n.SVGGraphics}}),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 c.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),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,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),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,"noContextMenu",{enumerable:!0,get:function(){return r.noContextMenu}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return a.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),r=__w_pdfjs_require__(6),a=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),s=__w_pdfjs_require__(5),o=__w_pdfjs_require__(29),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})(),module.exports=root.pdfjsLib=factory()},1497:(e,t,n)=>{"use strict";var r=n(3218);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,s){if(s!==r){var o=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 o.name="Invariant Violation",o}}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:i,resetWarningCache:a};return n.PropTypes=n,n}},5173:(e,t,n)=>{e.exports=n(1497)()},3218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2730:(e,t,n)=>{"use strict";var r=n(5043),a=n(8853);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!u.call(p,e)||!u.call(f,e)&&(h.test(e)?p[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,x);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,x);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,x);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),C=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),T=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var M=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var R=Symbol.iterator;function I(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=R&&e[R]||e["@@iterator"])?e:null}var O,L=Object.assign;function D(e){if(void 0===O)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);O=t&&t[1]||""}return"\n"+O+e}var G=!1;function B(e,t){if(!e||G)return"";G=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var a=c.stack.split("\n"),i=r.stack.split("\n"),s=a.length-1,o=i.length-1;1<=s&&0<=o&&a[s]!==i[o];)o--;for(;1<=s&&0<=o;s--,o--)if(a[s]!==i[o]){if(1!==s||1!==o)do{if(s--,0>--o||a[s]!==i[o]){var l="\n"+a[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=s&&0<=o);break}}}finally{G=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function z(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function W(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case _:return"Portal";case P:return"Profiler";case A:return"StrictMode";case E:return"Suspense";case N:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case k:return(e._context.displayName||"Context")+".Provider";case j:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case F:return null!==(t=e.displayName||null)?t:W(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return W(e(t))}catch(n){}}return null}function U(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W(t);case 8:return t===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Y(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function J(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Q(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Z(e,t){Q(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Y(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return de(e,t)}))}:de);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(fe).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ve=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xe(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(i(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ye=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Se=null,Ae=null;function Pe(e){if(e=ba(e)){if("function"!==typeof _e)throw Error(i(280));var t=e.stateNode;t&&(t=wa(t),_e(e.stateNode,e.type,t))}}function ke(e){Se?Ae?Ae.push(e):Ae=[e]:Se=e}function Ce(){if(Se){var e=Se,t=Ae;if(Ae=Se=null,Pe(e),t)for(e=0;e>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ct=64,dt=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,s=268435455&n;if(0!==s){var o=s&~a;0!==o?r=ut(o):0!==(i&=s)&&(r=ut(i))}else 0!==(s=n&~a)?r=ut(s):0!==i&&(r=ut(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(i=t&-t)||16===a&&0!==(4194240&i)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function xt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),a=1<=In),Dn=String.fromCharCode(32),Gn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var Un={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Un[e.type]:"textarea"===t}function qn(e,t,n,r){ke(r),0<(t=Vr(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,Xn=null;function Yn(e){Dr(e,0)}function Kn(e){if(X(ya(e)))return e}function Jn(e,t){if("change"===e)return t}var Qn=!1;if(d){var Zn;if(d){var $n="oninput"in document;if(!$n){var er=document.createElement("div");er.setAttribute("oninput","return;"),$n="function"===typeof er.oninput}Zn=$n}else Zn=!1;Qn=Zn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function ur(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ur(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=Y();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Y((e=t.contentWindow).document)}return t}function fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pr(e){var t=hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ur(n.ownerDocument.documentElement,n)){if(null!==r&&fr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=void 0===r.end?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=dr(n,i);var s=dr(n,r);a&&s&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n=document.documentMode,gr=null,vr=null,xr=null,br=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==gr||gr!==Y(r)||("selectionStart"in(r=gr)&&fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},xr&&lr(xr,r)||(xr=r,0<(r=Vr(vr,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},Ar={};function Pr(e){if(Sr[e])return Sr[e];if(!_r[e])return e;var t,n=_r[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ar)return Sr[e]=n[t];return e}d&&(Ar=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);var kr=Pr("animationend"),Cr=Pr("animationiteration"),jr=Pr("animationstart"),Er=Pr("transitionend"),Nr=new Map,Fr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Nr.set(e,t),l(t,[e])}for(var Mr=0;MrSa||(e.current=_a[Sa],_a[Sa]=null,Sa--)}function ka(e,t){Sa++,_a[Sa]=e.current,e.current=t}var Ca={},ja=Aa(Ca),Ea=Aa(!1),Na=Ca;function Fa(e,t){var n=e.type.contextTypes;if(!n)return Ca;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,i={};for(a in n)i[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ta(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ma(){Pa(Ea),Pa(ja)}function Ra(e,t,n){if(ja.current!==Ca)throw Error(i(168));ka(ja,t),ka(Ea,n)}function Ia(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,U(e)||"Unknown",a));return L({},n,r)}function Oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ca,Na=ja.current,ka(ja,e),ka(Ea,Ea.current),!0}function La(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=Ia(e,t,Na),r.__reactInternalMemoizedMergedChildContext=e,Pa(Ea),Pa(ja),ka(ja,e)):Pa(Ea),ka(Ea,n)}var Da=null,Ga=!1,Ba=!1;function za(e){null===Da?Da=[e]:Da.push(e)}function Wa(){if(!Ba&&null!==Da){Ba=!0;var e=0,t=bt;try{var n=Da;for(bt=1;e>=s,a-=s,Ja=1<<32-st(t)+a|n<m?(g=u,u=null):g=u.sibling;var v=f(a,u,o[m],l);if(null===v){null===u&&(u=g);break}e&&u&&null===v.alternate&&t(a,u),i=s(v,i,m),null===d?c=v:d.sibling=v,d=v,u=g}if(m===o.length)return n(a,u),ai&&Za(a,m),c;if(null===u){for(;mg?(v=m,m=null):v=m.sibling;var b=f(a,m,x.value,c);if(null===b){null===m&&(m=v);break}e&&m&&null===b.alternate&&t(a,m),o=s(b,o,g),null===u?d=b:u.sibling=b,u=b,m=v}if(x.done)return n(a,m),ai&&Za(a,g),d;if(null===m){for(;!x.done;g++,x=l.next())null!==(x=h(a,x.value,c))&&(o=s(x,o,g),null===u?d=x:u.sibling=x,u=x);return ai&&Za(a,g),d}for(m=r(a,m);!x.done;g++,x=l.next())null!==(x=p(m,a,g,x.value,c))&&(e&&null!==x.alternate&&m.delete(null===x.key?g:x.key),o=s(x,o,g),null===u?d=x:u.sibling=x,u=x);return e&&m.forEach((function(e){return t(a,e)})),ai&&Za(a,g),d}return function e(r,i,s,l){if("object"===typeof s&&null!==s&&s.type===S&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case w:e:{for(var c=s.key,d=i;null!==d;){if(d.key===c){if((c=s.type)===S){if(7===d.tag){n(r,d.sibling),(i=a(d,s.props.children)).return=r,r=i;break e}}else if(d.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===T&&Yi(c)===d.type){n(r,d.sibling),(i=a(d,s.props)).ref=Vi(r,d,s),i.return=r,r=i;break e}n(r,d);break}t(r,d),d=d.sibling}s.type===S?((i=Oc(s.props.children,r.mode,l,s.key)).return=r,r=i):((l=Ic(s.type,s.key,s.props,null,r.mode,l)).ref=Vi(r,i,s),l.return=r,r=l)}return o(r);case _:e:{for(d=s.key;null!==i;){if(i.key===d){if(4===i.tag&&i.stateNode.containerInfo===s.containerInfo&&i.stateNode.implementation===s.implementation){n(r,i.sibling),(i=a(i,s.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=Gc(s,r.mode,l)).return=r,r=i}return o(r);case T:return e(r,i,(d=s._init)(s._payload),l)}if(te(s))return m(r,i,s,l);if(I(s))return g(r,i,s,l);Xi(r,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==i&&6===i.tag?(n(r,i.sibling),(i=a(i,s)).return=r,r=i):(n(r,i),(i=Dc(s,r.mode,l)).return=r,r=i),o(r)):n(r,i)}}var Ji=Ki(!0),Qi=Ki(!1),Zi={},$i=Aa(Zi),es=Aa(Zi),ts=Aa(Zi);function ns(e){if(e===Zi)throw Error(i(174));return e}function rs(e,t){switch(ka(ts,t),ka(es,e),ka($i,Zi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Pa($i),ka($i,t)}function as(){Pa($i),Pa(es),Pa(ts)}function is(e){ns(ts.current);var t=ns($i.current),n=le(t,e.type);t!==n&&(ka(es,e),ka($i,n))}function ss(e){es.current===e&&(Pa($i),Pa(es))}var os=Aa(0);function ls(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cs=[];function ds(){for(var e=0;en?n:4,e(!0);var r=hs.transition;hs.transition={};try{e(!1),t()}finally{bt=n,hs.transition=r}}function $s(){return ks().memoizedState}function eo(e,t,n){var r=nc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},no(e))ro(t,n);else if(null!==(n=ji(e,t,n,r))){rc(n,e,r,tc()),ao(n,t,r)}}function to(e,t,n){var r=nc(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(no(e))ro(t,a);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var s=t.lastRenderedState,o=i(s,n);if(a.hasEagerState=!0,a.eagerState=o,or(o,s)){var l=t.interleaved;return null===l?(a.next=a,Ci(t)):(a.next=l.next,l.next=a),void(t.interleaved=a)}}catch(c){}null!==(n=ji(e,t,a,r))&&(rc(n,e,r,a=tc()),ao(n,t,r))}}function no(e){var t=e.alternate;return e===ps||null!==t&&t===ps}function ro(e,t){xs=vs=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ao(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xt(e,n)}}var io={readContext:Pi,useCallback:ws,useContext:ws,useEffect:ws,useImperativeHandle:ws,useInsertionEffect:ws,useLayoutEffect:ws,useMemo:ws,useReducer:ws,useRef:ws,useState:ws,useDebugValue:ws,useDeferredValue:ws,useTransition:ws,useMutableSource:ws,useSyncExternalStore:ws,useId:ws,unstable_isNewReconciler:!1},so={readContext:Pi,useCallback:function(e,t){return Ps().memoizedState=[e,void 0===t?null:t],e},useContext:Pi,useEffect:Ws,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Bs(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bs(4,2,e,t)},useMemo:function(e,t){var n=Ps();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ps();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=eo.bind(null,ps,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ps().memoizedState=e},useState:Ls,useDebugValue:Ys,useDeferredValue:function(e){return Ps().memoizedState=e},useTransition:function(){var e=Ls(!1),t=e[0];return e=Zs.bind(null,e[1]),Ps().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ps,a=Ps();if(ai){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===Nl)throw Error(i(349));0!==(30&fs)||Ts(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,Ws(Rs.bind(null,r,s,e),[e]),r.flags|=2048,Ds(9,Ms.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ps(),t=Nl.identifierPrefix;if(ai){var n=Qa;t=":"+t+"R"+(n=(Ja&~(1<<32-st(Ja)-1)).toString(32)+n),0<(n=bs++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ys++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oo={readContext:Pi,useCallback:Ks,useContext:Pi,useEffect:Us,useImperativeHandle:Xs,useInsertionEffect:Hs,useLayoutEffect:qs,useMemo:Js,useReducer:js,useRef:Gs,useState:function(){return js(Cs)},useDebugValue:Ys,useDeferredValue:function(e){return Qs(ks(),ms.memoizedState,e)},useTransition:function(){return[js(Cs)[0],ks().memoizedState]},useMutableSource:Ns,useSyncExternalStore:Fs,useId:$s,unstable_isNewReconciler:!1},lo={readContext:Pi,useCallback:Ks,useContext:Pi,useEffect:Us,useImperativeHandle:Xs,useInsertionEffect:Hs,useLayoutEffect:qs,useMemo:Js,useReducer:Es,useRef:Gs,useState:function(){return Es(Cs)},useDebugValue:Ys,useDeferredValue:function(e){var t=ks();return null===ms?t.memoizedState=e:Qs(t,ms.memoizedState,e)},useTransition:function(){return[Es(Cs)[0],ks().memoizedState]},useMutableSource:Ns,useSyncExternalStore:Fs,useId:$s,unstable_isNewReconciler:!1};function co(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var a=n}catch(i){a="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:a,digest:null}}function uo(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ho(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var fo="function"===typeof WeakMap?WeakMap:Map;function po(e,t,n){(n=Mi(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ql||(ql=!0,Vl=r),ho(0,t)},n}function mo(e,t,n){(n=Mi(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){ho(0,t)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){ho(0,t),"function"!==typeof r&&(null===Xl?Xl=new Set([this]):Xl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function go(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fo;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=kc.bind(null,e,t,n),t.then(e,e))}function vo(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function xo(e,t,n,r,a){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Mi(-1,1)).tag=2,Ri(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var bo=y.ReactCurrentOwner,yo=!1;function wo(e,t,n,r){t.child=null===e?Qi(t,null,n,r):Ji(t,e.child,n,r)}function _o(e,t,n,r,a){n=n.render;var i=t.ref;return Ai(t,a),r=Ss(e,t,n,r,i,a),n=As(),null===e||yo?(ai&&n&&ei(t),t.flags|=1,wo(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,qo(e,t,a))}function So(e,t,n,r,a){if(null===e){var i=n.type;return"function"!==typeof i||Mc(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ic(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ao(e,t,i,r,a))}if(i=e.child,0===(e.lanes&a)){var s=i.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(s,r)&&e.ref===t.ref)return qo(e,t,a)}return t.flags|=1,(e=Rc(i,r)).ref=t.ref,e.return=t,t.child=e}function Ao(e,t,n,r,a){if(null!==e){var i=e.memoizedProps;if(lr(i,r)&&e.ref===t.ref){if(yo=!1,t.pendingProps=r=i,0===(e.lanes&a))return t.lanes=e.lanes,qo(e,t,a);0!==(131072&e.flags)&&(yo=!0)}}return Co(e,t,n,r,a)}function Po(e,t,n){var r=t.pendingProps,a=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ka(Rl,Ml),Ml|=n;else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ka(Rl,Ml),Ml|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ka(Rl,Ml),Ml|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ka(Rl,Ml),Ml|=r;return wo(e,t,a,n),t.child}function ko(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Co(e,t,n,r,a){var i=Ta(n)?Na:ja.current;return i=Fa(t,i),Ai(t,a),n=Ss(e,t,n,r,i,a),r=As(),null===e||yo?(ai&&r&&ei(t),t.flags|=1,wo(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,qo(e,t,a))}function jo(e,t,n,r,a){if(Ta(n)){var i=!0;Oa(t)}else i=!1;if(Ai(t,a),null===t.stateNode)Ho(e,t),Ui(t,n,r),qi(t,n,r,a),r=!0;else if(null===e){var s=t.stateNode,o=t.memoizedProps;s.props=o;var l=s.context,c=n.contextType;"object"===typeof c&&null!==c?c=Pi(c):c=Fa(t,c=Ta(n)?Na:ja.current);var d=n.getDerivedStateFromProps,u="function"===typeof d||"function"===typeof s.getSnapshotBeforeUpdate;u||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==r||l!==c)&&Hi(t,s,r,c),Ni=!1;var h=t.memoizedState;s.state=h,Li(t,r,s,a),l=t.memoizedState,o!==r||h!==l||Ea.current||Ni?("function"===typeof d&&(Bi(t,n,d,r),l=t.memoizedState),(o=Ni||Wi(t,n,o,r,h,l,c))?(u||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=o):("function"===typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Ti(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:gi(t.type,o),s.props=c,u=t.pendingProps,h=s.context,"object"===typeof(l=n.contextType)&&null!==l?l=Pi(l):l=Fa(t,l=Ta(n)?Na:ja.current);var f=n.getDerivedStateFromProps;(d="function"===typeof f||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==u||h!==l)&&Hi(t,s,r,l),Ni=!1,h=t.memoizedState,s.state=h,Li(t,r,s,a);var p=t.memoizedState;o!==u||h!==p||Ea.current||Ni?("function"===typeof f&&(Bi(t,n,f,r),p=t.memoizedState),(c=Ni||Wi(t,n,c,r,h,p,l)||!1)?(d||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(r,p,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=c):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Eo(e,t,n,r,i,a)}function Eo(e,t,n,r,a,i){ko(e,t);var s=0!==(128&t.flags);if(!r&&!s)return a&&La(t,n,!1),qo(e,t,i);r=t.stateNode,bo.current=t;var o=s&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=Ji(t,e.child,null,i),t.child=Ji(t,null,o,i)):wo(e,t,o,i),t.memoizedState=r.state,a&&La(t,n,!0),t.child}function No(e){var t=e.stateNode;t.pendingContext?Ra(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ra(0,t.context,!1),rs(e,t.containerInfo)}function Fo(e,t,n,r,a){return fi(),pi(a),t.flags|=256,wo(e,t,n,r),t.child}var To,Mo,Ro,Io,Oo={dehydrated:null,treeContext:null,retryLane:0};function Lo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Do(e,t,n){var r,a=t.pendingProps,s=os.current,o=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&s)),r?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),ka(os,1&s),null===e)return ci(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=a.children,e=a.fallback,o?(a=t.mode,o=t.child,l={mode:"hidden",children:l},0===(1&a)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=Lc(l,a,0,null),e=Oc(e,a,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Lo(n),t.memoizedState=Oo,e):Go(t,l));if(null!==(s=e.memoizedState)&&null!==(r=s.dehydrated))return function(e,t,n,r,a,s,o){if(n)return 256&t.flags?(t.flags&=-257,Bo(e,t,o,r=uo(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=r.fallback,a=t.mode,r=Lc({mode:"visible",children:r.children},a,0,null),(s=Oc(s,a,o,null)).flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,0!==(1&t.mode)&&Ji(t,e.child,null,o),t.child.memoizedState=Lo(o),t.memoizedState=Oo,s);if(0===(1&t.mode))return Bo(e,t,o,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var l=r.dgst;return r=l,Bo(e,t,o,r=uo(s=Error(i(419)),r,void 0))}if(l=0!==(o&e.childLanes),yo||l){if(null!==(r=Nl)){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=0!==(a&(r.suspendedLanes|o))?0:a)&&a!==s.retryLane&&(s.retryLane=a,Ei(e,a),rc(r,e,a,-1))}return gc(),Bo(e,t,o,r=uo(Error(i(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=jc.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,ri=ca(a.nextSibling),ni=t,ai=!0,ii=null,null!==e&&(Xa[Ya++]=Ja,Xa[Ya++]=Qa,Xa[Ya++]=Ka,Ja=e.id,Qa=e.overflow,Ka=t),t=Go(t,r.children),t.flags|=4096,t)}(e,t,l,a,r,s,n);if(o){o=a.fallback,l=t.mode,r=(s=e.child).sibling;var c={mode:"hidden",children:a.children};return 0===(1&l)&&t.child!==s?((a=t.child).childLanes=0,a.pendingProps=c,t.deletions=null):(a=Rc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==r?o=Rc(r,o):(o=Oc(o,l,n,null)).flags|=2,o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,l=null===(l=e.child.memoizedState)?Lo(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=Oo,a}return e=(o=e.child).sibling,a=Rc(o,{mode:"visible",children:a.children}),0===(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Go(e,t){return(t=Lc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bo(e,t,n,r){return null!==r&&pi(r),Ji(t,e.child,null,n),(e=Go(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function zo(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Si(e.return,t,n)}function Wo(e,t,n,r,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function Uo(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(wo(e,t,r.children,n),0!==(2&(r=os.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&zo(e,n,t);else if(19===e.tag)zo(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ka(os,r),0===(1&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===ls(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Wo(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===ls(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Wo(t,!0,n,null,i);break;case"together":Wo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ho(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qo(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ll|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Rc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Rc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Vo(e,t){if(!ai)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xo(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Yo(e,t,n){var r=t.pendingProps;switch(ti(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xo(t),null;case 1:case 17:return Ta(t.type)&&Ma(),Xo(t),null;case 3:return r=t.stateNode,as(),Pa(Ea),Pa(ja),ds(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ui(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ii&&(oc(ii),ii=null))),Mo(e,t),Xo(t),null;case 5:ss(t);var a=ns(ts.current);if(n=t.type,null!==e&&null!=t.stateNode)Ro(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return Xo(t),null}if(e=ns($i.current),ui(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ha]=t,r[fa]=s,e=0!==(1&t.mode),n){case"dialog":Gr("cancel",r),Gr("close",r);break;case"iframe":case"object":case"embed":Gr("load",r);break;case"video":case"audio":for(a=0;a<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ha]=t,e[fa]=r,To(e,t,!1,!1),t.stateNode=e;e:{switch(l=be(n,r),n){case"dialog":Gr("cancel",e),Gr("close",e),a=r;break;case"iframe":case"object":case"embed":Gr("load",e),a=r;break;case"video":case"audio":for(a=0;aUl&&(t.flags|=128,r=!0,Vo(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ls(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Vo(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ai)return Xo(t),null}else 2*Qe()-s.renderingStartTime>Ul&&1073741824!==n&&(t.flags|=128,r=!0,Vo(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=s.last)?n.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Qe(),t.sibling=null,n=os.current,ka(os,r?1&n|2:1&n),t):(Xo(t),null);case 22:case 23:return hc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Ml)&&(Xo(t),6&t.subtreeFlags&&(t.flags|=8192)):Xo(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function Ko(e,t){switch(ti(t),t.tag){case 1:return Ta(t.type)&&Ma(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return as(),Pa(Ea),Pa(ja),ds(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ss(t),null;case 13:if(Pa(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));fi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Pa(os),null;case 4:return as(),null;case 10:return _i(t.type._context),null;case 22:case 23:return hc(),null;default:return null}}To=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Mo=function(){},Ro=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ns($i.current);var i,s=null;switch(n){case"input":a=K(e,a),r=K(e,r),s=[];break;case"select":a=L({},a,{value:void 0}),r=L({},r,{value:void 0}),s=[];break;case"textarea":a=re(e,a),r=re(e,r),s=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(e.onclick=$r)}for(d in xe(n,r),n=null,a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&null!=a[d])if("style"===d){var l=a[d];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(o.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(l=null!=a?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(null!=c||null!=l))if("style"===d)if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(s||(s=[]),s.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(d,c)):"children"===d?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(o.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&Gr("scroll",e),s||l===c||(s=[])):(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Io=function(e,t,n,r){n!==r&&(t.flags|=4)};var Jo=!1,Qo=!1,Zo="function"===typeof WeakSet?WeakSet:Set,$o=null;function el(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){Pc(e,t,r)}else n.current=null}function tl(e,t,n){try{n()}catch(r){Pc(e,t,r)}}var nl=!1;function rl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,void 0!==i&&tl(t,n,i)}a=a.next}while(a!==r)}}function al(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function il(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function sl(e){var t=e.alternate;null!==t&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[ha],delete t[fa],delete t[ma],delete t[ga],delete t[va])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ol(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=$r));else if(4!==r&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}function dl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(dl(e,t,n),e=e.sibling;null!==e;)dl(e,t,n),e=e.sibling}var ul=null,hl=!1;function fl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(at,n)}catch(o){}switch(n.tag){case 5:Qo||el(n,t);case 6:var r=ul,a=hl;ul=null,fl(e,t,n),hl=a,null!==(ul=r)&&(hl?(e=ul,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ul.removeChild(n.stateNode));break;case 18:null!==ul&&(hl?(e=ul,n=n.stateNode,8===e.nodeType?la(e.parentNode,n):1===e.nodeType&&la(e,n),Wt(e)):la(ul,n.stateNode));break;case 4:r=ul,a=hl,ul=n.stateNode.containerInfo,hl=!0,fl(e,t,n),ul=r,hl=a;break;case 0:case 11:case 14:case 15:if(!Qo&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){a=r=r.next;do{var i=a,s=i.destroy;i=i.tag,void 0!==s&&(0!==(2&i)||0!==(4&i))&&tl(n,t,s),a=a.next}while(a!==r)}fl(e,t,n);break;case 1:if(!Qo&&(el(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Pc(n,t,o)}fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:1&n.mode?(Qo=(r=Qo)||null!==n.memoizedState,fl(e,t,n),Qo=r):fl(e,t,n);break;default:fl(e,t,n)}}function ml(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zo),t.forEach((function(t){var r=Ec.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function gl(e,t){var n=t.deletions;if(null!==n)for(var r=0;ra&&(a=o),r&=~s}if(r=a,10<(r=(120>(r=Qe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Pl(r/1960))-r)){e.timeoutHandle=ra(_c.bind(null,e,zl,Hl),r);break}_c(e,zl,Hl);break;default:throw Error(i(329))}}}return ac(e,Qe()),e.callbackNode===n?ic.bind(null,e):null}function sc(e,t){var n=Bl;return e.current.memoizedState.isDehydrated&&(fc(e,t).flags|=256),2!==(e=vc(e,t))&&(t=zl,zl=n,null!==t&&oc(t)),e}function oc(e){null===zl?zl=e:zl.push.apply(zl,e)}function lc(e,t){for(t&=~Gl,t&=~Dl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Kl)var r=!1;else{if(e=Kl,Kl=null,Jl=0,0!==(6&El))throw Error(i(331));var a=El;for(El|=4,$o=e.current;null!==$o;){var s=$o,o=s.child;if(0!==(16&$o.flags)){var l=s.deletions;if(null!==l){for(var c=0;cQe()-Wl?fc(e,0):Gl|=n),ac(e,t)}function Cc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=dt,0===(130023424&(dt<<=1))&&(dt=4194304)));var n=tc();null!==(e=Ei(e,t))&&(vt(e,t,n),ac(e,n))}function jc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cc(e,n)}function Ec(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),Cc(e,n)}function Nc(e,t){return Xe(e,t)}function Fc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tc(e,t,n,r){return new Fc(e,t,n,r)}function Mc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rc(e,t){var n=e.alternate;return null===n?((n=Tc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ic(e,t,n,r,a,s){var o=2;if(r=e,"function"===typeof e)Mc(e)&&(o=1);else if("string"===typeof e)o=5;else e:switch(e){case S:return Oc(n.children,a,s,t);case A:o=8,a|=8;break;case P:return(e=Tc(12,n,t,2|a)).elementType=P,e.lanes=s,e;case E:return(e=Tc(13,n,t,a)).elementType=E,e.lanes=s,e;case N:return(e=Tc(19,n,t,a)).elementType=N,e.lanes=s,e;case M:return Lc(n,a,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case k:o=10;break e;case C:o=9;break e;case j:o=11;break e;case F:o=14;break e;case T:o=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Tc(o,n,t,a)).elementType=e,t.type=r,t.lanes=s,t}function Oc(e,t,n,r){return(e=Tc(7,e,r,t)).lanes=n,e}function Lc(e,t,n,r){return(e=Tc(22,e,r,t)).elementType=M,e.lanes=n,e.stateNode={isHidden:!1},e}function Dc(e,t,n){return(e=Tc(6,e,null,t)).lanes=n,e}function Gc(e,t,n){return(t=Tc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bc(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function zc(e,t,n,r,a,i,s,o,l){return e=new Bc(e,t,n,o,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Tc(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fi(i),e}function Wc(e){if(!e)return Ca;e:{if(We(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ta(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(Ta(n))return Ia(e,n,t)}return t}function Uc(e,t,n,r,a,i,s,o,l){return(e=zc(n,r,!0,e,0,i,0,o,l)).context=Wc(null),n=e.current,(i=Mi(r=tc(),a=nc(n))).callback=void 0!==t&&null!==t?t:null,Ri(n,i,a),e.current.lanes=a,vt(e,a,r),ac(e,r),e}function Hc(e,t,n,r){var a=t.current,i=tc(),s=nc(a);return n=Wc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Mi(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ri(a,t,s))&&(rc(e,a,s,i),Ii(e,a,s)),s}function qc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n{"use strict";var r=n(7950);t.H=r.createRoot,r.hydrateRoot},7950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2730)},6366:e=>{var t="undefined"!==typeof Element,n="function"===typeof Map,r="function"===typeof Set,a="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var o,l,c,d;if(Array.isArray(e)){if((o=e.length)!=s.length)return!1;for(l=o;0!==l--;)if(!i(e[l],s[l]))return!1;return!0}if(n&&e instanceof Map&&s instanceof Map){if(e.size!==s.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!s.has(l.value[0]))return!1;for(d=e.entries();!(l=d.next()).done;)if(!i(l.value[1],s.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&s instanceof Set){if(e.size!==s.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!s.has(l.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(s)){if((o=e.length)!=s.length)return!1;for(l=o;0!==l--;)if(e[l]!==s[l])return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof s.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof s.toString)return e.toString()===s.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(s,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!i(e[c[l]],s[c[l]]))return!1;return!0}return e!==e&&s!==s}e.exports=function(e,t){try{return i(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},5082:(e,t)=>{"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,o=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,x=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,y=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 d:case u:case i:case o:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case m:case l:return e;default:return t}}case a:return t}}}function _(e){return w(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=a,t.Profiler=o,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===d},t.isConcurrentMode=_,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)===h},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===a},t.isProfiler=function(e){return w(e)===o},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===i||e===u||e===o||e===s||e===f||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},2086:(e,t,n)=>{"use strict";e.exports=n(5082)},1153:(e,t,n)=>{"use strict";var r=n(5043),a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:a,type:e,key:c,ref:d,props:i,_owner:o.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},4202:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function x(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=v.prototype;var y=b.prototype=new x;y.constructor=b,m(y,v.prototype),y.isPureReactComponent=!0;var w=Array.isArray,_=Object.prototype.hasOwnProperty,S={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,r){var a,i={},s=null,o=null;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(s=""+t.key),t)_.call(t,a)&&!A.hasOwnProperty(a)&&(i[a]=t[a]);var l=arguments.length-2;if(1===l)i.children=r;else if(1{"use strict";e.exports=n(4202)},579:(e,t,n)=>{"use strict";e.exports=n(1153)},7234:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[r];if(!(0>>1;ri(l,n))ci(d,l)?(e[r]=d,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(ci(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,h=null,f=3,p=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,x="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function y(e){for(var t=r(d);null!==t;){if(null===t.callback)a(d);else{if(!(t.startTime<=e))break;a(d),t.sortIndex=t.expirationTime,n(c,t)}t=r(d)}}function w(e){if(g=!1,y(e),!m)if(null!==r(c))m=!0,M(_);else{var t=r(d);null!==t&&R(w,t.startTime-e)}}function _(e,n){m=!1,g&&(g=!1,x(k),k=-1),p=!0;var i=f;try{for(y(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!E());){var s=h.callback;if("function"===typeof s){h.callback=null,f=h.priorityLevel;var o=s(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof o?h.callback=o:h===r(c)&&a(c),y(n)}else a(c);h=r(c)}if(null!==h)var l=!0;else{var u=r(d);null!==u&&R(w,u.startTime-n),l=!1}return l}finally{h=null,f=i,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,A=!1,P=null,k=-1,C=5,j=-1;function E(){return!(t.unstable_now()-je||125s?(e.sortIndex=i,n(d,e),null===r(c)&&e===r(d)&&(g?(x(k),k=-1):g=!0,R(w,i-s))):(e.sortIndex=o,n(c,e),m||p||(m=!0,M(_))),e},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},8853:(e,t,n)=>{"use strict";e.exports=n(7234)},7324:e=>{e.exports=function(e,t,n,r){var a=n?n.call(r,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";e.exports=n.p+"static/media/LogyAI Terms & Conditions.641bc859e38400167f19.pdf"},5205:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/nigeria1.2f8fc189d1b99c7bb2cd.pdf"},6322:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/vidisha1.271ee3dcc9e9ee324350.pdf"},7640:()=>{},3237:()=>{},7492:()=>{},1815:()=>{},9052:()=>{},2787:()=>{},1756:e=>{e.exports=function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")},e.exports.__esModule=!0,e.exports.default=e.exports},7101:e=>{e.exports=function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")},e.exports.__esModule=!0,e.exports.default=e.exports},6668:(e,t,n)=>{var r=n(1756);e.exports=function(e,t){return e.get(r(e,t))},e.exports.__esModule=!0,e.exports.default=e.exports},2459:(e,t,n)=>{var r=n(7101);e.exports=function(e,t,n){r(e,t),t.set(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports},7088:(e,t,n)=>{var r=n(1756);e.exports=function(e,t,n){return e.set(r(e,t),n),n},e.exports.__esModule=!0,e.exports.default=e.exports},183:(e,t,n)=>{var r=n(1756);e.exports=function(e,t,n){return n(r(e,t))},e.exports.__esModule=!0,e.exports.default=e.exports},3312:(e,t,n)=>{var r=n(7101);e.exports=function(e,t){r(e,t),t.add(e)},e.exports.__esModule=!0,e.exports.default=e.exports},3693:(e,t,n)=>{var r=n(7736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},4634:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},4893:e=>{e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},9045:(e,t,n)=>{var r=n(3738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7736:(e,t,n)=>{var r=n(3738).default,a=n(9045);e.exports=function(e){var t=a(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},8168:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},8587:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}n.d(t,{A:()=>r})},8387:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;ta});const a=function(){for(var e,t,n=0,a="",i=arguments.length;n