vendor: 6,194 bytes, line 1
1(self.webpackChunkhost=self.webpackChunkhost||[]).push([[1108,6382],{71710:function(t,e,i){var n=i(48287).Buffer,s=i(77836);t.exports=function t(e,i,n){function s(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){return s(e[a][1][t]||t)},c,c.exports,t,e,i,n)}return i[a].exports}for(var r=void 0,a=0;a<n.length;a++)s(n[a]);return s}({1:[function(t,e,i){"use strict";var n=t("./utils"),s=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,s,a,o,l,c,h=[],d=0,u=t.length,p=u,f="string"!==n.getTypeOf(t);d<t.length;)p=u-d,s=f?(e=t[d++],i=d<u?t[d++]:0,d<u?t[d++]:0):(e=t.charCodeAt(d++),i=d<u?t.charCodeAt(d++):0,d<u?t.charCodeAt(d++):0),a=e>>2,o=(3&e)<<4|i>>4,l=1<p?(15&i)<<2|s>>6:64,c=2<p?63&s:64,h.push(r.charAt(a)+r.charAt(o)+r.charAt(l)+r.charAt(c));return h.join("")},i.decode=function(t){var e,i,n,a,o,l,c=0,h=0,d="data:";if(t.substr(0,5)===d)throw new Error("Invalid base64 input, it looks like a data url.");var u,p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&p--,t.charAt(t.length-2)===r.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=s.uint8array?new Uint8Array(0|p):new Array(0|p);c<t.length;)e=r.indexOf(t.charAt(c++))<<2|(a=r.indexOf(t.charAt(c++)))>>4,i=(15&a)<<4|(o=r.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(l=r.indexOf(t.charAt(c++))),u[h++]=e,64!==o&&(u[h++]=i),64!==l&&(u[h++]=n);return u}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var n=t("./external"),s=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,i,n,s){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=n,this.compressedContent=s}o.prototype={getContentWorker:function(){var t=new s(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new s(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new a("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var n=t("./utils"),s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,i){var n=s,r=0+i;t^=-1;for(var a=0;a<r;a++)t=t>>>8^n[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i){var n=s,r=0+i;t^=-1;for(var a=0;a<r;a++)t=t>>>8^n[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=t("pako"),r=t("./utils"),a=t("./stream/GenericWorker"),o=n?"uint8array":"array";function l(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,a),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(o,t.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function n(t,e){var i,n="";for(i=0;i<e;i++)n+=String.fromCharCode(255&t),t>>>=8;return n}function s(t,e,i,s,a,h){var d,u,p=t.file,f=t.compression,m=h!==o.utf8encode,g=r.transformTo("string",h(p.name)),b=r.transformTo("string",o.utf8encode(p.name)),v=p.comment,y=r.transformTo("string",h(v)),w=r.transformTo("string",o.utf8encode(v)),x=b.length!==p.name.length,_=w.length!==v.length,A="",C="",S="",k=p.dir,E=p.date,T={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(T.crc32=t.crc32,T.compressedSize=t.compressedSize,T.uncompressedSize=t.uncompressedSize);var P=0;e&&(P|=8),m||!x&&!_||(P|=2048);var M=0,R=0;k&&(M|=16),"UNIX"===a?(R=798,M|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,k)):(R=20,M|=function(t){return 63&(t||0)}(p.dosPermissions)),d=E.getUTCHours(),d<<=6,d|=E.getUTCMinutes(),d<<=5,d|=E.getUTCSeconds()/2,u=E.getUTCFullYear()-1980,u<<=4,u|=E.getUTCMonth()+1,u<<=5,u|=E.getUTCDate(),x&&(C=n(1,1)+n(l(g),4)+b,A+="up"+n(C.length,2)+C),_&&(S=n(1,1)+n(l(y),4)+w,A+="uc"+n(S.length,2)+S);var I="";return I+="\n\0",I+=n(P,2),I+=f.magic,I+=n(d,2),I+=n(u,2),I+=n(T.crc32,4),I+=n(T.compressedSize,4),I+=n(T.uncompressedSize,4),I+=n(g.length,2),I+=n(A.length,2),{fileRecord:c.LOCAL_FILE_HEADER+I+g
vendor: 22,354 bytes, line 1
1+A,dirRecord:c.CENTRAL_FILE_HEADER+n(R,2)+I+n(y.length,2)+"\0\0\0\0"+n(M,4)+n(s,4)+g+A+y}}var r=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,i,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(h,a),h.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-n-1))/i:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=s(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=s(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,s=function(t,e,i,s,a){var o=r.transformTo("string",a(s));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(t,2)+n(t,2)+n(e,4)+n(i,4)+n(o.length,2)+o}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:s,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},h.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},h.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var n=t("../compressions"),s=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new s(e.streamFiles,i,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,i){a++;var s=function(t,e){var i=t||e,s=n[i];if(!s)throw new Error(i+" is not a valid compression method !");return s}(i.options.compression,e.compression),o=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,c=i.date;i._compressWorker(s,o).withStreamInfo("file",{name:t,dir:l,date:c,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)}),r.entriesCount=a}catch(t){r.error(t)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(t,e){return(new n).loadAsync(t,e)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var n=t("./utils"),s=t("./external"),r=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function c(t){return new s.Promise(function(e,i){var n=t.decompressed.getContentWorker().pipe(new o);n.on("error",function(t){i(t)}).on("end",function(){n.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}e.exports=function(t,e){var i=this;return e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),l.isNode&&l.isStream(t)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var i=new a(e);return i.load(t),i}).then(function(t){var i=[s.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var r=0;r<n.length;r++)i.push(c(n[r]));return s.Promise.all(i)}).then(function(t){for(var s=t.shift(),r=s.files,a=0;a<r.length;a++){var o=r[a],l=o.fileNameStr,c=n.resolve(o.fileNameStr);i.file(c,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(i.file(c).unsafeOriginalName=l)}return s.zipComment.length&&(i.comment=s.zipComment),i})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var n=t("../utils"),s=t("../stream/GenericWorker");function r(t,e){s.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(r,s),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},r.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var n=t("readable-stream").Readable;function s(t,e,i){n.call(this,e),this._helper=t;var s=this;t.on("data",function(t,e){s.push(t)||s._helper.pause(),i&&i(e)}).on("error",function(t){s.emit("error",t)}).on("end",function(){s.push(null)})}t("../utils").inherits(s,n),s.prototype._read=function(){this._helper.resume()},e.exports=s},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:void 0!==n,newBufferFrom:function(t,e){if(n.from&&n.from!==Uint8Array.from)return n.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new n(t,e)},allocBuffer:function(t){if(n.alloc)return n.alloc(t);var e=new n(t);return e.fill(0),e},isBuffer:function(t){return n.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function n(t,e,i){var n,s=r.getTypeOf(e),o=r.extend(i||{},l);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=m(t)),o.createFolders&&(n=f(t))&&g.call(this,n,!0);var d="string"===s&&!1===o.binary&&!1===o.base64;i&&void 0!==i.binary||(o.binary=!d),(e instanceof c&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",s="string");var b;b=e instanceof c||e instanceof a?e:u.isNode&&u.isStream(e)?new p(t,e):r.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var v=new h(t,b,o);this.files[t]=v}var s=t("./utf8"),r=t("./utils"),a=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),l=t("./defaults"),c=t("./compressedObject"),h=t("./zipObject"),d=t("./generate"),u=t("./nodejsUtils"),p=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:l.createFolders,t=m(t),this.files[t]||n.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function b(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,n;for(e in this.files)n=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,n)},filter:function(t){var e=[];return this.forEach(function(i,n){t(i,n)&&e.push(n)}),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,n.call(this,t,e,i),this;if(b(t)){var s=t;return this.filter(function(t,e){return!e.dir&&s.test(t)})}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(b(t))return this.filter(function(e,i){return i.dir&&t.test(e)});var e=this.root+t,i=g.call(this,e),n=this.clone();return n.root=i.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter(function(e,i){return i.name.slice(0,t.length)===t}),n=0;n<i.length;n++)delete this.files[i[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var n=i.comment||this.comment||"";e=d.generateWorker(this,i,n)}catch(t){(e=new a("error")).error(t)}return new o(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=v},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var n=t("./DataReader");function s(t){n.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(s,n),s.prototype.byteAt=function(t){return this.data[this.zero+t]},s.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),n=t.charCodeAt(2),s=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===n&&this.data[r+3]===s)return r-this.zero;return-1},s.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),n=t.charCodeAt(2),s=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&n===r[2]&&s===r[3]},s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var n=t("../utils");function s(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=s},{"../utils":32}],19:[function(t,e,i){"use strict";var n=t("./Uint8ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var n=t("./DataReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},s.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},s.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var n=t("./ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var n=t("../utils"),s=t("../support"),r=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||s.uint8array?"nodebuffer"===e?new o(t):s.uint8array?new l(n.transformTo("uint8array",t)):new r(n.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK��",i.CENTRAL_FILE_HEADER="PK��",i.CENTRAL_DIRECTORY_END="PK��",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK��",i.ZIP64_CENTRAL_DIRECTORY_END="PK��",i.DATA_DESCRIPTOR="PK�\b"},{}],24:[function(t,e,i){"use strict";var n=t("./GenericWorker"),s=t("../utils");function r(t){n.call(this,"ConvertWorker to "+t),this.destType=t}s.inherits(r,n),r.prototype.processChunk=function(t){this.push({data:s.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var n=t("./GenericWorker"),s=t("../crc32");function r(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,n),r.prototype.processChunk=function(t){this.streamInfo.crc32=s(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(r,s),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}s.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.end()}),t.on("error",function(t){e.error(t)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=n},{}],29:[function(t,e,i){"use strict";var s=t("../utils"),r=t("./ConvertWorker"),a=t("./GenericWorker"),o=t("../base64"),l=t("../support"),c=t("../external"),h=null;if(l.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function d(t,e,i){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=i,s.checkSupport(n),this._worker=t.pipe(new r(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}d.prototype={accumulate:function(t){return function(t,e){return new c.Promise(function(i,r){var a=[],l=t._internalType,c=t._outputType,h=t._mimeType;t.on("data",function(t,i){a.push(t),e&&e(i)}).on("error",function(t){a=[],r(t)}).on("end",function(){try{var t=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return o.encode(e);default:return s.transformTo(t,e)}}(c,function(t,e){var i,s=0,r=null,a=0;for(i=0;i<e.length;i++)a+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(r=new Uint8Array(a),i=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r;case"nodebuffer":return n.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(l,a),h);i(t)}catch(t){r(t)}a=[]}).resume()})}(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,function(t){e.call(i,t.data,t.meta)}):this._worker.on(t,function(){s.delay(e,arguments,i)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer=void 0!==n,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=0===new Blob([s],{type:"application/zip"}).size}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(s),i.blob=0===r.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}
vendor: 5,985 bytes, line 1
1],31:[function(t,e,i){"use strict";for(var n=t("./utils"),s=t("./support"),r=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=new Array(256),l=0;l<256;l++)o[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function h(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,i.utf8encode=function(t){return s.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,n,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=s.uint8array?new Uint8Array(l):new Array(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e}(t)},i.utf8decode=function(t){return s.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,s,r,a=t.length,l=new Array(2*a);for(e=i=0;e<a;)if((s=t[e++])<128)l[i++]=s;else if(4<(r=o[s]))l[i++]=65533,e+=r-1;else{for(s&=2===r?31:3===r?15:7;1<r&&e<a;)s=s<<6|63&t[e++],r--;1<r?l[i++]=65533:s<65536?l[i++]=s:(s-=65536,l[i++]=55296|s>>10&1023,l[i++]=56320|1023&s)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(t=n.transformTo(s.uint8array?"uint8array":"array",t))},n.inherits(c,a),c.prototype.processChunk=function(t){var e=n.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}(e),l=e;a!==e.length&&(s.uint8array?(l=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(l=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=c,n.inherits(h,a),h.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var n=t("./support"),s=t("./base64"),r=t("./nodejsUtils"),a=t("./external");function o(t){return t}function l(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(t,e,i){var n=[],s=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;s<r;)"array"===e||"nodebuffer"===e?n.push(String.fromCharCode.apply(null,t.slice(s,Math.min(s+i,r)))):n.push(String.fromCharCode.apply(null,t.subarray(s,Math.min(s+i,r)))),s+=i;return n.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function h(t){var e=65536,n=i.getTypeOf(t),s=!0;if("uint8array"===n?s=c.applyCanBeUsed.uint8array:"nodebuffer"===n&&(s=c.applyCanBeUsed.nodebuffer),s)for(;1<e;)try{return c.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return c.stringifyByChar(t)}function d(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=h;var u={};u.string={string:o,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return u.string.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:function(t){return l(t,r.allocBuffer(t.length))}},u.array={string:h,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},u.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return d(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},u.uint8array={string:h,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return r.newBufferFrom(t)}},u.nodebuffer={string:h,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return u.nodebuffer.uint8array(t).buffer},uint8array:function(t){return d(t,new Uint8Array(t.length))},nodebuffer:o},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var n=i.getTypeOf(e);return u[n][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],n=0;n<e.length;n++){var s=e[n];"."===s||""===s&&0!==n&&n!==e.length-1||(".."===s?i.pop():i.push(s))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&r.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,n="";for(i=0;i<(t||"").length;i++)n+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return n}
vendor: 4,113 bytes, line 1
1,i.delay=function(t,e,i){setImmediate(function(){t.apply(i||null,e||[])})},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,o,c){return a.Promise.resolve(e).then(function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new a.Promise(function(e,i){var n=new FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){i(t.target.error)},n.readAsArrayBuffer(t)}):t}).then(function(e){var h=i.getTypeOf(e);return h?("arraybuffer"===h?e=i.transformTo("uint8array",e):"string"===h&&(c?e=s.decode(e):r&&!0!==o&&(e=function(t){return l(t,n.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):a.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){"use strict";var n=t("./reader/readerFor"),s=t("./utils"),r=t("./signature"),a=t("./zipEntry"),o=t("./support");function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(e)+", expected "+s.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===e;return this.reader.setIndex(i),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",i=s.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
1ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var n=e-i;if(0<n)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var n=t("./reader/readerFor"),s=t("./utils"),r=t("./compressedObject"),a=t("./crc32"),o=t("./utf8"),l=t("./compressions"),c=t("./support");function h(t,e){this.options=t,this.loadOptions=e}h.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(Object.prototype.hasOwnProperty.call(l,e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&
vendor: 2,334 bytes, line 1
1(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,n,s=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<s;)e=t.readInt(2),i=t.readInt(2),n=t.readData(i),this.extraFields[e]={id:e,length:i,value:n};t.setIndex(s)},handleUTF8:function(){var t=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=s.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var r=s.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)||a(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)||a(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function n(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var s=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),l=t("./stream/GenericWorker");n.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var n="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(e=e.pipe(new a.Utf8EncodeWorker)),!r&&n&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new l("error")).error(t)}return new s(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)}
vendor: 4,703 bytes, line 1
1,nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof l?this._data:new r(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<c.length;d++)n.prototype[c[d]]=h;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,n){(function(t){"use strict";var i,n,s=t.MutationObserver||t.WebKitMutationObserver;if(s){var r=0,a=new s(h),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){h(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(h,0)};else{var l=new t.MessageChannel;l.port1.onmessage=h,i=function(){l.port2.postMessage(0)}}var c=[];function h(){var t,e;n=!0;for(var i=c.length;i;){for(e=c,c=[],t=-1;++t<i;)e[t]();i=c.length}n=!1}e.exports=function(t){1!==c.push(t)||n||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var n=t("immediate");function s(){}var r={},a=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==s&&p(this,t)}function h(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function d(t,e,i){n(function(){var n;try{n=e(i)}catch(n){return r.reject(t,n)}n===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,n)})}function u(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function n(e){i||(i=!0,r.reject(t,e))}function s(e){i||(i=!0,r.resolve(t,e))}var a=f(function(){e(s,n)});"error"===a.status&&n(a.value)}function f(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=c).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(i){return e.resolve(t()).then(function(){return i})},function(i){return e.resolve(t()).then(function(){throw i})})},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(s);return this.state!==l?d(i,this.state===o?t:e,this.outcome):this.queue.push(new h(i,t,e)),i},h.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){d(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){r.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){d(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=f(u,e);if("error"===i.status)return r.reject(t,i.value);var n=i.value;if(n)p(t,n);else{t.state=o,t.outcome=e;for(var s=-1,a=t.queue.length;++s<a;)t.queue[s].callFulfilled(e)}return t},r.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,n=t.queue.length;++i<n;)t.queue[i].callRejected(e);return t},c.resolve=function(t){return t instanceof this?t:r.resolve(new this(s),t)},c.reject=function(t){var e=new this(s);return r.reject(e,t)},c.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,n=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,l=-1,c=new this(s);++l<i;)h(t[l],l);return c;function h(t,s){e.resolve(t).then(function(t){a[s]=t,++o!==i||n||(n=!0,r.resolve(c,a))},function(t){n||(n=!0,r.reject(c,t))})}},c.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,i=!1;if(!e)return this.resolve([]);for(var n,a=-1,o=new this(s);++a<e;
vendor: 8,351 bytes, line 1
1)n=t[a],this.resolve(n).then(function(t){i||(i=!0,r.resolve(o,t))},function(t){i||(i=!0,r.reject(o,t))});return o}},{immediate:36}],38:[function(t,e,i){"use strict";var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var n=t("./zlib/deflate"),s=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=s.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(a[i]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var h;if(h="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=n.deflateSetDictionary(this.strm,h)))throw new Error(a[i]);this._dict_set=!0}}function h(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}c.prototype.push=function(t,e){var i,a,o=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=r.string2buf(t):"[object ArrayBuffer]"===l.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new s.Buf8(c),o.next_out=0,o.avail_out=c),1!==(i=n.deflate(o,a))&&0!==i)return this.onEnd(i),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(r.buf2binstring(s.shrinkBuf(o.output,o.next_out))):this.onData(s.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==i);return 4===a?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==a||(this.onEnd(0),!(o.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=c,i.deflate=h,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,h(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var n=t("./zlib/inflate"),s=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),h=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(o[i]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function u(t,e){var i=new d(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}d.prototype.push=function(t,e){var i,o,l,c,d,u,p=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=r.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new s.Buf8(f),p.next_out=0,p.avail_out=f),(i=n.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(u="string"==typeof m?r.string2buf(m):"[object ArrayBuffer]"===h.call(m)?new Uint8Array(m):m,i=n.inflateSetDictionary(this.strm,u)),i===a.Z_BUF_ERROR&&!0===g&&(i=a.Z_OK,g=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(p.output,p.next_out),c=p.next_out-l,d=r.buf2string(p.output,l),p.next_out=c,p.avail_out=f-c,c&&s.arraySet(p.output,p.output,l,c,0),this.onData(d)):this.onData(s.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)}while((0<p.avail_in||0===p.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=d,i.inflate=u,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},i.ungzip=u},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var s={arraySet:function(t,e,i,n,s){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+n),s);else for(var r=0;r<n;r++)t[s+r]=e[i+r]},flattenChunks:function(t){var e,i,n,s,r,a;for(e=n=0,i=t.length;e<i;e++)n+=t[e].length;for(a=new Uint8Array(n),e=s=0,i=t.length;e<i;e++)r=t[e],a.set(r,s),s+=r.length;return a}},r={arraySet:function(t,e,i,n,s){for(var r=0;r<n;r++)t[s+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(n)},{}],42:[function(t,e,i){"use strict";var n=t("./common"),s=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(t){s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}for(var a=new n.Buf8(256),o=0;o<256;o++)a[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function l(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&s))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,i.string2buf=function(t){var e,i,s,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new n.Buf8(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,s=e.length;i<s;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,n,s,r,o=e||t.length,c=new Array(2*o);for(i=n=0;i<o;)if((s=t[i++])<128)c[n++]=s;else if(4<(r=a[s]))c[n++]=65533,i+=r-1;else{for(s&=2===r?31:3===r?15:7;1<r&&i<o;)s=s<<6|63&t[i++],r--;1<r?c[n++]=65533:s<65536?c[n++]=s:(s-=65536,c[n++]=55296|s>>10&1023,c[n++]=56320|1023&s)}return l(c,n)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,n){for(var s=65535&t,r=t>>>16&65535,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;r=r+(s=s+e[n++]|0)|0,--a;);s%=65521,r%=65521}return s|r<<16}},{}
vendor: 14,800 bytes, line 1
1],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";var n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,i){"use strict";var n,s=t("../utils/common"),r=t("./trees"),a=t("./adler32"),o=t("./crc32"),l=t("./messages"),c=-2,h=258,d=262,u=113;function p(t,e){return t.msg=l[e],e}function f(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function g(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(s.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function b(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function v(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var i,n,s=t.max_chain_length,r=t.strstart,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-d?t.strstart-(t.w_size-d):0,c=t.window,u=t.w_mask,p=t.prev,f=t.strstart+h,m=c[r+a-1],g=c[r+a];t.prev_length>=t.good_match&&(s>>=2),o>t.lookahead&&(o=t.lookahead);do{if(c[(i=e)+a]===g&&c[i+a-1]===m&&c[i]===c[r]&&c[++i]===c[r+1]){r+=2,i++;do{}while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<f);if(n=h-(f-r),r=f-h,a<n){if(t.match_start=e,o<=(a=n))break;m=c[r+a-1],g=c[r+a]}}}while((e=p[e&u])>l&&0!=--s);return a<=t.lookahead?a:t.lookahead}function x(t){var e,i,n,r,l,c,h,u,p,f,m=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-d)){for(s.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=i=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--i;);for(e=i=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--i;);r+=m}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,f=void 0,(p=r)<(f=c.avail_in)&&(f=p),i=0===f?0:(c.avail_in-=f,s.arraySet(h,c.input,c.next_in,f,u),1===c.state.wrap?c.adler=a(c.adler,h,f,u):2===c.state.wrap&&(c.adler=o(c.adler,h,f,u)),c.next_in+=f,c.total_in+=f,f),t.lookahead+=i,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<d&&0!==t.strm.avail_in)}function _(t,e){for(var i,n;;){if(t.lookahead<d){if(x(t),t.lookahead<d&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-d&&(t.match_length=w(t,i)),t.match_length>=3)if(n=r._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function A(t,e){for(var i,n,s;;){if(t.lookahead<d){if(x(t),t.lookahead<d&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-d&&(t.match_length=w(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-3,n=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=r._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function C(t,e,i,n,s){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=n,this.func=s}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(1146),this.dyn_dtree=new s.Buf16(122),this.bl_tree=new s.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(16),this.heap=new s.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:u,t.adler=2===e.wrap?0:1,e.last_flush=0,r._tr_init(e),0):p(t,c)}function E(t){var e=k(t);return 0===e&&function(t){t.window_size=2*t.w_size,m(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function T(t,e,i,n,r,a){if(!t)return c;var o=1;if(-1===e&&(e=6),n<0?(o=0,n=-n):15<n&&(o=2,n-=16),r<1||9<r||8!==i||n<8||15<n||e<0||9<e||a<0||4<a)return p(t,c);8===n&&(n=9);var l=new S;return(t.state=l).strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new s.Buf8(2*l.w_size),l.head=new s.Buf16(l.hash_size),l.prev=new s.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new s.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=a,l.method=i,E(t)}n=[new C(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-d&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(b(t,!1),t.strm.avail_out),1)}),new C(4,4,8,4,_),new C(4,5,16,8,_),new C(4,6,32,32,_),new C(4,4,16,16,A),new C(8,16,32,32,A),new C(8,16,128,128,A),new C(8,32,128,256,A),new C(32,128,258,1024,A),new C(32,258,258,4096,A)],i.deflateInit=function(t,e){return T(t,e,8,15,8,0)},i.deflateInit2=T,i.deflateReset=E,i.deflateResetKeep=k,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?c:(t.state.gzhead=e,0):c},i.deflate=function(t,e){var i,s,a,l;if(!t||!t.state||5<e||e<0)return t?p(t,c):c;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||666===s.status&&4!==e)return p(t,0===t.avail_out?-5:c);if(s.strm=t,i=s.last_flush,s.last_flush=e,42===s.status)if(2===s.wrap)t.adler=0,v(s,31),v(s,139),v(s,8),s.gzhead?(v(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),v(s,255&s.gzhead.time),v(s,s.gzhead.time>>8&255),v(s,s.gzhead.time>>16&255),v(s,s.gzhead.time>>24&255),v(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),v(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(v(s,255&s.gzhead.extra.length),v(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=o(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69):(v(s,0),v(s,0),v(s,0),v(s,0),v(s,0),v(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),v(s,3),s.status=u);else{var d=8+(s.w_bits-8<<4)<<8;d|=(2<=s.strategy||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(d|=32),d+=31-d%31,s.status=u,y(s,d),0!==s.strstart&&(y(s,t.adler>>>16),y(s,65535&t.adler)),t.adler=1}if(69===s.status)if(s.gzhead.extra){for(a=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),g(t),a=s.pending,s.pending!==s.pending_buf_size));)v(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=73)}else s.status=73;if(73===s.status)if(s.gzhead.name){a=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),g(t),a=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,v(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),0===l&&(s.gzindex=0,s.status=91)}else s.status=91;if(91===s.status)if(s.gzhead.comment){a=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),g(t),a=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,v(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>a&&(t.adler=o(t.adler,s.pending_buf,s.pending-a,a)),0===l&&(s.status=103)}else s.status=103;if(103===s.status&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&g(t),s.pending+2<=s.pending_buf_size&&(v(s,255&t.adler),v(s,t.adler>>8&255),t.adler=0,s.status=u)):s.status=u),0!==s.pending){if(g(t),0===t.avail_out)return s.last_flush=-1,0}else if(0===t.avail_in&&f(e)<=f(i)&&4!==e)return p(t,-5);if(666===s.status&&0!==t.avail_in)return p(t,-5);if(0!==t.avail_in||0!==s.lookahead||0!==e&&666!==s.status){var w=2===s.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(s,e):3===s.strategy?function(t,e){for(var i,n,s,a,o=t.window;;){if(t.lookahead<=h){if(x(t),t.lookahead<=h&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(n=o[s=t.strstart-1])===o[++s]&&n===o[++s]&&n===o[++s]){a=t.strstart+h;do{}while(n===o[++s]&&n===o[++s]&&n===o[++s]&&n===o[++s]&&n===o[++s]&&n===o[++s]&&n===o[++s]&&n===o[++s]&&s<a);t.match_length=h-(a-s),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=r._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(s,e):n[s.level].func(s,e);if(3!==w&&4!==w||(s.status=666),1===w||3===w)return 0===t.avail_out&&(s.last_flush=-1),0;if(2===w&&(1===e?r._tr_align(s):5!==e&&(r._tr_stored_block(s,0,0,!1),3===e&&(m(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),g(t),0===t.avail_out))return s.last_flush=-1,0}return 4!==e?0:s.wrap<=0?1:(2===s.wrap?(v(s,255&t.adler),v(s,t.adler>>8&255),v(s,t.adler>>16&255),v(s,t.adler>>24&255),v(s,255&t.total_in),v(s,t.total_in>>8&255),v(s,t.total_in>>16&255),v(s,t.total_in>>24&255)):(y(s,t.adler>>>16),y(s,65535&t.adler)),g(t),0<s.wrap&&(s.wrap=-s.wrap),0!==s.pending?0:1)},i.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==u&&666!==e?p(t,c):(t.state=null,e===u?p(t,-3):0):c},i.deflateSetDictionary=function(t,e){var i,n,r,o,l,h,d,u,p=e.length;if(!t||!t.state)return c;if(2===(o=(i=t.state).wrap)||1===o&&42!==i.status||i.lookahead)return c;for(1===o&&(t.adler=a(t.adler,e,p,0)),i.wrap=0,p>=i.w_size&&(0===o&&(m(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new s.Buf8(i.w_size),s.arraySet(u,e,p-i.w_size,i.w_size,0),e=u,p=i.w_size),l=t.avail_in,h=t.next_in,d=t.input,t.avail_in=p,t.next_in=0,t.input=e,x(i);i.lookahead>=3;){for(n=i.strstart,r=i.lookahead-2;i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++,--r;);i.strstart=n,i.lookahead=2,x(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=h,t.input=d,t.avail_in=l,i.wrap=o,0},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}
vendor: 15,819 bytes, line 1
1],47:[function(t,e,i){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,n,s,r,a,o,l,c,h,d,u,p,f,m,g,b,v,y,w,x,_,A,C,S,k;i=t.state,n=t.next_in,S=t.input,s=n+(t.avail_in-5),r=t.next_out,k=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),l=i.dmax,c=i.wsize,h=i.whave,d=i.wnext,u=i.window,p=i.hold,f=i.bits,m=i.lencode,g=i.distcode,b=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;t:do{f<15&&(p+=S[n++]<<f,f+=8,p+=S[n++]<<f,f+=8),y=m[p&b];e:for(;;){if(p>>>=w=y>>>24,f-=w,0==(w=y>>>16&255))k[r++]=65535&y;else{if(!(16&w)){if(!(64&w)){y=m[(65535&y)+(p&(1<<w)-1)];continue e}if(32&w){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}x=65535&y,(w&=15)&&(f<w&&(p+=S[n++]<<f,f+=8),x+=p&(1<<w)-1,p>>>=w,f-=w),f<15&&(p+=S[n++]<<f,f+=8,p+=S[n++]<<f,f+=8),y=g[p&v];i:for(;;){if(p>>>=w=y>>>24,f-=w,!(16&(w=y>>>16&255))){if(!(64&w)){y=g[(65535&y)+(p&(1<<w)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(_=65535&y,f<(w&=15)&&(p+=S[n++]<<f,(f+=8)<w&&(p+=S[n++]<<f,f+=8)),l<(_+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<_){if(h<(w=_-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(C=u,(A=0)===d){if(A+=c-w,w<x){for(x-=w;k[r++]=u[A++],--w;);A=r-_,C=k}}else if(d<w){if(A+=c+d-w,(w-=d)<x){for(x-=w;k[r++]=u[A++],--w;);if(A=0,d<x){for(x-=w=d;k[r++]=u[A++],--w;);A=r-_,C=k}}}else if(A+=d-w,w<x){for(x-=w;k[r++]=u[A++],--w;);A=r-_,C=k}for(;2<x;)k[r++]=C[A++],k[r++]=C[A++],k[r++]=C[A++],x-=3;x&&(k[r++]=C[A++],1<x&&(k[r++]=C[A++]))}else{for(A=r-_;k[r++]=k[A++],k[r++]=k[A++],k[r++]=k[A++],2<(x-=3););x&&(k[r++]=k[A++],1<x&&(k[r++]=k[A++]))}break}}break}}while(n<s&&r<o);n-=x=f>>3,p&=(1<<(f-=x<<3))-1,t.next_in=n,t.next_out=r,t.avail_in=n<s?s-n+5:5-(n-s),t.avail_out=r<o?o-r+257:257-(r-o),i.hold=p,i.bits=f}},{}],49:[function(t,e,i){"use strict";var n=t("../utils/common"),s=t("./adler32"),r=t("./crc32"),a=t("./inffast"),o=t("./inftrees"),l=-2;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):l}function u(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):l}function p(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=i,n.wbits=e,u(t))):l}function f(t,e){var i,n;return t?(n=new h,(t.state=n).window=null,0!==(i=p(t,e))&&(t.state=null),i):l}var m,g,b=!0;function v(t){if(b){var e;for(m=new n.Buf32(512),g=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,g,0,t.work,{bits:5}),b=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function y(t,e,i,s){var r,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),s>=a.wsize?(n.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(s<(r=a.wsize-a.wnext)&&(r=s),n.arraySet(a.window,e,i-s,r,a.wnext),(s-=r)?(n.arraySet(a.window,e,i-s,s,0),a.wnext=s,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}i.inflateReset=u,i.inflateReset2=p,i.inflateResetKeep=d,i.inflateInit=function(t){return f(t,15)},i.inflateInit2=f,i.inflate=function(t,e){var i,h,d,u,p,f,m,g,b,w,x,_,A,C,S,k,E,T,P,M,R,I,N,D,L=0,F=new n.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(i=t.state).mode&&(i.mode=13),p=t.next_out,d=t.output,m=t.avail_out,u=t.next_in,h=t.input,f=t.avail_in,g=i.hold,b=i.bits,w=f,x=m,I=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;b<16;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(2&i.wrap&&35615===g){F[i.check=0]=255&g,F[1]=g>>>8&255,i.check=r(i.check,F,2,0),b=g=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",i.mode=30;break}if(b-=4,R=8+(15&(g>>>=4)),0===i.wbits)i.wbits=R;else if(R>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<R,t.adler=i.check=1,i.mode=512&g?10:12,b=g=0;break;case 2:for(;b<16;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(i.flags=g,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=g>>8&1),512&i.flags&&(F[0]=255&g,F[1]=g>>>8&255,i.check=r(i.check,F,2,0)),b=g=0,i.mode=3;case 3:for(;b<32;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.head&&(i.head.time=g),512&i.flags&&(F[0]=255&g,F[1]=g>>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,i.check=r(i.check,F,4,0)),b=g=0,i.mode=4;case 4:for(;b<16;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.head&&(i.head.xflags=255&g,i.head.os=g>>8),512&i.flags&&(F[0]=255&g,F[1]=g>>>8&255,i.check=r(i.check,F,2,0)),b=g=0,i.mode=5;case 5:if(1024&i.flags){for(;b<16;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.length=g,i.head&&(i.head.extra_len=g),512&i.flags&&(F[0]=255&g,F[1]=g>>>8&255,i.check=r(i.check,F,2,0)),b=g=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(f<(_=i.length)&&(_=f),_&&(i.head&&(R=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,h,u,_,R)),512&i.flags&&(i.check=r(i.check,h,_,u)),f-=_,u+=_,i.length-=_),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===f)break t;for(_=0;R=h[u+_++],i.head&&R&&i.length<65536&&(i.head.name+=String.fromCharCode(R)),R&&_<f;);if(512&i.flags&&(i.check=r(i.check,h,_,u)),f-=_,u+=_,R)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===f)break t;for(_=0;R=h[u+_++],i.head&&R&&i.length<65536&&(i.head.comment+=String.fromCharCode(R)),R&&_<f;);if(512&i.flags&&(i.check=r(i.check,h,_,u)),f-=_,u+=_,R)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;b<16;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(g!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}b=g=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;b<32;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}t.adler=i.check=c(g),b=g=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=p,t.avail_out=m,t.next_in=u,t.avail_in=f,i.hold=g,i.bits=b,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){g>>>=7&b,b-=7&b,i.mode=27;break}for(;b<3;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}switch(i.last=1&g,b-=1,3&(g>>>=1)){case 0:i.mode=14;break;case 1:if(v(i),i.mode=20,6!==e)break;g>>>=2,b-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}g>>>=2,b-=2;break;case 14:for(g>>>=7&b,b-=7&b;b<32;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&g,b=g=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(_=i.length){if(f<_&&(_=f),m<_&&(_=m),0===_)break t;n.arraySet(d,h,u,_,p),f-=_,u+=_,m-=_,p+=_,i.length-=_;break}i.mode=12;break;case 17:for(;b<14;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(i.nlen=257+(31&g),g>>>=5,b-=5,i.ndist=1+(31&g),g>>>=5,b-=5,i.ncode=4+(15&g),g>>>=4,b-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;b<3;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.lens[O[i.have++]]=7&g,g>>>=3,b-=3}for(;i.have<19;)i.lens[O[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},I=o(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,I){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;k=(L=i.lencode[g&(1<<i.lenbits)-1])>>>16&255,E=65535&L,!((S=L>>>24)<=b);){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(E<16)g>>>=S,b-=S,i.lens[i.have++]=E;else{if(16===E){for(D=S+2;b<D;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(g>>>=S,b-=S,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}R=i.lens[i.have-1],_=3+(3&g),g>>>=2,b-=2}else if(17===E){for(D=S+3;b<D;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}b-=S,R=0,_=3+(7&(g>>>=S)),g>>>=3,b-=3}else{for(D=S+7;b<D;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}b-=S,R=0,_=11+(127&(g>>>=S)),g>>>=7,b-=7}if(i.have+_>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;_--;)i.lens[i.have++]=R}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,N={bits:i.lenbits},I=o(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,I){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},I=o(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,I){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=f&&258<=m){t.next_out=p,t.avail_out=m,t.next_in=u,t.avail_in=f,i.hold=g,i.bits=b,a(t,x),p=t.next_out,d=t.output,m=t.avail_out,u=t.next_in,h=t.input,f=t.avail_in,g=i.hold,b=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;k=(L=i.lencode[g&(1<<i.lenbits)-1])>>>16&255,E=65535&L,!((S=L>>>24)<=b);){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(k&&!(240&k)){for(T=S,P=k,M=E;k=(L=i.lencode[M+((g&(1<<T+P)-1)>>T)])>>>16&255,E=65535&L,!(T+(S=L>>>24)<=b);){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}g>>>=T,b-=T,i.back+=T}if(g>>>=S,b-=S,i.back+=S,i.length=E,0===k){i.mode=26;break}if(32&k){i.back=-1,i.mode=12;break}if(64&k){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&k,i.mode=22;case 22:if(i.extra){for(D=i.extra;b<D;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.length+=g&(1<<i.extra)-1,g>>>=i.extra,b-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;k=(L=i.distcode[g&(1<<i.distbits)-1])>>>16&255,E=65535&L,!((S=L>>>24)<=b);){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(!(240&k)){for(T=S,P=k,M=E;k=(L=i.distcode[M+((g&(1<<T+P)-1)>>T)])>>>16&255,E=65535&L,!(T+(S=L>>>24)<=b);){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}g>>>=T,b-=T,i.back+=T}if(g>>>=S,b-=S,i.back+=S,64&k){t.msg="invalid distance code",i.mode=30;break}i.offset=E,i.extra=15&k,i.mode=24;case 24:if(i.extra){for(D=i.extra;b<D;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}i.offset+=g&(1<<i.extra)-1,g>>>=i.extra,b-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===m)break t;if(_=x-m,i.offset>_){if((_=i.offset-_)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}A=_>i.wnext?(_-=i.wnext,i.wsize-_):i.wnext-_,_>i.length&&(_=i.length),C=i.window}else C=d,A=p-i.offset,_=i.length;for(m<_&&(_=m),m-=_,i.length-=_;d[p++]=C[A++],--_;);0===i.length&&(i.mode=21);break;case 26:if(0===m)break t;d[p++]=i.length,m--,i.mode=21;break;case 27:if(i.wrap){for(;b<32;){if(0===f)break t;f--,g|=h[u++]<<b,b+=8}if(x-=m,t.total_out+=x,i.total+=x,x&&(t.adler=i.check=i.flags?r(i.check,d,x,p-x):s(i.check,d,x,p-x)),x=m,(i.flags?g:c(g))!==i.check){t.msg="incorrect data check",i.mode=30;break}b=g=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;b<32;){if(0===f)break t;f--,g+=h[u++]<<b,b+=8}if(g!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}b=g=0}i.mode=29;case 29:I=1;break t;case 30:I=-3;break t;case 31:return-4;default:return l}return t.next_out=p,t.avail_out=m,t.next_in=u,t.avail_in=f,i.hold=g,i.bits=b,(i.wsize||x!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&y(t,t.output,t.next_out,x-t.avail_out)?(i.mode=31,-4):(w-=t.avail_in,x-=t.avail_out,t.total_in+=w,t.total_out+=x,i.total+=x,i.wrap&&x&&(t.adler=i.check=i.flags?r(i.check,d,x,t.next_out-x):s(i.check,d,x,t.next_out-x)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==w&&0===x||4===e)&&0===I&&(I=-5),I)},i.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},i.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?((i.head=e).done=!1,0):l},i.inflateSetDictionary=function(t,e){var i,n=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?l:11===i.mode&&s(1,e,n,0)!==i.check?-3:y(t,e,n,n)?(i.mode=31,-4):(i.havedict=1,0):l},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var n=t("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,l,c,h,d,u){var p,f,m,g,b,v,y,w,x,_=u.bits,A=0,C=0,S=0,k=0,E=0,T=0,P=0,M=0,R=0,I=0,N=null,D=0,L=new n.Buf16(16),F=new n.Buf16(16),O=null,z=0;for(A=0;A<=15;A++)L[A]=0;for(C=0;C<l;C++)L[e[i+C]]++;for(E=_,k=15;1<=k&&0===L[k];k--);if(k<E&&(E=k),0===k)return c[h++]=20971520,c[h++]=20971520,u.bits=1,0;for(S=1;S<k&&0===L[S];S++);for(E<S&&(E=S),A=M=1;A<=15;A++)if(M<<=1,(M-=L[A])<0)return-1;if(0<M&&(0===t||1!==k))return-1;for(F[1]=0,A=1;A<15;A++)F[A+1]=F[A]+L[A];for(C=0;C<l;C++)0!==e[i+C]&&(d[F[e[i+C]]++]=C);if(v=0===t?(N=O=d,19):1===t?(N=s,D-=257,O=r,z-=257,256):(N=a,O=o,-1),A=S,b=h,P=C=I=0,m=-1,g=(R=1<<(T=E))-1,1===t&&852<R||2===t&&592<R)return 1;for(;;){for(y=A-P,x=d[C]<v?(w=0,d[C]):d[C]>v?(w=O[z+d[C]],N[D+d[C]]):(w=96,0),p=1<<A-P,S=f=1<<T;c[b+(I>>P)+(f-=p)]=y<<24|w<<16|x,0!==f;);for(p=1<<A-1;I&p;)p>>=1;if(0!==p?(I&=p-1,I+=p):I=0,C++,0==--L[A]){if(A===k)break;A=e[i+d[C]]}if(E<A&&(I&g)!==m){for(0===P&&(P=E),b+=S,M=1<<(T=A-P);T+P<k&&!((M-=L[T+P])<=0);)T++,M<<=1;if(R+=1<<T,1===t&&852<R||2===t&&592<R)return 1;c[m=I&g]=E<<24|T<<16|b-h}}return 0!==I&&(c[b+I]=A-P<<24|64<<16),u.bits=E,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var n=t("../utils/common");function s(t){for(var e=t.length;0<=--e;)t[e]=0}var r=256,a=286,o=30,l=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],h=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);s(p);var f=new Array(60);s(f);var m=new Array(512);s(m);var g=new Array(256);s(g);var b=new Array(29);s(b);var v,y,w,x=new Array(o);function _(t,e,i,n,s){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=n,this.max_length=s,this.has_stree=t&&t.length}function A(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function C(t){return t<256?m[t]:m[256+(t>>
vendor: 8,564 bytes, line 1
1>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,S(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function E(t,e,i){k(t,i[2*e],i[2*e+1])}function T(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function P(t,e,i){var n,s,r=new Array(16),a=0;for(n=1;n<=l;n++)r[n]=a=a+i[n-1]<<1;for(s=0;s<=e;s++){var o=t[2*s+1];0!==o&&(t[2*s]=T(r[o]++,o))}}function M(t){var e;for(e=0;e<a;e++)t.dyn_ltree[2*e]=0;for(e=0;e<o;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){8<t.bi_valid?S(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function I(t,e,i,n){var s=2*e,r=2*i;return t[s]<t[r]||t[s]===t[r]&&n[e]<=n[i]}function N(t,e,i){for(var n=t.heap[i],s=i<<1;s<=t.heap_len&&(s<t.heap_len&&I(e,t.heap[s+1],t.heap[s],t.depth)&&s++,!I(e,n,t.heap[s],t.depth));)t.heap[i]=t.heap[s],i=s,s<<=1;t.heap[i]=n}function D(t,e,i){var n,s,a,o,l=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],s=t.pending_buf[t.l_buf+l],l++,0===n?E(t,s,e):(E(t,(a=g[s])+r+1,e),0!==(o=c[a])&&k(t,s-=b[a],o),E(t,a=C(--n),i),0!==(o=h[a])&&k(t,n-=x[a],o)),l<t.last_lit;);E(t,256,e)}function L(t,e){var i,n,s,r=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,c=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<c;i++)0!==r[2*i]?(t.heap[++t.heap_len]=h=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(s=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[s]=0,t.opt_len--,o&&(t.static_len-=a[2*s+1]);for(e.max_code=h,i=t.heap_len>>1;1<=i;i--)N(t,r,i);for(s=c;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],N(t,r,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,r[2*s]=r[2*i]+r[2*n],t.depth[s]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,r[2*i+1]=r[2*n+1]=s,t.heap[1]=s++,N(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,n,s,r,a,o,c=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(r=0;r<=l;r++)t.bl_count[r]=0;for(c[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)m<(r=c[2*c[2*(n=t.heap[i])+1]+1]+1)&&(r=m,g++),c[2*n+1]=r,h<n||(t.bl_count[r]++,a=0,f<=n&&(a=p[n-f]),o=c[2*n],t.opt_len+=o*(r+a),u&&(t.static_len+=o*(d[2*n+1]+a)));if(0!==g){do{for(r=m-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[m]--,g-=2}while(0<g);for(r=m;0!==r;r--)for(n=t.bl_count[r];0!==n;)h<(s=t.heap[--i])||(c[2*s+1]!==r&&(t.opt_len+=(r-c[2*s+1])*c[2*s],c[2*s+1]=r),n--)}}(t,e),P(r,h,t.bl_count)}function F(t,e,i){var n,s,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(i+1)+1]=65535,n=0;n<=i;n++)s=a,a=e[2*(n+1)+1],++o<l&&s===a||(o<c?t.bl_tree[2*s]+=o:0!==s?(s!==r&&t.bl_tree[2*s]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,r=s,c=(o=0)===a?(l=138,3):s===a?(l=6,3):(l=7,4))}function O(t,e,i){var n,s,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=i;n++)if(s=a,a=e[2*(n+1)+1],!(++o<l&&s===a)){if(o<c)for(;E(t,s,t.bl_tree),0!=--o;);else 0!==s?(s!==r&&(E(t,s,t.bl_tree),o--),E(t,16,t.bl_tree),k(t,o-3,2)):o<=10?(E(t,17,t.bl_tree),k(t,o-3,3)):(E(t,18,t.bl_tree),k(t,o-11,7));r=s,c=(o=0)===a?(l=138,3):s===a?(l=6,3):(l=7,4)}}s(x);var z=!1;function j(t,e,i,s){k(t,0+(s?1:0),3),function(t,e,i){R(t),S(t,i),S(t,~i),n.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i)}i._tr_init=function(t){z||(function(){var t,e,i,n,s,r=new Array(16);for(n=i=0;n<28;n++)for(b[n]=i,t=0;t<1<<c[n];t++)g[i++]=n;for(g[i-1]=n,n=s=0;n<16;n++)for(x[n]=s,t=0;t<1<<h[n];t++)m[s++]=n;for(s>>=7;n<o;n++)for(x[n]=s<<7,t=0;t<1<<h[n]-7;t++)m[256+s++]=n;for(e=0;e<=l;e++)r[e]=0;for(t=0;t<=143;)p[2*t+1]=8,t++,r[8]++;for(;t<=255;)p[2*t+1]=9,t++,r[9]++;for(;t<=279;)p[2*t+1]=7,t++,r[7]++;for(;t<=287;)p[2*t+1]=8,t++,r[8]++;for(P(p,287,r),t=0;t<o;t++)f[2*t+1]=5,f[2*t]=T(t,5);v=new _(p,c,257,a,l),y=new _(f,h,0,o,l),w=new _(new Array(0),d,0,19,7)}(),z=!0),t.l_desc=new A(t.dyn_ltree,v),t.d_desc=new A(t.dyn_dtree,y),t.bl_desc=new A(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,M(t)},i._tr_stored_block=j,i._tr_flush_block=function(t,e,i,n){var s,a,o=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<r;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),L(t,t.l_desc),L(t,t.d_desc),o=function(t){var e;for(F(t,t.dyn_ltree,t.l_desc.max_code),F(t,t.dyn_dtree,t.d_desc.max_code),L(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),s=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=s&&(s=a)):s=a=i+5,i+4<=s&&-1!==e?j(t,e,i,n):4===t.strategy||a===s?(k(t,2+(n?1:0),3),D(t,p,f)):(k(t,4+(n?1:0),3),function(t,e,i,n){var s;for(k(t,e-257,5),k(t,i-1,5),k(t,n-4,4),s=0;s<n;s++)k(t,t.bl_tree[2*u[s]+1],3);O(t,t.dyn_ltree,e-1),O(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),M(t),n&&R(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(g[i]+r+1)]++,t.dyn_dtree[2*C(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){k(t,2,3),E(t,256,p),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,n){(function(t){!function(t){"use strict";if(!t.setImmediate){var e,i,n,r,a=1,o={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,e="[object process]"==={}.toString.call(t.process)?function(t){s.nextTick(function(){u(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){u(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){u(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(u,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var i=new Array(arguments.length-1),n=0;n<i.length;n++)i[n]=arguments[n+1];var s={callback:t,args:i};return o[a]=s,e(a),a++},h.clearImmediate=d}function d(t){delete o[t]}function u(t){if(l)setTimeout(u,0,t);else{var e=o[t];if(e){l=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(void 0,i)}}(e)}finally{d(t),l=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&u(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},85039:function(t,e,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/oficina-virtual/carritov",function(){return i(63179)}])},61770:function(t,e,i){"use strict";i.d(e,{S:function(){return a}});var n=i(1995),s=i(13732),r=i(41705);const a=t=>{let{text:e="",onClick:i,className:a,active:o=!1,readonly:l=!1,colorCheckBox:c="fill-pt-primary",textClassName:h=""}=t;const[d,u]=(0,s.useState)(o);return(0,s.useEffect)(()=>{u(o)},[o]),(0,n.jsxs)("button",{onClick:l&&"editable"!=l?void 0:()=>{u(!d),i&&i(!d)},className:"".concat(a," flex items-center focus:outline-none transition duration-500 ease-in-out overflow-visible"),children:[d?(0,n.jsx)(r.$d,{className:"".concat(c," fill-pt-primary size-[15px]")}):(0,n.jsx)(r.mx,{className:"".concat(c," fill-pt-primary size-[15px]")}),e&&(0,n.jsx)("p",{className:"".concat(h||"text-[14px]"," ml-2"),children:e})]})}}
1,21763:function(t,e,i){"use strict";i.d(e,{S:function(){return c}});var n=i(1995),s=i(13732),r=i(19181),a=i.n(r),o=i(41705),l=i(32639);const c=t=>{let{className:e="",disabled:i,getText:r,onBlur:c,id:h,label:d,maxCharacters:u,minCharacters:p=0,floatCharacters:f=2,maxFloatCharacters:m=8,onClick:g,readonly:b,regex:v,required:y,type:w,value:x,wrong:_,wrongText:A,keepWrong:C,errorObj:S,helpText:k,onClickRefreshIcon:E,directRegex:T}=t;const[P,M]=(0,s.useState)(!1),[R,I]=(0,s.useState)(""),[N,D]=(0,s.useState)(_),[L,F]=(0,s.useState)(A),[O,z]=(0,s.useState)(),j=(0,s.useRef)(null),B=(0,s.useRef)(0),H=R.length,U=(t,e)=>{C||(D(!1),F("")),B.current=e;let n=t.toUpperCase();if(w){if("integer"==w||"number"==w)n=n.replace(/[^0-9]/g,"");else if("float"==w)if(n=n.replace(/[^0-9.]/g,""),(n.match(/\./g)||[]).length>1&&(n=n.replace(/\.(?=[^.]*$)/g,"")),n.includes(".")){const t=n.split(".");t[0]=t[0].substring(0,m),t[1]=t[1].substring(0,f),n=t.join(".")}else n=n.substring(0,m);else if("string"==w)n=n.replace(/[^a-zA-ZáéÃóúüñÃÃÃÃÃÃÃ\s.]/g,"");else if("alphanumeric"==w)n=n.replace(/[^a-zA-Z0-9áéÃóúüñÃÃÃÃÃÃÃ\s]/g,"");else if("curp"==w)n=n.replace(/[^A-Z0-9]/g,"");else if("rfc"==w)n=n.replace(/[^A-Z0-9&Ã]/g,"");else if("alphanumericEsp"==w)n=n.replace(/^([A-ZÃ&]{3,4})-?(\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01]))-?([A-Z\d]{3})$/,"");else if("razon"==w)n=n.toUpperCase().replace(/[^0-9A-ZÃÃÃÃÃÃà $%&\/():'_+{},.\-`]/g,"");else if("correo"===w&&(n=n.replace(/[^a-zA-Z0-9@._-]/g,""),(n.match(/@/g)||[]).length>1)){const t=n.indexOf("@");n=n.slice(0,t+1)+n.slice(t+1).replace(/@/g,"")}}else T?n=(0,l.Pr)(n,T):!T&&O&&(n=n.split("").filter(t=>O.test(t)).join(""));u&&n.length>u&&(n=n.slice(0,u)),I(n),i||r(null!=h?h:0,"integer"==w||"float"===w?""==n?void 0:Number(n):n),setTimeout(()=>{j.current&&j.current.setSelectionRange(B.current,B.current)},0)},$=()=>{i||b&&"editable"!==b||!j.current||j.current.focus()};return(0,s.useEffect)(()=>{if(v){const t=(0,l.F_)(v);z(t)}},[]),(0,s.useEffect)(()=>{let t=(null==x?void 0:x.toString().toUpperCase())||"";U(t,B.current||t.length)},[x]),(0,s.useEffect)(()=>{D(_),F(A)},S?[S]:[_,A]),(0,n.jsxs)("div",{className:"flex flex-col my-3 h-[40px] ".concat(e),children:[(0,n.jsxs)("div",{onClick:$,className:"".concat(a().inputText,"\n ").concat(i||b&&"editable"!==b?"bg-pt-gray-100 cursor-default":"bg-white","\n ").concat(N?"wrongBorderPulse":"editable"===b?"editable__field":"editado"===b?"notEditable__field ":"border-pt-gray-200/50"),children:[(0,n.jsxs)("div",{className:"flex flex-col w-[85%] 2xl:w-[95%]",children:[(0,n.jsxs)("p",{onClick:$,className:"".concat(a().inputText__label,"\n ").concat(i||b&&"editable"!==b?"bg-pt-gray-100 cursor-default":"bg-white"),children:[null==d?void 0:d.toUpperCase(),y&&(0,n.jsx)("span",{className:"text-pt-tertiary",children:" *"})]}),(0,n.jsx)("input",{ref:j,onClick:g,required:y,name:d,type:"text",readOnly:b&&"editable"!==b||i,value:i?"":R,onChange:t=>{var e;return U(t.target.value,(null==t||null===(e=t.target)||void 0===e?void 0:e.selectionStart)||0)},onFocus:()=>!i&&(!b||"editable"===b)&&M(!0),onBlur:()=>{M(!1),H&&U(R.trim(),null==R?void 0:R.length),(()=>{const t=R.trim();if(y||!(t.length<=0)){if(y&&t.length<=0)return I(t),D(!0),void F("Este campo es requerido");if("integer"===w||"float"===w){const e="integer"===w?parseInt(t,10):parseFloat(t);(isNaN(e)||e<p||u&&e>u)&&(D(!0),F("Número fuera de rango"))}else t.length>Number(u)||t.length<Number(p)?(D(!0),F("Campo inválido")):w&&["rfc","curp","correo","patronal"].includes(w)?(0,l.cf)(w).test(t)||(D(!0),F("Formato inválido")):v&&(v.test(t)||(D(!0),F("Formato inválido")));null==c||c()}})()},maxLength:"integer"==w?String(u).length||8:void 0,minLength:p,className:" ".concat(a().inputText__input," ").concat(P||H?"h-[20px] mt-0.5 ":"h-[0px]"," mb-2 ")})]}),k&&(0,n.jsx)("p",{className:"".concat(a().inputText__count),children:k}),P&&u&&"moneda"!=w&&"integer"!==w&&"float"!==w&&(0,n.jsxs)("p",{className:"".concat(a().inputText__count,"\n ").concat(H>u||H<p||y&&H<=0&&" text-pt-tertiary "," ").concat(E&&"mr-3"," "),children:[H,"/",u]}),E&&(!b||"editable"==b)&&(0,n.jsx)("button",{className:"".concat(a()["refresh-icon"]," mb-[11px] mr-1"),onClick:E,children:(0,n.jsx)(o.fN,{className:"w-3 fill-pt-tertiary"})})]}),(0,n.jsx)("p",{className:" hidden text-[11px] text-pt-primary no-select text-nowrap"})]})}}
1,73788:function(t,e,i){"use strict";i.d(e,{l:function(){return c}});var n=i(1995),s=i(13732),r=i(70598),a=i(69544),o=i.n(a),l=i(95677);const c=t=>{let{id:e,className:i="",data:a=[],label:c,wrongText:h="",active:d,required:u,readonly:p,wrong:f,getActive:m,blurColor:g="bg-white",loader:b=!0,keepWrong:v,sorting:y}=t;const[w,x]=(0,s.useState)(!1),_=(0,s.useRef)(null),[A,C]=(0,s.useState)(-1),S=(0,s.useRef)([]),[k,E]=(0,s.useState)(null==a?void 0:a.find(t=>(null==t?void 0:t.id)===d)),[T,P]=(0,s.useState)(""),M=(0,s.useRef)(null),R=(0,s.useRef)(0),[I,N]=(0,s.useState)(f),[D,L]=(0,s.useState)(h);(0,s.useEffect)(()=>{const t=t=>{if(!w)return;const e=j(a);if("ArrowDown"===t.key)t.preventDefault(),C(t=>{var i;const n=Math.min(t+1,e.length-1);return null===(i=S.current[n])||void 0===i||i.focus(),n});else if("ArrowUp"===t.key)t.preventDefault(),C(t=>{var e;const i=Math.max(t-1,0);return null===(e=S.current[i])||void 0===e||e.focus(),i});else if("Enter"===t.key)t.preventDefault(),A>=0&&e[A]?F(e[A]):e.length>0&&F(e[0]);else if("Escape"===t.key){var i;t.preventDefault(),x(!1),C(-1),null===(i=M.current)||void 0===i||i.blur()}else{var n;null===(n=M.current)||void 0===n||n.focus(),C(-1)}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[w,T,a,A]);const F=t=>{v||(N(!1),L(h)),p&&"editable"!==p||(t.id===(null==k?void 0:k.id)?(E(void 0),m(null!=e?e:0),P("")):(m(null!=e?e:0,t.id,t.nombre),E(t),P(t.nombre))),z()},O=t=>t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),z=()=>{w?M.current&&M.current.blur():(M.current&&(M.current.focus(),M.current.select()),C(-1)),x(!w)},j=t=>null==t?void 0:t.filter(t=>(null==k?void 0:k.nombre)!==T&&T?O(null==t?void 0:t.nombre).includes(O(T)):t).sort((t,e)=>{if(!y)return 0;const i=O(t.nombre).toLowerCase(),n=O(e.nombre).toLowerCase();return i<n?-1:i>n?1:0});return(0,s.useEffect)(()=>{const t=t=>{_.current&&!_.current.contains(t.target)&&(x(!1),T!==(null==k?void 0:k.nombre)&&P((null==k?void 0:k.nombre)?k.nombre:""))};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}}),(0,s.useEffect)(()=>{N(f),L(h)},[f,h]),(0,s.useEffect)(()=>{const t=null==a?void 0:a.find(t=>(null==t?void 0:t.id)===d);t&&!v&&N(!1),E(t),P((null==t?void 0:t.nombre)?t.nombre:"")},[d,a]),(0,n.jsxs)("div",{ref:_,translate:"no",onClick:()=>(!p||"editable"===p)&&(null==a?void 0:a.length)>0&&z(),className:" my-3 h-[40px] ".concat(i),children:[(0,n.jsxs)("div",{className:"".concat(o().select,"\n ").concat(p&&"editable"!==p?"bg-pt-gray-100":g,"\n ").concat(I?"wrongBorderPulse":"editable"===p?"editable__field":"editado"===p?"notEditable__field ":"border-pt-gray-200/50","\n "),children:[(0,n.jsxs)("div",{className:"flex flex-col w-full",children:[(0,n.jsxs)("p",{className:"".concat(o().select__label,"\n ").concat(p&&"editable"!==p?"bg-pt-gray-100":"bg-white"),children:[c.toUpperCase(),u&&(0,n.jsx)("span",{className:"text-pt-tertiary",children:" *"})]}),(0,n.jsx)("input",{autoComplete:"off",name:c,disabled:p&&"editable"!==p,ref:M,type:"text",onChange:t=>{var e,i,n;w&&(i=t.target.value,n=(null==t||null===(e=t.target)||void 0===e?void 0:e.selectionStart)||0,R.current=n,P(i),setTimeout(()=>{M.current&&M.current.setSelectionRange(R.current,R.current)},0))},value:T.toUpperCase(),className:"".concat(o().select__text," ").concat(w||k?"h-[15px] mt-1":"h-[0px]")})]}),b&&!(null==a?void 0:a.length)||!a?(0,n.jsx)(l.z,{className:" my-[16px] mr-2"}):(0,n.jsx)(r.g,{className:"".concat(o().select__arrow," ").concat(w?"-rotate-90":"rotate-90")})]}),(0,n.jsx)("p",{className:"".concat(!I&&"hidden"," text-[11px] text-pt-primary no-select ")}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("div",{className:"".concat(o().select__options," ").concat(o().select__scroll," ").concat(w&&0!==(null==a?void 0:a.length)?"flex":"hidden"," fadeIn"),children:(null==a?void 0:a.length)>0&&j(a).map((t,e)=>{var i;return(0,n.jsx)("button",{type:"button",ref:t=>{S.current[e]=t},onClick:()=>{F({id:null==t?void 0:t.id,nombre:null==t?void 0:t.nombre})},className:"border-b-[0.5px] border-black/20 last:border-0 py-1 text-start pl-3 focus:outline-none focus:bg-pt-gray-100 focus:text-pt-gray-300 ".concat((null==k?void 0:k.id)===(null==t?void 0:t.id)?"bg-pt-gray-300 text-white":"hover:bg-pt-gray-100 bg-white"),children:null==t||null===(i=t.nombre)||void 0===i?void 0:i.toUpperCase()},e)})})})]})}}
1,77857:function(t,e,i){"use strict";i.d(e,{y:function(){return a}});var n=i(1995),s=(i(13732),i(56015)),r=i.n(s);const a=t=>{let{texto:e,classNameTitle:i,subTitle:s}=t;return(0,n.jsxs)("div",{className:r().container,children:[(0,n.jsx)("p",{className:"".concat(r().title3," ").concat(i||"ml-9"),children:e.toUpperCase()}),s&&(0,n.jsx)("p",{className:"font-bold text-pt-primary text-xl",children:s})]})}},74388:function(t,e,i){"use strict";i.d(e,{C:function(){return xo}});var n={};i.r(n),i.d(n,{dU:function(){return wn},ng:function(){return xn},EA:function(){return _n},Tm:function(){return An},D6:function(){return Cn},YE:function(){return Sn}});var s=i(1995),r=(i(61889),i(13732)),a=i.n(r),o=i(77836),l=i(48287).Buffer,c={d:(t,e)=>{for(var i in e)c.o(e,i)&&!c.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},h=globalThis.pdfjsLib={};c.d(h,{AbortException:()=>j,AnnotationEditorLayer:()=>vn,AnnotationEditorParamsType:()=>b,AnnotationEditorType:()=>g,AnnotationEditorUIManager:()=>Ct,AnnotationLayer:()=>sn,AnnotationMode:()=>m,ColorPicker:()=>fn,DOMSVGFactory:()=>Si,DrawLayer:()=>yn,FeatureTest:()=>$,GlobalWorkerOptions:()=>ye,ImageKind:()=>y,InvalidPDFException:()=>L,MissingPDFException:()=>F,OPS:()=>x,OutputScale:()=>mt,PDFDataRangeTransport:()=>ci,PDFDateString:()=>ct,PDFWorker:()=>pi,PasswordResponses:()=>_,PermissionFlag:()=>v,PixelsPerInch:()=>Z,RenderingCancelledException:()=>tt,TextLayer:()=>Qe,UnexpectedResponseException:()=>O,Util:()=>V,VerbosityLevel:()=>w,XfaLayer:()=>ki,build:()=>wi,createValidAbsoluteUrl:()=>M,fetchData:()=>J,getDocument:()=>ai,getFilenameFromUrl:()=>nt,getPdfFilenameFromUrl:()=>st,getXfaPageViewport:()=>ht,isDataScheme:()=>et,isPdfFile:()=>it,noContextMenu:()=>ot,normalizeUnicode:()=>X,setLayerDimensions:()=>ft,shadow:()=>R,version:()=>yi});const d=!("object"!=typeof o||o+""!="[object process]"||o.versions.nw||o.versions.electron&&o.type&&"browser"!==o.type),u=[1,0,0,1,0,0],p=[.001,0,0,.001,0,0],f=1.35,m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},g={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},b={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},v={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},y={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},w={ERRORS:0,WARNINGS:1,INFOS:5},x={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},_={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let A=w.WARNINGS;
vendor: 46,804 bytes, line 1
1function C(t){Number.isInteger(t)&&(A=t)}function S(){return A}function k(t){A>=w.INFOS&&console.log(`Info: ${t}`)}function E(t){A>=w.WARNINGS&&console.log(`Warning: ${t}`)}function T(t){throw new Error(t)}function P(t,e){t||T(e)}function M(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function R(t,e,i,n=!1){return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const I=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class N extends I{constructor(t,e){super(t,"PasswordException"),this.code=e}}class D extends I{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class L extends I{constructor(t){super(t,"InvalidPDFException")}}class F extends I{constructor(t){super(t,"MissingPDFException")}}class O extends I{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class z extends I{constructor(t){super(t,"FormatError")}}class j extends I{constructor(t){super(t,"AbortException")}}function B(t){"object"==typeof t&&void 0!==t?.length||T("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function H(t){"string"!=typeof t&&T("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function U(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class ${static get isLittleEndian(){return R(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return R(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return R(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?R(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):R(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return R(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const W=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class V{static makeHexColor(t,e,i){return`#${W[t]}${W[e]}${W[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static#t(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,f=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}static#e(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),f=2*l;this.#t(t,e,i,n,s,r,a,o,(-c+p)/f,d),this.#t(t,e,i,n,s,r,a,o,(-c-p)/f,d)}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){return l?(l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,a),Math.min(e,o),Math.max(t,a),Math.max(e,o)],this.#e(t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),this.#e(t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}let G=null,q=null;function X(t){return G||(G=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,q=new Map([["ï¬
","ſt"]])),t.replaceAll(G,(t,e,i)=>e?e.normalize("NFKC"):q.get(i))}const Y="pdfjs_internal_id_",K="http://www.w3.org/2000/svg";class Z{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function J(t,e="text"){if(at(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)})}class Q{constructor({viewBox:t,scale:e,rotation:i,offsetX:n=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=n,this.offsetY=s;const a=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,c,h,d,u,p,f,m;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,c=0,h=0,d=1;break;case 90:l=0,c=1,h=1,d=0;break;case 270:l=0,c=-1,h=-1,d=0;break;case 0:l=1,c=0,h=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(h=-h,d=-d),0===l?(u=Math.abs(o-t[1])*e+n,p=Math.abs(a-t[0])*e+s,f=(t[3]-t[1])*e,m=(t[2]-t[0])*e):(u=Math.abs(a-t[0])*e+n,p=Math.abs(o-t[1])*e+s,f=(t[2]-t[0])*e,m=(t[3]-t[1])*e),this.transform=[l*e,c*e,h*e,d*e,u-l*e*a-h*e*o,p-c*e*a-d*e*o],this.width=f,this.height=m}get rawDims(){const{viewBox:t}=this;return R(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new Q({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return V.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=V.applyTransform([t[0],t[1]],this.transform),i=V.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return V.applyInverseTransform([t,e],this.transform)}}class tt extends I{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function et(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function it(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function nt(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function st(t,e="document.pdf"){if("string"!=typeof t)return e;if(et(t))return E('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class rt{started=Object.create(null);times=[];time(t){t in this.started&&E(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||E(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function at(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function ot(t){t.preventDefault()}function lt(t){console.log("Deprecated API usage: "+t)}class ct{static#i;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#i||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#i.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}function ht(t,{scale:e=1,rotation:i=0}){const{width:n,height:s}=t.attributes.style,r=[0,0,parseInt(n),parseInt(s)];return new Q({viewBox:r,scale:e,rotation:i})}function dt(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(E(`Not a valid color format: "${t}"`),[0,0,0])}function ut(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function pt(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function ft(t,e,i=!1,n=!0){if(e instanceof Q){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=$.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,c=a?`round(down, ${o}, var(--scale-round-x, 1px))`:`calc(${o})`,h=a?`round(down, ${l}, var(--scale-round-y, 1px))`:`calc(${l})`;i&&e.rotation%180!=0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}class mt{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class gt{#n=null;#s=null;#r;#a=null;#o=null;static#l=null;constructor(t){this.#r=t,gt.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const t=this.#n=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#r._uiManager._signal;t.addEventListener("contextmenu",ot,{signal:e}),t.addEventListener("pointerdown",gt.#c,{signal:e});const i=this.#a=document.createElement("div");i.className="buttons",t.append(i);const n=this.#r.toolbarPosition;if(n){const{style:e}=t,i="ltr"===this.#r._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#h(),t}get div(){return this.#n}static#c(t){t.stopPropagation()}#d(t){this.#r._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#u(t){this.#r._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#p(t){const e=this.#r._uiManager._signal;t.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ot,{signal:e})}hide(){this.#n.classList.add("hidden"),this.#s?.hideDropdown()}show(){this.#n.classList.remove("hidden"),this.#o?.shown()}#h(){const{editorType:t,_uiManager:e}=this.#r,i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",gt.#l[t]),this.#p(i),i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),this.#a.append(i)}get#f(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#p(e),this.#a.prepend(e,this.#f),this.#o=t}addColorPicker(t){this.#s=t;const e=t.renderButton();this.#p(e),this.#a.prepend(e,this.#f)}remove(){this.#n.remove(),this.#s?.destroy(),this.#s=null}}class bt{#a=null;#n=null;#m;constructor(t){this.#m=t}#g(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ot,{signal:this.#m._signal});const e=this.#a=document.createElement("div");return e.className="buttons",t.append(e),this.#b(),t}#v(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]}show(t,e,i){const[n,s]=this.#v(e,i),{style:r}=this.#n||=this.#g();t.append(this.#n),r.insetInlineEnd=100*n+"%",r.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#n.remove()}#b(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#m._signal;t.addEventListener("contextmenu",ot,{signal:i}),t.addEventListener("click",()=>{this.#m.highlightSelection("floating_button")},{signal:i}),this.#a.append(t)}}function vt(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}class yt{#y=0;get id(){return"pdfjs_internal_editor_"+this.#y++}}class wt{#w=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return B(t)}();#y=0;#x=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',R(this,"_isSVGFittingCanvas",e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}async#_(t,e){this.#x||=new Map;let i=this.#x.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#w}_${this.#y++}`,refCounter:0,isSvg:!1},"string"==typeof e?(i.url=e,t=await J(e,"blob")):e instanceof File?t=i.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=wt._isSVGFittingCanvas,n=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=r});n.readAsDataURL(t),await r}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}return this.#x.set(t,i),i&&this.#x.set(i.id,i),i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return this.#_(`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return this.#_(t,t)}async getFromBlob(t,e){const i=await e;return this.#_(t,i)}async getFromId(t){this.#x||=new Map;const e=this.#x.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#x||=new Map;let i=this.#x.get(t);if(i?.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#w}_${this.#y++}`,refCounter:1,isSvg:!1},this.#x.set(t,i),this.#x.set(i.id,i),i}getSvgUrl(t){const e=this.#x.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#x||=new Map;const e=this.#x.get(t);if(!e)return;if(e.refCounter-=1,0!==e.refCounter)return;const{bitmap:i}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=t.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#w}_`)}}class xt{#A=[];#C=!1;#S;#k=-1;constructor(t=128){this.#S=t}add({cmd:t,undo:e,post:i,mustExec:n,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}){if(n&&t(),this.#C)return;const o={cmd:t,undo:e,post:i,type:s};if(-1===this.#k)return this.#A.length>0&&(this.#A.length=0),this.#k=0,void this.#A.push(o);if(r&&this.#A[this.#k].type===s)return a&&(o.undo=this.#A[this.#k].undo),void(this.#A[this.#k]=o);const l=this.#k+1;l===this.#S?this.#A.splice(0,1):(this.#k=l,l<this.#A.length&&this.#A.splice(l)),this.#A.push(o)}undo(){if(-1===this.#k)return;this.#C=!0;const{undo:t,post:e}=this.#A[this.#k];t(),e?.(),this.#C=!1,this.#k-=1}redo(){if(this.#k<this.#A.length-1){this.#k+=1,this.#C=!0;const{cmd:t,post:e}=this.#A[this.#k];t(),e?.(),this.#C=!1}}hasSomethingToUndo(){return-1!==this.#k}hasSomethingToRedo(){return this.#k<this.#A.length-1}destroy(){this.#A=null}}class _t{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=$.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}#E(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(this.#E(e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}class At{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,dt(n))}e.remove()}(t),R(this,"_colors",t)}convert(t){const e=dt(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every((t,i)=>t===e[i]))return At._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?V.makeHexColor(...e):t}}class Ct{#T=new AbortController;#P=null;#M=new Map;#R=new Map;#I=null;#N=null;#D=null;#L=new xt;#F=null;#O=0;#z=new Set;#j=null;#B=null;#H=new Set;#U=!1;#$=!1;#W=!1;#V=null;#G=null;#q=null;#X=null;#Y=!1;#K=null;#Z=new yt;#J=!1;#Q=!1;#tt=null;#et=null;#it=null;#nt=null;#st=g.NONE;#rt=new Set;#at=null;#ot=null;#lt=null;#ct={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#ht=[0,0];#dt=null;#ut=null;#pt=null;#ft=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Ct.prototype,e=t=>t.#ut.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return R(this,"_keyboardManager",new _t([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#ut.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#ut.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,a,o,l,c,h){const d=this._signal=this.#T.signal;this.#ut=t,this.#pt=e,this.#I=i,this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:d}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:d}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:d}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:d}),n._on("setpreference",this.onSetPreference.bind(this),{signal:d}),n._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:d}),this.#mt(),this.#gt(),this.#bt(),this.#N=s.annotationStorage,this.#V=s.filterFactory,this.#ot=r,this.#X=a||null,this.#U=o,this.#$=l,this.#W=c,this.#nt=h||null,this.viewParameters={realScale:Z.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#ft?.resolve(),this.#ft=null,this.#T?.abort(),this.#T=null,this._signal=null;for(const t of this.#R.values())t.destroy();this.#R.clear(),this.#M.clear(),this.#H.clear(),this.#P=null,this.#rt.clear(),this.#L.destroy(),this.#I?.destroy(),this.#K?.hide(),this.#K=null,this.#G&&(clearTimeout(this.#G),this.#G=null),this.#dt&&(clearTimeout(this.#dt),this.#dt=null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#nt}get useNewAltTextFlow(){return this.#$}get useNewAltTextWhenAddingImage(){return this.#W}get hcmFilter(){return R(this,"hcmFilter",this.#ot?this.#V.addHCMFilter(this.#ot.foreground,this.#ot.background):"none")}get direction(){return R(this,"direction",getComputedStyle(this.#ut).direction)}get highlightColors(){return R(this,"highlightColors",this.#X?new Map(this.#X.split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return R(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#it=t}editAltText(t,e=!1){this.#I?.editAltText(this,t,e)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){"enableNewAltTextWhenAddingImage"===t&&(this.#W=e)}onPageChanging({pageNumber:t}){this.#O=t-1}focusMainContainer(){this.#ut.focus()}findParent(t,e){for(const i of this.#R.values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(t=!1){this.#pt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#H.add(t)}removeShouldRescale(t){this.#H.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Z.PDF_TO_CSS_UNITS;for(const t of this.#H)t.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#vt({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#yt(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const e of this.#R.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=e,a=e.toString(),o=this.#vt(e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(!l)return;e.empty();const c=this.#yt(o),h=this.#st===g.NONE,d=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r,text:a}),h&&this.showAllEditors("highlight",!0,!0)};h?this.switchToMode(g.HIGHLIGHT,d):d()}#wt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#vt(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#K||=new bt(this),this.#K.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#N||this.#N.has(t.id)||this.#N.setValue(t.id,t)}#xt(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#at&&(this.#K?.hide(),this.#at=null,this.#_t({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#at)return;const i=this.#vt(t).closest(".textLayer");if(i){if(this.#K?.hide(),this.#at=e,this.#_t({hasSelectedText:!0}),(this.#st===g.HIGHLIGHT||this.#st===g.NONE)&&(this.#st===g.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#Y=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#st===g.HIGHLIGHT?this.#yt(i):null;t?.toggleDrawing();const e=new AbortController,n=this.combinedSignal(e),s=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),t?.toggleDrawing(!0),"pointerup"===i.type&&this.#At("main_toolbar"))};window.addEventListener("pointerup",s,{signal:n}),window.addEventListener("blur",s,{signal:n})}}else this.#at&&(this.#K?.hide(),this.#at=null,this.#_t({hasSelectedText:!1}))}#At(t=""){this.#st===g.HIGHLIGHT?this.highlightSelection(t):this.#U&&this.#wt()}#mt(){document.addEventListener("selectionchange",this.#xt.bind(this),{signal:this._signal})}#Ct(){if(this.#q)return;this.#q=new AbortController;const t=this.combinedSignal(this.#q);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#St(){this.#q?.abort(),this.#q=null}blur(){if(this.isShiftKeyDown=!1,this.#Y&&(this.#Y=!1,this.#At("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#rt)if(e.div.contains(t)){this.#et=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#et)return;const[t,e]=this.#et;this.#et=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#bt(){if(this.#tt)return;this.#tt=new AbortController;const t=this.combinedSignal(this.#tt);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#kt(){this.#tt?.abort(),this.#tt=null}#Et(){if(this.#F)return;this.#F=new AbortController;const t=this.combinedSignal(this.#F);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Tt(){this.#F?.abort(),this.#F=null}#gt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#bt(),this.#Et()}removeEditListeners(){this.#kt(),this.#Tt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#B)if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#B)if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#P?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const t of this.#rt){const i=t.serialize(!0);i&&e.push(i)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of this.#B)if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){return void E(`paste: "${t.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const e of i){const i=await n.deserialize(e);if(!i)return;t.push(i)}const e=()=>{for(const e of t)this.#Pt(e);this.#Mt(t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(t){E(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#st===g.NONE||this.isEditorHandlingKeyboard||Ct._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#Y&&(this.#Y=!1,this.#At("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#_t(t){Object.entries(t).some(([t,e])=>this.#ct[t]!==e)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ct,t)}),this.#st===g.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Rt([[b.HIGHLIGHT_FREE,!0]]))}#Rt(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Ct(),this.#Et(),this.#_t({isEditing:this.#st!==g.NONE,isEmpty:this.#It(),hasSomethingToUndo:this.#L.hasSomethingToUndo(),hasSomethingToRedo:this.#L.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#St(),this.#Tt(),this.#_t({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#B){this.#B=t;for(const t of this.#B)this.#Rt(t.defaultPropertiesToUpdate)}}getId(){return this.#Z.id}get currentLayer(){return this.#R.get(this.#O)}getLayer(t){return this.#R.get(t)}get currentPageIndex(){return this.#O}addLayer(t){this.#R.set(t.pageIndex,t),this.#J?t.enable():t.disable()}removeLayer(t){this.#R.delete(t.pageIndex)}async updateMode(t,e=null,i=!1){if(this.#st!==t&&(!this.#ft||(await this.#ft.promise,this.#ft))){if(this.#ft=Promise.withResolvers(),this.#st=t,t===g.NONE)return this.setEditingState(!1),this.#Nt(),void this.#ft.resolve();this.setEditingState(!0),await this.#Dt(),this.unselectAll();for(const e of this.#R.values())e.updateMode(t);if(!e)return i&&this.addNewEditorFromKeyboard(),void this.#ft.resolve();for(const t of this.#M.values())t.annotationElementId===e?(this.setSelected(t),t.enterInEditMode()):t.unselect();this.#ft.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#st&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#B){switch(t){case b.CREATE:return void this.currentLayer.addNewEditor();case b.HIGHLIGHT_DEFAULT_COLOR:this.#it?.updateColor(e);break;case b.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#lt||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(const i of this.#rt)i.updateParams(t,e);for(const i of this.#B)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(const i of this.#M.values())i.editorType===t&&i.show(e);(this.#lt?.get(b.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#Rt([[b.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#Q!==t){this.#Q=t;for(const e of this.#R.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#Dt(){if(!this.#J){this.#J=!0;const t=[];for(const e of this.#R.values())t.push(e.enable());await Promise.all(t);for(const t of this.#M.values())t.enable()}}#Nt(){if(this.unselectAll(),this.#J){this.#J=!1;for(const t of this.#R.values())t.disable();for(const t of this.#M.values())t.disable()}}getEditors(t){const e=[];for(const i of this.#M.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#M.get(t)}addEditor(t){this.#M.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#G&&clearTimeout(this.#G),this.#G=setTimeout(()=>{this.focusMainContainer(),this.#G=null},0)),this.#M.delete(t.id),this.unselect(t),t.annotationElementId&&this.#z.has(t.annotationElementId)||this.#N?.remove(t.id)}addDeletedAnnotationElement(t){this.#z.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#z.has(t)}removeDeletedAnnotationElement(t){this.#z.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Pt(t){const e=this.#R.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#P!==t&&(this.#P=t,t&&this.#Rt(t.propertiesToUpdate))}get#Lt(){let t=null;for(t of this.#rt);return t}updateUI(t){this.#Lt===t&&this.#Rt(t.propertiesToUpdate)}toggleSelected(t){if(this.#rt.has(t))return this.#rt.delete(t),t.unselect(),void this.#_t({hasSelectedEditor:this.hasSelection});this.#rt.add(t),t.select(),this.#Rt(t.propertiesToUpdate),this.#_t({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#rt)e!==t&&e.unselect();this.#rt.clear(),this.#rt.add(t),t.select(),this.#Rt(t.propertiesToUpdate),this.#_t({hasSelectedEditor:!0})}isSelected(t){return this.#rt.has(t)}get firstSelectedEditor(){return this.#rt.values().next().value}unselect(t){t.unselect(),this.#rt.delete(t),this.#_t({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#rt.size}get isEnterHandled(){return 1===this.#rt.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#L.undo(),this.#_t({hasSomethingToUndo:this.#L.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#It()})}redo(){this.#L.redo(),this.#_t({hasSomethingToUndo:!0,hasSomethingToRedo:this.#L.hasSomethingToRedo(),isEmpty:this.#It()})}addCommands(t){this.#L.add(t),this.#_t({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#It()})}#It(){if(0===this.#M.size)return!0;if(1===this.#M.size)for(const t of this.#M.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#rt];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Pt(e)},mustExec:!0})}commitOrRemove(){this.#P?.commitOrRemove()}hasSomethingToControl(){return this.#P||this.hasSelection}#Mt(t){for(const t of this.#rt)t.unselect();this.#rt.clear();for(const e of t)e.isEmpty()||(this.#rt.add(e),e.select());this.#_t({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#rt)t.commit();this.#Mt(this.#M.values())}unselectAll(){if((!this.#P||(this.#P.commitOrRemove(),this.#st===g.NONE))&&this.hasSelection){for(const t of this.#rt)t.unselect();this.#rt.clear(),this.#_t({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#ht[0]+=t,this.#ht[1]+=e;const[n,s]=this.#ht,r=[...this.#rt];this.#dt&&clearTimeout(this.#dt),this.#dt=setTimeout(()=>{this.#dt=null,this.#ht[0]=this.#ht[1]=0,this.addCommands({cmd:()=>{for(const t of r)this.#M.has(t.id)&&t.translateInPage(n,s)},undo:()=>{for(const t of r)this.#M.has(t.id)&&t.translateInPage(-n,-s)},mustExec:!1})},1e3);for(const i of r)i.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#j=new Map;for(const t of this.#rt)this.#j.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#j)return!1;this.disableUserSelect(!1);const t=this.#j;this.#j=null;let e=!1;for(const[{x:i,y:n,pageIndex:s},r]of t)r.newX=i,r.newY=n,r.newPageIndex=s,e||=i!==r.savedX||n!==r.savedY||s!==r.savedPageIndex;if(!e)return!1;const i=(t,e,i,n)=>{if(this.#M.has(t.id)){const s=this.#R.get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#j)for(const i of this.#j.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#rt.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#P===t}getActive(){return this.#P}getMode(){return this.#st}get imageManager(){return R(this,"imageManager",new wt)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let i=0,n=e.rangeCount;i<n;i++)if(!t.contains(e.getRangeAt(i).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let t=0,i=e.rangeCount;t<i;t++){const i=e.getRangeAt(t);if(!i.collapsed)for(const{x:t,y:e,width:n,height:s}of i.getClientRects())0!==n&&0!==s&&o.push(a(t,e,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#D||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#D?.delete(t)}renderAnnotationElement(t){const e=this.#D?.get(t.data.id);if(!e)return;const i=this.#N.getRawValue(e);i&&(this.#st!==g.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}}class St{#o=null;#Ft=!1;#Ot=null;#zt=null;#jt=null;#Bt=null;#Ht=!1;#Ut=null;#r=null;#$t=null;#Wt=null;#Vt=!1;static#Gt=null;static _l10n=null;constructor(t){this.#r=t,this.#Vt=t._uiManager.useNewAltTextFlow,St.#Gt||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){St._l10n??=t}async render(){const t=this.#Ot=document.createElement("button");t.className="altText",t.tabIndex="0";const e=this.#zt=document.createElement("span");t.append(e),this.#Vt?(t.classList.add("new"),t.setAttribute("data-l10n-id",St.#Gt.missing),e.setAttribute("data-l10n-id",St.#Gt["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=this.#r._uiManager._signal;t.addEventListener("contextmenu",ot,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),this.#r._uiManager.editAltText(this.#r),this.#Vt&&this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#qt}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#Ht=!0,n(e))},{signal:i}),await this.#Xt(),t}get#qt(){return(this.#o?"added":null===this.#o&&this.guessedText&&"review")||"missing"}finish(){this.#Ot&&(this.#Ot.focus({focusVisible:this.#Ht}),this.#Ht=!1)}isEmpty(){return this.#Vt?null===this.#o:!this.#o&&!this.#Ft}hasData(){return this.#Vt?null!==this.#o||!!this.#$t:this.isEmpty()}get guessedText(){return this.#$t}async setGuessedText(t){null===this.#o&&(this.#$t=t,this.#Wt=await St._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#Xt())}toggleAltTextBadge(t=!1){if(!this.#Vt||this.#o)return this.#Ut?.remove(),void(this.#Ut=null);if(!this.#Ut){const t=this.#Ut=document.createElement("div");t.className="noAltTextBadge",this.#r.div.append(t)}this.#Ut.classList.toggle("hidden",!t)}serialize(t){let e=this.#o;return t||this.#$t!==e||(e=this.#Wt),{altText:e,decorative:this.#Ft,guessedText:this.#$t,textWithDisclaimer:this.#Wt}}get data(){return{altText:this.#o,decorative:this.#Ft}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:n,cancel:s=!1}){i&&(this.#$t=i,this.#Wt=n),this.#o===t&&this.#Ft===e||(s||(this.#o=t,this.#Ft=e),this.#Xt())}toggle(t=!1){this.#Ot&&(!t&&this.#Bt&&(clearTimeout(this.#Bt),this.#Bt=null),this.#Ot.disabled=!t)}shown(){this.#r._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#qt}})}destroy(){this.#Ot?.remove(),this.#Ot=null,this.#zt=null,this.#jt=null,this.#Ut?.remove(),this.#Ut=null}async#Xt(){const t=this.#Ot;if(!t)return;if(this.#Vt){if(t.classList.toggle("done",!!this.#o),t.setAttribute("data-l10n-id",St.#Gt[this.#qt]),this.#zt?.setAttribute("data-l10n-id",St.#Gt[`${this.#qt}-label`]),!this.#o)return void this.#jt?.remove()}else{if(!this.#o&&!this.#Ft)return t.classList.remove("done"),void this.#jt?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#jt;if(!e){this.#jt=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#r.id}`;const i=100,n=this.#r._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#Bt),this.#Bt=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#Bt=setTimeout(()=>{this.#Bt=null,this.#jt.classList.add("show"),this.#r._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n}),t.addEventListener("mouseleave",()=>{this.#Bt&&(clearTimeout(this.#Bt),this.#Bt=null),this.#jt?.classList.remove("show")},{signal:n})}this.#Ft?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#o),e.parentNode||t.append(e);const i=this.#r.getImageForAltText();i?.setAttribute("aria-describedby",e.id)}}class kt{#Yt=null;#Kt=null;#o=null;#Zt=!1;#Jt=!1;#Qt=null;#te=null;#ee=null;#ie="";#ne=!1;#se=null;#re=!1;#ae=!1;#oe=!1;#le=null;#ce=0;#he=0;#de=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#ue=!1;#pe=kt._zIndex++;static _borderLineWidth=-1;static _colorManager=new At;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=kt.prototype._resizeWithKeyboard,e=Ct.TRANSLATE_SMALL,i=Ct.TRANSLATE_BIG;return R(this,"_resizerKeyboardManager",new _t([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],kt.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return R(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Et({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(kt._l10n??=t,kt._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==kt._borderLineWidth)return;const i=getComputedStyle(document.documentElement);kt._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){T("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ue}set _isDraggable(t){this.#ue=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}
1setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#pe}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#fe(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ne?this.#ne=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}#me([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this.fixAndSetPosition()}translate(t,e){this.#me(this.parentDimensions,t,e)}translateInPage(t,e){this.#se||=[this.x,this.y],this.#me(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#se||=[this.x,this.y];const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this;const[a,o]=this.getBaseTranslation();s+=a,r+=o,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*r).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#se&&(this.#se[0]!==this.x||this.#se[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=kt,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#ge(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return kt.#ge(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return kt.#ge(t,e,360-this.parentRotation)}#be(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#Jt||(this.div.style.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!this.#Jt&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/r).toFixed(2)}%`),this.#Jt||s||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#ve(){if(this.#Qt)return;this.#Qt=document.createElement("div"),this.#Qt.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#Qt.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#ye.bind(this,i),{signal:e}),t.addEventListener("contextmenu",ot,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#Qt)}#ye(t,e){e.preventDefault();const{isMac:i}=$.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#o?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;const s=new AbortController,r=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#we.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("contextmenu",ot,{signal:r});const a=this.x,o=this.y,l=this.width,c=this.height,h=this.parent.div.style.cursor,d=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const u=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=h,this.div.style.cursor=d,this.#xe(a,o,l,c)};window.addEventListener("pointerup",u,{signal:r}),window.addEventListener("blur",u,{signal:r})}#xe(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})}#we(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=kt.MIN_SIZE/i,c=kt.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=this.#be(this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=this.#be(360-this.rotation);let f,m,g=!1,b=!1;switch(t){case"topLeft":g=!0,f=(t,e)=>
1[0,0],m=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],m=(t,e)=>[t/2,e];break;case"topRight":g=!0,f=(t,e)=>[t,0],m=(t,e)=>[0,e];break;case"middleRight":b=!0,f=(t,e)=>[t,e/2],m=(t,e)=>[0,e/2];break;case"bottomRight":g=!0,f=(t,e)=>[t,e],m=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],m=(t,e)=>[t/2,0];break;case"bottomLeft":g=!0,f=(t,e)=>[0,e],m=(t,e)=>[t,0];break;case"middleLeft":b=!0,f=(t,e)=>[0,e/2],m=(t,e)=>[t,e/2]}const v=f(a,o),y=m(a,o);let w=u(...y);const x=h(s+w[0]),_=h(r+w[1]);let A=1,C=1,[S,k]=this.screenToPageTranslation(e.movementX,e.movementY);var E,T;if([S,k]=(E=S/i,T=k/n,[p[0]*E+p[2]*T,p[1]*E+p[3]*T]),g){const t=Math.hypot(a,o);A=C=Math.max(Math.min(Math.hypot(y[0]-v[0]-S,y[1]-v[1]-k)/t,1/a,1/o),l/a,c/o)}else b?A=Math.max(l,Math.min(1,Math.abs(y[0]-v[0]-S)))/a:C=Math.max(c,Math.min(1,Math.abs(y[1]-v[1]-k)))/o;const P=h(a*A),M=h(o*C);w=u(...m(P,M));const R=x-w[0],I=_-w[1];this.width=P,this.height=M,this.x=R,this.y=I,this.setDims(i*P,n*M),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this._editToolbar||this.#ae||(this._editToolbar=new gt(this),this.div.append(this._editToolbar.render()),this.#o&&await this._editToolbar.addAltText(this.#o)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#o?.destroy())}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(St.initialize(kt._l10n),this.#o=new St(this),this.#Yt&&(this.#o.data=this.#Yt,this.#Yt=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}get guessedAltText(){return this.#o?.guessedText}async setGuessedAltText(t){await(this.#o?.setGuessedText(t))}serializeAltText(t){return this.#o?.serialize(t)}hasAltText(){return!!this.#o&&!this.#o.isEmpty()}hasAltTextData(){return this.#o?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#Zt?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#_e();const[t,e]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);const[i,n]=this.getInitialTranslation();return this.translate(i,n),vt(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=$.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#ne=!0,this._isDraggable?this.#Ae(t):this.#Ce(t))}get isSelected(){return this._uiManager.isSelected(this)}#Ce(t){const{isMac:e}=$.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Ae(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();const i=new AbortController,n=this._uiManager.combinedSignal(i);if(e){this.div.classList.add("moving"),this.#ce=t.clientX,this.#he=t.clientY;const e=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-this.#ce,i-this.#he);this.#ce=e,this.#he=i,this._uiManager.dragSelectedEditors(n,s)};window.addEventListener("pointermove",e,{passive:!0,capture:!0,signal:n})}const s=()=>{i.abort(),e&&this.div.classList.remove("moving"),this.#ne=!1,this._uiManager.endDragSession()||this.#Ce(t)};window.addEventListener("pointerup",s,{signal:n}),window.addEventListener("blur",s,{signal:n})}moveInDOM(){this.#le&&clearTimeout(this.#le),this.#le=setTimeout(()=>{this.#le=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e,i=this.rotation){const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#ae=!0}
vendor: 16,363 bytes, line 1
1disableEditMode(){this.#ae=!1}isInEditMode(){return this.#ae}shouldGetKeyboardEvents(){return this.#oe}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#_e(){if(this.#ee||!this.div)return;this.#ee=new AbortController;const t=this._uiManager.combinedSignal(this.#ee);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#_e()}rotate(t){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){T("An editor must be serializable")}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,n.#Yt=t.accessibilityData;const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#ee?.abort(),this.#ee=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#le&&(clearTimeout(this.#le),this.#le=null),this.#fe(),this.removeEditToolbar(),this.#de){for(const t of this.#de.values())clearTimeout(t);this.#de=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#ve(),this.#Qt.classList.remove("hidden"),vt(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#te={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Qt.children;if(!this.#Kt){this.#Kt=Array.from(e);const t=this.#Se.bind(this),i=this.#ke.bind(this),n=this._uiManager._signal;for(const e of this.#Kt){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",this.#Ee.bind(this,s),{signal:n}),e.setAttribute("data-l10n-id",kt._l10nResizer[s])}}const i=this.#Kt[0];let n=0;for(const t of e){if(t===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#Kt.length/4);if(s!==n){if(s<n)for(let t=0;t<n-s;t++)this.#Qt.append(this.#Qt.firstChild);else if(s>n)for(let t=0;t<s-n;t++)this.#Qt.firstChild.before(this.#Qt.lastChild);let t=0;for(const i of e){const e=this.#Kt[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",kt._l10nResizer[e])}}this.#Te(0),this.#oe=!0,this.#Qt.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#Se(t){kt._resizerKeyboardManager.exec(this,t)}#ke(t){this.#oe&&t.relatedTarget?.parentNode!==this.#Qt&&this.#fe()}#Ee(t){this.#ie=this.#oe?t:""}#Te(t){if(this.#Kt)for(const e of this.#Kt)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#oe&&this.#we(this.#ie,{movementX:t,movementY:e})}#fe(){if(this.#oe=!1,this.#Te(-1),this.#te){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#te;this.#xe(t,e,i,n),this.#te=null}}_stopResizingWithKeyboard(){this.#fe(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#o?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}unselect(){this.#Qt?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#o?.toggleAltTextBadge(!0)}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#re}set isEditing(t){this.#re=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#Jt=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#de||=new Map;const{action:e}=t;let i=this.#de.get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#de.delete(e),0===this.#de.size&&(this.#de=null)},kt._telemetryTimeout),void this.#de.set(e,i)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#Zt=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#Zt=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class Et extends kt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Tt=3285377520,Pt=4294901760,Mt=65535;class Rt{constructor(t){this.h1=t?4294967295&t:Tt,this.h2=t?4294967295&t:Tt}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let t=0;t<n;t++)1&t?(a=r[t],a=a*h&Pt|a*u&Mt,a=a<<15|a>>>17,a=a*d&Pt|a*p&Mt,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[t],o=o*h&Pt|o*u&Mt,o=o<<15|o>>>17,o=o*d&Pt|o*p&Mt,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*h&Pt|a*u&Mt,a=a<<15|a>>>17,a=a*d&Pt|a*p&Mt,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&Pt|36045*t&Mt,e=4283543511*e&Pt|(2950163797*(e<<16|t>>>16)&Pt)>>>16,t^=e>>>1,t=444984403*t&Pt|60499*t&Mt,e=3301882366*e&Pt|(3120437893*(e<<16|t>>>16)&Pt)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const It=Object.freeze({map:null,hash:"",transfer:void 0});class Nt{#Pe=!1;#Me=null;#Re=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#Re.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Re.get(t)}remove(t){if(this.#Re.delete(t),0===this.#Re.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#Re.values())if(t instanceof kt)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#Re.get(t);let n=!1;if(void 0!==i)for(const[t,s]of Object.entries(e))i[t]!==s&&(n=!0,i[t]=s);else n=!0,this.#Re.set(t,e);n&&this.#Ie(),e instanceof kt&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#Re.has(t)}getAll(){return this.#Re.size>0?U(this.#Re):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#Re.size}#Ie(){this.#Pe||(this.#Pe=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Pe&&(this.#Pe=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Dt(this)}get serializable(){if(0===this.#Re.size)return It;const t=new Map,e=new Rt,i=[],n=Object.create(null);let s=!1;for(const[i,r]of this.#Re){const a=r instanceof kt?r.serialize(!1,n):r;a&&(t.set(i,a),e.update(`${i}:${JSON.stringify(a)}`),s||=!!a.bitmap)}if(s)for(const e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:It}get editorStats(){let t=null;const e=new Map;for(const i of this.#Re.values()){if(!(i instanceof kt))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const r=t[s]||=new Map;for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=r.get(t);i||(i=new Map,r.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#Me=null}get modifiedIds(){if(this.#Me)return this.#Me;const t=[];for(const e of this.#Re.values())e instanceof kt&&e.annotationElementId&&e.serialize()&&t.push(e.annotationElementId);return this.#Me={ids:new Set(t),hash:t.join(",")}}}class Dt extends Nt{#Ne;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);this.#Ne={map:s,hash:i,transfer:n}}get print(){T("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Ne}get modifiedIds(){return R(this,"modifiedIds",{ids:new Set,hash:""})}}class Lt{#De=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#De.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:e}){if(t&&!this.#De.has(t.loadedName)){if(P(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:n,style:s}=t,r=new FontFace(i,n,s);this.addNativeFontFace(r);try{await r.load(),this.#De.add(i),e?.(t)}catch{E(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}return}T("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw E(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){return R(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return(d||"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),R(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(P(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return R(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f=`@font-face {font-family:"${c}";src:url(data:font/opentype;base64,${btoa(h)});}`;this.insertRule(f);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const e of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,m.append(t)}this._document.body.append(m),function t(e,i){if(++l>30)return E("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(c,()=>{m.remove(),e.complete()})}}class Ft{constructor(t,{disableFontFace:e=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.disableFontFace=!0===e,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${e=this.data,Uint8Array.prototype.toBase64?e.toBase64():btoa(B(e))});`;var e;let i;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){E(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let t=0,e=i.length;t<e;)switch(i[t++]){case 0:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push(t=>t.bezierCurveTo(e,s,r,a,o,l)),t+=6}break;case 1:{const[e,s]=i.slice(t,t+2);n.push(t=>t.moveTo(e,s)),t+=2}break;case 2:{const[e,s]=i.slice(t,t+2);n.push(t=>t.lineTo(e,s)),t+=2}break;case 3:{const[e,s,r,a]=i.slice(t,t+4);n.push(t=>t.quadraticCurveTo(e,s,r,a)),t+=4}break;case 4:n.push(t=>
1t.restore());break;case 5:n.push(t=>t.save());break;case 6:P(2===n.length,"Scale command is only valid at the third position.");break;case 7:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push(t=>t.transform(e,s,r,a,o,l)),t+=6}break;case 8:{const[e,s]=i.slice(t,t+2);n.push(t=>t.translate(e,s)),t+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let e=2,i=n.length;e<i;e++)n[e](t)}}}class Ot{#Le=!1;constructor({enableHWA:t=!1}){this.#Le=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#Le})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){T("Abstract method `_createCanvas` called.")}}class zt{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){T("Abstract method `_fetch` called.")}}class jt extends zt{async _fetch(t){const e=await J(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):H(e)}}class Bt{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(t=!1){}}class Ht{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){T("Abstract method `_fetch` called.")}}class Ut extends Ht{async _fetch(t){const e=await J(t,"arraybuffer");return new Uint8Array(e)}}if(d){var $t=Promise.withResolvers(),Wt=null;(async()=>{const t=await import("fs"),e=await import("http"),i=await import("https"),n=await import("url");return new Map(Object.entries({fs:t,http:e,https:i,url:n,canvas:void 0,path2d:void 0}))})().then(t=>{Wt=t,$t.resolve()},t=>{E(`loadPackages: ${t}`),Wt=new Map,$t.resolve()})}class Vt{static get promise(){return $t.promise}static get(t){return Wt?.get(t)}}async function Gt(t){const e=Vt.get("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}const qt="Fill",Xt="Stroke",Yt="Shading";function Kt(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Zt{getPattern(){T("Abstract method `getPattern` called.")}}class Jt extends Zt{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,n){let s;if(n===Xt||n===qt){const r=e.current.getClippedPathBoundingBox(n,ut(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=V.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Kt(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Kt(t,this._bbox),s=this._createGradient(t);return s}}
vendor: 5,263 bytes, line 1
1function Qt(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,m=(l[n]+e.offsetX)*e.scaleX,g=(l[n+1]+e.offsetY)*e.scaleY,b=(l[s]+e.offsetX)*e.scaleX,v=(l[s+1]+e.offsetY)*e.scaleY;if(f>=v)return;const y=c[r],w=c[r+1],x=c[r+2],_=c[a],A=c[a+1],C=c[a+2],S=c[o],k=c[o+1],E=c[o+2],T=Math.round(f),P=Math.round(v);let M,R,I,N,D,L,F,O;for(let t=T;t<=P;t++){if(t<g){const e=t<f?0:(f-t)/(f-g);M=p-(p-m)*e,R=y-(y-_)*e,I=w-(w-A)*e,N=x-(x-C)*e}else{let e;e=t>v?1:g===v?0:(g-t)/(g-v),M=m-(m-b)*e,R=_-(_-S)*e,I=A-(A-k)*e,N=C-(C-E)*e}let e;e=t<f?0:t>v?1:(f-t)/(f-v),D=p-(p-b)*e,L=y-(y-S)*e,F=w-(w-k)*e,O=x-(x-E)*e;const i=Math.round(Math.min(M,D)),n=Math.round(Math.max(M,D));let s=d*t+4*i;for(let t=i;t<=n;t++)e=(M-t)/(M-D),e<0?e=0:e>1&&(e=1),h[s++]=R-(R-L)*e|0,h[s++]=I-(I-F)*e|0,h[s++]=N-(N-O)*e|0,h[s++]=255}}function te(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)Qt(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Qt(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)Qt(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class ee extends Zt{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p),m=f.context,g=m.createImageData(o,l);if(e){const t=g.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const t of this._figures)te(g,t,d);return m.putImageData(g,2,2),{canvas:f.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}getPattern(t,e,i,n){let s;if(Kt(t,this._bbox),n===Yt)s=V.singularValueDecompose2dScale(ut(t));else if(s=V.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=V.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Yt?null:this._background,e.cachedCanvases);return n!==Yt&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class ie extends Zt{getPattern(){return"hotpink"}}class ne{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const{bbox:e,operatorList:i,paintType:n,tilingType:s,color:r,canvasGraphicsFactory:a}=this;let{xstep:o,ystep:l}=this;o=Math.abs(o),l=Math.abs(l),k("TilingType: "+s);const c=e[0],h=e[1],d=e[2],u=e[3],p=d-c,f=u-h,m=V.singularValueDecompose2dScale(this.matrix),g=V.singularValueDecompose2dScale(this.baseTransform),b=m[0]*g[0],v=m[1]*g[1];let y=p,w=f,x=!1,_=!1;const A=Math.ceil(o*b),C=Math.ceil(l*v);A>=Math.ceil(p*b)?y=o:x=!0,C>=Math.ceil(f*v)?w=l:_=!0;const S=this.getSizeAndScale(y,this.ctx.canvas.width,b),E=this.getSizeAndScale(w,this.ctx.canvas.height,v),T=t.cachedCanvases.getCanvas("pattern",S.size,E.size),P=T.context,M=a.createCanvasGraphics(P);if(M.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(M,n,r),P.translate(-S.scale*c,-E.scale*h),M.transform(S.scale,0,0,E.scale,0,0),P.save(),this.clipBbox(M,c,h,d,u),M.baseTransform=ut(M.ctx),M.executeOperatorList(i),M.endDrawing(),P.restore(),x||_){const e=T.canvas;x&&(y=o),_&&(w=l);const i=this.getSizeAndScale(y,this.ctx.canvas.width,b),n=this.getSizeAndScale(w,this.ctx.canvas.height,v),s=i.size,r=n.size,a=t.cachedCanvases.getCanvas("pattern-workaround",s,r),d=a.context,u=x?Math.floor(p/o):0,m=_?Math.floor(f/l):0;for(let t=0;t<=u;t++)for(let i=0;i<=m;i++)d.drawImage(e,s*t,r*i,s,r,0,0,s,r);return{canvas:a.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:c,offsetY:h}}return{canvas:T.canvas,scaleX:S.scale,scaleY:E.scale,offsetX:c,offsetY:h}}getSizeAndScale(t,e,i){const n=Math.max(ne.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),t.current.updateRectMinMax(ut(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case 1:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case 2:const r=V.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new z(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Yt&&(s=V.transform(s,e.baseTransform),this.matrix&&(s=V.transform(s,this.matrix
1)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}}function se({src:t,srcPos:e=0,dest:i,width:n,height:s,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const o=$.isLittleEndian?4278190080:255,[l,c]=a?[r,o]:[o,r],h=n>>3,d=7&n,u=t.length;i=new Uint32Array(i.buffer);let p=0;for(let n=0;n<s;n++){for(const n=e+h;e<n;e++){const n=e<u?t[e]:255;i[p++]=128&n?c:l,i[p++]=64&n?c:l,i[p++]=32&n?c:l,i[p++]=16&n?c:l,i[p++]=8&n?c:l,i[p++]=4&n?c:l,i[p++]=2&n?c:l,i[p++]=1&n?c:l}if(0===d)continue;const n=e<u?t[e++]:255;for(let t=0;t<d;t++)i[p++]=n&1<<7-t?c:l}return{srcPos:e,destPos:p}}const re=16;class ae{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function oe(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,f,m]=ut(t);if(0===d&&0===u){const g=a*h+f,b=Math.round(g),v=o*p+m,y=Math.round(v),w=(a+l)*h+f,x=Math.abs(Math.round(w)-b)||1,_=(o+c)*p+m,A=Math.abs(Math.round(_)-y)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),b,y),t.drawImage(e,i,n,s,r,0,0,x,A),t.setTransform(h,d,u,p,f,m),[x,A]}if(0===h&&0===p){const g=o*u+f,b=Math.round(g),v=a*d+m,y=Math.round(v),w=(o+c)*u+f,x=Math.abs(Math.round(w)-b)||1,_=(a+l)*d+m,A=Math.abs(Math.round(_)-y)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,b,y),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(h,d,u,p,f,m),[A,x]}return t.drawImage(e,i,n,s,r,a,o,l,c),[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class le{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=u,this.textMatrixScale=1,this.fontMatrix=p,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=0,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=V.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=V.applyTransform(e,t),n=V.applyTransform(e.slice(2),t),s=V.applyTransform([e[0],e[3]],t),r=V.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){V.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,c){const h=V.bezierBoundingBox(e,i,n,s,r,a,o,l,c);c||this.updateRectMinMax(t,h)}getPathBoundingBox(t=qt,e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Xt){e||T("Stroke bounding box must include transform.");const t=V.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=V.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=qt,e=null){return V.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function ce(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%re,r=(i-s)/re,a=0===s?r:r+1,o=t.createImageData(n,re);let l,c=0;const h=e.data,d=o.data;let u,p,f,m;if(e.kind===y.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),m=i.length,g=n+7>>3,b=4294967295,v=$.isLittleEndian?4278190080:255;for(u=0;
vendor: 9,530 bytes, line 1
1u<a;u++){for(f=u<r?re:s,l=0,p=0;p<f;p++){const t=e-c;let s=0;const r=t>g?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=h[c++],i[l++]=128&d?b:v,i[l++]=64&d?b:v,i[l++]=32&d?b:v,i[l++]=16&d?b:v,i[l++]=8&d?b:v,i[l++]=4&d?b:v,i[l++]=2&d?b:v,i[l++]=1&d?b:v;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?b:v,o>>=1}for(;l<m;)i[l++]=0;t.putImageData(o,0,u*re)}}else if(e.kind===y.RGBA_32BPP){for(p=0,m=n*re*4,u=0;u<r;u++)d.set(h.subarray(c,c+m)),c+=m,t.putImageData(o,0,p),p+=re;u<a&&(m=n*s*4,d.set(h.subarray(c,c+m)),t.putImageData(o,0,p))}else{if(e.kind!==y.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(f=re,m=n*f,u=0;u<a;u++){for(u>=r&&(f=s,m=n*f),l=0,p=m;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*re)}}}function he(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%re,r=(i-s)/re,a=0===s?r:r+1,o=t.createImageData(n,re);let l=0;const c=e.data,h=o.data;for(let e=0;e<a;e++){const i=e<r?re:s;({srcPos:l}=se({src:c,srcPos:l,dest:h,width:n,height:i,nonBlackColor:0})),t.putImageData(o,0,e*re)}}function de(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function ue(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!d){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function pe(t,e){if(e)return!0;const i=V.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Z.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const fe=["butt","round","square"],me=["miter","round","bevel"],ge={},be={};class ve{constructor(t,e,i,n,s,{optionalContentConfig:r,markedContentStack:a=null},o,l){this.ctx=t,this.current=new le(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=r,this.cachedCanvases=new ae(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const s=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,r),this.ctx.fillStyle=a,i){const t=this.cachedCanvases.getCanvas("transparent",s,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...ut(this.compositeCtx))}this.ctx.save(),ue(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=ut(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"==typeof i,c=l?Date.now()+15:0;let h=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==x.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++h>10){if(Date.now()>c)return i(),a;h=0}}}#Fe(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Fe(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#Oe()}#Oe(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=n,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,i=c;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=ut(e);let o,l,c,h;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r)return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])};c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),he(h.context,t));let d=V.transform(a,[1/i,0,0,-1/n,0,0]);d=V.transform(d,[1,0,0,1,0,-n]);const[u,p,f,m]=V.getAxialAlignedBoundingBox([0,0,i,n],d),g=Math.round(f-u)||1,b=Math.round(m-p)||1,v=this.cachedCanvases.getCanvas("fillCanvas",g,b),y=v.context,w=u,x=p;y.translate(-w,-x),y.transform(...d),c||(c=this._scaleImage(h.canvas,pt(y)),c=c.img,o&&r&&o.set(l,c)),y.imageSmoothingEnabled=pe(ut(y),t.interpolate),oe(y,c,0,0,c.width,c.height,0,0,i,n),y.globalCompositeOperation="source-in";const _=V.transform(pt(y),[1,0,0,1,-w,-x]);return y.fillStyle=r?s.getPattern(e,this,_,qt):s,y.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,v.canvas)),{canvas:v.canvas,offsetX:Math.round(w),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=fe[t]}setLineJoin(t){this.ctx.lineJoin=me[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...ut(this.suspendedCtx)),de(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()}
1,t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),de(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0!==a&&0!==o&&(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,c,h){let d=t.canvas,u=o-c,p=l-h;if(r){const e=V.makeHexColor(...r);if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),s=t.context;s.drawImage(d,-u,-p),s.globalCompositeOperation="destination-atop",s.fillStyle=e,s.fillRect(0,0,i,n),s.globalCompositeOperation="source-over",d=t.canvas,u=p=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const s=new Path2D;s.rect(u,p,i,n),t.clip(s),t.globalCompositeOperation="destination-atop",t.fillStyle=e,t.fillRect(u,p,i,n),t.restore()}}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(de(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),de(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const c=ut(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let i=0,u=0,p=t.length;i<p;i++)switch(0|t[i]){case x.rectangle:o=e[u++],l=e[u++];const t=e[u++],i=e[u++],p=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(p,f):(n.lineTo(p,l),n.lineTo(p,f),n.lineTo(o,f)),h||s.updateRectMinMax(c,[o,l,p,f]),n.closePath();break;case x.moveTo:o=e[u++],l=e[u++],n.moveTo(o,l),h||s.updatePathMinMax(c,o,l);break;case x.lineTo:o=e[u++],l=e[u++],n.lineTo(o,l),h||s.updatePathMinMax(c,o,l);break;case x.curveTo:r=o,a=l,o=e[u+4],l=e[u+5],n.bezierCurveTo(e[u],e[u+1],e[u+2],e[u+3],o,l),s.updateCurvePathMinMax(c,r,a,e[u],e[u+1],e[u+2],e[u+3],o,l,d),u+=6;break;case x.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[u],e[u+1],e[u+2],e[u+3]),s.updateCurvePathMinMax(c,r,a,o,l,e[u],e[u+1],e[u+2],e[u+3],d),o=e[u+2],l=e[u+3],u+=4;break;case x.curveTo3:r=o,a=l,o=e[u+2],l=e[u+3],n.bezierCurveTo(e[u],e[u+1],o,l,o,l),s.updateCurvePathMinMax(c,r,a,e[u],e[u+1],o,l,o,l,d),u+=4;break;case x.closePath:n.closePath()}h&&s.updateScalingPathMinMax(c,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,pt(e),Xt),this.rescaleAndStroke(!1),e.restore(
1)):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,pt(e),qt),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=ge}eoClip(){this.pendingClip=be}beginText(){this.current.textMatrix=u,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||p,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||E("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const s=i.loadedName||"sans-serif",r=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const o=i.italic?"italic":"normal";let l=e;e<16?l=16:e>100&&(l=100),this.current.fontSizeScale=e/l,this.ctx.font=`${o} ${a} ${l}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,c=3&o,h=!!(4&o),d=r.patternFill&&!a.missingFile;let u;(a.disableFontFace||h||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),0!==c&&2!==c||s.fill(),1!==c&&2!==c||s.stroke(),s.restore()):(0!==c&&2!==c||s.fillText(t,e,i),1!==c&&2!==c||s.strokeText(t,e,i)),h&&(this.pendingTextPaths||=[]).push({transform:ut(s),x:e,y:i,fontSize:l,addToPath:u})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return R(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],m=0===e.textRenderingMode&&!i.disableFontFace&&!e.patternFill;let g;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,pt(s),qt);g=ut(s),s.restore(),s.fillStyle=t}let b=e.lineWidth;const v=e.textMatrixScale;if(0===v||0===b){const t=3&e.textRenderingMode;1!==t&&2!==t||(b=this.getSinglePixelWidth())}else b/=v;if(1!==r&&(s.scale(r,r),b/=r),s.lineWidth=b,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;
1return s.fillText(i.join(""),0,0),e.x+=n*f*c,s.restore(),void this.compose()}let y,w=0;for(y=0;y<h;++y){const e=t[y];if("number"==typeof e){w+=u*e*n/1e3;continue}let c=!1;const h=(e.isSpace?o:0)+a,b=e.fontChar,v=e.accent;let x,_,A=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*A)*f,n=t[2]*f;A=t?-t[0]:A,x=i/r,_=(w+n)/r}else x=w/r,_=0;if(i.remeasure&&A>0){const t=1e3*s.measureText(b).width/n*r;if(A<t&&this.isFontSubpixelAAEnabled){const e=A/t;c=!0,s.save(),s.scale(e,1),x/=e}else A!==t&&(x+=(A-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(m&&!v)s.fillText(b,x,_);else if(this.paintChar(b,x,_,g),v){const t=x+n*v.offset.x/r,e=_-n*v.offset.y/r;this.paintChar(v.fontChar,t,e,g)}w+=d?A*f-h*l:A*f+h*l,c&&s.restore()}d?e.y-=w:e.x+=w*c,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,c=i.textHScale*r,h=i.fontMatrix||p,d=t.length;let u,f,m,g;if(3!==i.textRenderingMode&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,r),u=0;u<d;++u){if(f=t[u],"number"==typeof f){g=a*f*s/1e3,this.ctx.translate(g,0),i.x+=g*c;continue}const r=(f.isSpace?l:0)+o,d=n.charProcOperatorList[f.operatorListId];d?(this.contentVisible&&(this.processingType3=f,this.save(),e.scale(s,s),e.transform(...h),this.executeOperatorList(d),this.restore()),m=V.applyTransform([f.width,0],h)[0]*s+r,e.translate(m,0),i.x+=m*c):E(`Type3 character "${f.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}
1setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||ut(this.ctx),s={createCanvasGraphics:t=>new ve(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new ne(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){this.ctx.strokeStyle=this.current.strokeColor=V.makeHexColor(t,e,i)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(t,e,i){this.ctx.fillStyle=this.current.fillColor=V.makeHexColor(t,e,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function(t){switch(t[0]){case"RadialAxial":return new Jt(t);case"Mesh":return new ee(t);case"Dummy":return new ie}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,pt(e),Yt);const n=pt(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=V.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){T("Should not call beginInlineImage")}beginImageData(){T("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=ut(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(ut(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||k("TODO: Support non-isolated groups."),t.knockout&&E("Knockout groups not supported.");const i=ut(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=V.getAxialAlignedBoundingBox(t.bbox,ut(e));const s=[0,0,e.canvas.width,e.canvas.height];n=V.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),de(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=ut(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=V.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(this.#Fe(),ue(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=V.singularValueDecompose2dScale(ut(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,
10,0,-a,0,r*a),ue(this.ctx)}else ue(this.ctx),this.endPath(),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.ctx.beginPath()}this.current=new le(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Oe(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const e of t.data){let t=128;for(;t>0;)h[d++]=e&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[a]=h[d]?2:1,++u),d++;for(0!==h[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*c,o=r*s,h[d-c]!==h[d]&&(l[o]=h[d]?1:8,++u);let t=(h[d]?4:0)+(h[d-c]?8:0);for(a=1;a<e;a++)t=(t>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+a]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=r*s,0!==h[d]&&(l[o]=8,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[o+a]=h[d]?4:8,++u),d++;if(0!==h[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,s,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=ut(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let t=0,c=r.length;t<c;t+=2){const c=V.transform(o,[e,i,n,s,r[t],r[t+1]]),[h,d]=V.applyTransform([0,0],c);a.drawImage(l.canvas,h,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),c=l.context;c.save(),he(c,this.getObject(t,s)),c.globalCompositeOperation="source-in",c.fillStyle=n?i.getPattern(c,this,pt(e),qt):i,c.fillRect(0,0,r,a),c.restore(),e.save(),e.transform(...o),e.scale(1,-1),oe(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):E("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void E("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let t=0,s=n.length;t<s;t+=2)o.push({transform:[e,0,0,i,n[t],n[t+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!d){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;ce(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,pt(n));n.imageSmoothingEnabled=pe(ut(n),t.interpolate),oe(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.compose(),this.restore(
1)}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;ce(s,t),n=this.applyTransferMapsToCanvas(s)}for(const t of e)i.save(),i.transform(...t.transform),i.scale(1,-1),oe(i,n,t.x,t.y,t.w,t.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===be?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=ut(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map(e=>e/t)),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in x)void 0!==ve.prototype[t]&&(ve.prototype[x[t]]=ve.prototype[t]);class ye{static#ze=null;static#je="";static get workerPort(){return this.#ze}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#ze=t}static get workerSrc(){return this.#je}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#je=t}}function we(t){switch(t instanceof Error||"object"==typeof t&&null!==t||T('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new j(t.message);case"MissingPDFException":return new F(t.message);case"PasswordException":return new N(t.message,t.code);case"UnexpectedResponseException":return new O(t.message,t.status);case"UnknownErrorException":return new D(t.message,t.details);default:return new D(t.message,t.toString())}}class xe{#Be=new AbortController;constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,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),i.addEventListener("message",this.#He.bind(this),{signal:this.#Be.signal})}#He({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#Ue(t);if(t.callback){const e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)i.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");i.reject(we(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,n=t.sourceName,s=this.comObj;return void new Promise(function(i){i(e(t.data))}).then(function(e){s.postMessage({sourceName:i,targetName:n,callback:1,callbackId:t.callbackId,data:e})},function(e){s.postMessage({sourceName:i,targetName:n,callback:2,callbackId:t.callbackId,reason:we(e)})})}t.streamId?this.#$e(t):e(t.data)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}
vendor: 18,755 bytes, line 1
1sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:6,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{P(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:1,streamId:s,reason:we(t)}),e.promise}},i)}#$e(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t,r=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:4,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:3,streamId:e}),delete r.streamSinks[e])},error(t){P(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:5,streamId:e,reason:we(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise(function(e){e(a(t.data,o))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:8,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:8,streamId:e,reason:we(t)})})}#Ue(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case 8:t.success?r.startCall.resolve():r.startCall.reject(we(t.reason));break;case 7:t.success?r.pullCall.resolve():r.pullCall.reject(we(t.reason));break;case 6:if(!a){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(t){t(a.onPull?.())}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,reason:we(t)})});break;case 4:if(P(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case 3:if(P(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#We(r,e);break;case 5:P(r,"error should have stream controller"),r.controller.error(we(t.reason)),this.#We(r,e);break;case 2:t.success?r.cancelCall.resolve():r.cancelCall.reject(we(t.reason)),this.#We(r,e);break;case 1:if(!a)break;new Promise(function(e){e(a.onCancel?.(we(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:2,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:2,streamId:e,reason:we(t)})}),a.sinkCapability.reject(we(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#We(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#Be?.abort(),this.#Be=null}}class _e{#Ve;#Ge;constructor({parsedData:t,rawData:e}){this.#Ve=t,this.#Ge=e}getRaw(){return this.#Ge}get(t){return this.#Ve.get(t)??null}getAll(){return U(this.#Ve)}has(t){return this.#Ve.has(t)}}const Ae=Symbol("INTERNAL");class Ce{#qe=!1;#Xe=!1;#Ye=!1;#Ke=!0;constructor(t,{name:e,intent:i,usage:n,rbGroups:s}){this.#qe=!!(2&t),this.#Xe=!!(4&t),this.name=e,this.intent=i,this.usage=n,this.rbGroups=s}get visible(){if(this.#Ye)return this.#Ke;if(!this.#Ke)return!1;const{print:t,view:e}=this.usage;return this.#qe?"OFF"!==e?.viewState:!this.#Xe||"OFF"!==t?.printState}_setVisible(t,e,i=!1){t!==Ae&&T("Internal method `_setVisible` called."),this.#Ye=i,this.#Ke=e}}class Se{#Ze=null;#Je=new Map;#Qe=null;#ti=null;constructor(t,e=2){if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#ti=t.order;for(const i of t.groups)this.#Je.set(i.id,new Ce(e,i));if("OFF"===t.baseState)for(const t of this.#Je.values())t._setVisible(Ae,!1);for(const e of t.on)this.#Je.get(e)._setVisible(Ae,!0);for(const e of t.off)this.#Je.get(e)._setVisible(Ae,!1);this.#Qe=this.getHash()}}#ei(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=this.#ei(e);else{if(!this.#Je.has(e))return E(`Optional content group not found: ${e}`),!0;s=this.#Je.get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}isVisible(t){if(0===this.#Je.size)return!0;if(!t)return k("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Je.has(t.id)?this.#Je.get(t.id).visible:(E(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#ei(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Je.has(e))return E(`Optional content group not found: ${e}`),!0;if(this.#Je.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Je.has(e))return E(`Optional content group not found: ${e}`),!0;if(!this.#Je.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Je.has(e))return E(`Optional content group not found: ${e}`),!0;if(!this.#Je.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Je.has(e))return E(`Optional content group not found: ${e}`),!0;if(this.#Je.get(e).visible)return!1}return!0}return E(`Unknown optional content policy ${t.policy}.`),!0}return E(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,i=!0){const n=this.#Je.get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e)i!==t&&this.#Je.get(i)?._setVisible(Ae,!1,!0);n._setVisible(Ae,!!e,!0),this.#Ze=null}else E(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let i;for(const n of t){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const t=this.#Je.get(n);if(t)switch(i){case"ON":this.setVisibility(n,!0,e);break;case"OFF":this.setVisibility(n,!1,e);break;case"Toggle":this.setVisibility(n,!t.visible,e)}}this.#Ze=null}get hasInitialVisibility(){return null===this.#Qe||this.getHash()===this.#Qe}getOrder(){return this.#Je.size?this.#ti?this.#ti.slice():[...this.#Je.keys()]:null}getGroups(){return this.#Je.size>0?U(this.#Je):null}getGroup(t){return this.#Je.get(t)||null}getHash(){if(null!==this.#Ze)return this.#Ze;const t=new Rt;for(const[e,i]of this.#Je)t.update(`${e}:${i.visible}`);return this.#Ze=t.hexdigest()}}class ke{constructor(t,{disableRange:e=!1,disableStream:i=!1}){P(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:s,progressiveDone:r,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=a,s?.length>0){const t=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i):P(this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){P(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Ee(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Te(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Ee{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=it(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){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 Te{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.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 t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Pe(t,e){const i=new Headers;if(!t||!e||"object"!=typeof e)return i;for(const t in e){const n=e[t];void 0!==n&&i.append(t,n)}return i}function Me({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const s={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(t.get("Content-Length"),10);return Number.isInteger(r)?(s.suggestedLength=r,r<=2*i||n||!e||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(s.allowRangeRequests=!0),s):s}function Re(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let t=0;t<e.length&&t in e;++t){let[i,n]=e[t];n=a(n),i&&(n=unescape(n),0===t&&(n=o(n))),r.push(n)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=H(i);i=n.decode(s),e=!1}catch{}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{n=atob(n)}catch{}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(it(t))return t}return null}function Ie(t,e){return 404===t||0===t&&e.startsWith("file:")?new F('Missing PDF "'+e+'".'):new O(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Ne(t){return 200===t||206===t}function De(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Le(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(E(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class Fe{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=Pe(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return P(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Oe(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new ze(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Oe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),n=e.url;fetch(n,De(i,this._withCredentials,this._abortController)).then(e=>{if(!Ne(e.status))throw Ie(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:s,suggestedLength:r}=Me({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=r||this._contentLength,this._filename=Re(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new j("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Le(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class ze{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const s=new Headers(t.headers);s.append("Range",`bytes=${e}-${i-1}`);const r=n.url;fetch(r,De(s,this._withCredentials,this._abortController)).then(t=>{if(!Ne(t.status))throw Ie(t.status,r);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Le(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class je{constructor({url:t,httpHeaders:e,withCredentials:i}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=Pe(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const t in i)n[t]=i[t];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[t,i]of this.headers)e.setRequestHeader(t,i);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>
1=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError?.(n.status);const s=n.status||200;if((200!==s||206!==i.expectedStatus)&&s!==i.expectedStatus)return void i.onError?.(n.status);const r=function(t){const e=t.response;return"string"!=typeof e?e:H(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:r})}else r?i.onDone({begin:0,chunk:r}):i.onError?.(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Be{constructor(t){this._source=t,this._manager=new je(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return P(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new He(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Ue(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class He{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.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 t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=new Headers(e.getAllResponseHeaders().trim().split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]})),{allowRangeRequests:n,suggestedLength:s}=Me({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Re(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Ie(t,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.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._headersCapability.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);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}}
1class Ue{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Ie(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){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()}}const $e=/^[a-z][a-z0-9\-+.]+:/i;function We(t,e,i){return"http:"===t.protocol?Vt.get("http").request(t,{headers:e},i):Vt.get("https").request(t,{headers:e},i)}class Ve{constructor(t){this.source=t,this.url=function(t){if($e.test(t))return new URL(t);const e=Vt.get("url");return new URL(e.pathToFileURL(t))}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.headers=Pe(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return P(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Ke(this):new Xe(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Ze(this,t,e):new Ye(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Ge{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new j("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class qe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class Xe extends Ge{constructor(t){super(t);const e=Object.fromEntries(t.headers);this._request=We(this._url,e,e=>{if(404===e.statusCode){const t=new F(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=new Headers(this._readableStream.headers),{allowRangeRequests:n,suggestedLength:s}=Me({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Re(i)}),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class Ye extends qe{constructor(t,e,i){super(t);const n=Object.fromEntries(t.headers);n.Range=`bytes=${e}-${i-1}`,this._request=We(this._url,n,t=>{if(404===t.statusCode){const t=new F(`Missing PDF "${this._url}".`);return void(this._storedError=t)}this._setReadableStream(t)}),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class Ke extends Ge{constructor(t){super(t);const e=Vt.get("fs");e.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(e.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=new F(`Missing PDF "${this._url}".`)),this._storedError=t,this._headersCapability.reject(t)})}}class Ze extends qe{constructor(t,e,i){super(t);const n=Vt.get("fs");this._setReadableStream(n.createReadStream(this._url,{start:e,end:i-1}))}}const Je=30;
vendor: 6,564 bytes, line 1
1class Qe{#ii=Promise.withResolvers();#ut=null;#ni=!1;#si=!!globalThis.FontInspector?.enabled;#ri=null;#ai=null;#oi=0;#li=0;#ci=null;#hi=null;#di=0;#ui=0;#pi=Object.create(null);#fi=[];#mi=null;#gi=[];#bi=new WeakMap;#vi=null;static#yi=new Map;static#wi=new Map;static#xi=new WeakMap;static#_i=null;static#Ai=new Set;constructor({textContentSource:t,container:e,viewport:i}){if(t instanceof ReadableStream)this.#mi=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#mi=new ReadableStream({start(e){e.enqueue(t),e.close()}})}this.#ut=this.#hi=e,this.#ui=i.scale*(globalThis.devicePixelRatio||1),this.#di=i.rotation,this.#ai={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:s,pageX:r,pageY:a}=i.rawDims;this.#vi=[1,0,0,-1,-r,a+s],this.#li=n,this.#oi=s,Qe.#Ci(),ft(e,i),this.#ii.promise.finally(()=>{Qe.#Ai.delete(this),this.#ai=null,this.#pi=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=$.platform;return R(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#ci.read().then(({value:e,done:i})=>{i?this.#ii.resolve():(this.#ri??=e.lang,Object.assign(this.#pi,e.styles),this.#Si(e.items),t())},this.#ii.reject)};return this.#ci=this.#mi.getReader(),Qe.#Ai.add(this),t(),this.#ii.promise}update({viewport:t,onBefore:e=null}){const i=t.scale*(globalThis.devicePixelRatio||1),n=t.rotation;if(n!==this.#di&&(e?.(),this.#di=n,ft(this.#hi,{rotation:n})),i!==this.#ui){e?.(),this.#ui=i;const t={div:null,properties:null,ctx:Qe.#ki(this.#ri)};for(const e of this.#gi)t.properties=this.#bi.get(e),t.div=e,this.#Ei(t)}}cancel(){const t=new j("TextLayer task cancelled.");this.#ci?.cancel(t).catch(()=>{}),this.#ci=null,this.#ii.reject(t)}get textDivs(){return this.#gi}get textContentItemsStr(){return this.#fi}#Si(t){if(this.#ni)return;this.#ai.ctx??=Qe.#ki(this.#ri);const e=this.#gi,i=this.#fi;for(const n of t){if(e.length>1e5)return E("Ignoring additional textDivs for performance reasons."),void(this.#ni=!0);if(void 0!==n.str)i.push(n.str),this.#Ti(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#ut;this.#ut=document.createElement("span"),this.#ut.classList.add("markedContent"),null!==n.id&&this.#ut.setAttribute("id",`${n.id}`),t.append(this.#ut)}else"endMarkedContent"===n.type&&(this.#ut=this.#ut.parentNode)}}#Ti(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#gi.push(e);const n=V.transform(this.#vi,t.transform);let s=Math.atan2(n[1],n[0]);const r=this.#pi[t.fontName];r.vertical&&(s+=Math.PI/2);let a=this.#si&&r.fontSubstitution||r.fontFamily;a=Qe.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),l=o*Qe.#Pi(a,this.#ri);let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;this.#ut===this.#hi?(u.left=`${(100*c/this.#li).toFixed(2)}%`,u.top=`${(100*h/this.#oi).toFixed(2)}%`):(u.left=`${d}${c.toFixed(2)}px)`,u.top=`${d}${h.toFixed(2)}px)`),u.fontSize=`${d}${(Qe.#_i*o).toFixed(2)}px)`,u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#si&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),this.#bi.set(e,i),this.#ai.div=e,this.#ai.properties=i,this.#Ei(this.#ai),i.hasText&&this.#ut.append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#ut.append(t)}}#Ei(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let r="";if(Qe.#_i>1&&(r=`scale(${1/Qe.#_i})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:t}=s,{canvasWidth:a,fontSize:o}=i;Qe.#Mi(n,o*this.#ui,t);const{width:l}=n.measureText(e.textContent);l>0&&(r=`scaleX(${a*this.#ui/l}) ${r}`)}0!==i.angle&&(r=`rotate(${i.angle}deg) ${r}`),r.length>0&&(s.transform=r)}static cleanup(){if(!(this.#Ai.size>0)){this.#yi.clear();for(const{canvas:t}of this.#wi.values())t.remove();this.#wi.clear()}}static#ki(t=null){let e=this.#wi.get(t||="");if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#wi.set(t,e),this.#xi.set(e,{size:0,family:""})}return e}static#Mi(t,e,i){const n=this.#xi.get(t);e===n.size&&i===n.family||(t.font=`${e}px ${i}`,n.size=e,n.family=i)}static#Ci(){if(null!==this.#_i)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#_i=t.getBoundingClientRect().height,t.remove()}static#Pi(t,e){const i=this.#yi.get(t);if(i)return i;const n=this.#ki(e);n.canvas.width=n.canvas.height=Je,this.#Mi(n,Je,t);const s=n.measureText("");let r=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(r){const e=r/(r+a);return this.#yi.set(t,e),n.canvas.width=n.canvas.height=0,e}n.strokeStyle="red",n.clearRect(0,0,Je,Je),n.strokeText("g",0,0);let o=n.getImageData(0,0,Je,Je).data;a=0;for(let t=o.length-1-3;t>=0;t-=4)if(o[t]>0){a=Math.ceil(t/4/Je);break}n.clearRect(0,0,Je,Je),n.strokeText("A",0,Je),o=n.getImageData(0,0,Je,Je).data,r=0;for(let t=0,e=o.length;t<e;t+=4)if(o[t]>0){r=Je-Math.floor(t/4/Je);break}n.canvas.width=n.canvas.height=0;const l=r?r/(r+a):.8;return this.#yi.set(t,l),l}}class ti{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){if(!i)return;let n=null;const s=i.name;if("#text"===s)n=i.value;else{if(!ti.shouldBuildText(s))return;i?.attributes?.textContent?n=i.attributes.textContent:i.value&&(n=i.value)}if(null!==n&&e.push({str:n}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const ei=65536,ii=d?class extends Ot{_createCanvas(t,e){return Vt.get("canvas").createCanvas(t,e)}}:class extends Ot{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},ni=d?class extends zt{async _fetch(t){return Gt(t)}}:jt,si=d?class extends Bt{}:class extends Bt{#Ri;#Ii;
vendor: 6,756 bytes, line 1
1#Ni;#Di;#Li;#Fi;#y=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#Di=t,this.#Li=e}get#x(){return this.#Ii||=new Map}get#Oi(){return this.#Fi||=new Map}get#zi(){if(!this.#Ni){const t=this.#Li.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#Li.createElementNS(K,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#Ni=this.#Li.createElementNS(K,"defs"),t.append(i),i.append(this.#Ni),this.#Li.body.append(t)}return this.#Ni}#ji(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,r[t]=i[t]/255,a[t]=n[t]/255;return[s.join(","),r.join(","),a.join(",")]}#Bi(t){if(void 0===this.#Ri){this.#Ri="";const t=this.#Li.URL;t!==this.#Li.baseURI&&(et(t)?E('#createUrl: ignore "data:"-URL for performance reasons.'):this.#Ri=t.split("#",1)[0])}return`url(${this.#Ri}#${t})`}addFilter(t){if(!t)return"none";let e=this.#x.get(t);if(e)return e;const[i,n,s]=this.#ji(t),r=1===t.length?i:`${i}${n}${s}`;if(e=this.#x.get(r),e)return this.#x.set(t,e),e;const a=`g_${this.#Di}_transfer_map_${this.#y++}`,o=this.#Bi(a);this.#x.set(t,o),this.#x.set(r,o);const l=this.#Hi(a);return this.#Ui(i,n,s,l),o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let s=this.#Oi.get(n);if(s?.key===i)return s.url;if(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#Oi.set(n,s)),!t||!e)return s.url;const r=this.#$i(t);t=V.makeHexColor(...r);const a=this.#$i(e);if(e=V.makeHexColor(...a),this.#zi.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;const o=new Array(256);for(let t=0;t<=255;t++){const e=t/255;o[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#Di}_hcm_filter`,h=s.filter=this.#Hi(c);this.#Ui(l,l,l,h),this.#Wi(h);const d=(t,e)=>{const i=r[t]/255,n=a[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=i+t/e*(n-i);return s.join(",")};return this.#Ui(d(0,5),d(1,5),d(2,5),h),s.url=this.#Bi(c),s.url}addAlphaFilter(t){let e=this.#x.get(t);if(e)return e;const[i]=this.#ji([t]),n=`alpha_${i}`;if(e=this.#x.get(n),e)return this.#x.set(t,e),e;const s=`g_${this.#Di}_alpha_map_${this.#y++}`,r=this.#Bi(s);this.#x.set(t,r),this.#x.set(n,r);const a=this.#Hi(s);return this.#Vi(i,a),r}addLuminosityFilter(t){let e,i,n=this.#x.get(t||"luminosity");if(n)return n;if(t?([e]=this.#ji([t]),i=`luminosity_${e}`):i="luminosity",n=this.#x.get(i),n)return this.#x.set(t,n),n;const s=`g_${this.#Di}_luminosity_map_${this.#y++}`,r=this.#Bi(s);this.#x.set(t,r),this.#x.set(i,r);const a=this.#Hi(s);return this.#Gi(a),t&&this.#Vi(e,a),r}addHighlightHCMFilter(t,e,i,n,s){const r=`${e}-${i}-${n}-${s}`;let a=this.#Oi.get(t);if(a?.key===r)return a.url;if(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#Oi.set(t,a)),!e||!i)return a.url;const[o,l]=[e,i].map(this.#$i.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,s].map(this.#$i.bind(this));h<c&&([c,h,d,u]=[h,c,u,d]),this.#zi.style.color="";const p=(t,e,i)=>{const n=new Array(256),s=(h-c)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let t=0;t<=i;t++){const e=Math.round(c+t*s),i=r+t*a;for(let t=o;t<=e;t++)n[t]=i;o=e+1}for(let t=o;t<256;t++)n[t]=n[o-1];return n.join(",")},f=`g_${this.#Di}_hcm_${t}_filter`,m=a.filter=this.#Hi(f);return this.#Wi(m),this.#Ui(p(d[0],u[0],5),p(d[1],u[1],5),p(d[2],u[2],5),m),a.url=this.#Bi(f),a.url}destroy(t=!1){t&&0!==this.#Oi.size||(this.#Ni&&(this.#Ni.parentNode.parentNode.remove(),this.#Ni=null),this.#Ii&&(this.#Ii.clear(),this.#Ii=null),this.#y=0)}#Gi(t){const e=this.#Li.createElementNS(K,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#Wi(t){const e=this.#Li.createElementNS(K,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#Hi(t){const e=this.#Li.createElementNS(K,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#zi.append(e),e}#qi(t,e,i){const n=this.#Li.createElementNS(K,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#Ui(t,e,i,n){const s=this.#Li.createElementNS(K,"feComponentTransfer");n.append(s),this.#qi(s,"feFuncR",t),this.#qi(s,"feFuncG",e),this.#qi(s,"feFuncB",i)}#Vi(t,e){const i=this.#Li.createElementNS(K,"feComponentTransfer");e.append(i),this.#qi(i,"feFuncA",t)}#$i(t){return this.#zi.style.color=t,dt(getComputedStyle(this.#zi).getPropertyValue("color"))}},ri=d?class extends Ht{async _fetch(t){return Gt(t)}}:Ut;function ai(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new li,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(d&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(d&&void 0!==l&&t instanceof l)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return H(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,c=t.range instanceof ci?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:ei;let u=t.worker instanceof pi?t.worker:null;const p=t.verbosity,f="string"!=typeof t.docBaseUrl||et(t.docBaseUrl)?null:t.docBaseUrl,m="string"==typeof t.cMapUrl?t.cMapUrl:null,g=!1!==t.cMapPacked,b=t.CMapReaderFactory||ni,v="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,y=t.StandardFontDataFactory||ri,w=!0!==t.stopAtErrors,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!d,S="boolean"==typeof t.isChrome?t.isChrome:!$.platform.isFirefox&&"undefined"!=typeof window&&!!window?.chrome,k=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,E="boolean"==typeof t.disableFontFace?t.disableFontFace:d,T=!0===t.fontE
1xtraProperties,P=!0===t.enableXfa,M=t.ownerDocument||globalThis.document,R=!0===t.disableRange,I=!0===t.disableStream,N=!0===t.disableAutoFetch,D=!0===t.pdfBug,L=t.CanvasFactory||ii,F=t.FilterFactory||si,O=!0===t.enableHWA,z=c?c.length:t.length??NaN,j="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!d&&!E,B="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:b===jt&&y===Ut&&m&&v&&at(m,document.baseURI)&&at(v,document.baseURI);t.canvasFactory&<("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&<("`filterFactory`-instance option, please use `FilterFactory` instead."),C(p);const U={canvasFactory:new L({ownerDocument:M,enableHWA:O}),filterFactory:new F({docId:i,ownerDocument:M}),cMapReaderFactory:B?null:new b({baseUrl:m,isCompressed:g}),standardFontDataFactory:B?null:new y({baseUrl:v})};if(!u){const t={verbosity:p,port:ye.workerPort};u=t.port?pi.fromPort(t):new pi(t),e._worker=u}const W={docId:i,apiVersion:"4.8.69",data:s,password:o,disableAutoFetch:N,rangeChunkSize:h,length:z,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:x,disableFontFace:E,ignoreErrors:w,isEvalSupported:_,isOffscreenCanvasSupported:A,isChrome:S,canvasMaxAreaInBytes:k,fontExtraProperties:T,useSystemFonts:j,cMapUrl:B?m:null,standardFontDataUrl:B?v:null}},V={disableFontFace:E,fontExtraProperties:T,ownerDocument:M,pdfBug:D,styleElement:null,loadingParams:{disableAutoFetch:N,enableXfa:P}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",W,s?[s.buffer]:null);let o;if(c)o=new ke(c,{disableRange:R,disableStream:I});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");let t;t=d?"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&at(n)?Fe:Ve:at(n)?Fe:Be,o=new t({url:n,length:z,httpHeaders:r,withCredentials:a,rangeChunkSize:h,disableRange:R,disableStream:I})}return t.then(t=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const n=new xe(i,t,u.port),s=new fi(n,e,o,V,U);e._transport=s,n.send("Ready",null)})}).catch(e._capability.reject),e}function oi(t){return"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class li{static#Di=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+li.#Di++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class ci{constructor(t,e,i=!1,n=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){T("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class hi{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return R(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}
vendor: 3,786 bytes, line 1
1=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class di{#Xi=null;#Yi=!1;constructor(t,e,i,n=!1){this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new rt:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new gi,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}={}){return new Q({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return R(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:n=m.ENABLE,transform:s=null,background:r=null,optionalContentConfigPromise:a=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:c=null,isEditing:h=!1}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(i,n,c,h),{renderingIntent:u,cacheKey:p}=d;this.#Yi=!1,this.#Ki(),a||=this._transport.getOptionalContentConfig(u);let f=this._intentStates.get(p);f||(f=Object.create(null),this._intentStates.set(p,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const g=!!(4&u);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const b=t=>{f.renderTasks.delete(v),(this._maybeCleanupAfterRender||g)&&(this.#Yi=!0),this.#Zi(!g),t?(v.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new vi({callback:b,params:{canvasContext:t,viewport:e,transform:s,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:l});(f.renderTasks||=new Set).add(v);const y=v.task;return Promise.all([f.displayReadyCapability.promise,a]).then(([t,e])=>{if(this.destroyed)b();else{if(this._stats?.time("Rendering"),!(e.renderingIntent&u))throw new Error("Mu
1st use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:t,optionalContentConfig:e}),v.operatorListChanged()}}).catch(b),y}getOperatorList({intent:t="display",annotationMode:e=m.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const s=this._transport.getRenderingIntent(t,e,i,n,!0);let r,a=this._intentStates.get(s.cacheKey);return a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(r))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size(t){return t.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>ti.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then(function({value:i,done:n}){n?t(s):(s.lang??=i.lang,Object.assign(s.styles,i.styles),s.items.push(...i.items),e())},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#Yi=!1,this.#Ki(),Promise.all(t)}cleanup(t=!1){this.#Yi=!0;const e=this.#Zi(!1);return t&&e&&(this._stats&&=new rt),e}#Zi(t=!1){if(this.#Ki(),!this.#Yi||this.destroyed)return!1;if(t)return this.#Xi=setTimeout(()=>{this.#Xi=null,this.#Zi(!1)},5e3),!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Yi=!1,!0}#Ki(){this.#Xi&&(clearTimeout(this.#Xi),this.#Xi=null)}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this.#Zi(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:n}){const{map:s,transfer:r}=i,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s,modifiedIds:n},r).getReader(),o=this._intentStates.get(e);o.streamReader=a;const l=()=>{a.read().then(({value:t,done:e})=>{e?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,o),l())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#Zi(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};l()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof tt){let i=100;return e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i))}}if(t.streamReader.cancel(new j(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}class ui{#Ji=new Map;#Qi=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Qi.then(()=>{for(const[t]of this.#Ji)t.call(this,i)})}addEventListener(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void E("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",r),s.addEventListener("abort",r)}this.#Ji.set(e,n)}removeEventListener(t,e){const i=this.#Ji.get(e);i?.(),this.#Ji.delete(e)}terminate(){for(const[,t]of this.#Ji)t?.();this.#Ji.clear()}}class pi{static#tn=0;static#en=!1;static#in;static{d&&(this.#en=!0,ye.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},this._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}}constructor({name:t=null,port:e=null,verbosity:i=S()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(pi.#in?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(pi.#in||=new WeakMap).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return d?Promise.all([Vt.promise,this._readyCapability.promise]):this._readyCapability.promise}#nn(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new xe("main","worker",t),this._messageHandler.on("ready",function(){}),this.#nn()}_initialize(){if(pi.#en||pi.#sn)return void this._setupFakeWorker();let{workerSrc:t}=pi;try{pi._isSameOrigin(window.location.href,t)||(t=pi._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new xe("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",()=>{this._webWorker||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,this.#nn()):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch{k("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){pi.#en||(E("Setting up fake worker."),pi.#en=!0),pi._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new ui;this._port=e;const i="fake"+pi.#tn++,n=new xe(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new xe(i,i+"_worker",e),this.#nn()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pi.#in?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#in?.get(t.port);
1if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new pi(t)}static get workerSrc(){if(ye.workerSrc)return ye.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#sn(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return R(this,"_setupFakeWorkerGlobal",(async()=>this.#sn?this.#sn:(await import(this.workerSrc)).WorkerMessageHandler)())}}class fi{#rn=new Map;#an=new Map;#on=new Map;#ln=new Map;#cn=null;constructor(t,e,i,n,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new gi,this.fontLoader=new Lt({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#hn(t,e=null){const i=this.#rn.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#rn.set(t,n),n}get annotationStorage(){return R(this,"annotationStorage",new Nt)}getRenderingIntent(t,e=m.ENABLE,i=null,n=!1,s=!1){let r=2,a=It;switch(t){case"any":r=1;break;case"display":break;case"print":r=4;break;default:E(`getRenderingIntent - invalid intent: ${t}`)}const o=4&r&&i instanceof Dt?i:this.annotationStorage;switch(e){case m.DISABLE:r+=64;break;case m.ENABLE:break;case m.ENABLE_FORMS:r+=16;break;case m.ENABLE_STORAGE:r+=32,a=o.serializable;break;default:E(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(r+=128),s&&(r+=256);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#cn?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#an.values())t.push(e._destroy());this.#an.clear(),this.#on.clear(),this.#ln.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#rn.clear(),this.filterFactory.destroy(),Qe.cleanup(),this._networkStream?.cancelAllRequests(new j("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{P(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function({value:t,done:i}){i?e.close():(P(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:s}=this._fullReader;return i&&n||(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:i,isRangeSupported:n,contentLength:s}}),t.on("GetRangeReader",(t,e)=>{P(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function({value:t,done:i}){i?e.close():(P(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}):e.close()}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new hi(t,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new N(t.message,t.code);break;case"InvalidPDFException":i=new L(t.message);break;case"MissingPDFException":i=new F(t.message);break;case"UnexpectedResponseException":i=new O(t.message,t.status);break;case"UnknownErrorException":i=new D(t.message,t.details);break;default:T("DocException - expected a valid Error.")}e._capability.reject(i)}
1),t.on("PasswordRequest",t=>{if(this.#cn=Promise.withResolvers(),e.onPassword){const i=t=>{t instanceof Error?this.#cn.reject(t):this.#cn.resolve({password:t})};try{e.onPassword(i,t.code)}catch(t){this.#cn.reject(t)}}else this.#cn.reject(new N(t.message,t.code));return this.#cn.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#an.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,i,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(e))return null;switch(i){case"Font":const{disableFontFace:s,fontExtraProperties:r,pdfBug:a}=this._params;if("error"in n){const t=n.error;E(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const o=a&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new Ft(n,{disableFontFace:s,inspectFont:o});this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!r&&l.data&&(l.data=null),this.commonObjs.resolve(e,l)});break;case"CopyLocalImage":const{imageRef:c}=n;P(c,"The imageRef must be defined.");for(const t of this.#an.values())for(const[,i]of t.objs)if(i?.ref===c)return i.dataLen?(this.commonObjs.resolve(e,structuredClone(i)),i.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,n);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([t,e,i,n])=>{if(this.destroyed)return;const s=this.#an.get(e);if(!s.objs.has(t))if(0!==s._intentStates.size)switch(i){case"Image":s.objs.resolve(t,n),n?.dataLen>1e7&&(s._maybeCleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(t,n);break;default:throw new Error(`Got unknown object type ${i}`)}else n?.bitmap?.close()}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("FetchBuiltInCMap",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(t)}),t.on("FetchStandardFontData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&E("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.#on.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#ln.set(i.refStr,t);const n=new di(e,i,this,this._params.pdfBug);return this.#an.set(e,n),n});return this.#on.set(e,n),n}getPageIndex(t){return oi(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#hn("GetFieldObjects")}hasJSActions(){return this.#hn("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}
vendor: 9,908 bytes, line 1
1getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#hn("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#hn("GetOptionalContentConfig").then(e=>new Se(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#rn.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new _e(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#rn.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#an.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#rn.clear(),this.filterFactory.destroy(!0),Qe.cleanup()}}cachedPageNumber(t){if(!oi(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#ln.get(e)??null}}const mi=Symbol("INITIAL_DATA");class gi{#dn=Object.create(null);#un(t){return this.#dn[t]||={...Promise.withResolvers(),data:mi}}get(t,e=null){if(e){const i=this.#un(t);return i.promise.then(()=>e(i.data)),null}const i=this.#dn[t];if(!i||i.data===mi)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#dn[t];return!!e&&e.data!==mi}resolve(t,e=null){const i=this.#un(t);i.data=e,i.resolve()}clear(){for(const t in this.#dn){const{data:e}=this.#dn[t];e?.bitmap?.close()}this.#dn=Object.create(null)}*[Symbol.iterator](){for(const t in this.#dn){const{data:e}=this.#dn[t];e!==mi&&(yield[t,e])}}}class bi{#pn=null;constructor(t){this.#pn=t,this.onContinue=null}get promise(){return this.#pn.capability.promise}cancel(t=0){this.#pn.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#pn.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#pn;return t.form||t.canvas&&e?.size>0}}class vi{#fn=null;static#mn=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:s,operatorList:r,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:d=null}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=h,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new bi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(vi.#mn.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");vi.#mn.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:n,transform:s,background:r}=this.params;this.gfx=new ve(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:n,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#fn&&(window.cancelAnimationFrame(this.#fn),this.#fn=null),vi.#mn.delete(this._canvas),this.callback(t||new tt(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#fn=window.requestAnimationFrame(()=>{this.#fn=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),vi.#mn.delete(this._canvas),this.callback())))}}const yi="4.8.69",wi="3634dab10";function xi(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function _i(t){return Math.max(0,Math.min(255,255*t))}class Ai{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=_i(t),t,t]}static G_HTML([t]){const e=xi(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(_i)}static RGB_HTML(t){return`#${t.map(xi).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[_i(1-Math.min(1,t+n)),_i(1-Math.min(1,i+n)),_i(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,s=1-e,r=1-i;return["CMYK",n,s,r,Math.min(n,s,r)]}}class Ci{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){T("Abstract method `_createSVG` called.")}}class Si extends Ci{_createSVG(t){return document.createElementNS(K,t)}}class ki{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})})}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:s}){const{attributes:r}=e,a=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${n}`);for(const[e,i]of Object.entries(r))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!a||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}a&&s.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,e,i)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&ti.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);
1if(r.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:s,linkService:i}),o.children?.length>0)c.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);a&&ti.shouldBuildText(h)&&l.push(t),d.append(t)}}for(const t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const Ei=1e3,Ti=new WeakSet;function Pi(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Mi{static create(t){switch(t.data.annotationType){case 2:return new Ii(t);case 1:return new Ni(t);case 20:switch(t.data.fieldType){case"Tx":return new Li(t);case"Btn":return t.data.radioButton?new zi(t):t.data.checkBox?new Oi(t):new ji(t);case"Ch":return new Bi(t);case"Sig":return new Fi(t)}return new Di(t);case 16:return new Hi(t);case 3:return new $i(t);case 4:return new Wi(t);case 5:return new Vi(t);case 6:return new Gi(t);case 8:return new qi(t);case 14:return new Yi(t);case 15:return new Ki(t);case 7:return new Xi(t);case 9:return new Zi(t);case 10:return new Ji(t);case 11:return new Qi(t);case 12:return new tn(t);case 13:return new en(t);case 17:return new nn(t);default:return new Ri(t)}}}class Ri{#gn=null;#bn=!1;#vn=null;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(t?.str||e?.str||i?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Ri._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#gn||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#yn(e),this.#vn?.popup.updateEdited(t)}resetEdited(){this.#gn&&(this.#yn(this.#gn.rect),this.#vn?.popup.resetEdited(),this.#gn=null)}#yn(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);const{width:l,height:c}=Pi(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+o)/r+"%",0===n?(e.width=100*l/s+"%",e.height=100*c/r+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof Di||(s.tabIndex=Ei);const{style:r}=s;if(r.zIndex=this.parent.zIndex++,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Hi){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=Pi(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;r.borderRadius=e}else if(this instanceof zi){const t=`calc(${a}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;r.borderRadius=t}switch(e.borderStyle.style){case 1:r.borderStyle="solid";break;case 2:r.borderStyle="dashed";break;case 3:E("Unimplemented border style: beveled");break;case 4:E("Unimplemented border style: inset");break;case 5:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(this.#bn=!0,r.borderColor=V.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=V.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;r.left=100*(l[0]-d)/c+"%",r.top=100*(l[1]-u)/h+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width=100*a/c+"%",r.height=100*o/h+"%"):this.setRotation(p,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=Pi(this.data.rect);let a,o;t%180==0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width=`${a}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=Ai[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[e]:Ai[`${s}_rgb`](r)})};return R(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>
vendor: 4,756 bytes, line 1
1t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];s?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];r&&(r({detail:{[n]:s},target:t}),delete e[n])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if(this.#bn){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let i=2,n=t.length;i<n;i+=8){const n=t[i],r=t[i+1],h=t[i+2],d=t[i+3],p=c.createElement("rect"),f=(h-e)/o,m=(s-r)/l,g=(n-h)/o,b=(r-d)/l;p.setAttribute("x",f),p.setAttribute("y",m),p.setAttribute("width",g),p.setAttribute("height",b),u.append(p),a?.push(`<rect vector-effect="non-scaling-stroke" x="${f}" y="${m}" width="${g}" height="${b}"/>`)}this.#bn&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{data:t}=this,e=this.#vn=new Hi({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){T("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t)continue;if(s===e)continue;const n="string"==typeof r?r:null,a=document.querySelector(`[data-element-id="${s}"]`);!a||Ti.has(a)?i.push({id:s,exportValue:n,domElement:a}):E(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&Ti.has(n)&&i.push({id:s,exportValue:t,domElement:n})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class Ii extends Ri{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(this.#wn(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#xn(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkA
1nnotation"),n&&this.container.append(i),this.container}#_n(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#_n()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#_n()}#wn(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#_n()}#xn(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#_n()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#_n()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#_n(),!this._fieldObjects)return E('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const a=this.annotationStorage,o=[];for(const t of r){const{id:e}=t;switch(o.push(e),t.type){case"text":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;a.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(Ti.has(i)?i.dispatchEvent(new Event("resetform")):E(`_bindResetFormAction - element not allowed: ${e}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Ni extends Ri{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Di extends Ri{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return $.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}})})}_setEventListeners(t,e,i,n){for(const[s,r]of i)("Action"===r||this.data.actions?.[r])&&("Focus"!==r&&"Blur"!==r||(e||={focused:!1}),this._setEventListener(t,e,s,r,n),"Focus"!==r||this.data.actions?.Blur?"Blur"!==r||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":V.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const{fontColor:e}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,n=t.style;let s;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(f*i))||1);s=Math.min(i,r(e/f))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(i,r(t/f))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=V.makeHexColor(e[0],e[1],e[2]),null!==this.data.textAlignment&&(n.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Li extends Di{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;
vendor: 12,578 bytes, line 1
1for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let s=n.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&s.length>r&&(s=s.slice(0,r));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Ti.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Ei,this._setRequired(i,this.data.required),r&&(i.maxLength=r),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null});let l=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!=n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:s}=i;if(0===n)return void s.removeAttribute("maxLength");s.setAttribute("maxLength",n);let r=o.userValue;!r||r.length<=n||(r=r.slice(0,n),s.value=o.userValue=r,t.setValue(e,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=l;l=null,i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),n(t)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:s,selectionStart:r,selectionEnd:a}=n;let l=r,c=a;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===a&&(l-=1);break;case"deleteContentForward":r===a&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(l&&i.addEventListener("blur",l),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Fi extends Di{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Oi extends Di{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Ti.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=Ei,s.addEventListener("change",n=>{const{name:s,checked:r}=n.target;for(const n of this._getElementsByName(s,i)){const i=r&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=i),t.setValue(n.id,{value:i})}t.setValue(i,{value:r})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class zi extends Di{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const n of this._getElementsByName(e.fieldName,i))t.setValue(n.id,{value:!1});const s=document.createElement("input");if(Ti.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=Ei,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const e of this._getElementsByName(n,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class ji extends Ii{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class Bi extends Di{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Ti.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=Ei;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e});for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,i.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),s=!1),n.append(e)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",i=>{const s={value(i){r?.();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;s[r].selected=!1,n.remove(r),s.length>0&&-1===Array.prototype.findIndex.call(s,t=>t.selected)&&(s[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)}),n.addEventListener("input",i=>{const n=a(!0),s=a(!1);t.setValue(e,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:s,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):n.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Hi extends Ri{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Ri._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Ui({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}),e=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>`${Y}${t}`).join(",")),this.container}}
1class Ui{#An=this.#Cn.bind(this);#Sn=this.#kn.bind(this);#En=this.#Tn.bind(this);#Pn=this.#Mn.bind(this);#Rn=null;#ut=null;#In=null;#Nn=null;#Dn=null;#Ln=null;#Fn=null;#On=!1;#zn=null;#k=null;#jn=null;#Bn=null;#Hn=null;#gn=null;#Un=!1;constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:s,contentsObj:r,richText:a,parent:o,rect:l,parentRect:c,open:h}){this.#ut=t,this.#Hn=n,this.#In=r,this.#Bn=a,this.#Ln=o,this.#Rn=e,this.#jn=l,this.#Fn=c,this.#Dn=i,this.#Nn=ct.toDateObject(s),this.trigger=i.flatMap(t=>t.getElementsToTriggerPopup());for(const t of this.trigger)t.addEventListener("click",this.#Pn),t.addEventListener("mouseenter",this.#En),t.addEventListener("mouseleave",this.#Sn),t.classList.add("popupTriggerArea");for(const t of i)t.container?.addEventListener("keydown",this.#An);this.#ut.hidden=!0,h&&this.#Mn()}render(){if(this.#zn)return;const t=this.#zn=document.createElement("div");if(t.className="popup",this.#Rn){const e=t.style.outlineColor=V.makeHexColor(...this.#Rn);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;t.style.backgroundColor=V.makeHexColor(...this.#Rn.map(t=>Math.floor(e*(255-t)+t)))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#Hn),t.append(e),this.#Nn){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#Nn.valueOf()})),e.append(t)}const n=this.#$n;if(n)ki.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(this.#In);t.append(e)}this.#ut.append(t)}get#$n(){const t=this.#Bn,e=this.#In;return!t?.str||e?.str&&e.str!==t.str?null:this.#Bn.html||null}get#Wn(){return this.#$n?.attributes?.style?.fontSize||0}get#Vn(){return this.#$n?.attributes?.style?.color||null}#Gn(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#Vn,fontSize:this.#Wn?`calc(${this.#Wn}px * var(--scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:n});return i}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const s=n[t];i.append(document.createTextNode(s)),t<e-1&&i.append(document.createElement("br"))}return i}#Cn(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#On)&&this.#Mn()}updateEdited({rect:t,popupContent:e}){this.#gn||={contentsObj:this.#In,richText:this.#Bn},t&&(this.#k=null),e&&(this.#Bn=this.#Gn(e),this.#In=null),this.#zn?.remove(),this.#zn=null}resetEdited(){this.#gn&&(({contentsObj:this.#In,richText:this.#Bn}=this.#gn),this.#gn=null,this.#zn?.remove(),this.#zn=null,this.#k=null)}#qn(){if(null!==this.#k)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=this.#Ln;let r=!!this.#Fn,a=r?this.#Fn:this.#jn;for(const t of this.#Dn)if(!a||null!==V.intersect(t.data.rect,a)){a=t.data.rect,r=!0;break}const o=V.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];this.#k=[100*(c-n)/e,100*(h-s)/i];const{style:d}=this.#ut;d.left=`${this.#k[0]}%`,d.top=`${this.#k[1]}%`}#Mn(){this.#On=!this.#On,this.#On?(this.#Tn(),this.#ut.addEventListener("click",this.#Pn),this.#ut.addEventListener("keydown",this.#An)):(this.#kn(),this.#ut.removeEventListener("click",this.#Pn),this.#ut.removeEventListener("keydown",this.#An))}#Tn(){this.#zn||this.render(),this.isVisible?this.#On&&this.#ut.classList.add("focused"):(this.#qn(),this.#ut.hidden=!1,this.#ut.style.zIndex=parseInt(this.#ut.style.zIndex)+1e3)}#kn(){this.#ut.classList.remove("focused"),!this.#On&&this.isVisible&&(this.#ut.hidden=!0,this.#ut.style.zIndex=parseInt(this.#ut.style.zIndex)-1e3)}forceHide(){this.#Un=this.isVisible,this.#Un&&(this.#ut.hidden=!0)}maybeShow(){this.#Un&&(this.#zn||this.#Tn(),this.#Un=!1,this.#ut.hidden=!1)}get isVisible(){return!1===this.#ut.hidden}}class $i extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=g.FREETEXT}
vendor: 20,174 bytes, line 1
1render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Wi extends Ri{#Xn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Pi(t.rect),n=this.svgFactory.create(e,i,!0),s=this.#Xn=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Xn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Vi extends Ri{#Yn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Pi(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#Yn=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Yn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Gi extends Ri{#Kn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Pi(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#Kn=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Kn}addHighlightArea(){this.container.classList.add("highlightArea")}}class qi extends Ri{#Zn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:r}=Pi(t),a=this.svgFactory.create(s,r,!0);let o=[];for(let i=0,n=e.length;i<n;i+=2){const n=e[i]-t[0],s=t[3]-e[i+1];o.push(`${n},${s}`)}o=o.join(" ");const l=this.#Zn=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Zn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Xi extends qi{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Yi extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Ki extends Ri{#Jn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?g.HIGHLIGHT:g.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=Pi(t),a=this.svgFactory.create(s,r,!0);for(const n of e){let e=[];for(let i=0,s=n.length;i<s;i+=2){const s=n[i]-t[0],r=t[3]-n[i+1];e.push(`${s},${r}`)}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);this.#Jn.push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(a),this._editOnDoubleClick(),this.container}getElementsToTriggerPopup(){return this.#Jn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Zi extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=g.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class Ji extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Qi extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class tn extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class en extends Ri{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=g.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class nn extends Ri{#Qn=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#ts.bind(this)),this.#Qn=i;const{isMac:n}=$.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#ts()}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#Qn}addHighlightArea(){this.container.classList.add("highlightArea")}#ts(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class sn{#es=null;#is=null;#ns=new Map;#ss=null;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:s,viewport:r,structTreeLayer:a}){this.div=t,this.#es=e,this.#is=i,this.#ss=a||null,this.page=s,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return this.#ns.size>0}async#rs(t,e){const i=t.firstChild||t,n=i.id=`${Y}${e}`,s=await(this.#ss?.getAriaAttributes(n));if(s)for(const[t,e]of s)i.setAttribute(t,e);this.div.append(t),this.#es?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:e}=t,i=this.div;ft(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Si,annotationStorage:t.annotationStorage||new Nt,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e){if(t.noHTML)continue;const e=16===t.annotationType;if(e){const e=n.get(t.id);if(!e)continue;s.elements=e}else{const{width:e,height:i}=Pi(t.rect);if(e<=0||i<=0)continue}s.data=t;const i=Mi.create(s);if(!i.isRenderable)continue;if(!e&&t.popupRef){const e=n.get(t.popupRef);e?e.push(i):n.set(t.popupRef,[i])}const r=i.render();t.hidden&&(r.style.visibility="hidden"),await this.#rs(r,t.id),i._isEditable&&(this.#ns.set(i.data.id,i),this._annotationEditorUIManager?.renderAnnotationElement(i))}this.#as()}update({viewport:t}){const e=this.div;this.viewport=t,ft(e,{rotation:t.rotation}),this.#as(),e.hidden=!1}#as(){if(!this.#is)return;const t=this.div;for(const[e,i]of this.#is){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}this.#is.clear()}getEditableAnnotations(){return Array.from(this.#ns.values())}getEditableAnnotation(t){return this.#ns.get(t)}}const rn=/\r\n?|\n/g;class an extends kt{#Rn;#os="";#ls=`${this.id}-editor`;#cs=null;#Wn;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=an.prototype,e=t=>t.isEmpty(),i=Ct.TRANSLATE_SMALL,n=Ct.TRANSLATE_BIG;return R(this,"_keyboardManager",new _t([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static _type="freetext";static _editorType=g.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#Rn=t.color||an._defaultColor||kt._defaultLineColor,this.#Wn=t.fontSize||an._defaultFontSize}static initialize(t,e){kt.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case b.FREETEXT_SIZE:an._defaultFontSize=e;break;case b.FREETEXT_COLOR:an._defaultColor=e}}updateParams(t,e){switch(t){case b.FREETEXT_SIZE:this.#hs(e);break;case b.FREETEXT_COLOR:this.#ds(e)}}static get defaultPropertiesToUpdate(){return[[b.FREETEXT_SIZE,an._defaultFontSize],[b.FREETEXT_COLOR,an._defaultColor||kt._defaultLineColor]]}get propertiesToUpdate(){return[[b.FREETEXT_SIZE,this.#Wn],[b.FREETEXT_COLOR,this.#Rn]]}#hs(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#Wn)*this.parentScale),this.#Wn=t,this.#us()},i=this.#Wn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ds(t){const e=t=>{this.#Rn=this.editorDiv.style.color=t},i=this.#Rn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-an._internalPadding*t,-(an._internalPadding+this.#Wn)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(g.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#cs=new AbortController;const t=this._uiManager.combinedSignal(this.#cs);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#ls),this._isDraggable=!0,this.#cs?.abort(),this.#cs=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.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()}#ps(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&"BR"===i.nodeName||(t.push(an.#fs(i)),e=i);return t.join("\n")}#us(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#os,e=this.#os=this.#ps().trimEnd();if(t===e)return;const i=t=>{this.#os=t,t?(this.#ms(),this._uiManager.rebuild(this),this.#us()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#us()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){an._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){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 t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#ls),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Wn}px * var(--scale-factor))`,i.color=this.#Rn,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),vt(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this.setAt(t*i,e*n,this.width*i,this.height*n);this.#ms(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#fs(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(rn,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=an.#gs(e.getData("text")||"").replaceAll(rn,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(rn,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(an.#fs(i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(rn,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(an.#fs(i))}this.#os=`${l.join("\n")}${n}${c.join("\n")}`,this.#ms();const h=new Range;let d=l.reduce((t,e)=>t+e.length,0);for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(d<=e){h.setStart(t,d),h.setEnd(t,d);break}d-=e}s.removeAllRanges(),s.addRange(h)}#ms(){if(this.editorDiv.replaceChildren(),this.#os)for(const t of this.#os.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#bs(){return this.#os.replaceAll("Â "," ")}static#gs(t){return t.replaceAll(" ","Â ")}get contentDiv(){return this.editorDiv}static async deserialize(t,e,i){let n=null;if(t instanceof $i){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a,popupRef:o},textContent:l,textPosition:c,parent:{page:{pageNumber:h}}}=t;if(!l||0===l.length)return null;n=t={annotationType:g.FREETEXT,color:Array.from(i),fontSize:e,value:l.join("\n"),position:c,pageIndex:h-1,rect:s.slice(0),rotation:r,id:a,deleted:!1,popupRef:o}}const s=await super.deserialize(t,e,i);return s.#Wn=t.fontSize,s.#Rn=V.makeHexColor(...t.color),s.#os=an.#gs(t.value),s.annotationElementId=t.id||null,s._initialData=n,s}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=an._internalPadding*this.parentScale,i=this.getRect(e,e),n=kt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Rn),s={annotationType:g.FREETEXT,color:n,fontSize:this.#Wn,value:this.#bs(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!this.#vs(s)?null:(s.id=this.annotationElementId,s)}#vs(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#Wn}
vendor: 5,107 bytes, line 1
1px * var(--scale-factor))`,i.color=this.#Rn,e.replaceChildren();for(const t of this.#os.split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),e.append(i)}const n=an._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#os}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class on{toSVGPath(){T("Abstract method `toSVGPath` must be implemented.")}get box(){T("Abstract getter `box` must be implemented.")}serialize(t,e){T("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){T("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){T("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}class ln{#ys;#ws=[];#xs;#_s;#As=[];#Cs=new Float64Array(18);#Ss;#ks;#Es;#Ts;#Ps;#Ms;#Rs=[];static#Is=8;static#Ns=2;static#Ds=ln.#Is+ln.#Ns;constructor({x:t,y:e},i,n,s,r,a=0){this.#ys=i,this.#Ms=s*n,this.#_s=r,this.#Cs.set([NaN,NaN,NaN,NaN,t,e],6),this.#xs=a,this.#Ts=ln.#Is*n,this.#Es=ln.#Ds*n,this.#Ps=n,this.#Rs.push(t,e)}isEmpty(){return isNaN(this.#Cs[8])}#Ls(){const t=this.#Cs.subarray(4,6),e=this.#Cs.subarray(16,18),[i,n,s,r]=this.#ys;return[(this.#Ss+(t[0]-e[0])/2-i)/s,(this.#ks+(t[1]-e[1])/2-n)/r,(this.#Ss+(e[0]-t[0])/2-i)/s,(this.#ks+(e[1]-t[1])/2-n)/r]}add({x:t,y:e}){this.#Ss=t,this.#ks=e;const[i,n,s,r]=this.#ys;let[a,o,l,c]=this.#Cs.subarray(8,12);const h=t-l,d=e-c,u=Math.hypot(h,d);if(u<this.#Es)return!1;const p=u-this.#Ts,f=p/u,m=f*h,g=f*d;let b=a,v=o;a=l,o=c,l+=m,c+=g,this.#Rs?.push(t,e);const y=m/p,w=-g/p*this.#Ms,x=y*this.#Ms;return this.#Cs.set(this.#Cs.subarray(2,8),0),this.#Cs.set([l+w,c+x],4),this.#Cs.set(this.#Cs.subarray(14,18),12),this.#Cs.set([l-w,c-x],16),isNaN(this.#Cs[6])?(0===this.#As.length&&(this.#Cs.set([a+w,o+x],2),this.#As.push(NaN,NaN,NaN,NaN,(a+w-i)/s,(o+x-n)/r),this.#Cs.set([a-w,o-x],14),this.#ws.push(NaN,NaN,NaN,NaN,(a-w-i)/s,(o-x-n)/r)),this.#Cs.set([b,v,a,o,l,c],6),!this.isEmpty()):(this.#Cs.set([b,v,a,o,l,c],6),Math.abs(Math.atan2(v-o,b-a)-Math.atan2(g,m))<Math.PI/2?([a,o,l,c]=this.#Cs.subarray(2,6),this.#As.push(NaN,NaN,NaN,NaN,((a+l)/2-i)/s,((o+c)/2-n)/r),[a,o,b,v]=this.#Cs.subarray(14,18),this.#ws.push(NaN,NaN,NaN,NaN,((b+a)/2-i)/s,((v+o)/2-n)/r),!0):([b,v,a,o,l,c]=this.#Cs.subarray(0,6),this.#As.push(((b+5*a)/6-i)/s,((v+5*o)/6-n)/r,((5*a+l)/6-i)/s,((5*o+c)/6-n)/r,((a+l)/2-i)/s,((o+c)/2-n)/r),[l,c,a,o,b,v]=this.#Cs.subarray(12,18),this.#ws.push(((b+5*a)/6-i)/s,((v+5*o)/6-n)/r,((5*a+l)/6-i)/s,((5*o+c)/6-n)/r,((a+l)/2-i)/s,((o+c)/2-n)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#As,e=this.#ws;if(isNaN(this.#Cs[6])&&!this.isEmpty())return this.#Fs();const i=[];i.push(`M${t[4]} ${t[5]}`);for(let e=6;e<t.length;e+=6)isNaN(t[e])?i.push(`L${t[e+4]} ${t[e+5]}`):i.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);this.#Os(i);for(let t=e.length-6;t>=6;t-=6)isNaN(e[t])?i.push(`L${e[t+4]} ${e[t+5]}`):i.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);return this.#zs(i),i.join(" ")}#Fs(){const[t,e,i,n]=this.#ys,[s,r,a,o]=this.#Ls();return`M${(this.#Cs[2]-t)/i} ${(this.#Cs[3]-e)/n} L${(this.#Cs[4]-t)/i} ${(this.#Cs[5]-e)/n} L${s} ${r} L${a} ${o} L${(this.#Cs[16]-t)/i} ${(this.#Cs[17]-e)/n} L${(this.#Cs[14]-t)/i} ${(this.#Cs[15]-e)/n} Z`}#zs(t){const e=this.#ws;t.push(`L${e[4]} ${e[5]} Z`)}#Os(t){const[e,i,n,s]=this.#ys,r=this.#Cs.subarray(4,6),a=this.#Cs.subarray(16,18),[o,l,c,h]=this.#Ls();t.push(`L${(r[0]-e)/n} ${(r[1]-i)/s} L${o} ${l} L${c} ${h} L${(a[0]-e)/n} ${(a[1]-i)/s}`)}newFreeDrawOutline(t,e,i,n,s,r){return new cn(t,e,i,n,s,r)}getOutlines(){const t=this.#As,e=this.#ws,i=this.#Cs,[n,s,r,a]=this.#ys,o=new Float64Array((this.#Rs?.length??0)+2);for(let t=0,e=o.length-2;t<e;t+=2)o[t]=(this.#Rs[t]-n)/r,o[t+1]=(this.#Rs[t+1]-s)/a;if(o[o.length-2]=(this.#Ss-n)/r,o[o.length-1]=(this.#ks-s)/a,isNaN(i[6])&&!this.isEmpty())return this.#js(o);const l=new Float64Array(this.#As.length+24+this.#ws.length);let c=t.length;for(let e=0;e<c;e+=2)isNaN(t[e])?l[e]=l[e+1]=NaN:(l[e]=t[e],l[e+1]=t[e+1]);c=this.#Bs(l,c);for(let t=e.length-6;t>=6;t-=6)for(let i=0;i<6;i+=2)isNaN(e[t+i])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=e[t+i],l[c+1]=e[t+i+1],c+=2);return this.#Hs(l,c),this.newFreeDrawOutline(l,o,this.#ys,this.#Ps,this.#xs,this.#_s)}#js(t){const e=this.#Cs,[i,n,s,r]=this.#ys,[a,o,l,c]=this.#Ls(),h=new Float64Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/r,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/r,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/r],0),this.newFreeDrawOutline(h,t,this.#ys,this.#Ps,this.#xs,this.#_s)}#Hs(t,e){const i=this.#ws;return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}#Bs(t,e){const i=this.#Cs.subarray(4,6),n=this.#Cs.subarray(16,18),[s,r,a,o]=this.#ys,[l,c,h,d]=this.#Ls();return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-r)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-r)/o],e),e+24}}class cn extends on{#ys;
1#Us=null;#xs;#_s;#Rs;#Ps;#$s;constructor(t,e,i,n,s,r){super(),this.#$s=t,this.#Rs=e,this.#ys=i,this.#Ps=n,this.#xs=s,this.#_s=r,this.#Ws(r);const{x:a,y:o,width:l,height:c}=this.#Us;for(let e=0,i=t.length;e<i;e+=2)t[e]=(t[e]-a)/l,t[e+1]=(t[e+1]-o)/c;for(let t=0,i=e.length;t<i;t+=2)e[t]=(e[t]-a)/l,e[t+1]=(e[t+1]-o)/c}toSVGPath(){const t=[`M${this.#$s[4]} ${this.#$s[5]}`];for(let e=6,i=this.#$s.length;e<i;e+=6)isNaN(this.#$s[e])?t.push(`L${this.#$s[e+4]} ${this.#$s[e+5]}`):t.push(`C${this.#$s[e]} ${this.#$s[e+1]} ${this.#$s[e+2]} ${this.#$s[e+3]} ${this.#$s[e+4]} ${this.#$s[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,i,n],s){const r=i-t,a=n-e;let o,l;switch(s){case 0:o=this.#Vs(this.#$s,t,n,r,-a),l=this.#Vs(this.#Rs,t,n,r,-a);break;case 90:o=this.#Gs(this.#$s,t,e,r,a),l=this.#Gs(this.#Rs,t,e,r,a);break;case 180:o=this.#Vs(this.#$s,i,e,-r,a),l=this.#Vs(this.#Rs,i,e,-r,a);break;case 270:o=this.#Gs(this.#$s,i,n,-r,-a),l=this.#Gs(this.#Rs,i,n,-r,-a)}return{outline:Array.from(o),points:[Array.from(l)]}}#Vs(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r}#Gs(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r}#Ws(t){const e=this.#$s;let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,c=n;const h=t?Math.max:Math.min;for(let t=6,d=e.length;t<d;t+=6){if(isNaN(e[t]))s=Math.min(s,e[t+4]),r=Math.min(r,e[t+5]),a=Math.max(a,e[t+4]),o=Math.max(o,e[t+5]),c<e[t+5]?(l=e[t+4],c=e[t+5]):c===e[t+5]&&(l=h(l,e[t+4]));else{const d=V.bezierBoundingBox(i,n,...e.slice(t,t+6));s=Math.min(s,d[0]),r=Math.min(r,d[1]),a=Math.max(a,d[2]),o=Math.max(o,d[3]),c<d[3]?(l=d[2],c=d[3]):c===d[3]&&(l=h(l,d[2]))}i=e[t+4],n=e[t+5]}const d=s-this.#xs,u=r-this.#xs,p=a-s+2*this.#xs,f=o-r+2*this.#xs;this.#Us={x:d,y:u,width:p,height:f,lastPoint:[l,c]}}get box(){return this.#Us}newOutliner(t,e,i,n,s,r=0){return new ln(t,e,i,n,s,r)}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=this.#Us,[a,o,l,c]=this.#ys,h=s*l,d=r*c,u=i*l+a,p=n*c+o,f=this.newOutliner({x:this.#Rs[0]*h+u,y:this.#Rs[1]*d+p},this.#ys,this.#Ps,t,this.#_s,e??this.#xs);for(let t=2;t<this.#Rs.length;t+=2)f.add({x:this.#Rs[t]*h+u,y:this.#Rs[t+1]*d+p});return f.getOutlines()}get mustRemoveSelfIntersections(){return!0}}class hn{#ys;#qs=[];#Xs=[];constructor(t,e=0,i=0,n=!0){let s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:i,y:n,width:c,height:h}of t){const t=Math.floor((i-e)/l)*l,d=Math.ceil((i+c+e)/l)*l,u=Math.floor((n-e)/l)*l,p=Math.ceil((n+h+e)/l)*l,f=[t,u,p,!0],m=[d,u,p,!1];this.#qs.push(f,m),s=Math.min(s,t),r=Math.max(r,d),a=Math.min(a,u),o=Math.max(o,p)}const c=r-s+2*i,h=o-a+2*i,d=s-i,u=a-i,p=this.#qs.at(n?-1:-2),f=[p[0],p[2]];for(const t of this.#qs){const[e,i,n]=t;t[0]=(e-d)/c,t[1]=(i-u)/h,t[2]=(n-u)/h}this.#ys={x:d,y:u,width:c,height:h,lastPoint:f}}getOutlines(){this.#qs.sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of this.#qs)e[3]?(t.push(...this.#Ys(e)),this.#Ks(e)):(this.#Zs(e),t.push(...this.#Ys(e)));return this.#Js(t)}#Js(t){const e=[],i=new Set;for(const i of t){const[t,n,s]=i;e.push([t,n,i],[t,s,i])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let t=0,n=e.length;t<n;t+=2){const n=e[t][2],s=e[t+1][2];n.push(s),s.push(n),i.add(n),i.add(s)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let c=e,h=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new dn(n,this.#ys)}#Qs(t){const e=this.#Xs;let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}#Ks([,t,e]){const i=this.#Qs(t);this.#Xs.splice(i,0,[t,e])}#Zs([,t,e]){const i=this.#Qs(t);for(let n=i;n<this.#Xs.length;n++){const[i,s]=this.#Xs[n];if(i!==t)break;if(i===t&&s===e)return void this.#Xs.splice(n,1)}for(let n=i-1;n>=0;n--){const[i,s]=this.#Xs[n];if(i!==t)break;if(i===t&&s===e)return void this.#Xs.splice(n,1)}}#Ys(t){const[e,i,n]=t,s=[[e,i,n]],r=this.#Qs(n);for(let t=0;t<r;t++){const[i,n]=this.#Xs[t];for(let t=0,r=s.length;t<r;t++){const[,a,o]=s[t];if(!(n<=a||o<=i))if(a>=i)if(o>n)s[t][1]=n;else{if(1===r)return[];s.splice(t,1),t--,r--}else s[t][2]=i,o>n&&s.push([e,n,o])}}return s}}class dn extends on{#ys;#tr;constructor(t,e){super(),this.#tr=t,this.#ys=e}toSVGPath(){const t=[];for(const e of this.#tr){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize([t,e,i,n],s){const r=[],a=i-t,o=n-e;for(const e of this.#tr){const i=new Array(e.length);for(let s=0;s<e.length;s+=2)i[s]=t+e[s]*a,i[s+1]=n-e[s+1]*o;r.push(i)}return r}get box(){return this.#ys}get classNamesForDrawing(){return["highlight"]}get classNamesForOutlining(){return["highlightOutline"]}}class un extends ln{newFreeDrawOutline(t,e,i,n,s,r){return new pn(t,e,i,n,s,r)}get classNamesForDrawing(){return["highlight","free"]}}class pn extends cn{get classNamesForDrawing(){return["highlight","free"]}get classNamesForOutlining(){return["highlightOutline","free"]}newOutliner(t,e,i,n,s,r=0){return new un(t,e,i,n,s,r)}}class fn{#er=null;#ir=null;#nr;#sr=null;#rr=!1;#ar=!1;#r=null;#or;#lr=null;#m=null;#cr;static#hr=null;static get _keyboardManager(){return R(this,"_keyboardManager",new _t([[["Escape","mac+Escape"],fn.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],fn.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],fn.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],fn.prototype._moveToPrevious],[["Home","mac+Home"],fn.prototype._moveToBeginning],[["End","mac+End"],fn.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#ar=!1,this.#cr=b.HIGHLIGHT_COLOR,this.#r=t):(this.#ar=!0,this.#cr=b.HIGHLIGHT_DEFAULT_COLOR),this.#m=t?._uiManager||e,this.#or=this.#m._eventBus,this.#nr=t?.color||this.#m?.highlightColors.values().next().value||"#FFFF98",fn.#hr||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#er=document.createElement("button");
vendor: 9,416 bytes, line 1
1t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=this.#m._signal;t.addEventListener("click",this.#dr.bind(this),{signal:e}),t.addEventListener("keydown",this.#Cn.bind(this),{signal:e});const i=this.#ir=document.createElement("span");return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=this.#nr,t.append(i),t}renderMainDropdown(){const t=this.#sr=this.#ur();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#ur(){const t=document.createElement("div"),e=this.#m._signal;t.addEventListener("contextmenu",ot,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of this.#m.highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",fn.#hr[i]);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===this.#nr),s.addEventListener("click",this.#pr.bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",this.#Cn.bind(this),{signal:e}),t}#pr(t,e){e.stopPropagation(),this.#or.dispatch("switchannotationeditorparams",{source:this,type:this.#cr,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#er)return void this.#dr(t);const e=t.target.getAttribute("data-color");e&&this.#pr(e,t)}_moveToNext(t){this.#fr?t.target!==this.#er?t.target.nextSibling?.focus():this.#sr.firstChild?.focus():this.#dr(t)}_moveToPrevious(t){t.target!==this.#sr?.firstChild&&t.target!==this.#er?(this.#fr||this.#dr(t),t.target.previousSibling?.focus()):this.#fr&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#fr?this.#sr.firstChild?.focus():this.#dr(t)}_moveToEnd(t){this.#fr?this.#sr.lastChild?.focus():this.#dr(t)}#Cn(t){fn._keyboardManager.exec(this,t)}#dr(t){if(this.#fr)return void this.hideDropdown();if(this.#rr=0===t.detail,this.#lr||(this.#lr=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#m.combinedSignal(this.#lr)})),this.#sr)return void this.#sr.classList.remove("hidden");const e=this.#sr=this.#ur();this.#er.append(e)}#c(t){this.#sr?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#sr?.classList.add("hidden"),this.#lr?.abort(),this.#lr=null}get#fr(){return this.#sr&&!this.#sr.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#ar||(this.#fr?(this.hideDropdown(),this.#er.focus({preventScroll:!0,focusVisible:this.#rr})):this.#r?.unselect())}updateColor(t){if(this.#ir&&(this.#ir.style.backgroundColor=t),!this.#sr)return;const e=this.#m.highlightColors.values();for(const i of this.#sr.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#er?.remove(),this.#er=null,this.#ir=null,this.#sr?.remove(),this.#sr=null}}class mn extends kt{#mr=null;#gr=0;#br;#vr=null;#s=null;#yr=null;#wr=null;#xr=0;#_r=null;#Ar=null;#y=null;#Cr=!1;#Sr=null;#kr;#Er=null;#Tr="";#Ms;#Pr="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=g.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=mn.prototype;return R(this,"_keyboardManager",new _t([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||mn._defaultColor,this.#Ms=t.thickness||mn._defaultThickness,this.#kr=t.opacity||mn._defaultOpacity,this.#br=t.boxes||null,this.#Pr=t.methodOfCreation||"",this.#Tr=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#Cr=!0,this.#Mr(t),this.#Rr()):this.#br&&(this.#mr=t.anchorNode,this.#gr=t.anchorOffset,this.#wr=t.focusNode,this.#xr=t.focusOffset,this.#Ir(),this.#Rr(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#Cr?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#Ms,methodOfCreation:this.#Pr}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#Ir(){const t=new hn(this.#br,.001);this.#Ar=t.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#Ar.box);const e=new hn(this.#br,.0025,.001,"ltr"===this._uiManager.direction);this.#yr=e.getOutlines();const{lastPoint:i}=this.#yr.box;this.#Sr=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#Mr({highlightOutlines:t,highlightId:e,clipPathId:i}){if(this.#Ar=t,this.#yr=t.getNewOutline(this.#Ms/2+1.5,.0025),e>=0)this.#y=e,this.#vr=i,this.parent.drawLayer.finalizeLine(e,t),this.#Er=this.parent.drawLayer.drawOutline(this.#yr);else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#y,t),this.parent.drawLayer.updateBox(this.#y,mn.#Nr(this.#Ar.box,(e-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#Er,this.#yr),this.parent.drawLayer.updateBox(this.#Er,mn.#Nr(this.#yr.box,e))}const{x:n,y:s,width:r,height:a}=t.box;switch(this.rotation){case 0:this.x=n,this.y=s,this.width=r,this.height=a;break;case 90:{const[t,e]=this.parentDimensions;this.x=s,this.y=1-n,this.width=r*e/t,this.height=a*t/e;break}case 180:this.x=1-n,this.y=1-s,this.width=r,this.height=a;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-s,this.y=n,this.width=r*e/t,this.height=a*t/e;break}}const{lastPoint:o}=this.#yr.box;this.#Sr=[(o[0]-n)/r,(o[1]-s)/a]}static initialize(t,e){kt.initialize(t,e),mn._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case b.HIGHLIGHT_DEFAULT_COLOR:mn._defaultColor=e;break;case b.HIGHLIGHT_THICKNESS:mn._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#Sr}updateParams(t,e){switch(t){case b.HIGHLIGHT_COLOR:this.#ds(e);break;case b.HIGHLIGHT_THICKNESS:this.#Dr(e)}}static get defaultPropertiesToUpdate(){return[[b.HIGHLIGHT_DEFAULT_COLOR,mn._defaultColor],[b.HIGHLIGHT_THICKNESS,mn._defaultThickness]]}get propertiesToUpdate(){return[[b.HIGHLIGHT_COLOR,this.color||mn._defaultColor],[b.HIGHLIGHT_THICKNESS,this.#Ms||mn._defaultThickness],[b.HIGHLIGHT_FREE,this.#Cr]]}#ds(t){const e=(t,e)=>{this.color=t,this.parent?.drawLayer.changeColor(this.#y,t),this.#s?.updateColor(t),this.#kr=e,this.parent?.drawLayer.changeOpacity(this.#y,e)},i=this.color,n=this.#kr;this.addCommands({cmd:e.bind(this,t,mn._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#Dr(t){const e=this.#Ms,i=t=>{this.#Ms=t,this.#Lr(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#s=new fn({editor:this}),t.addColorPicker(this.#s)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Fr())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#Fr())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#Or(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#Rr(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#Or():t&&(this.#Rr(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#Lr(t){if(!this.#Cr)return;this.#Mr({highlightOutlines:this.#Ar.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#Or(){null!==this.#y&&this.parent&&(this.parent.drawLayer.remove(this.#y),this.#y=null,this.parent.drawLayer.remove(this.#Er),this.#Er=null)}#Rr(t=this.parent){null===this.#y&&(({id:this.#y,clipPathId:this.#vr}=t.drawLayer.draw(this.#Ar,this.color,this.#kr)),this.#Er=t.drawLayer.drawOutline(this.#yr),this.#_r&&(this.#_r.style.clipPath=this.#vr))}static#Nr({x:t,y:e,width:i,height:n},s){switch(s){case 90:return{x:1-e-n,y:t,width:n,height:i};case 180:return{x:1-t-i,y:1-e-n,width:i,height:n};case 270:return{x:e,y:1-t-i,width:n,height:i}}return{x:t,y:e,width:i,height:n}}rotate(t){const{drawLayer:e}=this.parent;let i;this.#Cr?(t=(t-this.rotation+360)%360,i=mn.#Nr(this.#Ar.box,t)):i=mn.#Nr(this,t),e.rotate(this.#y,t),e.rotate(this.#Er,t),e.updateBox(this.#y,i),e.updateBox(this.#Er,mn.#Nr(this.#yr.box,t))}
1render(){if(this.div)return this.div;const t=super.render();this.#Tr&&(t.setAttribute("aria-label",this.#Tr),t.setAttribute("role","mark")),this.#Cr?t.classList.add("free"):this.div.addEventListener("keydown",this.#zr.bind(this),{signal:this._uiManager._signal});const e=this.#_r=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#vr;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),vt(this,this.#_r,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#Er,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#Er,"hovered")}#zr(t){mn._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#jr(!0);break;case 1:case 3:this.#jr(!1)}}#jr(t){if(!this.#mr)return;const e=window.getSelection();t?e.setPosition(this.#mr,this.#gr):e.setPosition(this.#wr,this.#xr)}select(){super.select(),this.#Er&&(this.parent?.drawLayer.removeClass(this.#Er,"hovered"),this.parent?.drawLayer.addClass(this.#Er,"selected"))}unselect(){super.unselect(),this.#Er&&(this.parent?.drawLayer.removeClass(this.#Er,"selected"),this.#Cr||this.#jr(!1))}get _mustFixPosition(){return!this.#Cr}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(this.#y,t),this.parent.drawLayer.show(this.#Er,t))}#Fr(){return this.#Cr?this.rotation:0}#Br(){if(this.#Cr)return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=this.#br,r=new Float32Array(8*s.length);let a=0;for(const{x:o,y:l,width:c,height:h}of s){const s=o*t+i,d=(1-l-h)*e+n;r[a]=r[a+4]=s,r[a+1]=r[a+3]=d,r[a+2]=r[a+6]=s+c*t,r[a+5]=r[a+7]=d+h*e,a+=8}return r}#Hr(t){return this.#Ar.serialize(t,this.#Fr())}static startHighlighting(t,e,{target:i,x:n,y:s}){const{x:r,y:a,width:o,height:l}=i.getBoundingClientRect(),c=new AbortController,h=t.combinedSignal(c),d=e=>{c.abort(),this.#Ur(t,e)};window.addEventListener("blur",d,{signal:h}),window.addEventListener("pointerup",d,{signal:h}),window.addEventListener("pointerdown",t=>{t.preventDefault(),t.stopPropagation()},{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",ot,{signal:h}),i.addEventListener("pointermove",this.#$r.bind(this,t),{signal:h}),this._freeHighlight=new un({x:n,y:s},[r,a,o,l],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#$r(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#Ur(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,i){let n=null;if(t instanceof Zi){const{data:{quadPoints:e,rect:i,rotation:s,id:r,color:a,opacity:o,popupRef:l},parent:{page:{pageNumber:c}}}=t;n=t={annotationType:g.HIGHLIGHT,color:Array.from(a),opacity:o,quadPoints:e,boxes:null,pageIndex:c-1,rect:i.slice(0),rotation:s,id:r,deleted:!1,popupRef:l}}else if(t instanceof Ki){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,borderStyle:{rawWidth:o},popupRef:l},parent:{page:{pageNumber:c}}}=t;n=t={annotationType:g.HIGHLIGHT,color:Array.from(a),thickness:o,inkLists:e,boxes:null,pageIndex:c-1,rect:i.slice(0),rotation:s,id:r,deleted:!1,popupRef:l}}const{color:s,quadPoints:r,inkLists:a,opacity:o}=t,l=await super.deserialize(t,e,i);l.color=V.makeHexColor(...s),l.#kr=o||1,a&&(l.#Ms=t.thickness),l.annotationElementId=t.id||null,l._initialData=n;const[c,h]=l.pageDimensions,[d,u]=l.pageTranslation;if(r){const t=l.#br=[];for(let e=0;e<r.length;e+=8)t.push({x:(r[e]-d)/c,y:1-(r[e+1]-u)/h,width:(r[e+2]-r[e])/c,height:(r[e+1]-r[e+5])/h});l.#Ir(),l.#Rr(),l.rotate(l.rotation)}else if(a){l.#Cr=!0;const t=a[0],i={x:t[0]-d,y:h-(t[1]-u)},n=new un(i,[0,0,c,h],1,l.#Ms/2,!0,.001);for(let e=0,s=t.length;e<s;e+=2)i.x=t[e]-d,i.y=h-(t[e+1]-u),n.add(i);const{id:s,clipPathId:r}=e.drawLayer.draw(n,l.color,l._defaultOpacity,!0);l.#Mr({highlightOutlines:n.getOutlines(),highlightId:s,clipPathId:r}),l.#Rr()}return l}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=this.getRect(0,0),i=kt._colorManager.convert(this.color),n={annotationType:g.HIGHLIGHT,color:i,opacity:this.#kr,thickness:this.#Ms,quadPoints:this.#Br(),outlines:this.#Hr(e),pageIndex:this.pageIndex,rect:e,rotation:this.#Fr(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#vs(n)?null:(n.id=this.annotationElementId,n)}#vs(t){const{color:e}=this._initialData;return t.color.some((t,i)=>t!==e[i])}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class gn extends kt{#Wr=0;#Vr=0;#Gr=null;#qr=new Path2D;#Xr=!1;#Yr=null;#Kr=!1;#Zr=!1;#Jr=null;#Qr=null;#ta=0;#ea=0;#ia=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=g.INK;constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.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(t,e){kt.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case b.INK_THICKNESS:gn._defaultThickness=e;break;case b.INK_COLOR:gn._defaultColor=e;break;case b.INK_OPACITY:gn._defaultOpacity=e/100}}updateParams(t,e){switch(t){case b.INK_THICKNESS:this.#Dr(e);break;case b.INK_COLOR:this.#ds(e);break;case b.INK_OPACITY:this.#na(e)}}static get defaultPropertiesToUpdate(){return[[b.INK_THICKNESS,gn._defaultThickness],[b.INK_COLOR,gn._defaultColor||kt._defaultLineColor],[b.INK_OPACITY,Math.round(100*gn._defaultOpacity)]]}get propertiesToUpdate(){return[[b.INK_THICKNESS,this.thickness||gn._defaultThickness],[b.INK_COLOR,this.color||gn._defaultColor||kt._defaultLineColor],[b.INK_OPACITY,Math.round(100*(this.opacity??gn._defaultOpacity))]]}#Dr(t){const e=t=>{this.thickness=t,this.#sa()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ds(t){const e=t=>{this.color=t,this.#ra()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#na(t){const e=t=>{this.opacity=t,this.#ra()};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#aa(),this.#oa()),this.isAttachedToDOM||(this.parent.add(this),this.#la()),this.#sa()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Gr&&(clearTimeout(this.#Gr),this.#Gr=null),this.#Jr?.disconnect(),this.#Jr=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){this.#Xr||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.#ca())}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#ha())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#da(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#ua(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;
1t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i)}`}#pa(t,e){this.canvas.addEventListener("contextmenu",ot,{signal:this._uiManager._signal}),this.#ha(),this.#Yr=new AbortController;const i=this._uiManager.combinedSignal(this.#Yr);this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,this.#Zr||(this.#Zr=!0,this.#la(),this.thickness||=gn._defaultThickness,this.color||=gn._defaultColor||kt._defaultLineColor,this.opacity??=gn._defaultOpacity),this.currentPath.push([t,e]),this.#Kr=!1,this.#ua(),this.#ia=()=>{this.#fa(),this.#ia&&window.requestAnimationFrame(this.#ia)},window.requestAnimationFrame(this.#ia)}#ma(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let r=this.#qr;if(s.push([t,e]),this.#Kr=!0,s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&(this.#qr=r=new Path2D,r.moveTo(...s[0])),this.#ga(r,...s.at(-3),...s.at(-2),t,e)}#ba(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#qr.lineTo(...t)}#va(t,e){let i;if(this.#ia=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#ma(t,e),this.#ba(),1!==this.currentPath.length)i=this.#ya();else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=this.#qr,s=this.currentPath;this.currentPath=[],this.#qr=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#aa(),this.#oa()),this.#sa())},mustExec:!0})}#fa(){if(!this.#Kr)return;this.#Kr=!1;Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),e=t.map(t=>t[0]),i=t.map(t=>t[1]),{ctx:n}=(Math.min(...e),Math.max(...e),Math.min(...i),Math.max(...i),this);n.save(),n.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)n.stroke(t);n.stroke(this.#qr),n.restore()}#ga(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,c=(n+r)/2,h=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}#ya(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],c=(r+o)/2,h=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[c+2*(r-c)/3,h+2*(a-h)/3];e.push([[n,s],d,u,[c,h]]),[n,s]=[c,h]}const[r,a]=t[i],[o,l]=t[i+1],c=[n+2*(r-n)/3,s+2*(a-s)/3],h=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],c,h,[o,l]]),e}#ra(){if(this.isEmpty())return void this.#wa();this.#ua();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#wa();for(const t of this.bezierPath2D)e.stroke(t)}commit(){this.#Xr||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Xr=!0,this.div.classList.add("disabled"),this.#sa(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}#ca(){if(this.#Qr)return;this.#Qr=new AbortController;const t=this._uiManager.combinedSignal(this.#Qr);this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:t})}#ha(){this.pointerdownAC?.abort(),this.pointerdownAC=null}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#Xr&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#pa(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#ma(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#xa(t)}canvasPointerleave(t){this.#xa(t)}#xa(t){this.#Yr?.abort(),this.#Yr=null,this.#ca(),this.#Gr&&clearTimeout(this.#Gr),this.#Gr=setTimeout(()=>{this.#Gr=null,this.canvas.removeEventListener("contextmenu",ot)},10),this.#va(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
1d()}#aa(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#oa(){this.#Jr=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#Jr.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#Jr?.disconnect(),this.#Jr=null},{once:!0})}get isResizable(){return!this.isEmpty()&&this.#Xr}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,r]=this.#da();if(this.setAt(i,n,0,0),this.setDims(s,r),this.#aa(),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),this.#Zr=!0,this.#la(),this.setDims(this.width*i,this.height*n),this.#ra(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#oa(),this.div}#la(){if(!this.#Zr)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#wa()}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(this.#ta===i&&this.#ea===n)return;this.#ta=i,this.#ea=n,this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),this.#Xr&&this.#_a(t,e),this.#la(),this.#ra(),this.canvas.style.visibility="visible",this.fixDims()}#_a(t,e){const i=this.#Aa(),n=(t-i)/this.#Vr,s=(e-i)/this.#Wr;this.scaleFactor=Math.min(n,s)}#wa(){const t=this.#Aa()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#Ca(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e}static#Sa(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}static#ka(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}#Ea(t,e,i,n){const s=[],r=this.thickness/2,a=t*e+r,o=t*i+r;for(const e of this.paths){const i=[],r=[];for(let n=0,s=e.length;n<s;n++){const[l,c,h,d]=e[n];if(l[0]===d[0]&&l[1]===d[1]&&1===s){const e=t*l[0]+a,n=t*l[1]+o;i.push(e,n),r.push(e,n);break}const u=t*l[0]+a,p=t*l[1]+o,f=t*c[0]+a,m=t*c[1]+o,g=t*h[0]+a,b=t*h[1]+o,v=t*d[0]+a,y=t*d[1]+o;0===n&&(i.push(u,p),r.push(u,p)),i.push(f,m,g,b,v,y),r.push(f,m),n===s-1&&r.push(v,y)}s.push({bezier:gn.#Sa(i,n,this.rotation),points:gn.#Sa(r,n,this.rotation)})}return s}#Ta(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=V.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}#Aa(){return this.#Xr?Math.ceil(this.thickness*this.parentScale):0}#sa(t=!1){if(this.isEmpty())return;if(!this.#Xr)return void this.#ra();const e=this.#Ta(),i=this.#Aa();this.#Vr=Math.max(kt.MIN_SIZE,e[2]-e[0]),this.#Wr=Math.max(kt.MIN_SIZE,e[3]-e[1]);const n=Math.ceil(i+this.#Vr*this.scaleFactor),s=Math.ceil(i+this.#Wr*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r,this.height=s/a,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#la(),this.#ra(),this.#ta=n,this.#ea=s,this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}static async deserialize(t,e,i){if(t instanceof Ki)return null;const n=await super.deserialize(t,e,i);n.thickness=t.thickness,n.color=V.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,c=t.thickness/2;n.#Xr=!0,n.#ta=Math.round(a),n.#ea=Math.round(o);const{paths:h,rect:d,rotation:u}=t;for(let{bezier:t}of h){t=gn.#ka(t,d,u);const e=[];n.paths.push(e);let i=l*(t[0]-c),s=l*(t[1]-c);for(let n=2,r=t.length;n<r;n+=6){const r=l*(t[n]-c),a=l*(t[n+1]-c),o=l*(t[n+2]-c),h=l*(t[n+3]-c),d=l*(t[n+4]-c),u=l*(t[n+5]-c);e.push([[i,s],[r,a],[o,h],[d,u]]),i=d,s=u}const r=this.#Ca(e);n.bezierPath2D.push(r)}const p=n.#Ta();return n.#Vr=Math.max(kt.MIN_SIZE,p[2]-p[0]),n.#Wr=Math.max(kt.MIN_SIZE,p[3]-p[1]),n.#_a(a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=kt._colorManager.convert(this.ctx.strokeStyle);return{annotationType:g.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#Ea(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class bn extends kt{#Pa=null;#Ma=null;#Ra=null;#Ia=null;#Na=null;#Da="";#La=null;#Jr=null;#Fa=null;#Oa=!1;#za=!1;static _type="stamp";static _editorType=g.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#Ia=t.bitmapUrl,this.#Na=t.bitmapFile}static initialize(t,e){kt.initialize(t,e)}static get supportedTypes(){return R(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return R(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(g.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#ja(t,e=!1){t?(this.#Pa=t.bitmap,e||(this.#Ma=t.id,this.#Oa=t.isSvg),t.file&&(this.#Da=t.file.name),this.#aa()):this.remove()}#Ba(){if(this.#Ra=null,this._uiManager.enableWaiting(!1),this.#La){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Pa)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Pa){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:s,height:r}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:s,height:r,channels:n.length/(s*r)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#Ha(){if(this.#Ma)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#Ma).then(t=>this.#ja(t,!0)).finally(()=>this.#Ba());if(this.#Ia){const t=this.#Ia;return this.#Ia=null,this._uiManager.enableWaiting(!0),void(this.#Ra=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#ja(t)).finally(()=>this.#Ba()))}if(this.#Na){const t=this.#Na;return this.#Na=null,this._uiManager.enableWaiting(!0),void(this.#Ra=this._uiManager.imageManager.getFromFile(t).then(t=>this.#ja(t)).finally(()=>this.#Ba()))}const t=document.createElement("input");t.type="file",t.accept=bn.supportedTypesStr;const e=this._uiManager._signal;this.#Ra=new Promise(i=>{t.addEventListener("change",async()=>
1{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#ja(e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>this.#Ba()),t.click()}remove(){this.#Ma&&(this.#Pa=null,this._uiManager.imageManager.deleteId(this.#Ma),this.#La?.remove(),this.#La=null,this.#Jr?.disconnect(),this.#Jr=null,this.#Fa&&(clearTimeout(this.#Fa),this.#Fa=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#Ma&&null===this.#La&&this.#Ha(),this.isAttachedToDOM||this.parent.add(this))):this.#Ma&&this.#Ha()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#Ra||this.#Pa||this.#Ia||this.#Na||this.#Ma)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#Pa?this.#aa():this.#Ha(),this.width&&!this.annotationElementId){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}#aa(){const{div:t}=this;let{width:e,height:i}=this.#Pa;const[n,s]=this.pageDimensions,r=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>r*n||i>r*s){const t=Math.min(r*n/e,r*s/i);e*=t,i*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/n,i*o/s),this._uiManager.enableWaiting(!1);const l=this.#La=document.createElement("canvas");l.setAttribute("role","img"),this.addContainer(l),this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#Ua(e,i),this.#oa(),this.#za||(this.parent.addUndoableEditor(this),this.#za=!0),this._reportTelemetry({action:"inserted_image"}),this.#Da&&l.setAttribute("aria-label",this.#Da)}copyCanvas(t,e,i=!1){t||(t=224);const{width:n,height:s}=this.#Pa,r=new mt;let a=this.#Pa,o=n,l=s,c=null;if(e){if(n>e||s>e){const t=Math.min(e/n,e/s);o=Math.floor(n*t),l=Math.floor(s*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*r.sx),i=c.height=Math.ceil(l*r.sy);this.#Oa||(a=this.#$a(t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(d="#8f8f9d",u="#42414d");const p=15,f=p*r.sx,m=p*r.sy,g=new OffscreenCanvas(2*f,2*m),b=g.getContext("2d");b.fillStyle=d,b.fillRect(0,0,2*f,2*m),b.fillStyle=u,b.fillRect(0,0,f,m),b.fillRect(f,m,f,m),h.fillStyle=h.createPattern(g,"repeat"),h.fillRect(0,0,t,i),h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(r.symmetric&&a.width<t&&a.height<t)e=a.width,i=a.height;else if(a=this.#Pa,n>t||s>t){const r=Math.min(t/n,t/s);e=Math.floor(n*r),i=Math.floor(s*r),this.#Oa||(a=this.#$a(e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i),h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}#Wa(t,e){const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#Fa&&clearTimeout(this.#Fa),this.#Fa=setTimeout(()=>{this.#Fa=null,this.#Ua(t,e)},200)}#$a(t,e){const{width:i,height:n}=this.#Pa;let s=i,r=n,a=this.#Pa;for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}#Ua(t,e){const i=new mt,n=Math.ceil(t*i.sx),s=Math.ceil(e*i.sy),r=this.#La;if(!r||r.width===n&&r.height===s)return;r.width=n,r.height=s;const a=this.#Oa?this.#Pa:this.#$a(n,s),o=r.getContext("2d");o.filter=this._uiManager.hcmFilter,o.drawImage(a,0,0,a.width,a.height,0,0,n,s)}getImageForAltText(){return this.#La}#Va(t){if(t){if(this.#Oa){const t=this._uiManager.imageManager.getSvgUrl(this.#Ma);if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#Pa),t.getContext("2d").drawImage(this.#Pa,0,0),t.toDataURL()}if(this.#Oa){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Z.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Z.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(this.#Pa,0,0,this.#Pa.width,this.#Pa.height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(this.#Pa)}#oa(){this._uiManager._signal&&(this.#Jr=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.#Wa(e.width,e.height)}),this.#Jr.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#Jr?.disconnect(),this.#Jr=null},{once:!0}))}static async deserialize(t,e,i){let n=null;if(t instanceof en){const{data:{rect:s,rotation:r,id:a,structParent:o,popupRef:l},container:c,parent:{page:{pageNumber:h}}}=t,d=c.querySelector("canvas"),u=i.imageManager.getFromCanvas(c.id,d);d.remove();const p=(await e._structTree.getAriaAttributes(`${Y}${a}`))?.get("aria-label")||"";n=t={annotationType:g.STAMP,bitmapId:u.id,bitmap:u.bitmap,pageIndex:h-1,rect:s.slice(0),rotation:r,id:a,deleted:!1,accessibilityData:{decorative:!1,altText:p},isSvg:!1,structParent:o,popupRef:l}}const s=await super.deserialize(t,e,i),{rect:r,bitmap:a,bitmapUrl:o,bitmapId:l,isSvg:c,accessibilityData:h}=t;l&&i.imageManager.isValidId(l)?(s.#Ma=l,a&&(s.#Pa=a)):s.#Ia=o,s.#Oa=c;const[d,u]=s.pageDimensions;return s.width=(r[2]-r[0])/d,s.height=(r[3]-r[1])/u,s.annotationElementId=t.id||null,h&&(s.altTextData=h),s._initialData=n,s.#za=!!n,s}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i={annotationType:g.STAMP,bitmapId:this.#Ma,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Oa,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#Va(!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}
vendor: 5,621 bytes, line 1
1),this.annotationElementId){const t=this.#vs(i);if(t.isSame)return null;t.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,null===e)return i;e.stamps||=new Map;const r=this.#Oa?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#Ma)){if(this.#Oa){const t=e.stamps.get(this.#Ma);r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Va(!1))}}else e.stamps.set(this.#Ma,{area:r,serialized:i}),i.bitmap=this.#Va(!1);return i}#vs(t){const{rect:e,pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.rect.every((t,i)=>Math.abs(t-e[i])<1),r=t.pageIndex===i,a=(t.accessibilityData?.alt||"")===n;return{isSame:s&&r&&a,isSameAltText:a}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}class vn{#es;#Ga=!1;#qa=null;#Xa=null;#Ya=null;#Ka=new Map;#Za=!1;#Ja=!1;#Qa=!1;#to=null;#eo=null;#m;static _initialized=!1;static#B=new Map([an,gn,bn,mn].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:c}){const h=[...vn.#B.values()];if(!vn._initialized){vn._initialized=!0;for(const e of h)e.initialize(c,t)}t.registerEditorTypes(h),this.#m=t,this.pageIndex=e,this.div=i,this.#es=s,this.#qa=r,this.viewport=l,this.#to=o,this.drawLayer=a,this._structTree=n,this.#m.addLayer(this)}get isEmpty(){return 0===this.#Ka.size}get isInvisible(){return this.isEmpty&&this.#m.getMode()===g.NONE}updateToolbar(t){this.#m.updateToolbar(t)}updateMode(t=this.#m.getMode()){switch(this.#io(),t){case g.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case g.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case g.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of vn.#B.values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#to?.div}addInkEditorIfNeeded(t){if(this.#m.getMode()===g.INK){if(!t)for(const t of this.#Ka.values())if(t.isEmpty())return void t.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){this.#m.setEditingState(t)}addCommands(t){this.#m.addCommands(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#qa?.div.classList.toggle("disabled",!t)}async enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const e of this.#Ka.values())e.enableEditing(),e.show(!0),e.annotationElementId&&(this.#m.removeChangedExistingAnnotation(e),t.add(e.annotationElementId));if(!this.#qa)return;const e=this.#qa.getEditableAnnotations();for(const i of e){if(i.hide(),this.#m.isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=await this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){this.#Qa=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const i of this.#Ka.values())i.disableEditing(),i.annotationElementId&&(null===i.serialize()?(e.set(i.annotationElementId,i),this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()):t.set(i.annotationElementId,i));if(this.#qa){const i=this.#qa.getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(this.#m.isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(this.#m.addChangedExistingAnnotation(s),s.renderAnnotationElement(n)&&s.show(!1)),n.show())}}this.#io(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const t of vn.#B.values())i.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Qa=!1}getEditableAnnotation(t){return this.#qa?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#m.getActive()!==t&&this.#m.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#to?.div&&!this.#eo){this.#eo=new AbortController;const t=this.#m.combinedSignal(this.#eo);this.#to.div.addEventListener("pointerdown",this.#no.bind(this),{signal:t}),this.#to.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#to?.div&&this.#eo&&(this.#eo.abort(),this.#eo=null,this.#to.div.classList.remove("highlighting"))}#no(t){this.#m.unselectAll();const{target:e}=t;if(e===this.#to.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&this.#to.div.contains(e)){const{isMac:e}=$.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#m.showAllEditors("highlight",!0,!0),this.#to.div.classList.add("free"),this.toggleDrawing(),mn.startHighlighting(this,"ltr"===this.#m.direction,{target:this.#to.div,x:t.x,y:t.y}),this.#to.div.addEventListener("pointerup",()=>{this.#to.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#m._signal}),t.preventDefault()}}enableClick(){if(this.#Xa)return;this.#Xa=new AbortController;const t=this.#m.combinedSignal(this.#Xa);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:t})}disableClick(){this.#Xa?.abort(),this.#Xa=null}
1attach(t){this.#Ka.set(t.id,t);const{annotationElementId:e}=t;e&&this.#m.isDeletedAnnotationElement(e)&&this.#m.removeDeletedAnnotationElement(t)}detach(t){this.#Ka.delete(t.id),this.#es?.removePointerInTextLayer(t.contentDiv),!this.#Qa&&t.annotationElementId&&this.#m.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#m.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#Ja||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#m.addDeletedAnnotationElement(t.annotationElementId),kt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#m.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#m.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Ya&&(t._focusEventsAllowed=!1,this.#Ya=setTimeout(()=>{this.#Ya=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#m._signal}),e.focus())},0)),t._structTreeParentId=this.#es?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#m.getId()}get#so(){return vn.#B.get(this.#m.getMode())}combinedSignal(t){return this.#m.combinedSignal(t)}#ro(t){const e=this.#so;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#so?.canCreateNewEmptyEditor()}pasteEditor(t,e){this.#m.updateToolbar(t),this.#m.updateMode(t);const{offsetX:i,offsetY:n}=this.#ao(),s=this.getNextId(),r=this.#ro({parent:this,id:s,x:i,y:n,uiManager:this.#m,isCentered:!0,...e});r&&this.add(r)}async deserialize(t){return await(vn.#B.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#m))||null}createAndAddNewEditor(t,e,i={}){const n=this.getNextId(),s=this.#ro({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#m,isCentered:e,...i});return s&&this.add(s),s}#ao(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}addNewEditor(){this.createAndAddNewEditor(this.#ao(),!0)}setSelected(t){this.#m.setSelected(t)}toggleSelected(t){this.#m.toggleSelected(t)}unselect(t){this.#m.unselect(t)}pointerup(t){const{isMac:e}=$.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Za&&(this.#Za=!1,this.#Ga?this.#m.getMode()!==g.STAMP?this.createAndAddNewEditor(t,!1):this.#m.unselectAll():this.#Ga=!0)}pointerdown(t){if(this.#m.getMode()===g.HIGHLIGHT&&this.enableTextSelection(),this.#Za)return void(this.#Za=!1);const{isMac:e}=$.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Za=!0;const i=this.#m.getActive();this.#Ga=!i||i.isEmpty()}findNewParent(t,e,i){const n=this.#m.findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){this.#m.getActive()?.parent===this&&(this.#m.commitOrRemove(),this.#m.setActiveEditor(null)),this.#Ya&&(clearTimeout(this.#Ya),this.#Ya=null);for(const t of this.#Ka.values())this.#es?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Ka.clear(),this.#m.removeLayer(this)}#io(){this.#Ja=!0;for(const t of this.#Ka.values())t.isEmpty()&&t.remove();this.#Ja=!1}render({viewport:t}){this.viewport=t,ft(this.div,t);for(const t of this.#m.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){this.#m.commitOrRemove(),this.#io();const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,ft(this.div,{rotation:i}),e!==i)for(const t of this.#Ka.values())t.rotate(i);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#m.viewParameters.realScale}}class yn{#Ln=null;#y=0;#oo=new Map;#lo=new Map;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#Ln){if(this.#Ln!==t){if(this.#oo.size>0)for(const e of this.#oo.values())e.remove(),t.append(e);this.#Ln=t}}else this.#Ln=t}static get _svgFactory(){return R(this,"_svgFactory",new Si)}static#co(t,{x:e=0,y:i=0,width:n=1,height:s=1}={}){const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"}#ho(t){const e=yn._svgFactory.create(1,1,!0);return this.#Ln.append(e),e.setAttribute("aria-hidden",!0),yn.#co(e,t),e}#do(t,e){const i=yn._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=yn._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n}draw(t,e,i,n=!1){const s=this.#y++,r=this.#ho(t.box);r.classList.add(...t.classNamesForDrawing);const a=yn._svgFactory.createElement("defs");r.append(a);const o=yn._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",l),o.setAttribute("d",t.toSVGPath()),n&&this.#lo.set(s,o);const c=this.#do(a,l),h=yn._svgFactory.createElement("use");return r.append(h),r.setAttribute("fill",e),r.setAttribute("fill-opacity",i),h.setAttribute("href",`#${l}`),this.#oo.set(s,r),{id:s,clipPathId:`url(#${c})`}}drawOutline(t){const e=this.#y++,i=this.#ho(t.box);i.classList.add(...t.classNamesForOutlining);const n=yn._svgFactory.createElement("defs");i.append(n);const s=yn._svgFactory.createElement("path");n.append(s);const r=`path_p${this.pageIndex}_${e}`;let a;if(s.setAttribute("id",r),s.setAttribute("d",t.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke"),t.mustRemoveSelfIntersections){const t=yn._svgFactory.createElement("mask");n.append(t),a=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",a),t.setAttribute("maskUnits","objectBoundingBox");const i=yn._svgFactory.createElement("rect");t.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const s=yn._svgFactory.createElement("use");t.append(s),s.setAttribute("href",`#${r}`),s.setAttribute("stroke","none"),s.setAttribute("fill","black"),s.setAttribute("fill-rule","nonzero"),s.classList.add("mask")}const o=yn._svgFactory.createElement("use");i.append(o),o.setAttribute("href",`#${r}`),a&&o.setAttribute("mask",`url(#${a})`);const l=o.cloneNode();return i.append(l),o.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#oo.set(e,i),e}finalizeLine(t,e){const i=this.#lo.get(t);this.#lo.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){this.#oo.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}updatePath(t,e){this.#lo.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){yn.#co(this.#oo.get(t),e)}show(t,e){this.#oo.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#oo.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#oo.get(t).setAttribute("fill",e)}
1changeOpacity(t,e){this.#oo.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#oo.get(t).classList.add(e)}removeClass(t,e){this.#oo.get(t).classList.remove(e)}getSVGRoot(t){return this.#oo.get(t)}remove(t){this.#lo.delete(t),null!==this.#Ln&&(this.#oo.get(t).remove(),this.#oo.delete(t))}destroy(){this.#Ln=null;for(const t of this.#oo.values())t.remove();this.#oo.clear(),this.#lo.clear()}}var wn=h.AnnotationLayer,xn=h.AnnotationMode,_n=h.GlobalWorkerOptions,An=h.PDFDataRangeTransport,Cn=h.TextLayer,Sn=h.getDocument,kn=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},En=kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn(kn([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function Tn(t,e){var i={};return En.forEach(function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)}),i}function Pn(t){var e=!1;return{promise:new Promise(function(i,n){t.then(function(t){return!e&&i(t)}).catch(function(t){return!e&&n(t)})}),cancel:function(){e=!0}}}var Mn=i(34164),Rn=!0,In="Invariant failed";function Nn(t,e){if(!t){if(Rn)throw new Error(In);var i="function"==typeof e?e():e,n=i?"".concat(In,": ").concat(i):In;throw new Error(n)}}var Dn=i(9771),Ln=Object.prototype.hasOwnProperty;function Fn(t,e,i){for(i of t.keys())if(On(i,e))return i}function On(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&On(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"==typeof s&&!(s=Fn(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"==typeof s&&!(s=Fn(e,s)))return!1;if(!On(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"==typeof t){for(i in n=0,t){if(Ln.call(t,i)&&++n&&!Ln.call(e,i))return!1;if(!(i in e)||!On(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!=t&&e!=e}var zn=(0,r.createContext)(null);function jn({children:t,type:e}){return(0,s.jsx)("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}class Bn{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Nn(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){Nn(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{Nn(this.pdfDocument,"PDF document not loaded."),Nn(t,"Destination is not specified."),"string"==typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Nn(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise(t=>{Nn(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Nn(!1,`"${e}" is not a valid page reference.`)}):"number"==typeof e?t(e):Nn(!1,`"${e}" is not a valid destination reference.`)}).then(e=>{const i=e+1;Nn(this.pdfViewer,"PDF viewer is not initialized."),Nn(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;Nn(this.pdfViewer,"PDF viewer is not initialized."),Nn(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}var Hn=1,Un=2;const $n="undefined"!=typeof window,Wn=$n&&"file:"===window.location.protocol;function Vn(t){return function(t){return void 0!==t}(t)&&null!==t}function Gn(t){return function(t){return"string"==typeof t}(t)&&/^data:/.test(t)}function qn(t){Nn(Gn(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function Xn(){return $n&&window.devicePixelRatio||1}
1function Yn(){Dn(!Wn,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.")}function Kn(t){(null==t?void 0:t.cancel)&&t.cancel()}function Zn(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function Jn(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function Qn(){return(0,r.useReducer)(Jn,{value:void 0,error:void 0})}var ts=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:es}=n,is=(t,e)=>{switch(e){case Hn:t(prompt("Enter the password to open this PDF file."));break;case Un:t(prompt("Invalid password. Please try again."))}};function ns(t){return"object"==typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}var ss=(0,r.forwardRef)(function(t,e){var{children:i,className:n,error:a="Failed to load PDF file.",externalLinkRel:o,externalLinkTarget:l,file:c,inputRef:h,imageResourcesPath:d,loading:u="Loading PDFâ¦",noData:p="No PDF file specified.",onItemClick:f,onLoadError:m,onLoadProgress:g,onLoadSuccess:b,onPassword:v=is,onSourceError:y,onSourceSuccess:w,options:x,renderMode:_,rotate:A}=t,C=ts(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[S,k]=Qn(),{value:E,error:T}=S,[P,M]=Qn(),{value:R,error:I}=P,N=(0,r.useRef)(new Bn),D=(0,r.useRef)([]),L=(0,r.useRef)(void 0),F=(0,r.useRef)(void 0);c&&c!==L.current&&ns(c)&&(Dn(!On(c,L.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),L.current=c),x&&x!==F.current&&(Dn(!On(x,F.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),F.current=x);const O=(0,r.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(f)return void f({dest:e,pageIndex:n,pageNumber:i});const s=D.current[n];s?s.scrollIntoView():Dn(!1,`An internal link leading to page ${i} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,r.useImperativeHandle)(e,()=>({linkService:N,pages:D,viewer:O}),[]),(0,r.useEffect)(function(){k({type:"RESET"})},[c,k]);const z=(0,r.useCallback)(()=>{return t=this,e=void 0,n=function*(){if(!c)return null;if("string"==typeof c)return Gn(c)?{data:qn(c)}:(Yn(),{url:c});if(c instanceof es)return{range:c};if(c instanceof ArrayBuffer)return{data:c};if($n&&(t=c,Nn($n,"isBlob can only be used in a browser environment"),t instanceof Blob)){const t=yield function(t){return new Promise((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)})}(c);return{data:t}}var t;if(Nn("object"==typeof c,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),Nn(ns(c),"Invalid parameter object: need either .data, .range or .url"),"url"in c&&"string"==typeof c.url){if(Gn(c.url)){const{url:t}=c,e=ts(c,["url"]),i=qn(t);return Object.assign({data:i},e)}Yn()}return c}
1,new((i=void 0)||(i=Promise))(function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((n=n.apply(t,e||[])).next())});var t,e,i,n},[c]);(0,r.useEffect)(()=>{const t=Pn(z());return t.promise.then(t=>{k({type:"RESOLVE",value:t})}).catch(t=>{k({type:"REJECT",error:t})}),()=>{Kn(t)}},[z,k]),(0,r.useEffect)(()=>{void 0!==E&&(!1!==E?w&&w():T&&(Dn(!1,T.toString()),y&&y(T)))},[E]),(0,r.useEffect)(function(){M({type:"RESET"})},[M,E]),(0,r.useEffect)(function(){if(!E)return;const t=x?Object.assign(Object.assign({},E),x):E,e=Sn(t);g&&(e.onProgress=g),v&&(e.onPassword=v);const i=e,n=i.promise.then(t=>{M({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||M({type:"REJECT",error:t})});return()=>{n.finally(()=>i.destroy())}},[x,M,E]),(0,r.useEffect)(()=>{void 0!==R&&(!1!==R?R&&(b&&b(R),D.current=new Array(R.numPages),N.current.setDocument(R)):I&&(Dn(!1,I.toString()),m&&m(I)))},[R]),(0,r.useEffect)(function(){N.current.setViewer(O.current),N.current.setExternalLinkRel(o),N.current.setExternalLinkTarget(l)},[o,l]);const j=(0,r.useCallback)((t,e)=>{D.current[t]=e},[]),B=(0,r.useCallback)(t=>{delete D.current[t]},[]),H=(0,r.useMemo)(()=>({imageResourcesPath:d,linkService:N.current,onItemClick:f,pdf:R,registerPage:j,renderMode:_,rotate:A,unregisterPage:B}),[d,f,R,j,_,A,B]),U=(0,r.useMemo)(()=>Tn(C,()=>R),[C,R]);return(0,s.jsx)("div",Object.assign({className:(0,Mn.A)("react-pdf__Document",n),ref:h,style:{"--scale-factor":"1"}},U,{children:c?null==R?(0,s.jsx)(jn,{type:"loading",children:"function"==typeof u?u():u}):!1===R?(0,s.jsx)(jn,{type:"error",children:"function"==typeof a?a():a}):(0,s.jsx)(zn.Provider,{value:H,children:i}):(0,s.jsx)(jn,{type:"no-data",children:"function"==typeof p?p():p})}))});function rs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach(function(e){"function"==typeof e?e(t):e&&(e.current=t)})}}var as=(0,r.createContext)(null);const os={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},ls=/^H(\d+)$/;function cs(t){return"children"in t}function hs(t){return!!cs(t)&&1===t.children.length&&0 in t.children&&"id"in t.children[0]}function ds(t){const e={};if(cs(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),hs(t)){const[i]=t.children;if(i){const t=ds(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function us(t){return t?Object.assign(Object.assign({},function(t){const e={};if(cs(t)){const{role:i}=t,n=i.match(ls);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in os}(i)){const t=os[i];t&&(e.role=t)}}return e}(t)),ds(t)):null}function ps({className:t,node:e}){const i=(0,r.useMemo)(()=>us(e),[e]),n=(0,r.useMemo)(()=>cs(e)?hs(e)?null:e.children.map((t,e)=>(0,s.jsx)(ps,{node:t},e)):null,[e]);return(0,s.jsx)("span",Object.assign({className:t},i,{children:n}))}function fs(){return(0,r.useContext)(as)}function ms(){const t=fs();Nn(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,a]=Qn(),{value:o,error:l}=n,{customTextRenderer:c,page:h}=t;return(0,r.useEffect)(function(){a({type:"RESET"})},[a,h]),(0,r.useEffect)(function(){if(c)return;if(!h)return;const t=Pn(h.getStructTree()),e=t;return t.promise.then(t=>{a({type:"RESOLVE",value:t})}).catch(t=>{a({type:"REJECT",error:t})}),()=>Kn(e)},[c,h,a]),(0,r.useEffect)(()=>{void 0!==o&&(!1!==o?o&&i&&i(o):l&&(Dn(!1,l.toString()),e&&e(l)))},[o]),o?(0,s.jsx)(ps,{className:"react-pdf__Page__structTree structTree",node:o}):null}const gs=xn;function bs(t){const e=fs();Nn(e,"Unable to find Page context.");const i=Object.assign(Object.assign({}
1,e),t),{_className:n,canvasBackground:a,devicePixelRatio:o=Xn(),onRenderError:l,onRenderSuccess:c,page:h,renderForms:d,renderTextLayer:u,rotate:p,scale:f}=i,{canvasRef:m}=t;Nn(h,"Attempted to render page canvas, but no page was specified.");const g=(0,r.useRef)(null);function b(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(Dn(!1,t.toString()),l&&l(t))}const v=(0,r.useMemo)(()=>h.getViewport({scale:f*o,rotation:p}),[o,h,p,f]),y=(0,r.useMemo)(()=>h.getViewport({scale:f,rotation:p}),[h,p,f]);(0,r.useEffect)(function(){if(!h)return;h.cleanup();const{current:t}=g;if(!t)return;t.width=v.width,t.height=v.height,t.style.width=`${Math.floor(y.width)}px`,t.style.height=`${Math.floor(y.height)}px`,t.style.visibility="hidden";const e={annotationMode:d?gs.ENABLE_FORMS:gs.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:v};a&&(e.background=a);const i=h.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",h&&c&&c(Zn(h,f))}).catch(b),()=>Kn(n)},[a,h,d,v,y]);const w=(0,r.useCallback)(()=>{const{current:t}=g;t&&(t.width=0,t.height=0)},[]);return(0,r.useEffect)(()=>w,[w]),(0,s.jsx)("canvas",{className:`${n}__canvas`,dir:"ltr",ref:rs(m,g),style:{display:"block",userSelect:"none"},children:u?(0,s.jsx)(ms,{}):null})}function vs(){const t=fs();Nn(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:a,onRenderTextLayerSuccess:o,page:l,pageIndex:c,pageNumber:h,rotate:d,scale:u}=t;Nn(l,"Attempted to load page text content, but no page was specified.");const[p,f]=Qn(),{value:m,error:g}=p,b=(0,r.useRef)(null);Dn(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,r.useEffect)(function(){f({type:"RESET"})},[l,f]),(0,r.useEffect)(function(){if(!l)return;const t=Pn(l.getTextContent()),e=t;return t.promise.then(t=>{f({type:"RESOLVE",value:t})}).catch(t=>{f({type:"REJECT",error:t})}),()=>Kn(e)},[l,f]),(0,r.useEffect)(()=>{void 0!==m&&(!1!==m?m&&n&&n(m):g&&(Dn(!1,g.toString()),i&&i(g)))},[m]);const v=(0,r.useCallback)(()=>{o&&o()},[o]),y=(0,r.useCallback)(t=>{Dn(!1,t.toString()),a&&a(t)},[a]),w=(0,r.useMemo)(()=>l.getViewport({scale:u,rotation:d}),[l,d,u]);return(0,r.useLayoutEffect)(function(){if(!l||!m)return;const{current:t}=b;if(!t)return;t.innerHTML="";const i=l.streamTextContent({includeMarkedContent:!0}),n=new Cn({container:t,textContentSource:i,viewport:w}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i);const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;m.items.forEach((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:c,pageNumber:h,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(y),()=>Kn(s)},[e,y,v,l,c,h,m,w]),(0,s.jsx)("div",{className:(0,Mn.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=b.current;t&&t.classList.remove("selecting")},onMouseDown:function(){const t=b.current;t&&t.classList.add("selecting")},ref:b})}function ys(){return(0,r.useContext)(zn)}function ws(){const t=ys(),e=fs();Nn(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:a,onGetAnnotationsError:o,onGetAnnotationsSuccess:l,onRenderAnnotationLayerError:c,onRenderAnnotationLayerSuccess:h,page:d,pdf:u,renderForms:p,rotate:f,scale:m=1}=i;Nn(u,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),Nn(d,"Attempted to load page annotations, but no page was specified."),Nn(a,"Attempted to load page annotations, but no linkService was specified.");const[g,b]=Qn(),{value:v,error:y}=g,w=(0,r.useRef)(null);Dn(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,r.useEffect)(function(){b({type:"RESET"})},[b,d]),(0,r.useEffect)(function(){if(!d)return;const t=Pn(d.getAnnotations()),e=t;return t.promise.then(t=>{b({type:"RESOLVE",value:t})}).catch(t=>{b({type:"REJECT",error:t})}),()=>{Kn(e)}},[b,d]),(0,r.useEffect)(()=>{void 0!==v&&(!1!==v?v&&l&&l(v):y&&(Dn(!1,y.toString()),o&&o(y)))},[v]);const x=(0,r.useMemo)(()=>d.getViewport({scale:m,rotation:f}),[d,f,m]);return(0,r.useEffect)(function(){if(!(u&&d&&a&&v))return;const{current:t}=w;if(!t)return;const e=x.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:d,structTreeLayer:null,viewport:e},s={annotations:v,annotationStorage:u.annotationStorage,div:t,imageResourcesPath:n,linkService:a,page:d,renderForms:p,viewport:e};t.innerHTML="";try{new wn(i).render(s),h&&h()}catch(t){!function(t){Dn(!1,`${t}`),c&&c(t)}(t)}return()=>{}},[v,n,a,d,u,p,x]),(0,s.jsx)("div",{className:(0,Mn.A)("react-pdf__Page__annotations","annotationLayer"),ref:w})}var xs=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const _s=1;function As(t){const e=ys(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:a=!0,canvasBackgroun
1d:o,canvasRef:l,children:c,className:h,customRenderer:d,customTextRenderer:u,devicePixelRatio:p,error:f="Failed to load the page.",height:m,inputRef:g,loading:b="Loading pageâ¦",noData:v="No page specified.",onGetAnnotationsError:y,onGetAnnotationsSuccess:w,onGetStructTreeError:x,onGetStructTreeSuccess:_,onGetTextError:A,onGetTextSuccess:C,onLoadError:S,onLoadSuccess:k,onRenderAnnotationLayerError:E,onRenderAnnotationLayerSuccess:T,onRenderError:P,onRenderSuccess:M,onRenderTextLayerError:R,onRenderTextLayerSuccess:I,pageIndex:N,pageNumber:D,pdf:L,registerPage:F,renderAnnotationLayer:O=!0,renderForms:z=!1,renderMode:j="canvas",renderTextLayer:B=!0,rotate:H,scale:U=_s,unregisterPage:$,width:W}=i,V=xs(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[G,q]=Qn(),{value:X,error:Y}=G,K=(0,r.useRef)(null);Nn(L,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const Z=Vn(D)?D-1:null!=N?N:null,J=null!=D?D:Vn(N)?N+1:null,Q=null!=H?H:X?X.rotate:null,tt=(0,r.useMemo)(()=>{if(!X)return null;let t=1;const e=null!=U?U:_s;if(W||m){const e=X.getViewport({scale:1,rotation:Q});W?t=W/e.width:m&&(t=m/e.height)}return e*t},[m,X,Q,U,W]);(0,r.useEffect)(function(){return()=>{Vn(Z)&&a&&$&&$(Z)}},[a,L,Z,$]),(0,r.useEffect)(function(){q({type:"RESET"})},[q,L,Z]),(0,r.useEffect)(function(){if(!L||!J)return;const t=Pn(L.getPage(J)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>Kn(e)},[q,L,J]),(0,r.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(k){if(!X||!tt)return;k(Zn(X,tt))}if(a&&F){if(!Vn(Z)||!K.current)return;F(Z,K.current)}}():Y&&(Dn(!1,Y.toString()),S&&S(Y)))},[X,tt]);const et=(0,r.useMemo)(()=>X&&Vn(Z)&&J&&Vn(Q)&&Vn(tt)?{_className:n,canvasBackground:o,customTextRenderer:u,devicePixelRatio:p,onGetAnnotationsError:y,onGetAnnotationsSuccess:w,onGetStructTreeError:x,onGetStructTreeSuccess:_,onGetTextError:A,onGetTextSuccess:C,onRenderAnnotationLayerError:E,onRenderAnnotationLayerSuccess:T,onRenderError:P,onRenderSuccess:M,onRenderTextLayerError:R,onRenderTextLayerSuccess:I,page:X,pageIndex:Z,pageNumber:J,renderForms:z,renderTextLayer:B,rotate:Q,scale:tt}:null,[n,o,u,p,y,w,x,_,A,C,E,T,P,M,R,I,X,Z,J,z,B,Q,tt]),it=(0,r.useMemo)(()=>Tn(V,()=>X?tt?Zn(X,tt):void 0:X),[V,X,tt]),nt=`${Z}@${tt}/${Q}`;return(0,s.jsx)("div",Object.assign({className:(0,Mn.A)(n,h),"data-page-number":J,ref:rs(g,K),style:{"--scale-factor":`${tt}`,backgroundColor:o||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},it,{children:J?null===L||null==X?(0,s.jsx)(jn,{type:"loading",children:"function"==typeof b?b():b}):!1===L||!1===X?(0,s.jsx)(jn,{type:"error",children:"function"==typeof f?f():f}):(0,s.jsxs)(as.Provider,{value:et,children:[function(){switch(j){case"custom":return Nn(d,'renderMode was set to "custom", but no customRenderer was passed.'),(0,s.jsx)(d,{},`${nt}_custom`);case"none":return null;default:return(0,s.jsx)(bs,{canvasRef:l},`${nt}_canvas`)}}(),B?(0,s.jsx)(vs,{},`${nt}_text`):null,O?(0,s.jsx)(ws,{},`${nt}_annotations`):null,c]}):(0,s.jsx)(jn,{type:"no-data",children:"function"==typeof v?v():v})}))}var Cs,Ss=i(71710);function ks(t){return/^[^"'].*\s.*[^"']$/.test(t)?`'${t}'`:t}function Es(t){let e=t.lastIndexOf("/")+1;return[0==e?"":t.substring(0,e),0==e?t:t.substring(e)]}function Ts(t,e){try{const i="http://docx/";return new URL(t,i+e).toString().substring(i.length)}catch{return`${e}${t}`}}function Ps(t,e){return t.reduce((t,i)=>(t[e(i)]=i,t),{})}function Ms(t){return t&&"object"==typeof t&&!Array.isArray(t)}function Rs(t,...e){if(!e.length)return t;const i=e.shift();if(Ms(t)&&Ms(i))for(const e in i)Ms(i[e])?Rs(t[e]??(t[e]={}),i[e]):t[e]=i[e];return Rs(t,...e)}function Is(t){return Array.isArray(t)?t:[t]}!function(t){t.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",t.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",t.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",t.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",t.
vendor: 51,648 bytes, line 1
1Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",t.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",t.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",t.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",t.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",t.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",t.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",t.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",t.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",t.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",t.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",t.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",t.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",t.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",t.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",t.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"}(Cs||(Cs={}));const Ns="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Ds={mul:.05,unit:"pt"},Ls={mul:1/12700,unit:"pt"},Fs={mul:.5,unit:"pt"},Os={mul:.125,unit:"pt",min:.25,max:12},zs={mul:1,unit:"pt"},js={mul:.02,unit:"%"};function Bs(t,e=Ds){if(null==t||/.+(p[xt]|[%])$/.test(t))return t;var i=parseInt(t)*e.mul;return e.min&&e.max&&(i=function(t,e,i){return e>t?e:i<t?i:t}(i,e.min,e.max)),`${i.toFixed(2)}${e.unit}`}function Hs(t,e,i){if(t.namespaceURI!=Ns)return!1;switch(t.localName){case"color":e.color=i.attr(t,"val");break;case"sz":e.fontSize=i.lengthAttr(t,"val",Fs);break;default:return!1}return!0}class Us{elements(t,e=null){const i=[];for(let n=0,s=t.childNodes.length;n<s;n++){let s=t.childNodes.item(n);s.nodeType!=Node.ELEMENT_NODE||null!=e&&s.localName!=e||i.push(s)}return i}element(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){let n=t.childNodes.item(i);if(1==n.nodeType&&n.localName==e)return n}return null}elementAttr(t,e,i){var n=this.element(t,e);return n?this.attr(n,i):void 0}attrs(t){return Array.from(t.attributes)}attr(t,e){for(let i=0,n=t.attributes.length;i<n;i++){let n=t.attributes.item(i);if(n.localName==e)return n.value}return null}intAttr(t,e,i=null){var n=this.attr(t,e);return n?parseInt(n):i}hexAttr(t,e,i=null){var n=this.attr(t,e);return n?parseInt(n,16):i}floatAttr(t,e,i=null){var n=this.attr(t,e);return n?parseFloat(n):i}boolAttr(t,e,i=null){return function(t,e=!1){switch(t){case"1":case"on":case"true":return!0;case"0":case"off":case"false":return!1;default:return e}}(this.attr(t,e),i)}lengthAttr(t,e,i=Ds){return Bs(this.attr(t,e),i)}}const $s=new Us;class Ws{constructor(t,e){this._package=t,this.path=e}async load(){this.rels=await this._package.loadRelationships(this.path);const t=await this._package.load(this.path),e=this._package.parseXmlDocument(t);this._package.options.keepOrigin&&(this._xmlDocument=e),this.parseXml(e.firstElementChild)}save(){var t;this._package.update(this.path,(t=this._xmlDocument,(new XMLSerializer).serializeToString(t)))}parseXml(t){}}const Vs={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function Gs(t,e){return{id:e.attr(t,"id"),key:e.attr(t,"fontKey"),type:Vs[t.localName]}}class qs extends Ws{parseXml(t){this.fonts=function(t,e){return e.elements(t).map(t=>function(t,e){let i={name:e.attr(t,"name"),embedFontRefs:[]};for(let n of e.elements(t))switch(n.localName){case"family":i.family=e.attr(n,"val");break;case"altName":i.altName=e.attr(n,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":i.embedFontRefs.push(Gs(n,e))}return i}(t,e))}(t,this._package.xmlParser)}}class Xs{constructor(t,e){this._zip=t,this.options=e,this.xmlParser=new Us}get(t){const e=function(t){return t.startsWith("/")?t.substr(1):t}(t);return this._zip.files[e]??this._zip.files[e.replace(/\//g,"\\")]}update(t,e){this._zip.file(t,e)}static async load(t,e){const i=await Ss.loadAsync(t);return new Xs(i,e)}save(t="blob"){return this._zip.generateAsync({type:t})}load(t,e="string"){return this.get(t)?.async(e)??Promise.resolve(null)}async loadRelationships(t=null){let e="_rels/.rels";if(null!=t){const[i,n]=Es(t);e=`${i}_rels/${n}.rels`}const i=await this.load(e);return i?(n=this.parseXmlDocument(i).firstElementChild,(s=this.xmlParser).elements(n).map(t=>({id:s.attr(t,"Id"),type:s.attr(t,"Type"),target:s.attr(t,"Target"),targetMode:s.attr(t,"TargetMode")}))):null;var n,s}parseXmlDocument(t){return function(t,e=!1){var i;e&&(t=t.replace(/<[?].*[?]>/,"")),t=65279===(i=t).charCodeAt(0)?i.substring(1):i;const n=(new DOMParser).parseFromString(t,"application/xml"),s=(r=n,r.getElementsByTagName("parsererror")[0]?.textContent);var r;if(s)throw new Error(s);return n}(t,this.options.trimXmlDeclaration)}}class Ys extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}parseXml(t){this.body=this._documentParser.parseDocumentFile(t)}}function Ks(t,e){return{type:e.attr(t,"val"),color:e.attr(t,"color"),size:e.lengthAttr(t,"sz",Os),offset:e.lengthAttr(t,"space",zs),frame:e.boolAttr(t,"frame"),shadow:e.boolAttr(t,"shadow")}}function Zs(t,e){var i={};for(let n of e.elements(t))switch(n.localName){case"left":i.left=Ks(n,e);break;case"top":i.top=Ks(n,e);break;case"right":i.right=Ks(n,e);break;case"bottom":i.bottom=Ks(n,e)}return i}var Js,Qs;function tr(t,e=$s){var i={};for(let n of e.elements(t))switch(n.localName){case"pgSz":i.pageSize={width:e.lengthAttr(n,"w"),height:e.lengthAttr(n,"h"),orientation:e.attr(n,"orient")};break;case"type":i.type=e.attr(n,"val");break;case"pgMar":i.pageMargins={left:e.lengthAttr(n,"left"),right:e.lengthAttr(n,"right"),top:e.lengthAttr(n,"top"),bottom:e.lengthAttr(n,"bottom"),header:e.lengthAttr(n,"header"),footer:e.lengthAttr(n,"footer"),gutter:e.lengthAttr(n,"gutter")};break;case"cols":i.columns=er(n,e);break;case"headerReference":(i.headerRefs??(i.headerRefs=[])).push(nr(n,e));break;case"footerReference":(i.footerRefs??(i.footerRefs=[])).push(nr(n,e));break;case"titlePg":i.titlePage=e.boolAttr(n,"val",!0);break;case"pgBorders":i.pageBorders=Zs(n,e);break;case"pgNumType":i.pageNumber=ir(n,e)}return i}function er(t,e){return{numberOfColumns:e.intAttr(t,"num"),space:e.lengthAttr(t,"space"),separator:e.boolAttr(t,"sep"),equalWidth:e.boolAttr(t,"equalWidth",!0),columns:e.elements(t,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function ir(t,e){return{chapSep:e.attr(t,"chapSep"),chapStyle:e.attr(t,"chapStyle"),format:e.attr(t,"fmt"),start:e.intAttr(t,"start")}}function nr(t,e){return{id:e.attr(t,"id"),type:e.attr(t,"type")}}function sr(t,e){let i={};for(let n of e.elements(t))rr(n,i,e);return i}function rr(t,e,i){return!!Hs(t,e,i)}function ar(t,e){let i={};for(let n of e.elements(t))or(n,i,e);return i}function or(t,e,i){if(t.namespaceURI!=Ns)return!1;if(Hs(t,e,i))return!0;switch(t.localName){case"tabs":e.tabs=function(t,e){return e.elements(t,"tab").map(t=>({position:e.lengthAttr(t,"pos"),leader:e.attr(t,"leader"),style:e.attr(t,"val")}))}(t,i);break;case"sectPr":e.sectionProps=tr(t,i);break;case"numPr":e.numbering=function(t,e){var i={};for(let n of e.elements(t))switch(n.localName){case"numId":i.id=e.attr(n,"val");break;case"ilvl":i.level=e.intAttr(n,"val")}return i}(t,i);break;case"spacing":return e.lineSpacing=function(t,e){return{before:e.lengthAttr(t,"before"),after:e.lengthAttr(t,"after"),line:e.intAttr(t,"line"),lineRule:e.attr(t,"lineRule")}}(t,i),!1;case"textAlignment":return e.textAlignment=i.attr(t,"val"),!1;case"keepLines":e.keepLines=i.boolAttr(t,"val",!0);break;case"keepNext":e.keepNext=i.boolAttr(t,"val",!0);break;case"pageBreakBefore":e.pageBreakBefore=i.boolAttr(t,"val",!0);break;case"outlineLvl":e.outlineLevel=i.intAttr(t,"val");break;case"pStyle":e.styleName=i.attr(t,"val");break;case"rPr":e.runProps=sr(t,i);break;default:return!1}return!0}function lr(t,e){let i={id:e.attr(t,"numId"),overrides:[]};for(let n of e.elements(t))switch(n.localName){case"abstractNumId":i.abstractId=e.attr(n,"val");break;case"lvlOverride":i.overrides.push(dr(n,e))}return i}function cr(t,e){let i={id:e.attr(t,"abstractNumId"),levels:[]};for(let n of e.elements(t))switch(n.localName){case"name":i.name=e.attr(n,"val");break;case"multiLevelType":i.multiLevelType=e.attr(n,"val");break;case"numStyleLink":i.numberingStyleLink=e.attr(n,"val");break;case"styleLink":i.styleLink=e.attr(n,"val");break;case"lvl":i.levels.push(hr(n,e))}return i}function hr(t,e){let i={level:e.intAttr(t,"ilvl")};for(let n of e.elements(t))switch(n.localName){case"start":i.start=e.attr(n,"val");break;case"lvlRestart":i.restart=e.intAttr(n,"val");break;case"numFmt":i.format=e.attr(n,"val");break;case"lvlText":i.text=e.attr(n,"val");break;case"lvlJc":i.justification=e.attr(n,"val");break;case"lvlPicBulletId":i.bulletPictureId=e.attr(n,"val");break;case"pStyle":i.paragraphStyle=e.attr(n,"val");break;case"pPr":i.paragraphProps=ar(n,e);break;case"rPr":i.runProps=sr(n,e)}return i}function dr(t,e){let i={level:e.intAttr(t,"ilvl")};for(let n of e.elements(t))switch(n.localName){case"startOverride":i.start=e.intAttr(n,"val");break;case"lvl":i.numberingLevel=hr(n,e)}return i}function ur(t,e){var i=e.element(t,"pict"),n=i&&e.element(i,"shape"),s=n&&e.element(n,"imagedata");return s?{id:e.attr(t,"numPicBulletId"),referenceId:e.attr(s,"id"),style:e.attr(n,"style")}:null}!function(t){t.Continuous="continuous",t.NextPage="nextPage",t.NextColumn="nextColumn",t.EvenPage="evenPage",t.OddPage="oddPage"}(Js||(Js={}));class pr extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}parseXml(t){Object.assign(this,function(t,e){let i={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let n of e.elements(t))switch(n.localName){case"num":i.numberings.push(lr(n,e));break;case"abstractNum":i.abstractNumberings.push(cr(n,e));break;case"numPicBullet":i.bulletPictures.push(ur(n,e))}return i}(t,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(t)}}class fr extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}parseXml(t){this.styles=this._documentParser.parseStylesFile(t)}}!function(t){t.Document="document",t.Paragraph="paragraph",t.Run="run",t.Break="break",t.NoBreakHyphen="noBreakHyphen",t.Table="table",t.Row="row",t.Cell="cell",t.Hyperlink="hyperlink",t.SmartTag="smartTag",t.Drawing="drawing",t.Image="image",t.Text="text",t.Tab="tab",t.Symbol="symbol",t.BookmarkStart="bookmarkStart",t.BookmarkEnd="bookmarkEnd",t.Footer="footer",t.Header="header",t.FootnoteReference="footnoteReference",t.EndnoteReference="endnoteReference",t.Footnote="footnote",t.Endnote="endnote",t.SimpleField="simpleField",t.ComplexField="complexField",t.Instruction="instruction",t.VmlPicture="vmlPicture",t.MmlMath="mmlMath",t.MmlMathParagraph="mmlMathParagraph",t.MmlFraction="mmlFraction",t.MmlFunction="mmlFunction",t.MmlFunctionName="mmlFunctionName",t.MmlNumerator="mmlNumerator",t.MmlDenominator="mmlDenominator",t.MmlRadical="mmlRadical",t.MmlBase="mmlBase",t.MmlDegree="mmlDegree",t.MmlSuperscript="mmlSuperscript",t.MmlSubscript="mmlSubscript",t.MmlPreSubSuper="mmlPreSubSuper",t.MmlSubArgument="mmlSubArgument",t.MmlSuperArgument="mmlSuperArgument",t.MmlNary="mmlNary",t.MmlDelimiter="mmlDelimiter",t.MmlRun="mmlRun",t.MmlEquationArray="mmlEquationArray",t.MmlLimit="mmlLimit",t.MmlLimitLower="mmlLimitLower",t.MmlMatrix="mmlMatrix",t.MmlMatrixRow="mmlMatrixRow",t.MmlBox="mmlBox",t.MmlBar="mmlBar",t.MmlGroupChar="mmlGroupChar",t.VmlElement="vmlElement",t.Inserted="inserted",t.Deleted="deleted",t.DeletedText="deletedText",t.Comment="comment",t.CommentReference="commentReference",t.CommentRangeStart="commentRangeStart",t.CommentRangeEnd="commentRangeEnd",t.AltChunk="altChunk"}(Qs||(Qs={}));class mr{constructor(){this.children=[],this.cssStyle={}}}class gr extends mr{constructor(){super(...arguments),this.type=Qs.Header}}class br extends mr{constructor(){super(...arguments),this.type=Qs.Footer}}class vr extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}parseXml(t){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(t)}}class yr extends vr{createRootElement(){return new gr}}class wr extends vr{createRootElement(){return new br}}function xr(t){if(void 0!==t)return parseInt(t)}class _r extends Ws{parseXml(t){this.props=function(t,e){const i={};for(let n of e.elements(t))switch(n.localName){case"Template":i.template=n.textContent;break;case"Pages":i.pages=xr(n.textContent);break;case"Words":i.words=xr(n.textContent);break;case"Characters":i.characters=xr(n.textContent);break;case"Application":i.application=n.textContent;break;case"Lines":i.lines=xr(n.textContent);break;case"Paragraphs":i.paragraphs=xr(n.textContent);break;case"Company":i.company=n.textContent;break;case"AppVersion":i.appVersion=n.textContent}return i}(t,this._package.xmlParser)}}class Ar extends Ws{parseXml(t){this.props=function(t,e){const i={};for(let n of e.elements(t))switch(n.localName){case"title":i.title=n.textContent;break;case"description":i.description=n.textContent;break;case"subject":i.subject=n.textContent;break;case"creator":i.creator=n.textContent;break;case"keywords":i.keywords=n.textContent;break;case"language":i.language=n.textContent;break;case"lastModifiedBy":i.lastModifiedBy=n.textContent;break;case"revision":n.textContent&&(i.revision=parseInt(n.textContent))}return i}(t,this._package.xmlParser)}}class Cr{}function Sr(t,e){var i={name:e.attr(t,"name"),colors:{}};for(let r of e.elements(t)){var n=e.element(r,"srgbClr"),s=e.element(r,"sysClr");n?i.colors[r.localName]=e.attr(n,"val"):s&&(i.colors[r.localName]=e.attr(s,"lastClr"))}return i}function kr(t,e){var i={name:e.attr(t,"name")};for(let n of e.elements(t))switch(n.localName){case"majorFont":i.majorFont=Er(n,e);break;case"minorFont":i.minorFont=Er(n,e)}return i}function Er(t,e){return{latinTypeface:e.elementAttr(t,"latin","typeface"),eaTypeface:e.elementAttr(t,"ea","typeface"),csTypeface:e.elementAttr(t,"cs","typeface")}}class Tr extends Ws{constructor(t,e){super(t,e)}parseXml(t){this.theme=function(t,e){var i=new Cr,n=e.element(t,"themeElements");for(let t of e.elements(n))switch(t.localName){case"clrScheme":i.colorScheme=Sr(t,e);break;case"fontScheme":i.fontScheme=kr(t,e)}return i}(t,this._package.xmlParser)}}class Pr{}class Mr extends Pr{constructor(){super(...arguments),this.type=Qs.Footnote}}class Rr extends Pr{constructor(){super(...arguments),this.type=Qs.Endnote}}class Ir extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}}class Nr extends Ir{constructor(t,e,i){super(t,e,i)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"footnote",Mr)}}class Dr extends Ir{constructor(t,e,i){super(t,e,i)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"endnote",Rr)}}function Lr(t,e){var i={defaultNoteIds:[]};for(let n of e.elements(t))switch(n.localName){case"numFmt":i.nummeringFormat=e.attr(n,"val");break;case"footnote":case"endnote":i.defaultNoteIds.push(e.attr(n,"id"))}return i}class Fr extends Ws{constructor(t,e){super(t,e)}parseXml(t){this.settings=function(t,e){var i={};for(let n of e.elements(t))switch(n.localName){case"defaultTabStop":i.defaultTabStop=e.lengthAttr(n,"val");break;case"footnotePr":i.footnoteProps=Lr(n,e);break;case"endnotePr":i.endnoteProps=Lr(n,e);break;case"autoHyphenation":i.autoHyphenation=e.boolAttr(n,"val")}return i}(t,this._package.xmlParser)}}class Or extends Ws{parseXml(t){this.props=function(t,e){return e.elements(t,"property").map(t=>{const i=t.firstChild;return{formatId:e.attr(t,"fmtid"),name:e.attr(t,"name"),type:i.nodeName,value:i.textContent}})}(t,this._package.xmlParser)}}class zr extends Ws{constructor(t,e,i){super(t,e),this._documentParser=i}parseXml(t){this.comments=this._documentParser.parseComments(t),this.commentMap=Ps(this.comments,t=>t.id)}}class jr extends Ws{constructor(t,e){super(t,e),this.comments=[]}parseXml(t){const e=this._package.xmlParser;for(let i of e.elements(t,"commentEx"))this.comments.push({paraId:e.attr(i,"paraId"),paraIdParent:e.attr(i,"paraIdParent"),done:e.boolAttr(i,"done")});this.commentMap=Ps(this.comments,t=>t.paraId)}}const Br=[{type:Cs.OfficeDocument,target:"word/document.xml"},{type:Cs.ExtendedProperties,target:"docProps/app.xml"},{type:Cs.CoreProperties,target:"docProps/core.xml"},{type:Cs.CustomProperties,target:"docProps/custom.xml"}];class Hr{constructor(){this.parts=[],this.partsMap={}}static async load(t,e,i){var n=new Hr;return n._options=i,n._parser=e,n._package=await Xs.load(t,i),n.rels=await n._package.loadRelationships(),await Promise.all(Br.map(t=>{const e=n.rels.find(e=>e.type===t.type)??t;return n.loadRelationshipPart(e.target,e.type)})),n}save(t="blob"){return this._package.save(t)}async loadRelationshipPart(t,e){if(this.partsMap[t])return this.partsMap[t];if(!this._package.get(t))return null;let i=null;switch(e){case Cs.OfficeDocument:this.documentPart=i=new Ys(this._package,t,this._parser);break;case Cs.FontTable:this.fontTablePart=i=new qs(this._package,t);break;case Cs.Numbering:this.numberingPart=i=new pr(this._package,t,this._parser);break;case Cs.Styles:this.stylesPart=i=new fr(this._package,t,this._parser);break;case Cs.Theme:this.themePart=i=new Tr(this._package,t);break;case Cs.Footnotes:this.footnotesPart=i=new Nr(this._package,t,this._parser);break;case Cs.Endnotes:this.endnotesPart=i=new Dr(this._package,t,this._parser);break;case Cs.Footer:i=new wr(this._package,t,this._parser);break;case Cs.Header:i=new yr(this._package,t,this._parser);break;case Cs.CoreProperties:this.corePropsPart=i=new Ar(this._package,t);break;case Cs.ExtendedProperties:this.extendedPropsPart=i=new _r(this._package,t);break;case Cs.CustomProperties:i=new Or(this._package,t);break;case Cs.Settings:this.settingsPart=i=new Fr(this._package,t);break;case Cs.Comments:this.commentsPart=i=new zr(this._package,t,this._parser);break;case Cs.CommentsExtended:this.commentsExtendedPart=i=new jr(this._package,t)}if(null==i)return Promise.resolve(null);if(this.partsMap[t]=i,this.parts.push(i),await i.load(),i.rels?.length>0){const[t]=Es(i.path);await Promise.all(i.rels.map(e=>this.loadRelationshipPart(Ts(e.target,t),e.type)))}return i}async loadDocumentImage(t,e){const i=await this.loadResource(e??this.documentPart,t,"blob");return this.blobToURL(i)}async loadNumberingImage(t){const e=await this.loadResource(this.numberingPart,t,"blob");return this.blobToURL(e)}async loadFont(t,e){const i=await this.loadResource(this.fontTablePart,t,"uint8array");return i?this.blobToURL(new Blob([Ur(i,e)])):i}async loadAltChunk(t,e){return await this.loadResource(e??this.documentPart,t,"string")}blobToURL(t){return t?this._options.useBase64URL?function(t){return new Promise((e,i)=>{const n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>i(),n.readAsDataURL(t)})}(t):URL.createObjectURL(t):null}findPartByRelId(t,e=null){var i=(e.rels??this.rels).find(e=>e.id==t);const n=e?Es(e.path)[0]:"";return i?this.partsMap[Ts(i.target,n)]:null}getPathById(t,e){const i=t.rels.find(t=>t.id==e),[n]=Es(t.path);return i?Ts(i.target,n):null}loadResource(t,e,i){const n=this.getPathById(t,e);return n?this._package.load(n,i):Promise.resolve(null)}}function Ur(t,e){const i=e.replace(/{|}|-/g,""),n=new Array(16);for(let t=0;t<16;t++)n[16-t-1]=parseInt(i.substring(2*t,2*t+2),16);for(let e=0;e<32;e++)t[e]=t[e]^n[e%16];return t}function $r(t,e){return{type:Qs.BookmarkStart,id:e.attr(t,"id"),name:e.attr(t,"name"),colFirst:e.intAttr(t,"colFirst"),colLast:e.intAttr(t,"colLast")}}function Wr(t,e){return{type:Qs.BookmarkEnd,id:e.attr(t,"id")}}class Vr extends mr{constructor(){super(...arguments),this.type=Qs.VmlElement,this.attrs={}}}function Gr(t,e){var i=new Vr;switch(t.localName){case"rect":i.tagName="rect",Object.assign(i.attrs,{width:"100%",height:"100%"});break;case"oval":i.tagName="ellipse",Object.assign(i.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":i.tagName="line";break;case"shape":i.tagName="g";break;case"textbox":i.tagName="foreignObject",Object.assign(i.attrs,{width:"100%",height:"100%"});break;default:return null}for(const e of $s.attrs(t))switch(e.localName){case"style":i.cssStyleText=e.value;break;case"fillcolor":i.attrs.fill=e.value;break;case"from":const[t,n]=Yr(e.value);Object.assign(i.attrs,{x1:t,y1:n});break;case"to":const[s,r]=Yr(e.value);Object.assign(i.attrs,{x2:s,y2:r})}for(const n of $s.elements(t))switch(n.localName){case"stroke":Object.assign(i.attrs,qr(n));break;case"fill":Object.assign(i.attrs,Xr());break;case"imagedata":i.tagName="image",Object.assign(i.attrs,{width:"100%",height:"100%"}),i.imageHref={id:$s.attr(n,"id"),title:$s.attr(n,"title")};break;case"txbxContent":i.children.push(...e.parseBodyElements(n));break;default:const t=Gr(n,e);t&&i.children.push(t)}return i}function qr(t){return{stroke:$s.attr(t,"color"),"stroke-width":$s.lengthAttr(t,"weight",Ls)??"1px"}}function Xr(t){return{}}function Yr(t){return t.split(",")}class Kr extends mr{constructor(){super(...arguments),this.type=Qs.Comment}}class Zr extends mr{constructor(t){super(),this.id=t,this.type=Qs.CommentReference}}class Jr extends mr{constructor(t){super(),this.id=t,this.type=Qs.CommentRangeStart}}class Qr extends mr{constructor(t){super(),this.id=t,this.type=Qs.CommentRangeEnd}}const ta=[],ea={oMath:Qs.MmlMath,oMathPara:Qs.MmlMathParagraph,f:Qs.MmlFraction,func:Qs.MmlFunction,fName:Qs.MmlFunctionName,num:Qs.MmlNumerator,den:Qs.MmlDenominator,rad:Qs.MmlRadical,deg:Qs.MmlDegree,e:Qs.MmlBase,sSup:Qs.MmlSuperscript,sSub:Qs.MmlSubscript,sPre:Qs.MmlPreSubSuper,sup:Qs.MmlSuperArgument,sub:Qs.MmlSubArgument,d:Qs.MmlDelimiter,nary:Qs.MmlNary,eqArr:Qs.MmlEquationArray,lim:Qs.MmlLimit,limLow:Qs.MmlLimitLower,m:Qs.MmlMatrix,mr:Qs.MmlMatrixRow,box:Qs.MmlBox,bar:Qs.MmlBar,groupChr:Qs.MmlGroupChar};class ia{constructor(t){this.options={ignoreWidth:!1,debug:!1,...t}}parseNotes(t,e,i){var n=[];for(let s of $s.elements(t,e)){const t=new i;t.id=$s.attr(s,"id"),t.noteType=$s.attr(s,"type"),t.children=this.parseBodyElements(s),n.push(t)}return n}parseComments(t){var e=[];for(let i of $s.elements(t,"comment")){const t=new Kr;t.id=$s.attr(i,"id"),t.author=$s.attr(i,"author"),t.initials=$s.attr(i,"initials"),t.date=$s.attr(i,"date"),t.children=this.parseBodyElements(i),e.push(t)}return e}parseDocumentFile(t){var e=$s.element(t,"body"),i=$s.element(t,"background"),n=$s.element(e,"sectPr");return{type:Qs.Document,children:this.parseBodyElements(e),props:n?tr(n,$s):{},cssStyle:i?this.parseBackground(i):{}}}parseBackground(t){var e={},i=sa.colorAttr(t,"color");return i&&(e["background-color"]=i),e}parseBodyElements(t){var e=[];for(const i of $s.elements(t))switch(i.localName){case"p":e.push(this.parseParagraph(i));break;case"altChunk":e.push(this.parseAltChunk(i));break;case"tbl":e.push(this.parseTable(i));break;case"sdt":e.push(...this.parseSdt(i,t=>this.parseBodyElements(t)))}return e}parseStylesFile(t){var e=[];for(const i of $s.elements(t))switch(i.localName){case"style":e.push(this.parseStyle(i));break;case"docDefaults":e.push(this.parseDefaultStyles(i))}return e}parseDefaultStyles(t){var e={id:null,name:null,target:null,basedOn:null,styles:[]};for(const s of $s.elements(t))switch(s.localName){case"rPrDefault":var i=$s.element(s,"rPr");i&&e.styles.push({target:"span",values:this.parseDefaultProperties(i,{})});break;case"pPrDefault":var n=$s.element(s,"pPr");n&&e.styles.push({target:"p",values:this.parseDefaultProperties(n,{})})}return e}parseStyle(t){var e={id:$s.attr(t,"styleId"),isDefault:$s.boolAttr(t,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch($s.attr(t,"type")){case"paragraph":e.target="p";break;case"table":e.target="table";break;case"character":e.target="span"}for(const i of $s.elements(t))switch(i.localName){case"basedOn":e.basedOn=$s.attr(i,"val");break;case"name":e.name=$s.attr(i,"val");break;case"link":e.linked=$s.attr(i,"val");break;case"next":e.next=$s.attr(i,"val");break;case"aliases":e.aliases=$s.attr(i,"val").split(",");break;case"pPr":e.styles.push({target:"p",values:this.parseDefaultProperties(i,{})}),e.paragraphProps=ar(i,$s);break;case"rPr":e.styles.push({target:"span",values:this.parseDefaultProperties(i,{})}),e.runProps=sr(i,$s);break;case"tblPr":case"tcPr":e.styles.push({target:"td",values:this.parseDefaultProperties(i,{})});break;case"tblStylePr":for(let t of this.parseTableStyle(i))e.styles.push(t);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${i.localName}`)}return e}parseTableStyle(t){var e=[],i="",n="";switch($s.attr(t,"type")){case"firstRow":n=".first-row",i="tr.first-row td";break;case"lastRow":n=".last-row",i="tr.last-row td";break;case"firstCol":n=".first-col",i="td.first-col";break;case"lastCol":n=".last-col",i="td.last-col";break;case"band1Vert":n=":not(.no-vband)",i="td.odd-col";break;case"band2Vert":n=":not(.no-vband)",i="td.even-col";break;case"band1Horz":n=":not(.no-hband)",i="tr.odd-row";break;case"band2Horz":n=":not(.no-hband)",i="tr.even-row";break;default:return[]}for(const s of $s.elements(t))switch(s.localName){case"pPr":e.push({target:`${i} p`,mod:n,values:this.parseDefaultProperties(s,{})});break;case"rPr":e.push({target:`${i} span`,mod:n,values:this.parseDefaultProperties(s,{})});break;case"tblPr":case"tcPr":e.push({target:i,mod:n,values:this.parseDefaultProperties(s,{})})}return e}parseNumberingFile(t){var e=[],i={},n=[];for(const a of $s.elements(t))switch(a.localName){case"abstractNum":this.parseAbstractNumbering(a,n).forEach(t=>e.push(t));break;case"numPicBullet":n.push(this.parseNumberingPicBullet(a));break;case"num":var s=$s.attr(a,"numId"),r=$s.elementAttr(a,"abstractNumId","val");i[r]=s}return e.forEach(t=>t.id=i[t.id]),e}parseNumberingPicBullet(t){var e=$s.element(t,"pict"),i=e&&$s.element(e,"shape"),n=i&&$s.element(i,"imagedata");return n?{id:$s.intAttr(t,"numPicBulletId"),src:$s.attr(n,"id"),style:$s.attr(i,"style")}:null}parseAbstractNumbering(t,e){var i=[],n=$s.attr(t,"abstractNumId");for(const s of $s.elements(t))"lvl"===s.localName&&i.push(this.parseNumberingLevel(n,s,e));return i}parseNumberingLevel(t,e,i){var n={id:t,level:$s.intAttr(e,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const t of $s.elements(e))switch(t.localName){case"start":n.start=$s.intAttr(t,"val");break;case"pPr":this.parseDefaultProperties(t,n.pStyle);break;case"rPr":this.parseDefaultProperties(t,n.rStyle);break;case"lvlPicBulletId":var s=$s.intAttr(t,"val");n.bullet=i.find(t=>t?.id==s);break;case"lvlText":n.levelText=$s.attr(t,"val");break;case"pStyle":n.pStyleName=$s.attr(t,"val");break;case"numFmt":n.format=$s.attr(t,"val");break;case"suff":n.suff=$s.attr(t,"val")}return n}parseSdt(t,e){const i=$s.element(t,"sdtContent");return i?e(i):[]}parseInserted(t,e){return{type:Qs.Inserted,children:e(t)?.children??[]}}parseDeleted(t,e){return{type:Qs.Deleted,children:e(t)?.children??[]}}parseAltChunk(t){return{type:Qs.AltChunk,children:[],id:$s.attr(t,"id")}}parseParagraph(t){var e={type:Qs.Paragraph,children:[]};for(let i of $s.elements(t))switch(i.localName){case"pPr":this.parseParagraphProperties(i,e);break;case"r":e.children.push(this.parseRun(i,e));break;case"hyperlink":e.children.push(this.parseHyperlink(i,e));break;case"smartTag":e.children.push(this.parseSmartTag(i,e));break;case"bookmarkStart":e.children.push($r(i,$s));break;case"bookmarkEnd":e.children.push(Wr(i,$s));break;case"commentRangeStart":e.children.push(new Jr($s.attr(i,"id")));break;case"commentRangeEnd":e.children.push(new Qr($s.attr(i,"id")));break;case"oMath":case"oMathPara":e.children.push(this.parseMathElement(i));break;case"sdt":e.children.push(...this.parseSdt(i,t=>this.parseParagraph(t).children));break;case"ins":e.children.push(this.parseInserted(i,t=>this.parseParagraph(t)));break;case"del":e.children.push(this.parseDeleted(i,t=>this.parseParagraph(t)))}return e}parseParagraphProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,t=>{if(or(t,e,$s))return!0;switch(t.localName){case"pStyle":e.styleName=$s.attr(t,"val");break;case"cnfStyle":e.className=ra.classNameOfCnfStyle(t);break;case"framePr":this.parseFrame(t,e);break;case"rPr":break;default:return!1}return!0})}parseFrame(t,e){"drop"==$s.attr(t,"dropCap")&&(e.cssStyle.float="left")}parseHyperlink(t,e){var i={type:Qs.Hyperlink,parent:e,children:[]};i.anchor=$s.attr(t,"anchor"),i.id=$s.attr(t,"id");for(const e of $s.elements(t))"r"===e.localName&&i.children.push(this.parseRun(e,i));return i}parseSmartTag(t,e){var i={type:Qs.SmartTag,parent:e,children:[]},n=$s.attr(t,"uri"),s=$s.attr(t,"element");n&&(i.uri=n),s&&(i.element=s);for(const e of $s.elements(t))"r"===e.localName&&i.children.push(this.parseRun(e,i));return i}parseRun(t,e){var i={type:Qs.Run,parent:e,children:[]};for(let e of $s.elements(t))switch(e=this.checkAlternateContent(e),e.localName){case"t":i.children.push({type:Qs.Text,text:e.textContent});break;case"delText":i.children.push({type:Qs.DeletedText,text:e.textContent});break;case"commentReference":i.children.push(new Zr($s.attr(e,"id")));break;case"fldSimple":i.children.push({type:Qs.SimpleField,instruction:$s.attr(e,"instr"),lock:$s.boolAttr(e,"lock",!1),dirty:$s.boolAttr(e,"dirty",!1)});break;case"instrText":i.fieldRun=!0,i.children.push({type:Qs.Instruction,text:e.textContent});break;case"fldChar":i.fieldRun=!0,i.children.push({type:Qs.ComplexField,charType:$s.attr(e,"fldCharType"),lock:$s.boolAttr(e,"lock",!1),dirty:$s.boolAttr(e,"dirty",!1)});break;case"noBreakHyphen":i.children.push({type:Qs.NoBreakHyphen});break;case"br":i.children.push({type:Qs.Break,break:$s.attr(e,"type")||"textWrapping"});break;case"lastRenderedPageBreak":i.children.push({type:Qs.Break,break:"lastRenderedPageBreak"});break;case"sym":i.children.push({type:Qs.Symbol,font:ks($s.attr(e,"font")),char:$s.attr(e,"char")});break;case"tab":i.children.push({type:Qs.Tab});break;case"footnoteReference":i.children.push({type:Qs.FootnoteReference,id:$s.attr(e,"id")});break;case"endnoteReference":i.children.push({type:Qs.EndnoteReference,id:$s.attr(e,"id")});break;case"drawing":let t=this.parseDrawing(e);t&&(i.children=[t]);break;case"pict":i.children.push(this.parseVmlPicture(e));break;case"rPr":this.parseRunProperties(e,i)}return i}parseMathElement(t){const e=`${t.localName}Pr`,i={type:ea[t.localName],children:[]};for(const s of $s.elements(t))if(ea[s.localName])i.children.push(this.parseMathElement(s));else if("r"==s.localName){var n=this.parseRun(s);n.type=Qs.MmlRun,i.children.push(n)}else s.localName==e&&(i.props=this.parseMathProperies(s));return i}parseMathProperies(t){const e={};for(const i of $s.elements(t))switch(i.localName){case"chr":e.char=$s.attr(i,"val");break;case"vertJc":e.verticalJustification=$s.attr(i,"val");break;case"pos":e.position=$s.attr(i,"val");break;case"degHide":e.hideDegree=$s.boolAttr(i,"val");break;case"begChr":e.beginChar=$s.attr(i,"val");break;case"endChr":e.endChar=$s.attr(i,"val")}return e}parseRunProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,t=>{switch(t.localName){case"rStyle":e.styleName=$s.attr(t,"val");break;case"vertAlign":e.verticalAlign=ra.valueOfVertAlign(t,!0);break;default:return!1}return!0})}parseVmlPicture(t){const e={type:Qs.VmlPicture,children:[]};for(const i of $s.elements(t)){const t=Gr(i,this);t&&e.children.push(t)}return e}checkAlternateContent(t){if("AlternateContent"!=t.localName)return t;var e=$s.element(t,"Choice");if(e){var i=$s.attr(e,"Requires"),n=t.lookupNamespaceURI(i);if(ta.includes(n))return e.firstElementChild}return $s.element(t,"Fallback")?.firstElementChild}parseDrawing(t){for(var e of $s.elements(t))switch(e.localName){case"inline":case"anchor":return this.parseDrawingWrapper(e)}}parseDrawingWrapper(t){var e={type:Qs.Drawing,children:[],cssStyle:{}},i="anchor"==t.localName;let n=null,s=$s.boolAttr(t,"simplePos");$s.boolAttr(t,"behindDoc");let r={relative:"page",align:"left",offset:"0"},a={relative:"page",align:"top",offset:"0"};for(var o of $s.elements(t))switch(o.localName){case"simplePos":s&&(r.offset=$s.lengthAttr(o,"x",Ls),a.offset=$s.lengthAttr(o,"y",Ls));break;case"extent":e.cssStyle.width=$s.lengthAttr(o,"cx",Ls),e.cssStyle.height=$s.lengthAttr(o,"cy",Ls);break;case"positionH":case"positionV":if(!s){let t="positionH"==o.localName?r:a;var l=$s.element(o,"align"),c=$s.element(o,"posOffset");t.relative=$s.attr(o,"relativeFrom")??t.relative,l&&(t.align=l.textContent),c&&(t.offset=Bs(c.textContent,Ls))}break;case"wrapTopAndBottom":n="wrapTopAndBottom";break;case"wrapNone":n="wrapNone";break;case"graphic":var h=this.parseGraphic(o);h&&e.children.push(h)}return"wrapTopAndBottom"==n?(e.cssStyle.display="block",r.align&&(e.cssStyle["text-align"]=r.align,e.cssStyle.width="100%")):"wrapNone"==n?(e.cssStyle.display="block",e.cssStyle.position="relative",e.cssStyle.width="0px",e.cssStyle.height="0px",r.offset&&(e.cssStyle.left=r.offset),a.offset&&(e.cssStyle.top=a.offset)):!i||"left"!=r.align&&"right"!=r.align||(e.cssStyle.float=r.align),e}parseGraphic(t){var e=$s.element(t,"graphicData");for(let t of $s.elements(e))if("pic"===t.localName)return this.parsePicture(t);return null}parsePicture(t){var e={type:Qs.Image,src:"",cssStyle:{}},i=$s.element(t,"blipFill"),n=$s.element(i,"blip"),s=$s.element(i,"srcRect");e.src=$s.attr(n,"embed"),s&&(e.srcRect=[$s.intAttr(s,"l",0)/1e5,$s.intAttr(s,"t",0)/1e5,$s.intAttr(s,"r",0)/1e5,$s.intAttr(s,"b",0)/1e5]);var r=$s.element(t,"spPr"),a=$s.element(r,"xfrm");if(e.cssStyle.position="relative",a)for(var o of(e.rotation=$s.intAttr(a,"rot",0)/6e4,$s.elements(a)))switch(o.localName){case"ext":e.cssStyle.width=$s.lengthAttr(o,"cx",Ls),e.cssStyle.height=$s.lengthAttr(o,"cy",Ls);break;case"off":e.cssStyle.left=$s.lengthAttr(o,"x",Ls),e.cssStyle.top=$s.lengthAttr(o,"y",Ls)}return e}parseTable(t){var e={type:Qs.Table,children:[]};for(const i of $s.elements(t))switch(i.localName){case"tr":e.children.push(this.parseTableRow(i));break;case"tblGrid":e.columns=this.parseTableColumns(i);break;case"tblPr":this.parseTableProperties(i,e)}return e}parseTableColumns(t){var e=[];for(const i of $s.elements(t))"gridCol"===i.localName&&e.push({width:$s.lengthAttr(i,"w")});return e}parseTableProperties(t,e){switch(e.cssStyle={},e.cellStyle={},this.parseDefaultProperties(t,e.cssStyle,e.cellStyle,t=>{switch(t.localName){case"tblStyle":e.styleName=$s.attr(t,"val");break;case"tblLook":e.className=ra.classNameOftblLook(t);break;case"tblpPr":this.parseTablePosition(t,e);break;case"tblStyleColBandSize":e.colBandSize=$s.intAttr(t,"val");break;case"tblStyleRowBandSize":e.rowBandSize=$s.intAttr(t,"val");break;case"hidden":e.cssStyle.display="none";break;default:return!1}return!0}),e.cssStyle["text-align"]){case"center":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto",e.cssStyle["margin-right"]="auto";break;case"right":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto"}}parseTablePosition(t,e){var i=$s.lengthAttr(t,"topFromText"),n=$s.lengthAttr(t,"bottomFromText"),s=$s.lengthAttr(t,"rightFromText"),r=$s.lengthAttr(t,"leftFromText");e.cssStyle.float="left",e.cssStyle["margin-bottom"]=ra.addSize(e.cssStyle["margin-bottom"],n),e.cssStyle["margin-left"]=ra.addSize(e.cssStyle["margin-left"],r),e.cssStyle["margin-right"]=ra.addSize(e.cssStyle["margin-right"],s),e.cssStyle["margin-top"]=ra.addSize(e.cssStyle["margin-top"],i)}parseTableRow(t){var e={type:Qs.Row,children:[]};for(const i of $s.elements(t))switch(i.localName){case"tc":e.children.push(this.parseTableCell(i));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(i,e)}return e}parseTableRowProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,t=>{switch(t.localName){case"cnfStyle":e.className=ra.classNameOfCnfStyle(t);break;case"tblHeader":e.isHeader=$s.boolAttr(t,"val");break;case"gridBefore":e.gridBefore=$s.intAttr(t,"val");break;case"gridAfter":e.gridAfter=$s.intAttr(t,"val");break;default:return!1}return!0})}parseTableCell(t){var e={type:Qs.Cell,children:[]};for(const i of $s.elements(t))switch(i.localName){case"tbl":e.children.push(this.parseTable(i));break;case"p":e.children.push(this.parseParagraph(i));break;case"tcPr":this.parseTableCellProperties(i,e)}return e}parseTableCellProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,t=>{switch(t.localName){case"gridSpan":e.span=$s.intAttr(t,"val",null);break;case"vMerge":e.verticalMerge=$s.attr(t,"val")??"continue";break;case"cnfStyle":e.className=ra.classNameOfCnfStyle(t);break;default:return!1}return!0}),this.parseTableCellVerticalText(t,e)}parseTableCellVerticalText(t,e){const i={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const n of $s.elements(t))if("textDirection"===n.localName){const t=i[$s.attr(n,"val")]||{writingMode:"horizontal-tb"};e.cssStyle["writing-mode"]=t.writingMode,e.cssStyle.transform=t.transform}}parseDefaultProperties(t,e=null,i=null,n=null){e=e||{};for(const s of $s.elements(t))if(!n?.(s))switch(s.localName){case"jc":e["text-align"]=ra.valueOfJc(s);break;case"textAlignment":e["vertical-align"]=ra.valueOfTextAlignment(s);break;case"color":e.color=sa.colorAttr(s,"val",null,"black");break;case"sz":e["font-size"]=e["min-height"]=$s.lengthAttr(s,"val",Fs);break;case"shd":e["background-color"]=sa.colorAttr(s,"fill",null,"inherit");break;case"highlight":e["background-color"]=sa.colorAttr(s,"val",null,"transparent");break;case"vertAlign":break;case"position":e.verticalAlign=$s.lengthAttr(s,"val",Fs);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":e.width=ra.valueOfSize(s,"w");break;case"trHeight":this.parseTrHeight(s,e);break;case"strike":e["text-decoration"]=$s.boolAttr(s,"val",!0)?"line-through":"none";break;case"b":e["font-weight"]=$s.boolAttr(s,"val",!0)?"bold":"normal";break;case"i":e["font-style"]=$s.boolAttr(s,"val",!0)?"italic":"normal";break;case"caps":e["text-transform"]=$s.boolAttr(s,"val",!0)?"uppercase":"none";break;case"smallCaps":e["font-variant"]=$s.boolAttr(s,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(s,e);break;case"ind":case"tblInd":this.parseIndentation(s,e);break;case"rFonts":this.parseFont(s,e);break;case"tblBorders":this.parseBorderProperties(s,i||e);break;case"tblCellSpacing":e["border-spacing"]=ra.valueOfMargin(s),e["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(s,e);break;case"bdr":e.border=ra.valueOfBorder(s);break;case"tcBorders":this.parseBorderProperties(s,e);break;case"vanish":$s.boolAttr(s,"val",!0)&&(e.display="none");break;case"kern":case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(s,i||e);break;case"tblLayout":e["table-layout"]=ra.valueOfTblLayout(s);break;case"vAlign":e["vertical-align"]=ra.valueOfTextAlignment(s);break;case"spacing":"pPr"==t.localName&&this.parseSpacing(s,e);break;case"wordWrap":$s.boolAttr(s,"val")&&(e["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":e.hyphens=$s.boolAttr(s,"val",!0)?"none":"auto";break;case"lang":e.$lang=$s.attr(s,"val");break;case"rtl":case"bidi":$s.boolAttr(s,"val",!0)&&(e.direction="rtl");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"bidi":case"rtl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${t.localName}.${s.localName}`)}return e}parseUnderline(t,e){var i=$s.attr(t,"val");if(null!=i){switch(i){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":e["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":e["text-decoration"]="underline dotted";break;case"double":e["text-decoration"]="underline double";break;case"single":case"thick":case"words":e["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":e["text-decoration"]="underline wavy";break;case"none":e["text-decoration"]="none"}var n=sa.colorAttr(t,"color");n&&(e["text-decoration-color"]=n)}}parseFont(t,e){var i=[$s.attr(t,"ascii"),ra.themeValue(t,"asciiTheme"),$s.attr(t,"eastAsia")].filter(t=>t).map(t=>ks(t));i.length>0&&(e["font-family"]=[...new Set(i)].join(", "))}parseIndentation(t,e){var i=$s.lengthAttr(t,"firstLine"),n=$s.lengthAttr(t,"hanging"),s=$s.lengthAttr(t,"left"),r=$s.lengthAttr(t,"start"),a=$s.lengthAttr(t,"right"),o=$s.lengthAttr(t,"end");i&&(e["text-indent"]=i),n&&(e["text-indent"]=`-${n}`),(s||r)&&(e["margin-inline-start"]=s||r),(a||o)&&(e["margin-inline-end"]=a||o)}parseSpacing(t,e){var i=$s.lengthAttr(t,"before"),n=$s.lengthAttr(t,"after"),s=$s.intAttr(t,"line",null),r=$s.attr(t,"lineRule");if(i&&(e["margin-top"]=i),n&&(e["margin-bottom"]=n),null!==s)switch(r){case"auto":e["line-height"]=`${(s/240).toFixed(2)}`;break;case"atLeast":e["line-height"]=`calc(100% + ${s/20}pt)`;break;default:e["line-height"]=e["min-height"]=s/20+"pt"}}parseMarginProperties(t,e){for(const i of $s.elements(t))switch(i.localName){case"left":e["padding-left"]=ra.valueOfMargin(i);break;case"right":e["padding-right"]=ra.valueOfMargin(i);break;case"top":e["padding-top"]=ra.valueOfMargin(i);break;case"bottom":e["padding-bottom"]=ra.valueOfMargin(i)}}parseTrHeight(t,e){$s.attr(t,"hRule"),e.height=$s.lengthAttr(t,"val")}parseBorderProperties(t,e){for(const i of $s.elements(t))switch(i.localName){case"start":case"left":e["border-left"]=ra.valueOfBorder(i);break;case"end":case"right":e["border-right"]=ra.valueOfBorder(i);break;case"top":e["border-top"]=ra.valueOfBorder(i);break;case"bottom":e["border-bottom"]=ra.valueOfBorder(i)}}}const na=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class sa{static colorAttr(t,e,i=null,n="black"){var s=$s.attr(t,e);if(s)return"auto"==s?n:na.includes(s)?s:`#${s}`;var r=$s.attr(t,"themeColor");return r?`var(--docx-${r}-color)`:i}}class ra{static themeValue(t,e){var i=$s.attr(t,e);return i?`var(--docx-${i}-font)`:null}static valueOfSize(t,e){var i=Ds;switch($s.attr(t,"type")){case"dxa":break;case"pct":i=js;break;case"auto":return"auto"}return $s.lengthAttr(t,e,i)}static valueOfMargin(t){return $s.lengthAttr(t,"w")}static valueOfBorder(t){var e=ra.parseBorderType($s.attr(t,"val"));if("none"==e)return"none";var i=sa.colorAttr(t,"color");return`${$s.lengthAttr(t,"sz",Os)} ${e} ${"auto"==i?"black":i}`}static parseBorderType(t){switch(t){case"single":case"dashDotStroked":case"thick":case"thickThinLargeGap":case"thickThinMediumGap":case"thickThinSmallGap":case"thinThickLargeGap":case"thinThickMediumGap":case"thinThickSmallGap":case"thinThickThinLargeGap":case"thinThickThinMediumGap":case"thinThickThinSmallGap":case"threeDEmboss":case"threeDEngrave":case"wave":return"solid";case"dashed":case"dashSmallGap":return"dashed";case"dotDash":case"dotDotDash":case"dotted":return"dotted";case"double":case"doubleWave":case"triple":return"double";case"inset":return"inset";case"nil":case"none":return"none";case"outset":return"outset"}return"solid"}static valueOfTblLayout(t){return"fixed"==$s.attr(t,"val")?"fixed":"auto"}static classNameOfCnfStyle(t){const e=$s.attr(t,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((t,i)=>"1"==e[i]).join(" ")}static valueOfJc(t){var e=$s.attr(t,"val");switch(e){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return e}static valueOfVertAlign(t,e=!1){var i=$s.attr(t,"val");switch(i){case"subscript":return"sub";case"superscript":return e?"sup":"super"}return e?null:i}static valueOfTextAlignment(t){var e=$s.attr(t,"val");switch(e){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return e}static addSize(t,e){return null==t?e:null==e?t:`calc(${t} + ${e})`}static classNameOftblLook(t){const e=$s.hexAttr(t,"val",0);let i="";return($s.boolAttr(t,"firstRow")||32&e)&&(i+=" first-row"),($s.boolAttr(t,"lastRow")||64&e)&&(i+=" last-row"),($s.boolAttr(t,"firstColumn")||128&e)&&(i+=" first-col"),($s.boolAttr(t,"lastColumn")||256&e)&&(i+=" last-col"),($s.boolAttr(t,"noHBand")||512&e)&&(i+=" no-hband"),($s.boolAttr(t,"noVBand")||1024&e)&&(i+=" no-vband"),i.trim()}}const aa={pos:0,leader:"none",style:"left"};function oa(t,e,i,n=.75){const s=t.closest("p"),r=t.getBoundingClientRect(),a=s.getBoundingClientRect(),o=getComputedStyle(s),l=e?.length>0?e.map(t=>({pos:la(t.position),leader:t.leader,style:t.style})).sort((t,e)=>t.pos-e.pos):[aa],c=l[l.length-1],h=a.width*n,d=la(i);let u=c.pos+d;if(u<h)for(;u<h&&l.length<50;u+=d)l.push({...aa,pos:u});const p=parseFloat(o.marginLeft),f=a.left+p,m=(r.left-f)*n,g=l.find(t=>"clear"!=t.style&&t.pos>m);if(null==g)return;let b=1;if("right"==g.style||"center"==g.style){const e=Array.from(s.querySelectorAll(`.${t.className}`)),i=e.indexOf(t)+1,r=document.createRange();r.setStart(t,1),i<e.length?r.setEndBefore(e[i]):r.setEndAfter(s);const o="center"==g.style?.5:1,l=r.getBoundingClientRect(),c=l.left+o*l.width-(a.left-p);b=g.pos-c*n}else b=g.pos-m;switch(t.innerHTML=" ",t.style.textDecoration="inherit",t.style.wordSpacing=`${b.toFixed(0)}pt`,g.leader){case"dot":case"middleDot":t.style.textDecoration="underline",t.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":t.style.textDecoration="underline"}}function la(t){return parseFloat(t)}const ca="http://www.w3.org/1998/Math/MathML";class ha{constructor(t){this.htmlDocument=t,this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[]}async render(t,e,i=null,n){this.document=t,this.options=n,this.className=n.className,this.rootSelector=n.inWrapper?`.${this.className}-wrapper`:":root",this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight),da(i=i||e),da(e),i.appendChild(this.createComment("docxjs library predefined styles")),i.appendChild(this.renderDefaultStyle()),t.themePart&&(i.appendChild(this.createComment("docxjs document theme values")),this.renderTheme(t.themePart,i)),null!=t.stylesPart&&(this.styleMap=this.processStyles(t.stylesPart.styles),i.appendChild(this.createComment("docxjs document styles")),i.appendChild(this.renderStyles(t.stylesPart.styles))),t.numberingPart&&(this.prodessNumberings(t.numberingPart.domNumberings),i.appendChild(this.createComment("docxjs document numbering styles")),i.appendChild(this.renderNumbering(t.numberingPart.domNumberings,i))),t.footnotesPart&&(this.footnoteMap=Ps(t.footnotesPart.notes,t=>t.id)),t.endnotesPart&&(this.endnoteMap=Ps(t.endnotesPart.notes,t=>t.id)),t.settingsPart&&(this.defaultTabSize=t.settingsPart.settings?.defaultTabStop),!n.ignoreFonts&&t.fontTablePart&&this.renderFontTable(t.fontTablePart,i);var s=this.renderSections(t.documentPart.body);this.options.inWrapper?e.appendChild(this.renderWrapper(s)):ua(e,s),this.commentHighlight&&n.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(t=>t()),await Promise.allSettled(this.tasks),this.refreshTabStops()}renderTheme(t,e){const i={},n=t.theme?.fontScheme;n&&(n.majorFont&&(i["--docx-majorHAnsi-font"]=n.majorFont.latinTypeface),n.minorFont&&(i["--docx-minorHAnsi-font"]=n.minorFont.latinTypeface));const s=t.theme?.colorScheme;if(s)for(let[t,e]of Object.entries(s.colors))i[`--docx-${t}-color`]=`#${e}`;const r=this.styleToString(`.${this.className}`,i);e.appendChild(this.createStyleElement(r))}renderFontTable(t,e){for(let i of t.fonts)for(let t of i.embedFontRefs)this.tasks.push(this.document.loadFont(t.id,t.key).then(n=>{const s={"font-family":ks(i.name),src:`url(${n})`};"bold"!=t.type&&"boldItalic"!=t.type||(s["font-weight"]="bold"),"italic"!=t.type&&"boldItalic"!=t.type||(s["font-style"]="italic");const r=this.styleToString("@font-face",s);e.appendChild(this.createComment(`docxjs ${i.name} font`)),e.appendChild(this.createStyleElement(r))}))}processStyleName(t){return t?`${this.className}_${function(t){return t?.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}(t)}`:this.className}processStyles(t){const e=Ps(t.filter(t=>null!=t.id),t=>t.id);for(const n of t.filter(t=>t.basedOn)){var i=e[n.basedOn];if(i){n.paragraphProps=Rs(n.paragraphProps,i.paragraphProps),n.runProps=Rs(n.runProps,i.runProps);for(const t of i.styles){const e=n.styles.find(e=>e.target==t.target);e?this.copyStyleProperties(t.values,e.values):n.styles.push({...t,values:{...t.values}})}}else this.options.debug&&console.warn(`Can't find base style ${n.basedOn}`)}for(let e of t)e.cssName=this.processStyleName(e.id);return e}prodessNumberings(t){for(let e of t.filter(t=>t.pStyleName)){const t=this.findStyle(e.pStyleName);t?.paragraphProps?.numbering&&(t.paragraphProps.numbering.level=e.level)}}processElement(t){if(t.children)for(var e of t.children)e.parent=t,e.type==Qs.Table?this.processTable(e):this.processElement(e)}processTable(t){for(var e of t.children)for(var i of e.children)i.cssStyle=this.copyStyleProperties(t.cellStyle,i.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(i)}copyStyleProperties(t,e,i=null){if(!t)return e;for(var n of(null==e&&(e={}),null==i&&(i=Object.getOwnPropertyNames(t)),i))t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return e}createPageElement(t,e){var i=this.createElement("section",{className:t});return e&&(e.pageMargins&&(i.style.paddingLeft=e.pageMargins.left,i.style.paddingRight=e.pageMargins.right,i.style.paddingTop=e.pageMargins.top,i.style.paddingBottom=e.pageMargins.bottom),e.pageSize&&(this.options.ignoreWidth||(i.style.width=e.pageSize.width),this.options.ignoreHeight||(i.style.minHeight=e.pageSize.height))),i}createSectionContent(t){var e=this.createElement("article");return t.columns&&t.columns.numberOfColumns&&(e.style.columnCount=`${t.columns.numberOfColumns}`,e.style.columnGap=t.columns.space,t.columns.separator&&(e.style.columnRule="1px solid black")),e}renderSections(t){const e=[];this.processElement(t);const i=this.splitBySection(t.children,t.props),n=this.groupByPageBreaks(i);let s=null;for(let i=0,a=n.length;i<a;i++){this.currentFootnoteIds=[];let o=n[i][0].sectProps;const l=this.createPageElement(this.className,o);this.renderStyleValues(t.cssStyle,l),this.options.renderHeaders&&this.renderHeaderFooter(o.headerRefs,o,e.length,s!=o,l);for(const t of n[i]){var r=this.createSectionContent(t.sectProps);this.renderElements(t.elements,r),l.appendChild(r),o=t.sectProps}
1this.options.renderFootnotes&&this.renderNotes(this.currentFootnoteIds,this.footnoteMap,l),this.options.renderEndnotes&&i==a-1&&this.renderNotes(this.currentEndnoteIds,this.endnoteMap,l),this.options.renderFooters&&this.renderHeaderFooter(o.footerRefs,o,e.length,s!=o,l),e.push(l),s=o}return e}renderHeaderFooter(t,e,i,n,s){if(t){var r=(e.titlePage&&n?t.find(t=>"first"==t.type):null)??(i%2==1?t.find(t=>"even"==t.type):null)??t.find(t=>"default"==t.type),a=r&&this.document.findPartByRelId(r.id,this.document.documentPart);if(a){this.currentPart=a,this.usedHederFooterParts.includes(a.path)||(this.processElement(a.rootElement),this.usedHederFooterParts.push(a.path));const[t]=this.renderElements([a.rootElement],s);e?.pageMargins&&(a.rootElement.type===Qs.Header?(t.style.marginTop=`calc(${e.pageMargins.header} - ${e.pageMargins.top})`,t.style.minHeight=`calc(${e.pageMargins.top} - ${e.pageMargins.header})`):a.rootElement.type===Qs.Footer&&(t.style.marginBottom=`calc(${e.pageMargins.footer} - ${e.pageMargins.bottom})`,t.style.minHeight=`calc(${e.pageMargins.bottom} - ${e.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(t){return t.type==Qs.Break&&("lastRenderedPageBreak"==t.break?!this.options.ignoreLastRenderedPageBreak:"page"==t.break)}isPageBreakSection(t,e){return!(!t||!e||t.pageSize?.orientation==e.pageSize?.orientation&&t.pageSize?.width==e.pageSize?.width&&t.pageSize?.height==e.pageSize?.height)}splitBySection(t,e){var i={sectProps:null,elements:[],pageBreak:!1},n=[i];for(let e of t){if(e.type==Qs.Paragraph){const t=this.findStyle(e.styleName);t?.paragraphProps?.pageBreakBefore&&(i.sectProps=s,i.pageBreak=!0,i={sectProps:null,elements:[],pageBreak:!1},n.push(i))}if(i.elements.push(e),e.type==Qs.Paragraph){const t=e;var s=t.sectionProps,r=-1,a=-1;if(this.options.breakPages&&t.children&&(r=t.children.findIndex(t=>-1!=(a=t.children?.findIndex(this.isPageBreakElement.bind(this))??-1))),(s||-1!=r)&&(i.sectProps=s,i.pageBreak=-1!=r,i={sectProps:null,elements:[],pageBreak:!1},n.push(i)),-1!=r){let n=t.children[r],s=a<n.children.length-1;if(r<t.children.length-1||s){var o=e.children,l={...e,children:o.slice(r)};if(e.children=o.slice(0,r),i.elements.push(l),s){let t=n.children,i={...n,children:t.slice(0,a)};e.children.push(i),n.children=t.slice(a)}}}}}let c=null;for(let t=n.length-1;t>=0;t--)null==n[t].sectProps?n[t].sectProps=c??e:c=n[t].sectProps;return n}groupByPageBreaks(t){let e,i=[];const n=[i];for(let s of t)i.push(s),(this.options.ignoreLastRenderedPageBreak||s.pageBreak||this.isPageBreakSection(e,s.sectProps))&&n.push(i=[]),e=s.sectProps;return n.filter(t=>t.length>0)}renderWrapper(t){return this.createElement("div",{className:`${this.className}-wrapper`},t)}renderDefaultStyle(){var t=this.className,e=`\n.${t}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; } \n.${t}-wrapper>section.${t} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(e=`@media not print { ${e} }`);var i=`${e}\n.${t} { color: black; hyphens: auto; text-underline-position: from-font; }\nsection.${t} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }\nsection.${t}>article { margin-bottom: auto; z-index: 1; }\nsection.${t}>footer { z-index: 1; }\n.${t} table { border-collapse: collapse; }\n.${t} table td, .${t} table th { vertical-align: top; }\n.${t} p { margin: 0pt; min-height: 1em; }\n.${t} span { white-space: pre-wrap; overflow-wrap: break-word; }\n.${t} a { color: inherit; text-decoration: inherit; }\n.${t} svg { fill: transparent; }\n`;return this.options.renderComments&&(i+=`\n.${t}-comment-ref { cursor: default; }\n.${t}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; }\n.${t}-comment-ref:hover~.${t}-comment-popover { display: block; }\n.${t}-comment-author,.${t}-comment-date { font-size: 0.875rem; color: #888; }\n`),this.createStyleElement(i)}renderNumbering(t,e){var i="",n=[];for(var s of t){var r=`p.${this.numberingClass(s.id,s.level)}`,a="none";if(s.bullet){let t=`--${this.className}-${s.bullet.src}`.toLowerCase();i+=this.styleToString(`${r}:before`,{content:"' '",display:"inline-block",background:`var(${t})`},s.bullet.style),this.tasks.push(this.document.loadNumberingImage(s.bullet.src).then(i=>{var n=`${this.rootSelector} { ${t}: url(${i}) }`;e.appendChild(this.createStyleElement(n))}))}else if(s.levelText){let t=this.numberingCounter(s.id,s.level);const e=t+" "+(s.start-1);s.level>0&&(i+=this.styleToString(`p.${this.numberingClass(s.id,s.level-1)}`,{"counter-set":e})),n.push(e),i+=this.styleToString(`${r}:before`,{content:this.levelTextToContent(s.levelText,s.suff,s.id,this.numFormatToCssValue(s.format)),"counter-increment":t,...s.rStyle})}else a=this.numFormatToCssValue(s.format);i+=this.styleToString(r,{display:"list-item","list-style-position":"inside","list-style-type":a,...s.pStyle})}return n.length>0&&(i+=this.styleToString(this.rootSelector,{"counter-reset":n.join(" ")})),this.createStyleElement(i)}renderStyles(t){var e="";const i=this.styleMap,n=Ps(t.filter(t=>t.isDefault),t=>t.target);for(const o of t){var s=o.styles;if(o.linked){var r=o.linked&&i[o.linked];r?s=s.concat(r.styles):this.options.debug&&console.warn(`Can't find linked style ${o.linked}`)}for(const t of s){var a=`${o.target??""}.${o.cssName}`;o.target!=t.target&&(a+=` ${t.target}`),n[o.target]==o&&(a=`.${this.className} ${o.target}, `+a),e+=this.styleToString(a,t.values)}}return this.createStyleElement(e)}renderNotes(t,e,i){var n=t.map(t=>e[t]).filter(t=>t);if(n.length>0){var s=this.createElement("ol",null,this.renderElements(n));i.appendChild(s)}}renderElement(t){switch(t.type){case Qs.Paragraph:return this.renderParagraph(t);case Qs.BookmarkStart:return this.renderBookmarkStart(t);case Qs.BookmarkEnd:return null;case Qs.Run:return this.renderRun(t);case Qs.Table:return this.renderTable(t);case Qs.Row:return this.renderTableRow(t);case Qs.Cell:return this.renderTableCell(t);case Qs.Hyperlink:return this.renderHyperlink(t);case Qs.SmartTag:return this.renderSmartTag(t);case Qs.Drawing:return this.renderDrawing(t);case Qs.Image:return this.renderImage(t);case Qs.Text:case Qs.Text:return this.renderText(t);case Qs.DeletedText:return this.renderDeletedText(t);case Qs.Tab:return this.renderTab(t);case Qs.Symbol:return this.renderSymbol(t);case Qs.Break:return this.renderBreak(t);case Qs.Footer:return this.renderContainer(t,"footer");case Qs.Header:return this.renderContainer(t,"header");case Qs.Footnote:case Qs.Endnote:return this.renderContainer(t,"li");case Qs.FootnoteReference:return this.renderFootnoteReference(t);case Qs.EndnoteReference:return this.renderEndnoteReference(t);case Qs.NoBreakHyphen:return this.createElement("wbr");case Qs.VmlPicture:return this.renderVmlPicture(t);case Qs.VmlElement:return this.renderVmlElement(t);case Qs.MmlMath:return this.renderContainerNS(t,ca,"math",{xmlns:ca});case Qs.MmlMathParagraph:return this.renderContainer(t,"span");case Qs.MmlFraction:return this.renderContainerNS(t,ca,"mfrac");case Qs.MmlBase:return this.renderContainerNS(t,ca,t.parent.type==Qs.MmlMatrixRow?"mtd":"mrow");case Qs.MmlNumerator:case Qs.MmlDenominator:case Qs.MmlFunction:case Qs.MmlLimit:case Qs.MmlBox:return this.renderContainerNS(t,ca,"mrow");case Qs.MmlGroupChar:return this.renderMmlGroupChar(t);case Qs.MmlLimitLower:return this.renderContainerNS(t,ca,"munder");case Qs.MmlMatrix:return this.renderContainerNS(t,ca,"mtable");case Qs.MmlMatrixRow:return this.renderContainerNS(t,ca,"mtr");case Qs.MmlRadical:return this.renderMmlRadical(t);case Qs.MmlSuperscript:return this.renderContainerNS(t,ca,"msup");case Qs.MmlSubscript:return this.renderContainerNS(t,ca,"msub");case Qs.MmlDegree:case Qs.MmlSuperArgument:case Qs.MmlSubArgument:return this.renderContainerNS(t,ca,"mn");case Qs.MmlFunctionName:return this.renderContainerNS(t,ca,"ms");case Qs.MmlDelimiter:return this.renderMmlDelimiter(t);case Qs.MmlRun:return this.renderMmlRun(t);case Qs.MmlNary:return this.renderMmlNary(t);case Qs.MmlPreSubSuper:return this.renderMmlPreSubSuper(t);case Qs.MmlBar:return this.renderMmlBar(t);case Qs.MmlEquationArray:return this.renderMllList(t);case Qs.Inserted:return this.renderInserted(t);case Qs.Deleted:return this.renderDeleted(t);case Qs.CommentRangeStart:return this.renderCommentRangeStart(t);case Qs.CommentRangeEnd:return this.renderCommentRangeEnd(t);case Qs.CommentReference:return this.renderCommentReference(t);case Qs.AltChunk:return this.renderAltChunk(t)}return null}renderElements(t,e){if(null==t)return null;var i=t.flatMap(t=>this.renderElement(t)).filter(t=>null!=t);return e&&ua(e,i),i}renderContainer(t,e,i){return this.createElement(e,i,this.renderElements(t.children))}renderContainerNS(t,e,i,n){return this.createElementNS(e,i,n,this.renderElements(t.children))}renderParagraph(t){var e=this.renderContainer(t,"p");const i=this.findStyle(t.styleName);t.tabs??(t.tabs=i?.paragraphProps?.tabs),this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),this.renderCommonProperties(e.style,t);const n=t.numbering??i?.paragraphProps?.numbering;return n&&e.classList.add(this.numberingClass(n.id,n.level)),e}renderRunProperties(t,e){this.renderCommonProperties(t,e)}renderCommonProperties(t,e){null!=e&&(e.color&&(t.color=e.color),e.fontSize&&(t["font-size"]=e.fontSize))}renderHyperlink(t){var e=this.renderContainer(t,"a");this.renderStyleValues(t.cssStyle,e);let i="";if(t.id){const e=this.document.documentPart.rels.find(e=>e.id==t.id&&"External"===e.targetMode);i=e?.target??i}return t.anchor&&(i+=`#${t.anchor}`),e.href=i,e}renderSmartTag(t){return this.renderContainer(t,"span")}renderCommentRangeStart(t){if(!this.options.renderComments)return null;const e=new Range;this.commentHighlight?.add(e);const i=this.createComment(`start of comment #${t.id}`);return this.later(()=>e.setStart(i,0)),this.commentMap[t.id]=e,i}renderCommentRangeEnd(t){if(!this.options.renderComments)return null;const e=this.commentMap[t.id],i=this.createComment(`end of comment #${t.id}`);return this.later(()=>e?.setEnd(i,0)),i}renderCommentReference(t){if(!this.options.renderComments)return null;var e=this.document.commentsPart?.commentMap[t.id];if(!e)return null;const i=new DocumentFragment,n=this.createElement("span",{className:`${this.className}-comment-ref`},["ð¬"]),s=this.createElement("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(e,s),i.appendChild(this.createComment(`comment #${e.id} by ${e.author} on ${e.date}`)),i.appendChild(n),i.appendChild(s),i}renderAltChunk(t){if(!this.options.renderAltChunks)return null;var e=this.createElement("iframe");return this.tasks.push(this.document.loadAltChunk(t.id,this.currentPart).then(t=>{e.srcdoc=t})),e}renderCommentContent(t,e){e.appendChild(this.createElement("div",{className:`${this.className}-comment-author`},[t.author])),e.appendChild(this.createElement("div",{className:`${this.className}-comment-date`}
1,[new Date(t.date).toLocaleString()])),this.renderElements(t.children,e)}renderDrawing(t){var e=this.renderContainer(t,"div");return e.style.display="inline-block",e.style.position="relative",e.style.textIndent="0px",this.renderStyleValues(t.cssStyle,e),e}renderImage(t){let e=this.createElement("img"),i=t.cssStyle?.transform;if(this.renderStyleValues(t.cssStyle,e),t.srcRect&&t.srcRect.some(t=>0!=t)){var[n,s,r,a]=t.srcRect;i=`scale(${1/(1-n-r)}, ${1/(1-s-a)})`,e.style["clip-path"]=`rect(${(100*s).toFixed(2)}% ${(100*(1-r)).toFixed(2)}% ${(100*(1-a)).toFixed(2)}% ${(100*n).toFixed(2)}%)`}return t.rotation&&(i=`rotate(${t.rotation}deg) ${i??""}`),e.style.transform=i?.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(t.src,this.currentPart).then(t=>{e.src=t})),e}renderText(t){return this.htmlDocument.createTextNode(t.text)}renderDeletedText(t){return this.options.renderChanges?this.renderText(t):null}renderBreak(t){return"textWrapping"==t.break?this.createElement("br"):null}renderInserted(t){return this.options.renderChanges?this.renderContainer(t,"ins"):this.renderElements(t.children)}renderDeleted(t){return this.options.renderChanges?this.renderContainer(t,"del"):null}renderSymbol(t){var e=this.createElement("span");return e.style.fontFamily=t.font,e.innerHTML=`&#x${t.char};`,e}renderFootnoteReference(t){var e=this.createElement("sup");return this.currentFootnoteIds.push(t.id),e.textContent=`${this.currentFootnoteIds.length}`,e}renderEndnoteReference(t){var e=this.createElement("sup");return this.currentEndnoteIds.push(t.id),e.textContent=`${this.currentEndnoteIds.length}`,e}renderTab(t){var e=this.createElement("span");if(e.innerHTML=" ",this.options.experimental){e.className=this.tabStopClass();var i=function(t,e){for(var i=t.parent;null!=i&&i.type!=e;)i=i.parent;return i}(t,Qs.Paragraph)?.tabs;this.currentTabs.push({stops:i,span:e})}return e}renderBookmarkStart(t){return this.createElement("span",{id:t.name})}renderRun(t){if(t.fieldRun)return null;const e=this.createElement("span");if(t.id&&(e.id=t.id),this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),t.verticalAlign){const i=this.createElement(t.verticalAlign);this.renderElements(t.children,i),e.appendChild(i)}else this.renderElements(t.children,e);return e}renderTable(t){let e=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},t.columns&&e.appendChild(this.renderTableColumns(t.columns)),this.renderClass(t,e),this.renderElements(t.children,e),this.renderStyleValues(t.cssStyle,e),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),e}renderTableColumns(t){let e=this.createElement("colgroup");for(let i of t){let t=this.createElement("col");i.width&&(t.style.width=i.width),e.appendChild(t)}return e}renderTableRow(t){let e=this.createElement("tr");return this.currentCellPosition.col=0,t.gridBefore&&e.appendChild(this.renderTableCellPlaceholder(t.gridBefore)),this.renderClass(t,e),this.renderElements(t.children,e),this.renderStyleValues(t.cssStyle,e),t.gridAfter&&e.appendChild(this.renderTableCellPlaceholder(t.gridAfter)),this.currentCellPosition.row++,e}renderTableCellPlaceholder(t){const e=this.createElement("td",{colSpan:t});return e.style.border="none",e}renderTableCell(t){let e=this.renderContainer(t,"td");const i=this.currentCellPosition.col;return t.verticalMerge?"restart"==t.verticalMerge?(this.currentVerticalMerge[i]=e,e.rowSpan=1):this.currentVerticalMerge[i]&&(this.currentVerticalMerge[i].rowSpan+=1,e.style.display="none"):this.currentVerticalMerge[i]=null,this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),t.span&&(e.colSpan=t.span),this.currentCellPosition.col+=e.colSpan,e}renderVmlPicture(t){return this.renderContainer(t,"div")}renderVmlElement(t){var e=this.createSvgElement("svg");e.setAttribute("style",t.cssStyleText);const i=this.renderVmlChildElement(t);return t.imageHref?.id&&this.tasks.push(this.document?.loadDocumentImage(t.imageHref.id,this.currentPart).then(t=>i.setAttribute("href",t))),e.appendChild(i),requestAnimationFrame(()=>{const t=e.firstElementChild.getBBox();e.setAttribute("width",`${Math.ceil(t.x+t.width)}`),e.setAttribute("height",`${Math.ceil(t.y+t.height)}`)}),e}renderVmlChildElement(t){const e=this.createSvgElement(t.tagName);
1Object.entries(t.attrs).forEach(([t,i])=>e.setAttribute(t,i));for(let i of t.children)i.type==Qs.VmlElement?e.appendChild(this.renderVmlChildElement(i)):e.appendChild(...Is(this.renderElement(i)));return e}renderMmlRadical(t){const e=t.children.find(t=>t.type==Qs.MmlBase);if(t.props?.hideDegree)return this.createElementNS(ca,"msqrt",null,this.renderElements([e]));const i=t.children.find(t=>t.type==Qs.MmlDegree);return this.createElementNS(ca,"mroot",null,this.renderElements([e,i]))}renderMmlDelimiter(t){const e=[];return e.push(this.createElementNS(ca,"mo",null,[t.props.beginChar??"("])),e.push(...this.renderElements(t.children)),e.push(this.createElementNS(ca,"mo",null,[t.props.endChar??")"])),this.createElementNS(ca,"mrow",null,e)}renderMmlNary(t){const e=[],i=Ps(t.children,t=>t.type),n=i[Qs.MmlSuperArgument],s=i[Qs.MmlSubArgument],r=n?this.createElementNS(ca,"mo",null,Is(this.renderElement(n))):null,a=s?this.createElementNS(ca,"mo",null,Is(this.renderElement(s))):null,o=this.createElementNS(ca,"mo",null,[t.props?.char??"â«"]);return r||a?e.push(this.createElementNS(ca,"munderover",null,[o,a,r])):r?e.push(this.createElementNS(ca,"mover",null,[o,r])):a?e.push(this.createElementNS(ca,"munder",null,[o,a])):e.push(o),e.push(...this.renderElements(i[Qs.MmlBase].children)),this.createElementNS(ca,"mrow",null,e)}renderMmlPreSubSuper(t){const e=[],i=Ps(t.children,t=>t.type),n=i[Qs.MmlSuperArgument],s=i[Qs.MmlSubArgument],r=n?this.createElementNS(ca,"mo",null,Is(this.renderElement(n))):null,a=s?this.createElementNS(ca,"mo",null,Is(this.renderElement(s))):null,o=this.createElementNS(ca,"mo",null);return e.push(this.createElementNS(ca,"msubsup",null,[o,a,r])),e.push(...this.renderElements(i[Qs.MmlBase].children)),this.createElementNS(ca,"mrow",null,e)}renderMmlGroupChar(t){const e="bot"===t.props.verticalJustification?"mover":"munder",i=this.renderContainerNS(t,ca,e);return t.props.char&&i.appendChild(this.createElementNS(ca,"mo",null,[t.props.char])),i}renderMmlBar(t){const e=this.renderContainerNS(t,ca,"mrow");switch(t.props.position){case"top":e.style.textDecoration="overline";break;case"bottom":e.style.textDecoration="underline"}return e}renderMmlRun(t){const e=this.createElementNS(ca,"ms",null,this.renderElements(t.children));return this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),e}renderMllList(t){const e=this.createElementNS(ca,"mtable");this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e);for(let i of this.renderElements(t.children))e.appendChild(this.createElementNS(ca,"mtr",null,[this.createElementNS(ca,"mtd",null,[i])]));return e}renderStyleValues(t,e){for(let i in t)i.startsWith("$")?e.setAttribute(i.slice(1),t[i]):e.style[i]=t[i]}renderClass(t,e){t.className&&(e.className=t.className),t.styleName&&e.classList.add(this.processStyleName(t.styleName))}findStyle(t){return t&&this.styleMap?.[t]}numberingClass(t,e){return`${this.className}-num-${t}-${e}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(t,e,i=null){let n=`${t} {\r\n`;for(const t in e)t.startsWith("$")||(n+=` ${t}: ${e[t]};\r\n`);return i&&(n+=i),n+"}\r\n"}numberingCounter(t,e){return`${this.className}-num-${t}-${e}`}levelTextToContent(t,e,i,n){return`"${t.replace(/%\d*/g,t=>{let e=parseInt(t.substring(1),10)-1;return`"counter(${this.numberingCounter(i,e)}, ${n})"`})}${{tab:"\\9",space:"\\a0"}[e]??""}"`}numFormatToCssValue(t){return{none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"}[t]??t}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const t=function(t=document.body){const e=document.createElement("div");e.style.width="100pt",t.appendChild(e);const i=100/e.offsetWidth;return t.removeChild(e),i}();for(let e of this.currentTabs)oa(e.span,e.stops,this.defaultTabSize,t)},500)}
1createElementNS(t,e,i,n){var s=t?this.htmlDocument.createElementNS(t,e):this.htmlDocument.createElement(e);return Object.assign(s,i),n&&ua(s,n),s}createElement(t,e,i){return this.createElementNS(void 0,t,e,i)}createSvgElement(t,e,i){return this.createElementNS("http://www.w3.org/2000/svg",t,e,i)}createStyleElement(t){return this.createElement("style",{innerHTML:t})}createComment(t){return this.htmlDocument.createComment(t)}later(t){this.postRenderTasks.push(t)}}function da(t){t.innerHTML=""}function ua(t,e){e.forEach(e=>{return t.appendChild("string"==typeof(i=e)||i instanceof String?document.createTextNode(e):e);var i})}const pa={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0};var fa=i(20067),ma=i(44372),ga=function(t,e){return Number(t.toFixed(e))},ba=function(t,e,i){i&&"function"==typeof i&&i(t,e)},va={easeOut:function(t){return-Math.cos(t*Math.PI)/2+.5},linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},ya=function(t){"number"==typeof t&&cancelAnimationFrame(t)},wa=function(t){t.mounted&&(ya(t.animation),t.animate=!1,t.animation=null,t.velocity=null)};function xa(t,e,i,n){if(t.mounted){var s=(new Date).getTime();wa(t),t.animation=function(){if(!t.mounted)return ya(t.animation);var r=(new Date).getTime()-s,a=(0,va[e])(r/i);r>=i?(n(1),t.animation=null):t.animation&&(n(a),requestAnimationFrame(t.animation))},requestAnimationFrame(t.animation)}}function _a(t,e,i,n){var s=function(t){var e=t.scale,i=t.positionX,n=t.positionY;return!(Number.isNaN(e)||Number.isNaN(i)||Number.isNaN(n))}(e);if(t.mounted&&s){var r=t.setTransformState,a=t.transformState,o=a.scale,l=a.positionX,c=a.positionY,h=e.scale-o,d=e.positionX-l,u=e.positionY-c;0===i?r(e.scale,e.positionX,e.positionY):xa(t,n,i,function(t){r(o+h*t,l+d*t,c+u*t)})}}var Aa=function(t,e){var i=t.wrapperComponent,n=t.contentComponent,s=t.setup.centerZoomedOut;if(!i||!n)throw new Error("Components are not mounted");var r=function(t,e,i){var n=t.offsetWidth,s=t.offsetHeight,r=e.offsetWidth*i,a=e.offsetHeight*i;
vendor: 24,457 bytes, line 1
1return{wrapperWidth:n,wrapperHeight:s,newContentWidth:r,newDiffWidth:n-r,newContentHeight:a,newDiffHeight:s-a}}(i,n,e),a=r.wrapperWidth,o=r.wrapperHeight,l=function(t,e,i,n,s,r,a){var o=t>e?i*(a?1:.5):0,l=n>s?r*(a?1:.5):0;return{minPositionX:t-e-o,maxPositionX:o,minPositionY:n-s-l,maxPositionY:l}}(a,r.newContentWidth,r.newDiffWidth,o,r.newContentHeight,r.newDiffHeight,Boolean(s));return l},Ca=function(t,e,i,n){return ga(n?t<e?e:t>i?i:t:t,2)},Sa=function(t,e){var i=Aa(t,e);return t.bounds=i,i};function ka(t,e,i,n,s,r,a){var o=i.minPositionX,l=i.minPositionY,c=i.maxPositionX,h=i.maxPositionY,d=0,u=0;return a&&(d=s,u=r),{x:Ca(t,o-d,c+d,n),y:Ca(e,l-u,h+u,n)}}function Ea(t,e,i,n,s,r){var a=t.transformState,o=a.scale,l=a.positionX,c=a.positionY,h=n-o;return"number"!=typeof e||"number"!=typeof i?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):ka(l-e*h,c-i*h,s,r,0,0,null)}function Ta(t,e,i,n,s){var r=e-(s?n:0);return!Number.isNaN(i)&&t>=i?i:!Number.isNaN(e)&&t<=r?r:t}var Pa=function(t,e){var i=t.setup.panning.excluded,n=t.isInitialized,s=t.wrapperComponent,r=e.target,a="shadowRoot"in r&&"composedPath"in e?e.composedPath().some(function(t){return t instanceof Element&&(null==s?void 0:s.contains(t))}):null==s?void 0:s.contains(r);return!!(n&&r&&a)&&!so(r,i)},Ma=function(t){var e=t.isInitialized,i=t.isPanning,n=t.setup.panning.disabled;return!(!e||!i||n)};function Ra(t,e,i,n,s){var r=t.setup.limitToBounds,a=t.wrapperComponent,o=t.bounds,l=t.transformState,c=l.scale,h=l.positionX,d=l.positionY;if(null!==a&&null!==o&&(e!==h||i!==d)){var u=ka(e,i,o,r,n,s,a),p=u.x,f=u.y;t.setTransformState(c,p,f)}}var Ia=function(t,e){var i=t.setup,n=t.transformState.scale,s=i.minScale,r=i.disablePadding;return e>0&&n>=s&&!r?e:0};function Na(t,e,i,n,s,r,a,o,l,c){if(s){var h;if(e>a&&i>a)return(h=a+(t-a)*c)>l?l:h<a?a:h;if(e<r&&i<r)return(h=r+(t-r)*c)<o?o:h>r?r:h}return n?e:Ca(t,r,a,s)}function Da(t,e){var i=t.transformState.scale;wa(t),Sa(t,i),void 0!==window.TouchEvent&&e instanceof TouchEvent?function(t,e){var i=e.touches,n=t.transformState,s=n.positionX,r=n.positionY;if(t.isPanning=!0,1===i.length){var a=i[0].clientX,o=i[0].clientY;t.startCoords={x:a-s,y:o-r}}}(t,e):function(t,e){var i=t.transformState,n=i.positionX,s=i.positionY;t.isPanning=!0;var r=e.clientX,a=e.clientY;t.startCoords={x:r-n,y:a-s}}(t,e)}function La(t,e){var i=t.transformState.scale,n=t.setup,s=n.minScale,r=n.alignmentAnimation,a=r.disabled,o=r.sizeX,l=r.sizeY,c=r.animationTime,h=r.animationType;if(!(a||i<s||!o&&!l)){var d=function(t){var e=t.transformState,i=e.positionX,n=e.positionY,s=e.scale,r=t.setup,a=r.disabled,o=r.limitToBounds,l=r.centerZoomedOut,c=t.wrapperComponent;if(!a&&c&&t.bounds){var h=t.bounds,d=h.maxPositionX,u=h.minPositionX,p=h.maxPositionY,f=h.minPositionY,m=i>d||i<u,g=n>p||n<f,b=Ea(t,i>d?c.offsetWidth:t.setup.minPositionX||0,n>p?c.offsetHeight:t.setup.minPositionY||0,s,t.bounds,o||l),v=b.x,y=b.y;return{scale:s,positionX:m?v:i,positionY:g?y:n}}}(t);d&&_a(t,d,null!=e?e:c,h)}}function Fa(t,e,i){var n=t.startCoords,s=t.setup.alignmentAnimation,r=s.sizeX,a=s.sizeY;if(n){var o=function(t,e,i){var n=t.startCoords,s=t.transformState,r=t.setup.panning,a=r.lockAxisX,o=r.lockAxisY,l=s.positionX,c=s.positionY;if(!n)return{x:l,y:c};var h=e-n.x,d=i-n.y;return{x:a?l:h,y:o?c:d}}(t,e,i),l=o.x,c=o.y,h=Ia(t,r),d=Ia(t,a);(function(t,e){var i=function(t){var e=t.mounted,i=t.setup,n=i.disabled,s=i.velocityAnimation,r=t.transformState.scale;return!(s.disabled&&!(r>1)&&n&&!e)}(t);if(i){var n=t.lastMousePosition,s=t.velocityTime,r=t.setup,a=t.wrapperComponent,o=r.velocityAnimation.equalToMove,l=Date.now();if(n&&s&&a){var c=function(t,e){return e?Math.min(1,t.offsetWidth/window.innerWidth):1}(a,o),h=e.x-n.x,d=e.y-n.y,u=h/c,p=d/c,f=l-s,m=h*h+d*d,g=Math.sqrt(m)/f;t.velocity={velocityX:u,velocityY:p,total:g}}t.lastMousePosition=e,t.velocityTime=l}})(t,{x:l,y:c}),Ra(t,l,c,h,d)}}function Oa(t,e,i,n){var s=t.setup,r=s.minScale,a=s.maxScale,o=s.limitToBounds,l=Ta(ga(e,2),r,a,0,!1),c=Ea(t,i,n,l,Sa(t,l),o);return{scale:l,positionX:c.x,positionY:c.y}}function za(t,e,i){var n=t.transformState.scale,s=t.wrapperComponent,r=t.setup,a=r.minScale,o=r.limitToBounds,l=r.zoomAnimation,c=l.disabled,h=l.animationTime,d=l.animationType,u=c||n>=a;if((n>=1||o)&&La(t),!u&&s&&t.mounted){var p=Oa(t,a,e||s.offsetWidth/2,i||s.offsetHeight/2);p&&_a(t,p,h,d)}}var ja=function(){return ja=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},ja.apply(this,arguments)};function Ba(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Ha={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,wheelPanning:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Ua="react-transform-wrapper",$a=function(t){var e,i,n,s;return{previousScale:null!==(e=t.initialScale)&&void 0!==e?e:1,scale:null!==(i=t.initialScale)&&void 0!==i?i:1,positionX:null!==(n=t.initialPositionX)&&void 0!==n?n:0,positionY:null!==(s=t.initialPositionY)&&void 0!==s?s:0}},Wa=function(t){var e=ja({},Ha);return Object.keys(t).forEach(function(i){var n=void 0!==t[i];if(void 0!==Ha[i]&&n){var s=Object.prototype.toString.call(Ha[i]),r="[object Object]"===s,a="[object Array]"===s;e[i]=r?ja(ja({},Ha[i]),t[i]):a?Ba(Ba([],Ha[i],!0),t[i],!0):t[i]}}),e},Va=function(t,e,i){var n=t.transformState.scale,s=t.wrapperComponent,r=t.setup,a=r.maxScale,o=r.minScale,l=r.zoomAnimation,c=r.smooth,h=l.size;if(!s)throw new Error("Wrapper is not mounted");var d=c?n*Math.exp(e*i):n+e*i;return Ta(ga(d,3),o,a,h,!1)};function Ga(t,e,i,n,s){var r=t.wrapperComponent,a=t.transformState,o=a.scale,l=a.positionX,c=a.positionY;if(!r)return console.error("No WrapperComponent found");var h=(r.offsetWidth/2-l)/o,d=(r.offsetHeight/2-c)/o,u=Oa(t,Va(t,e,i),h,d);if(!u)return console.error("Error during zoom event. New transformation state was not calculated.");_a(t,u,n,s)}function qa(t,e,i,n){var s=t.setup,r=t.wrapperComponent,a=s.limitToBounds,o=$a(t.props),l=t.transformState,c=l.scale,h=l.positionX,d=l.positionY;if(r){var u=Aa(t,o.scale),p=ka(o.positionX,o.positionY,u,a,0,0,r),f={scale:o.scale,positionX:p.x,positionY:p.y};c===o.scale&&h===o.positionX&&d===o.positionY||(null==n||n(),_a(t,f,e,i))}}var Xa=function(t){return function(e,i,n){void 0===e&&(e=.5),void 0===i&&(i=300),void 0===n&&(n="easeOut"),Ga(t,1,e,i,n)}},Ya=function(t){return function(e,i,n){void 0===e&&(e=.5),void 0===i&&(i=300),void 0===n&&(n="easeOut"),Ga(t,-1,e,i,n)}},Ka=function(t){return function(e,i,n,s,r){void 0===s&&(s=300),void 0===r&&(r="easeOut");var a=t.transformState,o=a.positionX,l=a.positionY,c=a.scale,h=t.wrapperComponent,d=t.contentComponent;if(!t.setup.disabled&&h&&d){var u={positionX:Number.isNaN(e)?o:e,positionY:Number.isNaN(i)?l:i,scale:Number.isNaN(n)?c:n};_a(t,u,s,r)}}},Za=function(t){return function(e,i){void 0===e&&(e=200),void 0===i&&(i="easeOut"),qa(t,e,i)}},Ja=function(t){return function(e,i,n){void 0===i&&(i=200),void 0===n&&(n="easeOut");var s=t.transformState,r=t.wrapperComponent,a=t.contentComponent;if(r&&a){var o=ao(e||s.scale,r,a);_a(t,o,i,n)}}},Qa=function(t){return function(e,i,n,s){void 0===n&&(n=600),void 0===s&&(s="easeOut"),wa(t);var r=t.wrapperComponent,a="string"==typeof e?document.getElementById(e):e;if(r&&a&&r.contains(a)){var o=function(t,e,i){var n=t.wrapperComponent,s=t.contentComponent,r=t.transformState,a=t.setup,o=a.limitToBounds,l=a.minScale,c=a.maxScale;if(!n||!s)return r;var h,d,u,p,f,m,g,b,v=n.getBoundingClientRect(),y=e.getBoundingClientRect(),w=(h=n,d=s,u=r,p=e.getBoundingClientRect(),f=h.getBoundingClientRect(),m=d.getBoundingClientRect(),g=f.x*u.scale,b=f.y*u.scale,{x:(p.x-m.x+g)/u.scale,y:(p.y-m.y+b)/u.scale}),x=w.x,_=w.y,A=y.width/r.scale,C=y.height/r.scale,S=n.offsetWidth/A,k=n.offsetHeight/C,E=Ta(i||Math.min(S,k),l,c,0,!1),T=(v.width-A*E)/2,P=(v.height-C*E)/2,M=ka((v.left-x)*E+T,(v.top-_)*E+P,Aa(t,E),o,0,0,n);return{positionX:M.x,positionY:M.y,scale:E}}(t,a,i);_a(t,o,n,s)}}},to=function(t){return{instance:t,zoomIn:Xa(t),zoomOut:Ya(t),setTransform:Ka(t),resetTransform:Za(t),centerView:Ja(t),zoomToElement:Qa(t)}},eo=function(t){var e={};return Object.assign(e,function(t){return{instance:t,state:t.transformState}}(t)),Object.assign(e,to(t)),e};function io(){try{return{get passive(){return!1}}}catch(t){return!1}}var no=".".concat(Ua),so=function(t,e){return e.some(function(e){return t.matches("".concat(no," ").concat(e,", ").concat(no," .").concat(e,", ").concat(no," ").concat(e," *, ").concat(no," .").concat(e," *"))})},ro=function(t){t&&clearTimeout(t)},ao=function(t,e,i){var n=i.offsetWidth*t,s=i.offsetHeight*t;return{scale:t,positionX:(e.offsetWidth-n)/2,positionY:(e.offsetHeight-s)/2}};function oo(t,e,i){var n=e.getBoundingClientRect(),s=0,r=0;if("clientX"in t)s=(t.clientX-n.left)/i,r=(t.clientY-n.top)/i;else{var a=t.touches[0];s=(a.clientX-n.left)/i,r=(a.clientY-n.top)/i}return(Number.isNaN(s)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:s,y:r}}var lo=function(t){return Math.sqrt(Math.pow(t.touches[0].pageX-t.touches[1].pageX,2)+Math.pow(t.touches[0].pageY-t.touches[1].pageY,2))},co=function(t){for(var e=0,i=0,n=0;n<2;n+=1)e+=t.touches[n].clientX,i+=t.touches[n].clientY;return{x:e/2,y:i/2}},ho=function(t,e){var i=t.props.onZoomStop,n=t.setup.doubleClick.animationTime;ro(t.doubleClickStopEventTimer),t.doubleClickStopEventTimer=setTimeout(function(){t.doubleClickStopEventTimer=null,ba(eo(t),e,i)},n)};var uo=function(t){var e=this;this.mounted=!0,this.pinchLastCenterX=null,this.pinchLastCenterY=null,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){e.initializeWindowEvents()},this.unmount=function(){e.cleanupWindowEvents()},this.update=function(t){e.props=t,Sa(e,e.transformState.scale),e.setup=Wa(t)},this.initializeWindowEvents=function(){var t,i,n=io(),s=null===(t=e.wrapperComponent)||void 0===t?void 0:t.ownerDocument,r=null==s?void 0:s.defaultView;null===(i=e.wrapperComponent)||void 0===i||i.addEventListener("wheel",e.onWheelPanning,n),null==r||r.addEventListener("mousedown",e.onPanningStart,n),null==r||r.addEventListener("mousemove",e.onPanning,n),null==r||r.addEventListener("mouseup",e.onPanningStop,n),null==s||s.addEventListener("mouseleave",e.clearPanning,n),null==r||r.addEventListener("keyup",e.setKeyUnPressed,n),null==r||r.addEventListener("keydown",e.setKeyPressed,n)},this.cleanupWindowEvents=function(){var t,i,n=io(),s=null===(t=e.wrapperComponent)||void 0===t?void 0:t.ownerDocument,r=null==s?void 0:s.defaultView;null==r||r.removeEventListener("mousedown",e.onPanningStart,n),null==r||r.removeEventListener("mousemove",e.onPanning,n),null==r||r.removeEventListener("mouseup",e.onPanningStop,n),null==s||s.removeEventListener("mouseleave",e.clearPanning,n),null==r||r.removeEventListener("keyup",e.setKeyUnPressed,n),null==r||r.removeEventListener("keydown",e.setKeyPressed,n),document.removeEventListener("mouseleave",e.clearPanning,n),wa(e),null===(i=e.observer)||void 0===i||i.disconnect()},this.handleInitializeWrapperEvents=function(t){var i=io();t.addEventListener("wheel",e.onWheelZoom,i),t.addEventListener("dblclick",e.onDoubleClick,i),t.addEventListener("touchstart",e.onTouchPanningStart,i),t.addEventListener("touchmove",e.onTouchPanning,i),t.addEventListener("touchend",e.onTouchPanningStop,i)},this.handleInitialize=function(t,i){var n=!1,s=e.setup.centerOnInit,r=function(t,e){for(var i=0,n=t;i<n.length;i++)if(n[i].target===e)return!0;return!1};e.applyTransformation(),e.onInitCallbacks.forEach(function(t){t(eo(e))}),e.observer=new ResizeObserver(function(a){if(r(a,t)||r(a,i))if(s&&!n){var o=i.offsetWidth,l=i.offsetHeight;(o>0||l>0)&&(n=!0,e.setCenter())}else wa(e),Sa(e,e.transformState.scale),La(e,0)}),e.observer.observe(t),e.observer.observe(i)},this.onWheelZoom=function(t){if(!e.setup.disabled){var i=function(t,e){var i=t.setup.wheel,n=i.disabled,s=i.wheelDisabled,r=i.touchPadDisabled,a=i.excluded,o=t.isInitialized,l=t.isPanning,c=e.target;return!(!o||l||n||!c||s&&!e.ctrlKey||r&&e.ctrlKey||so(c,a))}(e,t);i&&e.isPressingKeys(e.setup.wheel.activationKeys)&&(function(t,e){var i=t.props,n=i.onWheelStart,s=i.onZoomStart;t.wheelStopEventTimer||(wa(t),ba(eo(t),e,n),ba(eo(t),e,s))}(e,t),function(t,e){var i=t.props,n=i.onWheel,s=i.onZoom,r=t.contentComponent,a=t.setup,o=t.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,h=a.zoomAnimation,d=a.wheel,u=a.disablePadding,p=a.smooth,f=h.size,m=h.disabled,g=d.step,b=d.smoothStep;if(!r)throw new Error("Component not mounted");e.preventDefault(),e.stopPropagation();var v=function(t){var e=function(t){return t?t.deltaY<0?1:-1:0}(t);return e}(e),y=function(t,e,i,n){var s=t.transformState.scale,r=t.wrapperComponent,a=t.setup,o=a.maxScale,l=a.minScale,c=a.zoomAnimation,h=a.disablePadding,d=c.size,u=c.disabled;if(!r)throw new Error("Wrapper is not mounted");var p=!n&&!u;return Ta(ga(s+e*i,3),l,o,d,p&&!h)}(t,v,p?b*Math.abs(e.deltaY):g,!e.ctrlKey);if(o!==y){var w=Sa(t,y),x=oo(e,r,o),_=l&&(m||0===f||c||u),A=Ea(t,x.x,x.y,y,w,_),C=A.x,S=A.y;t.previousWheelEvent=e,t.setTransformState(y,C,S),ba(eo(t),e,n),ba(eo(t),e,s)}}(e,t),function(t,e){var i=t.props,n=i.onWheelStop,s=i.onZoomStop;ro(t.wheelAnimationTimer),t.wheelAnimationTimer=setTimeout(function(){t.mounted&&(za(t,e.x,e.y),t.wheelAnimationTimer=null)},100);var r=function(t,e){var i=t.previousWheelEvent,n=t.transformState.scale,s=t.setup,r=s.maxScale,a=s.minScale;return!!i&&(n<r||n>a||Math.sign(i.deltaY)!==Math.sign(e.deltaY)||i.deltaY>0&&i.deltaY<e.deltaY||i.deltaY<0&&i.deltaY>e.deltaY||Math.sign(i.deltaY)!==Math.sign(e.deltaY))}(t,e);r&&(ro(t.wheelStopEventTimer),t.wheelStopEventTimer=setTimeout(function(){t.mounted&&(t.wheelStopEventTimer=null,ba(eo(t),e,n),ba(eo(t),e,s))},160))}(e,t))}},this.onWheelPanning=function(t){var i=e.setup,n=i.disabled,s=i.wheel,r=i.panning;if(e.wrapperComponent&&e.contentComponent&&!n&&s.wheelDisabled&&!r.disabled&&r.wheelPanning&&!t.ctrlKey){t.preventDefault(),t.stopPropagation();var a=e.transformState,o=a.positionX,l=a.positionY,c=o-t.deltaX,h=l-t.deltaY,d=r.lockAxisX?o:c,u=r.lockAxisY?l:h,p=e.setup.alignmentAnimation,f=p.sizeX,m=p.sizeY,g=Ia(e,f),b=Ia(e,m);d===o&&u===l||Ra(e,d,u,g,b)}},this.onPanningStart=function(t){var i=e.setup.disabled,n=e.props.onPanningStart;i||Pa(e,t)&&e.isPressingKeys(e.setup.panning.activationKeys)&&(0!==t.button||e.setup.panning.allowLeftClickPan)&&(1!==t.button||e.setup.panning.allowMiddleClickPan)&&(2!==t.button||e.setup.panning.allowRightClickPan)&&(t.preventDefault(),t.stopPropagation(),wa(e),Da(e,t),ba(eo(e),t,n))},this.onPanning=function(t){var i=e.setup.disabled,n=e.props.onPanning;i||Ma(e)&&e.isPressingKeys(e.setup.panning.activationKeys)&&(t.preventDefault(),t.stopPropagation(),Fa(e,t.clientX,t.clientY),ba(eo(e),t,n))},this.onPanningStop=function(t){var i=e.props.onPanningStop;e.isPanning&&(function(t){if(t.isPanning){var e=t.setup.panning.velocityDisabled,i=t.velocity,n=t.wrapperComponent,s=t.contentComponent;t.isPanning=!1,t.animate=!1,t.animation=null;var r=null==n?void 0:n.getBoundingClientRect(),a=null==s?void 0:s.getBoundingClientRect(),o=(null==r?void 0:r.width)||0,l=(null==r?void 0:r.height)||0,c=(null==a?void 0:a.width)||0,h=(null==a?void 0:a.height)||0,d=o<c||l<h;!e&&i&&(null==i?void 0:i.total)>.1&&d?function(t){var e=t.velocity,i=t.bounds,n=t.setup,s=t.wrapperComponent,r=function(t){var e=t.mounted,i=t.velocity,n=t.bounds,s=t.setup,r=s.disabled,a=s.velocityAnimation,o=t.transformState.scale;return!(a.disabled&&!(o>1)&&r&&!e||!i||!n)}(t);if(r&&e&&i&&s){var a=e.velocityX,o=e.velocityY,l=e.total,c=i.maxPositionX,h=i.minPositionX,d=i.maxPositionY,u=i.minPositionY,p=n.limitToBounds,f=n.alignmentAnimation,m=n.zoomAnimation,g=n.panning,b=g.lockAxisY,v=g.lockAxisX,y=m.animationType,w=f.sizeX,x=f.sizeY,_=f.velocityAlignmentTime,A=function(t,e){var i=t.setup.velocityAnimation,n=i.equalToMove,s=i.animationTime,r=i.sensitivity;return n?s*e*r:s}(t,l),C=Math.max(A,_),S=Ia(t,w),k=Ia(t,x),E=S*s.offsetWidth/100,T=k*s.offsetHeight/100,P=c+E,M=h-E,R=d+T,I=u-T,N=t.transformState,D=(new Date).getTime();xa(t,y,C,function(e){var i=t.transformState,n=i.scale,s=i.positionX,r=i.positionY,l=((new Date).getTime()-D)/_,m=1-(0,va[f.animationType])(Math.min(1,l)),g=1-e,y=s+a*g,w=r+o*g,x=Na(y,N.positionX,s,v,p,h,c,M,P,m),A=Na(w,N.positionY,r,b,p,u,d,I,R,m);s===y&&r===w||t.setTransformState(n,x,A)})}}(t):La(t)}}(e),ba(eo(e),t,i))},this.onPinchStart=function(t){var i=e.setup.disabled,n=e.props,s=n.onPinchingStart,r=n.onZoomStart;if(!i){var a=function(t,e){var i=t.setup.pinch,n=i.disabled,s=i.excluded,r=t.isInitialized,a=e.target;return!(!r||n||!a||so(a,s))}(e,t);a&&(function(t,e){var i=lo(e);t.pinchStartDistance=i,t.lastDistance=i,t.pinchStartScale=t.transformState.scale,t.isPanning=!1;var n=co(e);t.pinchLastCenterX=n.x,t.pinchLastCenterY=n.y,wa(t)}(e,t),wa(e),ba(eo(e),t,s),ba(eo(e),t,r))}},this.onPinch=function(t){var i=e.setup.disabled,n=e.props,s=n.onPinching,r=n.onZoom;if(!i){var a=function(t){var e=t.setup.pinch.disabled,i=t.isInitialized,n=t.pinchStartDistance;return!(!i||e||!n)}(e);a&&(t.preventDefault(),t.stopPropagation(),function(t,e){var i=t.contentComponent,n=t.pinchStartDistance,s=t.wrapperComponent,r=t.transformState.scale,a=t.setup,o=a.limitToBounds,l=a.centerZoomedOut,c=a.zoomAnimation,h=a.alignmentAnimation,d=c.disabled,u=c.size;if(null!==n&&i){var p=function(t,e,i){var n=i.getBoundingClientRect(),s=t.touches,r=ga(s[0].clientX-n.left,5),a=ga(s[0].clientY-n.top,5);return{x:(r+ga(s[1].clientX-n.left,5))/2/e,y:(a+ga(s[1].clientY-n.top,5))/2/e}}(e,r,i);if(Number.isFinite(p.x)&&Number.isFinite(p.y)){var f=lo(e),m=function(t,e){var i=t.pinchStartScale,n=t.pinchStartDistance,s=t.setup,r=s.maxScale,a=s.minScale,o=s.zoomAnimation,l=s.disablePadding,c=o.size,h=o.disabled;if(!i||null===n||!e)throw new Error("Pinch touches distance was not provided");return e<0?t.transformState.scale:Ta(ga(e/n*i,2),a,r,c,!h&&!l)}(t,f),g=co(e),b=g.x-(t.pinchLastCenterX||0),v=g.y-(t.pinchLastCenterY||0);if(m!==r||0!==b||0!==v){t.pinchLastCenterX=g.x,t.pinchLastCenterY=g.y;var y=Sa(t,m),w=o&&(d||0===u||l),x=Ea(t,p.x,p.y,m,y,w),_=x.x,A=x.y;t.pinchMidpoint=p,t.lastDistance=f;var C=h.sizeX,S=h.sizeY,k=ka(_+b,A+v,y,o,Ia(t,C),Ia(t,S),s),E=k.x,T=k.y;t.setTransformState(m,E,T)}}}}(e,t),ba(eo(e),t,s),ba(eo(e),t,r))}},this.onPinchStop=function(t){var i,n,s=e.props,r=s.onPinchingStop,a=s.onZoomStop;e.pinchStartScale&&(n=(i=e).pinchMidpoint,i.velocity=null,i.lastDistance=null,i.pinchMidpoint=null,i.pinchStartScale=null,i.pinchStartDistance=null,za(i,null==n?void 0:n.x,null==n?void 0:n.y),ba(eo(e),t,r),ba(eo(e),t,a))},this.onTouchPanningStart=function(t){var i=e.setup.disabled,n=e.props.onPanningStart;if(!i&&Pa(e,t)&&!(e.lastTouch&&+new Date-e.lastTouch<200&&1===t.touches.length)){e.lastTouch=+new Date,wa(e);var s=t.touches,r=1===s.length,a=2===s.length;r&&(wa(e),Da(e,t),ba(eo(e),t,n)),a&&e.onPinchStart(t)}},this.onTouchPanning=function(t){var i=e.setup.disabled,n=e.props.onPanning;if(e.isPanning&&1===t.touches.length){if(i)return;if(!Ma(e))return;t.preventDefault(),t.stopPropagation();var s=t.touches[0];Fa(e,s.clientX,s.clientY),ba(eo(e),t,n)}else t.touches.length>1&&e.onPinch(t)},this.onTouchPanningStop=function(t){e.onPanningStop(t),e.onPinchStop(t)},this.onDoubleClick=function(t){if(!e.setup.disabled){var i=function(t,e){var i=t.isInitialized,n=t.setup,s=t.wrapperComponent,r=n.doubleClick,a=r.disabled,o=r.excluded,l=e.target,c=null==s?void 0:s.contains(l);return!(!(i&&l&&c)||a||so(l,o))}(e,t);i&&function(t,e){var i=t.setup,n=t.doubleClickStopEventTimer,s=t.transformState,r=t.contentComponent,a=s.scale,o=t.props,l=o.onZoomStart,c=o.onZoom,h=i.doubleClick,d=h.disabled,u=h.mode,p=h.step,f=h.animationTime,m=h.animationType;if(!d&&!n){if("reset"===u)return function(t,e){var i=t.props,n=i.onZoomStart,s=i.onZoom,r=t.setup.doubleClick,a=r.animationTime,o=r.animationType;ba(eo(t),e,n),qa(t,a,o,function(){return ba(eo(t),e,s)}),ho(t,e)}(t,e);if(!r)return console.error("No ContentComponent found");var g=function(t,e){return"toggle"===t?1===e?1:-1:"zoomOut"===t?-1:1}(u,t.transformState.scale),b=Va(t,g,p);if(a!==b){ba(eo(t),e,l);var v=oo(e,r,a),y=Oa(t,b,v.x,v.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");ba(eo(t),e,c),_a(t,y,f,m),ho(t,e)}}}(e,t)}},this.clearPanning=function(t){e.isPanning&&e.onPanningStop(t)},this.setKeyPressed=function(t){e.pressedKeys[t.key]=!0},this.setKeyUnPressed=function(t){e.pressedKeys[t.key]=!1},this.isPressingKeys=function(t){return!t.length||Boolean(t.find(function(t){return e.pressedKeys[t]}))},this.setTransformState=function(t,i,n){var s=e.props.onTransformed;if(Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(n))console.error("Detected NaN set state values");else{t!==e.transformState.scale&&(e.transformState.previousScale=e.transformState.scale,e.transformState.scale=t),e.transformState.positionX=i,e.transformState.positionY=n,e.applyTransformation();var r=eo(e);e.onChangeCallbacks.forEach(function(t){return t(r)}),ba(r,{scale:t,positionX:i,positionY:n},s)}},this.setCenter=function(){if(e.wrapperComponent&&e.contentComponent){var t=ao(e.transformState.scale,e.wrapperComponent,e.contentComponent);e.setTransformState(t.scale,t.positionX,t.positionY)}},this.handleTransformStyles=function(t,i,n){return e.props.customTransform?e.props.customTransform(t,i,n):function(t,e,i){return"translate(".concat(t,"px, ").concat(e,"px) scale(").concat(i,")")}(t,i,n)},this.applyTransformation=function(){if(e.mounted&&e.contentComponent){var t=e.transformState,i=t.scale,n=t.positionX,s=t.positionY,r=e.handleTransformStyles(n,s,i);e.contentComponent.style.transform=r}},this.getContext=function(){return eo(e)},this.onChange=function(t){return e.onChangeCallbacks.has(t)||e.onChangeCallbacks.add(t),function(){e.onChangeCallbacks.delete(t)}},this.onInit=function(t){return e.onInitCallbacks.has(t)||e.onInitCallbacks.add(t),function(){e.onInitCallbacks.delete(t)}},this.init=function(t,i){e.cleanupWindowEvents(),e.wrapperComponent=t,e.contentComponent=i,Sa(e,e.transformState.scale),e.handleInitializeWrapperEvents(t),e.handleInitialize(t,i),e.initializeWindowEvents(),e.isInitialized=!0;var n=eo(e);ba(n,void 0,e.props.onInit)},this.props=t,this.setup=Wa(this.props),this.transformState=$a(this.props)},po=a().createContext(null),fo=a().forwardRef(function(t,e){var i,n,s=(0,r.useRef)(new uo(t)).current,o=(i=t.children,n=to(s),"function"==typeof i?i(n):i);return(0,r.useImperativeHandle)(e,function(){return to(s)},[s]),(0,r.useEffect)(function(){s.update(t)},[s,t]),a().createElement(po.Provider,{value:s},o)});a().forwardRef(function(t,e){var i,n=(0,r.useRef)(null),s=(0,r.useContext)(po);return(0,r.useEffect)(function(){return s.onChange(function(t){n.current&&(n.current.style.transform=s.handleTransformStyles(0,0,1/t.instance.transformState.scale))})},[s]),a().createElement("div",ja({}
1,t,{ref:(i=[n,e],function(t){i.forEach(function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)})})}))});!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}(".transform-component-module_wrapper__SPB86 {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n transform: translate3d(0, 0, 0);\n}\n.transform-component-module_content__FBWxo {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__FBWxo img {\n pointer-events: none;\n}\n");var mo=function(t){var e=t.children,i=t.wrapperClass,n=void 0===i?"":i,s=t.contentClass,o=void 0===s?"":s,l=t.wrapperStyle,c=t.contentStyle,h=t.wrapperProps,d=void 0===h?{}:h,u=t.contentProps,p=void 0===u?{}:u,f=(0,r.useContext)(po),m=f.init,g=f.cleanupWindowEvents,b=(0,r.useRef)(null),v=(0,r.useRef)(null);return(0,r.useEffect)(function(){var t=b.current,e=v.current;return null!==t&&null!==e&&m&&(null==m||m(t,e)),function(){null==g||g()}},[]),a().createElement("div",ja({},d,{ref:b,className:"".concat(Ua," ").concat("transform-component-module_wrapper__SPB86"," ").concat(n),style:l}),a().createElement("div",ja({},p,{ref:v,className:"".concat("react-transform-component"," ").concat("transform-component-module_content__FBWxo"," ").concat(o),style:c}),e))},go=i(91396),bo=i(41705),vo=i(51053),yo=i.n(vo),wo=i(18814);function xo(t){const{visible:e,data:i,type:n,setPrevisualizarArchivosVisible:o,nombre:l,nombreRequisito:c}=t,[h,d]=(0,r.useState)(0),[u,p]=(0,r.useState)(1),[f,m]=(0,r.useState)(100),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{if("application/vnd.openxmlformats-officedocument.wordprocessingml.document"===n||"docx"===n){const t=setTimeout(()=>{if(!g.current)return;const t=atob(i),e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);const s=new Blob([e],{type:n});g.current.innerHTML="",async function(t,e,i,n){const s=await function(t,e){const i={...pa,...e};return Hr.load(t,new ia(i),i)}(t,n);return await async function(t,e,i,n){const s={...pa,...n},r=new ha(window.document);return await r.render(t,e,i,s)}(s,e,i,n),s}(s,g.current).then().catch(t=>console.error("Error en renderAsync",t))},100);return()=>clearTimeout(t)}},[e]);const b=()=>{m(140),d(0),p(1),o(!1)};return(0,s.jsx)(go.A,{open:e,onClose:b,"aria-labelledby":"modal-title","aria-describedby":"modal-description",className:"flex justify-center items-center ",children:(0,s.jsxs)("div",{className:"",children:[(0,s.jsx)("div",{className:" fixed w-full h-full justify-center ".concat(yo().select_scrollbar," body overflow-auto items-center top-0 left-0"),children:(0,s.jsx)("div",{className:"flex justify-center relative w-full ",onClick:t=>{t.stopPropagation(),b()},style:{height:"".concat(f,"%")},children:(0,s.jsx)("div",{className:"flex justify-center w-fit h-full ",onClick:t=>t.stopPropagation(),children:"image"===n.substring(0,5)?(0,s.jsx)(fo,{initialScale:1,children:t=>{let{zoomIn:e,zoomOut:r,resetTransform:o}=t;return(0,s.jsxs)(a().Fragment,{children:[(0,s.jsx)("div",{className:"pdf-container-img top-1 rounded-3xl p-16",children:(0,s.jsx)(mo,{children:(0,s.jsx)("div",{className:"divzoom",children:(0,s.jsx)("img",{src:"data:".concat(n,";base64,").concat(i),alt:"Base64",style:{maxWidth:"auto",height:"auto"}})})})}),(0,s.jsx)("div",{className:"flex fixed bottom-1 w-full justify-center",children:(0,s.jsx)("div",{className:"flex-col justify-center",children:(0,s.jsxs)("div",{className:"flex justify-center items-center rounded-full py-[6px] px-2 bg-pt-primary space-x-4",children:[(0,s.jsx)("button",{className:" flex items-center justify-center rounded-full duration-300 hover:scale-[1.1]",onClick:t=>{t.stopPropagation(),r()},children:(0,s.jsx)(ma.e,{className:"size-5 fill-white"})}),(0,s.jsx)("button",{className:" flex items-center justify-center rounded-full duration-300 hover:scale-[1.1]",onClick:t=>{t.stopPropagation(),e()},children:(0,s.jsx)(fa.$,{className:"size-5 fill-white"})}),(0,s.jsx)("button",{className:" flex items-center justify-center rounded-full duration-300 hover:scale-[1.1]",onClick:t=>{t.stopPropagation(),o()},children:(0,s.jsx)(bo.fN,{className:"size-[18px] fill-white"})})]})})})]})}}):"application/pdf"===n?(0,s.jsx)(ss,{className:"gdcp__prearchview--archivos",file:"data:".concat(n,";base64,").concat(i),onLoadSuccess:function(t){let{numPages:e}=t;d(e)},children:(0,s.jsx)(As,{className:"gdcp__prearchview-canvas",width:f/100*800,pageNumber:u,renderTextLayer:!1})}):"application/vnd.openxmlformats-officedocument.wordprocessingml.document"===n?(0,s.jsx)("div",{className:"".concat(yo().gdcp__prearchview__doc),ref:g}):(0,s.jsx)("iframe",{style:{height:"100%",width:"100%",border:"none"},title:"pdf",src:"data:".concat(n,";base64,").concat(i)})})})}),(0,s.jsx)("div",{className:"w-fit flex justify-center ",children:"application/pdf"===n&&(0,s.jsxs)("div",{className:"fixed bottom-0",children:[(0,s.jsx)("div",{className:"flex justify-center",onClick:t=>t.stopPropagation(),children:(0,s.jsxs)("p",{className:"bg-pt-quaternary/80 rounded-full flex justify-center font-anek font-medium text-t2 w-fit px-2",children:["Página ",u," de ",h]})}),(0,s.jsxs)("div",{className:"flex justify-center w-full space-x-[10px] mt-2 mb-2 bg-pt-primary rounded-full p-1",onClick:t=>t.stopPropagation(),children:[(0,s.jsx)("button",{className:" rounded-full transition-all duration-200",onClick:t=>{t.stopPropagation(),u>1&&p(t=>t-1)},children:(0,s.jsx)(bo.rZ,{className:"size-3 rounded-xl fill-white hover:scale-[1.2] transition-all duration-200"})}),(0,s.jsx)("button",{className:" rounded-full transition-all duration-200",onClick:t=>{t.stopPropagation(),f>20&&m(t=>t-20)},children:(0,s.jsx)(ma.e,{className:"size-4 fill-white hover:scale-[1.1] transition-all duration-200"})}),(0,s.jsxs)("p",{className:"text-t3 flex items-center text-white rounded-full font-anek font-bold",children:[f,"%"]}),(0,s.jsx)("button",{className:" rounded-full transition-all duration-200",onClick:t=>{t.stopPropagation(),f<1e3&&m(t=>t+20)},children:(0,s.jsx)(fa.$,{className:"size-4 fill-white hover:scale-[1.1] transition-all duration-200"})}),(0,s.jsx)("button",{className:" rounded-full transition-all duration-200",onClick:t=>{t.stopPropagation(),u<h&&p(t=>t+1)},children:(0,s.jsx)(bo.wF,{className:"size-3 hover:scale-[1.2] transition-all duration-200 rounded-xl fill-white "})})]})]})}),(0,s.jsxs)("div",{className:"flex right-8 rounded-full space-x-3 top-3 px-3 py-[7px] f
1ixed bg-pt-quaternary/60 justify-center items-start",children:[(0,s.jsx)("div",{className:"cursor-pointer",onClick:()=>{var t;const e=l.indexOf("-"),s=(-1!==e?l.substring(0,e):l.split(".").slice(0,-1).join("."))+(c?"-"+c.replace(/ /g,"-").toUpperCase():"")+"."+(null===(t=l.split(".").pop())||void 0===t?void 0:t.toLocaleLowerCase()),r=atob(i),a=new Uint8Array(r.length);for(let t=0;t<r.length;t++)a[t]=r.charCodeAt(t);const o=new Blob([a],{type:n}),h=document.createElement("a");h.href=URL.createObjectURL(o),h.download=s,h.click(),URL.revokeObjectURL(h.href)},title:"Descargar",children:(0,s.jsx)(bo.Xm,{className:"fill-white size-4"})}),(0,s.jsxs)("div",{onClick:b,className:"cursor-pointer",title:"Salir",children:[(0,s.jsx)(bo.sF,{color:"#fff"})," "]})]})]})})}_n.workerSrc="".concat(wo.NI,"/pdf.worker.min.mjs")},78424:function(t,e,i){"use strict";i.d(e,{w:function(){return b}});var n=i(1995),s=i(28545),r=i(33350),a=i.n(r),o=i(16984),l=i.n(o),c=i(41705),h=t=>{let{className:e}=t;return(0,n.jsx)("div",{className:"".concat(e," gap-2 mx-auto"),children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"https://x.com/gobqro",target:"blank",referrerPolicy:"no-referrer",rel:"noopener",children:(0,n.jsx)(c.$L,{className:"size-8"})}),(0,n.jsx)(a(),{href:"https://www.instagram.com/gobiernoqueretaro",target:"blank",referrerPolicy:"no-referrer",rel:"noopener",children:(0,n.jsx)(c.Lx,{className:"size-8"})}),(0,n.jsx)(a(),{href:"https://www.facebook.com/GobQro?ref=ts",target:"blank",referrerPolicy:"no-referrer",rel:"noopener",children:(0,n.jsx)(c.lB,{className:"size-8"})}),(0,n.jsx)(a(),{href:"https://www.youtube.com/user/GobQro",target:"blank",referrerPolicy:"no-referrer",rel:"noopener",children:(0,n.jsx)("div",{className:"rounded-full bg-[#212d59] p-[7px] w-8 h-8 flex justify-center items-center",children:(0,n.jsx)(c.o4,{})})})]})})},d=i(18814),u=i(13732),p=i(74388),f=i(760),m=i(99192),g=i.n(m);const b=()=>{const[t,e]=(0,u.useState)(!1),[i,r]=(0,u.useState)();return(0,n.jsxs)("footer",{className:g().footerContainer,children:[(0,n.jsx)(h,{className:g().footerSocialMedia}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(l(),{alt:"Logotipo Querétaro",src:"".concat(s.f,"/poder_ejecutivo.png"),width:300,height:300,className:g().logoQro})}),(0,n.jsxs)("div",{className:g().footerLinks,children:[(0,n.jsx)("div",{className:"cursor-pointer text-center",onClick:()=>(async()=>{if(!(null==i?void 0:i.base64)){var t;const e=await(async t=>{try{const e=await fetch(t);if(404===(null==e?void 0:e.status))return{base64:"",name:"",type:"",url:""};const i=await e.blob();return{base64:await new Promise((t,e)=>{const n=new FileReader;n.onloadend=()=>{const e=n.result;t(e.split(",")[1])},n.onerror=e,n.readAsDataURL(i)}),name:t.split("/").pop()||"archivo.pdf",type:i.type,url:URL.createObjectURL(i)}}catch(t){throw console.error("Error al precargar archivo:",t),t}})("".concat(d.NI,"/docs/").concat("AVISO-DE-PRIVACIDAD-VF-04-08-25",".pdf"));if(0===(null==e||null===(t=e.base64)||void 0===t?void 0:t.length))return void(null===f.default||void 0===f.default||f.default.error("No se encontró la ruta del archivo, solicite ayuda a soporte técnico"));r({base64:null==e?void 0:e.base64,id:1,nombre:null==e?void 0:e.name,tipoDoc:"application/pdf"})}e(!0)})(),children:"AVISO DE PRIVACIDAD"}),(0,n.jsx)(a(),{href:"mailto:[email protected]",target:"blank",className:"text-center",children:"¿PROBLEMAS TÃCNICOS?"}),(0,n.jsx)(a(),{href:"tel:+524422117070",className:"text-center",children:"¿TIENES DUDAS?"})]}),t&&(0,n.jsx)(p.C,{type:(null==i?void 0:i.tipoDoc)||"",data:(null==i?void 0:i.base64)||"",nombre:(null==i?void 0:i.nombre)||"",visible:t,nombreRequisito:"",setPrevisualizarArchivosVisible:e})]})}},48807:function(t,e,i){"use strict";i.d(e,{V:function(){return p}});var n=i(1995),s=i(13732),r=i(33350),a=i.n(r),o=i(16984),l=i.n(o),c=i(76424),h=i(28545),d=i(47074),u=i(10865);const p=()=>{const t=(0,c.usePathname)(),[e,i]=(0,s.useState)(""),[r,o]=(0,s.use
1State)(null),p=(0,u.useRouter)(),f=(0,s.useMemo)(()=>({"/":"Portal Tributario","/oficina-virtual":"Mi perfil","/buzon-tributario":"Buzón Tributario - Notificaciones","/impuesto":"Impuesto sobre nómina","/constancia":"Constancia","/donativos":"Donativos","/tramite":"Inscripción al padrón de contribuyentes","/ingreso":"Ingreso al portal","/oficina-virtual/notificaciones":"Notificaciones","/oficina-virtual/contribuciones":"Contribuciones","/oficina-virtual/contribuciones/aumento-obligaciones":"Aumento de obligaciones","/oficina-virtual/contribuciones/disminucion-obligaciones":" Disminucion de obligaciones","/oficina-virtual/mis-tramites":"Mis tramites"}),[]);return(0,s.useEffect)(()=>{const t=window.sessionStorage.getItem("user_data");t&&o(JSON.parse(t))},[]),(0,s.useEffect)(()=>{const e=()=>{if(window.scrollY>50){const e=f[t];i(e)}else i("")};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[f]),(0,n.jsx)(n.Fragment,{children:"/ingreso"===t||"/registro"===t?(0,n.jsxs)("div",{className:"flex items-center gap-2 h-[55px] pt-[15px] sticky top-0 z-80 bg-pt-gray-100",children:[(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-r-md basis-10/12 text-white font-bold uppercase pl-6 font-anek",children:e}),(0,n.jsx)(a(),{href:"/",className:"bg-pt-secondary rounded-lg text-white py-[6px] px-6 uppercase text-sm",children:"Inicio"}),(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-md basis-1/12"}),(0,n.jsx)("div",{className:"w-52",children:(0,n.jsx)(a(),{href:"/",children:(0,n.jsx)(l(),{src:"".concat(h.f,"/edo_qro.png"),alt:"logo",width:208,he
1ight:100})})}),(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-l-md basis-1/12"})]}):(0,n.jsxs)("div",{className:"flex items-center h-[48px] pt-[15px] gap-2 sticky top-0 z-80 bg-white",children:[(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-r-md basis-10/12 text-white font-bold uppercase pl-6 font-anek",children:e}),"/"!=t?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("button",{onClick:()=>(async()=>{try{r&&r.rfc?(await d.y.logout(r.rfc),sessionStorage.clear(),p.push("/")):console.error("userData es null o no tiene un RFC")}catch(t){console.error("Error al cerrar sesión:",t)}})(),className:"bg-pt-tertiary rounded-lg text-white p-[6px] uppercase text-sm whitespace-nowrap",children:"Cerrar Sesión"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/registro",className:"bg-pt-secondary rounded-lg text-white p-[6px] uppercase text-sm",children:"Registro"}),(0,n.jsx)(a(),{href:"/ingreso",className:"bg-pt-tertiary rounded-lg text-white p-[6px] uppercase text-sm whitespace-nowrap",children:"ACCESO"})]}),(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-md basis-1/12"}),(0,n.jsx)(a(),{href:"/",children:(0,n.jsx)(l(),{src:"".concat(h.f,"/edo_qro.png"),alt:"logo",className:"",width:208,he
1ight:100})}),(0,n.jsx)("span",{className:"bg-pt-primary w-full h-7 rounded-l-md basis-1/12 text-white font-anek text-sm flex justify-center items-center",children:"v1.3.0"})]})})}},57982:function(t,e,i){"use strict";i.d(e,{p:function(){return h}});var n=i(1995),s=i(13732),r=i(760);const a=t=>{let{url:e}=t;return(0,n.jsxs)("div",{className:"modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},children:[(0,n.jsx)("div",{style:{position:"absolute",zIndex:"10",width:"800px",height:"455px",borderRadius:"25px",backgroundColor:"white"},children:" "}),(0,n.jsx)("iframe",{src:null!=e?e:"",style:{zIndex:"20",width:"1000px",height:"455px",border:"none"},title:"Método de pago "})]})};var o=i(21403),l=i(36428),c=i(18814);const h=(0,s.forwardRef)((t,e)=>{let{onPaymentComplete:i,setIsLoading:h,onPaymentFailed:d,onCancel:u,showButton:p=!0}=t;const[f,m]=(0,s.useState)(!1),[g,b]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),w=async t=>{switch(t.data){case"PAYMENT_COMPLETE":await new Promise(t=>setTimeout(t,1e4)),m(!1),null==i||i();break;case"PAYMENT_FAILED":null==d||d(),r.default.error("No fué posible procesar la selección del método de pago, intente más tarde"),await new Promise(t=>setTimeout(t,5e3)),m(!1);break;case"PAYMENT_CANCELLED":null==u||u(),r.default.error("Pago cancelado"),m(!1)}};(0,s.useImperativeHandle)(e,()=>({payment:_}));const x=()=>{y(!0)};(0,s.useEffect)(()=>(window.addEventListener("message",w),()=>{window.removeEventListener("message",w)}),[]);const _=async t=>{h(!0);try{if(t)return b(t),c.Jp.includes("/app-dev")||c.Jp.includes("/app-qa")?x():m(!0),h(!1),!0;const e=await(0,l.F)({module:"/ctr_declaraciones",plantilla:"/getData4Pay",method:"POST",body:{}});if(null==e?void 0:e.error)return r.default.error(e.error||". Verifica tu información!"),void h(!1);let i=e.result;return i.error?(r.default.error(i.error),void h(!1)):i.url?(b(i.url),c.Jp.includes("/app-dev")||c.Jp.includes("/app-qa")?x():m(!0),!0):(r.default.error("Los datos de la respuesta no coinciden con lo esperado: ".concat(JSON.stringify(i))),void h(!1))}catch(t){console.error("Error al procesar la solicitud de método de pago:",t),r.default.error("Error al procesar la solicitud de método de pago: ".concat(t)),h(!1)}},A=t=>{let{onConfirm:e,onCancel:i,isOpen:s}=t;return s?(0,n.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,n.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-lg",children:[(0,n.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Confirme"}),(0,n.jsx)("p",{className:"mb-6",children:"Conectese a la VPN de PEEQ para continuar!"}),(0,n.jsx)("div",{className:"flex justify-end gap-4",children:(0,n.jsx)("button",{onClick:e,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Continuar"})})]})}):null};return(0,n.jsxs)(n.Fragment,{children:[p&&(0,n.jsx)(o.d,{onClick:()=>_(),pClassName:"text-[12px]",className:"px-0.5",type:"tertiary",title:"Prueba de pagos"}),(0,n.jsx)(A,{isOpen:v,onConfirm:()=>{y(!1),m(!0)},onCancel:()=>{y(!1),b(null)}}),f&&g&&(0,n.jsx)(a,{url:g})]})})},96837:function(t,e,i){"use strict";i.d(e,{z:function(){return u}});var n=i(1995),s=i(13732),r=i(10865),a=i(28545),o=i(65499),l=i.n(o),c=i(44663),h=i(18814);const d=(()=>{const t=[{id:8,href:"/oficina-virtual/mi-perfil",icon:"icono_casa.svg",label:"Mi Perfil"},{id:0,href:"/oficina-virtual/notificaciones/",icon:"icono_notificacion.svg",label:"Notificaciones"},{id:1,href:"/oficina-virtual/mis-tramites",icon:"icono_inscripcion.svg",label:"Mis Trámites"},{id:2,href:"/oficina-virtual/contribuciones",icon:"icono_obligaciones.svg",label:"Impuestos"},{id:3,href:"/oficina-virtual/mis-vehiculos",icon:"icono_vehiculos.svg",label:"Vehicular"},{id:6,href:"/oficina-virtual/agendar-cita",icon:"icono_cita.svg",label:"Agendar cita"}];return h.j2||t.push({id:5,href:"#",icon:"icono_diversos.svg",label:"Diversos"}),t})(),u=t=>{let{active:e,flagToRefreshUserData:i,setActive:o}=t;var h,u,p;
1const f=(0,r.useRouter)(),[m]=(0,s.useState)(!1),[g,b]=(0,s.useState)(8),v=(0,s.useMemo)(()=>{const t=sessionStorage.getItem("user_data");return t?JSON.parse(t):null},[i]);var y;const w=null!==(y=sessionStorage.getItem("tipoPersona"))&&void 0!==y?y:"";var x,_,A;(0,s.useEffect)(()=>{var t,e;const i=null!==(e=null===(t=d.find(t=>f.pathname.includes(t.href.split("/")[2])))||void 0===t?void 0:t.id)&&void 0!==e?e:8;b(i)},[f.pathname]);const C="F"===w?"".concat(null!==(x=null==v||null===(h=v.nombre)||void 0===h?void 0:h[0])&&void 0!==x?x:"").concat(null!==(_=null==v||null===(u=v.apellido_paterno)||void 0===u?void 0:u[0])&&void 0!==_?_:""):null!==(A=null==v||null===(p=v.razon_social)||void 0===p?void 0:p.substring(0,2))&&void 0!==A?A:"";return(0,n.jsx)("aside",{className:"sticky top-12 flex h-full -translate-x-10 gap-x-4 rounded-br-full ".concat(8===g?"bg-pt-gray-100":"bg-white"),children:(0,n.jsxs)("div",{className:"".concat(l().sidebar," bg-white group"),children:[(0,n.jsxs)("div",{className:"flex-col w-full flex transform transition-all duration-100 bg-pt-gray-100 ".concat(8===g&&" rounded-br-[17px]"),children:[(0,n.jsx)("div",{className:"md:group-hover:size-14 md:group-hover:ml-5 size-10 ml-2 mt-1 relative inline-flex items-center justify-center transform duration-150 overflow-hidden bg-[#C4C4C4] rounded-full",children:(0,n.jsx)("span",{className:"md:group-hover:text-3xl text-[16px] font-bold text-white transform duration-150 font-anek text-3xl",children:C})}),(0,n.jsxs)("div",{className:"md:group-hover:opacity-100 opacity-0 pl-4 transform duration-150 uppercase text-[18px] leading-5 translate-y-3 mb-6 ml-1",children:[(0,n.jsx)("h2",{className:"text-pt-primary font-bold font-anek text-nowrap",children:"Bienvenid@,"}),"F"===w?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h2",{className:"text-pt-secondary font-bold font-anek text-nowrap truncate",children:null==v?void 0:v.nombre}),(0,n.jsxs)("h2",{className:"text-pt-secondary font-bold font-anek text-nowrap truncate",children:[null==v?void 0:v.apellido_paterno," ",null==v?void 0:v.apellido_materno]})]}):(0,n.jsx)("h2",{className:"text-pt-secondary font-bold font-anek text-nowrap truncate",children:null==v?void 0:v.razon_social})]})]}),d.map((t,e)=>{var i,s;const r=["flex w-full bg-pt-gray-100",g===t.id&&"bg-white",g===(null===(i=d[e+1])||void 0===i?void 0:i.id)&&"rounded-br-[17px]",g===(null===(s=d[e-1])||void 0===s?void 0:s.id)&&"rounded-tr-[17px]","overflow-visible",l().sidebar__option].filter(Boolean).join(" ");return(0,n.jsxs)("button",{onClick:()=>(async t=>{o(t.id),b(t.id);try{const e=await fetch("".concat(a.x,"/api/exists/").concat(sessionStorage.getItem("sessionId"))),{exists:i}=await e.json();if(!i)return(0,c.t2)("sessionExpired",!0);window.location.href="".concat(a.x).concat(t.href)}catch(t){(0,c.t2)("sessionExpired",!0)}})(t),className:r,children:[(0,n.jsx)("img",{src:"".concat(a.f,"/").concat(t.icon),className:l().sidebar__option__img,alt:t.label}),(0,n.jsx)("p",{className:"".concat(l().sidebar__option__text," opacity-0 md:group-hover:opacity-100"),children:t.label})]},t.id)}),(0,n.jsx)("div",{className:"h-[20px] bg-pt-gray-100 w-full rounded-br-full ".concat(7===g?"rounded-r-full":"")})]})})}},67790:function(t,e,i){"use strict";i.d(e,{A:function(){return p}});var n=i(1995),s=i(21763),r=i(36428),a=i(13732),o=i(760),l=i(13294),c=i(73788);const h=()=>{},d=new class{async validarCPQro(t){var e,i;const n=await(0,r.F)({method:"GET",module:"/adm_contribuyentes",plantilla:"/valida_cp",parameter:"?cp=".concat(t,"}")});return(null==n||null===(i=n.result)||void 0===i||null===(e=i[0])||void 0===e?void 0:e.cp_code)?{success:!0,data:n.result[0]}:{success:!1,data:[]}}async validarCPGeneral(t){var e,i;const n=await(0,r.F)({method:"GET",module:"/adm_contribuyentes",plantilla:"/valida_cp",parameter:"?cp=".concat(t,"&origen=d")});return(null==n||null===(i=n.result)||void 0===i||null===(e=i[0])||void 0===e?void 0:e.cp_code)?{success:!0,data:n.result[0]}:{success:!1,data:[]}}async consultarMunicipiosPorEstado(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:22;const e=await(0,r.F)({method:"GET",module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_MUNICIPIOS&valor1=".concat(t)});return e.result?{success:!0,data:e.result.map(t=>{var e,i,n,s;return{id:t.id,clave:null!==(n=null===(e=t.nombre.split(" - "))||void 0===e?void 0:e[0])&&void 0!==n?n:"",nombre:null!==(s=null===(i=t.nombre.split(" - "))||void 0===i?void 0:i[1])&&void 0!==s?s:""}})}:{success:!1,data:[]}}
1async consultarLocalidadesPorMunicipio(t){const e=await(0,r.F)({method:"GET",module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_CIUDADES&valor1=".concat(t)});return e.result?{success:!0,data:e.result.map(t=>{var e,i,n,s;return{id:t.id,clave:null!==(n=null===(e=t.nombre.split(" - "))||void 0===e?void 0:e[0])&&void 0!==n?n:"",nombre:null!==(s=null===(i=t.nombre.split(" - "))||void 0===i?void 0:i[1])&&void 0!==s?s:""}})}:{success:!1,data:[]}}async consultarColoniaPorLocalidadYCP(t,e){const i=await(0,r.F)({method:"GET",module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_COLONIAS&valor1=".concat(t,"&valor2=").concat(e)});return i.result?{success:!0,data:i.result.map(t=>{const e=t.nombre.lastIndexOf("-");return{id:t.id,clave:-1!==e?t.nombre.slice(0,e):t.nombre,nombre:-1!==e?t.nombre.slice(e+1).trim():""}})}:{success:!1,data:[]}}},u={id:-1,clave:"",nombre:"OTRA"};var p=(0,a.forwardRef)((t,e)=>{let{initialData:i}=t;var r,p,f,m,g,b,v;const[y,w]=(0,a.useState)(!1),[x,_]=(0,a.useState)(0),[A,C]=(0,a.useState)(i||{}),[S,k]=(0,a.useState)({}),[E,T]=(0,a.useState)([]),[P,M]=(0,a.useState)([]),[R,I]=(0,a.useState)([]),[N,D]=(0,a.useState)([]),[L,F]=(0,a.useState)(!1),O=(t,e)=>{C(i=>({...i,[t]:e}))},z=t=>{k(e=>({...e,[t]:!1}))},j=(0,a.useCallback)(()=>{const{success:t,errors:e}=(t=>{const e={};return(!t.cp||t.cp.length<5)&&(e.cp=!0),t.estado&&t.estado.nombre||(e.estado=!0),t.municipio&&t.municipio.nombre||(e.municipio=!0),t.localidad&&t.localidad.nombre||(e.localidad=!0),("object"!=typeof t.colonia||t.colonia.nombre)&&t.colonia||(e.colonia=!0),t.calle||(e.calle=!0),t.noExterior||(e.noExterior=!0),0===Object.keys(e).length?{success:!0}:{success:!1,errors:e}})(A);return!!t||(k(e),!1)},[A]);return(0,a.useImperativeHandle)(e,()=>({requestData:()=>j()?{success:!0,data:A}:{success:!1,data:null}}),[j,A]),(0,a.useEffect)(()=>{if(!A.cp||A.cp.length<5)return C(t=>({cp:t.cp})),T([]),M([]),I([]),D([]),_(0),void F(!1);(async t=>{w(!0);const{success:e,data:i}=await d.validarCPGeneral(t);if(w(!1),e){if(_(i.cp_code),1===i.cp_code&&(C(t=>({...t,estado:i.estado,municipio:i.municipio,localidad:i.ciudad})),D([...i.colonias,u])),2===i.cp_code&&T(i.estados),3===i.cp_code&&(C(t=>({...t,estado:i.estado})),M(i.municipios)),4===i.cp_code){if(C(t=>({...t,estado:i.estado,municipio:i.municipio})),0===i.ciudades.length)return void I([i.municipio]);I(i.ciudades)}}else o.default.error("Ocurrió un error al consultar el CP")})(A.cp)},[A.cp]),(0,a.useEffect)(()=>{A.estado&&2!==x||(C(t=>({...t,municipio:void 0,localidad:void 0,colonia:void 0})),M([]),I([]),D([]),F(!1)),A.estado&&2===x&&(w(!0),d.consultarMunicipiosPorEstado(A.estado.id).then(t=>{let{success:e,data:i}=t;e?M(i):o.default.error("Ocurrió un error al consultar los municipios")}).finally(()=>w(!1)))},[A.estado]),(0,a.useEffect)(()=>{A.municipio&&2!==x&&3!==x||(C(t=>({...t,localidad:void 0,colonia:void 0})),I([]),D([]),F(!1)),A.municipio&&(2!==x&&3!==x||(w(!0),d.consultarLocalidadesPorMunicipio(A.municipio.id).then(t=>{let{success:e,data:i}=t;e?0!==i.length?I(i):I([A.municipio]):o.default.error("Ocurrió un error al consultar las localidades")}).finally(()=>w(!1))))},[A.municipio]),(0,a.useEffect)(()=>{1!==x&&(C(t=>({...t,colonia:void 0})),D([]),F(!1)),A.localidad&&A.cp&&(2!==x&&3!==x&&4!==x||(w(!0),d.consultarColoniaPorLocalidadYCP(A.localidad.id,A.cp).then(t=>{let{success:e,data:i}=t;e?D([...i,u]):o.default.error("Ocurrió un error al consultar las colonias")}).finally(()=>w(!1))))},[A.localidad]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.a,{show:y}),(0,n.jsx)(s.S,{label:"Código Postal",getText:(t,e)=>{O("cp",e),z("cp")},type:"number",maxCharacters:5,required:!0,wrong:!!S.cp,value:A.cp}),(0,n.jsx)(n.Fragment,{children:2===x?(0,n.jsx)(c.l,{label:"Estado",getActive:(t,e)=>{const i=E.find(t=>t.id===e);O("estado",i),z("estado")},data:E,loader:!1,required:!0,active:null===(r=A.estado)||void 0===r?void 0:r.id,wrong:!!S.estado}):(0,n.jsx)(s.S,{label:"Estado",getText:h,value:null===(p=A.estado)||void 0===p?void 0:p.nombre,readonly:!0,wrong:!!S.estado})}),(0,n.jsx)(n.Fragment,{children:2===x||3===x?(0,n.jsx)(c.l,{label:"Mu
1nicipio",getActive:(t,e)=>{const i=P.find(t=>t.id===e);O("municipio",i),z("municipio")},data:P,readonly:0===P.length,loader:!1,required:!0,active:null===(f=A.municipio)||void 0===f?void 0:f.id,wrong:!!S.municipio}):(0,n.jsx)(s.S,{label:"Municipio",getText:h,value:null===(m=A.municipio)||void 0===m?void 0:m.nombre,readonly:!0,wrong:!!S.municipio})}),(0,n.jsx)(n.Fragment,{children:2===x||3===x||4===x?(0,n.jsx)(c.l,{label:"Localidad",required:!0,getActive:(t,e)=>{const i=R.find(t=>t.id===e);O("localidad",i),z("localidad")},readonly:0===R.length,loader:!1,data:R,active:null===(g=A.localidad)||void 0===g?void 0:g.id,wrong:!!S.localidad}):(0,n.jsx)(s.S,{label:"Localidad",getText:h,value:null===(b=A.localidad)||void 0===b?void 0:b.nombre,readonly:!0,wrong:!!S.localidad})}),(0,n.jsx)(n.Fragment,{children:A.localidad&&N.length>0&&!L?(0,n.jsx)(c.l,{label:"Colonia",getActive:(t,e)=>{if(e&&-1===e)return O("colonia",void 0),void F(!0);const i=N.find(t=>t.id===e);O("colonia",i),z("colonia")},required:!0,loader:!1,data:N,active:"object"==typeof A.colonia?null===(v=A.colonia)||void 0===v?void 0:v.id:void 0,wrong:!!S.colonia}):(0,n.jsx)(s.S,{label:"Colonia",required:!0,getText:(t,e)=>{O("colonia",e)},readonly:!A.localidad,value:"string"==typeof A.colonia?A.colonia:void 0,wrong:!!S.colonia,maxCharacters:200,onClickRefreshIcon:L?()=>{F(!1),O("colonia",void 0)}:void 0})}),(0,n.jsx)(s.S,{label:"Calle",getText:(t,e)=>{O("calle",e),z("calle")},directRegex:/[A-Za-z0-9ñÃáéÃóúÃÃÃÃà "&\(\)\+`{},\.:'-]/,required:!0,wrong:!!S.calle,maxCharacters:200,minCharacters:1,value:A.calle}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(s.S,{className:"grow",label:"No. Ext",getText:(t,e)=>{O("noExterior",e),z("noExterior")},directRegex:/[a-zA-Z0-9ñÃ\(\)\/,\.'& -]/,required:!0,wrong:!!S.noExterior,maxCharacters:50,minCharacters:1,value:A.noExterior}),(0,n.jsx)(s.S,{className:"grow",label:"No. Int",getText:(t,e)=>{O("noInterior",e),z("noInterior")},wrong:!!S.noInterior,maxCharacters:100,value:A.noInterior})]})]})})},63179:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return P}});var n=i(1995),s=i(78424),r=i(48807),a=i(96837),o=i(36428),l=i(84343),c=i(12646),h=i(10865),d=i(13732),u=i(760),p=i(71468),f=i(21403),m=i(61770),g=i(21763),b=i(73788),v=i(77857),y=i(13294),w=i(57982),x=i(41705),_=i(67790);const A={carr_key:0,facturacion:null,vencimiento:"",importe:"",descripcion:"",facturaCheck:null,facturaIndividualCheck:null},C=(0,d.forwardRef)((t,e)=>{let{data:i,requiere_factura:s,regimenesF:r,regimenesM:a,getData:l,onDelete:c,errors:h}=t;var u,p,f,v,y,w,C,S,k,E,T,P,M,R;const I=(0,d.useRef)(null);(0,d.useImperativeHandle)(e,()=>({requestDireccion:()=>{var t,e,i;return null!==(i=null===(e=I.current)||void 0===e||null===(t=e.requestData)||void 0===t?void 0:t.call(e))&&void 0!==i?i:null}}));const N=(t=>{if(!(null==t?void 0:t.cp))return;const e=null==t?void 0:t.acontribuyente;var i;return{cp:String(t.cp),calle:null!==(i=null==e?void 0:e.cNombreCalle)&&void 0!==i?i:"",noExterior:null!=(null==e?void 0:e.cNumeroExt)?String(e.cNumeroExt):"",noInterior:null!=(null==e?void 0:e.cNumeroInt)?String(e.cNumeroInt):"",colonia:null!=(null==e?void 0:e.cClaveCol)?{id:e.cClaveCol,nombre:""}:void 0}})(null==i?void 0:i.facturacion),[D,L]=(0,d.useState)({...A,...i}),[F,O]=(0,d.useState)([]),[z,j]=(0,d.useState)(!1),[B,H]=(0,d.useState)(!1);var U;const $="M"==(12===String(null!==(U=null==D||null===(u=D.facturacion)||void 0===u?void 0:u.rfc)&&void 0!==U?U:"").trim().length?"M":"F")?a:r,W=null==i?void 0:i.figura,V="PO"===W,G=s&&"PO"===W&&!!D.payCheck&&!!D.facturaCheck,q=(0,d.useRef)(0),[X,Y]=(0,d.useState)(!1),K=(0,d.useRef)({});(0,d.useEffect)(()=>{var t,e,n,s;if(B)return;const r=Number(i.carr_key);if(!r)return;if(K.current[r])return;const a=null===(e=i.facturacion)||void 0===e||null===(t=e.__direccionPrefill)||void 0===t?void 0:t.data;a&&(null===(s=I.current)||void 0===s||null===(n=s.setData)||void 0===n||n.call(s,a),K.current[r]=!0)},[B,i.carr_key,i.facturacion]),(0,d.useEffect)(()=>{L(t=>{if(!s){const e={...t,facturaCheck:!1,facturaIndividualCheck:!1};return l(e),j(!1),e}if(!t.payCheck){const e={...t,facturaCheck:!1,facturaIndividualCheck:!1};return l(e),j(!1),e}if(null!==t.facturaCheck&&void 0!==t.facturaCheck)return j(!!t.facturaIndividualCheck),t;const e="PO"===W,i={...t,facturaCheck:!0,facturaIndividualCheck:e};return l(i),j(e),i})},[s,W,l]),(0,d.useEffect)(()=>{var t;if(!V)return O([]),void Y(!1);if(!(s&&D.payCheck&&D.facturaCheck&&D.facturaIndividualCheck))return O([]),void Y(!1);const e=(null===(t=D.facturacion)||void 0===t?void 0:t.regimen_fiscal_key)?Number(D.facturacion.regimen_fiscal_key):0;if(!e)return O([]),void Y(!1);O([]),(async t=>{const e=++q.current;if(!t)return O([]),void Y(!1);Y(!0);try{const i=await(0,o.F)({module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_
1USO_CFDI&valor1=".concat(t),method:"GET"});if(e!==q.current)return;O(i.result||[])}catch(t){if(e!==q.current)return;O([]),console.error("Error al consumir servicio ",t)}finally{e===q.current&&Y(!1)}})(e)},[V,s,D.payCheck,D.facturaCheck,D.facturaIndividualCheck,null===(p=D.facturacion)||void 0===p?void 0:p.regimen_fiscal_key]),(0,d.useEffect)(()=>{var t;const e=null==D||null===(t=D.facturacion)||void 0===t?void 0:t.alta_ctr;H(!!e&&"S"===e)},[null==D||null===(f=D.facturacion)||void 0===f?void 0:f.alta_ctr]),(0,d.useEffect)(()=>{L(t=>({...t,carr_key:i.carr_key,payCheck:i.payCheck,facturaCheck:i.facturaCheck,facturaIndividualCheck:i.facturaIndividualCheck}));const t=null==i?void 0:i.figura,e=!!(s&&"PO"===t&&i.payCheck&&i.facturaCheck&&i.facturaIndividualCheck);j(e)},[i,s]);const Z=t=>{L(e=>{const i=t(e);return l(i),i})};return(0,n.jsxs)("div",{className:"my-2",children:[(0,n.jsxs)("div",{className:"flex h-11 rounded-[25px] place-items-center bg-gray-100",children:[(0,n.jsx)("div",{className:"flex w-[5%] justify-center pl-4",children:(0,n.jsx)(m.S,{active:!!D.payCheck,onClick:t=>{const e="PO"===W,i=t?s?{...D,payCheck:!0,facturaCheck:!0,facturaIndividualCheck:!!e}:{...D,payCheck:!0,facturaCheck:!1,facturaIndividualCheck:!1}:{...D,payCheck:!1,facturaCheck:!1,facturaIndividualCheck:!1};L(i),j(!!i.facturaIndividualCheck),l(i)}})}),(0,n.jsx)("div",{className:"flex w-[6%] justify-center",children:(0,n.jsx)(m.S,{active:!!D.facturaCheck,readonly:!s||!D.payCheck,onClick:t=>{const e="PO"===W,i={...D,facturaCheck:t,facturaIndividualCheck:!!t&&!!e};L(i),j(t&&e),l(i)}})}),(0,n.jsx)("p",{className:"text-pt-primary w-[10%] text-[10px] font-bold text-nowrap truncate text-start",children:i.vencimiento}),(0,n.jsx)("div",{className:"text-pt-primary w-[48%] text-[10px] font-bold text-start flex py-1 pr-1 items-center",children:(0,n.jsx)("p",{className:"line-clamp-2",children:i.descripcion})}),(0,n.jsx)("p",{className:"text-pt-primary w-[11%] text-[10px] font-bold text-nowrap text-end",children:i.importe}),(0,n.jsx)("div",{className:"flex w-[10%] justify-center",children:(0,n.jsx)(m.S,{active:!!D.facturaIndividualCheck,colorCheckBox:"fill-pt-quaternary opacity-60",readonly:!0,onClick:()=>{}})}),(0,n.jsx)("button",{onClick:()=>c(D.carr_key),className:"focus:outline-none w-[4%] pl-2",type:"button",children:(0,n.jsx)(x.d7,{className:"fill-pt-primary size-4 w-full pl-4"})}),(0,n.jsx)("div",{className:"flex w-[5%] justify-center",children:(0,n.jsx)("button",{disabled:!D.facturaIndividualCheck,onClick:()=>j(!z),className:"focus:outline-none",type:"button",children:(0,n.jsx)(x.g5,{className:"size-3 ".concat(D.facturaIndividualCheck?"fill-pt-tertiary":"fill-pt-quaternary/40"," transition-colors duration-[300ms] ").concat(z?"-rotate-90":"rotate-90")})})})]}),G&&(0,n.jsx)("div",{className:"".concat(z?"h-18 mb-4 mt-2 opacity-100":"h-[0px] opacity-0","\n w-full bg-white rounded-[15px] shadow-lg transition-all duration-150"),children:(0,n.jsxs)("div",{className:"grid grid-cols-3 items-center px-2 gap-x-2 ".concat(z?"":"pointer-events-none"),children:[(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{Z(t=>{var i;return{...t,facturacion:{...null!==(i=t.facturacion)&&void 0!==i?i:{},rfc:String(e)}}})},label:"RFC",readonly:!0,type:"rfc",maxCharacters:13,minCharacters:12,value:null==D||null===(v=D.facturacion)||void 0===v?void 0:v.rfc}),13===(null==D||null===(w=D.facturacion)||void 0===w||null===(y=w.rfc)||void 0===y?void 0:y.length)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{L({...D,facturacion:{...D.facturacion,nombre_facturacion:String(e)}})},label:"Nombre(s)",type:"string",readonly:!0,maxCharacters:100,value:null==D||null===(C=D.facturacion)||void 0===C?void 0:C.nombre_facturacion,regex:/^[a-zA-Z0-9ñÃáéÃóúÃÃÃÃÃüÃ&,"'()+}`\s.-]*$/}),(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{L({...D,facturacion:{...D.facturacion,ap_pat_facturacion:String(e)}})},label:"Primer Apellido",readonly:!0,type:"string",maxCharacters:100,value:null==D||null===(S=D.facturacion)||void 0===S?void 0:S.ap_pat_facturacion,regex:/^[a-zA-Z0-9ñÃáéÃóúÃÃÃÃÃüÃ&,"'()+}`\s.-]*$/}),(0,n.jsx)(g.S,{id:0,getText:(t,e)=>
1{L({...D,facturacion:{...D.facturacion,ap_mat_facturacion:String(e)}})},label:"Segundo apellido",readonly:!0,type:"string",maxCharacters:100,value:null==D||null===(k=D.facturacion)||void 0===k?void 0:k.ap_mat_facturacion,regex:/^[a-zA-Z0-9ñÃáéÃóúÃÃÃÃÃüÃ&,"'()+}`\s.-]*$/})]}):(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{L({...D,facturacion:{...D.facturacion,nombre_facturacion:String(e)}})},readonly:!0,label:"Razón social",type:"string",maxCharacters:100,value:null==D||null===(E=D.facturacion)||void 0===E?void 0:E.nombre_facturacion}),B?(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{Z(t=>{var i;return{...t,facturacion:{...null!==(i=t.facturacion)&&void 0!==i?i:{},cp:String(e)}}})},label:"Código Postal",required:!0,type:"number",maxCharacters:5,minCharacters:5,value:null==D||null===(T=D.facturacion)||void 0===T?void 0:T.cp}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(_.A,{ref:I,initialData:N},(J=N,J?"".concat(J.cp,"|").concat(null!==(tt=null===(Q=J.colonia)||void 0===Q?void 0:Q.id)&&void 0!==tt?tt:"","|").concat(null!==(et=J.calle)&&void 0!==et?et:"","|").concat(null!==(it=J.noExterior)&&void 0!==it?it:"","|").concat(null!==(nt=J.noInterior)&&void 0!==nt?nt:""):"no-prefill"))}),(0,n.jsx)(b.l,{id:0,active:Number(null==D||null===(P=D.facturacion)||void 0===P?void 0:P.regimen_fiscal_key),data:$,getActive:(t,e)=>{const i=Number(e);Z(t=>{var e;return{...t,facturacion:{...null!==(e=t.facturacion)&&void 0!==e?e:{},regimen_fiscal_key:i,usocfdi_key:null}}}),O([])},label:"Régimen Fiscal",wrong:!!(null==h?void 0:h.regimen_fiscal_key)}),(0,n.jsx)(b.l,{id:0,active:Number(null==D||null===(M=D.facturacion)||void 0===M?void 0:M.usocfdi_key),loader:X,data:F,getActive:(t,e)=>{Z(t=>{var i;return{...t,facturacion:{...null!==(i=t.facturacion)&&void 0!==i?i:{},usocfdi_key:Number(e)}}})},label:"Uso de CFDI",wrong:!!(null==h?void 0:h.usocfdi_key)}),(0,n.jsx)(g.S,{id:0,required:!0,getText:(t,e)=>{Z(t=>{var i;return{...t,facturacion:{...null!==(i=t.facturacion)&&void 0!==i?i:{},email:e}}})},value:(null===(R=D.facturacion)||void 0===R?void 0:R.email)||"",type:"correo",label:"Correo electrónico",maxCharacters:50,minCharacters:5})]})})]},i.carr_key);var J,Q,tt,et,it,nt});C.displayName="CarritoItem";var S=i(40774);const k=t=>{let{total:e}=t;const i=e.toLocaleString("es-MX",{style:"currency",currency:"MXN"});return(0,n.jsxs)("div",{className:"w-full flex flex-col justify-center px-6 items-end rounded-[25px] bg-pt-gray-100 h-24",children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("p",{className:"text-[16px] font-bold text-pt-primary",children:"Total a pagar"}),(0,n.jsx)(S.x,{className:"fill-pt-primary size-6"})]}),(0,n.jsx)("p",{className:"text-[33px] font-bold text-pt-primary",children:i})]})};var E=i(74661),T=()=>{var t;const e=(0,p.wA)(),{deleteItem:i}=(0,E.e)(),s=(0,h.useRouter)(),r=(0,p.d4)(t=>t.carrito.previousPath),[a,x]=(0,d.useState)(!1),[A,S]=(0,d.useState)({}),[T,P]=(0,d.useState)({F:[],M:[]}),M=(0,d.useRef)(!1),[R,I]=(0,d.useState)([]),[N,D]=(0,d.useState)([]),[L,F]=(0,d.useState)(!1),[O,z]=(0,d.useState)(!1),[j,B]=(0,d.useState)(null),[H,U]=(0,d.useState)([]),[$,W]=(0,d.useState)(0),[V,G]=(0,d.useState)(!1),q=(0,d.useRef)(null),X=(0,d.useRef)(0),[Y,K]=(0,d.useState)(!1),Z=(0,d.useRef)($),J=(0,d.useRef)(null),Q=(0,d.useRef)(null),tt=(0,d.useRef)({});var et;const it=(null==j?void 0:j.rfc)?j.rfc.length<=12?"M":"F":null!==(et=window.sessionStorage.getItem("tipoPersona"))&&void 0!==et?et:"f",nt=(0,d.useMemo)(()=>H.filter(t=>!!t.payCheck),[H]),st=(0,d.useMemo)(()=>nt.reduce((t,e)=>t+parseFloat(e.importe.replace(/[$,]/g,"").trim()),0),[nt]);(0,d.useEffect)(()=>{bt()},[]),(0,d.useEffect)(()=>{L&&!R.length&&(async()=>{try{const t=(await(0,o.F)({module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_PAISES&buscar=",method:"GET"})).result.filter(t=>1!==t.id);I(t)}catch(t){I([]),console.error("Error al consumir servicio ",t)}})()},[L]),(0,d.useEffect)(()=>{Z.current=$},[$]),(0,d.useEffect)(()=>O&&(null==j?void 0:j.regimen_fiscal_key)?void at(Number(j.regimen_fiscal_key),!0):(D([]),void K(!1)),[O,null==j?void 0:j.regimen_fiscal_key]);const rt=(0,d.useCallback)(t=>{const e=null==t?void 0:t.figura;return O&&t.payCheck&&t.facturaCheck?"PO"===e?{...t,facturaCheck:!0,facturaIndividualCheck:null===(i=t.facturaIndividualCheck)||void 0===i||i}:{...t,facturaCheck:!0,facturaIndividualCheck:!1}:{...t,facturaCheck:!1,facturaIndividualCheck:!1};var i},[O]),at=async(t,e)=>{e||B(e=>e?{...e,regimen_fiscal_key:t,usocfdi_key:void 0}:e);const i=++X.current;if(!t)return D([]),void K(!1);K(!0);try{const e=await(0,o.F)({module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_
1USO_CFDI&valor1=".concat(t),method:"GET"});if(i!==X.current)return;D(e.result||[])}catch(t){if(i!==X.current)return;D([]),console.error("Error al consumir servicio ",t)}finally{i===X.current&&K(!1)}},ot=(0,d.useCallback)(async()=>{if(!M.current){M.current=!0;try{const[t,e]=await Promise.all([(0,o.F)({module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_REGIMENES_FISCALES&valor1=F",method:"GET"}),(0,o.F)({module:"/krn_tools",plantilla:"/nlov",parameter:"?cvelov=LOV_REGIMENES_FISCALES&valor1=M",method:"GET"})]);P({F:t.result||[],M:e.result||[]})}catch(t){M.current=!1,P({F:[],M:[]}),console.error("Error al consumir servicio regimenes",t)}}},[]),lt=12===(null==j||null===(t=j.rfc)||void 0===t?void 0:t.length)?"M":"F",ct=(0,d.useMemo)(()=>T[lt]||[],[T,lt]),ht=(0,d.useCallback)(async t=>{if(t)try{if(x(!0),!await i(t))return void u.default.error("No se pudo eliminar el Ãtem del carrito.");U(e=>e.filter(e=>e.carr_key!==t))}catch(t){console.error(t),u.default.error("Ocurrió un error al eliminar el Ãtem.")}finally{x(!1)}},[i]),dt=(0,d.useCallback)(t=>{const e=rt(t);U(t=>t.map(t=>t.carr_key===e.carr_key?e:t))},[rt]),ut=(t,e)=>{var i,n;const s=(null==t?void 0:t.success)?String(null!==(n=null==t||null===(i=t.data)||void 0===i?void 0:i.cp)&&void 0!==n?n:""):"";var r;const a=String(null!==(r=null==e?void 0:e.cp)&&void 0!==r?r:"");return s||a},pt=t=>{if(!t)return null;const e=t.split("*").filter(Boolean);if(e.length<3)return t.replace(/\*/g,"-");const[i,n,s]=e,r=String(s).padStart(3,"0");return"".concat(i,"-").concat(n,"-").concat(r)},ft=t=>{const e=(t=>{return t?{estado:{clave:null!==(e=t.cCveEstado)&&void 0!==e?e:null},municipio:{clave:null!==(i=t.cCveMunicipio)&&void 0!==i?i:null},localidad:{clave:null!==(n=t.cCveCiudad)&&void 0!==n?n:null},colonia:{id:null!==(s=t.cClaveCol)&&void 0!==s?s:null},calle:null!==(r=t.cNombreCalle)&&void 0!==r?r:"",noExterior:null!=t.cNumeroExt?String(t.cNumeroExt):"",noInterior:null!=t.cNumeroInt?String(t.cNumeroInt):""}:null;var e,i,n,s,r})(t);return e?{success:!0,data:e}:null},mt=(t,e)=>{var i,n,s,r;if(!(null==t?void 0:t.success))return;const a=t.data;var o,l,c,h,d,u,p,f,m,g,b,v,y,w,x,_,A,C,S;return{cTipoPersona:null!==(l=null!==(o=null==e?void 0:e.cTipoPersona)&&void 0!==o?o:null==e?void 0:e.tipo_persona)&&void 0!==l?l:"F",dFechaNacimiento:null!==(h=null!==(c=null==e?void 0:e.dFechaNacimiento)&&void 0!==c?c:null==e?void 0:e.fecha_nacimiento)&&void 0!==h?h:null,cCURP:null!==(u=null!==(d=null==e?void 0:e.cCURP)&&void 0!==d?d:null==e?void 0:e.curp)&&void 0!==u?u:null,cRazonSocial:null!==(f=null!==(p=null==e?void 0:e.cRazonSocial)&&void 0!==p?p:null==e?void 0:e.razon_social)&&void 0!==f?f:null,dFechaConstitucion:null!==(g=null!==(m=null==e?void 0:e.dFechaConstitucion)&&void 0!==m?m:null==e?void 0:e.fecha_constitucion)&&void 0!==g?g:null,cTelefono:null!==(v=null!==(b=null==e?void 0:e.cTelefono)&&void 0!==b?b:null==e?void 0:e.telefono)&&void 0!==v?v:null,cCveEstado:null!==(y=null==a||null===(i=a.estado)||void 0===i?void 0:i.clave)&&void 0!==y?y:null,cCveMunicipio:null!==(w=null==a||null===(n=a.municipio)||void 0===n?void 0:n.clave)&&void 0!==w?w:null,cCveCiudad:null!==(x=pt(null==a||null===(s=a.localidad)||void 0===s?void 0:s.clave))&&void 0!==x?x:null,cClaveCol:null!==(_=null==a||null===(r=a.colonia)||void 0===r?void 0:r.id)&&void 0!==_?_:null,cDescColonia:null,cNombreCalle:null!==(A=null==a?void 0:a.calle)&&void 0!==A?A:null,cNumeroExt:null!==(C=null==a?void 0:a.noExterior)&&void 0!==C?C:null,cNumeroInt:null!==(S=null==a?void 0:a.noInterior)&&void 0!==S?S:null}},gt=async()=>{try{x(!0),Q.current||(Q.current=new Set(nt.map(t=>t.carr_key)));const t=Z.current;if(!t)return await bt(),void(Q.current=null);if(!(await(0,o.F)({module:"/prt_carritov",plantilla:"/restore_items",method:"PUT",body:{lote_id:t}})).result)throw new Error("Error al restaurar los elementos.");S({}),await bt(),Q.current=null}catch(t){console.error("Error al restaurar los elementos del carrito:",t),await bt(),Q.current=null}finally{x(!1)}},bt=async()=>{x(!0);try{const t=await(0,o.F)({module:"/prt_carritov",plantilla:"/get_items",method:"GET"});if(!t.result.length)return U([]),void e((0,l.setItems)(0));const{elementos:i,...n}=null==t?void 0:t.result[0],s=new URLSearchParams(window.location.search).get("id"),r="N"!==n.req_factura,a=i.map(t=>{var e;const i=Q.current,n=i?i.has(Number(t.carr_key)):!s||t.carr_key==Number(s),a=null==t?void 0:t.figura,o=ft(null==t||null===(e=t.facturacion)||void 0===e?void 0:e.acontribuyente);if(!n)return{...t,payCheck:n,facturaCheck:!1,facturaIndividualCheck:!1,facturacion:t.facturacion?{...t.facturacion,__direccionPrefill:o}:t.facturacion};if(!r)return{...t,payCheck:n,facturaCheck:!1,facturaIndividualCheck:!1,facturacion:t.facturacion?{...t.facturacion,__direccionPrefill:o}:t.facturacion};const l="PO"===a;return{...t,payCheck:n,facturaCheck:!0,facturaIndividualCheck:l,facturacion:t.facturacion?{...t.facturacion,__direccionPrefill:o}:t.facturacion}});a.filter(t=>t.payCheck),await ot(),U(a);const c="S"===n.alta_ctr,h=c?void 0:wt(n);G(c),yt(h),B({...n,__direccionPrefill:ft(null==n?void 0:n.acontribuyente)}),z(r),F("S"===n.extranjero)}catch(t){u.default.error("Error al cargar el carrito. Por favor, inténtalo de nuevo más tarde."),console.error(t)}finally{x(!1)}},[vt,yt]=(0,d.useState)(void 0),wt=t=>{const e=null==t?void 0:t.acontribuyente;var i,n,s,r,a;if((null==t?void 0:t.cp)&&e)return{cp:String(t.cp),estado:{clave:null!==(i=e.cCveEstado)&&void 0!==i?i:null},municipio:{clave:null!==(n=e.cCveMunicipio)&&void 0!==n?n:null},localidad:{clave:null!==(s=e.cCveCiudad)&&void 0!==s?s:null},colonia:{id:null!==(r=e.cClaveCol)&&void 0!==r?r:null},calle:null!==(a=e.cNombreCalle)&&void 0!==a?a:"",noExterior:null!=e.cNumeroExt?String(e.cNumeroExt):"",noInterior:null!=e.cNumeroInt?String(e.cNumeroInt):""}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.y,{texto:"CARRITO",subTitle:"DE COBRO",classNameTitle:"text-start"}),a&&(0,n.jsx)(y.a,{show:!0}
1),(0,n.jsxs)("div",{className:"grid grid-cols-[67%_33%] 2xl:grid-cols-[75%_25%] gap-y-2 gap-x-4",children:[(null==j?void 0:j.rfc)?(0,n.jsx)("p",{className:"text-[20px] font-bold text-pt-primary self-end",children:"Datos generales"}):(0,n.jsx)("div",{}),(0,n.jsx)(k,{total:st}),(null==j?void 0:j.rfc)&&("F"===it?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"grid grid-cols-4 gap-x-4 px-6 pt-2 pb-2 gap-y-4 col-span-2",children:[(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,rfc:String(e)})},label:"RFC",required:O,readonly:!0,type:"rfc",maxCharacters:13,minCharacters:12,value:null==j?void 0:j.rfc,wrong:!!A.rfc}),(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,nombre_facturacion:String(e)})},label:"Nombre(s)",required:O,readonly:!0,type:"string",maxCharacters:100,value:null==j?void 0:j.nombre_facturacion,wrong:!!A.nombre_facturacion}),(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,ap_pat_facturacion:String(e)})},label:"Primer Apellido",required:O,readonly:!0,type:"string",maxCharacters:100,value:null==j?void 0:j.ap_pat_facturacion,wrong:!!A.ap_pat_facturacion}),(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,ap_mat_facturacion:String(e)})},label:"Segundo apellido",readonly:!0,type:"string",maxCharacters:100,value:null==j?void 0:j.ap_mat_facturacion,wrong:!!A.ap_mat_facturacion})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"grid grid-cols-4 gap-x-4 px-6 pt-2 pb-2 gap-y-4 col-span-2",children:[(0,n.jsx)("div",{className:"col-span-1",children:(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,rfc:String(e)})},label:"RFC",required:O,readonly:!0,type:"rfc",maxCharacters:13,minCharacters:12,value:null==j?void 0:j.rfc,wrong:!!A.rfc})}),(0,n.jsx)("div",{className:"col-span-3",children:(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,nombre_facturacion:String(e)})},label:"Razón social",required:O,readonly:!0,type:"razon",maxCharacters:100,value:null==j?void 0:j.nombre_facturacion,wrong:!!A.nombre_facturacion})})]})})),(0,n.jsxs)("div",{className:"col-span-2",children:[(null==j?void 0:j.rfc)&&(0,n.jsxs)("div",{className:"grid grid-cols-4 gap-x-2 px-6 pt-2 pb-2 gap-y-2",children:[(0,n.jsx)("div",{className:"col-span-4",children:(0,n.jsx)(m.S,{text:"Requiere Factura",active:O,textClassName:"text-[11px] text-pt-primary font-semibold",colorCheckBox:"fill-pt-primary",onClick:t=>{z(t),U(e=>e.map(e=>{const i="PO"===(null==e?void 0:e.figura);return e.payCheck&&t?{...e,facturaCheck:!0,facturaIndividualCheck:!!i}:{...e,facturaCheck:!1,facturaIndividualCheck:!1}})),B({...j,req_factura:t?"S":"N"})}})}),O&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"col-span-4 text-[12px] text-pt-primary font-bold",children:"Datos Generales de Facturación"}),V?(0,n.jsx)(g.S,{id:0,getText:(t,e)=>{B({...j,cp:String(e)})},label:"Código Postal",required:!0,type:"number",maxCharacters:5,minCharacters:5,value:null==j?void 0:j.cp,wrong:!!A.cp}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.A,{ref:q,initialData:vt},(xt=vt,xt?"".concat(xt.cp,"|").concat(null!==(At=null===(_t=xt.colonia)||void 0===_t?void 0:_t.id)&&void 0!==At?At:"","|").concat(null!==(Ct=xt.calle)&&void 0!==Ct?Ct:"","|").concat(null!==(St=xt.noExterior)&&void 0!==St?St:"","|").concat(null!==(kt=xt.noInterior)&&void 0!==kt?kt:""):"no-prefill")),(0,n.jsx)("div",{})]}),(0,n.jsxs)("div",{className:"".concat(V?"col-span-3":"col-span-4"," grid grid-cols-3 gap-x-2 gap-y-2"),children:[(0,n.jsx)(b.l,{id:0,data:ct,active:Number(null==j?void 0:j.regimen_fiscal_key),getActive:(t,e)=>{D([]),at(Number(e))},label:"Régimen Fiscal",required:!0,wrong:!!A.regimen_fiscal_key}),(0,n.jsx)(b.l,{id:0,data:N,active:Number(null==j?void 0:j.usocfdi_key),loader:Y,getActive:(t,e)=>B({...j,usocfdi_key:e}),label:"Uso de CFDI",wrong:!!A.usocfdi_key,required:!0}),(0,n.jsx)(g.S,{id:0,required:!0,getText:(t,e)=>{B({...j,email:e})},value:(null==j?void 0:j.email)||"",type:"correo",label:"Correo electrónico",maxCharacters:50,minCharacters:5,wrong:!!A.email})]}),(0,n.jsx)("div",{className:"col-span-4",children:(0,n.jsx)(m.S,{text:"Es extranjero",active:"S"===(null==j?void 0:j.extranjero),textClassName:"text-[11px] text-pt-primary font-semibold",colorCheckBox:"fill-pt-primary",onClick:t=>{F(t),B({...j,extranjero:t?"S":"N"})}})}),L&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.l,{id:0,data:R,active:Number(null==j?void 0:j.pais_origen),getActive:(t,e)=>{B({...j,pais_origen:e})},label:"PaÃs de origen",wrong:!!A.pais_origen}),(0,n.jsx)(g.S,{id:0,value:(null==j?void 0:j.num_registro)||"",getText:(t,e)=>{B({...j,num_registro:e})},type:"alphanumeric",label:"ID Extranjero",minCharacters:13,maxCharacters:13,wrong:!!A.num_registro})]})]})]}),(0,n.jsx)("div",{children:H.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-end text-[10px] font-bold text-pt-primary",children:[(0,n.jsx)("p",{className:"text-nowrap truncate w-[5%] text-center pl-4",children:"Pagar"}
1),(0,n.jsx)("p",{className:"text-nowrap truncate w-[6%] text-center",children:"Factura "}),(0,n.jsx)("p",{className:"text-nowrap truncate w-[10%] text-start",children:"Fecha vencimiento"}),(0,n.jsx)("p",{className:"text-nowrap truncate w-[48%] text-start",children:"Descripción"}),(0,n.jsx)("p",{className:"text-nowrap truncate w-[11%] text-end",children:"Importe a pagar"}),(0,n.jsxs)("p",{className:"text-wrap w-[10%] text-center",children:["Actualizar Datos ",(0,n.jsx)("br",{})," Factura Individual"]}),(0,n.jsx)("p",{className:"text-nowrap truncate w-[5%] text-center pl-2",children:"Eliminar"})]}),H.length>0&&H.map(t=>{var e;const i=null===(e=A.elementos)||void 0===e?void 0:e.find(e=>e.carr_key==t.carr_key);return(0,n.jsx)(C,{ref:e=>{tt.current[t.carr_key]=e},data:t,requiere_factura:O,regimenesF:T.F,regimenesM:T.M,getData:dt,onDelete:ht,errors:i},t.carr_key)})]}):!a&&(0,n.jsx)("div",{className:"flex min-h-[200px] justify-center items-center",children:(0,n.jsx)("p",{className:"font-anek font-semibold text-pt-gray-300",children:"Aún no hay nada en el carrito"})})})]}),(0,n.jsx)("div",{}),(0,n.jsxs)("div",{className:"col-start-2 flex items-center justify-around gap-x-4 p-4",children:[(0,n.jsx)(f.d,{onClick:()=>{r?s.push(r):s.push("/oficina-virtual/mi-perfil"),e((0,l.setPreviousPath)(""))},className:"w-full",title:"Regresar",type:"secondary"}),(0,n.jsx)(f.d,{onClick:()=>s.push("/oficina-virtual/mi-perfil"),className:"w-full",title:"Cancelar",type:"primary"}),(0,n.jsx)(f.d,{onClick:async()=>{var t;const e=V?null:(()=>{var t;const e=null===(t=q.current)||void 0===t?void 0:t.requestData();if(e&&e.success)return e})();if(!V&&e&&!e.success)return void u.default.error("Verifica tu dirección (incluye Código Postal).");const i=nt.map(rt),n={};i.forEach(t=>{if(t.facturaIndividualCheck){var e,i;const s=null===(i=tt.current[t.carr_key])||void 0===i||null===(e=i.requestDireccion)||void 0===e?void 0:e.call(i);(null==s?void 0:s.success)&&(n[t.carr_key]=s)}});const s=ut(e,j),r=j?{...j,cp:s}:j,{errors:a,message:l,isValid:h}=(0,c.f)(r,i);if(!h)return u.default.error(l||""),void S(a);x(!0),Q.current=new Set(i.map(t=>t.carr_key));const d=await(async(t,e,i,n)=>{try{const a=O&&L,l=ut(t,i),c={email:O?null==i?void 0:i.email:void 0,cp:O?l:void 0,requiere_factura:O?"S":"N",regimen_fiscal_key:O?Number(null==i?void 0:i.regimen_fiscal_key):void 0,usocfdi_key:O?Number(null==i?void 0:i.usocfdi_key):void 0,extranjero:a?"S":"N",num_registro:a?null==i?void 0:i.num_registro:void 0,pais_origen:a?Number(null==i?void 0:i.pais_origen):void 0,carr_items:n.map(t=>{var i;const n=O&&t.facturaCheck?"S":"N",s={carr_key:t.carr_key,factura:n};if("S"!==n)return s;if(!t.facturaIndividualCheck)return{...s};const r=t.facturacion||{},a=e[t.carr_key],o=String(((null==a?void 0:a.success)?null==a||null===(i=a.data)||void 0===i?void 0:i.cp:"")||r.cp||""),l={...s,rfc:r.rfc,nombre_facturacion:r.nombre_facturacion,ap_pat_facturacion:r.ap_pat_facturacion,ap_mat_facturacion:r.ap_mat_facturacion,cp:o,email:r.email,regimen_fiscal_key:Number(r.regimen_fiscal_key),usocfdi_key:Number(r.usocfdi_key)};return(null==a?void 0:a.success)?(l.acontribuyente=mt(a,r),l):r.acontribuyente?(l.acontribuyente=r.acontribuyente,l):l})};var s,r;c.acontribuyente=V?null!==(s=null==i?void 0:i.acontribuyente)&&void 0!==s?s:void 0:(null==t?void 0:t.success)?mt(t,i):null!==(r=null==i?void 0:i.acontribuyente)&&void 0!==r?r:void 0;const h=await(0,o.F)({module:"/prt_carritov",plantilla:"/pay_items",method:"POST",body:c});if(!h.result)throw new Error("Error al enviar los datos.");return{url:h.result.url,lote_id:h.result.lote_id}}catch(t){console.error("Error al enviar los datos:",t),u.default.error("Error al enviar los datos. Por favor, inténtalo de nuevo más tarde.")}})(e,n,r,i);if(!d)return void x(!1);Z.current=d.lote_id,W(d.lote_id);const p=await(null===(t=J.current)||void 0===t?void 0:t.payment(d.url));x(!1),p||u.default.error("Ocurrio un error.")},disabled:st<=0,className:"w-full",title:"Pagar",type:"tertiary"})]}),(0,n.jsx)(w.p,{ref:J,onCancel:()=>gt(),onPaymentFailed:()=>gt(),showButton:!1,onPaymentComplete:()=>{Q.current=null;const t=s.asPath.split("?")[0];s.replace(t),bt()},setIsLoading:x})]})]});var xt,_t,At,Ct,St,kt};function P(){const[t,e]=(0,d.useState)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.V,{}),(0,n.jsx)("div",{className:"mx-10 mb-10 ",children:(0,n.jsxs)("div",{className:"flex min-h-[calc(100dvh-250px)]",children:[(0,n.jsx)(a.z,{active:t,setActive:e}),(0,n.jsx)("div",{className:"w-full h-fit",children:(0,n.jsx)(T,{})})]})}),(0,n.jsx)(s.w,{})]})}}
1,74661:function(t,e,i){"use strict";i.d(e,{e:function(){return l}});var n=i(71468),s=i(53485),r=i(36428),a=i(760),o=i(13732);function l(){const t=(0,n.wA)(),e=(0,n.d4)(t=>t.carrito.items),i=(0,n.d4)(t=>t.carrito.itemsId),[l,c]=(0,o.useState)(!1);return{items:e,itemsId:i,isProcessing:l,addItem:async i=>{if(i){c(!0);try{const n=await(0,r.F)({module:"/prt_carritov",plantilla:"/add_item",method:"POST",body:i});return!n.result||n.error?-20101==(null==n?void 0:n.code)?void a.default.error("El concepto ya se encuentra en su carrito de cobro. Para modificarlo, acceda al carrito."):void a.default.error("No se pudo agregar al carrito"):(a.default.success("Agregado al carrito correctamente"),t((0,s.jb)((e||0)+(n.result[0].carr_cnt||0))),{...n.result[0]})}catch(t){a.default.error("No se pudo agregar al carrito"),console.error("Error al cargar el carrito:",t)}finally{c(!1)}}},deleteItem:async i=>{if(!i)return!1;c(!0);try{const n=await(0,r.F)({module:"/prt_carritov",plantilla:"/rem_item",method:"DELETE",body:{carr_key:i}});return!n.result||n.error?(a.default.error("No se pudo eliminar del carrito"),!1):(t((0,s.jb)((e||0)-(n.result[0].carr_cnt||0))),!0)}catch(t){return a.default.error("No se pudo eliminar del carrito"),console.error("Error al eliminar del carrito:",t),!1}finally{c(!1)}}}}},32639:function(t,e,i){"use strict";i.d(e,{F_:function(){return s},Pr:function(){return r},cf:function(){return n}});const n=t=>({correo:/^[A-Za-z0-9]+([._-][A-Za-z0-9]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,63}$/,curp:/^[A-Z][AEIOUX][A-Z]{2}\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])[HMX](AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|NE)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d]\d$/,password:/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[a-zA-Z0-9]{8,}$/,rfc:/^([A-ZÃ&]{3,4})-?(\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01]))-?([A-Z\d]{3})$/,rfcFisica:/^([A-ZÃ&]{3,4})(\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01]))([A-Z\d]{2,3})([A\d])$/,rfcMoral:/^([A-Z&Ã]{3})(\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01]))([A-Z\d]{3})$/,razonSocial:RegExp("^(?!\\s*$)[0-9A-Za-zÃÃÃÃÃÃÃáéÃóúüñ _&,\\.\"'\\$%\\/\\-\\(\\)\\{\\}\\`\\:\\+]+(?<!\\s)$"),number:/^[0-9]+$/,string:/^[a-zA-ZáéÃóúüñÃÃÃÃÃÃÃ0-9.\s]+$/,alphanumeric:/[^a-zA-Z0-9áéÃóúüñÃÃÃÃÃÃÃ\s]*$/,alphanumericSpecial:/^[a-zA-Z0-9ñÃáéÃóúÃÃÃÃÃüÃ&,\s.-]*$/,alphanumericEsp:/[^a-zA-Z0-9áéÃóúüñÃÃÃÃÃÃÃ\s.-]*$/,patronal:/^[A-Z]{1}[0-9]{2}(AS|BC|BS|CC|CS|CH|DF|CL|CM|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|NE)[0-9]{5}[0-9A-Z]{1}$/,folio:/^[a-zA-Z0-9áéÃóúüñÃÃÃÃÃÃÃ&´]{1,11}$/,text:/^(?!\s*$)[a-zA-ZáéÃóúüÃÃÃÃÃÃñÃ\s.]+$/}[t]);function s(t){let e=t.source,i="";e.includes("\\s")&&(i+="\\s",e=e.replace(/\\s/g,"")),(e.includes("a-z")||e.includes("A-Z"))&&(i+="a-zA-Z",e=e.replace(/a-z|A-Z/g,"")),(e.includes("0-9")||e.includes("\\d"))&&(i+="0-9",e=e.replace(/0-9|\\d/g,"")),e.split("").forEach(t=>{if(/[a-zA-Z0-9._%-@&#()"'}+`,;:áéÃóúüñÃÃÃÃÃÃÃ+\s]/.test(t))try{["[","]","^","$",".","|","?","*","+","(",")","{","}","-"].includes(t)?e.includes(t)&&new RegExp("\\[.*\\".concat(t,".*\\]")).test(e)&&(i+="\\"+t):e.includes(t)&&new RegExp("\\[.*".concat(t,".*\\]")).test(e)&&(i+=t)}catch(t){return}}),e.includes("-")&&/[a-z]-[a-z]|[A-Z]-[A-Z]|[0-9]-[0-9]/.test(e)&&(i=i.replace(/-/g,""));try{return new RegExp("^[".concat(i,"]*$"))}catch(t){return/[a-zA-Z0-9._%+-@&#(),;:áéÃóúüñÃÃÃÃÃÃÃ\s]/}}const r=(t,e)=>{const i=e.toString().match(/\[([^\]]+)\]/);if(!i)throw new Error("El regex debe contener un character class [ ... ]");let n=i[1];"^"===n[0]&&(n="\\^"+n.slice(1)),n=n.replace(/([\\\]])/g,"\\$1");const s=new RegExp("[^".concat(n,"]"),"g");return t.replace(s,"")}},12646:function(t,e,i){"use strict";i.d(e,{f:function(){return s}});var n=i(32639);const s=(t,e)=>{if(!t||!e.length)throw new Error("User data is required for validation.");const i={};"N"!==t.req_factura&&(t.email&&(0,n.cf)("correo").test(t.email)||(i.email="El correo electrónico no es válido."),(!t.cp||t.cp.length<5||Number(t.cp)<=0)&&(i.cp="El código postal debe tener 5 dÃgitos."),t.regimen_fiscal_key||(i.regimen_fiscal_key="El régimen fiscal es obligatorio."),t.usocfdi_key||(i.usocfdi_key="El uso de CFDI es obligatorio."),"S"===t.extranjero&&t.req_factura&&((!t.num_registro||t.num_registro.length<13)&&(i.num_registro="El número de registro es obligatorio."),t.pais_origen||(i.pais_origen="El paÃs de origen es obligatorio."))),i.elementos=e.map(t=>{const e={carr_key:t.carr_key};var i,n;return t.facturaIndividualCheck&&(null==(null===(i=t.facturacion)||void 0===i?void 0:i.regimen_fiscal_key)&&(e.regimen_fiscal_key="Regimen fiscal requerido"),null==(null===(n=t.facturacion)||void 0===n?void 0:n.usocfdi_key)&&(e.usocfdi_key="Uso CFDI requerido")),e}).filter(t=>Object.keys(t).length>1);const{elementos:s,...r}=i,a=Object.values(r)[0]||(s.length>0?"Verifica los campos.":"");return{errors:i,isValid:!a.length,message:a}}},19181:function(t){t.exports={inputText:"InputText_inputText__U_GdH",inputText__label:"InputText_inputText__label__LMRjB",inputText__count:"InputText_inputText__count__LXmAi",inputText__input:"InputText_inputText__input__xx2d7"}},69544:function(t){t.exports={select:"Select_select__Ege0F",select__label:"Select_select__label___RKb7",select__options:"Select_select__options__ilVft",select__options__obligaciones:"Select_select__options__obligaciones__MBjqV",select__arrow:"Select_select__arrow__jVLfb",select__text:"Select_select__text__TrzjL",select__scroll:"Select_select__scroll__3adYH"}},56015:function(t){t.exports={container:"Titles_container__NfgJj",title1:"Titles_title1__9NJnB",title2:"Titles_title2__ahMIm",title3:"Titles_title3__2jqxj"}},51053:function(t){t.exports={select_scrollbar:"beta_select_scrollbar__GAgjm",body:"beta_body__y3rzi",gdcp__prearchview__doc:"beta_gdcp__prearchview__doc__pByit"}},99192:function(t){t.exports={footerContainer:"Footer_footerContainer__6Yt8p",footerSocialMedia:"Footer_footerSocialMedia__h8Ya9",logoQro:"Footer_logoQro__1Z7qd",footerLinks:"Footer_footerLinks__RiUnk"}},65499:function(t){t.exports={"no-scrollbar":"Sidebar_no-scrollbar__IBX8n",bounceToRight:"Sidebar_bounceToRight__ozB63",moveToLeft:"Sidebar_moveToLeft__dNece",toLeft:"Sidebar_toLeft__tQ_0Y",sidebar:"Sidebar_sidebar__VS2pC",sidebar__option:"Sidebar_sidebar__option___lw_g",sidebar__option__text:"Sidebar_sidebar__option__text__lLQuW",group:"Sidebar_group___LyYD",avatar:"Sidebar_avatar__izwl_",sidebar__option__img:"Sidebar_sidebar__option__img__bE72Y"}},61889:function(){},9771:function(t){"use strict";
1t.exports=function(){}}},function(t){"function"==typeof t.x?t.x():console.warn("[Module Federation] __webpack_require__.x is not a function, skipping startup extension");var e=Promise.all([t.f.consumes||function(t,e){},t.f.remotes||function(t,e){}].reduce(function(t,e){return e("1108",t),t},[])).then(function(){return t.X(0,[636,8792],function(){return t(t.s=85039)})});_N_E=e}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.