@eddie-doc/cli 0.0.0-stage → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +914 -2
- package/dist/cli.js +347 -0
- package/dist/pdf.worker.mjs +62201 -0
- package/package.json +44 -4
package/dist/cli.js
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
(() => {
|
|
4
|
+
// pdfjs's "Warning: Cannot polyfill DOMMatrix…" lines are noise for text
|
|
5
|
+
// extraction; they are shown only with EDDIE_DEBUG set.
|
|
6
|
+
const debug = !!process.env.EDDIE_DEBUG;
|
|
7
|
+
const toStderr = (...a) => {
|
|
8
|
+
const line = a.join(" ");
|
|
9
|
+
if (!debug && /^Warning: Cannot /.test(line)) return;
|
|
10
|
+
try { process.stderr.write(line + "\n"); } catch {}
|
|
11
|
+
};
|
|
12
|
+
console.log = toStderr;
|
|
13
|
+
console.info = toStderr;
|
|
14
|
+
console.warn = toStderr;
|
|
15
|
+
console.debug = toStderr;
|
|
16
|
+
})();
|
|
17
|
+
|
|
18
|
+
"use strict";var XP=Object.create;var tu=Object.defineProperty;var YP=Object.getOwnPropertyDescriptor;var ZP=Object.getOwnPropertyNames;var JP=Object.getPrototypeOf,QP=Object.prototype.hasOwnProperty;var $P=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),eF=(r,e)=>{for(var t in e)tu(r,t,{get:e[t],enumerable:!0})},oy=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ZP(e))!QP.call(r,i)&&i!==t&&tu(r,i,{get:()=>e[i],enumerable:!(n=YP(e,i))||n.enumerable});return r};var jr=(r,e,t)=>(t=r!=null?XP(JP(r)):{},oy(e||!r||!r.__esModule?tu(t,"default",{value:r,enumerable:!0}):t,r)),U=r=>oy(tu({},"__esModule",{value:!0}),r);var L={};eF(L,{__assign:()=>Up,__asyncDelegator:()=>zE,__asyncGenerator:()=>qE,__asyncValues:()=>VE,__await:()=>Vo,__awaiter:()=>ME,__classPrivateFieldGet:()=>KE,__classPrivateFieldSet:()=>XE,__createBinding:()=>LE,__decorate:()=>_E,__exportStar:()=>jE,__extends:()=>kE,__generator:()=>NE,__importDefault:()=>WE,__importStar:()=>GE,__makeTemplateObject:()=>HE,__metadata:()=>OE,__param:()=>IE,__read:()=>pw,__rest:()=>RE,__spread:()=>BE,__spreadArrays:()=>UE,__values:()=>qp});function kE(r,e){Bp(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function RE(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function _E(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function IE(r,e){return function(t,n){e(t,n,r)}}function OE(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function ME(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(d){try{u(n.next(d))}catch(c){a(c)}}function l(d){try{u(n.throw(d))}catch(c){a(c)}}function u(d){d.done?s(d.value):i(d.value).then(o,l)}u((n=n.apply(r,e||[])).next())})}function NE(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function LE(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function jE(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function qp(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function pw(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(a)throw a.error}}return s}function BE(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(pw(arguments[e]));return r}function UE(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function Vo(r){return this instanceof Vo?(this.v=r,this):new Vo(r)}function qE(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(h){n[h]&&(i[h]=function(f){return new Promise(function(p,g){s.push([h,f,p,g])>1||o(h,f)})})}function o(h,f){try{l(n[h](f))}catch(p){c(s[0][3],p)}}function l(h){h.value instanceof Vo?Promise.resolve(h.value.v).then(u,d):c(s[0][2],h)}function u(h){o("next",h)}function d(h){o("throw",h)}function c(h,f){h(f),s.shift(),s.length&&o(s[0][0],s[0][1])}}function zE(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=r[i]?function(a){return(t=!t)?{value:Vo(r[i](a)),done:i==="return"}:s?s(a):a}:s}}function VE(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof qp=="function"?qp(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(a){return new Promise(function(o,l){a=r[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(u){s({value:u,done:o})},a)}}function HE(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function GE(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function WE(r){return r&&r.__esModule?r:{default:r}}function KE(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function XE(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var Bp,Up,j=$P(()=>{Bp=function(r,e){return Bp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Bp(r,e)};Up=function(){return Up=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Up.apply(this,arguments)}});var zp=E(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.decodeFromBase64DataUri=xn.decodeFromBase64=xn.encodeToBase64=void 0;var ha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=new Uint8Array(256);for(Ho=0;Ho<ha.length;Ho++)Go[ha.charCodeAt(Ho)]=Ho;var Ho;xn.encodeToBase64=function(r){for(var e="",t=r.length,n=0;n<t;n+=3)e+=ha[r[n]>>2],e+=ha[(r[n]&3)<<4|r[n+1]>>4],e+=ha[(r[n+1]&15)<<2|r[n+2]>>6],e+=ha[r[n+2]&63];return t%3===2?e=e.substring(0,e.length-1)+"=":t%3===1&&(e=e.substring(0,e.length-2)+"=="),e};xn.decodeFromBase64=function(r){var e=r.length*.75,t=r.length,n,i=0,s,a,o,l;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var u=new Uint8Array(e);for(n=0;n<t;n+=4)s=Go[r.charCodeAt(n)],a=Go[r.charCodeAt(n+1)],o=Go[r.charCodeAt(n+2)],l=Go[r.charCodeAt(n+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|o>>2,u[i++]=(o&3)<<6|l&63;return u};var YE=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i;xn.decodeFromBase64DataUri=function(r){var e=r.trim(),t=e.substring(0,100),n=t.match(YE);if(!n)return xn.decodeFromBase64(e);var i=n[0],s=e.substring(i.length);return xn.decodeFromBase64(s)}});var Wo=E(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.findLastMatch=ie.parseDate=ie.breakTextIntoLines=ie.charSplit=ie.charAtIndex=ie.mergeLines=ie.lineSplit=ie.isNewlineChar=ie.newlineChars=ie.escapedNewlineChars=ie.cleanText=ie.escapeRegExp=ie.addRandomSuffix=ie.copyStringIntoBuffer=ie.padStart=ie.charFromHexCode=ie.charFromCode=ie.toHexString=ie.toHexStringOfMinLength=ie.toCodePoint=ie.toCharCode=void 0;ie.toCharCode=function(r){return r.charCodeAt(0)};ie.toCodePoint=function(r){return r.codePointAt(0)};ie.toHexStringOfMinLength=function(r,e){return ie.padStart(r.toString(16),e,"0").toUpperCase()};ie.toHexString=function(r){return ie.toHexStringOfMinLength(r,2)};ie.charFromCode=function(r){return String.fromCharCode(r)};ie.charFromHexCode=function(r){return ie.charFromCode(parseInt(r,16))};ie.padStart=function(r,e,t){for(var n="",i=0,s=e-r.length;i<s;i++)n+=t;return n+r};ie.copyStringIntoBuffer=function(r,e,t){for(var n=r.length,i=0;i<n;i++)e[t++]=r.charCodeAt(i);return n};ie.addRandomSuffix=function(r,e){return e===void 0&&(e=4),r+"-"+Math.floor(Math.random()*Math.pow(10,e))};ie.escapeRegExp=function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};ie.cleanText=function(r){return r.replace(/\t|\u0085|\u2028|\u2029/g," ").replace(/[\b\v]/g,"")};ie.escapedNewlineChars=["\\n","\\f","\\r","\\u000B"];ie.newlineChars=[`
|
|
19
|
+
`,"\f","\r","\v"];ie.isNewlineChar=function(r){return/^[\n\f\r\u000B]$/.test(r)};ie.lineSplit=function(r){return r.split(/[\n\f\r\u000B]/)};ie.mergeLines=function(r){return r.replace(/[\n\f\r\u000B]/g," ")};ie.charAtIndex=function(r,e){var t=r.charCodeAt(e),n,i=e+1,s=1;return t>=55296&&t<=56319&&r.length>i&&(n=r.charCodeAt(i),n>=56320&&n<=57343&&(s=2)),[r.slice(e,e+s),s]};ie.charSplit=function(r){for(var e=[],t=0,n=r.length;t<n;){var i=ie.charAtIndex(r,t),s=i[0],a=i[1];e.push(s),t+=a}return e};var ZE=function(r){for(var e=ie.escapedNewlineChars.join("|"),t=["$"],n=0,i=r.length;n<i;n++){var s=r[n];if(ie.isNewlineChar(s))throw new TypeError("`wordBreak` must not include "+e);t.push(s===""?".":ie.escapeRegExp(s))}var a=t.join("|");return new RegExp("("+e+")|((.*?)("+a+"))","gm")};ie.breakTextIntoLines=function(r,e,t,n){for(var i=ZE(e),s=ie.cleanText(r).match(i),a="",o=0,l=[],u=function(){a!==""&&l.push(a),a="",o=0},d=0,c=s.length;d<c;d++){var h=s[d];if(ie.isNewlineChar(h))u();else{var f=n(h);o+f>t&&u(),a+=h,o+=f}}return u(),l};var JE=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/;ie.parseDate=function(r){var e=r.match(JE);if(e){var t=e[1],n=e[2],i=n===void 0?"01":n,s=e[3],a=s===void 0?"01":s,o=e[4],l=o===void 0?"00":o,u=e[5],d=u===void 0?"00":u,c=e[6],h=c===void 0?"00":c,f=e[7],p=f===void 0?"Z":f,g=e[8],v=g===void 0?"00":g,m=e[9],y=m===void 0?"00":m,w=p==="Z"?"Z":""+p+v+":"+y,x=new Date(t+"-"+i+"-"+a+"T"+l+":"+d+":"+h+w);return x}};ie.findLastMatch=function(r,e){for(var t,n=0,i;n<r.length;){var s=r.substring(n).match(e);if(!s)return{match:i,pos:n};i=s,n+=((t=s.index)!==null&&t!==void 0?t:0)+s[0].length}return{match:i,pos:n}}});var gw=E(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.toUint8Array=Le.canBeConvertedToUint8Array=Le.pluckIndices=Le.range=Le.sum=Le.reverseArray=Le.sortedUniq=Le.byAscendingId=Le.arrayAsString=Le.mergeUint8Arrays=Le.mergeIntoTypedArray=Le.typedArrayFor=Le.last=void 0;var QE=zp(),$E=Wo();Le.last=function(r){return r[r.length-1]};Le.typedArrayFor=function(r){if(r instanceof Uint8Array)return r;for(var e=r.length,t=new Uint8Array(e),n=0;n<e;n++)t[n]=r.charCodeAt(n);return t};Le.mergeIntoTypedArray=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=r.length,n=[],i=0;i<t;i++){var s=r[i];n[i]=s instanceof Uint8Array?s:Le.typedArrayFor(s)}for(var a=0,i=0;i<t;i++)a+=r[i].length;for(var o=new Uint8Array(a),l=0,u=0;u<t;u++)for(var d=n[u],c=0,h=d.length;c<h;c++)o[l++]=d[c];return o};Le.mergeUint8Arrays=function(r){for(var e=0,t=0,n=r.length;t<n;t++)e+=r[t].length;for(var i=new Uint8Array(e),s=0,t=0,n=r.length;t<n;t++){var a=r[t];i.set(a,s),s+=a.length}return i};Le.arrayAsString=function(r){for(var e="",t=0,n=r.length;t<n;t++)e+=$E.charFromCode(r[t]);return e};Le.byAscendingId=function(r,e){return r.id-e.id};Le.sortedUniq=function(r,e){for(var t=[],n=0,i=r.length;n<i;n++){var s=r[n],a=r[n-1];(n===0||e(s)!==e(a))&&t.push(s)}return t};Le.reverseArray=function(r){for(var e=r.length,t=0,n=Math.floor(e/2);t<n;t++){var i=t,s=e-t-1,a=r[t];r[i]=r[s],r[s]=a}return r};Le.sum=function(r){for(var e=0,t=0,n=r.length;t<n;t++)e+=r[t];return e};Le.range=function(r,e){for(var t=new Array(e-r),n=0,i=t.length;n<i;n++)t[n]=r+n;return t};Le.pluckIndices=function(r,e){for(var t=new Array(e.length),n=0,i=e.length;n<i;n++)t[n]=r[e[n]];return t};Le.canBeConvertedToUint8Array=function(r){return r instanceof Uint8Array||r instanceof ArrayBuffer||typeof r=="string"};Le.toUint8Array=function(r){if(typeof r=="string")return QE.decodeFromBase64DataUri(r);if(r instanceof ArrayBuffer)return new Uint8Array(r);if(r instanceof Uint8Array)return r;throw new TypeError("`input` must be one of `string | ArrayBuffer | Uint8Array`")}});var mw=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.waitForTick=void 0;Ud.waitForTick=function(){return new Promise(function(r){setTimeout(function(){return r()},0)})}});var Vp=E(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.hasUtf16BOM=wt.utf16Decode=wt.lowSurrogate=wt.highSurrogate=wt.hasSurrogates=wt.isWithinBMP=wt.utf16Encode=wt.utf8Encode=void 0;var bw=Wo();wt.utf8Encode=function(r,e){e===void 0&&(e=!0);var t=[];e&&t.push(239,187,191);for(var n=0,i=r.length;n<i;){var s=r.codePointAt(n);if(s<128){var a=s&127;t.push(a),n+=1}else if(s<2048){var a=s>>6&31|192,o=s&63|128;t.push(a,o),n+=1}else if(s<65536){var a=s>>12&15|224,o=s>>6&63|128,l=s&63|128;t.push(a,o,l),n+=1}else if(s<1114112){var a=s>>18&7|240,o=s>>12&63|128,l=s>>6&63|128,u=s>>0&63|128;t.push(a,o,l,u),n+=2}else throw new Error("Invalid code point: 0x"+bw.toHexString(s))}return new Uint8Array(t)};wt.utf16Encode=function(r,e){e===void 0&&(e=!0);var t=[];e&&t.push(65279);for(var n=0,i=r.length;n<i;){var s=r.codePointAt(n);if(s<65536)t.push(s),n+=1;else if(s<1114112)t.push(wt.highSurrogate(s),wt.lowSurrogate(s)),n+=2;else throw new Error("Invalid code point: 0x"+bw.toHexString(s))}return new Uint16Array(t)};wt.isWithinBMP=function(r){return r>=0&&r<=65535};wt.hasSurrogates=function(r){return r>=65536&&r<=1114111};wt.highSurrogate=function(r){return Math.floor((r-65536)/1024)+55296};wt.lowSurrogate=function(r){return(r-65536)%1024+56320};var Fi;(function(r){r.BigEndian="BigEndian",r.LittleEndian="LittleEndian"})(Fi||(Fi={}));var Ko="\uFFFD".codePointAt(0);wt.utf16Decode=function(r,e){if(e===void 0&&(e=!0),r.length<=1)return String.fromCodePoint(Ko);for(var t=e?tC(r):Fi.BigEndian,n=e?2:0,i=[];r.length-n>=2;){var s=yw(r[n++],r[n++],t);if(eC(s))if(r.length-n<2)i.push(Ko);else{var a=yw(r[n++],r[n++],t);vw(a)?i.push(s,a):i.push(Ko)}else vw(s)?(n+=2,i.push(Ko)):i.push(s)}return n<r.length&&i.push(Ko),String.fromCodePoint.apply(String,i)};var eC=function(r){return r>=55296&&r<=56319},vw=function(r){return r>=56320&&r<=57343},yw=function(r,e,t){if(t===Fi.LittleEndian)return e<<8|r;if(t===Fi.BigEndian)return r<<8|e;throw new Error("Invalid byteOrder: "+t)},tC=function(r){return ww(r)?Fi.BigEndian:xw(r)?Fi.LittleEndian:Fi.BigEndian},ww=function(r){return r[0]===254&&r[1]===255},xw=function(r){return r[0]===255&&r[1]===254};wt.hasUtf16BOM=function(r){return ww(r)||xw(r)}});var Aw=E(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.bytesFor=Yn.sizeInBytes=Yn.numberToString=void 0;Yn.numberToString=function(r){var e=String(r);if(Math.abs(r)<1){var t=parseInt(r.toString().split("e-")[1]);if(t){var n=r<0;n&&(r*=-1),r*=Math.pow(10,t-1),e="0."+new Array(t).join("0")+r.toString().substring(2),n&&(e="-"+e)}}else{var t=parseInt(r.toString().split("+")[1]);t>20&&(t-=20,r/=Math.pow(10,t),e=r.toString()+new Array(t+1).join("0"))}return e};Yn.sizeInBytes=function(r){return Math.ceil(r.toString(2).length/8)};Yn.bytesFor=function(r){for(var e=new Uint8Array(Yn.sizeInBytes(r)),t=1;t<=e.length;t++)e[t-1]=r>>(e.length-t)*8;return e}});var Sw=E(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.error=void 0;qd.error=function(r){throw new Error(r)}});var Zn=E(rr=>{"use strict";var rC=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function nC(r,e){return Object.prototype.hasOwnProperty.call(r,e)}rr.assign=function(r){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(var n in t)nC(t,n)&&(r[n]=t[n])}}return r};rr.shrinkBuf=function(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)};var iC={arraySet:function(r,e,t,n,i){if(e.subarray&&r.subarray){r.set(e.subarray(t,t+n),i);return}for(var s=0;s<n;s++)r[i+s]=e[t+s]},flattenChunks:function(r){var e,t,n,i,s,a;for(n=0,e=0,t=r.length;e<t;e++)n+=r[e].length;for(a=new Uint8Array(n),i=0,e=0,t=r.length;e<t;e++)s=r[e],a.set(s,i),i+=s.length;return a}},sC={arraySet:function(r,e,t,n,i){for(var s=0;s<n;s++)r[i+s]=e[t+s]},flattenChunks:function(r){return[].concat.apply([],r)}};rr.setTyped=function(r){r?(rr.Buf8=Uint8Array,rr.Buf16=Uint16Array,rr.Buf32=Int32Array,rr.assign(rr,iC)):(rr.Buf8=Array,rr.Buf16=Array,rr.Buf32=Array,rr.assign(rr,sC))};rr.setTyped(rC)});var Ww=E(ga=>{"use strict";var aC=Zn(),oC=4,Pw=0,Fw=1,lC=2;function pa(r){for(var e=r.length;--e>=0;)r[e]=0}var uC=0,Rw=1,dC=2,cC=3,hC=258,Zp=29,$o=256,Yo=$o+1+Zp,fa=30,Jp=19,_w=2*Yo+1,as=15,Hp=16,fC=7,Qp=256,Iw=16,Ow=17,Mw=18,Xp=[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],zd=[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],pC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Nw=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gC=512,Jn=new Array((Yo+2)*2);pa(Jn);var Xo=new Array(fa*2);pa(Xo);var Zo=new Array(gC);pa(Zo);var Jo=new Array(hC-cC+1);pa(Jo);var $p=new Array(Zp);pa($p);var Vd=new Array(fa);pa(Vd);function Gp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}var Lw,jw,Bw;function Wp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function Uw(r){return r<256?Zo[r]:Zo[256+(r>>>7)]}function Qo(r,e){r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255}function hr(r,e,t){r.bi_valid>Hp-t?(r.bi_buf|=e<<r.bi_valid&65535,Qo(r,r.bi_buf),r.bi_buf=e>>Hp-r.bi_valid,r.bi_valid+=t-Hp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)}function An(r,e,t){hr(r,t[e*2],t[e*2+1])}function qw(r,e){var t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1}function mC(r){r.bi_valid===16?(Qo(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)}function vC(r,e){var t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,u,d,c,h,f,p,g=0;for(h=0;h<=as;h++)r.bl_count[h]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<_w;u++)d=r.heap[u],h=t[t[d*2+1]*2+1]+1,h>l&&(h=l,g++),t[d*2+1]=h,!(d>n)&&(r.bl_count[h]++,f=0,d>=o&&(f=a[d-o]),p=t[d*2],r.opt_len+=p*(h+f),s&&(r.static_len+=p*(i[d*2+1]+f)));if(g!==0){do{for(h=l-1;r.bl_count[h]===0;)h--;r.bl_count[h]--,r.bl_count[h+1]+=2,r.bl_count[l]--,g-=2}while(g>0);for(h=l;h!==0;h--)for(d=r.bl_count[h];d!==0;)c=r.heap[--u],!(c>n)&&(t[c*2+1]!==h&&(r.opt_len+=(h-t[c*2+1])*t[c*2],t[c*2+1]=h),d--)}}function zw(r,e,t){var n=new Array(as+1),i=0,s,a;for(s=1;s<=as;s++)n[s]=i=i+t[s-1]<<1;for(a=0;a<=e;a++){var o=r[a*2+1];o!==0&&(r[a*2]=qw(n[o]++,o))}}function yC(){var r,e,t,n,i,s=new Array(as+1);for(t=0,n=0;n<Zp-1;n++)for($p[n]=t,r=0;r<1<<Xp[n];r++)Jo[t++]=n;for(Jo[t-1]=n,i=0,n=0;n<16;n++)for(Vd[n]=i,r=0;r<1<<zd[n];r++)Zo[i++]=n;for(i>>=7;n<fa;n++)for(Vd[n]=i<<7,r=0;r<1<<zd[n]-7;r++)Zo[256+i++]=n;for(e=0;e<=as;e++)s[e]=0;for(r=0;r<=143;)Jn[r*2+1]=8,r++,s[8]++;for(;r<=255;)Jn[r*2+1]=9,r++,s[9]++;for(;r<=279;)Jn[r*2+1]=7,r++,s[7]++;for(;r<=287;)Jn[r*2+1]=8,r++,s[8]++;for(zw(Jn,Yo+1,s),r=0;r<fa;r++)Xo[r*2+1]=5,Xo[r*2]=qw(r,5);Lw=new Gp(Jn,Xp,$o+1,Yo,as),jw=new Gp(Xo,zd,0,fa,as),Bw=new Gp(new Array(0),pC,0,Jp,fC)}function Vw(r){var e;for(e=0;e<Yo;e++)r.dyn_ltree[e*2]=0;for(e=0;e<fa;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Jp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Qp*2]=1,r.opt_len=r.static_len=0,r.last_lit=r.matches=0}function Hw(r){r.bi_valid>8?Qo(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function bC(r,e,t,n){Hw(r),n&&(Qo(r,t),Qo(r,~t)),aC.arraySet(r.pending_buf,r.window,e,t,r.pending),r.pending+=t}function Dw(r,e,t,n){var i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]}function Kp(r,e,t){for(var n=r.heap[t],i=t<<1;i<=r.heap_len&&(i<r.heap_len&&Dw(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!Dw(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n}function Ew(r,e,t){var n,i,s=0,a,o;if(r.last_lit!==0)do n=r.pending_buf[r.d_buf+s*2]<<8|r.pending_buf[r.d_buf+s*2+1],i=r.pending_buf[r.l_buf+s],s++,n===0?An(r,i,e):(a=Jo[i],An(r,a+$o+1,e),o=Xp[a],o!==0&&(i-=$p[a],hr(r,i,o)),n--,a=Uw(n),An(r,a,t),o=zd[a],o!==0&&(n-=Vd[a],hr(r,n,o)));while(s<r.last_lit);An(r,Qp,e)}function Yp(r,e){var t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems,a,o,l=-1,u;for(r.heap_len=0,r.heap_max=_w,a=0;a<s;a++)t[a*2]!==0?(r.heap[++r.heap_len]=l=a,r.depth[a]=0):t[a*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=l<2?++l:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=l,a=r.heap_len>>1;a>=1;a--)Kp(r,t,a);u=s;do a=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Kp(r,t,1),o=r.heap[1],r.heap[--r.heap_max]=a,r.heap[--r.heap_max]=o,t[u*2]=t[a*2]+t[o*2],r.depth[u]=(r.depth[a]>=r.depth[o]?r.depth[a]:r.depth[o])+1,t[a*2+1]=t[o*2+1]=u,r.heap[1]=u++,Kp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],vC(r,e),zw(t,l,r.bl_count)}function Cw(r,e,t){var n,i=-1,s,a=e[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=a,a=e[(n+1)*2+1],!(++o<l&&s===a)&&(o<u?r.bl_tree[s*2]+=o:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[Iw*2]++):o<=10?r.bl_tree[Ow*2]++:r.bl_tree[Mw*2]++,o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4))}function Tw(r,e,t){var n,i=-1,s,a=e[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),n=0;n<=t;n++)if(s=a,a=e[(n+1)*2+1],!(++o<l&&s===a)){if(o<u)do An(r,s,r.bl_tree);while(--o!==0);else s!==0?(s!==i&&(An(r,s,r.bl_tree),o--),An(r,Iw,r.bl_tree),hr(r,o-3,2)):o<=10?(An(r,Ow,r.bl_tree),hr(r,o-3,3)):(An(r,Mw,r.bl_tree),hr(r,o-11,7));o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4)}}function wC(r){var e;for(Cw(r,r.dyn_ltree,r.l_desc.max_code),Cw(r,r.dyn_dtree,r.d_desc.max_code),Yp(r,r.bl_desc),e=Jp-1;e>=3&&r.bl_tree[Nw[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e}function xC(r,e,t,n){var i;for(hr(r,e-257,5),hr(r,t-1,5),hr(r,n-4,4),i=0;i<n;i++)hr(r,r.bl_tree[Nw[i]*2+1],3);Tw(r,r.dyn_ltree,e-1),Tw(r,r.dyn_dtree,t-1)}function AC(r){var e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return Pw;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return Fw;for(t=32;t<$o;t++)if(r.dyn_ltree[t*2]!==0)return Fw;return Pw}var kw=!1;function SC(r){kw||(yC(),kw=!0),r.l_desc=new Wp(r.dyn_ltree,Lw),r.d_desc=new Wp(r.dyn_dtree,jw),r.bl_desc=new Wp(r.bl_tree,Bw),r.bi_buf=0,r.bi_valid=0,Vw(r)}function Gw(r,e,t,n){hr(r,(uC<<1)+(n?1:0),3),bC(r,e,t,!0)}function PC(r){hr(r,Rw<<1,3),An(r,Qp,Jn),mC(r)}function FC(r,e,t,n){var i,s,a=0;r.level>0?(r.strm.data_type===lC&&(r.strm.data_type=AC(r)),Yp(r,r.l_desc),Yp(r,r.d_desc),a=wC(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?Gw(r,e,t,n):r.strategy===oC||s===i?(hr(r,(Rw<<1)+(n?1:0),3),Ew(r,Jn,Xo)):(hr(r,(dC<<1)+(n?1:0),3),xC(r,r.l_desc.max_code+1,r.d_desc.max_code+1,a+1),Ew(r,r.dyn_ltree,r.dyn_dtree)),Vw(r),n&&Hw(r)}function DC(r,e,t){return r.pending_buf[r.d_buf+r.last_lit*2]=e>>>8&255,r.pending_buf[r.d_buf+r.last_lit*2+1]=e&255,r.pending_buf[r.l_buf+r.last_lit]=t&255,r.last_lit++,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Jo[t]+$o+1)*2]++,r.dyn_dtree[Uw(e)*2]++),r.last_lit===r.lit_bufsize-1}ga._tr_init=SC;ga._tr_stored_block=Gw;ga._tr_flush_block=FC;ga._tr_tally=DC;ga._tr_align=PC});var eg=E((h4,Kw)=>{"use strict";function EC(r,e,t,n){for(var i=r&65535|0,s=r>>>16&65535|0,a=0;t!==0;){a=t>2e3?2e3:t,t-=a;do i=i+e[n++]|0,s=s+i|0;while(--a);i%=65521,s%=65521}return i|s<<16|0}Kw.exports=EC});var tg=E((f4,Xw)=>{"use strict";function CC(){for(var r,e=[],t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e}var TC=CC();function kC(r,e,t,n){var i=TC,s=n+t;r^=-1;for(var a=n;a<s;a++)r=r>>>8^i[(r^e[a])&255];return r^-1}Xw.exports=kC});var Hd=E((p4,Yw)=>{"use strict";Yw.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"}});var ix=E(Fn=>{"use strict";var nr=Zn(),qr=Ww(),$w=eg(),Di=tg(),RC=Hd(),ds=0,_C=1,IC=3,Ri=4,Zw=5,Pn=0,Jw=1,zr=-2,OC=-3,rg=-5,MC=-1,NC=1,Gd=2,LC=3,jC=4,BC=0,UC=2,Yd=8,qC=9,zC=15,VC=8,HC=29,GC=256,ig=GC+1+HC,WC=30,KC=19,XC=2*ig+1,YC=15,Fe=3,Ti=258,sn=Ti+Fe+1,ZC=32,Zd=42,sg=69,Wd=73,Kd=91,Xd=103,os=113,tl=666,Dt=1,rl=2,ls=3,ya=4,JC=3;function ki(r,e){return r.msg=RC[e],e}function Qw(r){return(r<<1)-(r>4?9:0)}function Ci(r){for(var e=r.length;--e>=0;)r[e]=0}function Ei(r){var e=r.state,t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(nr.arraySet(r.output,e.pending_buf,e.pending_out,t,r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function Bt(r,e){qr._tr_flush_block(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Ei(r.strm)}function Re(r,e){r.pending_buf[r.pending++]=e}function el(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255}function QC(r,e,t,n){var i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,nr.arraySet(e,r.input,r.next_in,i,t),r.state.wrap===1?r.adler=$w(r.adler,e,i,t):r.state.wrap===2&&(r.adler=Di(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)}function ex(r,e){var t=r.max_chain_length,n=r.strstart,i,s,a=r.prev_length,o=r.nice_match,l=r.strstart>r.w_size-sn?r.strstart-(r.w_size-sn):0,u=r.window,d=r.w_mask,c=r.prev,h=r.strstart+Ti,f=u[n+a-1],p=u[n+a];r.prev_length>=r.good_match&&(t>>=2),o>r.lookahead&&(o=r.lookahead);do if(i=e,!(u[i+a]!==p||u[i+a-1]!==f||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<h);if(s=Ti-(h-n),n=h-Ti,s>a){if(r.match_start=e,a=s,s>=o)break;f=u[n+a-1],p=u[n+a]}}while((e=c[e&d])>l&&--t!==0);return a<=r.lookahead?a:r.lookahead}function us(r){var e=r.w_size,t,n,i,s,a;do{if(s=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-sn)){nr.arraySet(r.window,r.window,e,e,0),r.match_start-=e,r.strstart-=e,r.block_start-=e,n=r.hash_size,t=n;do i=r.head[--t],r.head[t]=i>=e?i-e:0;while(--n);n=e,t=n;do i=r.prev[--t],r.prev[t]=i>=e?i-e:0;while(--n);s+=e}if(r.strm.avail_in===0)break;if(n=QC(r.strm,r.window,r.strstart+r.lookahead,s),r.lookahead+=n,r.lookahead+r.insert>=Fe)for(a=r.strstart-r.insert,r.ins_h=r.window[a],r.ins_h=(r.ins_h<<r.hash_shift^r.window[a+1])&r.hash_mask;r.insert&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[a+Fe-1])&r.hash_mask,r.prev[a&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=a,a++,r.insert--,!(r.lookahead+r.insert<Fe)););}while(r.lookahead<sn&&r.strm.avail_in!==0)}function $C(r,e){var t=65535;for(t>r.pending_buf_size-5&&(t=r.pending_buf_size-5);;){if(r.lookahead<=1){if(us(r),r.lookahead===0&&e===ds)return Dt;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;var n=r.block_start+t;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,Bt(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-sn&&(Bt(r,!1),r.strm.avail_out===0))return Dt}return r.insert=0,e===Ri?(Bt(r,!0),r.strm.avail_out===0?ls:ya):(r.strstart>r.block_start&&(Bt(r,!1),r.strm.avail_out===0),Dt)}function ng(r,e){for(var t,n;;){if(r.lookahead<sn){if(us(r),r.lookahead<sn&&e===ds)return Dt;if(r.lookahead===0)break}if(t=0,r.lookahead>=Fe&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+Fe-1])&r.hash_mask,t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-sn&&(r.match_length=ex(r,t)),r.match_length>=Fe)if(n=qr._tr_tally(r,r.strstart-r.match_start,r.match_length-Fe),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Fe){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+Fe-1])&r.hash_mask,t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+1])&r.hash_mask;else n=qr._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(Bt(r,!1),r.strm.avail_out===0))return Dt}return r.insert=r.strstart<Fe-1?r.strstart:Fe-1,e===Ri?(Bt(r,!0),r.strm.avail_out===0?ls:ya):r.last_lit&&(Bt(r,!1),r.strm.avail_out===0)?Dt:rl}function ma(r,e){for(var t,n,i;;){if(r.lookahead<sn){if(us(r),r.lookahead<sn&&e===ds)return Dt;if(r.lookahead===0)break}if(t=0,r.lookahead>=Fe&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+Fe-1])&r.hash_mask,t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=Fe-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-sn&&(r.match_length=ex(r,t),r.match_length<=5&&(r.strategy===NC||r.match_length===Fe&&r.strstart-r.match_start>4096)&&(r.match_length=Fe-1)),r.prev_length>=Fe&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Fe,n=qr._tr_tally(r,r.strstart-1-r.prev_match,r.prev_length-Fe),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+Fe-1])&r.hash_mask,t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=Fe-1,r.strstart++,n&&(Bt(r,!1),r.strm.avail_out===0))return Dt}else if(r.match_available){if(n=qr._tr_tally(r,0,r.window[r.strstart-1]),n&&Bt(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return Dt}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=qr._tr_tally(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<Fe-1?r.strstart:Fe-1,e===Ri?(Bt(r,!0),r.strm.avail_out===0?ls:ya):r.last_lit&&(Bt(r,!1),r.strm.avail_out===0)?Dt:rl}function eT(r,e){for(var t,n,i,s,a=r.window;;){if(r.lookahead<=Ti){if(us(r),r.lookahead<=Ti&&e===ds)return Dt;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=Fe&&r.strstart>0&&(i=r.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){s=r.strstart+Ti;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);r.match_length=Ti-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=Fe?(t=qr._tr_tally(r,1,r.match_length-Fe),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=qr._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(Bt(r,!1),r.strm.avail_out===0))return Dt}return r.insert=0,e===Ri?(Bt(r,!0),r.strm.avail_out===0?ls:ya):r.last_lit&&(Bt(r,!1),r.strm.avail_out===0)?Dt:rl}function tT(r,e){for(var t;;){if(r.lookahead===0&&(us(r),r.lookahead===0)){if(e===ds)return Dt;break}if(r.match_length=0,t=qr._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(Bt(r,!1),r.strm.avail_out===0))return Dt}return r.insert=0,e===Ri?(Bt(r,!0),r.strm.avail_out===0?ls:ya):r.last_lit&&(Bt(r,!1),r.strm.avail_out===0)?Dt:rl}function Sn(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}var va;va=[new Sn(0,0,0,0,$C),new Sn(4,4,8,4,ng),new Sn(4,5,16,8,ng),new Sn(4,6,32,32,ng),new Sn(4,4,16,16,ma),new Sn(8,16,32,32,ma),new Sn(8,16,128,128,ma),new Sn(8,32,128,256,ma),new Sn(32,128,258,1024,ma),new Sn(32,258,258,4096,ma)];function rT(r){r.window_size=2*r.w_size,Ci(r.head),r.max_lazy_match=va[r.level].max_lazy,r.good_match=va[r.level].good_length,r.nice_match=va[r.level].nice_length,r.max_chain_length=va[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=Fe-1,r.match_available=0,r.ins_h=0}function nT(){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=Yd,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 nr.Buf16(XC*2),this.dyn_dtree=new nr.Buf16((2*WC+1)*2),this.bl_tree=new nr.Buf16((2*KC+1)*2),Ci(this.dyn_ltree),Ci(this.dyn_dtree),Ci(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new nr.Buf16(YC+1),this.heap=new nr.Buf16(2*ig+1),Ci(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new nr.Buf16(2*ig+1),Ci(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 tx(r){var e;return!r||!r.state?ki(r,zr):(r.total_in=r.total_out=0,r.data_type=UC,e=r.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Zd:os,r.adler=e.wrap===2?0:1,e.last_flush=ds,qr._tr_init(e),Pn)}function rx(r){var e=tx(r);return e===Pn&&rT(r.state),e}function iT(r,e){return!r||!r.state||r.state.wrap!==2?zr:(r.state.gzhead=e,Pn)}function nx(r,e,t,n,i,s){if(!r)return zr;var a=1;if(e===MC&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>qC||t!==Yd||n<8||n>15||e<0||e>9||s<0||s>jC)return ki(r,zr);n===8&&(n=9);var o=new nT;return r.state=o,o.strm=r,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Fe-1)/Fe),o.window=new nr.Buf8(o.w_size*2),o.head=new nr.Buf16(o.hash_size),o.prev=new nr.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new nr.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=s,o.method=t,rx(r)}function sT(r,e){return nx(r,e,Yd,zC,VC,BC)}function aT(r,e){var t,n,i,s;if(!r||!r.state||e>Zw||e<0)return r?ki(r,zr):zr;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===tl&&e!==Ri)return ki(r,r.avail_out===0?rg:zr);if(n.strm=r,t=n.last_flush,n.last_flush=e,n.status===Zd)if(n.wrap===2)r.adler=0,Re(n,31),Re(n,139),Re(n,8),n.gzhead?(Re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Re(n,n.gzhead.time&255),Re(n,n.gzhead.time>>8&255),Re(n,n.gzhead.time>>16&255),Re(n,n.gzhead.time>>24&255),Re(n,n.level===9?2:n.strategy>=Gd||n.level<2?4:0),Re(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Re(n,n.gzhead.extra.length&255),Re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=Di(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=sg):(Re(n,0),Re(n,0),Re(n,0),Re(n,0),Re(n,0),Re(n,n.level===9?2:n.strategy>=Gd||n.level<2?4:0),Re(n,JC),n.status=os);else{var a=Yd+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=Gd||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,a|=o<<6,n.strstart!==0&&(a|=ZC),a+=31-a%31,n.status=os,el(n,a),n.strstart!==0&&(el(n,r.adler>>>16),el(n,r.adler&65535)),r.adler=1}if(n.status===sg)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),Ei(r),i=n.pending,n.pending===n.pending_buf_size));)Re(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Wd)}else n.status=Wd;if(n.status===Wd)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),Ei(r),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,Re(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.gzindex=0,n.status=Kd)}else n.status=Kd;if(n.status===Kd)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),Ei(r),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,Re(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(r.adler=Di(r.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.status=Xd)}else n.status=Xd;if(n.status===Xd&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ei(r),n.pending+2<=n.pending_buf_size&&(Re(n,r.adler&255),Re(n,r.adler>>8&255),r.adler=0,n.status=os)):n.status=os),n.pending!==0){if(Ei(r),r.avail_out===0)return n.last_flush=-1,Pn}else if(r.avail_in===0&&Qw(e)<=Qw(t)&&e!==Ri)return ki(r,rg);if(n.status===tl&&r.avail_in!==0)return ki(r,rg);if(r.avail_in!==0||n.lookahead!==0||e!==ds&&n.status!==tl){var l=n.strategy===Gd?tT(n,e):n.strategy===LC?eT(n,e):va[n.level].func(n,e);if((l===ls||l===ya)&&(n.status=tl),l===Dt||l===ls)return r.avail_out===0&&(n.last_flush=-1),Pn;if(l===rl&&(e===_C?qr._tr_align(n):e!==Zw&&(qr._tr_stored_block(n,0,0,!1),e===IC&&(Ci(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ei(r),r.avail_out===0))return n.last_flush=-1,Pn}return e!==Ri?Pn:n.wrap<=0?Jw:(n.wrap===2?(Re(n,r.adler&255),Re(n,r.adler>>8&255),Re(n,r.adler>>16&255),Re(n,r.adler>>24&255),Re(n,r.total_in&255),Re(n,r.total_in>>8&255),Re(n,r.total_in>>16&255),Re(n,r.total_in>>24&255)):(el(n,r.adler>>>16),el(n,r.adler&65535)),Ei(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Pn:Jw)}function oT(r){var e;return!r||!r.state?zr:(e=r.state.status,e!==Zd&&e!==sg&&e!==Wd&&e!==Kd&&e!==Xd&&e!==os&&e!==tl?ki(r,zr):(r.state=null,e===os?ki(r,OC):Pn))}function lT(r,e){var t=e.length,n,i,s,a,o,l,u,d;if(!r||!r.state||(n=r.state,a=n.wrap,a===2||a===1&&n.status!==Zd||n.lookahead))return zr;for(a===1&&(r.adler=$w(r.adler,e,t,0)),n.wrap=0,t>=n.w_size&&(a===0&&(Ci(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new nr.Buf8(n.w_size),nr.arraySet(d,e,t-n.w_size,n.w_size,0),e=d,t=n.w_size),o=r.avail_in,l=r.next_in,u=r.input,r.avail_in=t,r.next_in=0,r.input=e,us(n);n.lookahead>=Fe;){i=n.strstart,s=n.lookahead-(Fe-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+Fe-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--s);n.strstart=i,n.lookahead=Fe-1,us(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Fe-1,n.match_available=0,r.next_in=l,r.input=u,r.avail_in=o,n.wrap=a,Pn}Fn.deflateInit=sT;Fn.deflateInit2=nx;Fn.deflateReset=rx;Fn.deflateResetKeep=tx;Fn.deflateSetHeader=iT;Fn.deflate=aT;Fn.deflateEnd=oT;Fn.deflateSetDictionary=lT;Fn.deflateInfo="pako deflate (from Nodeca project)"});var ag=E(ba=>{"use strict";var Jd=Zn(),sx=!0,ax=!0;try{String.fromCharCode.apply(null,[0])}catch{sx=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ax=!1}var nl=new Jd.Buf8(256);for(Qn=0;Qn<256;Qn++)nl[Qn]=Qn>=252?6:Qn>=248?5:Qn>=240?4:Qn>=224?3:Qn>=192?2:1;var Qn;nl[254]=nl[254]=1;ba.string2buf=function(r){var e,t,n,i,s,a=r.length,o=0;for(i=0;i<a;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Jd.Buf8(o),s=0,i=0;s<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};function ox(r,e){if(e<65534&&(r.subarray&&ax||!r.subarray&&sx))return String.fromCharCode.apply(null,Jd.shrinkBuf(r,e));for(var t="",n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t}ba.buf2binstring=function(r){return ox(r,r.length)};ba.binstring2buf=function(r){for(var e=new Jd.Buf8(r.length),t=0,n=e.length;t<n;t++)e[t]=r.charCodeAt(t);return e};ba.buf2string=function(r,e){var t,n,i,s,a=e||r.length,o=new Array(a*2);for(n=0,t=0;t<a;){if(i=r[t++],i<128){o[n++]=i;continue}if(s=nl[i],s>4){o[n++]=65533,t+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&t<a;)i=i<<6|r[t++]&63,s--;if(s>1){o[n++]=65533;continue}i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|i&1023)}return ox(o,n)};ba.utf8border=function(r,e){var t;for(e=e||r.length,e>r.length&&(e=r.length),t=e-1;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+nl[r[t]]>e?t:e}});var og=E((v4,lx)=>{"use strict";function uT(){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}lx.exports=uT});var hx=E(al=>{"use strict";var il=ix(),sl=Zn(),ug=ag(),dg=Hd(),dT=og(),cx=Object.prototype.toString,cT=0,lg=4,wa=0,ux=1,dx=2,hT=-1,fT=0,pT=8;function cs(r){if(!(this instanceof cs))return new cs(r);this.options=sl.assign({level:hT,method:pT,chunkSize:16384,windowBits:15,memLevel:8,strategy:fT,to:""},r||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dT,this.strm.avail_out=0;var t=il.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==wa)throw new Error(dg[t]);if(e.header&&il.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=ug.string2buf(e.dictionary):cx.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=il.deflateSetDictionary(this.strm,n),t!==wa)throw new Error(dg[t]);this._dict_set=!0}}cs.prototype.push=function(r,e){var t=this.strm,n=this.options.chunkSize,i,s;if(this.ended)return!1;s=e===~~e?e:e===!0?lg:cT,typeof r=="string"?t.input=ug.string2buf(r):cx.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new sl.Buf8(n),t.next_out=0,t.avail_out=n),i=il.deflate(t,s),i!==ux&&i!==wa)return this.onEnd(i),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(s===lg||s===dx))&&(this.options.to==="string"?this.onData(ug.buf2binstring(sl.shrinkBuf(t.output,t.next_out))):this.onData(sl.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&i!==ux);return s===lg?(i=il.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===wa):(s===dx&&(this.onEnd(wa),t.avail_out=0),!0)};cs.prototype.onData=function(r){this.chunks.push(r)};cs.prototype.onEnd=function(r){r===wa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=sl.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function cg(r,e){var t=new cs(e);if(t.push(r,!0),t.err)throw t.msg||dg[t.err];return t.result}function gT(r,e){return e=e||{},e.raw=!0,cg(r,e)}function mT(r,e){return e=e||{},e.gzip=!0,cg(r,e)}al.Deflate=cs;al.deflate=cg;al.deflateRaw=gT;al.gzip=mT});var px=E((b4,fx)=>{"use strict";var Qd=30,vT=12;fx.exports=function(e,t){var n,i,s,a,o,l,u,d,c,h,f,p,g,v,m,y,w,x,b,A,S,P,F,k,D;n=e.state,i=e.next_in,k=e.input,s=i+(e.avail_in-5),a=e.next_out,D=e.output,o=a-(t-e.avail_out),l=a+(e.avail_out-257),u=n.dmax,d=n.wsize,c=n.whave,h=n.wnext,f=n.window,p=n.hold,g=n.bits,v=n.lencode,m=n.distcode,y=(1<<n.lenbits)-1,w=(1<<n.distbits)-1;e:do{g<15&&(p+=k[i++]<<g,g+=8,p+=k[i++]<<g,g+=8),x=v[p&y];t:for(;;){if(b=x>>>24,p>>>=b,g-=b,b=x>>>16&255,b===0)D[a++]=x&65535;else if(b&16){A=x&65535,b&=15,b&&(g<b&&(p+=k[i++]<<g,g+=8),A+=p&(1<<b)-1,p>>>=b,g-=b),g<15&&(p+=k[i++]<<g,g+=8,p+=k[i++]<<g,g+=8),x=m[p&w];r:for(;;){if(b=x>>>24,p>>>=b,g-=b,b=x>>>16&255,b&16){if(S=x&65535,b&=15,g<b&&(p+=k[i++]<<g,g+=8,g<b&&(p+=k[i++]<<g,g+=8)),S+=p&(1<<b)-1,S>u){e.msg="invalid distance too far back",n.mode=Qd;break e}if(p>>>=b,g-=b,b=a-o,S>b){if(b=S-b,b>c&&n.sane){e.msg="invalid distance too far back",n.mode=Qd;break e}if(P=0,F=f,h===0){if(P+=d-b,b<A){A-=b;do D[a++]=f[P++];while(--b);P=a-S,F=D}}else if(h<b){if(P+=d+h-b,b-=h,b<A){A-=b;do D[a++]=f[P++];while(--b);if(P=0,h<A){b=h,A-=b;do D[a++]=f[P++];while(--b);P=a-S,F=D}}}else if(P+=h-b,b<A){A-=b;do D[a++]=f[P++];while(--b);P=a-S,F=D}for(;A>2;)D[a++]=F[P++],D[a++]=F[P++],D[a++]=F[P++],A-=3;A&&(D[a++]=F[P++],A>1&&(D[a++]=F[P++]))}else{P=a-S;do D[a++]=D[P++],D[a++]=D[P++],D[a++]=D[P++],A-=3;while(A>2);A&&(D[a++]=D[P++],A>1&&(D[a++]=D[P++]))}}else if(b&64){e.msg="invalid distance code",n.mode=Qd;break e}else{x=m[(x&65535)+(p&(1<<b)-1)];continue r}break}}else if(b&64)if(b&32){n.mode=vT;break e}else{e.msg="invalid literal/length code",n.mode=Qd;break e}else{x=v[(x&65535)+(p&(1<<b)-1)];continue t}break}}while(i<s&&a<l);A=g>>3,i-=A,g-=A<<3,p&=(1<<g)-1,e.next_in=i,e.next_out=a,e.avail_in=i<s?5+(s-i):5-(i-s),e.avail_out=a<l?257+(l-a):257-(a-l),n.hold=p,n.bits=g}});var xx=E((w4,wx)=>{"use strict";var gx=Zn(),xa=15,mx=852,vx=592,yx=0,hg=1,bx=2,yT=[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],bT=[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],wT=[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],xT=[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];wx.exports=function(e,t,n,i,s,a,o,l){var u=l.bits,d=0,c=0,h=0,f=0,p=0,g=0,v=0,m=0,y=0,w=0,x,b,A,S,P,F=null,k=0,D,_=new gx.Buf16(xa+1),B=new gx.Buf16(xa+1),N=null,G=0,O,R,J;for(d=0;d<=xa;d++)_[d]=0;for(c=0;c<i;c++)_[t[n+c]]++;for(p=u,f=xa;f>=1&&_[f]===0;f--);if(p>f&&(p=f),f===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(h=1;h<f&&_[h]===0;h++);for(p<h&&(p=h),m=1,d=1;d<=xa;d++)if(m<<=1,m-=_[d],m<0)return-1;if(m>0&&(e===yx||f!==1))return-1;for(B[1]=0,d=1;d<xa;d++)B[d+1]=B[d]+_[d];for(c=0;c<i;c++)t[n+c]!==0&&(o[B[t[n+c]]++]=c);if(e===yx?(F=N=o,D=19):e===hg?(F=yT,k-=257,N=bT,G-=257,D=256):(F=wT,N=xT,D=-1),w=0,c=0,d=h,P=a,g=p,v=0,A=-1,y=1<<p,S=y-1,e===hg&&y>mx||e===bx&&y>vx)return 1;for(;;){O=d-v,o[c]<D?(R=0,J=o[c]):o[c]>D?(R=N[G+o[c]],J=F[k+o[c]]):(R=96,J=0),x=1<<d-v,b=1<<g,h=b;do b-=x,s[P+(w>>v)+b]=O<<24|R<<16|J|0;while(b!==0);for(x=1<<d-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,c++,--_[d]===0){if(d===f)break;d=t[n+o[c]]}if(d>p&&(w&S)!==A){for(v===0&&(v=p),P+=h,g=d-v,m=1<<g;g+v<f&&(m-=_[g+v],!(m<=0));)g++,m<<=1;if(y+=1<<g,e===hg&&y>mx||e===bx&&y>vx)return 1;A=w&S,s[A]=p<<24|g<<16|P-a|0}}return w!==0&&(s[P+w]=d-v<<24|64<<16|0),l.bits=p,0}});var r1=E(an=>{"use strict";var Tr=Zn(),yg=eg(),Dn=tg(),AT=px(),ol=xx(),ST=0,Kx=1,Xx=2,Ax=4,PT=5,$d=6,hs=0,FT=1,DT=2,Vr=-2,Yx=-3,bg=-4,ET=-5,Sx=8,Zx=1,Px=2,Fx=3,Dx=4,Ex=5,Cx=6,Tx=7,kx=8,Rx=9,_x=10,rc=11,$n=12,fg=13,Ix=14,pg=15,Ox=16,Mx=17,Nx=18,Lx=19,ec=20,tc=21,jx=22,Bx=23,Ux=24,qx=25,zx=26,gg=27,Vx=28,Hx=29,$e=30,wg=31,CT=32,TT=852,kT=592,RT=15,_T=RT;function Gx(r){return(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24)}function IT(){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 Tr.Buf16(320),this.work=new Tr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Jx(r){var e;return!r||!r.state?Vr:(e=r.state,r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Zx,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Tr.Buf32(TT),e.distcode=e.distdyn=new Tr.Buf32(kT),e.sane=1,e.back=-1,hs)}function Qx(r){var e;return!r||!r.state?Vr:(e=r.state,e.wsize=0,e.whave=0,e.wnext=0,Jx(r))}function $x(r,e){var t,n;return!r||!r.state||(n=r.state,e<0?(t=0,e=-e):(t=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Vr:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Qx(r))}function e1(r,e){var t,n;return r?(n=new IT,r.state=n,n.window=null,t=$x(r,e),t!==hs&&(r.state=null),t):Vr}function OT(r){return e1(r,_T)}var Wx=!0,mg,vg;function MT(r){if(Wx){var e;for(mg=new Tr.Buf32(512),vg=new Tr.Buf32(32),e=0;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(ol(Kx,r.lens,0,288,mg,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;ol(Xx,r.lens,0,32,vg,0,r.work,{bits:5}),Wx=!1}r.lencode=mg,r.lenbits=9,r.distcode=vg,r.distbits=5}function t1(r,e,t,n){var i,s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Tr.Buf8(s.wsize)),n>=s.wsize?(Tr.arraySet(s.window,e,t-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),Tr.arraySet(s.window,e,t-n,i,s.wnext),n-=i,n?(Tr.arraySet(s.window,e,t-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}function NT(r,e){var t,n,i,s,a,o,l,u,d,c,h,f,p,g,v=0,m,y,w,x,b,A,S,P,F=new Tr.Buf8(4),k,D,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!r||!r.state||!r.output||!r.input&&r.avail_in!==0)return Vr;t=r.state,t.mode===$n&&(t.mode=fg),a=r.next_out,i=r.output,l=r.avail_out,s=r.next_in,n=r.input,o=r.avail_in,u=t.hold,d=t.bits,c=o,h=l,P=hs;e:for(;;)switch(t.mode){case Zx:if(t.wrap===0){t.mode=fg;break}for(;d<16;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.check=0,F[0]=u&255,F[1]=u>>>8&255,t.check=Dn(t.check,F,2,0),u=0,d=0,t.mode=Px;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=$e;break}if((u&15)!==Sx){r.msg="unknown compression method",t.mode=$e;break}if(u>>>=4,d-=4,S=(u&15)+8,t.wbits===0)t.wbits=S;else if(S>t.wbits){r.msg="invalid window size",t.mode=$e;break}t.dmax=1<<S,r.adler=t.check=1,t.mode=u&512?_x:$n,u=0,d=0;break;case Px:for(;d<16;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==Sx){r.msg="unknown compression method",t.mode=$e;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=$e;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&(F[0]=u&255,F[1]=u>>>8&255,t.check=Dn(t.check,F,2,0)),u=0,d=0,t.mode=Fx;case Fx:for(;d<32;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&(F[0]=u&255,F[1]=u>>>8&255,F[2]=u>>>16&255,F[3]=u>>>24&255,t.check=Dn(t.check,F,4,0)),u=0,d=0,t.mode=Dx;case Dx:for(;d<16;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&(F[0]=u&255,F[1]=u>>>8&255,t.check=Dn(t.check,F,2,0)),u=0,d=0,t.mode=Ex;case Ex:if(t.flags&1024){for(;d<16;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&(F[0]=u&255,F[1]=u>>>8&255,t.check=Dn(t.check,F,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=Cx;case Cx:if(t.flags&1024&&(f=t.length,f>o&&(f=o),f&&(t.head&&(S=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Tr.arraySet(t.head.extra,n,s,f,S)),t.flags&512&&(t.check=Dn(t.check,n,f,s)),o-=f,s+=f,t.length-=f),t.length))break e;t.length=0,t.mode=Tx;case Tx:if(t.flags&2048){if(o===0)break e;f=0;do S=n[s+f++],t.head&&S&&t.length<65536&&(t.head.name+=String.fromCharCode(S));while(S&&f<o);if(t.flags&512&&(t.check=Dn(t.check,n,f,s)),o-=f,s+=f,S)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=kx;case kx:if(t.flags&4096){if(o===0)break e;f=0;do S=n[s+f++],t.head&&S&&t.length<65536&&(t.head.comment+=String.fromCharCode(S));while(S&&f<o);if(t.flags&512&&(t.check=Dn(t.check,n,f,s)),o-=f,s+=f,S)break e}else t.head&&(t.head.comment=null);t.mode=Rx;case Rx:if(t.flags&512){for(;d<16;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=$e;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=$n;break;case _x:for(;d<32;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}r.adler=t.check=Gx(u),u=0,d=0,t.mode=rc;case rc:if(t.havedict===0)return r.next_out=a,r.avail_out=l,r.next_in=s,r.avail_in=o,t.hold=u,t.bits=d,DT;r.adler=t.check=1,t.mode=$n;case $n:if(e===PT||e===$d)break e;case fg:if(t.last){u>>>=d&7,d-=d&7,t.mode=gg;break}for(;d<3;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=Ix;break;case 1:if(MT(t),t.mode=ec,e===$d){u>>>=2,d-=2;break e}break;case 2:t.mode=Mx;break;case 3:r.msg="invalid block type",t.mode=$e}u>>>=2,d-=2;break;case Ix:for(u>>>=d&7,d-=d&7;d<32;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=$e;break}if(t.length=u&65535,u=0,d=0,t.mode=pg,e===$d)break e;case pg:t.mode=Ox;case Ox:if(f=t.length,f){if(f>o&&(f=o),f>l&&(f=l),f===0)break e;Tr.arraySet(i,n,s,f,a),o-=f,s+=f,l-=f,a+=f,t.length-=f;break}t.mode=$n;break;case Mx:for(;d<14;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=$e;break}t.have=0,t.mode=Nx;case Nx:for(;t.have<t.ncode;){for(;d<3;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.lens[_[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[_[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},P=ol(ST,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,P){r.msg="invalid code lengths set",t.mode=$e;break}t.have=0,t.mode=Lx;case Lx:for(;t.have<t.nlen+t.ndist;){for(;v=t.lencode[u&(1<<t.lenbits)-1],m=v>>>24,y=v>>>16&255,w=v&65535,!(m<=d);){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(w<16)u>>>=m,d-=m,t.lens[t.have++]=w;else{if(w===16){for(D=m+2;d<D;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(u>>>=m,d-=m,t.have===0){r.msg="invalid bit length repeat",t.mode=$e;break}S=t.lens[t.have-1],f=3+(u&3),u>>>=2,d-=2}else if(w===17){for(D=m+3;d<D;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}u>>>=m,d-=m,S=0,f=3+(u&7),u>>>=3,d-=3}else{for(D=m+7;d<D;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}u>>>=m,d-=m,S=0,f=11+(u&127),u>>>=7,d-=7}if(t.have+f>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=$e;break}for(;f--;)t.lens[t.have++]=S}}if(t.mode===$e)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=$e;break}if(t.lenbits=9,k={bits:t.lenbits},P=ol(Kx,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,P){r.msg="invalid literal/lengths set",t.mode=$e;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},P=ol(Xx,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,P){r.msg="invalid distances set",t.mode=$e;break}if(t.mode=ec,e===$d)break e;case ec:t.mode=tc;case tc:if(o>=6&&l>=258){r.next_out=a,r.avail_out=l,r.next_in=s,r.avail_in=o,t.hold=u,t.bits=d,AT(r,h),a=r.next_out,i=r.output,l=r.avail_out,s=r.next_in,n=r.input,o=r.avail_in,u=t.hold,d=t.bits,t.mode===$n&&(t.back=-1);break}for(t.back=0;v=t.lencode[u&(1<<t.lenbits)-1],m=v>>>24,y=v>>>16&255,w=v&65535,!(m<=d);){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(y&&!(y&240)){for(x=m,b=y,A=w;v=t.lencode[A+((u&(1<<x+b)-1)>>x)],m=v>>>24,y=v>>>16&255,w=v&65535,!(x+m<=d);){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}u>>>=x,d-=x,t.back+=x}if(u>>>=m,d-=m,t.back+=m,t.length=w,y===0){t.mode=zx;break}if(y&32){t.back=-1,t.mode=$n;break}if(y&64){r.msg="invalid literal/length code",t.mode=$e;break}t.extra=y&15,t.mode=jx;case jx:if(t.extra){for(D=t.extra;d<D;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Bx;case Bx:for(;v=t.distcode[u&(1<<t.distbits)-1],m=v>>>24,y=v>>>16&255,w=v&65535,!(m<=d);){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(!(y&240)){for(x=m,b=y,A=w;v=t.distcode[A+((u&(1<<x+b)-1)>>x)],m=v>>>24,y=v>>>16&255,w=v&65535,!(x+m<=d);){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}u>>>=x,d-=x,t.back+=x}if(u>>>=m,d-=m,t.back+=m,y&64){r.msg="invalid distance code",t.mode=$e;break}t.offset=w,t.extra=y&15,t.mode=Ux;case Ux:if(t.extra){for(D=t.extra;d<D;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=$e;break}t.mode=qx;case qx:if(l===0)break e;if(f=h-l,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=$e;break}f>t.wnext?(f-=t.wnext,p=t.wsize-f):p=t.wnext-f,f>t.length&&(f=t.length),g=t.window}else g=i,p=a-t.offset,f=t.length;f>l&&(f=l),l-=f,t.length-=f;do i[a++]=g[p++];while(--f);t.length===0&&(t.mode=tc);break;case zx:if(l===0)break e;i[a++]=t.length,l--,t.mode=tc;break;case gg:if(t.wrap){for(;d<32;){if(o===0)break e;o--,u|=n[s++]<<d,d+=8}if(h-=l,r.total_out+=h,t.total+=h,h&&(r.adler=t.check=t.flags?Dn(t.check,i,h,a-h):yg(t.check,i,h,a-h)),h=l,(t.flags?u:Gx(u))!==t.check){r.msg="incorrect data check",t.mode=$e;break}u=0,d=0}t.mode=Vx;case Vx:if(t.wrap&&t.flags){for(;d<32;){if(o===0)break e;o--,u+=n[s++]<<d,d+=8}if(u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=$e;break}u=0,d=0}t.mode=Hx;case Hx:P=FT;break e;case $e:P=Yx;break e;case wg:return bg;case CT:default:return Vr}return r.next_out=a,r.avail_out=l,r.next_in=s,r.avail_in=o,t.hold=u,t.bits=d,(t.wsize||h!==r.avail_out&&t.mode<$e&&(t.mode<gg||e!==Ax))&&t1(r,r.output,r.next_out,h-r.avail_out)?(t.mode=wg,bg):(c-=r.avail_in,h-=r.avail_out,r.total_in+=c,r.total_out+=h,t.total+=h,t.wrap&&h&&(r.adler=t.check=t.flags?Dn(t.check,i,h,r.next_out-h):yg(t.check,i,h,r.next_out-h)),r.data_type=t.bits+(t.last?64:0)+(t.mode===$n?128:0)+(t.mode===ec||t.mode===pg?256:0),(c===0&&h===0||e===Ax)&&P===hs&&(P=ET),P)}function LT(r){if(!r||!r.state)return Vr;var e=r.state;return e.window&&(e.window=null),r.state=null,hs}function jT(r,e){var t;return!r||!r.state||(t=r.state,!(t.wrap&2))?Vr:(t.head=e,e.done=!1,hs)}function BT(r,e){var t=e.length,n,i,s;return!r||!r.state||(n=r.state,n.wrap!==0&&n.mode!==rc)?Vr:n.mode===rc&&(i=1,i=yg(i,e,t,0),i!==n.check)?Yx:(s=t1(r,e,t,t),s?(n.mode=wg,bg):(n.havedict=1,hs))}an.inflateReset=Qx;an.inflateReset2=$x;an.inflateResetKeep=Jx;an.inflateInit=OT;an.inflateInit2=e1;an.inflate=NT;an.inflateEnd=LT;an.inflateGetHeader=jT;an.inflateSetDictionary=BT;an.inflateInfo="pako inflate (from Nodeca project)"});var xg=E((A4,n1)=>{"use strict";n1.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}});var s1=E((S4,i1)=>{"use strict";function UT(){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}i1.exports=UT});var o1=E(ul=>{"use strict";var Aa=r1(),ll=Zn(),nc=ag(),pt=xg(),Ag=Hd(),qT=og(),zT=s1(),a1=Object.prototype.toString;function fs(r){if(!(this instanceof fs))return new fs(r);this.options=ll.assign({chunkSize:16384,windowBits:0,to:""},r||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qT,this.strm.avail_out=0;var t=Aa.inflateInit2(this.strm,e.windowBits);if(t!==pt.Z_OK)throw new Error(Ag[t]);if(this.header=new zT,Aa.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=nc.string2buf(e.dictionary):a1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Aa.inflateSetDictionary(this.strm,e.dictionary),t!==pt.Z_OK)))throw new Error(Ag[t])}fs.prototype.push=function(r,e){var t=this.strm,n=this.options.chunkSize,i=this.options.dictionary,s,a,o,l,u,d=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?pt.Z_FINISH:pt.Z_NO_FLUSH,typeof r=="string"?t.input=nc.binstring2buf(r):a1.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new ll.Buf8(n),t.next_out=0,t.avail_out=n),s=Aa.inflate(t,pt.Z_NO_FLUSH),s===pt.Z_NEED_DICT&&i&&(s=Aa.inflateSetDictionary(this.strm,i)),s===pt.Z_BUF_ERROR&&d===!0&&(s=pt.Z_OK,d=!1),s!==pt.Z_STREAM_END&&s!==pt.Z_OK)return this.onEnd(s),this.ended=!0,!1;t.next_out&&(t.avail_out===0||s===pt.Z_STREAM_END||t.avail_in===0&&(a===pt.Z_FINISH||a===pt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=nc.utf8border(t.output,t.next_out),l=t.next_out-o,u=nc.buf2string(t.output,o),t.next_out=l,t.avail_out=n-l,l&&ll.arraySet(t.output,t.output,o,l,0),this.onData(u)):this.onData(ll.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(d=!0)}while((t.avail_in>0||t.avail_out===0)&&s!==pt.Z_STREAM_END);return s===pt.Z_STREAM_END&&(a=pt.Z_FINISH),a===pt.Z_FINISH?(s=Aa.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===pt.Z_OK):(a===pt.Z_SYNC_FLUSH&&(this.onEnd(pt.Z_OK),t.avail_out=0),!0)};fs.prototype.onData=function(r){this.chunks.push(r)};fs.prototype.onEnd=function(r){r===pt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ll.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Sg(r,e){var t=new fs(e);if(t.push(r,!0),t.err)throw t.msg||Ag[t.err];return t.result}function VT(r,e){return e=e||{},e.raw=!0,Sg(r,e)}ul.Inflate=fs;ul.inflate=Sg;ul.inflateRaw=VT;ul.ungzip=Sg});var dl=E((F4,u1)=>{"use strict";var HT=Zn().assign,GT=hx(),WT=o1(),KT=xg(),l1={};HT(l1,GT,WT,KT);u1.exports=l1});var Pg=E(_i=>{"use strict";var XT=_i&&_i.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_i,"__esModule",{value:!0});var YT=XT(dl()),d1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hl=new Uint8Array(256);for(cl=0;cl<d1.length;cl++)hl[d1.charCodeAt(cl)]=cl;var cl;_i.decodeFromBase64=function(r){var e=r.length*.75,t=r.length,n,i=0,s,a,o,l;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var u=new Uint8Array(e);for(n=0;n<t;n+=4)s=hl[r.charCodeAt(n)],a=hl[r.charCodeAt(n+1)],o=hl[r.charCodeAt(n+2)],l=hl[r.charCodeAt(n+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|o>>2,u[i++]=(o&3)<<6|l&63;return u};var ZT=function(r){for(var e="",t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e};_i.decompressJson=function(r){return ZT(YT.default.inflate(_i.decodeFromBase64(r)))};_i.padStart=function(r,e,t){for(var n="",i=0,s=e-r.length;i<s;i++)n+=t;return n+r}});var c1=E((E4,JT)=>{JT.exports="eJyFWdtyGjkQ/RVqnnar8Bb4lpg3jEnCxgEvGDtxKg9iphm01oyILrZxKv++mrGd3az6KC8UnNa0+nrUGr5lI11VVLtskF198F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Sx1Juc0oVWMpqY295qVltmtWmWW2a1aZZbZrVplltmtWmWW2G1WZYbYbVZlhthtVmWG2G1WZYbYbVZlhtltVmWW2W1WZZbZbVZlltltVmWW2W1QYjQCh7E2aAQHeGhCFgPoNoy8KNb2wxBhmGKBxoUZXlLGsLI6AsftEDHV0wIURVbANLcTKlGGBIKPOAxCmhePCKUwFzAmpDFRQvjA9R06Hq8TONvshgKDCuRAZTXigUxjxNFfKRo3CLhnIJBMFRvMZpqpNBMlQJzGT5WFQMVQI/AikPMIhEU1aDjqJvQwmjSHB05cC9jbYwc5UtAHNLhDw41ha+lEqF4JaH3gmB61SYcqInxTDmQK8v08vjqv4zDf1N0w3Lf4A8/vwPpfK11w=="});var D1=E(ps=>{"use strict";var fr=ps&&ps.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ps,"__esModule",{value:!0});var ck=Pg(),hk=fr(c1()),fk=fr(h1()),pk=fr(f1()),gk=fr(p1()),mk=fr(g1()),vk=fr(m1()),yk=fr(v1()),bk=fr(y1()),wk=fr(b1()),xk=fr(w1()),Ak=fr(x1()),Sk=fr(A1()),Pk=fr(S1()),Fk=fr(P1()),Dk={Courier:gk.default,"Courier-Bold":hk.default,"Courier-Oblique":pk.default,"Courier-BoldOblique":fk.default,Helvetica:bk.default,"Helvetica-Bold":mk.default,"Helvetica-Oblique":yk.default,"Helvetica-BoldOblique":vk.default,"Times-Roman":Sk.default,"Times-Bold":wk.default,"Times-Italic":Ak.default,"Times-BoldItalic":xk.default,Symbol:Pk.default,ZapfDingbats:Fk.default},Ek;(function(r){r.Courier="Courier",r.CourierBold="Courier-Bold",r.CourierOblique="Courier-Oblique",r.CourierBoldOblique="Courier-BoldOblique",r.Helvetica="Helvetica",r.HelveticaBold="Helvetica-Bold",r.HelveticaOblique="Helvetica-Oblique",r.HelveticaBoldOblique="Helvetica-BoldOblique",r.TimesRoman="Times-Roman",r.TimesRomanBold="Times-Bold",r.TimesRomanItalic="Times-Italic",r.TimesRomanBoldItalic="Times-BoldItalic",r.Symbol="Symbol",r.ZapfDingbats="ZapfDingbats"})(Ek=ps.FontNames||(ps.FontNames={}));var F1={},Ck=function(){function r(){var e=this;this.getWidthOfGlyph=function(t){return e.CharWidths[t]},this.getXAxisKerningForPair=function(t,n){return(e.KernPairXAmounts[t]||{})[n]}}return r.load=function(e){var t=F1[e];if(t)return t;var n=ck.decompressJson(Dk[e]),i=Object.assign(new r,JSON.parse(n));return i.CharWidths=i.CharMetrics.reduce(function(s,a){return s[a.N]=a.WX,s},{}),i.KernPairXAmounts=i.KernPairs.reduce(function(s,a){var o=a[0],l=a[1],u=a[2];return s[o]||(s[o]={}),s[o][l]=u,s},{}),F1[e]=i,i},r}();ps.Font=Ck});var E1=E((z4,Tk)=>{Tk.exports="eJztWsuy48iN/Ret74KZfHtX47meqfGjPHaXx4/wgpJ4JbooUU1JVXXb0f9u4JwESF13R7TD29koIpFi8gCJBHDA/Pvm+nraTuPmZ3/f5HHzs7/k8WlzvXS7fvPXp02eqyR/2vRfd2N3gqhUUfm0Od9P236+DoczxLWK66fNpZ93/fkGWaOy5mnTnUR67c57lRaZSItM/tnN/XnsX/DfIqg0JOk8HI4UK4BCAFzG+xWCQgXF02Y3nU4dJJVKKrx5mPgKBVMImOvYXY+QKJRCoHzXzxMErQrap810hqaloioF1e0L5kvFUwqe23Hu+Q+1TinWeZnuMwSKrRRsL8Nn/kOxlYLtOnzFWE1Viqmu/eceVioVaylYe1OwVKilQD0PCYgiLRtVcJz4kEItW13mNLi0UsCVAB77KyxTKeJKEPff3rsREkVcCeLD3He3HqArBV0J6G/v/fU2cK1WH23l0e3c7T71N9uUVv/c5i73bWlVs1Y0u5/3srO7aQb2EPUB+eUTva0TYgG5mGbbzZSUkJTpn75ygF4PThhq1SMGMds4HYZdN54n/rdWc8rv02bfH9I2hbqGsKbPnIYzHSc0qmTIxI6nuwpiAIQmU8F4Gy7jK8RwntAI1v3wedj39FmFECp508s4zUOyGmwpKrwbL8eOIlVU//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qwaw5VJr2vB8dSFn89fvv/8H0oq1dA=="});var T1=E(fl=>{"use strict";var kk=fl&&fl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fl,"__esModule",{value:!0});var C1=Pg(),Rk=kk(E1()),_k=C1.decompressJson(Rk.default),Fg=JSON.parse(_k),Dg=function(){function r(e,t){var n=this;this.canEncodeUnicodeCodePoint=function(i){return i in n.unicodeMappings},this.encodeUnicodeCodePoint=function(i){var s=n.unicodeMappings[i];if(!s){var a=String.fromCharCode(i),o="0x"+C1.padStart(i.toString(16),4,"0"),l=n.name+' cannot encode "'+a+'" ('+o+")";throw new Error(l)}return{code:s[0],name:s[1]}},this.name=e,this.supportedCodePoints=Object.keys(t).map(Number).sort(function(i,s){return i-s}),this.unicodeMappings=t}return r}();fl.Encodings={Symbol:new Dg("Symbol",Fg.symbol),ZapfDingbats:new Dg("ZapfDingbats",Fg.zapfdingbats),WinAnsi:new Dg("WinAnsi",Fg.win1252)}});var Eg=E(ic=>{"use strict";function k1(r){for(var e in r)ic.hasOwnProperty(e)||(ic[e]=r[e])}Object.defineProperty(ic,"__esModule",{value:!0});k1(D1());k1(T1())});var Cg=E(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.rectanglesAreEqual=Hr.isStandardFont=Hr.StandardFontValues=Hr.values=void 0;var Ik=Eg();Hr.values=function(r){return Object.keys(r).map(function(e){return r[e]})};Hr.StandardFontValues=Hr.values(Ik.FontNames);Hr.isStandardFont=function(r){return Hr.StandardFontValues.includes(r)};Hr.rectanglesAreEqual=function(r,e){return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}});var _1=E(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.assertPositive=X.assertInteger=X.assertMultiple=X.assertRangeOrUndefined=X.assertRange=X.assertEachIs=X.assertOrUndefined=X.assertIs=X.createTypeErrorMsg=X.isType=X.getType=X.assertIsSubset=X.assertIsOneOfOrUndefined=X.assertIsOneOf=X.createValueErrorMsg=X.singleQuote=X.backtick=void 0;var Tg=Cg();X.backtick=function(r){return"`"+r+"`"};X.singleQuote=function(r){return"'"+r+"'"};var R1=function(r){var e=typeof r;return e==="string"?X.singleQuote(r):e==="undefined"?X.backtick(r):r};X.createValueErrorMsg=function(r,e,t){for(var n=new Array(t.length),i=0,s=t.length;i<s;i++){var a=t[i];n[i]=R1(a)}var o=n.join(" or ");return X.backtick(e)+" must be one of "+o+", but was actually "+R1(r)};X.assertIsOneOf=function(r,e,t){Array.isArray(t)||(t=Tg.values(t));for(var n=0,i=t.length;n<i;n++)if(r===t[n])return;throw new TypeError(X.createValueErrorMsg(r,e,t))};X.assertIsOneOfOrUndefined=function(r,e,t){Array.isArray(t)||(t=Tg.values(t)),X.assertIsOneOf(r,e,t.concat(void 0))};X.assertIsSubset=function(r,e,t){Array.isArray(t)||(t=Tg.values(t));for(var n=0,i=r.length;n<i;n++)X.assertIsOneOf(r[n],e,t)};X.getType=function(r){return r===null?"null":r===void 0?"undefined":typeof r=="string"?"string":isNaN(r)?"NaN":typeof r=="number"?"number":typeof r=="boolean"?"boolean":typeof r=="symbol"?"symbol":typeof r=="bigint"?"bigint":r.constructor&&r.constructor.name?r.constructor.name:r.name?r.name:r.constructor?String(r.constructor):String(r)};X.isType=function(r,e){return e==="null"?r===null:e==="undefined"?r===void 0:e==="string"?typeof r=="string":e==="number"?typeof r=="number"&&!isNaN(r):e==="boolean"?typeof r=="boolean":e==="symbol"?typeof r=="symbol":e==="bigint"?typeof r=="bigint":e===Date?r instanceof Date:e===Array?r instanceof Array:e===Uint8Array?r instanceof Uint8Array:e===ArrayBuffer?r instanceof ArrayBuffer:e===Function?r instanceof Function:r instanceof e[0]};X.createTypeErrorMsg=function(r,e,t){for(var n=new Array(t.length),i=0,s=t.length;i<s;i++){var a=t[i];a==="null"&&(n[i]=X.backtick("null")),a==="undefined"&&(n[i]=X.backtick("undefined")),a==="string"?n[i]=X.backtick("string"):a==="number"?n[i]=X.backtick("number"):a==="boolean"?n[i]=X.backtick("boolean"):a==="symbol"?n[i]=X.backtick("symbol"):a==="bigint"?n[i]=X.backtick("bigint"):a===Array?n[i]=X.backtick("Array"):a===Uint8Array?n[i]=X.backtick("Uint8Array"):a===ArrayBuffer?n[i]=X.backtick("ArrayBuffer"):n[i]=X.backtick(a[1])}var o=n.join(" or ");return X.backtick(e)+" must be of type "+o+", but was actually of type "+X.backtick(X.getType(r))};X.assertIs=function(r,e,t){for(var n=0,i=t.length;n<i;n++)if(X.isType(r,t[n]))return;throw new TypeError(X.createTypeErrorMsg(r,e,t))};X.assertOrUndefined=function(r,e,t){X.assertIs(r,e,t.concat("undefined"))};X.assertEachIs=function(r,e,t){for(var n=0,i=r.length;n<i;n++)X.assertIs(r[n],e,t)};X.assertRange=function(r,e,t,n){if(X.assertIs(r,e,["number"]),X.assertIs(t,"min",["number"]),X.assertIs(n,"max",["number"]),n=Math.max(t,n),r<t||r>n)throw new Error(X.backtick(e)+" must be at least "+t+" and at most "+n+", but was actually "+r)};X.assertRangeOrUndefined=function(r,e,t,n){X.assertIs(r,e,["number","undefined"]),typeof r=="number"&&X.assertRange(r,e,t,n)};X.assertMultiple=function(r,e,t){if(X.assertIs(r,e,["number"]),r%t!==0)throw new Error(X.backtick(e)+" must be a multiple of "+t+", but was actually "+r)};X.assertInteger=function(r,e){if(!Number.isInteger(r))throw new Error(X.backtick(e)+" must be an integer, but was actually "+r)};X.assertPositive=function(r,e){if(![1,0].includes(Math.sign(r)))throw new Error(X.backtick(e)+" must be a positive number or 0, but was actually "+r)}});var I1=E(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.pdfDocEncodingDecode=void 0;var me=Wo(),ce=new Uint16Array(256);for(pl=0;pl<256;pl++)ce[pl]=pl;var pl;ce[22]=me.toCharCode("");ce[24]=me.toCharCode("\u02D8");ce[25]=me.toCharCode("\u02C7");ce[26]=me.toCharCode("\u02C6");ce[27]=me.toCharCode("\u02D9");ce[28]=me.toCharCode("\u02DD");ce[29]=me.toCharCode("\u02DB");ce[30]=me.toCharCode("\u02DA");ce[31]=me.toCharCode("\u02DC");ce[127]=me.toCharCode("\uFFFD");ce[128]=me.toCharCode("\u2022");ce[129]=me.toCharCode("\u2020");ce[130]=me.toCharCode("\u2021");ce[131]=me.toCharCode("\u2026");ce[132]=me.toCharCode("\u2014");ce[133]=me.toCharCode("\u2013");ce[134]=me.toCharCode("\u0192");ce[135]=me.toCharCode("\u2044");ce[136]=me.toCharCode("\u2039");ce[137]=me.toCharCode("\u203A");ce[138]=me.toCharCode("\u2212");ce[139]=me.toCharCode("\u2030");ce[140]=me.toCharCode("\u201E");ce[141]=me.toCharCode("\u201C");ce[142]=me.toCharCode("\u201D");ce[143]=me.toCharCode("\u2018");ce[144]=me.toCharCode("\u2019");ce[145]=me.toCharCode("\u201A");ce[146]=me.toCharCode("\u2122");ce[147]=me.toCharCode("\uFB01");ce[148]=me.toCharCode("\uFB02");ce[149]=me.toCharCode("\u0141");ce[150]=me.toCharCode("\u0152");ce[151]=me.toCharCode("\u0160");ce[152]=me.toCharCode("\u0178");ce[153]=me.toCharCode("\u017D");ce[154]=me.toCharCode("\u0131");ce[155]=me.toCharCode("\u0142");ce[156]=me.toCharCode("\u0153");ce[157]=me.toCharCode("\u0161");ce[158]=me.toCharCode("\u017E");ce[159]=me.toCharCode("\uFFFD");ce[160]=me.toCharCode("\u20AC");ce[173]=me.toCharCode("\uFFFD");sc.pdfDocEncodingDecode=function(r){for(var e=new Array(r.length),t=0,n=r.length;t<n;t++)e[t]=ce[r[t]];return String.fromCodePoint.apply(String,e)}});var O1=E(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});var Ok=function(){function r(e){this.populate=e,this.value=void 0}return r.prototype.getValue=function(){return this.value},r.prototype.access=function(){return this.value||(this.value=this.populate()),this.value},r.prototype.invalidate=function(){this.value=void 0},r.populatedBy=function(e){return new r(e)},r}();kg.default=Ok});var ae=E(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});var En=(j(),U(L));En.__exportStar(gw(),kr);En.__exportStar(mw(),kr);En.__exportStar(Wo(),kr);En.__exportStar(Vp(),kr);En.__exportStar(Aw(),kr);En.__exportStar(Sw(),kr);En.__exportStar(zp(),kr);En.__exportStar(Cg(),kr);En.__exportStar(_1(),kr);En.__exportStar(I1(),kr);var Mk=O1();Object.defineProperty(kr,"Cache",{enumerable:!0,get:function(){return Mk.default}})});var ze=E($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.MissingKeywordError=$.MissingPDFHeaderError=$.StalledParserError=$.UnbalancedParenthesisError=$.PDFStreamParsingError=$.PDFInvalidObjectParsingError=$.PDFObjectParsingError=$.NextByteAssertionError=$.PDFParsingError=$.NumberParsingError=$.MissingTfOperatorError=$.MissingDAEntryError=$.MultiSelectValueError=$.InvalidAcroFieldValueError=$.IndexOutOfBoundsError=$.CorruptPageTreeError=$.InvalidTargetIndexError=$.InvalidPDFDateStringError=$.PDFArrayIsNotRectangleError=$.PageEmbeddingMismatchedContextError=$.UnrecognizedStreamTypeError=$.MissingPageContentsEmbeddingError=$.MissingCatalogError=$.ReparseError=$.UnsupportedEncodingError=$.UnexpectedObjectTypeError=$.PrivateConstructorError=$.MethodNotImplementedError=void 0;var qe=(j(),U(L)),Nk=ae(),Lk=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Method "+t+"."+n+"() not implemented";return i=r.call(this,s)||this,i}return e}(Error);$.MethodNotImplementedError=Lk;var jk=function(r){qe.__extends(e,r);function e(t){var n=this,i="Cannot construct "+t+" - it has a private constructor";return n=r.call(this,i)||this,n}return e}(Error);$.PrivateConstructorError=jk;var Bk=function(r){qe.__extends(e,r);function e(t,n){var i=this,s=function(l){var u,d;return(u=l?.name)!==null&&u!==void 0?u:(d=l?.constructor)===null||d===void 0?void 0:d.name},a=Array.isArray(t)?t.map(s):[s(t)],o="Expected instance of "+a.join(" or ")+", "+("but got instance of "+(n&&s(n)));return i=r.call(this,o)||this,i}return e}(Error);$.UnexpectedObjectTypeError=Bk;var Uk=function(r){qe.__extends(e,r);function e(t){var n=this,i=t+" stream encoding not supported";return n=r.call(this,i)||this,n}return e}(Error);$.UnsupportedEncodingError=Uk;var qk=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Cannot call "+t+"."+n+"() more than once";return i=r.call(this,s)||this,i}return e}(Error);$.ReparseError=qk;var zk=function(r){qe.__extends(e,r);function e(t){var n=this,i="Missing catalog (ref="+t+")";return n=r.call(this,i)||this,n}return e}(Error);$.MissingCatalogError=zk;var Vk=function(r){qe.__extends(e,r);function e(){var t=this,n="Can't embed page with missing Contents";return t=r.call(this,n)||this,t}return e}(Error);$.MissingPageContentsEmbeddingError=Vk;var Hk=function(r){qe.__extends(e,r);function e(t){var n,i,s,a=this,o=(s=(i=(n=t?.contructor)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:t?.name)!==null&&s!==void 0?s:t,l="Unrecognized stream type: "+o;return a=r.call(this,l)||this,a}return e}(Error);$.UnrecognizedStreamTypeError=Hk;var Gk=function(r){qe.__extends(e,r);function e(){var t=this,n="Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.";return t=r.call(this,n)||this,t}return e}(Error);$.PageEmbeddingMismatchedContextError=Gk;var Wk=function(r){qe.__extends(e,r);function e(t){var n=this,i="Attempted to convert PDFArray with "+t+" elements to rectangle, but must have exactly 4 elements.";return n=r.call(this,i)||this,n}return e}(Error);$.PDFArrayIsNotRectangleError=Wk;var Kk=function(r){qe.__extends(e,r);function e(t){var n=this,i='Attempted to convert "'+t+'" to a date, but it does not match the PDF date string format.';return n=r.call(this,i)||this,n}return e}(Error);$.InvalidPDFDateStringError=Kk;var Xk=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Invalid targetIndex specified: targetIndex="+t+" must be less than Count="+n;return i=r.call(this,s)||this,i}return e}(Error);$.InvalidTargetIndexError=Xk;var Yk=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Failed to "+n+" at targetIndex="+t+" due to corrupt page tree: It is likely that one or more 'Count' entries are invalid";return i=r.call(this,s)||this,i}return e}(Error);$.CorruptPageTreeError=Yk;var Zk=function(r){qe.__extends(e,r);function e(t,n,i){var s=this,a="index should be at least "+n+" and at most "+i+", but was actually "+t;return s=r.call(this,a)||this,s}return e}(Error);$.IndexOutOfBoundsError=Zk;var Jk=function(r){qe.__extends(e,r);function e(){var t=this,n="Attempted to set invalid field value";return t=r.call(this,n)||this,t}return e}(Error);$.InvalidAcroFieldValueError=Jk;var Qk=function(r){qe.__extends(e,r);function e(){var t=this,n="Attempted to select multiple values for single-select field";return t=r.call(this,n)||this,t}return e}(Error);$.MultiSelectValueError=Qk;var $k=function(r){qe.__extends(e,r);function e(t){var n=this,i="No /DA (default appearance) entry found for field: "+t;return n=r.call(this,i)||this,n}return e}(Error);$.MissingDAEntryError=$k;var eR=function(r){qe.__extends(e,r);function e(t){var n=this,i="No Tf operator found for DA of field: "+t;return n=r.call(this,i)||this,n}return e}(Error);$.MissingTfOperatorError=eR;var tR=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Failed to parse number "+("(line:"+t.line+" col:"+t.column+" offset="+t.offset+'): "'+n+'"');return i=r.call(this,s)||this,i}return e}(Error);$.NumberParsingError=tR;var ei=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Failed to parse PDF document "+("(line:"+t.line+" col:"+t.column+" offset="+t.offset+"): "+n);return i=r.call(this,s)||this,i}return e}(Error);$.PDFParsingError=ei;var rR=function(r){qe.__extends(e,r);function e(t,n,i){var s=this,a="Expected next byte to be "+n+" but it was actually "+i;return s=r.call(this,t,a)||this,s}return e}(ei);$.NextByteAssertionError=rR;var nR=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Failed to parse PDF object starting with the following byte: "+n;return i=r.call(this,t,s)||this,i}return e}(ei);$.PDFObjectParsingError=nR;var iR=function(r){qe.__extends(e,r);function e(t){var n=this,i="Failed to parse invalid PDF object";return n=r.call(this,t,i)||this,n}return e}(ei);$.PDFInvalidObjectParsingError=iR;var sR=function(r){qe.__extends(e,r);function e(t){var n=this,i="Failed to parse PDF stream";return n=r.call(this,t,i)||this,n}return e}(ei);$.PDFStreamParsingError=sR;var aR=function(r){qe.__extends(e,r);function e(t){var n=this,i="Failed to parse PDF literal string due to unbalanced parenthesis";return n=r.call(this,t,i)||this,n}return e}(ei);$.UnbalancedParenthesisError=aR;var oR=function(r){qe.__extends(e,r);function e(t){var n=this,i="Parser stalled";return n=r.call(this,t,i)||this,n}return e}(ei);$.StalledParserError=oR;var lR=function(r){qe.__extends(e,r);function e(t){var n=this,i="No PDF header found";return n=r.call(this,t,i)||this,n}return e}(ei);$.MissingPDFHeaderError=lR;var uR=function(r){qe.__extends(e,r);function e(t,n){var i=this,s="Did not find expected keyword '"+Nk.arrayAsString(n)+"'";return i=r.call(this,t,s)||this,i}return e}(ei);$.MissingKeywordError=uR});var Ve=E(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});var Rg;(function(r){r[r.Null=0]="Null",r[r.Backspace=8]="Backspace",r[r.Tab=9]="Tab",r[r.Newline=10]="Newline",r[r.FormFeed=12]="FormFeed",r[r.CarriageReturn=13]="CarriageReturn",r[r.Space=32]="Space",r[r.ExclamationPoint=33]="ExclamationPoint",r[r.Hash=35]="Hash",r[r.Percent=37]="Percent",r[r.LeftParen=40]="LeftParen",r[r.RightParen=41]="RightParen",r[r.Plus=43]="Plus",r[r.Minus=45]="Minus",r[r.Dash=45]="Dash",r[r.Period=46]="Period",r[r.ForwardSlash=47]="ForwardSlash",r[r.Zero=48]="Zero",r[r.One=49]="One",r[r.Two=50]="Two",r[r.Three=51]="Three",r[r.Four=52]="Four",r[r.Five=53]="Five",r[r.Six=54]="Six",r[r.Seven=55]="Seven",r[r.Eight=56]="Eight",r[r.Nine=57]="Nine",r[r.LessThan=60]="LessThan",r[r.GreaterThan=62]="GreaterThan",r[r.A=65]="A",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.O=79]="O",r[r.P=80]="P",r[r.R=82]="R",r[r.LeftSquareBracket=91]="LeftSquareBracket",r[r.BackSlash=92]="BackSlash",r[r.RightSquareBracket=93]="RightSquareBracket",r[r.a=97]="a",r[r.b=98]="b",r[r.d=100]="d",r[r.e=101]="e",r[r.f=102]="f",r[r.i=105]="i",r[r.j=106]="j",r[r.l=108]="l",r[r.m=109]="m",r[r.n=110]="n",r[r.o=111]="o",r[r.r=114]="r",r[r.s=115]="s",r[r.t=116]="t",r[r.u=117]="u",r[r.x=120]="x",r[r.LeftCurly=123]="LeftCurly",r[r.RightCurly=125]="RightCurly",r[r.Tilde=126]="Tilde"})(Rg||(Rg={}));_g.default=Rg});var Sa=E(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});var dR=(j(),U(L)),Ii=dR.__importDefault(Ve()),Ig=ae(),cR=function(){function r(e,t){this.major=String(e),this.minor=String(t)}return r.prototype.toString=function(){var e=Ig.charFromCode(129);return"%PDF-"+this.major+"."+this.minor+`
|
|
20
|
+
%`+e+e+e+e},r.prototype.sizeInBytes=function(){return 12+this.major.length+this.minor.length},r.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Ii.default.Percent,e[t++]=Ii.default.P,e[t++]=Ii.default.D,e[t++]=Ii.default.F,e[t++]=Ii.default.Dash,t+=Ig.copyStringIntoBuffer(this.major,e,t),e[t++]=Ii.default.Period,t+=Ig.copyStringIntoBuffer(this.minor,e,t),e[t++]=Ii.default.Newline,e[t++]=Ii.default.Percent,e[t++]=129,e[t++]=129,e[t++]=129,e[t++]=129,t-n},r.forVersion=function(e,t){return new r(e,t)},r}();Og.default=cR});var ir=E(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});var ac=ze(),hR=function(){function r(){}return r.prototype.clone=function(e){throw new ac.MethodNotImplementedError(this.constructor.name,"clone")},r.prototype.toString=function(){throw new ac.MethodNotImplementedError(this.constructor.name,"toString")},r.prototype.sizeInBytes=function(){throw new ac.MethodNotImplementedError(this.constructor.name,"sizeInBytes")},r.prototype.copyBytesInto=function(e,t){throw new ac.MethodNotImplementedError(this.constructor.name,"copyBytesInto")},r}();Mg.default=hR});var gt=E(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});var N1=(j(),U(L)),M1=ae(),fR=N1.__importDefault(ir()),pR=function(r){N1.__extends(e,r);function e(t){var n=r.call(this)||this;return n.numberValue=t,n.stringValue=M1.numberToString(t),n}return e.prototype.asNumber=function(){return this.numberValue},e.prototype.value=function(){return this.numberValue},e.prototype.clone=function(){return e.of(this.numberValue)},e.prototype.toString=function(){return this.stringValue},e.prototype.sizeInBytes=function(){return this.stringValue.length},e.prototype.copyBytesInto=function(t,n){return n+=M1.copyStringIntoBuffer(this.stringValue,t,n),this.stringValue.length},e.of=function(t){return new e(t)},e}(fR.default);Ng.default=pR});var Ut=E(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var Fa=(j(),U(L)),Pa=Fa.__importDefault(gt()),gR=Fa.__importDefault(ir()),oc=Fa.__importDefault(Ve()),mR=ze(),vR=function(r){Fa.__extends(e,r);function e(t){var n=r.call(this)||this;return n.array=[],n.context=t,n}return e.prototype.size=function(){return this.array.length},e.prototype.push=function(t){this.array.push(t)},e.prototype.insert=function(t,n){this.array.splice(t,0,n)},e.prototype.indexOf=function(t){var n=this.array.indexOf(t);return n===-1?void 0:n},e.prototype.remove=function(t){this.array.splice(t,1)},e.prototype.set=function(t,n){this.array[t]=n},e.prototype.get=function(t){return this.array[t]},e.prototype.lookupMaybe=function(t){for(var n,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return(n=this.context).lookupMaybe.apply(n,Fa.__spreadArrays([this.get(t)],i))},e.prototype.lookup=function(t){for(var n,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return(n=this.context).lookup.apply(n,Fa.__spreadArrays([this.get(t)],i))},e.prototype.asRectangle=function(){if(this.size()!==4)throw new mR.PDFArrayIsNotRectangleError(this.size());var t=this.lookup(0,Pa.default).asNumber(),n=this.lookup(1,Pa.default).asNumber(),i=this.lookup(2,Pa.default).asNumber(),s=this.lookup(3,Pa.default).asNumber(),a=t,o=n,l=i-t,u=s-n;return{x:a,y:o,width:l,height:u}},e.prototype.asArray=function(){return this.array.slice()},e.prototype.clone=function(t){for(var n=e.withContext(t||this.context),i=0,s=this.size();i<s;i++)n.push(this.array[i]);return n},e.prototype.toString=function(){for(var t="[ ",n=0,i=this.size();n<i;n++)t+=this.get(n).toString(),t+=" ";return t+="]",t},e.prototype.sizeInBytes=function(){for(var t=3,n=0,i=this.size();n<i;n++)t+=this.get(n).sizeInBytes()+1;return t},e.prototype.copyBytesInto=function(t,n){var i=n;t[n++]=oc.default.LeftSquareBracket,t[n++]=oc.default.Space;for(var s=0,a=this.size();s<a;s++)n+=this.get(s).copyBytesInto(t,n),t[n++]=oc.default.Space;return t[n++]=oc.default.RightSquareBracket,n-i},e.prototype.scalePDFNumbers=function(t,n){for(var i=0,s=this.size();i<s;i++){var a=this.lookup(i);if(a instanceof Pa.default){var o=i%2===0?t:n;this.set(i,Pa.default.of(a.asNumber()*o))}}},e.withContext=function(t){return new e(t)},e}(gR.default);Lg.default=vR});var gl=E(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});var Bg=(j(),U(L)),yR=ze(),bR=Bg.__importDefault(ir()),ti=Bg.__importDefault(Ve()),jg={},wR=function(r){Bg.__extends(e,r);function e(t,n){var i=this;if(t!==jg)throw new yR.PrivateConstructorError("PDFBool");return i=r.call(this)||this,i.value=n,i}return e.prototype.asBoolean=function(){return this.value},e.prototype.clone=function(){return this},e.prototype.toString=function(){return String(this.value)},e.prototype.sizeInBytes=function(){return this.value?4:5},e.prototype.copyBytesInto=function(t,n){return this.value?(t[n++]=ti.default.t,t[n++]=ti.default.r,t[n++]=ti.default.u,t[n++]=ti.default.e,4):(t[n++]=ti.default.f,t[n++]=ti.default.a,t[n++]=ti.default.l,t[n++]=ti.default.s,t[n++]=ti.default.e,5)},e.True=new e(jg,!0),e.False=new e(jg,!1),e}(bR.default);Ug.default=wR});var qg=E(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.IsDelimiter=void 0;var xR=(j(),U(L)),Cn=xR.__importDefault(Ve());pr.IsDelimiter=new Uint8Array(256);pr.IsDelimiter[Cn.default.LeftParen]=1;pr.IsDelimiter[Cn.default.RightParen]=1;pr.IsDelimiter[Cn.default.LessThan]=1;pr.IsDelimiter[Cn.default.GreaterThan]=1;pr.IsDelimiter[Cn.default.LeftSquareBracket]=1;pr.IsDelimiter[Cn.default.RightSquareBracket]=1;pr.IsDelimiter[Cn.default.LeftCurly]=1;pr.IsDelimiter[Cn.default.RightCurly]=1;pr.IsDelimiter[Cn.default.ForwardSlash]=1;pr.IsDelimiter[Cn.default.Percent]=1});var lc=E(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.IsWhitespace=void 0;var AR=(j(),U(L)),Da=AR.__importDefault(Ve());Tn.IsWhitespace=new Uint8Array(256);Tn.IsWhitespace[Da.default.Null]=1;Tn.IsWhitespace[Da.default.Tab]=1;Tn.IsWhitespace[Da.default.Newline]=1;Tn.IsWhitespace[Da.default.FormFeed]=1;Tn.IsWhitespace[Da.default.CarriageReturn]=1;Tn.IsWhitespace[Da.default.Space]=1});var j1=E(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.IsIrregular=void 0;var SR=(j(),U(L)),PR=SR.__importDefault(Ve()),FR=qg(),DR=lc();Ca.IsIrregular=new Uint8Array(256);for(Ea=0,L1=256;Ea<L1;Ea++)Ca.IsIrregular[Ea]=DR.IsWhitespace[Ea]||FR.IsDelimiter[Ea]?1:0;var Ea,L1;Ca.IsIrregular[PR.default.Hash]=1});var Ce=E(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var zg=(j(),U(L)),ER=ze(),CR=zg.__importDefault(ir()),ri=zg.__importDefault(Ve()),TR=j1(),ml=ae(),kR=function(r){return r.replace(/#([\dABCDEF]{2})/g,function(e,t){return ml.charFromHexCode(t)})},RR=function(r){return r>=ri.default.ExclamationPoint&&r<=ri.default.Tilde&&!TR.IsIrregular[r]},B1={},U1=new Map,_R=function(r){zg.__extends(e,r);function e(t,n){var i=this;if(t!==B1)throw new ER.PrivateConstructorError("PDFName");i=r.call(this)||this;for(var s="/",a=0,o=n.length;a<o;a++){var l=n[a],u=ml.toCharCode(l);s+=RR(u)?l:"#"+ml.toHexString(u)}return i.encodedName=s,i}return e.prototype.asBytes=function(){for(var t=[],n="",i=!1,s=function(c){c!==void 0&&t.push(c),i=!1},a=1,o=this.encodedName.length;a<o;a++){var l=this.encodedName[a],u=ml.toCharCode(l),d=this.encodedName[a+1];i?u>=ri.default.Zero&&u<=ri.default.Nine||u>=ri.default.a&&u<=ri.default.f||u>=ri.default.A&&u<=ri.default.F?(n+=l,(n.length===2||!(d>="0"&&d<="9"||d>="a"&&d<="f"||d>="A"&&d<="F"))&&(s(parseInt(n,16)),n="")):s(u):u===ri.default.Hash?i=!0:s(u)}return new Uint8Array(t)},e.prototype.decodeText=function(){var t=this.asBytes();return String.fromCharCode.apply(String,Array.from(t))},e.prototype.asString=function(){return this.encodedName},e.prototype.value=function(){return this.encodedName},e.prototype.clone=function(){return this},e.prototype.toString=function(){return this.encodedName},e.prototype.sizeInBytes=function(){return this.encodedName.length},e.prototype.copyBytesInto=function(t,n){return n+=ml.copyStringIntoBuffer(this.encodedName,t,n),this.encodedName.length},e.of=function(t){var n=kR(t),i=U1.get(n);return i||(i=new e(B1,n),U1.set(n,i)),i},e.Length=e.of("Length"),e.FlateDecode=e.of("FlateDecode"),e.Resources=e.of("Resources"),e.Font=e.of("Font"),e.XObject=e.of("XObject"),e.ExtGState=e.of("ExtGState"),e.Contents=e.of("Contents"),e.Type=e.of("Type"),e.Parent=e.of("Parent"),e.MediaBox=e.of("MediaBox"),e.Page=e.of("Page"),e.Annots=e.of("Annots"),e.TrimBox=e.of("TrimBox"),e.ArtBox=e.of("ArtBox"),e.BleedBox=e.of("BleedBox"),e.CropBox=e.of("CropBox"),e.Rotate=e.of("Rotate"),e.Title=e.of("Title"),e.Author=e.of("Author"),e.Subject=e.of("Subject"),e.Creator=e.of("Creator"),e.Keywords=e.of("Keywords"),e.Producer=e.of("Producer"),e.CreationDate=e.of("CreationDate"),e.ModDate=e.of("ModDate"),e}(CR.default);Vg.default=_R});var vl=E(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});var Hg=(j(),U(L)),IR=Hg.__importDefault(ir()),uc=Hg.__importDefault(Ve()),OR=function(r){Hg.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.asNull=function(){return null},e.prototype.clone=function(){return this},e.prototype.toString=function(){return"null"},e.prototype.sizeInBytes=function(){return 4},e.prototype.copyBytesInto=function(t,n){return t[n++]=uc.default.n,t[n++]=uc.default.u,t[n++]=uc.default.l,t[n++]=uc.default.l,4},e}(IR.default);Gg.default=new OR});var Yt=E(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});var ms=(j(),U(L)),q1=ms.__importDefault(Ce()),Ta=ms.__importDefault(vl()),MR=ms.__importDefault(ir()),gs=ms.__importDefault(Ve()),NR=function(r){ms.__extends(e,r);function e(t,n){var i=r.call(this)||this;return i.dict=t,i.context=n,i}return e.prototype.keys=function(){return Array.from(this.dict.keys())},e.prototype.values=function(){return Array.from(this.dict.values())},e.prototype.entries=function(){return Array.from(this.dict.entries())},e.prototype.set=function(t,n){this.dict.set(t,n)},e.prototype.get=function(t,n){n===void 0&&(n=!1);var i=this.dict.get(t);if(!(i===Ta.default&&!n))return i},e.prototype.has=function(t){var n=this.dict.get(t);return n!==void 0&&n!==Ta.default},e.prototype.lookupMaybe=function(t){for(var n,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var a=i.includes(Ta.default),o=(n=this.context).lookupMaybe.apply(n,ms.__spreadArrays([this.get(t,a)],i));if(!(o===Ta.default&&!a))return o},e.prototype.lookup=function(t){for(var n,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var a=i.includes(Ta.default),o=(n=this.context).lookup.apply(n,ms.__spreadArrays([this.get(t,a)],i));if(!(o===Ta.default&&!a))return o},e.prototype.delete=function(t){return this.dict.delete(t)},e.prototype.asMap=function(){return new Map(this.dict)},e.prototype.uniqueKey=function(t){t===void 0&&(t="");for(var n=this.keys(),i=q1.default.of(this.context.addRandomSuffix(t,10));n.includes(i);)i=q1.default.of(this.context.addRandomSuffix(t,10));return i},e.prototype.clone=function(t){for(var n=e.withContext(t||this.context),i=this.entries(),s=0,a=i.length;s<a;s++){var o=i[s],l=o[0],u=o[1];n.set(l,u)}return n},e.prototype.toString=function(){for(var t=`<<
|
|
21
|
+
`,n=this.entries(),i=0,s=n.length;i<s;i++){var a=n[i],o=a[0],l=a[1];t+=o.toString()+" "+l.toString()+`
|
|
22
|
+
`}return t+=">>",t},e.prototype.sizeInBytes=function(){for(var t=5,n=this.entries(),i=0,s=n.length;i<s;i++){var a=n[i],o=a[0],l=a[1];t+=o.sizeInBytes()+l.sizeInBytes()+2}return t},e.prototype.copyBytesInto=function(t,n){var i=n;t[n++]=gs.default.LessThan,t[n++]=gs.default.LessThan,t[n++]=gs.default.Newline;for(var s=this.entries(),a=0,o=s.length;a<o;a++){var l=s[a],u=l[0],d=l[1];n+=u.copyBytesInto(t,n),t[n++]=gs.default.Space,n+=d.copyBytesInto(t,n),t[n++]=gs.default.Newline}return t[n++]=gs.default.GreaterThan,t[n++]=gs.default.GreaterThan,n-i},e.withContext=function(t){return new e(new Map,t)},e.fromMapWithContext=function(t,n){return new e(t,n)},e}(MR.default);Wg.default=NR});var ni=E(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});var yl=(j(),U(L)),dc=ze(),LR=yl.__importDefault(Ce()),jR=yl.__importDefault(gt()),BR=yl.__importDefault(ir()),_t=yl.__importDefault(Ve()),UR=function(r){yl.__extends(e,r);function e(t){var n=r.call(this)||this;return n.dict=t,n}return e.prototype.clone=function(t){throw new dc.MethodNotImplementedError(this.constructor.name,"clone")},e.prototype.getContentsString=function(){throw new dc.MethodNotImplementedError(this.constructor.name,"getContentsString")},e.prototype.getContents=function(){throw new dc.MethodNotImplementedError(this.constructor.name,"getContents")},e.prototype.getContentsSize=function(){throw new dc.MethodNotImplementedError(this.constructor.name,"getContentsSize")},e.prototype.updateDict=function(){var t=this.getContentsSize();this.dict.set(LR.default.Length,jR.default.of(t))},e.prototype.sizeInBytes=function(){return this.updateDict(),this.dict.sizeInBytes()+this.getContentsSize()+18},e.prototype.toString=function(){this.updateDict();var t=this.dict.toString();return t+=`
|
|
23
|
+
stream
|
|
24
|
+
`,t+=this.getContentsString(),t+=`
|
|
25
|
+
endstream`,t},e.prototype.copyBytesInto=function(t,n){this.updateDict();var i=n;n+=this.dict.copyBytesInto(t,n),t[n++]=_t.default.Newline,t[n++]=_t.default.s,t[n++]=_t.default.t,t[n++]=_t.default.r,t[n++]=_t.default.e,t[n++]=_t.default.a,t[n++]=_t.default.m,t[n++]=_t.default.Newline;for(var s=this.getContents(),a=0,o=s.length;a<o;a++)t[n++]=s[a];return t[n++]=_t.default.Newline,t[n++]=_t.default.e,t[n++]=_t.default.n,t[n++]=_t.default.d,t[n++]=_t.default.s,t[n++]=_t.default.t,t[n++]=_t.default.r,t[n++]=_t.default.e,t[n++]=_t.default.a,t[n++]=_t.default.m,n-i},e}(BR.default);Kg.default=UR});var ka=E(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});var z1=(j(),U(L)),qR=z1.__importDefault(ni()),zR=ae(),VR=function(r){z1.__extends(e,r);function e(t,n){var i=r.call(this,t)||this;return i.contents=n,i}return e.prototype.asUint8Array=function(){return this.contents.slice()},e.prototype.clone=function(t){return e.of(this.dict.clone(t),this.contents.slice())},e.prototype.getContentsString=function(){return zR.arrayAsString(this.contents)},e.prototype.getContents=function(){return this.contents},e.prototype.getContentsSize=function(){return this.contents.length},e.of=function(t,n){return new e(t,n)},e}(qR.default);Xg.default=VR});var sr=E(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});var G1=(j(),U(L)),HR=ze(),GR=G1.__importDefault(ir()),WR=ae(),V1={},H1=new Map,KR=function(r){G1.__extends(e,r);function e(t,n,i){var s=this;if(t!==V1)throw new HR.PrivateConstructorError("PDFRef");return s=r.call(this)||this,s.objectNumber=n,s.generationNumber=i,s.tag=n+" "+i+" R",s}return e.prototype.clone=function(){return this},e.prototype.toString=function(){return this.tag},e.prototype.sizeInBytes=function(){return this.tag.length},e.prototype.copyBytesInto=function(t,n){return n+=WR.copyStringIntoBuffer(this.tag,t,n),this.tag.length},e.of=function(t,n){n===void 0&&(n=0);var i=t+" "+n+" R",s=H1.get(i);return s||(s=new e(V1,t,n),H1.set(i,s)),s},e}(GR.default);Yg.default=KR});var Qg=E(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});var K1=(j(),U(L)),Zg=K1.__importDefault(ir()),XR=K1.__importDefault(Ve()),W1=ae(),YR=function(){function r(e,t){this.name=e,this.args=t||[]}return r.prototype.clone=function(e){for(var t=new Array(this.args.length),n=0,i=t.length;n<i;n++){var s=this.args[n];t[n]=s instanceof Zg.default?s.clone(e):s}return r.of(this.name,t)},r.prototype.toString=function(){for(var e="",t=0,n=this.args.length;t<n;t++)e+=String(this.args[t])+" ";return e+=this.name,e},r.prototype.sizeInBytes=function(){for(var e=0,t=0,n=this.args.length;t<n;t++){var i=this.args[t];e+=(i instanceof Zg.default?i.sizeInBytes():i.length)+1}return e+=this.name.length,e},r.prototype.copyBytesInto=function(e,t){for(var n=t,i=0,s=this.args.length;i<s;i++){var a=this.args[i];a instanceof Zg.default?t+=a.copyBytesInto(e,t):t+=W1.copyStringIntoBuffer(a,e,t),e[t++]=XR.default.Space}return t+=W1.copyStringIntoBuffer(this.name,e,t),t-n},r.of=function(e,t){return new r(e,t)},r}();Jg.default=YR});var tm=E(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var $g;(function(r){r.NonStrokingColor="sc",r.NonStrokingColorN="scn",r.NonStrokingColorRgb="rg",r.NonStrokingColorGray="g",r.NonStrokingColorCmyk="k",r.NonStrokingColorspace="cs",r.StrokingColor="SC",r.StrokingColorN="SCN",r.StrokingColorRgb="RG",r.StrokingColorGray="G",r.StrokingColorCmyk="K",r.StrokingColorspace="CS",r.BeginMarkedContentSequence="BDC",r.BeginMarkedContent="BMC",r.EndMarkedContent="EMC",r.MarkedContentPointWithProps="DP",r.MarkedContentPoint="MP",r.DrawObject="Do",r.ConcatTransformationMatrix="cm",r.PopGraphicsState="Q",r.PushGraphicsState="q",r.SetFlatness="i",r.SetGraphicsStateParams="gs",r.SetLineCapStyle="J",r.SetLineDashPattern="d",r.SetLineJoinStyle="j",r.SetLineMiterLimit="M",r.SetLineWidth="w",r.SetTextMatrix="Tm",r.SetRenderingIntent="ri",r.AppendRectangle="re",r.BeginInlineImage="BI",r.BeginInlineImageData="ID",r.EndInlineImage="EI",r.ClipEvenOdd="W*",r.ClipNonZero="W",r.CloseAndStroke="s",r.CloseFillEvenOddAndStroke="b*",r.CloseFillNonZeroAndStroke="b",r.ClosePath="h",r.AppendBezierCurve="c",r.CurveToReplicateFinalPoint="y",r.CurveToReplicateInitialPoint="v",r.EndPath="n",r.FillEvenOddAndStroke="B*",r.FillEvenOdd="f*",r.FillNonZeroAndStroke="B",r.FillNonZero="f",r.LegacyFillNonZero="F",r.LineTo="l",r.MoveTo="m",r.ShadingFill="sh",r.StrokePath="S",r.BeginText="BT",r.EndText="ET",r.MoveText="Td",r.MoveTextSetLeading="TD",r.NextLine="T*",r.SetCharacterSpacing="Tc",r.SetFontAndSize="Tf",r.SetTextHorizontalScaling="Tz",r.SetTextLineHeight="TL",r.SetTextRenderingMode="Tr",r.SetTextRise="Ts",r.SetWordSpacing="Tw",r.ShowText="Tj",r.ShowTextAdjusted="TJ",r.ShowTextLine="'",r.ShowTextLineAndSpace='"',r.Type3D0="d0",r.Type3D1="d1",r.BeginCompatibilitySection="BX",r.EndCompatibilitySection="EX"})($g||($g={}));em.default=$g});var bl=E(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var cc=(j(),U(L)),ZR=cc.__importDefault(dl()),JR=ze(),X1=cc.__importDefault(Ce()),QR=cc.__importDefault(ni()),$R=ae(),e_=function(r){cc.__extends(e,r);function e(t,n){var i=r.call(this,t)||this;return i.computeContents=function(){var s=i.getUnencodedContents();return i.encode?ZR.default.deflate(s):s},i.encode=n,n&&t.set(X1.default.of("Filter"),X1.default.of("FlateDecode")),i.contentsCache=$R.Cache.populatedBy(i.computeContents),i}return e.prototype.getContents=function(){return this.contentsCache.access()},e.prototype.getContentsSize=function(){return this.contentsCache.access().length},e.prototype.getUnencodedContents=function(){throw new JR.MethodNotImplementedError(this.constructor.name,"getUnencodedContents")},e}(QR.default);rm.default=e_});var hc=E(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var nm=(j(),U(L)),t_=nm.__importDefault(bl()),r_=nm.__importDefault(Ve()),n_=function(r){nm.__extends(e,r);function e(t,n,i){i===void 0&&(i=!0);var s=r.call(this,t,i)||this;return s.operators=n,s}return e.prototype.push=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];(t=this.operators).push.apply(t,n)},e.prototype.clone=function(t){for(var n=new Array(this.operators.length),i=0,s=this.operators.length;i<s;i++)n[i]=this.operators[i].clone(t);var a=this,o=a.dict,l=a.encode;return e.of(o.clone(t),n,l)},e.prototype.getContentsString=function(){for(var t="",n=0,i=this.operators.length;n<i;n++)t+=this.operators[n]+`
|
|
26
|
+
`;return t},e.prototype.getUnencodedContents=function(){for(var t=new Uint8Array(this.getUnencodedContentsSize()),n=0,i=0,s=this.operators.length;i<s;i++)n+=this.operators[i].copyBytesInto(t,n),t[n++]=r_.default.Newline;return t},e.prototype.getUnencodedContentsSize=function(){for(var t=0,n=0,i=this.operators.length;n<i;n++)t+=this.operators[n].sizeInBytes()+1;return t},e.of=function(t,n,i){return i===void 0&&(i=!0),new e(t,n,i)},e}(t_.default);im.default=n_});var Y1=E(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.SimpleRNG=void 0;var i_=function(){function r(e){this.seed=e}return r.prototype.nextInt=function(){var e=Math.sin(this.seed++)*1e4;return e-Math.floor(e)},r.withSeed=function(e){return new r(e)},r}();fc.SimpleRNG=i_});var lm=E(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var It=(j(),U(L)),s_=It.__importDefault(dl()),a_=It.__importDefault(Sa()),Z1=ze(),o_=It.__importDefault(Ut()),J1=It.__importDefault(gl()),l_=It.__importDefault(Yt()),Q1=It.__importDefault(Ce()),vs=It.__importDefault(vl()),u_=It.__importDefault(gt()),d_=It.__importDefault(ir()),c_=It.__importDefault(ka()),sm=It.__importDefault(sr()),$1=It.__importDefault(Qg()),eA=It.__importDefault(tm()),am=It.__importDefault(hc()),tA=ae(),h_=Y1(),f_=function(r,e){var t=r[0],n=e[0];return t.objectNumber-n.objectNumber},p_=function(){function r(){this.largestObjectNumber=0,this.header=a_.default.forVersion(1,7),this.trailerInfo={},this.indirectObjects=new Map,this.rng=h_.SimpleRNG.withSeed(1)}return r.prototype.assign=function(e,t){this.indirectObjects.set(e,t),e.objectNumber>this.largestObjectNumber&&(this.largestObjectNumber=e.objectNumber)},r.prototype.nextRef=function(){return this.largestObjectNumber+=1,sm.default.of(this.largestObjectNumber)},r.prototype.register=function(e){var t=this.nextRef();return this.assign(t,e),t},r.prototype.delete=function(e){return this.indirectObjects.delete(e)},r.prototype.lookupMaybe=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=t.includes(vs.default),s=e instanceof sm.default?this.indirectObjects.get(e):e;if(!(!s||s===vs.default&&!i)){for(var a=0,o=t.length;a<o;a++){var l=t[a];if(l===vs.default){if(s===vs.default)return s}else if(s instanceof l)return s}throw new Z1.UnexpectedObjectTypeError(t,s)}},r.prototype.lookup=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=e instanceof sm.default?this.indirectObjects.get(e):e;if(t.length===0)return i;for(var s=0,a=t.length;s<a;s++){var o=t[s];if(o===vs.default){if(i===vs.default)return i}else if(i instanceof o)return i}throw new Z1.UnexpectedObjectTypeError(t,i)},r.prototype.getObjectRef=function(e){for(var t=Array.from(this.indirectObjects.entries()),n=0,i=t.length;n<i;n++){var s=t[n],a=s[0],o=s[1];if(o===e)return a}},r.prototype.enumerateIndirectObjects=function(){return Array.from(this.indirectObjects.entries()).sort(f_)},r.prototype.obj=function(e){if(e instanceof d_.default)return e;if(e==null)return vs.default;if(typeof e=="string")return Q1.default.of(e);if(typeof e=="number")return u_.default.of(e);if(typeof e=="boolean")return e?J1.default.True:J1.default.False;if(Array.isArray(e)){for(var t=o_.default.withContext(this),n=0,i=e.length;n<i;n++)t.push(this.obj(e[n]));return t}else{for(var s=l_.default.withContext(this),a=Object.keys(e),n=0,i=a.length;n<i;n++){var o=a[n],l=e[o];l!==void 0&&s.set(Q1.default.of(o),this.obj(l))}return s}},r.prototype.stream=function(e,t){return t===void 0&&(t={}),c_.default.of(this.obj(t),tA.typedArrayFor(e))},r.prototype.flateStream=function(e,t){return t===void 0&&(t={}),this.stream(s_.default.deflate(tA.typedArrayFor(e)),It.__assign(It.__assign({},t),{Filter:"FlateDecode"}))},r.prototype.contentStream=function(e,t){return t===void 0&&(t={}),am.default.of(this.obj(t),e)},r.prototype.formXObject=function(e,t){return t===void 0&&(t={}),this.contentStream(e,It.__assign(It.__assign({BBox:this.obj([0,0,0,0]),Matrix:this.obj([1,0,0,1,0,0])},t),{Type:"XObject",Subtype:"Form"}))},r.prototype.getPushGraphicsStateContentStream=function(){if(this.pushGraphicsStateContentStreamRef)return this.pushGraphicsStateContentStreamRef;var e=this.obj({}),t=$1.default.of(eA.default.PushGraphicsState),n=am.default.of(e,[t]);return this.pushGraphicsStateContentStreamRef=this.register(n),this.pushGraphicsStateContentStreamRef},r.prototype.getPopGraphicsStateContentStream=function(){if(this.popGraphicsStateContentStreamRef)return this.popGraphicsStateContentStreamRef;var e=this.obj({}),t=$1.default.of(eA.default.PopGraphicsState),n=am.default.of(e,[t]);return this.popGraphicsStateContentStreamRef=this.register(n),this.popGraphicsStateContentStreamRef},r.prototype.addRandomSuffix=function(e,t){return t===void 0&&(t=4),e+"-"+Math.floor(this.rng.nextInt()*Math.pow(10,t))},r.create=function(){return new r},r}();om.default=p_});var wl=E(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var Ra=(j(),U(L)),ys=Ra.__importDefault(Ut()),kn=Ra.__importDefault(Yt()),Ie=Ra.__importDefault(Ce()),g_=Ra.__importDefault(gt()),m_=Ra.__importDefault(ni()),v_=function(r){Ra.__extends(e,r);function e(t,n,i){i===void 0&&(i=!0);var s=r.call(this,t,n)||this;return s.normalized=!1,s.autoNormalizeCTM=i,s}return e.prototype.clone=function(t){for(var n=e.fromMapWithContext(new Map,t||this.context,this.autoNormalizeCTM),i=this.entries(),s=0,a=i.length;s<a;s++){var o=i[s],l=o[0],u=o[1];n.set(l,u)}return n},e.prototype.Parent=function(){return this.lookupMaybe(Ie.default.Parent,kn.default)},e.prototype.Contents=function(){return this.lookup(Ie.default.of("Contents"))},e.prototype.Annots=function(){return this.lookupMaybe(Ie.default.Annots,ys.default)},e.prototype.BleedBox=function(){return this.lookupMaybe(Ie.default.BleedBox,ys.default)},e.prototype.TrimBox=function(){return this.lookupMaybe(Ie.default.TrimBox,ys.default)},e.prototype.ArtBox=function(){return this.lookupMaybe(Ie.default.ArtBox,ys.default)},e.prototype.Resources=function(){var t=this.getInheritableAttribute(Ie.default.Resources);return this.context.lookupMaybe(t,kn.default)},e.prototype.MediaBox=function(){var t=this.getInheritableAttribute(Ie.default.MediaBox);return this.context.lookup(t,ys.default)},e.prototype.CropBox=function(){var t=this.getInheritableAttribute(Ie.default.CropBox);return this.context.lookupMaybe(t,ys.default)},e.prototype.Rotate=function(){var t=this.getInheritableAttribute(Ie.default.Rotate);return this.context.lookupMaybe(t,g_.default)},e.prototype.getInheritableAttribute=function(t){var n;return this.ascend(function(i){n||(n=i.get(t))}),n},e.prototype.setParent=function(t){this.set(Ie.default.Parent,t)},e.prototype.addContentStream=function(t){var n=this.normalizedEntries().Contents||this.context.obj([]);this.set(Ie.default.Contents,n),n.push(t)},e.prototype.wrapContentStreams=function(t,n){var i=this.Contents();return i instanceof ys.default?(i.insert(0,t),i.push(n),!0):!1},e.prototype.addAnnot=function(t){var n=this.normalizedEntries().Annots;n.push(t)},e.prototype.removeAnnot=function(t){var n=this.normalizedEntries().Annots,i=n.indexOf(t);i!==void 0&&n.remove(i)},e.prototype.setFontDictionary=function(t,n){var i=this.normalizedEntries().Font;i.set(t,n)},e.prototype.newFontDictionaryKey=function(t){var n=this.normalizedEntries().Font;return n.uniqueKey(t)},e.prototype.newFontDictionary=function(t,n){var i=this.newFontDictionaryKey(t);return this.setFontDictionary(i,n),i},e.prototype.setXObject=function(t,n){var i=this.normalizedEntries().XObject;i.set(t,n)},e.prototype.newXObjectKey=function(t){var n=this.normalizedEntries().XObject;return n.uniqueKey(t)},e.prototype.newXObject=function(t,n){var i=this.newXObjectKey(t);return this.setXObject(i,n),i},e.prototype.setExtGState=function(t,n){var i=this.normalizedEntries().ExtGState;i.set(t,n)},e.prototype.newExtGStateKey=function(t){var n=this.normalizedEntries().ExtGState;return n.uniqueKey(t)},e.prototype.newExtGState=function(t,n){var i=this.newExtGStateKey(t);return this.setExtGState(i,n),i},e.prototype.ascend=function(t){t(this);var n=this.Parent();n&&n.ascend(t)},e.prototype.normalize=function(){if(!this.normalized){var t=this.context,n=this.get(Ie.default.Contents),i=this.context.lookup(n);i instanceof m_.default&&this.set(Ie.default.Contents,t.obj([n])),this.autoNormalizeCTM&&this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(),this.context.getPopGraphicsStateContentStream());var s=this.getInheritableAttribute(Ie.default.Resources),a=t.lookupMaybe(s,kn.default)||t.obj({});this.set(Ie.default.Resources,a);var o=a.lookupMaybe(Ie.default.Font,kn.default)||t.obj({});a.set(Ie.default.Font,o);var l=a.lookupMaybe(Ie.default.XObject,kn.default)||t.obj({});a.set(Ie.default.XObject,l);var u=a.lookupMaybe(Ie.default.ExtGState,kn.default)||t.obj({});a.set(Ie.default.ExtGState,u);var d=this.Annots()||t.obj([]);this.set(Ie.default.Annots,d),this.normalized=!0}},e.prototype.normalizedEntries=function(){this.normalize();var t=this.Annots(),n=this.Resources(),i=this.Contents();return{Annots:t,Resources:n,Contents:i,Font:n.lookup(Ie.default.Font,kn.default),XObject:n.lookup(Ie.default.XObject,kn.default),ExtGState:n.lookup(Ie.default.ExtGState,kn.default)}},e.InheritableEntries=["Resources","MediaBox","CropBox","Rotate"],e.withContextAndParent=function(t,n){var i=new Map;return i.set(Ie.default.Type,Ie.default.Page),i.set(Ie.default.Parent,n),i.set(Ie.default.Resources,t.obj({})),i.set(Ie.default.MediaBox,t.obj([0,0,612,792])),new e(i,t,!1)},e.fromMapWithContext=function(t,n,i){return i===void 0&&(i=!0),new e(t,n,i)},e}(kn.default);um.default=v_});var iA=E(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var _a=(j(),U(L)),y_=_a.__importDefault(Ut()),b_=_a.__importDefault(Yt()),rA=_a.__importDefault(Ce()),w_=_a.__importDefault(sr()),x_=_a.__importDefault(ni()),nA=_a.__importDefault(wl()),A_=function(){function r(e,t){var n=this;this.traversedObjects=new Map,this.copy=function(i){return i instanceof nA.default?n.copyPDFPage(i):i instanceof b_.default?n.copyPDFDict(i):i instanceof y_.default?n.copyPDFArray(i):i instanceof x_.default?n.copyPDFStream(i):i instanceof w_.default?n.copyPDFIndirectObject(i):i.clone()},this.copyPDFPage=function(i){for(var s=i.clone(),a=nA.default.InheritableEntries,o=0,l=a.length;o<l;o++){var u=rA.default.of(a[o]),d=s.getInheritableAttribute(u);!s.get(u)&&d&&s.set(u,d)}return s.delete(rA.default.of("Parent")),n.copyPDFDict(s)},this.copyPDFDict=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var s=i.clone(n.dest);n.traversedObjects.set(i,s);for(var a=i.entries(),o=0,l=a.length;o<l;o++){var u=a[o],d=u[0],c=u[1];s.set(d,n.copy(c))}return s},this.copyPDFArray=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var s=i.clone(n.dest);n.traversedObjects.set(i,s);for(var a=0,o=i.size();a<o;a++){var l=i.get(a);s.set(a,n.copy(l))}return s},this.copyPDFStream=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var s=i.clone(n.dest);n.traversedObjects.set(i,s);for(var a=i.dict.entries(),o=0,l=a.length;o<l;o++){var u=a[o],d=u[0],c=u[1];s.dict.set(d,n.copy(c))}return s},this.copyPDFIndirectObject=function(i){var s=n.traversedObjects.has(i);if(!s){var a=n.dest.nextRef();n.traversedObjects.set(i,a);var o=n.src.lookup(i);if(o){var l=n.copy(o);n.dest.assign(a,l)}}return n.traversedObjects.get(i)},this.src=e,this.dest=t}return r.for=function(e,t){return new r(e,t)},r}();dm.default=A_});var pc=E(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var sA=(j(),U(L)),S_=sA.__importDefault(sr()),Rr=sA.__importDefault(Ve()),Oi=ae(),P_=function(){function r(e){this.subsections=e?[[e]]:[],this.chunkIdx=0,this.chunkLength=e?1:0}return r.prototype.addEntry=function(e,t){this.append({ref:e,offset:t,deleted:!1})},r.prototype.addDeletedEntry=function(e,t){this.append({ref:e,offset:t,deleted:!0})},r.prototype.toString=function(){for(var e=`xref
|
|
27
|
+
`,t=0,n=this.subsections.length;t<n;t++){var i=this.subsections[t];e+=i[0].ref.objectNumber+" "+i.length+`
|
|
28
|
+
`;for(var s=0,a=i.length;s<a;s++){var o=i[s];e+=Oi.padStart(String(o.offset),10,"0"),e+=" ",e+=Oi.padStart(String(o.ref.generationNumber),5,"0"),e+=" ",e+=o.deleted?"f":"n",e+=`
|
|
29
|
+
`}}return e},r.prototype.sizeInBytes=function(){for(var e=5,t=0,n=this.subsections.length;t<n;t++){var i=this.subsections[t],s=i.length,a=i[0];e+=2,e+=String(a.ref.objectNumber).length,e+=String(s).length,e+=20*s}return e},r.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Rr.default.x,e[t++]=Rr.default.r,e[t++]=Rr.default.e,e[t++]=Rr.default.f,e[t++]=Rr.default.Newline,t+=this.copySubsectionsIntoBuffer(this.subsections,e,t),t-n},r.prototype.copySubsectionsIntoBuffer=function(e,t,n){for(var i=n,s=e.length,a=0;a<s;a++){var o=this.subsections[a],l=String(o[0].ref.objectNumber);n+=Oi.copyStringIntoBuffer(l,t,n),t[n++]=Rr.default.Space;var u=String(o.length);n+=Oi.copyStringIntoBuffer(u,t,n),t[n++]=Rr.default.Newline,n+=this.copyEntriesIntoBuffer(o,t,n)}return n-i},r.prototype.copyEntriesIntoBuffer=function(e,t,n){for(var i=e.length,s=0;s<i;s++){var a=e[s],o=Oi.padStart(String(a.offset),10,"0");n+=Oi.copyStringIntoBuffer(o,t,n),t[n++]=Rr.default.Space;var l=Oi.padStart(String(a.ref.generationNumber),5,"0");n+=Oi.copyStringIntoBuffer(l,t,n),t[n++]=Rr.default.Space,t[n++]=a.deleted?Rr.default.f:Rr.default.n,t[n++]=Rr.default.Space,t[n++]=Rr.default.Newline}return 20*i},r.prototype.append=function(e){if(this.chunkLength===0){this.subsections.push([e]),this.chunkIdx=0,this.chunkLength=1;return}var t=this.subsections[this.chunkIdx],n=t[this.chunkLength-1];e.ref.objectNumber-n.ref.objectNumber>1?(this.subsections.push([e]),this.chunkIdx+=1,this.chunkLength=1):(t.push(e),this.chunkLength+=1)},r.create=function(){return new r({ref:S_.default.of(0,65535),offset:0,deleted:!0})},r.createEmpty=function(){return new r},r}();cm.default=P_});var xl=E(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var F_=(j(),U(L)),Zt=F_.__importDefault(Ve()),D_=ae(),E_=function(){function r(e){this.lastXRefOffset=String(e)}return r.prototype.toString=function(){return`startxref
|
|
30
|
+
`+this.lastXRefOffset+`
|
|
31
|
+
%%EOF`},r.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},r.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Zt.default.s,e[t++]=Zt.default.t,e[t++]=Zt.default.a,e[t++]=Zt.default.r,e[t++]=Zt.default.t,e[t++]=Zt.default.x,e[t++]=Zt.default.r,e[t++]=Zt.default.e,e[t++]=Zt.default.f,e[t++]=Zt.default.Newline,t+=D_.copyStringIntoBuffer(this.lastXRefOffset,e,t),e[t++]=Zt.default.Newline,e[t++]=Zt.default.Percent,e[t++]=Zt.default.Percent,e[t++]=Zt.default.E,e[t++]=Zt.default.O,e[t++]=Zt.default.F,t-n},r.forLastCrossRefSectionOffset=function(e){return new r(e)},r}();hm.default=E_});var pm=E(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var C_=(j(),U(L)),Mi=C_.__importDefault(Ve()),T_=function(){function r(e){this.dict=e}return r.prototype.toString=function(){return`trailer
|
|
32
|
+
`+this.dict.toString()},r.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},r.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Mi.default.t,e[t++]=Mi.default.r,e[t++]=Mi.default.a,e[t++]=Mi.default.i,e[t++]=Mi.default.l,e[t++]=Mi.default.e,e[t++]=Mi.default.r,e[t++]=Mi.default.Newline,t+=this.dict.copyBytesInto(e,t),t-n},r.of=function(e){return new r(e)},r}();fm.default=T_});var mc=E(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var Al=(j(),U(L)),gc=Al.__importDefault(Ce()),aA=Al.__importDefault(gt()),k_=Al.__importDefault(bl()),R_=Al.__importDefault(Ve()),gm=ae(),__=function(r){Al.__extends(e,r);function e(t,n,i){i===void 0&&(i=!0);var s=r.call(this,t.obj({}),i)||this;return s.objects=n,s.offsets=s.computeObjectOffsets(),s.offsetsString=s.computeOffsetsString(),s.dict.set(gc.default.of("Type"),gc.default.of("ObjStm")),s.dict.set(gc.default.of("N"),aA.default.of(s.objects.length)),s.dict.set(gc.default.of("First"),aA.default.of(s.offsetsString.length)),s}return e.prototype.getObjectsCount=function(){return this.objects.length},e.prototype.clone=function(t){return e.withContextAndObjects(t||this.dict.context,this.objects.slice(),this.encode)},e.prototype.getContentsString=function(){for(var t=this.offsetsString,n=0,i=this.objects.length;n<i;n++){var s=this.objects[n],a=s[1];t+=a+`
|
|
33
|
+
`}return t},e.prototype.getUnencodedContents=function(){for(var t=new Uint8Array(this.getUnencodedContentsSize()),n=gm.copyStringIntoBuffer(this.offsetsString,t,0),i=0,s=this.objects.length;i<s;i++){var a=this.objects[i],o=a[1];n+=o.copyBytesInto(t,n),t[n++]=R_.default.Newline}return t},e.prototype.getUnencodedContentsSize=function(){return this.offsetsString.length+gm.last(this.offsets)[1]+gm.last(this.objects)[1].sizeInBytes()+1},e.prototype.computeOffsetsString=function(){for(var t="",n=0,i=this.offsets.length;n<i;n++){var s=this.offsets[n],a=s[0],o=s[1];t+=a+" "+o+" "}return t},e.prototype.computeObjectOffsets=function(){for(var t=0,n=new Array(this.objects.length),i=0,s=this.objects.length;i<s;i++){var a=this.objects[i],o=a[0],l=a[1];n[i]=[o.objectNumber,t],t+=l.sizeInBytes()+1}return n},e.withContextAndObjects=function(t,n,i){return i===void 0&&(i=!0),new e(t,n,i)},e}(k_.default);mm.default=__});var ym=E(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var Rn=(j(),U(L)),I_=Rn.__importDefault(pc()),O_=Rn.__importDefault(Sa()),M_=Rn.__importDefault(xl()),N_=Rn.__importDefault(pm()),L_=Rn.__importDefault(mc()),xt=Rn.__importDefault(Ve()),vc=ae(),j_=function(){function r(e,t){var n=this;this.parsedObjects=0,this.shouldWaitForTick=function(i){return n.parsedObjects+=i,n.parsedObjects%n.objectsPerTick===0},this.context=e,this.objectsPerTick=t}return r.prototype.serializeToBuffer=function(){return Rn.__awaiter(this,void 0,void 0,function(){var e,t,n,i,s,a,o,l,u,d,c,h,f,p,g,v,m;return Rn.__generator(this,function(y){switch(y.label){case 0:return[4,this.computeBufferSize()];case 1:e=y.sent(),t=e.size,n=e.header,i=e.indirectObjects,s=e.xref,a=e.trailerDict,o=e.trailer,l=0,u=new Uint8Array(t),l+=n.copyBytesInto(u,l),u[l++]=xt.default.Newline,u[l++]=xt.default.Newline,d=0,c=i.length,y.label=2;case 2:return d<c?(h=i[d],f=h[0],p=h[1],g=String(f.objectNumber),l+=vc.copyStringIntoBuffer(g,u,l),u[l++]=xt.default.Space,v=String(f.generationNumber),l+=vc.copyStringIntoBuffer(v,u,l),u[l++]=xt.default.Space,u[l++]=xt.default.o,u[l++]=xt.default.b,u[l++]=xt.default.j,u[l++]=xt.default.Newline,l+=p.copyBytesInto(u,l),u[l++]=xt.default.Newline,u[l++]=xt.default.e,u[l++]=xt.default.n,u[l++]=xt.default.d,u[l++]=xt.default.o,u[l++]=xt.default.b,u[l++]=xt.default.j,u[l++]=xt.default.Newline,u[l++]=xt.default.Newline,m=p instanceof L_.default?p.getObjectsCount():1,this.shouldWaitForTick(m)?[4,vc.waitForTick()]:[3,4]):[3,5];case 3:y.sent(),y.label=4;case 4:return d++,[3,2];case 5:return s&&(l+=s.copyBytesInto(u,l),u[l++]=xt.default.Newline),a&&(l+=a.copyBytesInto(u,l),u[l++]=xt.default.Newline,u[l++]=xt.default.Newline),l+=o.copyBytesInto(u,l),[2,u]}})})},r.prototype.computeIndirectObjectSize=function(e){var t=e[0],n=e[1],i=t.sizeInBytes()+3,s=n.sizeInBytes()+9;return i+s},r.prototype.createTrailerDict=function(){return this.context.obj({Size:this.context.largestObjectNumber+1,Root:this.context.trailerInfo.Root,Encrypt:this.context.trailerInfo.Encrypt,Info:this.context.trailerInfo.Info,ID:this.context.trailerInfo.ID})},r.prototype.computeBufferSize=function(){return Rn.__awaiter(this,void 0,void 0,function(){var e,t,n,i,s,a,o,l,u,d,c;return Rn.__generator(this,function(h){switch(h.label){case 0:e=O_.default.forVersion(1,7),t=e.sizeInBytes()+2,n=I_.default.create(),i=this.context.enumerateIndirectObjects(),s=0,a=i.length,h.label=1;case 1:return s<a?(o=i[s],l=o[0],n.addEntry(l,t),t+=this.computeIndirectObjectSize(o),this.shouldWaitForTick(1)?[4,vc.waitForTick()]:[3,3]):[3,4];case 2:h.sent(),h.label=3;case 3:return s++,[3,1];case 4:return u=t,t+=n.sizeInBytes()+1,d=N_.default.of(this.createTrailerDict()),t+=d.sizeInBytes()+2,c=M_.default.forLastCrossRefSectionOffset(u),t+=c.sizeInBytes(),[2,{size:t,header:e,indirectObjects:i,xref:n,trailerDict:d,trailer:c}]}})})},r.forContext=function(e,t){return new r(e,t)},r}();vm.default=j_});var yc=E(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var oA=(j(),U(L)),B_=oA.__importDefault(ir()),U_=function(r){oA.__extends(e,r);function e(t){var n=r.call(this)||this;return n.data=t,n}return e.prototype.clone=function(){return e.of(this.data.slice())},e.prototype.toString=function(){return"PDFInvalidObject("+this.data.length+" bytes)"},e.prototype.sizeInBytes=function(){return this.data.length},e.prototype.copyBytesInto=function(t,n){for(var i=this.data.length,s=0;s<i;s++)t[n++]=this.data[s];return i},e.of=function(t){return new e(t)},e}(B_.default);bm.default=U_});var wm=E(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.EntryType=void 0;var wc=(j(),U(L)),bc=wc.__importDefault(Ce()),q_=wc.__importDefault(sr()),z_=wc.__importDefault(bl()),Et=ae(),bs;(function(r){r[r.Deleted=0]="Deleted",r[r.Uncompressed=1]="Uncompressed",r[r.Compressed=2]="Compressed"})(bs=Ia.EntryType||(Ia.EntryType={}));var V_=function(r){wc.__extends(e,r);function e(t,n,i){i===void 0&&(i=!0);var s=r.call(this,t,i)||this;return s.computeIndex=function(){for(var a=[],o=0,l=0,u=s.entries.length;l<u;l++){var d=s.entries[l],c=s.entries[l-1];l===0?a.push(d.ref.objectNumber):d.ref.objectNumber-c.ref.objectNumber>1&&(a.push(o),a.push(d.ref.objectNumber),o=0),o+=1}return a.push(o),a},s.computeEntryTuples=function(){for(var a=new Array(s.entries.length),o=0,l=s.entries.length;o<l;o++){var u=s.entries[o];if(u.type===bs.Deleted){var d=u.type,c=u.nextFreeObjectNumber,h=u.ref;a[o]=[d,c,h.generationNumber]}if(u.type===bs.Uncompressed){var d=u.type,f=u.offset,h=u.ref;a[o]=[d,f,h.generationNumber]}if(u.type===bs.Compressed){var d=u.type,p=u.objectStreamRef,g=u.index;a[o]=[d,p.objectNumber,g]}}return a},s.computeMaxEntryByteWidths=function(){for(var a=s.entryTuplesCache.access(),o=[0,0,0],l=0,u=a.length;l<u;l++){var d=a[l],c=d[0],h=d[1],f=d[2],p=Et.sizeInBytes(c),g=Et.sizeInBytes(h),v=Et.sizeInBytes(f);p>o[0]&&(o[0]=p),g>o[1]&&(o[1]=g),v>o[2]&&(o[2]=v)}return o},s.entries=n||[],s.entryTuplesCache=Et.Cache.populatedBy(s.computeEntryTuples),s.maxByteWidthsCache=Et.Cache.populatedBy(s.computeMaxEntryByteWidths),s.indexCache=Et.Cache.populatedBy(s.computeIndex),t.set(bc.default.of("Type"),bc.default.of("XRef")),s}return e.prototype.addDeletedEntry=function(t,n){var i=bs.Deleted;this.entries.push({type:i,ref:t,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.addUncompressedEntry=function(t,n){var i=bs.Uncompressed;this.entries.push({type:i,ref:t,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.addCompressedEntry=function(t,n,i){var s=bs.Compressed;this.entries.push({type:s,ref:t,objectStreamRef:n,index:i}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.clone=function(t){var n=this,i=n.dict,s=n.entries,a=n.encode;return e.of(i.clone(t),s.slice(),a)},e.prototype.getContentsString=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i="",s=0,a=t.length;s<a;s++){for(var o=t[s],l=o[0],u=o[1],d=o[2],c=Et.reverseArray(Et.bytesFor(l)),h=Et.reverseArray(Et.bytesFor(u)),f=Et.reverseArray(Et.bytesFor(d)),p=n[0]-1;p>=0;p--)i+=(c[p]||0).toString(2);for(var p=n[1]-1;p>=0;p--)i+=(h[p]||0).toString(2);for(var p=n[2]-1;p>=0;p--)i+=(f[p]||0).toString(2)}return i},e.prototype.getUnencodedContents=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i=new Uint8Array(this.getUnencodedContentsSize()),s=0,a=0,o=t.length;a<o;a++){for(var l=t[a],u=l[0],d=l[1],c=l[2],h=Et.reverseArray(Et.bytesFor(u)),f=Et.reverseArray(Et.bytesFor(d)),p=Et.reverseArray(Et.bytesFor(c)),g=n[0]-1;g>=0;g--)i[s++]=h[g]||0;for(var g=n[1]-1;g>=0;g--)i[s++]=f[g]||0;for(var g=n[2]-1;g>=0;g--)i[s++]=p[g]||0}return i},e.prototype.getUnencodedContentsSize=function(){var t=this.maxByteWidthsCache.access(),n=Et.sum(t);return n*this.entries.length},e.prototype.updateDict=function(){r.prototype.updateDict.call(this);var t=this.maxByteWidthsCache.access(),n=this.indexCache.access(),i=this.dict.context;this.dict.set(bc.default.of("W"),i.obj(t)),this.dict.set(bc.default.of("Index"),i.obj(n))},e.create=function(t,n){n===void 0&&(n=!0);var i=new e(t,[],n);return i.addDeletedEntry(q_.default.of(0,65535),0),i},e.of=function(t,n,i){return i===void 0&&(i=!0),new e(t,n,i)},e}(z_.default);Ia.default=V_});var uA=E(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var _r=(j(),U(L)),H_=_r.__importDefault(Sa()),G_=_r.__importDefault(xl()),W_=_r.__importDefault(yc()),K_=_r.__importDefault(Ce()),X_=_r.__importDefault(gt()),lA=_r.__importDefault(sr()),Y_=_r.__importDefault(ni()),Z_=_r.__importDefault(wm()),J_=_r.__importDefault(mc()),Q_=_r.__importDefault(ym()),xc=ae(),$_=function(r){_r.__extends(e,r);function e(t,n,i,s){var a=r.call(this,t,n)||this;return a.encodeStreams=i,a.objectsPerStream=s,a}return e.prototype.computeBufferSize=function(){return _r.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o,l,u,p,g,d,m,c,h,v,f,p,g,v,m,y,w,x,b;return _r.__generator(this,function(A){switch(A.label){case 0:t=this.context.largestObjectNumber+1,n=H_.default.forVersion(1,7),i=n.sizeInBytes()+2,s=Z_.default.create(this.createTrailerDict(),this.encodeStreams),a=[],o=[],l=[],u=this.context.enumerateIndirectObjects(),p=0,g=u.length,A.label=1;case 1:return p<g?(d=u[p],m=d[0],c=d[1],h=m===this.context.trailerInfo.Encrypt||c instanceof Y_.default||c instanceof W_.default||m.generationNumber!==0,h?(a.push(d),s.addUncompressedEntry(m,i),i+=this.computeIndirectObjectSize(d),this.shouldWaitForTick(1)?[4,xc.waitForTick()]:[3,3]):[3,4]):[3,6];case 2:A.sent(),A.label=3;case 3:return[3,5];case 4:v=xc.last(o),f=xc.last(l),(!v||v.length%this.objectsPerStream===0)&&(v=[],o.push(v),f=lA.default.of(t++),l.push(f)),s.addCompressedEntry(m,f,v.length),v.push(d),A.label=5;case 5:return p++,[3,1];case 6:p=0,g=o.length,A.label=7;case 7:return p<g?(v=o[p],m=l[p],y=J_.default.withContextAndObjects(this.context,v,this.encodeStreams),s.addUncompressedEntry(m,i),i+=this.computeIndirectObjectSize([m,y]),a.push([m,y]),this.shouldWaitForTick(v.length)?[4,xc.waitForTick()]:[3,9]):[3,10];case 8:A.sent(),A.label=9;case 9:return p++,[3,7];case 10:return w=lA.default.of(t++),s.dict.set(K_.default.of("Size"),X_.default.of(t)),s.addUncompressedEntry(w,i),x=i,i+=this.computeIndirectObjectSize([w,s]),a.push([w,s]),b=G_.default.forLastCrossRefSectionOffset(x),i+=b.sizeInBytes(),[2,{size:i,header:n,indirectObjects:a,trailer:b}]}})})},e.forContext=function(t,n,i,s){return i===void 0&&(i=!0),s===void 0&&(s=50),new e(t,n,i,s)},e}(Q_.default);xm.default=$_});var gr=E(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Am=(j(),U(L)),eI=Am.__importDefault(ir()),dA=Am.__importDefault(Ve()),ws=ae(),tI=ze(),rI=function(r){Am.__extends(e,r);function e(t){var n=r.call(this)||this;return n.value=t,n}return e.prototype.asBytes=function(){for(var t=this.value+(this.value.length%2===1?"0":""),n=t.length,i=new Uint8Array(t.length/2),s=0,a=0;s<n;){var o=parseInt(t.substring(s,s+2),16);i[a]=o,s+=2,a+=1}return i},e.prototype.decodeText=function(){var t=this.asBytes();return ws.hasUtf16BOM(t)?ws.utf16Decode(t):ws.pdfDocEncodingDecode(t)},e.prototype.decodeDate=function(){var t=this.decodeText(),n=ws.parseDate(t);if(!n)throw new tI.InvalidPDFDateStringError(t);return n},e.prototype.asString=function(){return this.value},e.prototype.clone=function(){return e.of(this.value)},e.prototype.toString=function(){return"<"+this.value+">"},e.prototype.sizeInBytes=function(){return this.value.length+2},e.prototype.copyBytesInto=function(t,n){return t[n++]=dA.default.LessThan,n+=ws.copyStringIntoBuffer(this.value,t,n),t[n++]=dA.default.GreaterThan,this.value.length+2},e.of=function(t){return new e(t)},e.fromText=function(t){for(var n=ws.utf16Encode(t),i="",s=0,a=n.length;s<a;s++)i+=ws.toHexStringOfMinLength(n[s],4);return new e(i)},e}(eI.default);Sm.default=rI});var hA=E(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var nI=(j(),U(L)),xs=Eg(),iI=nI.__importDefault(gr()),cA=ae(),sI=function(){function r(e,t){this.encoding=e===xs.FontNames.ZapfDingbats?xs.Encodings.ZapfDingbats:e===xs.FontNames.Symbol?xs.Encodings.Symbol:xs.Encodings.WinAnsi,this.font=xs.Font.load(e),this.fontName=this.font.FontName,this.customName=t}return r.prototype.encodeText=function(e){for(var t=this.encodeTextAsGlyphs(e),n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]=cA.toHexString(t[i].code);return iI.default.of(n.join(""))},r.prototype.widthOfTextAtSize=function(e,t){for(var n=this.encodeTextAsGlyphs(e),i=0,s=0,a=n.length;s<a;s++){var o=n[s].name,l=(n[s+1]||{}).name,u=this.font.getXAxisKerningForPair(o,l)||0;i+=this.widthOfGlyph(o)+u}var d=t/1e3;return i*d},r.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,i=n===void 0?!0:n,s=this.font,a=s.Ascender,o=s.Descender,l=s.FontBBox,u=a||l[3],d=o||l[1],c=u-d;return i||(c+=o||0),c/1e3*e},r.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.Ascender,i=t.Descender,s=t.FontBBox,a=n||s[3],o=i||s[1];return 1e3*e/(a-o)},r.prototype.embedIntoContext=function(e,t){var n=e.obj({Type:"Font",Subtype:"Type1",BaseFont:this.customName||this.fontName,Encoding:this.encoding===xs.Encodings.WinAnsi?"WinAnsiEncoding":void 0});return t?(e.assign(t,n),t):e.register(n)},r.prototype.widthOfGlyph=function(e){return this.font.getWidthOfGlyph(e)||250},r.prototype.encodeTextAsGlyphs=function(e){for(var t=Array.from(e),n=new Array(t.length),i=0,s=t.length;i<s;i++){var a=cA.toCodePoint(t[i]);n[i]=this.encoding.encodeUnicodeCodePoint(a)}return n},r.for=function(e,t){return new r(e,t)},r}();Pm.default=sI});var gA=E(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.createCmap=void 0;var pA=ae(),Ac=Vp();Pc.createCmap=function(r,e){for(var t=new Array(r.length),n=0,i=r.length;n<i;n++){var s=r[n],a=fA(Sc(e(s))),o=fA.apply(void 0,s.codePoints.map(oI));t[n]=[a,o]}return aI(t)};var aI=function(r){return`/CIDInit /ProcSet findresource begin
|
|
34
|
+
12 dict begin
|
|
35
|
+
begincmap
|
|
36
|
+
/CIDSystemInfo <<
|
|
37
|
+
/Registry (Adobe)
|
|
38
|
+
/Ordering (UCS)
|
|
39
|
+
/Supplement 0
|
|
40
|
+
>> def
|
|
41
|
+
/CMapName /Adobe-Identity-UCS def
|
|
42
|
+
/CMapType 2 def
|
|
43
|
+
1 begincodespacerange
|
|
44
|
+
<0000><ffff>
|
|
45
|
+
endcodespacerange
|
|
46
|
+
`+r.length+` beginbfchar
|
|
47
|
+
`+r.map(function(e){var t=e[0],n=e[1];return t+" "+n}).join(`
|
|
48
|
+
`)+`
|
|
49
|
+
endbfchar
|
|
50
|
+
endcmap
|
|
51
|
+
CMapName currentdict /CMap defineresource pop
|
|
52
|
+
end
|
|
53
|
+
end`},fA=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"<"+r.join("")+">"},Sc=function(r){return pA.toHexStringOfMinLength(r,4)},oI=function(r){if(Ac.isWithinBMP(r))return Sc(r);if(Ac.hasSurrogates(r)){var e=Ac.highSurrogate(r),t=Ac.lowSurrogate(r);return""+Sc(e)+Sc(t)}var n=pA.toHexString(r),i="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(i)}});var mA=E(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.deriveFontFlags=void 0;var lI=function(r){var e=0,t=function(n){e|=1<<n-1};return r.fixedPitch&&t(1),r.serif&&t(2),r.symbolic&&t(3),r.script&&t(4),r.nonsymbolic&&t(6),r.italic&&t(7),r.allCap&&t(17),r.smallCap&&t(18),r.forceBold&&t(19),e};Fc.deriveFontFlags=function(r){var e=r["OS/2"]?r["OS/2"].sFamilyClass:0,t=lI({fixedPitch:r.post.isFixedPitch,serif:1<=e&&e<=7,symbolic:!0,script:e===10,italic:r.head.macStyle.italic});return t}});var on=E(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var Fm=(j(),U(L)),uI=Fm.__importDefault(ir()),st=Fm.__importDefault(Ve()),Gr=ae(),dI=ze(),cI=function(r){Fm.__extends(e,r);function e(t){var n=r.call(this)||this;return n.value=t,n}return e.prototype.asBytes=function(){for(var t=[],n="",i=!1,s=function(c){c!==void 0&&t.push(c),i=!1},a=0,o=this.value.length;a<o;a++){var l=this.value[a],u=Gr.toCharCode(l),d=this.value[a+1];i?u===st.default.Newline||u===st.default.CarriageReturn?s():u===st.default.n?s(st.default.Newline):u===st.default.r?s(st.default.CarriageReturn):u===st.default.t?s(st.default.Tab):u===st.default.b?s(st.default.Backspace):u===st.default.f?s(st.default.FormFeed):u===st.default.LeftParen?s(st.default.LeftParen):u===st.default.RightParen?s(st.default.RightParen):u===st.default.Backspace?s(st.default.BackSlash):u>=st.default.Zero&&u<=st.default.Seven?(n+=l,(n.length===3||!(d>="0"&&d<="7"))&&(s(parseInt(n,8)),n="")):s(u):u===st.default.BackSlash?i=!0:s(u)}return new Uint8Array(t)},e.prototype.decodeText=function(){var t=this.asBytes();return Gr.hasUtf16BOM(t)?Gr.utf16Decode(t):Gr.pdfDocEncodingDecode(t)},e.prototype.decodeDate=function(){var t=this.decodeText(),n=Gr.parseDate(t);if(!n)throw new dI.InvalidPDFDateStringError(t);return n},e.prototype.asString=function(){return this.value},e.prototype.clone=function(){return e.of(this.value)},e.prototype.toString=function(){return"("+this.value+")"},e.prototype.sizeInBytes=function(){return this.value.length+2},e.prototype.copyBytesInto=function(t,n){return t[n++]=st.default.LeftParen,n+=Gr.copyStringIntoBuffer(this.value,t,n),t[n++]=st.default.RightParen,this.value.length+2},e.of=function(t){return new e(t)},e.fromDate=function(t){var n=Gr.padStart(String(t.getUTCFullYear()),4,"0"),i=Gr.padStart(String(t.getUTCMonth()+1),2,"0"),s=Gr.padStart(String(t.getUTCDate()),2,"0"),a=Gr.padStart(String(t.getUTCHours()),2,"0"),o=Gr.padStart(String(t.getUTCMinutes()),2,"0"),l=Gr.padStart(String(t.getUTCSeconds()),2,"0");return new e("D:"+n+i+s+a+o+l+"Z")},e}(uI.default);Dm.default=cI});var Cm=E(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var mr=(j(),U(L)),hI=gA(),fI=mA(),pI=mr.__importDefault(gr()),vA=mr.__importDefault(on()),Dc=ae(),gI=function(){function r(e,t,n,i){var s=this;this.allGlyphsInFontSortedById=function(){for(var a=new Array(s.font.characterSet.length),o=0,l=a.length;o<l;o++){var u=s.font.characterSet[o];a[o]=s.font.glyphForCodePoint(u)}return Dc.sortedUniq(a.sort(Dc.byAscendingId),function(d){return d.id})},this.font=e,this.scale=1e3/this.font.unitsPerEm,this.fontData=t,this.fontName=this.font.postscriptName||"Font",this.customName=n,this.fontFeatures=i,this.baseFontName="",this.glyphCache=Dc.Cache.populatedBy(this.allGlyphsInFontSortedById)}return r.for=function(e,t,n,i){return mr.__awaiter(this,void 0,void 0,function(){var s;return mr.__generator(this,function(a){switch(a.label){case 0:return[4,e.create(t)];case 1:return s=a.sent(),[2,new r(s,t,n,i)]}})})},r.prototype.encodeText=function(e){for(var t=this.font.layout(e,this.fontFeatures).glyphs,n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]=Dc.toHexStringOfMinLength(t[i].id,4);return pI.default.of(n.join(""))},r.prototype.widthOfTextAtSize=function(e,t){for(var n=this.font.layout(e,this.fontFeatures).glyphs,i=0,s=0,a=n.length;s<a;s++)i+=n[s].advanceWidth*this.scale;var o=t/1e3;return i*o},r.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,i=n===void 0?!0:n,s=this.font,a=s.ascent,o=s.descent,l=s.bbox,u=(a||l.maxY)*this.scale,d=(o||l.minY)*this.scale,c=u-d;return i||(c-=Math.abs(o)||0),c/1e3*e},r.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.ascent,i=t.descent,s=t.bbox,a=(n||s.maxY)*this.scale,o=(i||s.minY)*this.scale;return 1e3*e/(a-o)},r.prototype.embedIntoContext=function(e,t){return this.baseFontName=this.customName||e.addRandomSuffix(this.fontName),this.embedFontDict(e,t)},r.prototype.embedFontDict=function(e,t){return mr.__awaiter(this,void 0,void 0,function(){var n,i,s;return mr.__generator(this,function(a){switch(a.label){case 0:return[4,this.embedCIDFontDict(e)];case 1:return n=a.sent(),i=this.embedUnicodeCmap(e),s=e.obj({Type:"Font",Subtype:"Type0",BaseFont:this.baseFontName,Encoding:"Identity-H",DescendantFonts:[n],ToUnicode:i}),t?(e.assign(t,s),[2,t]):[2,e.register(s)]}})})},r.prototype.isCFF=function(){return this.font.cff},r.prototype.embedCIDFontDict=function(e){return mr.__awaiter(this,void 0,void 0,function(){var t,n;return mr.__generator(this,function(i){switch(i.label){case 0:return[4,this.embedFontDescriptor(e)];case 1:return t=i.sent(),n=e.obj({Type:"Font",Subtype:this.isCFF()?"CIDFontType0":"CIDFontType2",CIDToGIDMap:"Identity",BaseFont:this.baseFontName,CIDSystemInfo:{Registry:vA.default.of("Adobe"),Ordering:vA.default.of("Identity"),Supplement:0},FontDescriptor:t,W:this.computeWidths()}),[2,e.register(n)]}})})},r.prototype.embedFontDescriptor=function(e){return mr.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o,l,u,d,c,h,f,p,g,v;return mr.__generator(this,function(m){switch(m.label){case 0:return[4,this.embedFontStream(e)];case 1:return t=m.sent(),n=this.scale,i=this.font,s=i.italicAngle,a=i.ascent,o=i.descent,l=i.capHeight,u=i.xHeight,d=this.font.bbox,c=d.minX,h=d.minY,f=d.maxX,p=d.maxY,g=e.obj((v={Type:"FontDescriptor",FontName:this.baseFontName,Flags:fI.deriveFontFlags(this.font),FontBBox:[c*n,h*n,f*n,p*n],ItalicAngle:s,Ascent:a*n,Descent:o*n,CapHeight:(l||a)*n,XHeight:(u||0)*n,StemV:0},v[this.isCFF()?"FontFile3":"FontFile2"]=t,v)),[2,e.register(g)]}})})},r.prototype.serializeFont=function(){return mr.__awaiter(this,void 0,void 0,function(){return mr.__generator(this,function(e){return[2,this.fontData]})})},r.prototype.embedFontStream=function(e){return mr.__awaiter(this,void 0,void 0,function(){var t,n,i;return mr.__generator(this,function(s){switch(s.label){case 0:return i=(n=e).flateStream,[4,this.serializeFont()];case 1:return t=i.apply(n,[s.sent(),{Subtype:this.isCFF()?"CIDFontType0C":void 0}]),[2,e.register(t)]}})})},r.prototype.embedUnicodeCmap=function(e){var t=hI.createCmap(this.glyphCache.access(),this.glyphId.bind(this)),n=e.flateStream(t);return e.register(n)},r.prototype.glyphId=function(e){return e?e.id:-1},r.prototype.computeWidths=function(){for(var e=this.glyphCache.access(),t=[],n=[],i=0,s=e.length;i<s;i++){var a=e[i],o=e[i-1],l=this.glyphId(a),u=this.glyphId(o);i===0?t.push(l):l-u!==1&&(t.push(n),t.push(l),n=[]),n.push(a.advanceWidth*this.scale)}return t.push(n),t},r}();Em.default=gI});var yA=E(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var Sl=(j(),U(L)),mI=Sl.__importDefault(Cm()),vI=Sl.__importDefault(gr()),Tm=ae(),yI=function(r){Sl.__extends(e,r);function e(t,n,i,s){var a=r.call(this,t,n,i,s)||this;return a.subset=a.font.createSubset(),a.glyphs=[],a.glyphCache=Tm.Cache.populatedBy(function(){return a.glyphs}),a.glyphIdMap=new Map,a}return e.for=function(t,n,i,s){return Sl.__awaiter(this,void 0,void 0,function(){var a;return Sl.__generator(this,function(o){switch(o.label){case 0:return[4,t.create(n)];case 1:return a=o.sent(),[2,new e(a,n,i,s)]}})})},e.prototype.encodeText=function(t){for(var n=this.font.layout(t,this.fontFeatures).glyphs,i=new Array(n.length),s=0,a=n.length;s<a;s++){var o=n[s],l=this.subset.includeGlyph(o);this.glyphs[l-1]=o,this.glyphIdMap.set(o.id,l),i[s]=Tm.toHexStringOfMinLength(l,4)}return this.glyphCache.invalidate(),vI.default.of(i.join(""))},e.prototype.isCFF=function(){return this.subset.cff},e.prototype.glyphId=function(t){return t?this.glyphIdMap.get(t.id):-1},e.prototype.serializeFont=function(){var t=this;return new Promise(function(n,i){var s=[];t.subset.encodeStream().on("data",function(a){return s.push(a)}).on("end",function(){return n(Tm.mergeUint8Arrays(s))}).on("error",function(a){return i(a)})})},e}(mI.default);km.default=yI});var _m=E(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.AFRelationship=void 0;var Ec=(j(),U(L)),Rm=Ec.__importDefault(on()),bA=Ec.__importDefault(gr()),bI;(function(r){r.Source="Source",r.Data="Data",r.Alternative="Alternative",r.Supplement="Supplement",r.EncryptedPayload="EncryptedPayload",r.FormData="EncryptedPayload",r.Schema="Schema",r.Unspecified="Unspecified"})(bI=Oa.AFRelationship||(Oa.AFRelationship={}));var wI=function(){function r(e,t,n){n===void 0&&(n={}),this.fileData=e,this.fileName=t,this.options=n}return r.for=function(e,t,n){return n===void 0&&(n={}),new r(e,t,n)},r.prototype.embedIntoContext=function(e,t){return Ec.__awaiter(this,void 0,void 0,function(){var n,i,s,a,o,l,u,d,c;return Ec.__generator(this,function(h){return n=this.options,i=n.mimeType,s=n.description,a=n.creationDate,o=n.modificationDate,l=n.afRelationship,u=e.flateStream(this.fileData,{Type:"EmbeddedFile",Subtype:i??void 0,Params:{Size:this.fileData.length,CreationDate:a?Rm.default.fromDate(a):void 0,ModDate:o?Rm.default.fromDate(o):void 0}}),d=e.register(u),c=e.obj({Type:"Filespec",F:Rm.default.of(this.fileName),UF:bA.default.fromText(this.fileName),EF:{F:d},Desc:s?bA.default.fromText(s):void 0,AFRelationship:l??void 0}),t?(e.assign(t,c),[2,t]):[2,e.register(c)]})})},r}();Oa.default=wI});var xA=E(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var Cc=(j(),U(L)),wA=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],Ma;(function(r){r.DeviceGray="DeviceGray",r.DeviceRGB="DeviceRGB",r.DeviceCMYK="DeviceCMYK"})(Ma||(Ma={}));var xI={1:Ma.DeviceGray,3:Ma.DeviceRGB,4:Ma.DeviceCMYK},AI=function(){function r(e,t,n,i,s){this.imageData=e,this.bitsPerComponent=t,this.width=n,this.height=i,this.colorSpace=s}return r.for=function(e){return Cc.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o,l,u,d,c;return Cc.__generator(this,function(h){if(t=new DataView(e.buffer),n=t.getUint16(0),n!==65496)throw new Error("SOI not found in JPEG");for(i=2;i<t.byteLength&&(s=t.getUint16(i),i+=2,!wA.includes(s));)i+=t.getUint16(i);if(!wA.includes(s))throw new Error("Invalid JPEG");if(i+=2,a=t.getUint8(i++),o=t.getUint16(i),i+=2,l=t.getUint16(i),i+=2,u=t.getUint8(i++),d=xI[u],!d)throw new Error("Unknown JPEG channel.");return c=d,[2,new r(e,a,l,o,c)]})})},r.prototype.embedIntoContext=function(e,t){return Cc.__awaiter(this,void 0,void 0,function(){var n;return Cc.__generator(this,function(i){return n=e.stream(this.imageData,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.bitsPerComponent,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:"DCTDecode",Decode:this.colorSpace===Ma.DeviceCMYK?[1,0,1,0,1,0,1,0]:void 0}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},r}();Im.default=AI});var AA=E(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.default=void 0;var SI=PI(dl());function PI(r){return r&&r.__esModule?r:{default:r}}var q={};q.toRGBA8=function(r){var e=r.width,t=r.height;if(r.tabs.acTL==null)return[q.toRGBA8.decodeImage(r.data,e,t,r).buffer];var n=[];r.frames[0].data==null&&(r.frames[0].data=r.data);for(var i=e*t*4,s=new Uint8Array(i),a=new Uint8Array(i),o=new Uint8Array(i),l=0;l<r.frames.length;l++){var u=r.frames[l],d=u.rect.x,c=u.rect.y,h=u.rect.width,f=u.rect.height,p=q.toRGBA8.decodeImage(u.data,h,f,r);if(l!=0)for(var g=0;g<i;g++)o[g]=s[g];if(u.blend==0?q._copyTile(p,h,f,s,e,t,d,c,0):u.blend==1&&q._copyTile(p,h,f,s,e,t,d,c,1),n.push(s.buffer.slice(0)),u.dispose!=0){if(u.dispose==1)q._copyTile(a,h,f,s,e,t,d,c,0);else if(u.dispose==2)for(var g=0;g<i;g++)s[g]=o[g]}}return n};q.toRGBA8.decodeImage=function(r,e,t,n){var i=e*t,s=q.decode._getBPP(n),a=Math.ceil(e*s/8),o=new Uint8Array(i*4),l=new Uint32Array(o.buffer),u=n.ctype,d=n.depth,c=q._bin.readUshort,h=Date.now();if(u==6){var f=i<<2;if(d==8)for(var p=0;p<f;p+=4)o[p]=r[p],o[p+1]=r[p+1],o[p+2]=r[p+2],o[p+3]=r[p+3];if(d==16)for(var p=0;p<f;p++)o[p]=r[p<<1]}else if(u==2){var g=n.tabs.tRNS;if(g==null){if(d==8)for(var p=0;p<i;p++){var v=p*3;l[p]=255<<24|r[v+2]<<16|r[v+1]<<8|r[v]}if(d==16)for(var p=0;p<i;p++){var v=p*6;l[p]=255<<24|r[v+4]<<16|r[v+2]<<8|r[v]}}else{var m=g[0],y=g[1],w=g[2];if(d==8)for(var p=0;p<i;p++){var x=p<<2,v=p*3;l[p]=255<<24|r[v+2]<<16|r[v+1]<<8|r[v],r[v]==m&&r[v+1]==y&&r[v+2]==w&&(o[x+3]=0)}if(d==16)for(var p=0;p<i;p++){var x=p<<2,v=p*6;l[p]=255<<24|r[v+4]<<16|r[v+2]<<8|r[v],c(r,v)==m&&c(r,v+2)==y&&c(r,v+4)==w&&(o[x+3]=0)}}}else if(u==3){var b=n.tabs.PLTE,A=n.tabs.tRNS,S=A?A.length:0;if(d==1)for(var P=0;P<t;P++)for(var F=P*a,k=P*e,p=0;p<e;p++){var x=k+p<<2,D=r[F+(p>>3)]>>7-((p&7)<<0)&1,_=3*D;o[x]=b[_],o[x+1]=b[_+1],o[x+2]=b[_+2],o[x+3]=D<S?A[D]:255}if(d==2)for(var P=0;P<t;P++)for(var F=P*a,k=P*e,p=0;p<e;p++){var x=k+p<<2,D=r[F+(p>>2)]>>6-((p&3)<<1)&3,_=3*D;o[x]=b[_],o[x+1]=b[_+1],o[x+2]=b[_+2],o[x+3]=D<S?A[D]:255}if(d==4)for(var P=0;P<t;P++)for(var F=P*a,k=P*e,p=0;p<e;p++){var x=k+p<<2,D=r[F+(p>>1)]>>4-((p&1)<<2)&15,_=3*D;o[x]=b[_],o[x+1]=b[_+1],o[x+2]=b[_+2],o[x+3]=D<S?A[D]:255}if(d==8)for(var p=0;p<i;p++){var x=p<<2,D=r[p],_=3*D;o[x]=b[_],o[x+1]=b[_+1],o[x+2]=b[_+2],o[x+3]=D<S?A[D]:255}}else if(u==4){if(d==8)for(var p=0;p<i;p++){var x=p<<2,B=p<<1,N=r[B];o[x]=N,o[x+1]=N,o[x+2]=N,o[x+3]=r[B+1]}if(d==16)for(var p=0;p<i;p++){var x=p<<2,B=p<<2,N=r[B];o[x]=N,o[x+1]=N,o[x+2]=N,o[x+3]=r[B+2]}}else if(u==0)for(var m=n.tabs.tRNS?n.tabs.tRNS:-1,P=0;P<t;P++){var G=P*a,O=P*e;if(d==1)for(var R=0;R<e;R++){var N=255*(r[G+(R>>>3)]>>>7-(R&7)&1),J=N==m*255?0:255;l[O+R]=J<<24|N<<16|N<<8|N}else if(d==2)for(var R=0;R<e;R++){var N=85*(r[G+(R>>>2)]>>>6-((R&3)<<1)&3),J=N==m*85?0:255;l[O+R]=J<<24|N<<16|N<<8|N}else if(d==4)for(var R=0;R<e;R++){var N=17*(r[G+(R>>>1)]>>>4-((R&1)<<2)&15),J=N==m*17?0:255;l[O+R]=J<<24|N<<16|N<<8|N}else if(d==8)for(var R=0;R<e;R++){var N=r[G+R],J=N==m?0:255;l[O+R]=J<<24|N<<16|N<<8|N}else if(d==16)for(var R=0;R<e;R++){var N=r[G+(R<<1)],J=c(r,G+(R<<p))==m?0:255;l[O+R]=J<<24|N<<16|N<<8|N}}return o};q.decode=function(r){for(var e=new Uint8Array(r),t=8,n=q._bin,i=n.readUshort,s=n.readUint,a={tabs:{},frames:[]},o=new Uint8Array(e.length),l=0,u,d=0,c=[137,80,78,71,13,10,26,10],h=0;h<8;h++)if(e[h]!=c[h])throw"The input is not a PNG file!";for(;t<e.length;){var f=n.readUint(e,t);t+=4;var p=n.readASCII(e,t,4);if(t+=4,p=="IHDR")q.decode._IHDR(e,t,a);else if(p=="IDAT"){for(var h=0;h<f;h++)o[l+h]=e[t+h];l+=f}else if(p=="acTL")a.tabs[p]={num_frames:s(e,t),num_plays:s(e,t+4)},u=new Uint8Array(e.length);else if(p=="fcTL"){if(d!=0){var g=a.frames[a.frames.length-1];g.data=q.decode._decompress(a,u.slice(0,d),g.rect.width,g.rect.height),d=0}var v={x:s(e,t+12),y:s(e,t+16),width:s(e,t+4),height:s(e,t+8)},m=i(e,t+22);m=i(e,t+20)/(m==0?100:m);var y={rect:v,delay:Math.round(m*1e3),dispose:e[t+24],blend:e[t+25]};a.frames.push(y)}else if(p=="fdAT"){for(var h=0;h<f-4;h++)u[d+h]=e[t+h+4];d+=f-4}else if(p=="pHYs")a.tabs[p]=[n.readUint(e,t),n.readUint(e,t+4),e[t+8]];else if(p=="cHRM"){a.tabs[p]=[];for(var h=0;h<8;h++)a.tabs[p].push(n.readUint(e,t+h*4))}else if(p=="tEXt"){a.tabs[p]==null&&(a.tabs[p]={});var w=n.nextZero(e,t),x=n.readASCII(e,t,w-t),b=n.readASCII(e,w+1,t+f-w-1);a.tabs[p][x]=b}else if(p=="iTXt"){a.tabs[p]==null&&(a.tabs[p]={});var w=0,A=t;w=n.nextZero(e,A);var x=n.readASCII(e,A,w-A);A=w+1;var S=e[A],P=e[A+1];A+=2,w=n.nextZero(e,A);var F=n.readASCII(e,A,w-A);A=w+1,w=n.nextZero(e,A);var k=n.readUTF8(e,A,w-A);A=w+1;var b=n.readUTF8(e,A,f-(A-t));a.tabs[p][x]=b}else if(p=="PLTE")a.tabs[p]=n.readBytes(e,t,f);else if(p=="hIST"){var D=a.tabs.PLTE.length/3;a.tabs[p]=[];for(var h=0;h<D;h++)a.tabs[p].push(i(e,t+h*2))}else if(p=="tRNS")a.ctype==3?a.tabs[p]=n.readBytes(e,t,f):a.ctype==0?a.tabs[p]=i(e,t):a.ctype==2&&(a.tabs[p]=[i(e,t),i(e,t+2),i(e,t+4)]);else if(p=="gAMA")a.tabs[p]=n.readUint(e,t)/1e5;else if(p=="sRGB")a.tabs[p]=e[t];else if(p=="bKGD")a.ctype==0||a.ctype==4?a.tabs[p]=[i(e,t)]:a.ctype==2||a.ctype==6?a.tabs[p]=[i(e,t),i(e,t+2),i(e,t+4)]:a.ctype==3&&(a.tabs[p]=e[t]);else if(p=="IEND")break;t+=f;var _=n.readUint(e,t);t+=4}if(d!=0){var g=a.frames[a.frames.length-1];g.data=q.decode._decompress(a,u.slice(0,d),g.rect.width,g.rect.height),d=0}return a.data=q.decode._decompress(a,o,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a};q.decode._decompress=function(r,e,t,n){var o=Date.now(),i=q.decode._getBPP(r),s=Math.ceil(t*i/8),a=new Uint8Array((s+1+r.interlace)*n);e=q.decode._inflate(e,a);var o=Date.now();return r.interlace==0?e=q.decode._filterZero(e,r,0,t,n):r.interlace==1&&(e=q.decode._readInterlace(e,r)),e};q.decode._inflate=function(r,e){var t=q.inflateRaw(new Uint8Array(r.buffer,2,r.length-6),e);return t};q.inflateRaw=function(){var r={};return r.H={},r.H.N=function(e,t){var n=Uint8Array,i=0,s=0,a=0,o=0,l=0,u=0,d=0,c=0,h=0,f,p;if(e[0]==3&&e[1]==0)return t||new n(0);var g=r.H,v=g.b,m=g.e,y=g.R,w=g.n,x=g.A,b=g.Z,A=g.m,S=t==null;for(S&&(t=new n(e.length>>>2<<3));i==0;){if(i=v(e,h,1),s=v(e,h+1,2),h+=3,s==0){h&7&&(h+=8-(h&7));var P=(h>>>3)+4,F=e[P-4]|e[P-3]<<8;S&&(t=r.H.W(t,c+F)),t.set(new n(e.buffer,e.byteOffset+P,F),c),h=P+F<<3,c+=F;continue}if(S&&(t=r.H.W(t,c+(1<<17))),s==1&&(f=A.J,p=A.h,u=511,d=31),s==2){a=m(e,h,5)+257,o=m(e,h+5,5)+1,l=m(e,h+10,4)+4,h+=14;for(var k=h,D=1,_=0;_<38;_+=2)A.Q[_]=0,A.Q[_+1]=0;for(var _=0;_<l;_++){var B=m(e,h+_*3,3);A.Q[(A.X[_]<<1)+1]=B,B>D&&(D=B)}h+=3*l,w(A.Q,D),x(A.Q,D,A.u),f=A.w,p=A.d,h=y(A.u,(1<<D)-1,a+o,e,h,A.v);var N=g.V(A.v,0,a,A.C);u=(1<<N)-1;var G=g.V(A.v,a,o,A.D);d=(1<<G)-1,w(A.C,N),x(A.C,N,f),w(A.D,G),x(A.D,G,p)}for(;;){var O=f[b(e,h)&u];h+=O&15;var R=O>>>4;if(!(R>>>8))t[c++]=R;else{if(R==256)break;var J=c+R-254;if(R>264){var le=A.q[R-257];J=c+(le>>>3)+m(e,h,le&7),h+=le&7}var _e=p[b(e,h)&d];h+=_e&15;var Be=_e>>>4,we=A.c[Be],ye=(we>>>4)+v(e,h,we&15);for(h+=we&15;c<J;)t[c]=t[c++-ye],t[c]=t[c++-ye],t[c]=t[c++-ye],t[c]=t[c++-ye];c=J}}}return t.length==c?t:t.slice(0,c)},r.H.W=function(e,t){var n=e.length;if(t<=n)return e;var i=new Uint8Array(n<<1);return i.set(e,0),i},r.H.R=function(e,t,n,i,s,a){for(var o=r.H.e,l=r.H.Z,u=0;u<n;){var d=e[l(i,s)&t];s+=d&15;var c=d>>>4;if(c<=15)a[u]=c,u++;else{var h=0,f=0;c==16?(f=3+o(i,s,2),s+=2,h=a[u-1]):c==17?(f=3+o(i,s,3),s+=3):c==18&&(f=11+o(i,s,7),s+=7);for(var p=u+f;u<p;)a[u]=h,u++}}return s},r.H.V=function(e,t,n,i){for(var s=0,a=0,o=i.length>>>1;a<n;){var l=e[a+t];i[a<<1]=0,i[(a<<1)+1]=l,l>s&&(s=l),a++}for(;a<o;)i[a<<1]=0,i[(a<<1)+1]=0,a++;return s},r.H.n=function(e,t){for(var n=r.H.m,i=e.length,s,a,o,l,u,d=n.j,l=0;l<=t;l++)d[l]=0;for(l=1;l<i;l+=2)d[e[l]]++;var c=n.K;for(s=0,d[0]=0,a=1;a<=t;a++)s=s+d[a-1]<<1,c[a]=s;for(o=0;o<i;o+=2)u=e[o+1],u!=0&&(e[o]=c[u],c[u]++)},r.H.A=function(e,t,n){for(var i=e.length,s=r.H.m,a=s.r,o=0;o<i;o+=2)if(e[o+1]!=0)for(var l=o>>1,u=e[o+1],d=l<<4|u,c=t-u,h=e[o]<<c,f=h+(1<<c);h!=f;){var p=a[h]>>>15-t;n[p]=d,h++}},r.H.l=function(e,t){for(var n=r.H.m.r,i=15-t,s=0;s<e.length;s+=2){var a=e[s]<<t-e[s+1];e[s]=n[a]>>>i}},r.H.M=function(e,t,n){n=n<<(t&7);var i=t>>>3;e[i]|=n,e[i+1]|=n>>>8},r.H.I=function(e,t,n){n=n<<(t&7);var i=t>>>3;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},r.H.e=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<n)-1},r.H.b=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<n)-1},r.H.Z=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)},r.H.i=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16|e[(t>>>3)+3]<<24)>>>(t&7)},r.H.m=function(){var e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],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,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[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,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){for(var e=r.H.m,t=32768,n=0;n<t;n++){var i=n;i=(i&2863311530)>>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,e.r[n]=(i>>>16|i<<16)>>>17}function s(a,o,l){for(;o--!=0;)a.push(0,l)}for(var n=0;n<32;n++)e.q[n]=e.S[n]<<3|e.T[n],e.c[n]=e.p[n]<<4|e.z[n];s(e._,144,8),s(e._,112,9),s(e._,24,7),s(e._,8,8),r.H.n(e._,9),r.H.A(e._,9,e.J),r.H.l(e._,9),s(e.$,32,5),r.H.n(e.$,5),r.H.A(e.$,5,e.h),r.H.l(e.$,5),s(e.Q,19,0),s(e.C,286,0),s(e.D,30,0),s(e.v,320,0)}(),r.H.N}();q.decode._readInterlace=function(r,e){for(var t=e.width,n=e.height,i=q.decode._getBPP(e),s=i>>3,a=Math.ceil(t*i/8),o=new Uint8Array(n*a),l=0,u=[0,0,4,0,2,0,1],d=[0,4,0,2,0,1,0],c=[8,8,8,4,4,2,2],h=[8,8,4,4,2,2,1],f=0;f<7;){for(var p=c[f],g=h[f],v=0,m=0,y=u[f];y<n;)y+=p,m++;for(var w=d[f];w<t;)w+=g,v++;var x=Math.ceil(v*i/8);q.decode._filterZero(r,e,l,v,m);for(var b=0,A=u[f];A<n;){for(var S=d[f],P=l+b*x<<3;S<t;){if(i==1){var F=r[P>>3];F=F>>7-(P&7)&1,o[A*a+(S>>3)]|=F<<7-((S&7)<<0)}if(i==2){var F=r[P>>3];F=F>>6-(P&7)&3,o[A*a+(S>>2)]|=F<<6-((S&3)<<1)}if(i==4){var F=r[P>>3];F=F>>4-(P&7)&15,o[A*a+(S>>1)]|=F<<4-((S&1)<<2)}if(i>=8)for(var k=A*a+S*s,D=0;D<s;D++)o[k+D]=r[(P>>3)+D];P+=i,S+=g}b++,A+=p}v*m!=0&&(l+=m*(1+x)),f=f+1}return o};q.decode._getBPP=function(r){var e=[1,null,3,1,2,null,4][r.ctype];return e*r.depth};q.decode._filterZero=function(r,e,t,n,i){var s=q.decode._getBPP(e),a=Math.ceil(n*s/8),o=q.decode._paeth;s=Math.ceil(s/8);var l=0,u=1,d=r[t],c=0;if(d>1&&(r[t]=[0,0,1][d-2]),d==3)for(c=s;c<a;c++)r[c+1]=r[c+1]+(r[c+1-s]>>>1)&255;for(var h=0;h<i;h++)if(l=t+h*a,u=l+h+1,d=r[u-1],c=0,d==0)for(;c<a;c++)r[l+c]=r[u+c];else if(d==1){for(;c<s;c++)r[l+c]=r[u+c];for(;c<a;c++)r[l+c]=r[u+c]+r[l+c-s]}else if(d==2)for(;c<a;c++)r[l+c]=r[u+c]+r[l+c-a];else if(d==3){for(;c<s;c++)r[l+c]=r[u+c]+(r[l+c-a]>>>1);for(;c<a;c++)r[l+c]=r[u+c]+(r[l+c-a]+r[l+c-s]>>>1)}else{for(;c<s;c++)r[l+c]=r[u+c]+o(0,r[l+c-a],0);for(;c<a;c++)r[l+c]=r[u+c]+o(r[l+c-s],r[l+c-a],r[l+c-s-a])}return r};q.decode._paeth=function(r,e,t){var n=r+e-t,i=n-r,s=n-e,a=n-t;return i*i<=s*s&&i*i<=a*a?r:s*s<=a*a?e:t};q.decode._IHDR=function(r,e,t){var n=q._bin;t.width=n.readUint(r,e),e+=4,t.height=n.readUint(r,e),e+=4,t.depth=r[e],e++,t.ctype=r[e],e++,t.compress=r[e],e++,t.filter=r[e],e++,t.interlace=r[e],e++};q._bin={nextZero:function(r,e){for(;r[e]!=0;)e++;return e},readUshort:function(r,e){return r[e]<<8|r[e+1]},writeUshort:function(r,e,t){r[e]=t>>8&255,r[e+1]=t&255},readUint:function(r,e){return r[e]*(256*256*256)+(r[e+1]<<16|r[e+2]<<8|r[e+3])},writeUint:function(r,e,t){r[e]=t>>24&255,r[e+1]=t>>16&255,r[e+2]=t>>8&255,r[e+3]=t&255},readASCII:function(r,e,t){for(var n="",i=0;i<t;i++)n+=String.fromCharCode(r[e+i]);return n},writeASCII:function(r,e,t){for(var n=0;n<t.length;n++)r[e+n]=t.charCodeAt(n)},readBytes:function(r,e,t){for(var n=[],i=0;i<t;i++)n.push(r[e+i]);return n},pad:function(r){return r.length<2?"0"+r:r},readUTF8:function(r,e,t){for(var n="",i,s=0;s<t;s++)n+="%"+q._bin.pad(r[e+s].toString(16));try{i=decodeURIComponent(n)}catch{return q._bin.readASCII(r,e,t)}return i}};q._copyTile=function(r,e,t,n,i,s,a,o,l){for(var u=Math.min(e,i),d=Math.min(t,s),c=0,h=0,f=0;f<d;f++)for(var p=0;p<u;p++)if(a>=0&&o>=0?(c=f*e+p<<2,h=(o+f)*i+a+p<<2):(c=(-o+f)*e-a+p<<2,h=f*i+p<<2),l==0)n[h]=r[c],n[h+1]=r[c+1],n[h+2]=r[c+2],n[h+3]=r[c+3];else if(l==1){var g=r[c+3]*.00392156862745098,v=r[c]*g,m=r[c+1]*g,y=r[c+2]*g,w=n[h+3]*(1/255),x=n[h]*w,b=n[h+1]*w,A=n[h+2]*w,S=1-g,P=g+w*S,F=P==0?0:1/P;n[h+3]=255*P,n[h+0]=(v+x*S)*F,n[h+1]=(m+b*S)*F,n[h+2]=(y+A*S)*F}else if(l==2){var g=r[c+3],v=r[c],m=r[c+1],y=r[c+2],w=n[h+3],x=n[h],b=n[h+1],A=n[h+2];g==w&&v==x&&m==b&&y==A?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=v,n[h+1]=m,n[h+2]=y,n[h+3]=g)}else if(l==3){var g=r[c+3],v=r[c],m=r[c+1],y=r[c+2],w=n[h+3],x=n[h],b=n[h+1],A=n[h+2];if(g==w&&v==x&&m==b&&y==A)continue;if(g<220&&w>20)return!1}return!0};q.encode=function(r,e,t,n,i,s,a){n==null&&(n=0),a==null&&(a=!1);var o=q.encode.compress(r,e,t,n,[!1,!1,!1,0,a]);return q.encode.compressPNG(o,-1),q.encode._main(o,e,t,i,s)};q.encodeLL=function(r,e,t,n,i,s,a,o){for(var l={ctype:0+(n==1?0:2)+(i==0?0:4),depth:s,frames:[]},u=Date.now(),d=(n+i)*s,c=d*e,h=0;h<r.length;h++)l.frames.push({rect:{x:0,y:0,width:e,height:t},img:new Uint8Array(r[h]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(c/8)});q.encode.compressPNG(l,0,!0);var f=q.encode._main(l,e,t,a,o);return f};q.encode._main=function(r,e,t,n,i){i==null&&(i={});var s=q.crc.crc,a=q._bin.writeUint,o=q._bin.writeUshort,l=q._bin.writeASCII,u=8,d=r.frames.length>1,c=!1,h=33+(d?20:0);if(i.sRGB!=null&&(h+=13),i.pHYs!=null&&(h+=21),r.ctype==3){for(var f=r.plte.length,p=0;p<f;p++)r.plte[p]>>>24!=255&&(c=!0);h+=8+f*3+4+(c?8+f*1+4:0)}for(var g=0;g<r.frames.length;g++){var v=r.frames[g];d&&(h+=38),h+=v.cimg.length+12,g!=0&&(h+=4)}h+=12;for(var m=new Uint8Array(h),y=[137,80,78,71,13,10,26,10],p=0;p<8;p++)m[p]=y[p];if(a(m,u,13),u+=4,l(m,u,"IHDR"),u+=4,a(m,u,e),u+=4,a(m,u,t),u+=4,m[u]=r.depth,u++,m[u]=r.ctype,u++,m[u]=0,u++,m[u]=0,u++,m[u]=0,u++,a(m,u,s(m,u-17,17)),u+=4,i.sRGB!=null&&(a(m,u,1),u+=4,l(m,u,"sRGB"),u+=4,m[u]=i.sRGB,u++,a(m,u,s(m,u-5,5)),u+=4),i.pHYs!=null&&(a(m,u,9),u+=4,l(m,u,"pHYs"),u+=4,a(m,u,i.pHYs[0]),u+=4,a(m,u,i.pHYs[1]),u+=4,m[u]=i.pHYs[2],u++,a(m,u,s(m,u-13,13)),u+=4),d&&(a(m,u,8),u+=4,l(m,u,"acTL"),u+=4,a(m,u,r.frames.length),u+=4,a(m,u,i.loop!=null?i.loop:0),u+=4,a(m,u,s(m,u-12,12)),u+=4),r.ctype==3){var f=r.plte.length;a(m,u,f*3),u+=4,l(m,u,"PLTE"),u+=4;for(var p=0;p<f;p++){var w=p*3,x=r.plte[p],b=x&255,A=x>>>8&255,S=x>>>16&255;m[u+w+0]=b,m[u+w+1]=A,m[u+w+2]=S}if(u+=f*3,a(m,u,s(m,u-f*3-4,f*3+4)),u+=4,c){a(m,u,f),u+=4,l(m,u,"tRNS"),u+=4;for(var p=0;p<f;p++)m[u+p]=r.plte[p]>>>24&255;u+=f,a(m,u,s(m,u-f-4,f+4)),u+=4}}for(var P=0,g=0;g<r.frames.length;g++){var v=r.frames[g];d&&(a(m,u,26),u+=4,l(m,u,"fcTL"),u+=4,a(m,u,P++),u+=4,a(m,u,v.rect.width),u+=4,a(m,u,v.rect.height),u+=4,a(m,u,v.rect.x),u+=4,a(m,u,v.rect.y),u+=4,o(m,u,n[g]),u+=2,o(m,u,1e3),u+=2,m[u]=v.dispose,u++,m[u]=v.blend,u++,a(m,u,s(m,u-30,30)),u+=4);var F=v.cimg,f=F.length;a(m,u,f+(g==0?0:4)),u+=4;var k=u;l(m,u,g==0?"IDAT":"fdAT"),u+=4,g!=0&&(a(m,u,P++),u+=4),m.set(F,u),u+=f,a(m,u,s(m,k,u-k)),u+=4}return a(m,u,0),u+=4,l(m,u,"IEND"),u+=4,a(m,u,s(m,u-4,4)),u+=4,m.buffer};q.encode.compressPNG=function(r,e,t){for(var n=0;n<r.frames.length;n++){var i=r.frames[n],s=i.rect.width,a=i.rect.height,o=new Uint8Array(a*i.bpl+a);i.cimg=q.encode._filterZero(i.img,a,i.bpp,i.bpl,o,e,t)}};q.encode.compress=function(r,e,t,n,i){for(var s=i[0],a=i[1],o=i[2],l=i[3],u=i[4],d=6,c=8,h=255,f=0;f<r.length;f++)for(var p=new Uint8Array(r[f]),g=p.length,v=0;v<g;v+=4)h&=p[v+3];var m=h!=255,y=q.encode.framize(r,e,t,s,a,o),w={},x=[],b=[];if(n!=0){for(var A=[],v=0;v<y.length;v++)A.push(y[v].img.buffer);for(var S=q.encode.concatRGBA(A),P=q.quantize(S,n),F=0,k=new Uint8Array(P.abuf),v=0;v<y.length;v++){var D=y[v].img,_=D.length;b.push(new Uint8Array(P.inds.buffer,F>>2,_>>2));for(var f=0;f<_;f+=4)D[f]=k[F+f],D[f+1]=k[F+f+1],D[f+2]=k[F+f+2],D[f+3]=k[F+f+3];F+=_}for(var v=0;v<P.plte.length;v++)x.push(P.plte[v].est.rgba)}else for(var f=0;f<y.length;f++){var B=y[f],N=new Uint32Array(B.img.buffer),G=B.rect.width,g=N.length,O=new Uint8Array(g);b.push(O);for(var v=0;v<g;v++){var R=N[v];if(v!=0&&R==N[v-1])O[v]=O[v-1];else if(v>G&&R==N[v-G])O[v]=O[v-G];else{var J=w[R];if(J==null&&(w[R]=J=x.length,x.push(R),x.length>=300))break;O[v]=J}}}var le=x.length;le<=256&&u==!1&&(le<=2?c=1:le<=4?c=2:le<=16?c=4:c=8,c=Math.max(c,l));for(var f=0;f<y.length;f++){var B=y[f],_e=B.rect.x,Be=B.rect.y,G=B.rect.width,we=B.rect.height,ye=B.img,$r=new Uint32Array(ye.buffer),Ht=4*G,W=4;if(le<=256&&u==!1){Ht=Math.ceil(c*G/8);for(var M=new Uint8Array(Ht*we),H=b[f],ue=0;ue<we;ue++){var v=ue*Ht,Te=ue*G;if(c==8)for(var K=0;K<G;K++)M[v+K]=H[Te+K];else if(c==4)for(var K=0;K<G;K++)M[v+(K>>1)]|=H[Te+K]<<4-(K&1)*4;else if(c==2)for(var K=0;K<G;K++)M[v+(K>>2)]|=H[Te+K]<<6-(K&3)*2;else if(c==1)for(var K=0;K<G;K++)M[v+(K>>3)]|=H[Te+K]<<7-(K&7)*1}ye=M,d=3,W=1}else if(m==!1&&y.length==1){for(var M=new Uint8Array(G*we*3),Ye=G*we,v=0;v<Ye;v++){var D=v*3,Ke=v*4;M[D]=ye[Ke],M[D+1]=ye[Ke+1],M[D+2]=ye[Ke+2]}ye=M,d=2,W=3,Ht=3*G}B.img=ye,B.bpl=Ht,B.bpp=W}return{ctype:d,depth:c,plte:x,frames:y}};q.encode.framize=function(r,e,t,n,i,s){for(var a=[],o=0;o<r.length;o++){var l=new Uint8Array(r[o]),u=new Uint32Array(l.buffer),d,c=0,h=0,f=e,p=t,g=n?1:0;if(o!=0){for(var v=s||n||o==1||a[o-2].dispose!=0?1:2,m=0,y=1e9,w=0;w<v;w++){for(var B=new Uint8Array(r[o-1-w]),x=new Uint32Array(r[o-1-w]),b=e,A=t,S=-1,P=-1,F=0;F<t;F++)for(var k=0;k<e;k++){var D=F*e+k;u[D]!=x[D]&&(k<b&&(b=k),k>S&&(S=k),F<A&&(A=F),F>P&&(P=F))}S==-1&&(b=A=S=P=0),i&&((b&1)==1&&b--,(A&1)==1&&A--);var _=(S-b+1)*(P-A+1);_<y&&(y=_,m=w,c=b,h=A,f=S-b+1,p=P-A+1)}var B=new Uint8Array(r[o-1-m]);m==1&&(a[o-1].dispose=2),d=new Uint8Array(f*p*4),q._copyTile(B,e,t,d,f,p,-c,-h,0),g=q._copyTile(l,e,t,d,f,p,-c,-h,3)?1:0,g==1?q.encode._prepareDiff(l,e,t,d,{x:c,y:h,width:f,height:p}):q._copyTile(l,e,t,d,f,p,-c,-h,0)}else d=l.slice(0);a.push({rect:{x:c,y:h,width:f,height:p},img:d,blend:g,dispose:0})}if(n)for(var o=0;o<a.length;o++){var N=a[o];if(N.blend!=1){var G=N.rect,O=a[o-1].rect,R=Math.min(G.x,O.x),J=Math.min(G.y,O.y),le=Math.max(G.x+G.width,O.x+O.width),_e=Math.max(G.y+G.height,O.y+O.height),Be={x:R,y:J,width:le-R,height:_e-J};a[o-1].dispose=1,o-1!=0&&q.encode._updateFrame(r,e,t,a,o-1,Be,i),q.encode._updateFrame(r,e,t,a,o,Be,i)}}var we=0;if(r.length!=1)for(var D=0;D<a.length;D++){var N=a[D];we+=N.rect.width*N.rect.height}return a};q.encode._updateFrame=function(r,e,t,n,i,s,a){for(var o=Uint8Array,l=Uint32Array,u=new o(r[i-1]),d=new l(r[i-1]),c=i+1<r.length?new o(r[i+1]):null,h=new o(r[i]),f=new l(h.buffer),p=e,g=t,v=-1,m=-1,y=0;y<s.height;y++)for(var w=0;w<s.width;w++){var x=s.x+w,b=s.y+y,A=b*e+x,S=f[A];S==0||n[i-1].dispose==0&&d[A]==S&&(c==null||c[A*4+3]!=0)||(x<p&&(p=x),x>v&&(v=x),b<g&&(g=b),b>m&&(m=b))}v==-1&&(p=g=v=m=0),a&&((p&1)==1&&p--,(g&1)==1&&g--),s={x:p,y:g,width:v-p+1,height:m-g+1};var P=n[i];P.rect=s,P.blend=1,P.img=new Uint8Array(s.width*s.height*4),n[i-1].dispose==0?(q._copyTile(u,e,t,P.img,s.width,s.height,-s.x,-s.y,0),q.encode._prepareDiff(h,e,t,P.img,s)):q._copyTile(h,e,t,P.img,s.width,s.height,-s.x,-s.y,0)};q.encode._prepareDiff=function(r,e,t,n,i){q._copyTile(r,e,t,n,i.width,i.height,-i.x,-i.y,2)};q.encode._filterZero=function(r,e,t,n,i,s,a){var o=[],l=[0,1,2,3,4];s!=-1?l=[s]:(e*n>5e5||t==1)&&(l=[0]);var u;a&&(u={level:0});for(var d=a&&UZIP!=null?UZIP:SI.default,c=0;c<l.length;c++){for(var h=0;h<e;h++)q.encode._filterLine(i,r,h,n,t,l[c]);o.push(d.deflate(i,u))}for(var f,p=1e9,c=0;c<o.length;c++)o[c].length<p&&(f=c,p=o[c].length);return o[f]};q.encode._filterLine=function(r,e,t,n,i,s){var a=t*n,o=a+t,l=q.decode._paeth;if(r[o]=s,o++,s==0)if(n<500)for(var u=0;u<n;u++)r[o+u]=e[a+u];else r.set(new Uint8Array(e.buffer,a,n),o);else if(s==1){for(var u=0;u<i;u++)r[o+u]=e[a+u];for(var u=i;u<n;u++)r[o+u]=e[a+u]-e[a+u-i]+256&255}else if(t==0){for(var u=0;u<i;u++)r[o+u]=e[a+u];if(s==2)for(var u=i;u<n;u++)r[o+u]=e[a+u];if(s==3)for(var u=i;u<n;u++)r[o+u]=e[a+u]-(e[a+u-i]>>1)+256&255;if(s==4)for(var u=i;u<n;u++)r[o+u]=e[a+u]-l(e[a+u-i],0,0)+256&255}else{if(s==2)for(var u=0;u<n;u++)r[o+u]=e[a+u]+256-e[a+u-n]&255;if(s==3){for(var u=0;u<i;u++)r[o+u]=e[a+u]+256-(e[a+u-n]>>1)&255;for(var u=i;u<n;u++)r[o+u]=e[a+u]+256-(e[a+u-n]+e[a+u-i]>>1)&255}if(s==4){for(var u=0;u<i;u++)r[o+u]=e[a+u]+256-l(0,e[a+u-n],0)&255;for(var u=i;u<n;u++)r[o+u]=e[a+u]+256-l(e[a+u-i],e[a+u-n],e[a+u-i-n])&255}}};q.crc={table:function(){for(var r=new Uint32Array(256),e=0;e<256;e++){for(var t=e,n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;r[e]=t}return r}(),update:function(r,e,t,n){for(var i=0;i<n;i++)r=q.crc.table[(r^e[t+i])&255]^r>>>8;return r},crc:function(r,e,t){return q.crc.update(4294967295,r,e,t)^4294967295}};q.quantize=function(r,e){for(var t=new Uint8Array(r),n=t.slice(0),i=new Uint32Array(n.buffer),s=q.quantize.getKDtree(n,e),a=s[0],o=s[1],l=q.quantize.planeDst,u=t,d=i,c=u.length,h=new Uint8Array(t.length>>2),f=0;f<c;f+=4){var p=u[f]*.00392156862745098,g=u[f+1]*(1/255),v=u[f+2]*(1/255),m=u[f+3]*(1/255),y=q.quantize.getNearest(a,p,g,v,m);h[f>>2]=y.ind,d[f>>2]=y.est.rgba}return{abuf:n.buffer,inds:h,plte:o}};q.quantize.getKDtree=function(r,e,t){t==null&&(t=1e-4);var n=new Uint32Array(r.buffer),i={i0:0,i1:r.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=q.quantize.stats(r,i.i0,i.i1),i.est=q.quantize.estats(i.bst);for(var s=[i];s.length<e;){for(var a=0,o=0,l=0;l<s.length;l++)s[l].est.L>a&&(a=s[l].est.L,o=l);if(a<t)break;var u=s[o],d=q.quantize.splitPixels(r,n,u.i0,u.i1,u.est.e,u.est.eMq255),c=u.i0>=d||u.i1<=d;if(c){u.est.L=0;continue}var h={i0:u.i0,i1:d,bst:null,est:null,tdst:0,left:null,right:null};h.bst=q.quantize.stats(r,h.i0,h.i1),h.est=q.quantize.estats(h.bst);var f={i0:d,i1:u.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:u.bst.N-h.bst.N};for(var l=0;l<16;l++)f.bst.R[l]=u.bst.R[l]-h.bst.R[l];for(var l=0;l<4;l++)f.bst.m[l]=u.bst.m[l]-h.bst.m[l];f.est=q.quantize.estats(f.bst),u.left=h,u.right=f,s[o]=h,s.push(f)}s.sort(function(p,g){return g.bst.N-p.bst.N});for(var l=0;l<s.length;l++)s[l].ind=l;return[i,s]};q.quantize.getNearest=function(r,e,t,n,i){if(r.left==null)return r.tdst=q.quantize.dist(r.est.q,e,t,n,i),r;var s=q.quantize.planeDst(r.est,e,t,n,i),a=r.left,o=r.right;s>0&&(a=r.right,o=r.left);var l=q.quantize.getNearest(a,e,t,n,i);if(l.tdst<=s*s)return l;var u=q.quantize.getNearest(o,e,t,n,i);return u.tdst<l.tdst?u:l};q.quantize.planeDst=function(r,e,t,n,i){var s=r.e;return s[0]*e+s[1]*t+s[2]*n+s[3]*i-r.eMq};q.quantize.dist=function(r,e,t,n,i){var s=e-r[0],a=t-r[1],o=n-r[2],l=i-r[3];return s*s+a*a+o*o+l*l};q.quantize.splitPixels=function(r,e,t,n,i,s){var a=q.quantize.vecDot;n-=4;for(var o=0;t<n;){for(;a(r,t,i)<=s;)t+=4;for(;a(r,n,i)>s;)n-=4;if(t>=n)break;var l=e[t>>2];e[t>>2]=e[n>>2],e[n>>2]=l,t+=4,n-=4}for(;a(r,t,i)>s;)t-=4;return t+4};q.quantize.vecDot=function(r,e,t){return r[e]*t[0]+r[e+1]*t[1]+r[e+2]*t[2]+r[e+3]*t[3]};q.quantize.stats=function(r,e,t){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],s=t-e>>2,a=e;a<t;a+=4){var o=r[a]*.00392156862745098,l=r[a+1]*(1/255),u=r[a+2]*(1/255),d=r[a+3]*(1/255);i[0]+=o,i[1]+=l,i[2]+=u,i[3]+=d,n[0]+=o*o,n[1]+=o*l,n[2]+=o*u,n[3]+=o*d,n[5]+=l*l,n[6]+=l*u,n[7]+=l*d,n[10]+=u*u,n[11]+=u*d,n[15]+=d*d}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:s}};q.quantize.estats=function(r){var e=r.R,t=r.m,n=r.N,i=t[0],s=t[1],a=t[2],o=t[3],l=n==0?0:1/n,u=[e[0]-i*i*l,e[1]-i*s*l,e[2]-i*a*l,e[3]-i*o*l,e[4]-s*i*l,e[5]-s*s*l,e[6]-s*a*l,e[7]-s*o*l,e[8]-a*i*l,e[9]-a*s*l,e[10]-a*a*l,e[11]-a*o*l,e[12]-o*i*l,e[13]-o*s*l,e[14]-o*a*l,e[15]-o*o*l],d=u,c=q.M4,h=[.5,.5,.5,.5],f=0,p=0;if(n!=0)for(var g=0;g<10&&(h=c.multVec(d,h),p=Math.sqrt(c.dot(h,h)),h=c.sml(1/p,h),!(Math.abs(p-f)<1e-9));g++)f=p;var v=[i*l,s*l,a*l,o*l],m=c.dot(c.sml(255,v),h);return{Cov:u,q:v,e:h,L:f,eMq255:m,eMq:c.dot(h,v),rgba:(Math.round(255*v[3])<<24|Math.round(255*v[2])<<16|Math.round(255*v[1])<<8|Math.round(255*v[0])<<0)>>>0}};q.M4={multVec:function(r,e){return[r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3],r[4]*e[0]+r[5]*e[1]+r[6]*e[2]+r[7]*e[3],r[8]*e[0]+r[9]*e[1]+r[10]*e[2]+r[11]*e[3],r[12]*e[0]+r[13]*e[1]+r[14]*e[2]+r[15]*e[3]]},dot:function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]},sml:function(r,e){return[r*e[0],r*e[1],r*e[2],r*e[3]]}};q.encode.concatRGBA=function(r){for(var e=0,t=0;t<r.length;t++)e+=r[t].byteLength;for(var n=new Uint8Array(e),i=0,t=0;t<r.length;t++){for(var s=new Uint8Array(r[t]),a=s.length,o=0;o<a;o+=4){var l=s[o],u=s[o+1],d=s[o+2],c=s[o+3];c==0&&(l=u=d=0),n[i+o]=l,n[i+o+1]=u,n[i+o+2]=d,n[i+o+3]=c}i+=a}return n.buffer};var FI=q;Tc.default=FI});var PA=E(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.PNG=As.PngType=void 0;var DI=(j(),U(L)),SA=DI.__importDefault(AA()),EI=function(r){if(r===0)return Na.Greyscale;if(r===2)return Na.Truecolour;if(r===3)return Na.IndexedColour;if(r===4)return Na.GreyscaleWithAlpha;if(r===6)return Na.TruecolourWithAlpha;throw new Error("Unknown color type: "+r)},CI=function(r){for(var e=Math.floor(r.length/4),t=new Uint8Array(e*3),n=new Uint8Array(e*1),i=0,s=0,a=0;i<r.length;)t[s++]=r[i++],t[s++]=r[i++],t[s++]=r[i++],n[a++]=r[i++];return{rgbChannel:t,alphaChannel:n}},Na;(function(r){r.Greyscale="Greyscale",r.Truecolour="Truecolour",r.IndexedColour="IndexedColour",r.GreyscaleWithAlpha="GreyscaleWithAlpha",r.TruecolourWithAlpha="TruecolourWithAlpha"})(Na=As.PngType||(As.PngType={}));var TI=function(){function r(e){var t=SA.default.decode(e),n=SA.default.toRGBA8(t);if(n.length>1)throw new Error("Animated PNGs are not supported");var i=new Uint8Array(n[0]),s=CI(i),a=s.rgbChannel,o=s.alphaChannel;this.rgbChannel=a;var l=o.some(function(u){return u<255});l&&(this.alphaChannel=o),this.type=EI(t.ctype),this.width=t.width,this.height=t.height,this.bitsPerComponent=8}return r.load=function(e){return new r(e)},r}();As.PNG=TI});var FA=E(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var kc=(j(),U(L)),kI=PA(),RI=function(){function r(e){this.image=e,this.bitsPerComponent=e.bitsPerComponent,this.width=e.width,this.height=e.height,this.colorSpace="DeviceRGB"}return r.for=function(e){return kc.__awaiter(this,void 0,void 0,function(){var t;return kc.__generator(this,function(n){return t=kI.PNG.load(e),[2,new r(t)]})})},r.prototype.embedIntoContext=function(e,t){return kc.__awaiter(this,void 0,void 0,function(){var n,i;return kc.__generator(this,function(s){return n=this.embedAlphaChannel(e),i=e.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),t?(e.assign(t,i),[2,t]):[2,e.register(i)]})})},r.prototype.embedAlphaChannel=function(e){if(this.image.alphaChannel){var t=e.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return e.register(t)}},r}();Om.default=RI});var Nm=E(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var _I=function(){function r(e,t,n){this.bytes=e,this.start=t||0,this.pos=this.start,this.end=t&&n?t+n:this.bytes.length}return Object.defineProperty(r.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),r.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},r.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},r.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),i=this.getByte();return(e<<24)+(t<<16)+(n<<8)+i},r.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n=this.bytes,i=this.pos,s=this.end;if(e){var o=i+e;o>s&&(o=s),this.pos=o;var a=n.subarray(i,o);return t?new Uint8ClampedArray(a):a}else{var a=n.subarray(i,s);return t?new Uint8ClampedArray(a):a}},r.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},r.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},r.prototype.skip=function(e){e||(e=1),this.pos+=e},r.prototype.reset=function(){this.pos=this.start},r.prototype.moveStart=function(){this.start=this.pos},r.prototype.makeSubStream=function(e,t){return new r(this.bytes,e,t)},r.prototype.decode=function(){return this.bytes},r}();Mm.default=_I});var La=E(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var II=(j(),U(L)),OI=ze(),MI=II.__importDefault(Nm()),NI=new Uint8Array(0),LI=function(){function r(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=NI,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}return Object.defineProperty(r.prototype,"isEmpty",{get:function(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0},enumerable:!1,configurable:!0}),r.prototype.getByte=function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},r.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},r.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),i=this.getByte();return(e<<24)+(t<<16)+(n<<8)+i},r.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n,i=this.pos;if(e){for(this.ensureBuffer(i+e),n=i+e;!this.eof&&this.bufferLength<n;)this.readBlock();var s=this.bufferLength;n>s&&(n=s)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(i,n);return t&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},r.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},r.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},r.prototype.skip=function(e){e||(e=1),this.pos+=e},r.prototype.reset=function(){this.pos=0},r.prototype.makeSubStream=function(e,t){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new MI.default(this.buffer,e,t)},r.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},r.prototype.readBlock=function(){throw new OI.MethodNotImplementedError(this.constructor.name,"readBlock")},r.prototype.ensureBuffer=function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var n=this.minBufferLength;n<e;)n*=2;var i=new Uint8Array(n);return i.set(t),this.buffer=i},r}();Lm.default=LI});var CA=E(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var EA=(j(),U(L)),jI=EA.__importDefault(La()),DA=function(r){return r===32||r===9||r===13||r===10},BI=function(r){EA.__extends(e,r);function e(t,n){var i=r.call(this,n)||this;return i.stream=t,i.input=new Uint8Array(5),n&&(n=.8*n),i}return e.prototype.readBlock=function(){for(var t=126,n=122,i=-1,s=this.stream,a=s.getByte();DA(a);)a=s.getByte();if(a===i||a===t){this.eof=!0;return}var o=this.bufferLength,l,u;if(a===n){for(l=this.ensureBuffer(o+4),u=0;u<4;++u)l[o+u]=0;this.bufferLength+=4}else{var d=this.input;for(d[0]=a,u=1;u<5;++u){for(a=s.getByte();DA(a);)a=s.getByte();if(d[u]=a,a===i||a===t)break}if(l=this.ensureBuffer(o+u-1),this.bufferLength+=u-1,u<5){for(;u<5;++u)d[u]=117;this.eof=!0}var c=0;for(u=0;u<5;++u)c=c*85+(d[u]-33);for(u=3;u>=0;--u)l[o+u]=c&255,c>>=8}},e}(jI.default);jm.default=BI});var kA=E(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var TA=(j(),U(L)),UI=TA.__importDefault(La()),qI=function(r){TA.__extends(e,r);function e(t,n){var i=r.call(this,n)||this;return i.stream=t,i.firstDigit=-1,n&&(n=.5*n),i}return e.prototype.readBlock=function(){var t=8e3,n=this.stream.getBytes(t);if(!n.length){this.eof=!0;return}for(var i=n.length+1>>1,s=this.ensureBuffer(this.bufferLength+i),a=this.bufferLength,o=this.firstDigit,l=0,u=n.length;l<u;l++){var d=n[l],c=void 0;if(d>=48&&d<=57)c=d&15;else if(d>=65&&d<=70||d>=97&&d<=102)c=(d&15)+9;else if(d===62){this.eof=!0;break}else continue;o<0?o=c:(s[a++]=o<<4|c,o=-1)}o>=0&&this.eof&&(s[a++]=o<<4,o=-1),this.firstDigit=o,this.bufferLength=a},e}(UI.default);Bm.default=qI});var IA=E(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var _A=(j(),U(L)),zI=_A.__importDefault(La()),RA=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),VI=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),HI=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),GI=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],WI=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],KI=function(r){_A.__extends(e,r);function e(t,n){var i=r.call(this,n)||this;i.stream=t;var s=t.getByte(),a=t.getByte();if(s===-1||a===-1)throw new Error("Invalid header in flate stream: "+s+", "+a);if((s&15)!==8)throw new Error("Unknown compression method in flate stream: "+s+", "+a);if(((s<<8)+a)%31!==0)throw new Error("Bad FCHECK in flate stream: "+s+", "+a);if(a&32)throw new Error("FDICT bit set in flate stream: "+s+", "+a);return i.codeSize=0,i.codeBuf=0,i}return e.prototype.readBlock=function(){var t,n,i=this.stream,s=this.getBits(3);if(s&1&&(this.eof=!0),s>>=1,s===0){var a=void 0;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");var o=a;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(o|=a<<8,(a=i.getByte())===-1)throw new Error("Bad block header in flate stream");var l=a;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(l|=a<<8,l!==(~o&65535)&&(o!==0||l!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var u=this.bufferLength;t=this.ensureBuffer(u+o);var d=u+o;if(this.bufferLength=d,o===0)i.peekByte()===-1&&(this.eof=!0);else for(var c=u;c<d;++c){if((a=i.getByte())===-1){this.eof=!0;break}t[c]=a}return}var h,f;if(s===1)h=GI,f=WI;else if(s===2){var p=this.getBits(5)+257,g=this.getBits(5)+1,v=this.getBits(4)+4,m=new Uint8Array(RA.length),y=void 0;for(y=0;y<v;++y)m[RA[y]]=this.getBits(3);var w=this.generateHuffmanTable(m);n=0,y=0;for(var x=p+g,b=new Uint8Array(x),A=void 0,S=void 0,P=void 0;y<x;){var F=this.getCode(w);if(F===16)A=2,S=3,P=n;else if(F===17)A=3,S=3,P=n=0;else if(F===18)A=7,S=11,P=n=0;else{b[y++]=n=F;continue}for(var k=this.getBits(A)+S;k-- >0;)b[y++]=P}h=this.generateHuffmanTable(b.subarray(0,p)),f=this.generateHuffmanTable(b.subarray(p,x))}else throw new Error("Unknown block type in flate stream");t=this.buffer;for(var D=t?t.length:0,_=this.bufferLength;;){var B=this.getCode(h);if(B<256){_+1>=D&&(t=this.ensureBuffer(_+1),D=t.length),t[_++]=B;continue}if(B===256){this.bufferLength=_;return}B-=257,B=VI[B];var N=B>>16;N>0&&(N=this.getBits(N)),n=(B&65535)+N,B=this.getCode(f),B=HI[B],N=B>>16,N>0&&(N=this.getBits(N));var G=(B&65535)+N;_+n>=D&&(t=this.ensureBuffer(_+n),D=t.length);for(var O=0;O<n;++O,++_)t[_]=t[_-G]}},e.prototype.getBits=function(t){for(var n=this.stream,i=this.codeSize,s=this.codeBuf,a;i<t;){if((a=n.getByte())===-1)throw new Error("Bad encoding in flate stream");s|=a<<i,i+=8}return a=s&(1<<t)-1,this.codeBuf=s>>t,this.codeSize=i-=t,a},e.prototype.getCode=function(t){for(var n=this.stream,i=t[0],s=t[1],a=this.codeSize,o=this.codeBuf,l;a<s&&(l=n.getByte())!==-1;)o|=l<<a,a+=8;var u=i[o&(1<<s)-1];typeof i=="number"&&console.log("FLATE:",u);var d=u>>16,c=u&65535;if(d<1||a<d)throw new Error("Bad encoding in flate stream");return this.codeBuf=o>>d,this.codeSize=a-d,c},e.prototype.generateHuffmanTable=function(t){var n=t.length,i=0,s;for(s=0;s<n;++s)t[s]>i&&(i=t[s]);for(var a=1<<i,o=new Int32Array(a),l=1,u=0,d=2;l<=i;++l,u<<=1,d<<=1)for(var c=0;c<n;++c)if(t[c]===l){var h=0,f=u;for(s=0;s<l;++s)h=h<<1|f&1,f>>=1;for(s=h;s<a;s+=d)o[s]=l<<16|c;++u}return[o,i]},e}(zI.default);Um.default=KI});var MA=E(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var OA=(j(),U(L)),XI=OA.__importDefault(La()),YI=function(r){OA.__extends(e,r);function e(t,n,i){var s=r.call(this,n)||this;s.stream=t,s.cachedData=0,s.bitsCached=0;for(var a=4096,o={earlyChange:i,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0},l=0;l<256;++l)o.dictionaryValues[l]=l,o.dictionaryLengths[l]=1;return s.lzwState=o,s}return e.prototype.readBlock=function(){var t=512,n=t*2,i=t,s,a,o,l=this.lzwState;if(l){var u=l.earlyChange,d=l.nextCode,c=l.dictionaryValues,h=l.dictionaryLengths,f=l.dictionaryPrevCodes,p=l.codeLength,g=l.prevCode,v=l.currentSequence,m=l.currentSequenceLength,y=0,w=this.bufferLength,x=this.ensureBuffer(this.bufferLength+n);for(s=0;s<t;s++){var b=this.readBits(p),A=m>0;if(!b||b<256)v[0]=b,m=1;else if(b>=258)if(b<d)for(m=h[b],a=m-1,o=b;a>=0;a--)v[a]=c[o],o=f[o];else v[m++]=v[0];else if(b===256){p=9,d=258,m=0;continue}else{this.eof=!0,delete this.lzwState;break}if(A&&(f[d]=g,h[d]=h[g]+1,c[d]=v[0],d++,p=d+u&d+u-1?p:Math.min(Math.log(d+u)/.6931471805599453+1,12)|0),g=b,y+=m,n<y){do n+=i;while(n<y);x=this.ensureBuffer(this.bufferLength+n)}for(a=0;a<m;a++)x[w++]=v[a]}l.nextCode=d,l.codeLength=p,l.prevCode=g,l.currentSequenceLength=m,this.bufferLength=w}},e.prototype.readBits=function(t){for(var n=this.bitsCached,i=this.cachedData;n<t;){var s=this.stream.getByte();if(s===-1)return this.eof=!0,null;i=i<<8|s,n+=8}return this.bitsCached=n-=t,this.cachedData=i,i>>>n&(1<<t)-1},e}(XI.default);qm.default=YI});var LA=E(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var NA=(j(),U(L)),ZI=NA.__importDefault(La()),JI=function(r){NA.__extends(e,r);function e(t,n){var i=r.call(this,n)||this;return i.stream=t,i}return e.prototype.readBlock=function(){var t=this.stream.getBytes(2);if(!t||t.length<2||t[0]===128){this.eof=!0;return}var n,i=this.bufferLength,s=t[0];if(s<128){if(n=this.ensureBuffer(i+s+1),n[i++]=t[1],s>0){var a=this.stream.getBytes(s);n.set(a,i),i+=s}}else{s=257-s;var o=t[1];n=this.ensureBuffer(i+s+1);for(var l=0;l<s;l++)n[i++]=o}this.bufferLength=i},e}(ZI.default);zm.default=JI});var _c=E(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.decodePDFRawStream=void 0;var _n=(j(),U(L)),UA=ze(),jA=_n.__importDefault(Ut()),qA=_n.__importDefault(Yt()),ln=_n.__importDefault(Ce()),QI=_n.__importDefault(gt()),$I=_n.__importDefault(CA()),eO=_n.__importDefault(kA()),tO=_n.__importDefault(IA()),rO=_n.__importDefault(MA()),nO=_n.__importDefault(LA()),iO=_n.__importDefault(Nm()),BA=function(r,e,t){if(e===ln.default.of("FlateDecode"))return new tO.default(r);if(e===ln.default.of("LZWDecode")){var n=1;if(t instanceof qA.default){var i=t.lookup(ln.default.of("EarlyChange"));i instanceof QI.default&&(n=i.asNumber())}return new rO.default(r,void 0,n)}if(e===ln.default.of("ASCII85Decode"))return new $I.default(r);if(e===ln.default.of("ASCIIHexDecode"))return new eO.default(r);if(e===ln.default.of("RunLengthDecode"))return new nO.default(r);throw new UA.UnsupportedEncodingError(e.asString())};Rc.decodePDFRawStream=function(r){var e=r.dict,t=r.contents,n=new iO.default(t),i=e.lookup(ln.default.of("Filter")),s=e.lookup(ln.default.of("DecodeParms"));if(i instanceof ln.default)n=BA(n,i,s);else if(i instanceof jA.default)for(var a=0,o=i.size();a<o;a++)n=BA(n,i.lookup(a,ln.default),s&&s.lookupMaybe(a,qA.default));else if(i)throw new UA.UnexpectedObjectTypeError([ln.default,jA.default],i);return n}});var VA=E(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var ii=(j(),U(L)),zA=ze(),Ic=ii.__importDefault(gt()),sO=ii.__importDefault(ka()),aO=ii.__importDefault(ni()),oO=_c(),lO=ii.__importDefault(hc()),uO=ii.__importDefault(Ve()),dO=ae(),cO=function(r){var e=r.MediaBox(),t=e.lookup(2,Ic.default).asNumber()-e.lookup(0,Ic.default).asNumber(),n=e.lookup(3,Ic.default).asNumber()-e.lookup(1,Ic.default).asNumber();return{left:0,bottom:0,right:t,top:n}},hO=function(r){return[1,0,0,1,-r.left,-r.bottom]},fO=function(){function r(e,t,n){this.page=e;var i=t??cO(e);this.width=i.right-i.left,this.height=i.top-i.bottom,this.boundingBox=i,this.transformationMatrix=n??hO(i)}return r.for=function(e,t,n){return ii.__awaiter(this,void 0,void 0,function(){return ii.__generator(this,function(i){return[2,new r(e,t,n)]})})},r.prototype.embedIntoContext=function(e,t){return ii.__awaiter(this,void 0,void 0,function(){var n,i,s,a,o,l,u,d,c,h;return ii.__generator(this,function(f){if(n=this.page.normalizedEntries(),i=n.Contents,s=n.Resources,!i)throw new zA.MissingPageContentsEmbeddingError;return a=this.decodeContents(i),o=this.boundingBox,l=o.left,u=o.bottom,d=o.right,c=o.top,h=e.flateStream(a,{Type:"XObject",Subtype:"Form",FormType:1,BBox:[l,u,d,c],Matrix:this.transformationMatrix,Resources:s}),t?(e.assign(t,h),[2,t]):[2,e.register(h)]})})},r.prototype.decodeContents=function(e){for(var t=Uint8Array.of(uO.default.Newline),n=[],i=0,s=e.size();i<s;i++){var a=e.lookup(i,aO.default),o=void 0;if(a instanceof sO.default)o=oO.decodePDFRawStream(a).decode();else if(a instanceof lO.default)o=a.getUnencodedContents();else throw new zA.UnrecognizedStreamTypeError(a);n.push(o,t)}return dO.mergeIntoTypedArray.apply(void 0,n)},r}();Vm.default=fO});var Wm=E(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.Duplex=ar.PrintScaling=ar.ReadingDirection=ar.NonFullScreenPageMode=void 0;var jc=(j(),U(L)),pO=jc.__importDefault(Ut()),gO=jc.__importDefault(gl()),lt=jc.__importDefault(Ce()),Hm=jc.__importDefault(gt()),Ss=ae(),Oc=function(r,e){if(r!==void 0)return e[r]},Mc;(function(r){r.UseNone="UseNone",r.UseOutlines="UseOutlines",r.UseThumbs="UseThumbs",r.UseOC="UseOC"})(Mc=ar.NonFullScreenPageMode||(ar.NonFullScreenPageMode={}));var Nc;(function(r){r.L2R="L2R",r.R2L="R2L"})(Nc=ar.ReadingDirection||(ar.ReadingDirection={}));var Lc;(function(r){r.None="None",r.AppDefault="AppDefault"})(Lc=ar.PrintScaling||(ar.PrintScaling={}));var Gm;(function(r){r.Simplex="Simplex",r.DuplexFlipShortEdge="DuplexFlipShortEdge",r.DuplexFlipLongEdge="DuplexFlipLongEdge"})(Gm=ar.Duplex||(ar.Duplex={}));var mO=function(){function r(e){this.dict=e}return r.prototype.lookupBool=function(e){var t=this.dict.lookup(lt.default.of(e));if(t instanceof gO.default)return t},r.prototype.lookupName=function(e){var t=this.dict.lookup(lt.default.of(e));if(t instanceof lt.default)return t},r.prototype.HideToolbar=function(){return this.lookupBool("HideToolbar")},r.prototype.HideMenubar=function(){return this.lookupBool("HideMenubar")},r.prototype.HideWindowUI=function(){return this.lookupBool("HideWindowUI")},r.prototype.FitWindow=function(){return this.lookupBool("FitWindow")},r.prototype.CenterWindow=function(){return this.lookupBool("CenterWindow")},r.prototype.DisplayDocTitle=function(){return this.lookupBool("DisplayDocTitle")},r.prototype.NonFullScreenPageMode=function(){return this.lookupName("NonFullScreenPageMode")},r.prototype.Direction=function(){return this.lookupName("Direction")},r.prototype.PrintScaling=function(){return this.lookupName("PrintScaling")},r.prototype.Duplex=function(){return this.lookupName("Duplex")},r.prototype.PickTrayByPDFSize=function(){return this.lookupBool("PickTrayByPDFSize")},r.prototype.PrintPageRange=function(){var e=this.dict.lookup(lt.default.of("PrintPageRange"));if(e instanceof pO.default)return e},r.prototype.NumCopies=function(){var e=this.dict.lookup(lt.default.of("NumCopies"));if(e instanceof Hm.default)return e},r.prototype.getHideToolbar=function(){var e,t;return(t=(e=this.HideToolbar())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getHideMenubar=function(){var e,t;return(t=(e=this.HideMenubar())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getHideWindowUI=function(){var e,t;return(t=(e=this.HideWindowUI())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getFitWindow=function(){var e,t;return(t=(e=this.FitWindow())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getCenterWindow=function(){var e,t;return(t=(e=this.CenterWindow())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getDisplayDocTitle=function(){var e,t;return(t=(e=this.DisplayDocTitle())===null||e===void 0?void 0:e.asBoolean())!==null&&t!==void 0?t:!1},r.prototype.getNonFullScreenPageMode=function(){var e,t,n=(e=this.NonFullScreenPageMode())===null||e===void 0?void 0:e.decodeText();return(t=Oc(n,Mc))!==null&&t!==void 0?t:Mc.UseNone},r.prototype.getReadingDirection=function(){var e,t,n=(e=this.Direction())===null||e===void 0?void 0:e.decodeText();return(t=Oc(n,Nc))!==null&&t!==void 0?t:Nc.L2R},r.prototype.getPrintScaling=function(){var e,t,n=(e=this.PrintScaling())===null||e===void 0?void 0:e.decodeText();return(t=Oc(n,Lc))!==null&&t!==void 0?t:Lc.AppDefault},r.prototype.getDuplex=function(){var e,t=(e=this.Duplex())===null||e===void 0?void 0:e.decodeText();return Oc(t,Gm)},r.prototype.getPickTrayByPDFSize=function(){var e;return(e=this.PickTrayByPDFSize())===null||e===void 0?void 0:e.asBoolean()},r.prototype.getPrintPageRange=function(){var e=this.PrintPageRange();if(!e)return[];for(var t=[],n=0;n<e.size();n+=2){var i=e.lookup(n,Hm.default).asNumber(),s=e.lookup(n+1,Hm.default).asNumber();t.push({start:i,end:s})}return t},r.prototype.getNumCopies=function(){var e,t;return(t=(e=this.NumCopies())===null||e===void 0?void 0:e.asNumber())!==null&&t!==void 0?t:1},r.prototype.setHideToolbar=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("HideToolbar"),t)},r.prototype.setHideMenubar=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("HideMenubar"),t)},r.prototype.setHideWindowUI=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("HideWindowUI"),t)},r.prototype.setFitWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("FitWindow"),t)},r.prototype.setCenterWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("CenterWindow"),t)},r.prototype.setDisplayDocTitle=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("DisplayDocTitle"),t)},r.prototype.setNonFullScreenPageMode=function(e){Ss.assertIsOneOf(e,"nonFullScreenPageMode",Mc);var t=lt.default.of(e);this.dict.set(lt.default.of("NonFullScreenPageMode"),t)},r.prototype.setReadingDirection=function(e){Ss.assertIsOneOf(e,"readingDirection",Nc);var t=lt.default.of(e);this.dict.set(lt.default.of("Direction"),t)},r.prototype.setPrintScaling=function(e){Ss.assertIsOneOf(e,"printScaling",Lc);var t=lt.default.of(e);this.dict.set(lt.default.of("PrintScaling"),t)},r.prototype.setDuplex=function(e){Ss.assertIsOneOf(e,"duplex",Gm);var t=lt.default.of(e);this.dict.set(lt.default.of("Duplex"),t)},r.prototype.setPickTrayByPDFSize=function(e){var t=this.dict.context.obj(e);this.dict.set(lt.default.of("PickTrayByPDFSize"),t)},r.prototype.setPrintPageRange=function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0,i=e.length;n<i;n++)t.push(e[n].start),t.push(e[n].end);Ss.assertEachIs(t,"printPageRange",["number"]);var s=this.dict.context.obj(t);this.dict.set(lt.default.of("PrintPageRange"),s)},r.prototype.setNumCopies=function(e){Ss.assertRange(e,"numCopies",1,Number.MAX_VALUE),Ss.assertInteger(e,"numCopies");var t=this.dict.context.obj(e);this.dict.set(lt.default.of("NumCopies"),t)},r.fromDict=function(e){return new r(e)},r.create=function(e){var t=e.obj({});return new r(t)},r}();ar.default=mO});var Uc=E(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});var Ps=(j(),U(L)),vO=Ps.__importDefault(Yt()),Km=Ps.__importDefault(on()),Bc=Ps.__importDefault(gr()),vr=Ps.__importDefault(Ce()),HA=Ps.__importDefault(gt()),yO=Ps.__importDefault(Ut()),bO=Ps.__importDefault(sr()),wO=ae(),GA=ze(),xO=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/,AO=function(){function r(e,t){this.dict=e,this.ref=t}return r.prototype.T=function(){return this.dict.lookupMaybe(vr.default.of("T"),Km.default,Bc.default)},r.prototype.Ff=function(){var e=this.getInheritableAttribute(vr.default.of("Ff"));return this.dict.context.lookupMaybe(e,HA.default)},r.prototype.V=function(){var e=this.getInheritableAttribute(vr.default.of("V"));return this.dict.context.lookup(e)},r.prototype.Kids=function(){return this.dict.lookupMaybe(vr.default.of("Kids"),yO.default)},r.prototype.DA=function(){var e=this.dict.lookup(vr.default.of("DA"));if(e instanceof Km.default||e instanceof Bc.default)return e},r.prototype.setKids=function(e){this.dict.set(vr.default.of("Kids"),this.dict.context.obj(e))},r.prototype.getParent=function(){var e=this.dict.get(vr.default.of("Parent"));if(e instanceof bO.default){var t=this.dict.lookup(vr.default.of("Parent"),vO.default);return new r(t,e)}},r.prototype.setParent=function(e){e?this.dict.set(vr.default.of("Parent"),e):this.dict.delete(vr.default.of("Parent"))},r.prototype.getFullyQualifiedName=function(){var e=this.getParent();return e?e.getFullyQualifiedName()+"."+this.getPartialName():this.getPartialName()},r.prototype.getPartialName=function(){var e;return(e=this.T())===null||e===void 0?void 0:e.decodeText()},r.prototype.setPartialName=function(e){e?this.dict.set(vr.default.of("T"),Bc.default.fromText(e)):this.dict.delete(vr.default.of("T"))},r.prototype.setDefaultAppearance=function(e){this.dict.set(vr.default.of("DA"),Km.default.of(e))},r.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof Bc.default?e.decodeText():e?.asString()},r.prototype.setFontSize=function(e){var t,n=(t=this.getFullyQualifiedName())!==null&&t!==void 0?t:"",i=this.getDefaultAppearance();if(!i)throw new GA.MissingDAEntryError(n);var s=wO.findLastMatch(i,xO);if(!s.match)throw new GA.MissingTfOperatorError(n);var a=i.slice(0,s.pos-s.match[0].length),o=s.pos<=i.length?i.slice(s.pos):"",l=s.match[1],u=a+" /"+l+" "+e+" Tf "+o;this.setDefaultAppearance(u)},r.prototype.getFlags=function(){var e,t;return(t=(e=this.Ff())===null||e===void 0?void 0:e.asNumber())!==null&&t!==void 0?t:0},r.prototype.setFlags=function(e){this.dict.set(vr.default.of("Ff"),HA.default.of(e))},r.prototype.hasFlag=function(e){var t=this.getFlags();return(t&e)!==0},r.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},r.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},r.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},r.prototype.getInheritableAttribute=function(e){var t;return this.ascend(function(n){t||(t=n.dict.get(e))}),t},r.prototype.ascend=function(e){e(this);var t=this.getParent();t&&t.ascend(e)},r}();Xm.default=AO});var XA=E(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var KA=(j(),U(L)),WA=KA.__importDefault(Ce()),SO=KA.__importDefault(gt()),PO=function(){function r(e){this.dict=e}return r.prototype.W=function(){var e=this.dict.lookup(WA.default.of("W"));if(e instanceof SO.default)return e},r.prototype.getWidth=function(){var e,t;return(t=(e=this.W())===null||e===void 0?void 0:e.asNumber())!==null&&t!==void 0?t:1},r.prototype.setWidth=function(e){var t=this.dict.context.obj(e);this.dict.set(WA.default.of("W"),t)},r.fromDict=function(e){return new r(e)},r}();Ym.default=PO});var Qm=E(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var ja=(j(),U(L)),Pl=ja.__importDefault(Yt()),Ct=ja.__importDefault(Ce()),Zm=ja.__importDefault(ni()),FO=ja.__importDefault(Ut()),DO=ja.__importDefault(sr()),YA=ja.__importDefault(gt()),EO=function(){function r(e){this.dict=e}return r.prototype.Rect=function(){return this.dict.lookup(Ct.default.of("Rect"),FO.default)},r.prototype.AP=function(){return this.dict.lookupMaybe(Ct.default.of("AP"),Pl.default)},r.prototype.F=function(){var e=this.dict.lookup(Ct.default.of("F"));return this.dict.context.lookupMaybe(e,YA.default)},r.prototype.getRectangle=function(){var e,t=this.Rect();return(e=t?.asRectangle())!==null&&e!==void 0?e:{x:0,y:0,width:0,height:0}},r.prototype.setRectangle=function(e){var t=e.x,n=e.y,i=e.width,s=e.height,a=this.dict.context.obj([t,n,t+i,n+s]);this.dict.set(Ct.default.of("Rect"),a)},r.prototype.getAppearanceState=function(){var e=this.dict.lookup(Ct.default.of("AS"));if(e instanceof Ct.default)return e},r.prototype.setAppearanceState=function(e){this.dict.set(Ct.default.of("AS"),e)},r.prototype.setAppearances=function(e){this.dict.set(Ct.default.of("AP"),e)},r.prototype.ensureAP=function(){var e=this.AP();return e||(e=this.dict.context.obj({}),this.dict.set(Ct.default.of("AP"),e)),e},r.prototype.getNormalAppearance=function(){var e=this.ensureAP(),t=e.get(Ct.default.of("N"));if(t instanceof DO.default||t instanceof Pl.default)return t;throw new Error("Unexpected N type: "+t?.constructor.name)},r.prototype.setNormalAppearance=function(e){var t=this.ensureAP();t.set(Ct.default.of("N"),e)},r.prototype.setRolloverAppearance=function(e){var t=this.ensureAP();t.set(Ct.default.of("R"),e)},r.prototype.setDownAppearance=function(e){var t=this.ensureAP();t.set(Ct.default.of("D"),e)},r.prototype.removeRolloverAppearance=function(){var e=this.AP();e?.delete(Ct.default.of("R"))},r.prototype.removeDownAppearance=function(){var e=this.AP();e?.delete(Ct.default.of("D"))},r.prototype.getAppearances=function(){var e=this.AP();if(e){var t=e.lookup(Ct.default.of("N"),Pl.default,Zm.default),n=e.lookupMaybe(Ct.default.of("R"),Pl.default,Zm.default),i=e.lookupMaybe(Ct.default.of("D"),Pl.default,Zm.default);return{normal:t,rollover:n,down:i}}},r.prototype.getFlags=function(){var e,t;return(t=(e=this.F())===null||e===void 0?void 0:e.asNumber())!==null&&t!==void 0?t:0},r.prototype.setFlags=function(e){this.dict.set(Ct.default.of("F"),YA.default.of(e))},r.prototype.hasFlag=function(e){var t=this.getFlags();return(t&e)!==0},r.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},r.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},r.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},r.fromDict=function(e){return new r(e)},r}();Jm.default=EO});var rv=E(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var Fl=(j(),U(L)),yr=Fl.__importDefault(Ce()),$m=Fl.__importDefault(gt()),ZA=Fl.__importDefault(Ut()),Ba=Fl.__importDefault(gr()),ev=Fl.__importDefault(on()),CO=function(){function r(e){this.dict=e}return r.prototype.R=function(){var e=this.dict.lookup(yr.default.of("R"));if(e instanceof $m.default)return e},r.prototype.BC=function(){var e=this.dict.lookup(yr.default.of("BC"));if(e instanceof ZA.default)return e},r.prototype.BG=function(){var e=this.dict.lookup(yr.default.of("BG"));if(e instanceof ZA.default)return e},r.prototype.CA=function(){var e=this.dict.lookup(yr.default.of("CA"));if(e instanceof Ba.default||e instanceof ev.default)return e},r.prototype.RC=function(){var e=this.dict.lookup(yr.default.of("RC"));if(e instanceof Ba.default||e instanceof ev.default)return e},r.prototype.AC=function(){var e=this.dict.lookup(yr.default.of("AC"));if(e instanceof Ba.default||e instanceof ev.default)return e},r.prototype.getRotation=function(){var e;return(e=this.R())===null||e===void 0?void 0:e.asNumber()},r.prototype.getBorderColor=function(){var e=this.BC();if(e){for(var t=[],n=0,i=e?.size();n<i;n++){var s=e.get(n);s instanceof $m.default&&t.push(s.asNumber())}return t}},r.prototype.getBackgroundColor=function(){var e=this.BG();if(e){for(var t=[],n=0,i=e?.size();n<i;n++){var s=e.get(n);s instanceof $m.default&&t.push(s.asNumber())}return t}},r.prototype.getCaptions=function(){var e=this.CA(),t=this.RC(),n=this.AC();return{normal:e?.decodeText(),rollover:t?.decodeText(),down:n?.decodeText()}},r.prototype.setRotation=function(e){var t=this.dict.context.obj(e);this.dict.set(yr.default.of("R"),t)},r.prototype.setBorderColor=function(e){var t=this.dict.context.obj(e);this.dict.set(yr.default.of("BC"),t)},r.prototype.setBackgroundColor=function(e){var t=this.dict.context.obj(e);this.dict.set(yr.default.of("BG"),t)},r.prototype.setCaptions=function(e){var t=Ba.default.fromText(e.normal);if(this.dict.set(yr.default.of("CA"),t),e.rollover){var n=Ba.default.fromText(e.rollover);this.dict.set(yr.default.of("RC"),n)}else this.dict.delete(yr.default.of("RC"));if(e.down){var i=Ba.default.fromText(e.down);this.dict.set(yr.default.of("AC"),i)}else this.dict.delete(yr.default.of("AC"))},r.fromDict=function(e){return new r(e)},r}();tv.default=CO});var ov=E(av=>{"use strict";Object.defineProperty(av,"__esModule",{value:!0});var ai=(j(),U(L)),nv=ai.__importDefault(Yt()),si=ai.__importDefault(Ce()),TO=ai.__importDefault(sr()),JA=ai.__importDefault(on()),QA=ai.__importDefault(gr()),iv=ai.__importDefault(XA()),kO=ai.__importDefault(Qm()),sv=ai.__importDefault(rv()),RO=function(r){ai.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.MK=function(){var t=this.dict.lookup(si.default.of("MK"));if(t instanceof nv.default)return t},e.prototype.BS=function(){var t=this.dict.lookup(si.default.of("BS"));if(t instanceof nv.default)return t},e.prototype.DA=function(){var t=this.dict.lookup(si.default.of("DA"));if(t instanceof JA.default||t instanceof QA.default)return t},e.prototype.P=function(){var t=this.dict.get(si.default.of("P"));if(t instanceof TO.default)return t},e.prototype.setP=function(t){this.dict.set(si.default.of("P"),t)},e.prototype.setDefaultAppearance=function(t){this.dict.set(si.default.of("DA"),JA.default.of(t))},e.prototype.getDefaultAppearance=function(){var t=this.DA();return t instanceof QA.default?t.decodeText():t?.asString()},e.prototype.getAppearanceCharacteristics=function(){var t=this.MK();if(t)return sv.default.fromDict(t)},e.prototype.getOrCreateAppearanceCharacteristics=function(){var t=this.MK();if(t)return sv.default.fromDict(t);var n=sv.default.fromDict(this.dict.context.obj({}));return this.dict.set(si.default.of("MK"),n.dict),n},e.prototype.getBorderStyle=function(){var t=this.BS();if(t)return iv.default.fromDict(t)},e.prototype.getOrCreateBorderStyle=function(){var t=this.BS();if(t)return iv.default.fromDict(t);var n=iv.default.fromDict(this.dict.context.obj({}));return this.dict.set(si.default.of("BS"),n.dict),n},e.prototype.getOnValue=function(){var t,n=(t=this.getAppearances())===null||t===void 0?void 0:t.normal;if(n instanceof nv.default)for(var i=n.keys(),s=0,a=i.length;s<a;s++){var o=i[s];if(o!==si.default.of("Off"))return o}},e.fromDict=function(t){return new e(t)},e.create=function(t,n){var i=t.obj({Type:"Annot",Subtype:"Widget",Rect:[0,0,0,0],Parent:n});return new e(i)},e}(kO.default);av.default=RO});var Fs=E(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var Dl=(j(),U(L)),_O=Dl.__importDefault(Yt()),lv=Dl.__importDefault(Ce()),IO=Dl.__importDefault(Uc()),$A=Dl.__importDefault(ov()),eS=ze(),OO=function(r){Dl.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.FT=function(){var t=this.getInheritableAttribute(lv.default.of("FT"));return this.dict.context.lookup(t,lv.default)},e.prototype.getWidgets=function(){var t=this.Kids();if(!t)return[$A.default.fromDict(this.dict)];for(var n=new Array(t.size()),i=0,s=t.size();i<s;i++){var a=t.lookup(i,_O.default);n[i]=$A.default.fromDict(a)}return n},e.prototype.addWidget=function(t){var n=this.normalizedEntries().Kids;n.push(t)},e.prototype.removeWidget=function(t){var n=this.Kids();if(n){if(t<0||t>n.size())throw new eS.IndexOutOfBoundsError(t,0,n.size());n.remove(t)}else{if(t!==0)throw new eS.IndexOutOfBoundsError(t,0,0);this.setKids([])}},e.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([this.ref]),this.dict.set(lv.default.of("Kids"),t)),{Kids:t}},e.fromDict=function(t,n){return new e(t,n)},e}(IO.default);uv.default=OO});var Cl=E(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var Ua=(j(),U(L)),qc=Ua.__importDefault(on()),El=Ua.__importDefault(gr()),MO=Ua.__importDefault(Ut()),dv=Ua.__importDefault(Ce()),NO=Ua.__importDefault(Fs()),tS=ze(),LO=function(r){Ua.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.Opt=function(){return this.dict.lookupMaybe(dv.default.of("Opt"),qc.default,El.default,MO.default)},e.prototype.setOpt=function(t){this.dict.set(dv.default.of("Opt"),this.dict.context.obj(t))},e.prototype.getExportValues=function(){var t=this.Opt();if(t){if(t instanceof qc.default||t instanceof El.default)return[t];for(var n=[],i=0,s=t.size();i<s;i++){var a=t.lookup(i);(a instanceof qc.default||a instanceof El.default)&&n.push(a)}return n}},e.prototype.removeExportValue=function(t){var n=this.Opt();if(n)if(n instanceof qc.default||n instanceof El.default){if(t!==0)throw new tS.IndexOutOfBoundsError(t,0,0);this.setOpt([])}else{if(t<0||t>n.size())throw new tS.IndexOutOfBoundsError(t,0,n.size());n.remove(t)}},e.prototype.normalizeExportValues=function(){for(var t,n,i,s,a=(t=this.getExportValues())!==null&&t!==void 0?t:[],o=[],l=this.getWidgets(),u=0,d=l.length;u<d;u++){var c=l[u],h=(n=a[u])!==null&&n!==void 0?n:El.default.fromText((s=(i=c.getOnValue())===null||i===void 0?void 0:i.decodeText())!==null&&s!==void 0?s:"");o.push(h)}this.setOpt(o)},e.prototype.addOpt=function(t,n){var i;this.normalizeExportValues();var s=t.decodeText(),a;if(n)for(var o=(i=this.getExportValues())!==null&&i!==void 0?i:[],l=0,u=o.length;l<u;l++){var d=o[l];d.decodeText()===s&&(a=l)}var c=this.Opt();return c.push(t),a??c.size()-1},e.prototype.addWidgetWithOpt=function(t,n,i){var s=this.addOpt(n,i),a=dv.default.of(String(s));return this.addWidget(t),a},e}(NO.default);cv.default=LO});var pv=E(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});var hv=(j(),U(L)),qa=hv.__importDefault(Ce()),jO=hv.__importDefault(Cl()),BO=ze(),UO=function(r){hv.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setValue=function(t){var n,i=(n=this.getOnValue())!==null&&n!==void 0?n:qa.default.of("Yes");if(t!==i&&t!==qa.default.of("Off"))throw new BO.InvalidAcroFieldValueError;this.dict.set(qa.default.of("V"),t);for(var s=this.getWidgets(),a=0,o=s.length;a<o;a++){var l=s[a],u=l.getOnValue()===t?t:qa.default.of("Off");l.setAppearanceState(u)}},e.prototype.getValue=function(){var t=this.V();return t instanceof qa.default?t:qa.default.of("Off")},e.prototype.getOnValue=function(){var t=this.getWidgets()[0];return t?.getOnValue()},e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Btn",Kids:[]}),i=t.register(n);return new e(n,i)},e}(jO.default);fv.default=UO});var Ds=E(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AcroChoiceFlags=br.AcroTextFlags=br.AcroButtonFlags=br.AcroFieldFlags=void 0;var At=function(r){return 1<<r},qO;(function(r){r[r.ReadOnly=At(0)]="ReadOnly",r[r.Required=At(1)]="Required",r[r.NoExport=At(2)]="NoExport"})(qO=br.AcroFieldFlags||(br.AcroFieldFlags={}));var zO;(function(r){r[r.NoToggleToOff=At(14)]="NoToggleToOff",r[r.Radio=At(15)]="Radio",r[r.PushButton=At(16)]="PushButton",r[r.RadiosInUnison=At(25)]="RadiosInUnison"})(zO=br.AcroButtonFlags||(br.AcroButtonFlags={}));var VO;(function(r){r[r.Multiline=At(12)]="Multiline",r[r.Password=At(13)]="Password",r[r.FileSelect=At(20)]="FileSelect",r[r.DoNotSpellCheck=At(22)]="DoNotSpellCheck",r[r.DoNotScroll=At(23)]="DoNotScroll",r[r.Comb=At(24)]="Comb",r[r.RichText=At(25)]="RichText"})(VO=br.AcroTextFlags||(br.AcroTextFlags={}));var HO;(function(r){r[r.Combo=At(17)]="Combo",r[r.Edit=At(18)]="Edit",r[r.Sort=At(19)]="Sort",r[r.MultiSelect=At(21)]="MultiSelect",r[r.DoNotSpellCheck=At(22)]="DoNotSpellCheck",r[r.CommitOnSelChange=At(26)]="CommitOnSelChange"})(HO=br.AcroChoiceFlags||(br.AcroChoiceFlags={}))});var Vc=E(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});var za=(j(),U(L)),GO=za.__importDefault(Fs()),Es=za.__importDefault(gr()),Cs=za.__importDefault(on()),zc=za.__importDefault(Ut()),Ts=za.__importDefault(Ce()),gv=Ds(),rS=ze(),WO=function(r){za.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setValues=function(t){if(this.hasFlag(gv.AcroChoiceFlags.Combo)&&!this.hasFlag(gv.AcroChoiceFlags.Edit)&&!this.valuesAreValid(t))throw new rS.InvalidAcroFieldValueError;if(t.length===0&&this.dict.delete(Ts.default.of("V")),t.length===1&&this.dict.set(Ts.default.of("V"),t[0]),t.length>1){if(!this.hasFlag(gv.AcroChoiceFlags.MultiSelect))throw new rS.MultiSelectValueError;this.dict.set(Ts.default.of("V"),this.dict.context.obj(t))}this.updateSelectedIndices(t)},e.prototype.valuesAreValid=function(t){for(var n=this.getOptions(),i=function(l,u){var d=t[l].decodeText();if(!n.find(function(c){return d===(c.display||c.value).decodeText()}))return{value:!1}},s=0,a=t.length;s<a;s++){var o=i(s,a);if(typeof o=="object")return o.value}return!0},e.prototype.updateSelectedIndices=function(t){if(t.length>1){for(var n=new Array(t.length),i=this.getOptions(),s=function(l,u){var d=t[l].decodeText();n[l]=i.findIndex(function(c){return d===(c.display||c.value).decodeText()})},a=0,o=t.length;a<o;a++)s(a,o);this.dict.set(Ts.default.of("I"),this.dict.context.obj(n.sort()))}else this.dict.delete(Ts.default.of("I"))},e.prototype.getValues=function(){var t=this.V();if(t instanceof Cs.default||t instanceof Es.default)return[t];if(t instanceof zc.default){for(var n=[],i=0,s=t.size();i<s;i++){var a=t.lookup(i);(a instanceof Cs.default||a instanceof Es.default)&&n.push(a)}return n}return[]},e.prototype.Opt=function(){return this.dict.lookupMaybe(Ts.default.of("Opt"),Cs.default,Es.default,zc.default)},e.prototype.setOptions=function(t){for(var n=new Array(t.length),i=0,s=t.length;i<s;i++){var a=t[i],o=a.value,l=a.display;n[i]=this.dict.context.obj([o,l||o])}this.dict.set(Ts.default.of("Opt"),this.dict.context.obj(n))},e.prototype.getOptions=function(){var t=this.Opt();if(t instanceof Cs.default||t instanceof Es.default)return[{value:t,display:t}];if(t instanceof zc.default){for(var n=[],i=0,s=t.size();i<s;i++){var a=t.lookup(i);if((a instanceof Cs.default||a instanceof Es.default)&&n.push({value:a,display:a}),a instanceof zc.default&&a.size()>0){var o=a.lookup(0,Cs.default,Es.default),l=a.lookupMaybe(1,Cs.default,Es.default);n.push({value:o,display:l||o})}}return n}return[]},e}(GO.default);mv.default=WO});var yv=E(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});var nS=(j(),U(L)),KO=nS.__importDefault(Vc()),XO=Ds(),YO=function(r){nS.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Ch",Ff:XO.AcroChoiceFlags.Combo,Kids:[]}),i=t.register(n);return new e(n,i)},e}(KO.default);vv.default=YO});var Hc=E(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});var bv=(j(),U(L)),ZO=bv.__importDefault(Ce()),JO=bv.__importDefault(Uc()),QO=function(r){bv.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.addField=function(t){var n=this.normalizedEntries().Kids;n?.push(t)},e.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([]),this.dict.set(ZO.default.of("Kids"),t)),{Kids:t}},e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({}),i=t.register(n);return new e(n,i)},e}(JO.default);wv.default=QO});var Av=E(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});var iS=(j(),U(L)),$O=iS.__importDefault(Fs()),e2=function(r){iS.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.fromDict=function(t,n){return new e(t,n)},e}($O.default);xv.default=e2});var Pv=E(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});var Va=(j(),U(L)),Gc=Va.__importDefault(gt()),t2=Va.__importDefault(on()),r2=Va.__importDefault(gr()),ks=Va.__importDefault(Ce()),n2=Va.__importDefault(Fs()),i2=function(r){Va.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.MaxLen=function(){var t=this.dict.lookup(ks.default.of("MaxLen"));if(t instanceof Gc.default)return t},e.prototype.Q=function(){var t=this.dict.lookup(ks.default.of("Q"));if(t instanceof Gc.default)return t},e.prototype.setMaxLength=function(t){this.dict.set(ks.default.of("MaxLen"),Gc.default.of(t))},e.prototype.removeMaxLength=function(){this.dict.delete(ks.default.of("MaxLen"))},e.prototype.getMaxLength=function(){var t;return(t=this.MaxLen())===null||t===void 0?void 0:t.asNumber()},e.prototype.setQuadding=function(t){this.dict.set(ks.default.of("Q"),Gc.default.of(t))},e.prototype.getQuadding=function(){var t;return(t=this.Q())===null||t===void 0?void 0:t.asNumber()},e.prototype.setValue=function(t){this.dict.set(ks.default.of("V"),t)},e.prototype.removeValue=function(){this.dict.delete(ks.default.of("V"))},e.prototype.getValue=function(){var t=this.V();if(t instanceof t2.default||t instanceof r2.default)return t},e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Tx",Kids:[]}),i=t.register(n);return new e(n,i)},e}(n2.default);Sv.default=i2});var Dv=E(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var sS=(j(),U(L)),s2=sS.__importDefault(Cl()),a2=Ds(),o2=function(r){sS.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Btn",Ff:a2.AcroButtonFlags.PushButton,Kids:[]}),i=t.register(n);return new e(n,i)},e}(s2.default);Fv.default=o2});var Tv=E(Cv=>{"use strict";Object.defineProperty(Cv,"__esModule",{value:!0});var Ev=(j(),U(L)),Tl=Ev.__importDefault(Ce()),l2=Ev.__importDefault(Cl()),u2=Ds(),d2=ze(),c2=function(r){Ev.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setValue=function(t){var n=this.getOnValues();if(!n.includes(t)&&t!==Tl.default.of("Off"))throw new d2.InvalidAcroFieldValueError;this.dict.set(Tl.default.of("V"),t);for(var i=this.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s],l=o.getOnValue()===t?t:Tl.default.of("Off");o.setAppearanceState(l)}},e.prototype.getValue=function(){var t=this.V();return t instanceof Tl.default?t:Tl.default.of("Off")},e.prototype.getOnValues=function(){for(var t=this.getWidgets(),n=[],i=0,s=t.length;i<s;i++){var a=t[i].getOnValue();a&&n.push(a)}return n},e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Btn",Ff:u2.AcroButtonFlags.Radio,Kids:[]}),i=t.register(n);return new e(n,i)},e}(l2.default);Cv.default=c2});var Rv=E(kv=>{"use strict";Object.defineProperty(kv,"__esModule",{value:!0});var aS=(j(),U(L)),h2=aS.__importDefault(Vc()),f2=function(r){aS.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.fromDict=function(t,n){return new e(t,n)},e.create=function(t){var n=t.obj({FT:"Ch",Kids:[]}),i=t.register(n);return new e(n,i)},e}(h2.default);kv.default=f2});var Nv=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.createPDFAcroField=Rs.createPDFAcroFields=void 0;var wr=(j(),U(L)),oS=wr.__importDefault(gt()),Ov=wr.__importDefault(Yt()),un=wr.__importDefault(Ce()),p2=wr.__importDefault(Ut()),g2=wr.__importDefault(sr()),m2=wr.__importDefault(Fs()),v2=wr.__importDefault(Hc()),y2=wr.__importDefault(Av()),b2=wr.__importDefault(Pv()),w2=wr.__importDefault(Dv()),x2=wr.__importDefault(Tv()),A2=wr.__importDefault(pv()),S2=wr.__importDefault(yv()),P2=wr.__importDefault(Rv()),_v=Ds();Rs.createPDFAcroFields=function(r){if(!r)return[];for(var e=[],t=0,n=r.size();t<n;t++){var i=r.get(t),s=r.lookup(t);i instanceof g2.default&&s instanceof Ov.default&&e.push([Rs.createPDFAcroField(s,i),i])}return e};Rs.createPDFAcroField=function(r,e){var t=F2(r);return t?v2.default.fromDict(r,e):D2(r,e)};var F2=function(r){var e=r.lookup(un.default.of("Kids"));if(e instanceof p2.default)for(var t=0,n=e.size();t<n;t++){var i=e.lookup(t),s=i instanceof Ov.default&&i.has(un.default.of("T"));if(s)return!0}return!1},D2=function(r,e){var t=Mv(r,un.default.of("FT")),n=r.context.lookup(t,un.default);return n===un.default.of("Btn")?E2(r,e):n===un.default.of("Ch")?C2(r,e):n===un.default.of("Tx")?b2.default.fromDict(r,e):n===un.default.of("Sig")?y2.default.fromDict(r,e):m2.default.fromDict(r,e)},E2=function(r,e){var t,n=Mv(r,un.default.of("Ff")),i=r.context.lookupMaybe(n,oS.default),s=(t=i?.asNumber())!==null&&t!==void 0?t:0;return Iv(s,_v.AcroButtonFlags.PushButton)?w2.default.fromDict(r,e):Iv(s,_v.AcroButtonFlags.Radio)?x2.default.fromDict(r,e):A2.default.fromDict(r,e)},C2=function(r,e){var t,n=Mv(r,un.default.of("Ff")),i=r.context.lookupMaybe(n,oS.default),s=(t=i?.asNumber())!==null&&t!==void 0?t:0;return Iv(s,_v.AcroChoiceFlags.Combo)?S2.default.fromDict(r,e):P2.default.fromDict(r,e)},Iv=function(r,e){return(r&e)!==0},Mv=function(r,e){var t;return lS(r,function(n){t||(t=n.get(e))}),t},lS=function(r,e){e(r);var t=r.lookupMaybe(un.default.of("Parent"),Ov.default);t&&lS(t,e)}});var cS=E(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var Wc=(j(),U(L)),T2=Wc.__importDefault(Yt()),k2=Wc.__importDefault(Ut()),uS=Wc.__importDefault(Ce()),R2=Wc.__importDefault(Hc()),dS=Nv(),_2=function(){function r(e){this.dict=e}return r.prototype.Fields=function(){var e=this.dict.lookup(uS.default.of("Fields"));if(e instanceof k2.default)return e},r.prototype.getFields=function(){for(var e=this.normalizedEntries().Fields,t=new Array(e.size()),n=0,i=e.size();n<i;n++){var s=e.get(n),a=e.lookup(n,T2.default);t[n]=[dS.createPDFAcroField(a,s),s]}return t},r.prototype.getAllFields=function(){var e=[],t=function(n){if(n)for(var i=0,s=n.length;i<s;i++){var a=n[i];e.push(a);var o=a[0];o instanceof R2.default&&t(dS.createPDFAcroFields(o.Kids()))}};return t(this.getFields()),e},r.prototype.addField=function(e){var t=this.normalizedEntries().Fields;t?.push(e)},r.prototype.removeField=function(e){var t=e.getParent(),n=t===void 0?this.normalizedEntries().Fields:t.Kids(),i=n?.indexOf(e.ref);if(n===void 0||i===void 0)throw new Error("Tried to remove inexistent field "+e.getFullyQualifiedName());n.remove(i),t!==void 0&&n.size()===0&&this.removeField(t)},r.prototype.normalizedEntries=function(){var e=this.Fields();return e||(e=this.dict.context.obj([]),this.dict.set(uS.default.of("Fields"),e)),{Fields:e}},r.fromDict=function(e){return new r(e)},r.create=function(e){var t=e.obj({Fields:[]});return new r(t)},r}();Lv.default=_2});var jv=E(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});var hS=(j(),U(L)),I2=Cl();Object.defineProperty(qt,"PDFAcroButton",{enumerable:!0,get:function(){return I2.default}});var O2=pv();Object.defineProperty(qt,"PDFAcroCheckBox",{enumerable:!0,get:function(){return O2.default}});var M2=Vc();Object.defineProperty(qt,"PDFAcroChoice",{enumerable:!0,get:function(){return M2.default}});var N2=yv();Object.defineProperty(qt,"PDFAcroComboBox",{enumerable:!0,get:function(){return N2.default}});var L2=Uc();Object.defineProperty(qt,"PDFAcroField",{enumerable:!0,get:function(){return L2.default}});var j2=cS();Object.defineProperty(qt,"PDFAcroForm",{enumerable:!0,get:function(){return j2.default}});var B2=Rv();Object.defineProperty(qt,"PDFAcroListBox",{enumerable:!0,get:function(){return B2.default}});var U2=Hc();Object.defineProperty(qt,"PDFAcroNonTerminal",{enumerable:!0,get:function(){return U2.default}});var q2=Dv();Object.defineProperty(qt,"PDFAcroPushButton",{enumerable:!0,get:function(){return q2.default}});var z2=Tv();Object.defineProperty(qt,"PDFAcroRadioButton",{enumerable:!0,get:function(){return z2.default}});var V2=Av();Object.defineProperty(qt,"PDFAcroSignature",{enumerable:!0,get:function(){return V2.default}});var H2=Fs();Object.defineProperty(qt,"PDFAcroTerminal",{enumerable:!0,get:function(){return H2.default}});var G2=Pv();Object.defineProperty(qt,"PDFAcroText",{enumerable:!0,get:function(){return G2.default}});hS.__exportStar(Ds(),qt);hS.__exportStar(Nv(),qt)});var Uv=E(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var Xc=(j(),U(L)),Kc=Xc.__importDefault(Yt()),oi=Xc.__importDefault(Ce()),fS=jv(),pS=Xc.__importDefault(Wm()),W2=function(r){Xc.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.Pages=function(){return this.lookup(oi.default.of("Pages"),Kc.default)},e.prototype.AcroForm=function(){return this.lookupMaybe(oi.default.of("AcroForm"),Kc.default)},e.prototype.getAcroForm=function(){var t=this.AcroForm();if(t)return fS.PDFAcroForm.fromDict(t)},e.prototype.getOrCreateAcroForm=function(){var t=this.getAcroForm();if(!t){t=fS.PDFAcroForm.create(this.context);var n=this.context.register(t.dict);this.set(oi.default.of("AcroForm"),n)}return t},e.prototype.ViewerPreferences=function(){return this.lookupMaybe(oi.default.of("ViewerPreferences"),Kc.default)},e.prototype.getViewerPreferences=function(){var t=this.ViewerPreferences();if(t)return pS.default.fromDict(t)},e.prototype.getOrCreateViewerPreferences=function(){var t=this.getViewerPreferences();if(!t){t=pS.default.create(this.context);var n=this.context.register(t.dict);this.set(oi.default.of("ViewerPreferences"),n)}return t},e.prototype.insertLeafNode=function(t,n){var i=this.get(oi.default.of("Pages")),s=this.Pages().insertLeafNode(t,n);return s||i},e.prototype.removeLeafNode=function(t){this.Pages().removeLeafNode(t)},e.withContextAndPages=function(t,n){var i=new Map;return i.set(oi.default.of("Type"),oi.default.of("Catalog")),i.set(oi.default.of("Pages"),n),new e(i,t)},e.fromMapWithContext=function(t,n){return new e(t,n)},e}(Kc.default);Bv.default=W2});var Hv=E(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var Ha=(j(),U(L)),K2=Ha.__importDefault(Ut()),X2=Ha.__importDefault(Yt()),In=Ha.__importDefault(Ce()),qv=Ha.__importDefault(gt()),zv=Ha.__importDefault(wl()),Yc=ze(),Y2=function(r){Ha.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.Parent=function(){return this.lookup(In.default.of("Parent"))},e.prototype.Kids=function(){return this.lookup(In.default.of("Kids"),K2.default)},e.prototype.Count=function(){return this.lookup(In.default.of("Count"),qv.default)},e.prototype.pushTreeNode=function(t){var n=this.Kids();n.push(t)},e.prototype.pushLeafNode=function(t){var n=this.Kids();this.insertLeafKid(n.size(),t)},e.prototype.insertLeafNode=function(t,n){var i=this.Kids(),s=this.Count().asNumber();if(n>s)throw new Yc.InvalidTargetIndexError(n,s);for(var a=n,o=0,l=i.size();o<l;o++){if(a===0){this.insertLeafKid(o,t);return}var u=i.get(o),d=this.context.lookup(u);if(d instanceof e){if(d.Count().asNumber()>a)return d.insertLeafNode(t,a)||u;a-=d.Count().asNumber()}d instanceof zv.default&&(a-=1)}if(a===0){this.insertLeafKid(i.size(),t);return}throw new Yc.CorruptPageTreeError(n,"insertLeafNode")},e.prototype.removeLeafNode=function(t,n){n===void 0&&(n=!0);var i=this.Kids(),s=this.Count().asNumber();if(t>=s)throw new Yc.InvalidTargetIndexError(t,s);for(var a=t,o=0,l=i.size();o<l;o++){var u=i.get(o),d=this.context.lookup(u);if(d instanceof e)if(d.Count().asNumber()>a){d.removeLeafNode(a,n),n&&d.Kids().size()===0&&i.remove(o);return}else a-=d.Count().asNumber();if(d instanceof zv.default)if(a===0){this.removeKid(o);return}else a-=1}throw new Yc.CorruptPageTreeError(t,"removeLeafNode")},e.prototype.ascend=function(t){t(this);var n=this.Parent();n&&n.ascend(t)},e.prototype.traverse=function(t){for(var n=this.Kids(),i=0,s=n.size();i<s;i++){var a=n.get(i),o=this.context.lookup(a);o instanceof e&&o.traverse(t),t(o,a)}},e.prototype.insertLeafKid=function(t,n){var i=this.Kids();this.ascend(function(s){var a=s.Count().asNumber()+1;s.set(In.default.of("Count"),qv.default.of(a))}),i.insert(t,n)},e.prototype.removeKid=function(t){var n=this.Kids(),i=n.lookup(t);i instanceof zv.default&&this.ascend(function(s){var a=s.Count().asNumber()-1;s.set(In.default.of("Count"),qv.default.of(a))}),n.remove(t)},e.withContext=function(t,n){var i=new Map;return i.set(In.default.of("Type"),In.default.of("Pages")),i.set(In.default.of("Kids"),t.obj([])),i.set(In.default.of("Count"),t.obj(0)),n&&i.set(In.default.of("Parent"),n),new e(i,t)},e.fromMapWithContext=function(t,n){return new e(t,n)},e}(X2.default);Vv.default=Y2});var Zc=E(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.IsNumeric=et.IsNumericPrefix=et.IsDigit=void 0;var Z2=(j(),U(L)),Ir=Z2.__importDefault(Ve());et.IsDigit=new Uint8Array(256);et.IsDigit[Ir.default.Zero]=1;et.IsDigit[Ir.default.One]=1;et.IsDigit[Ir.default.Two]=1;et.IsDigit[Ir.default.Three]=1;et.IsDigit[Ir.default.Four]=1;et.IsDigit[Ir.default.Five]=1;et.IsDigit[Ir.default.Six]=1;et.IsDigit[Ir.default.Seven]=1;et.IsDigit[Ir.default.Eight]=1;et.IsDigit[Ir.default.Nine]=1;et.IsNumericPrefix=new Uint8Array(256);et.IsNumericPrefix[Ir.default.Period]=1;et.IsNumericPrefix[Ir.default.Plus]=1;et.IsNumericPrefix[Ir.default.Minus]=1;et.IsNumeric=new Uint8Array(256);for(Ga=0,gS=256;Ga<gS;Ga++)et.IsNumeric[Ga]=et.IsDigit[Ga]||et.IsNumericPrefix[Ga]?1:0;var Ga,gS});var bS=E(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var J2=(j(),U(L)),mS=ze(),Jc=J2.__importDefault(Ve()),Gv=Zc(),Q2=lc(),Wv=ae(),vS=Jc.default.Newline,yS=Jc.default.CarriageReturn,$2=function(){function r(e,t){t===void 0&&(t=!1),this.bytes=e,this.capNumbers=t}return r.prototype.parseRawInt=function(){for(var e="";!this.bytes.done();){var t=this.bytes.peek();if(!Gv.IsDigit[t])break;e+=Wv.charFromCode(this.bytes.next())}var n=Number(e);if(!e||!isFinite(n))throw new mS.NumberParsingError(this.bytes.position(),e);return n},r.prototype.parseRawNumber=function(){for(var e="";!this.bytes.done();){var t=this.bytes.peek();if(!Gv.IsNumeric[t]||(e+=Wv.charFromCode(this.bytes.next()),t===Jc.default.Period))break}for(;!this.bytes.done();){var t=this.bytes.peek();if(!Gv.IsDigit[t])break;e+=Wv.charFromCode(this.bytes.next())}var n=Number(e);if(!e||!isFinite(n))throw new mS.NumberParsingError(this.bytes.position(),e);if(n>Number.MAX_SAFE_INTEGER)if(this.capNumbers){var i="Parsed number that is too large for some PDF readers: "+e+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(i),Number.MAX_SAFE_INTEGER}else{var i="Parsed number that is too large for some PDF readers: "+e+", not capping.";console.warn(i)}return n},r.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&Q2.IsWhitespace[this.bytes.peek()];)this.bytes.next()},r.prototype.skipLine=function(){for(;!this.bytes.done();){var e=this.bytes.peek();if(e===vS||e===yS)return;this.bytes.next()}},r.prototype.skipComment=function(){if(this.bytes.peek()!==Jc.default.Percent)return!1;for(;!this.bytes.done();){var e=this.bytes.peek();if(e===vS||e===yS)return!0;this.bytes.next()}return!0},r.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},r.prototype.matchKeyword=function(e){for(var t=this.bytes.offset(),n=0,i=e.length;n<i;n++)if(this.bytes.done()||this.bytes.next()!==e[n])return this.bytes.moveTo(t),!1;return!0},r}();Kv.default=$2});var kl=E(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var eM=(j(),U(L)),tM=ze(),rM=_c(),nM=eM.__importDefault(Ve()),iM=function(){function r(e){this.idx=0,this.line=0,this.column=0,this.bytes=e,this.length=this.bytes.length}return r.prototype.moveTo=function(e){this.idx=e},r.prototype.next=function(){var e=this.bytes[this.idx++];return e===nM.default.Newline?(this.line+=1,this.column=0):this.column+=1,e},r.prototype.assertNext=function(e){if(this.peek()!==e)throw new tM.NextByteAssertionError(this.position(),e,this.peek());return this.next()},r.prototype.peek=function(){return this.bytes[this.idx]},r.prototype.peekAhead=function(e){return this.bytes[this.idx+e]},r.prototype.peekAt=function(e){return this.bytes[e]},r.prototype.done=function(){return this.idx>=this.length},r.prototype.offset=function(){return this.idx},r.prototype.slice=function(e,t){return this.bytes.slice(e,t)},r.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},r.of=function(e){return new r(e)},r.fromPDFRawStream=function(e){return r.of(rM.decodePDFRawStream(e).decode())},r}();Xv.default=iM});var Yv=E($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Keywords=void 0;var Ni=(j(),U(L)),Y=Ni.__importDefault(Ve()),sM=Y.default.Space,Rl=Y.default.CarriageReturn,_l=Y.default.Newline,Il=[Y.default.s,Y.default.t,Y.default.r,Y.default.e,Y.default.a,Y.default.m],Qc=[Y.default.e,Y.default.n,Y.default.d,Y.default.s,Y.default.t,Y.default.r,Y.default.e,Y.default.a,Y.default.m];$c.Keywords={header:[Y.default.Percent,Y.default.P,Y.default.D,Y.default.F,Y.default.Dash],eof:[Y.default.Percent,Y.default.Percent,Y.default.E,Y.default.O,Y.default.F],obj:[Y.default.o,Y.default.b,Y.default.j],endobj:[Y.default.e,Y.default.n,Y.default.d,Y.default.o,Y.default.b,Y.default.j],xref:[Y.default.x,Y.default.r,Y.default.e,Y.default.f],trailer:[Y.default.t,Y.default.r,Y.default.a,Y.default.i,Y.default.l,Y.default.e,Y.default.r],startxref:[Y.default.s,Y.default.t,Y.default.a,Y.default.r,Y.default.t,Y.default.x,Y.default.r,Y.default.e,Y.default.f],true:[Y.default.t,Y.default.r,Y.default.u,Y.default.e],false:[Y.default.f,Y.default.a,Y.default.l,Y.default.s,Y.default.e],null:[Y.default.n,Y.default.u,Y.default.l,Y.default.l],stream:Il,streamEOF1:Ni.__spreadArrays(Il,[sM,Rl,_l]),streamEOF2:Ni.__spreadArrays(Il,[Rl,_l]),streamEOF3:Ni.__spreadArrays(Il,[Rl]),streamEOF4:Ni.__spreadArrays(Il,[_l]),endstream:Qc,EOF1endstream:Ni.__spreadArrays([Rl,_l],Qc),EOF2endstream:Ni.__spreadArrays([Rl],Qc),EOF3endstream:Ni.__spreadArrays([_l],Qc)}});var eh=E(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var zt=(j(),U(L)),Zv=ze(),aM=zt.__importDefault(Ut()),wS=zt.__importDefault(gl()),oM=zt.__importDefault(Yt()),lM=zt.__importDefault(gr()),Wa=zt.__importDefault(Ce()),uM=zt.__importDefault(vl()),xS=zt.__importDefault(gt()),dM=zt.__importDefault(ka()),cM=zt.__importDefault(sr()),hM=zt.__importDefault(on()),fM=zt.__importDefault(bS()),pM=zt.__importDefault(kl()),gM=zt.__importDefault(Uv()),mM=zt.__importDefault(wl()),vM=zt.__importDefault(Hv()),tt=zt.__importDefault(Ve()),yM=qg(),xr=Yv(),AS=Zc(),bM=lc(),Jv=ae(),wM=function(r){zt.__extends(e,r);function e(t,n,i){i===void 0&&(i=!1);var s=r.call(this,t,i)||this;return s.context=n,s}return e.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(xr.Keywords.true))return wS.default.True;if(this.matchKeyword(xr.Keywords.false))return wS.default.False;if(this.matchKeyword(xr.Keywords.null))return uM.default;var t=this.bytes.peek();if(t===tt.default.LessThan&&this.bytes.peekAhead(1)===tt.default.LessThan)return this.parseDictOrStream();if(t===tt.default.LessThan)return this.parseHexString();if(t===tt.default.LeftParen)return this.parseString();if(t===tt.default.ForwardSlash)return this.parseName();if(t===tt.default.LeftSquareBracket)return this.parseArray();if(AS.IsNumeric[t])return this.parseNumberOrRef();throw new Zv.PDFObjectParsingError(this.bytes.position(),t)},e.prototype.parseNumberOrRef=function(){var t=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(AS.IsDigit[this.bytes.peek()]){var i=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===tt.default.R)return this.bytes.assertNext(tt.default.R),cM.default.of(t,i)}return this.bytes.moveTo(n),xS.default.of(t)},e.prototype.parseHexString=function(){var t="";for(this.bytes.assertNext(tt.default.LessThan);!this.bytes.done()&&this.bytes.peek()!==tt.default.GreaterThan;)t+=Jv.charFromCode(this.bytes.next());return this.bytes.assertNext(tt.default.GreaterThan),lM.default.of(t)},e.prototype.parseString=function(){for(var t=0,n=!1,i="";!this.bytes.done();){var s=this.bytes.next();if(i+=Jv.charFromCode(s),n||(s===tt.default.LeftParen&&(t+=1),s===tt.default.RightParen&&(t-=1)),s===tt.default.BackSlash?n=!n:n&&(n=!1),t===0)return hM.default.of(i.substring(1,i.length-1))}throw new Zv.UnbalancedParenthesisError(this.bytes.position())},e.prototype.parseName=function(){this.bytes.assertNext(tt.default.ForwardSlash);for(var t="";!this.bytes.done();){var n=this.bytes.peek();if(bM.IsWhitespace[n]||yM.IsDelimiter[n])break;t+=Jv.charFromCode(n),this.bytes.next()}return Wa.default.of(t)},e.prototype.parseArray=function(){this.bytes.assertNext(tt.default.LeftSquareBracket),this.skipWhitespaceAndComments();for(var t=aM.default.withContext(this.context);this.bytes.peek()!==tt.default.RightSquareBracket;){var n=this.parseObject();t.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(tt.default.RightSquareBracket),t},e.prototype.parseDict=function(){this.bytes.assertNext(tt.default.LessThan),this.bytes.assertNext(tt.default.LessThan),this.skipWhitespaceAndComments();for(var t=new Map;!this.bytes.done()&&this.bytes.peek()!==tt.default.GreaterThan&&this.bytes.peekAhead(1)!==tt.default.GreaterThan;){var n=this.parseName(),i=this.parseObject();t.set(n,i),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(tt.default.GreaterThan),this.bytes.assertNext(tt.default.GreaterThan);var s=t.get(Wa.default.of("Type"));return s===Wa.default.of("Catalog")?gM.default.fromMapWithContext(t,this.context):s===Wa.default.of("Pages")?vM.default.fromMapWithContext(t,this.context):s===Wa.default.of("Page")?mM.default.fromMapWithContext(t,this.context):oM.default.fromMapWithContext(t,this.context)},e.prototype.parseDictOrStream=function(){var t=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(xr.Keywords.streamEOF1)&&!this.matchKeyword(xr.Keywords.streamEOF2)&&!this.matchKeyword(xr.Keywords.streamEOF3)&&!this.matchKeyword(xr.Keywords.streamEOF4)&&!this.matchKeyword(xr.Keywords.stream))return n;var i=this.bytes.offset(),s,a=n.get(Wa.default.of("Length"));a instanceof xS.default?(s=i+a.asNumber(),this.bytes.moveTo(s),this.skipWhitespaceAndComments(),this.matchKeyword(xr.Keywords.endstream)||(this.bytes.moveTo(i),s=this.findEndOfStreamFallback(t))):s=this.findEndOfStreamFallback(t);var o=this.bytes.slice(i,s);return dM.default.of(n,o)},e.prototype.findEndOfStreamFallback=function(t){for(var n=1,i=this.bytes.offset();!this.bytes.done()&&(i=this.bytes.offset(),this.matchKeyword(xr.Keywords.stream)?n+=1:this.matchKeyword(xr.Keywords.EOF1endstream)||this.matchKeyword(xr.Keywords.EOF2endstream)||this.matchKeyword(xr.Keywords.EOF3endstream)||this.matchKeyword(xr.Keywords.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new Zv.PDFStreamParsingError(t);return i},e.forBytes=function(t,n,i){return new e(pM.default.of(t),n,i)},e.forByteStream=function(t,n,i){return i===void 0&&(i=!1),new e(t,n,i)},e}(fM.default);Qv.default=wM});var e0=E($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});var Li=(j(),U(L)),xM=ze(),SS=Li.__importDefault(Ce()),PS=Li.__importDefault(gt()),AM=Li.__importDefault(sr()),SM=Li.__importDefault(kl()),PM=Li.__importDefault(eh()),FM=ae(),DM=function(r){Li.__extends(e,r);function e(t,n){var i=r.call(this,SM.default.fromPDFRawStream(t),t.dict.context)||this,s=t.dict;return i.alreadyParsed=!1,i.shouldWaitForTick=n||function(){return!1},i.firstOffset=s.lookup(SS.default.of("First"),PS.default).asNumber(),i.objectCount=s.lookup(SS.default.of("N"),PS.default).asNumber(),i}return e.prototype.parseIntoContext=function(){return Li.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o,l,u;return Li.__generator(this,function(d){switch(d.label){case 0:if(this.alreadyParsed)throw new xM.ReparseError("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,t=this.parseOffsetsAndObjectNumbers(),n=0,i=t.length,d.label=1;case 1:return n<i?(s=t[n],a=s.objectNumber,o=s.offset,this.bytes.moveTo(this.firstOffset+o),l=this.parseObject(),u=AM.default.of(a,0),this.context.assign(u,l),this.shouldWaitForTick()?[4,FM.waitForTick()]:[3,3]):[3,4];case 2:d.sent(),d.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e.prototype.parseOffsetsAndObjectNumbers=function(){for(var t=[],n=0,i=this.objectCount;n<i;n++){this.skipWhitespaceAndComments();var s=this.parseRawInt();this.skipWhitespaceAndComments();var a=this.parseRawInt();t.push({objectNumber:s,offset:a})}return t},e.forStream=function(t,n){return new e(t,n)},e}(PM.default);$v.default=DM});var r0=E(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Ol=(j(),U(L)),EM=ze(),FS=Ol.__importDefault(Ut()),_s=Ol.__importDefault(Ce()),th=Ol.__importDefault(gt()),CM=Ol.__importDefault(sr()),TM=Ol.__importDefault(kl()),kM=function(){function r(e){this.alreadyParsed=!1,this.dict=e.dict,this.bytes=TM.default.fromPDFRawStream(e),this.context=this.dict.context;var t=this.dict.lookup(_s.default.of("Size"),th.default),n=this.dict.lookup(_s.default.of("Index"));if(n instanceof FS.default){this.subsections=[];for(var i=0,s=n.size();i<s;i+=2){var a=n.lookup(i+0,th.default).asNumber(),o=n.lookup(i+1,th.default).asNumber();this.subsections.push({firstObjectNumber:a,length:o})}}else this.subsections=[{firstObjectNumber:0,length:t.asNumber()}];var l=this.dict.lookup(_s.default.of("W"),FS.default);this.byteWidths=[-1,-1,-1];for(var i=0,s=l.size();i<s;i++)this.byteWidths[i]=l.lookup(i,th.default).asNumber()}return r.prototype.parseIntoContext=function(){if(this.alreadyParsed)throw new EM.ReparseError("PDFXRefStreamParser","parseIntoContext");this.alreadyParsed=!0,this.context.trailerInfo={Root:this.dict.get(_s.default.of("Root")),Encrypt:this.dict.get(_s.default.of("Encrypt")),Info:this.dict.get(_s.default.of("Info")),ID:this.dict.get(_s.default.of("ID"))};var e=this.parseEntries();return e},r.prototype.parseEntries=function(){for(var e=[],t=this.byteWidths,n=t[0],i=t[1],s=t[2],a=0,o=this.subsections.length;a<o;a++)for(var l=this.subsections[a],u=l.firstObjectNumber,d=l.length,c=0;c<d;c++){for(var h=0,f=0,p=n;f<p;f++)h=h<<8|this.bytes.next();for(var g=0,f=0,p=i;f<p;f++)g=g<<8|this.bytes.next();for(var v=0,f=0,p=s;f<p;f++)v=v<<8|this.bytes.next();n===0&&(h=1);var m=u+c,y={ref:CM.default.of(m,v),offset:g,deleted:h===0,inObjectStream:h===2};e.push(y)}return e},r.forStream=function(e){return new r(e)},r}();t0.default=kM});var CS=E(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var at=(j(),U(L)),RM=at.__importDefault(pc()),_M=at.__importDefault(Sa()),IM=at.__importDefault(xl()),Ml=ze(),OM=at.__importDefault(Yt()),MM=at.__importDefault(yc()),On=at.__importDefault(Ce()),DS=at.__importDefault(ka()),rh=at.__importDefault(sr()),NM=at.__importDefault(kl()),LM=at.__importDefault(eh()),jM=at.__importDefault(e0()),BM=at.__importDefault(r0()),UM=at.__importDefault(lm()),Ka=at.__importDefault(Ve()),Ar=Yv(),ES=Zc(),qM=ae(),zM=function(r){at.__extends(e,r);function e(t,n,i,s){n===void 0&&(n=1/0),i===void 0&&(i=!1),s===void 0&&(s=!1);var a=r.call(this,NM.default.of(t),UM.default.create(),s)||this;return a.alreadyParsed=!1,a.parsedObjects=0,a.shouldWaitForTick=function(){return a.parsedObjects+=1,a.parsedObjects%a.objectsPerTick===0},a.objectsPerTick=n,a.throwOnInvalidObject=i,a}return e.prototype.parseDocument=function(){return at.__awaiter(this,void 0,void 0,function(){var t,n;return at.__generator(this,function(i){switch(i.label){case 0:if(this.alreadyParsed)throw new Ml.ReparseError("PDFParser","parseDocument");this.alreadyParsed=!0,this.context.header=this.parseHeader(),i.label=1;case 1:return this.bytes.done()?[3,3]:[4,this.parseDocumentSection()];case 2:if(i.sent(),n=this.bytes.offset(),n===t)throw new Ml.StalledParserError(this.bytes.position());return t=n,[3,1];case 3:return this.maybeRecoverRoot(),this.context.lookup(rh.default.of(0))&&(console.warn("Removing parsed object: 0 0 R"),this.context.delete(rh.default.of(0))),[2,this.context]}})})},e.prototype.maybeRecoverRoot=function(){var t=function(d){return d instanceof OM.default&&d.lookup(On.default.of("Type"))===On.default.of("Catalog")},n=this.context.lookup(this.context.trailerInfo.Root);if(!t(n))for(var i=this.context.enumerateIndirectObjects(),s=0,a=i.length;s<a;s++){var o=i[s],l=o[0],u=o[1];t(u)&&(this.context.trailerInfo.Root=l)}},e.prototype.parseHeader=function(){for(;!this.bytes.done();){if(this.matchKeyword(Ar.Keywords.header)){var t=this.parseRawInt();this.bytes.assertNext(Ka.default.Period);var n=this.parseRawInt(),i=_M.default.forVersion(t,n);return this.skipBinaryHeaderComment(),i}this.bytes.next()}throw new Ml.MissingPDFHeaderError(this.bytes.position())},e.prototype.parseIndirectObjectHeader=function(){this.skipWhitespaceAndComments();var t=this.parseRawInt();this.skipWhitespaceAndComments();var n=this.parseRawInt();if(this.skipWhitespaceAndComments(),!this.matchKeyword(Ar.Keywords.obj))throw new Ml.MissingKeywordError(this.bytes.position(),Ar.Keywords.obj);return rh.default.of(t,n)},e.prototype.matchIndirectObjectHeader=function(){var t=this.bytes.offset();try{return this.parseIndirectObjectHeader(),!0}catch{return this.bytes.moveTo(t),!1}},e.prototype.parseIndirectObject=function(){return at.__awaiter(this,void 0,void 0,function(){var t,n;return at.__generator(this,function(i){switch(i.label){case 0:return t=this.parseIndirectObjectHeader(),this.skipWhitespaceAndComments(),n=this.parseObject(),this.skipWhitespaceAndComments(),this.matchKeyword(Ar.Keywords.endobj),n instanceof DS.default&&n.dict.lookup(On.default.of("Type"))===On.default.of("ObjStm")?[4,jM.default.forStream(n,this.shouldWaitForTick).parseIntoContext()]:[3,2];case 1:return i.sent(),[3,3];case 2:n instanceof DS.default&&n.dict.lookup(On.default.of("Type"))===On.default.of("XRef")?BM.default.forStream(n).parseIntoContext():this.context.assign(t,n),i.label=3;case 3:return[2,t]}})})},e.prototype.tryToParseInvalidIndirectObject=function(){var t=this.bytes.position(),n="Trying to parse invalid object: "+JSON.stringify(t)+")";if(this.throwOnInvalidObject)throw new Error(n);console.warn(n);var i=this.parseIndirectObjectHeader();console.warn("Invalid object ref: "+i),this.skipWhitespaceAndComments();for(var s=this.bytes.offset(),a=!0;!this.bytes.done()&&(this.matchKeyword(Ar.Keywords.endobj)&&(a=!1),!!a);)this.bytes.next();if(a)throw new Ml.PDFInvalidObjectParsingError(t);var o=this.bytes.offset()-Ar.Keywords.endobj.length,l=MM.default.of(this.bytes.slice(s,o));return this.context.assign(i,l),i},e.prototype.parseIndirectObjects=function(){return at.__awaiter(this,void 0,void 0,function(){var t,n;return at.__generator(this,function(i){switch(i.label){case 0:this.skipWhitespaceAndComments(),i.label=1;case 1:if(!(!this.bytes.done()&&ES.IsDigit[this.bytes.peek()]))return[3,8];t=this.bytes.offset(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.parseIndirectObject()];case 3:return i.sent(),[3,5];case 4:return n=i.sent(),this.bytes.moveTo(t),this.tryToParseInvalidIndirectObject(),[3,5];case 5:return this.skipWhitespaceAndComments(),this.skipJibberish(),this.shouldWaitForTick()?[4,qM.waitForTick()]:[3,7];case 6:i.sent(),i.label=7;case 7:return[3,1];case 8:return[2]}})})},e.prototype.maybeParseCrossRefSection=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(Ar.Keywords.xref)){this.skipWhitespaceAndComments();for(var t=-1,n=RM.default.createEmpty();!this.bytes.done()&&ES.IsDigit[this.bytes.peek()];){var i=this.parseRawInt();this.skipWhitespaceAndComments();var s=this.parseRawInt();this.skipWhitespaceAndComments();var a=this.bytes.peek();if(a===Ka.default.n||a===Ka.default.f){var o=rh.default.of(t,s);this.bytes.next()===Ka.default.n?n.addEntry(o,i):n.addDeletedEntry(o,i),t+=1}else t=i;this.skipWhitespaceAndComments()}return n}},e.prototype.maybeParseTrailerDict=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(Ar.Keywords.trailer)){this.skipWhitespaceAndComments();var t=this.parseDict(),n=this.context;n.trailerInfo={Root:t.get(On.default.of("Root"))||n.trailerInfo.Root,Encrypt:t.get(On.default.of("Encrypt"))||n.trailerInfo.Encrypt,Info:t.get(On.default.of("Info"))||n.trailerInfo.Info,ID:t.get(On.default.of("ID"))||n.trailerInfo.ID}}},e.prototype.maybeParseTrailer=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(Ar.Keywords.startxref)){this.skipWhitespaceAndComments();var t=this.parseRawInt();return this.skipWhitespace(),this.matchKeyword(Ar.Keywords.eof),this.skipWhitespaceAndComments(),this.matchKeyword(Ar.Keywords.eof),this.skipWhitespaceAndComments(),IM.default.forLastCrossRefSectionOffset(t)}},e.prototype.parseDocumentSection=function(){return at.__awaiter(this,void 0,void 0,function(){return at.__generator(this,function(t){switch(t.label){case 0:return[4,this.parseIndirectObjects()];case 1:return t.sent(),this.maybeParseCrossRefSection(),this.maybeParseTrailerDict(),this.maybeParseTrailer(),this.skipJibberish(),[2]}})})},e.prototype.skipJibberish=function(){for(this.skipWhitespaceAndComments();!this.bytes.done();){var t=this.bytes.offset(),n=this.bytes.peek(),i=n>=Ka.default.Space&&n<=Ka.default.Tilde;if(i&&(this.matchKeyword(Ar.Keywords.xref)||this.matchKeyword(Ar.Keywords.trailer)||this.matchKeyword(Ar.Keywords.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(t);break}this.bytes.next()}},e.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var t=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(t)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},e.forBytesWithOptions=function(t,n,i,s){return new e(t,n,i,s)},e}(LM.default);n0.default=zM});var TS=E(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.AnnotationFlags=void 0;var Mn=function(r){return 1<<r},VM;(function(r){r[r.Invisible=Mn(0)]="Invisible",r[r.Hidden=Mn(1)]="Hidden",r[r.Print=Mn(2)]="Print",r[r.NoZoom=Mn(3)]="NoZoom",r[r.NoRotate=Mn(4)]="NoRotate",r[r.NoView=Mn(5)]="NoView",r[r.ReadOnly=Mn(6)]="ReadOnly",r[r.Locked=Mn(7)]="Locked",r[r.ToggleNoView=Mn(8)]="ToggleNoView",r[r.LockedContents=Mn(9)]="LockedContents"})(VM=Nl.AnnotationFlags||(Nl.AnnotationFlags={}))});var kS=E(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});var HM=(j(),U(L)),GM=Qm();Object.defineProperty(Xa,"PDFAnnotation",{enumerable:!0,get:function(){return GM.default}});var WM=ov();Object.defineProperty(Xa,"PDFWidgetAnnotation",{enumerable:!0,get:function(){return WM.default}});var KM=rv();Object.defineProperty(Xa,"AppearanceCharacteristics",{enumerable:!0,get:function(){return KM.default}});HM.__exportStar(TS(),Xa)});var St=E(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});var i0=(j(),U(L));i0.__exportStar(ze(),ne);var XM=Ve();Object.defineProperty(ne,"CharCodes",{enumerable:!0,get:function(){return XM.default}});var YM=lm();Object.defineProperty(ne,"PDFContext",{enumerable:!0,get:function(){return YM.default}});var ZM=iA();Object.defineProperty(ne,"PDFObjectCopier",{enumerable:!0,get:function(){return ZM.default}});var JM=ym();Object.defineProperty(ne,"PDFWriter",{enumerable:!0,get:function(){return JM.default}});var QM=uA();Object.defineProperty(ne,"PDFStreamWriter",{enumerable:!0,get:function(){return QM.default}});var $M=Sa();Object.defineProperty(ne,"PDFHeader",{enumerable:!0,get:function(){return $M.default}});var eN=xl();Object.defineProperty(ne,"PDFTrailer",{enumerable:!0,get:function(){return eN.default}});var tN=pm();Object.defineProperty(ne,"PDFTrailerDict",{enumerable:!0,get:function(){return tN.default}});var rN=pc();Object.defineProperty(ne,"PDFCrossRefSection",{enumerable:!0,get:function(){return rN.default}});var nN=hA();Object.defineProperty(ne,"StandardFontEmbedder",{enumerable:!0,get:function(){return nN.default}});var iN=Cm();Object.defineProperty(ne,"CustomFontEmbedder",{enumerable:!0,get:function(){return iN.default}});var sN=yA();Object.defineProperty(ne,"CustomFontSubsetEmbedder",{enumerable:!0,get:function(){return sN.default}});var RS=_m();Object.defineProperty(ne,"FileEmbedder",{enumerable:!0,get:function(){return RS.default}});Object.defineProperty(ne,"AFRelationship",{enumerable:!0,get:function(){return RS.AFRelationship}});var aN=xA();Object.defineProperty(ne,"JpegEmbedder",{enumerable:!0,get:function(){return aN.default}});var oN=FA();Object.defineProperty(ne,"PngEmbedder",{enumerable:!0,get:function(){return oN.default}});var lN=VA();Object.defineProperty(ne,"PDFPageEmbedder",{enumerable:!0,get:function(){return lN.default}});var Ll=Wm();Object.defineProperty(ne,"ViewerPreferences",{enumerable:!0,get:function(){return Ll.default}});Object.defineProperty(ne,"NonFullScreenPageMode",{enumerable:!0,get:function(){return Ll.NonFullScreenPageMode}});Object.defineProperty(ne,"ReadingDirection",{enumerable:!0,get:function(){return Ll.ReadingDirection}});Object.defineProperty(ne,"PrintScaling",{enumerable:!0,get:function(){return Ll.PrintScaling}});Object.defineProperty(ne,"Duplex",{enumerable:!0,get:function(){return Ll.Duplex}});var uN=ir();Object.defineProperty(ne,"PDFObject",{enumerable:!0,get:function(){return uN.default}});var dN=gl();Object.defineProperty(ne,"PDFBool",{enumerable:!0,get:function(){return dN.default}});var cN=gt();Object.defineProperty(ne,"PDFNumber",{enumerable:!0,get:function(){return cN.default}});var hN=on();Object.defineProperty(ne,"PDFString",{enumerable:!0,get:function(){return hN.default}});var fN=gr();Object.defineProperty(ne,"PDFHexString",{enumerable:!0,get:function(){return fN.default}});var pN=Ce();Object.defineProperty(ne,"PDFName",{enumerable:!0,get:function(){return pN.default}});var gN=vl();Object.defineProperty(ne,"PDFNull",{enumerable:!0,get:function(){return gN.default}});var mN=Ut();Object.defineProperty(ne,"PDFArray",{enumerable:!0,get:function(){return mN.default}});var vN=Yt();Object.defineProperty(ne,"PDFDict",{enumerable:!0,get:function(){return vN.default}});var yN=sr();Object.defineProperty(ne,"PDFRef",{enumerable:!0,get:function(){return yN.default}});var bN=yc();Object.defineProperty(ne,"PDFInvalidObject",{enumerable:!0,get:function(){return bN.default}});var wN=ni();Object.defineProperty(ne,"PDFStream",{enumerable:!0,get:function(){return wN.default}});var xN=ka();Object.defineProperty(ne,"PDFRawStream",{enumerable:!0,get:function(){return xN.default}});var AN=Uv();Object.defineProperty(ne,"PDFCatalog",{enumerable:!0,get:function(){return AN.default}});var SN=hc();Object.defineProperty(ne,"PDFContentStream",{enumerable:!0,get:function(){return SN.default}});var PN=wm();Object.defineProperty(ne,"PDFCrossRefStream",{enumerable:!0,get:function(){return PN.default}});var FN=mc();Object.defineProperty(ne,"PDFObjectStream",{enumerable:!0,get:function(){return FN.default}});var DN=Hv();Object.defineProperty(ne,"PDFPageTree",{enumerable:!0,get:function(){return DN.default}});var EN=wl();Object.defineProperty(ne,"PDFPageLeaf",{enumerable:!0,get:function(){return EN.default}});var CN=bl();Object.defineProperty(ne,"PDFFlateStream",{enumerable:!0,get:function(){return CN.default}});var TN=Qg();Object.defineProperty(ne,"PDFOperator",{enumerable:!0,get:function(){return TN.default}});var kN=tm();Object.defineProperty(ne,"PDFOperatorNames",{enumerable:!0,get:function(){return kN.default}});var RN=eh();Object.defineProperty(ne,"PDFObjectParser",{enumerable:!0,get:function(){return RN.default}});var _N=e0();Object.defineProperty(ne,"PDFObjectStreamParser",{enumerable:!0,get:function(){return _N.default}});var IN=CS();Object.defineProperty(ne,"PDFParser",{enumerable:!0,get:function(){return IN.default}});var ON=r0();Object.defineProperty(ne,"PDFXRefStreamParser",{enumerable:!0,get:function(){return ON.default}});var MN=_c();Object.defineProperty(ne,"decodePDFRawStream",{enumerable:!0,get:function(){return MN.decodePDFRawStream}});i0.__exportStar(kS(),ne);i0.__exportStar(jv(),ne)});var nh=E(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.asNumber=ji.asPDFNumber=ji.asPDFName=void 0;var jl=St();ji.asPDFName=function(r){return r instanceof jl.PDFName?r:jl.PDFName.of(r)};ji.asPDFNumber=function(r){return r instanceof jl.PDFNumber?r:jl.PDFNumber.of(r)};ji.asNumber=function(r){return r instanceof jl.PDFNumber?r.asNumber():r}});var Or=E(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.rotateRectangle=We.adjustDimsForRotation=We.reduceRotation=We.toDegrees=We.toRadians=We.radiansToDegrees=We.degreesToRadians=We.degrees=We.radians=We.RotationTypes=void 0;var ih=ae(),Bl;(function(r){r.Degrees="degrees",r.Radians="radians"})(Bl=We.RotationTypes||(We.RotationTypes={}));We.radians=function(r){return ih.assertIs(r,"radianAngle",["number"]),{type:Bl.Radians,angle:r}};We.degrees=function(r){return ih.assertIs(r,"degreeAngle",["number"]),{type:Bl.Degrees,angle:r}};var _S=Bl.Radians,IS=Bl.Degrees;We.degreesToRadians=function(r){return r*Math.PI/180};We.radiansToDegrees=function(r){return r*180/Math.PI};We.toRadians=function(r){return r.type===_S?r.angle:r.type===IS?We.degreesToRadians(r.angle):ih.error("Invalid rotation: "+JSON.stringify(r))};We.toDegrees=function(r){return r.type===_S?We.radiansToDegrees(r.angle):r.type===IS?r.angle:ih.error("Invalid rotation: "+JSON.stringify(r))};We.reduceRotation=function(r){r===void 0&&(r=0);var e=r/90%4;return e===0?0:e===1?90:e===2?180:e===3?270:0};We.adjustDimsForRotation=function(r,e){e===void 0&&(e=0);var t=We.reduceRotation(e);return t===90||t===270?{width:r.height,height:r.width}:{width:r.width,height:r.height}};We.rotateRectangle=function(r,e,t){e===void 0&&(e=0),t===void 0&&(t=0);var n=r.x,i=r.y,s=r.width,a=r.height,o=We.reduceRotation(t),l=e/2;return o===0?{x:n-l,y:i-l,width:s,height:a}:o===90?{x:n-a+l,y:i-l,width:a,height:s}:o===180?{x:n-s+l,y:i-a+l,width:s,height:a}:o===270?{x:n-l,y:i-s+l,width:a,height:s}:{x:n-l,y:i-l,width:s,height:a}}});var Bi=E(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.endMarkedContent=I.beginMarkedContent=I.setStrokingCmykColor=I.setFillingCmykColor=I.setStrokingRgbColor=I.setFillingRgbColor=I.setStrokingGrayscaleColor=I.setFillingGrayscaleColor=I.drawObject=I.rotateAndSkewTextDegreesAndTranslate=I.rotateAndSkewTextRadiansAndTranslate=I.setTextMatrix=I.setTextRenderingMode=I.TextRenderingMode=I.setTextRise=I.setLineHeight=I.setCharacterSqueeze=I.setWordSpacing=I.setCharacterSpacing=I.setFontAndSize=I.endText=I.beginText=I.showText=I.moveText=I.nextLine=I.endPath=I.fillAndStroke=I.fill=I.stroke=I.square=I.rectangle=I.lineTo=I.moveTo=I.closePath=I.appendQuadraticCurve=I.appendBezierCurve=I.setLineWidth=I.popGraphicsState=I.pushGraphicsState=I.setGraphicsState=I.setLineJoin=I.LineJoinStyle=I.setLineCap=I.LineCapStyle=I.restoreDashPattern=I.setDashPattern=I.skewDegrees=I.skewRadians=I.rotateDegrees=I.rotateRadians=I.scale=I.translate=I.concatTransformationMatrix=I.clipEvenOdd=I.clip=void 0;var V=nh(),Ya=Or(),z=St();I.clip=function(){return z.PDFOperator.of(z.PDFOperatorNames.ClipNonZero)};I.clipEvenOdd=function(){return z.PDFOperator.of(z.PDFOperatorNames.ClipEvenOdd)};var sh=Math.cos,ah=Math.sin,oh=Math.tan;I.concatTransformationMatrix=function(r,e,t,n,i,s){return z.PDFOperator.of(z.PDFOperatorNames.ConcatTransformationMatrix,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n),V.asPDFNumber(i),V.asPDFNumber(s)])};I.translate=function(r,e){return I.concatTransformationMatrix(1,0,0,1,r,e)};I.scale=function(r,e){return I.concatTransformationMatrix(r,0,0,e,0,0)};I.rotateRadians=function(r){return I.concatTransformationMatrix(sh(V.asNumber(r)),ah(V.asNumber(r)),-ah(V.asNumber(r)),sh(V.asNumber(r)),0,0)};I.rotateDegrees=function(r){return I.rotateRadians(Ya.degreesToRadians(V.asNumber(r)))};I.skewRadians=function(r,e){return I.concatTransformationMatrix(1,oh(V.asNumber(r)),oh(V.asNumber(e)),1,0,0)};I.skewDegrees=function(r,e){return I.skewRadians(Ya.degreesToRadians(V.asNumber(r)),Ya.degreesToRadians(V.asNumber(e)))};I.setDashPattern=function(r,e){return z.PDFOperator.of(z.PDFOperatorNames.SetLineDashPattern,["["+r.map(V.asPDFNumber).join(" ")+"]",V.asPDFNumber(e)])};I.restoreDashPattern=function(){return I.setDashPattern([],0)};var NN;(function(r){r[r.Butt=0]="Butt",r[r.Round=1]="Round",r[r.Projecting=2]="Projecting"})(NN=I.LineCapStyle||(I.LineCapStyle={}));I.setLineCap=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetLineCapStyle,[V.asPDFNumber(r)])};var LN;(function(r){r[r.Miter=0]="Miter",r[r.Round=1]="Round",r[r.Bevel=2]="Bevel"})(LN=I.LineJoinStyle||(I.LineJoinStyle={}));I.setLineJoin=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetLineJoinStyle,[V.asPDFNumber(r)])};I.setGraphicsState=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetGraphicsStateParams,[V.asPDFName(r)])};I.pushGraphicsState=function(){return z.PDFOperator.of(z.PDFOperatorNames.PushGraphicsState)};I.popGraphicsState=function(){return z.PDFOperator.of(z.PDFOperatorNames.PopGraphicsState)};I.setLineWidth=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetLineWidth,[V.asPDFNumber(r)])};I.appendBezierCurve=function(r,e,t,n,i,s){return z.PDFOperator.of(z.PDFOperatorNames.AppendBezierCurve,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n),V.asPDFNumber(i),V.asPDFNumber(s)])};I.appendQuadraticCurve=function(r,e,t,n){return z.PDFOperator.of(z.PDFOperatorNames.CurveToReplicateInitialPoint,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n)])};I.closePath=function(){return z.PDFOperator.of(z.PDFOperatorNames.ClosePath)};I.moveTo=function(r,e){return z.PDFOperator.of(z.PDFOperatorNames.MoveTo,[V.asPDFNumber(r),V.asPDFNumber(e)])};I.lineTo=function(r,e){return z.PDFOperator.of(z.PDFOperatorNames.LineTo,[V.asPDFNumber(r),V.asPDFNumber(e)])};I.rectangle=function(r,e,t,n){return z.PDFOperator.of(z.PDFOperatorNames.AppendRectangle,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n)])};I.square=function(r,e,t){return I.rectangle(r,e,t,t)};I.stroke=function(){return z.PDFOperator.of(z.PDFOperatorNames.StrokePath)};I.fill=function(){return z.PDFOperator.of(z.PDFOperatorNames.FillNonZero)};I.fillAndStroke=function(){return z.PDFOperator.of(z.PDFOperatorNames.FillNonZeroAndStroke)};I.endPath=function(){return z.PDFOperator.of(z.PDFOperatorNames.EndPath)};I.nextLine=function(){return z.PDFOperator.of(z.PDFOperatorNames.NextLine)};I.moveText=function(r,e){return z.PDFOperator.of(z.PDFOperatorNames.MoveText,[V.asPDFNumber(r),V.asPDFNumber(e)])};I.showText=function(r){return z.PDFOperator.of(z.PDFOperatorNames.ShowText,[r])};I.beginText=function(){return z.PDFOperator.of(z.PDFOperatorNames.BeginText)};I.endText=function(){return z.PDFOperator.of(z.PDFOperatorNames.EndText)};I.setFontAndSize=function(r,e){return z.PDFOperator.of(z.PDFOperatorNames.SetFontAndSize,[V.asPDFName(r),V.asPDFNumber(e)])};I.setCharacterSpacing=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetCharacterSpacing,[V.asPDFNumber(r)])};I.setWordSpacing=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetWordSpacing,[V.asPDFNumber(r)])};I.setCharacterSqueeze=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetTextHorizontalScaling,[V.asPDFNumber(r)])};I.setLineHeight=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetTextLineHeight,[V.asPDFNumber(r)])};I.setTextRise=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetTextRise,[V.asPDFNumber(r)])};var jN;(function(r){r[r.Fill=0]="Fill",r[r.Outline=1]="Outline",r[r.FillAndOutline=2]="FillAndOutline",r[r.Invisible=3]="Invisible",r[r.FillAndClip=4]="FillAndClip",r[r.OutlineAndClip=5]="OutlineAndClip",r[r.FillAndOutlineAndClip=6]="FillAndOutlineAndClip",r[r.Clip=7]="Clip"})(jN=I.TextRenderingMode||(I.TextRenderingMode={}));I.setTextRenderingMode=function(r){return z.PDFOperator.of(z.PDFOperatorNames.SetTextRenderingMode,[V.asPDFNumber(r)])};I.setTextMatrix=function(r,e,t,n,i,s){return z.PDFOperator.of(z.PDFOperatorNames.SetTextMatrix,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n),V.asPDFNumber(i),V.asPDFNumber(s)])};I.rotateAndSkewTextRadiansAndTranslate=function(r,e,t,n,i){return I.setTextMatrix(sh(V.asNumber(r)),ah(V.asNumber(r))+oh(V.asNumber(e)),-ah(V.asNumber(r))+oh(V.asNumber(t)),sh(V.asNumber(r)),n,i)};I.rotateAndSkewTextDegreesAndTranslate=function(r,e,t,n,i){return I.rotateAndSkewTextRadiansAndTranslate(Ya.degreesToRadians(V.asNumber(r)),Ya.degreesToRadians(V.asNumber(e)),Ya.degreesToRadians(V.asNumber(t)),n,i)};I.drawObject=function(r){return z.PDFOperator.of(z.PDFOperatorNames.DrawObject,[V.asPDFName(r)])};I.setFillingGrayscaleColor=function(r){return z.PDFOperator.of(z.PDFOperatorNames.NonStrokingColorGray,[V.asPDFNumber(r)])};I.setStrokingGrayscaleColor=function(r){return z.PDFOperator.of(z.PDFOperatorNames.StrokingColorGray,[V.asPDFNumber(r)])};I.setFillingRgbColor=function(r,e,t){return z.PDFOperator.of(z.PDFOperatorNames.NonStrokingColorRgb,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t)])};I.setStrokingRgbColor=function(r,e,t){return z.PDFOperator.of(z.PDFOperatorNames.StrokingColorRgb,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t)])};I.setFillingCmykColor=function(r,e,t,n){return z.PDFOperator.of(z.PDFOperatorNames.NonStrokingColorCmyk,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n)])};I.setStrokingCmykColor=function(r,e,t,n){return z.PDFOperator.of(z.PDFOperatorNames.StrokingColorCmyk,[V.asPDFNumber(r),V.asPDFNumber(e),V.asPDFNumber(t),V.asPDFNumber(n)])};I.beginMarkedContent=function(r){return z.PDFOperator.of(z.PDFOperatorNames.BeginMarkedContent,[V.asPDFName(r)])};I.endMarkedContent=function(){return z.PDFOperator.of(z.PDFOperatorNames.EndMarkedContent)}});var Wr=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.colorToComponents=ut.componentsToColor=ut.setStrokingColor=ut.setFillingColor=ut.cmyk=ut.rgb=ut.grayscale=ut.ColorTypes=void 0;var Za=Bi(),dn=ae(),Is;(function(r){r.Grayscale="Grayscale",r.RGB="RGB",r.CMYK="CMYK"})(Is=ut.ColorTypes||(ut.ColorTypes={}));ut.grayscale=function(r){return dn.assertRange(r,"gray",0,1),{type:Is.Grayscale,gray:r}};ut.rgb=function(r,e,t){return dn.assertRange(r,"red",0,1),dn.assertRange(e,"green",0,1),dn.assertRange(t,"blue",0,1),{type:Is.RGB,red:r,green:e,blue:t}};ut.cmyk=function(r,e,t,n){return dn.assertRange(r,"cyan",0,1),dn.assertRange(e,"magenta",0,1),dn.assertRange(t,"yellow",0,1),dn.assertRange(n,"key",0,1),{type:Is.CMYK,cyan:r,magenta:e,yellow:t,key:n}};var s0=Is.Grayscale,a0=Is.RGB,o0=Is.CMYK;ut.setFillingColor=function(r){return r.type===s0?Za.setFillingGrayscaleColor(r.gray):r.type===a0?Za.setFillingRgbColor(r.red,r.green,r.blue):r.type===o0?Za.setFillingCmykColor(r.cyan,r.magenta,r.yellow,r.key):dn.error("Invalid color: "+JSON.stringify(r))};ut.setStrokingColor=function(r){return r.type===s0?Za.setStrokingGrayscaleColor(r.gray):r.type===a0?Za.setStrokingRgbColor(r.red,r.green,r.blue):r.type===o0?Za.setStrokingCmykColor(r.cyan,r.magenta,r.yellow,r.key):dn.error("Invalid color: "+JSON.stringify(r))};ut.componentsToColor=function(r,e){return e===void 0&&(e=1),r?.length===1?ut.grayscale(r[0]*e):r?.length===3?ut.rgb(r[0]*e,r[1]*e,r[2]*e):r?.length===4?ut.cmyk(r[0]*e,r[1]*e,r[2]*e,r[3]*e):void 0};ut.colorToComponents=function(r){return r.type===s0?[r.gray]:r.type===a0?[r.red,r.green,r.blue]:r.type===o0?[r.cyan,r.magenta,r.yellow,r.key]:dn.error("Invalid color: "+JSON.stringify(r))}});var LS=E(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.svgPathToOperators=void 0;var Tt=Bi(),ee=0,te=0,Ae=0,Se=0,Ul=0,ql=0,OS=new Map([["A",7],["a",7],["C",6],["c",6],["H",1],["h",1],["L",2],["l",2],["M",2],["m",2],["Q",4],["q",4],["S",4],["s",4],["T",2],["t",2],["V",1],["v",1],["Z",0],["z",0]]),BN=function(r){for(var e,t=[],n=[],i="",s=!1,a=0,o=0,l=r;o<l.length;o++){var u=l[o];if(OS.has(u))a=OS.get(u),e&&(i.length>0&&(n[n.length]=+i),t[t.length]={cmd:e,args:n},n=[],i="",s=!1),e=u;else if([" ",","].includes(u)||u==="-"&&i.length>0&&i[i.length-1]!=="e"||u==="."&&s){if(i.length===0)continue;n.length===a?(t[t.length]={cmd:e,args:n},n=[+i],e==="M"&&(e="L"),e==="m"&&(e="l")):n[n.length]=+i,s=u===".",i=["-","."].includes(u)?u:""}else i+=u,u==="."&&(s=!0)}return i.length>0&&(n.length===a?(t[t.length]={cmd:e,args:n},n=[+i],e==="M"&&(e="L"),e==="m"&&(e="l")):n[n.length]=+i),t[t.length]={cmd:e,args:n},t},UN=function(r){ee=te=Ae=Se=Ul=ql=0;for(var e=[],t=0;t<r.length;t++){var n=r[t];if(n.cmd&&typeof MS[n.cmd]=="function"){var i=MS[n.cmd](n.args);Array.isArray(i)?e=e.concat(i):e.push(i)}}return e},MS={M:function(r){return ee=r[0],te=r[1],Ae=Se=null,Ul=ee,ql=te,Tt.moveTo(ee,te)},m:function(r){return ee+=r[0],te+=r[1],Ae=Se=null,Ul=ee,ql=te,Tt.moveTo(ee,te)},C:function(r){return ee=r[4],te=r[5],Ae=r[2],Se=r[3],Tt.appendBezierCurve(r[0],r[1],r[2],r[3],r[4],r[5])},c:function(r){var e=Tt.appendBezierCurve(r[0]+ee,r[1]+te,r[2]+ee,r[3]+te,r[4]+ee,r[5]+te);return Ae=ee+r[2],Se=te+r[3],ee+=r[4],te+=r[5],e},S:function(r){(Ae===null||Se===null)&&(Ae=ee,Se=te);var e=Tt.appendBezierCurve(ee-(Ae-ee),te-(Se-te),r[0],r[1],r[2],r[3]);return Ae=r[0],Se=r[1],ee=r[2],te=r[3],e},s:function(r){(Ae===null||Se===null)&&(Ae=ee,Se=te);var e=Tt.appendBezierCurve(ee-(Ae-ee),te-(Se-te),ee+r[0],te+r[1],ee+r[2],te+r[3]);return Ae=ee+r[0],Se=te+r[1],ee+=r[2],te+=r[3],e},Q:function(r){return Ae=r[0],Se=r[1],ee=r[2],te=r[3],Tt.appendQuadraticCurve(r[0],r[1],ee,te)},q:function(r){var e=Tt.appendQuadraticCurve(r[0]+ee,r[1]+te,r[2]+ee,r[3]+te);return Ae=ee+r[0],Se=te+r[1],ee+=r[2],te+=r[3],e},T:function(r){Ae===null||Se===null?(Ae=ee,Se=te):(Ae=ee-(Ae-ee),Se=te-(Se-te));var e=Tt.appendQuadraticCurve(Ae,Se,r[0],r[1]);return Ae=ee-(Ae-ee),Se=te-(Se-te),ee=r[0],te=r[1],e},t:function(r){Ae===null||Se===null?(Ae=ee,Se=te):(Ae=ee-(Ae-ee),Se=te-(Se-te));var e=Tt.appendQuadraticCurve(Ae,Se,ee+r[0],te+r[1]);return ee+=r[0],te+=r[1],e},A:function(r){var e=NS(ee,te,r);return ee=r[5],te=r[6],e},a:function(r){r[5]+=ee,r[6]+=te;var e=NS(ee,te,r);return ee=r[5],te=r[6],e},L:function(r){return ee=r[0],te=r[1],Ae=Se=null,Tt.lineTo(ee,te)},l:function(r){return ee+=r[0],te+=r[1],Ae=Se=null,Tt.lineTo(ee,te)},H:function(r){return ee=r[0],Ae=Se=null,Tt.lineTo(ee,te)},h:function(r){return ee+=r[0],Ae=Se=null,Tt.lineTo(ee,te)},V:function(r){return te=r[0],Ae=Se=null,Tt.lineTo(ee,te)},v:function(r){return te+=r[0],Ae=Se=null,Tt.lineTo(ee,te)},Z:function(){var r=Tt.closePath();return ee=Ul,te=ql,r},z:function(){var r=Tt.closePath();return ee=Ul,te=ql,r}},NS=function(r,e,t){for(var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],d=qN(l,u,n,i,a,o,s,r,e),c=[],h=0,f=d;h<f.length;h++){var p=f[h],g=zN.apply(void 0,p);c.push(Tt.appendBezierCurve.apply(void 0,g))}return c},qN=function(r,e,t,n,i,s,a,o,l){var u=a*(Math.PI/180),d=Math.sin(u),c=Math.cos(u);t=Math.abs(t),n=Math.abs(n),Ae=c*(o-r)*.5+d*(l-e)*.5,Se=c*(l-e)*.5-d*(o-r)*.5;var h=Ae*Ae/(t*t)+Se*Se/(n*n);h>1&&(h=Math.sqrt(h),t*=h,n*=h);var f=c/t,p=d/t,g=-d/n,v=c/n,m=f*o+p*l,y=g*o+v*l,w=f*r+p*e,x=g*r+v*e,b=(w-m)*(w-m)+(x-y)*(x-y),A=1/b-.25;A<0&&(A=0);var S=Math.sqrt(A);s===i&&(S=-S);var P=.5*(m+w)-S*(x-y),F=.5*(y+x)+S*(w-m),k=Math.atan2(y-F,m-P),D=Math.atan2(x-F,w-P),_=D-k;_<0&&s===1?_+=2*Math.PI:_>0&&s===0&&(_-=2*Math.PI);for(var B=Math.ceil(Math.abs(_/(Math.PI*.5+.001))),N=[],G=0;G<B;G++){var O=k+G*_/B,R=k+(G+1)*_/B;N[G]=[P,F,O,R,t,n,d,c]}return N},zN=function(r,e,t,n,i,s,a,o){var l=o*i,u=-a*s,d=a*i,c=o*s,h=.5*(n-t),f=8/3*Math.sin(h*.5)*Math.sin(h*.5)/Math.sin(h),p=r+Math.cos(t)-f*Math.sin(t),g=e+Math.sin(t)+f*Math.cos(t),v=r+Math.cos(n),m=e+Math.sin(n),y=v+f*Math.sin(n),w=m-f*Math.cos(n),x=[l*p+u*g,d*p+c*g,l*y+u*w,d*y+c*w,l*v+u*m,d*v+c*m];return x};lh.svgPathToOperators=function(r){return UN(BN(r))}});var Ja=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.drawOptionList=oe.drawTextField=oe.drawTextLines=oe.drawButton=oe.drawRadioButton=oe.drawCheckBox=oe.rotateInPlace=oe.drawCheckMark=oe.drawSvgPath=oe.drawEllipse=oe.drawEllipsePath=oe.drawRectangle=oe.drawLine=oe.drawPage=oe.drawImage=oe.drawLinesOfText=oe.drawText=void 0;var li=(j(),U(L)),cn=Wr(),C=Bi(),he=Or(),VN=LS(),Me=nh();oe.drawText=function(r,e){return[C.pushGraphicsState(),e.graphicsState&&C.setGraphicsState(e.graphicsState),C.beginText(),cn.setFillingColor(e.color),C.setFontAndSize(e.font,e.size),C.rotateAndSkewTextRadiansAndTranslate(he.toRadians(e.rotate),he.toRadians(e.xSkew),he.toRadians(e.ySkew),e.x,e.y),C.showText(r),C.endText(),C.popGraphicsState()].filter(Boolean)};oe.drawLinesOfText=function(r,e){for(var t=[C.pushGraphicsState(),e.graphicsState&&C.setGraphicsState(e.graphicsState),C.beginText(),cn.setFillingColor(e.color),C.setFontAndSize(e.font,e.size),C.setLineHeight(e.lineHeight),C.rotateAndSkewTextRadiansAndTranslate(he.toRadians(e.rotate),he.toRadians(e.xSkew),he.toRadians(e.ySkew),e.x,e.y)].filter(Boolean),n=0,i=r.length;n<i;n++)t.push(C.showText(r[n]),C.nextLine());return t.push(C.endText(),C.popGraphicsState()),t};oe.drawImage=function(r,e){return[C.pushGraphicsState(),e.graphicsState&&C.setGraphicsState(e.graphicsState),C.translate(e.x,e.y),C.rotateRadians(he.toRadians(e.rotate)),C.scale(e.width,e.height),C.skewRadians(he.toRadians(e.xSkew),he.toRadians(e.ySkew)),C.drawObject(r),C.popGraphicsState()].filter(Boolean)};oe.drawPage=function(r,e){return[C.pushGraphicsState(),e.graphicsState&&C.setGraphicsState(e.graphicsState),C.translate(e.x,e.y),C.rotateRadians(he.toRadians(e.rotate)),C.scale(e.xScale,e.yScale),C.skewRadians(he.toRadians(e.xSkew),he.toRadians(e.ySkew)),C.drawObject(r),C.popGraphicsState()].filter(Boolean)};oe.drawLine=function(r){var e,t;return[C.pushGraphicsState(),r.graphicsState&&C.setGraphicsState(r.graphicsState),r.color&&cn.setStrokingColor(r.color),C.setLineWidth(r.thickness),C.setDashPattern((e=r.dashArray)!==null&&e!==void 0?e:[],(t=r.dashPhase)!==null&&t!==void 0?t:0),C.moveTo(r.start.x,r.start.y),r.lineCap&&C.setLineCap(r.lineCap),C.moveTo(r.start.x,r.start.y),C.lineTo(r.end.x,r.end.y),C.stroke(),C.popGraphicsState()].filter(Boolean)};oe.drawRectangle=function(r){var e,t;return[C.pushGraphicsState(),r.graphicsState&&C.setGraphicsState(r.graphicsState),r.color&&cn.setFillingColor(r.color),r.borderColor&&cn.setStrokingColor(r.borderColor),C.setLineWidth(r.borderWidth),r.borderLineCap&&C.setLineCap(r.borderLineCap),C.setDashPattern((e=r.borderDashArray)!==null&&e!==void 0?e:[],(t=r.borderDashPhase)!==null&&t!==void 0?t:0),C.translate(r.x,r.y),C.rotateRadians(he.toRadians(r.rotate)),C.skewRadians(he.toRadians(r.xSkew),he.toRadians(r.ySkew)),C.moveTo(0,0),C.lineTo(0,r.height),C.lineTo(r.width,r.height),C.lineTo(r.width,0),C.closePath(),r.color&&r.borderWidth?C.fillAndStroke():r.color?C.fill():r.borderColor?C.stroke():C.closePath(),C.popGraphicsState()].filter(Boolean)};var uh=4*((Math.sqrt(2)-1)/3);oe.drawEllipsePath=function(r){var e=Me.asNumber(r.x),t=Me.asNumber(r.y),n=Me.asNumber(r.xScale),i=Me.asNumber(r.yScale);e-=n,t-=i;var s=n*uh,a=i*uh,o=e+n*2,l=t+i*2,u=e+n,d=t+i;return[C.pushGraphicsState(),C.moveTo(e,d),C.appendBezierCurve(e,d-a,u-s,t,u,t),C.appendBezierCurve(u+s,t,o,d-a,o,d),C.appendBezierCurve(o,d+a,u+s,l,u,l),C.appendBezierCurve(u-s,l,e,d+a,e,d),C.popGraphicsState()]};var HN=function(r){var e=Me.asNumber(r.x),t=Me.asNumber(r.y),n=Me.asNumber(r.xScale),i=Me.asNumber(r.yScale),s=-n,a=-i,o=n*uh,l=i*uh,u=s+n*2,d=a+i*2,c=s+n,h=a+i;return[C.translate(e,t),C.rotateRadians(he.toRadians(r.rotate)),C.moveTo(s,h),C.appendBezierCurve(s,h-l,c-o,a,c,a),C.appendBezierCurve(c+o,a,u,h-l,u,h),C.appendBezierCurve(u,h+l,c+o,d,c,d),C.appendBezierCurve(c-o,d,s,h+l,s,h)]};oe.drawEllipse=function(r){var e,t,n;return li.__spreadArrays([C.pushGraphicsState(),r.graphicsState&&C.setGraphicsState(r.graphicsState),r.color&&cn.setFillingColor(r.color),r.borderColor&&cn.setStrokingColor(r.borderColor),C.setLineWidth(r.borderWidth),r.borderLineCap&&C.setLineCap(r.borderLineCap),C.setDashPattern((e=r.borderDashArray)!==null&&e!==void 0?e:[],(t=r.borderDashPhase)!==null&&t!==void 0?t:0)],r.rotate===void 0?oe.drawEllipsePath({x:r.x,y:r.y,xScale:r.xScale,yScale:r.yScale}):HN({x:r.x,y:r.y,xScale:r.xScale,yScale:r.yScale,rotate:(n=r.rotate)!==null&&n!==void 0?n:he.degrees(0)}),[r.color&&r.borderWidth?C.fillAndStroke():r.color?C.fill():r.borderColor?C.stroke():C.closePath(),C.popGraphicsState()]).filter(Boolean)};oe.drawSvgPath=function(r,e){var t,n,i;return li.__spreadArrays([C.pushGraphicsState(),e.graphicsState&&C.setGraphicsState(e.graphicsState),C.translate(e.x,e.y),C.rotateRadians(he.toRadians((t=e.rotate)!==null&&t!==void 0?t:he.degrees(0))),e.scale?C.scale(e.scale,-e.scale):C.scale(1,-1),e.color&&cn.setFillingColor(e.color),e.borderColor&&cn.setStrokingColor(e.borderColor),e.borderWidth&&C.setLineWidth(e.borderWidth),e.borderLineCap&&C.setLineCap(e.borderLineCap),C.setDashPattern((n=e.borderDashArray)!==null&&n!==void 0?n:[],(i=e.borderDashPhase)!==null&&i!==void 0?i:0)],VN.svgPathToOperators(r),[e.color&&e.borderWidth?C.fillAndStroke():e.color?C.fill():e.borderColor?C.stroke():C.closePath(),C.popGraphicsState()]).filter(Boolean)};oe.drawCheckMark=function(r){var e=Me.asNumber(r.size),t=-1+.75,n=-1+.51,i=1-.525,s=1-.31,a=-1+.325,o=-((a-t)*(s-t))/(i-n)+n;return[C.pushGraphicsState(),r.color&&cn.setStrokingColor(r.color),C.setLineWidth(r.thickness),C.translate(r.x,r.y),C.moveTo(a*e,o*e),C.lineTo(t*e,n*e),C.lineTo(s*e,i*e),C.stroke(),C.popGraphicsState()].filter(Boolean)};oe.rotateInPlace=function(r){return r.rotation===0?[C.translate(0,0),C.rotateDegrees(0)]:r.rotation===90?[C.translate(r.width,0),C.rotateDegrees(90)]:r.rotation===180?[C.translate(r.width,r.height),C.rotateDegrees(180)]:r.rotation===270?[C.translate(0,r.height),C.rotateDegrees(270)]:[]};oe.drawCheckBox=function(r){var e=oe.drawRectangle({x:r.x,y:r.y,width:r.width,height:r.height,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)});if(!r.filled)return e;var t=Me.asNumber(r.width),n=Me.asNumber(r.height),i=Math.min(t,n)/2,s=oe.drawCheckMark({x:t/2,y:n/2,size:i,thickness:r.thickness,color:r.markColor});return li.__spreadArrays([C.pushGraphicsState()],e,s,[C.popGraphicsState()])};oe.drawRadioButton=function(r){var e=Me.asNumber(r.width),t=Me.asNumber(r.height),n=Math.min(e,t)/2,i=oe.drawEllipse({x:r.x,y:r.y,xScale:n,yScale:n,color:r.color,borderColor:r.borderColor,borderWidth:r.borderWidth});if(!r.filled)return i;var s=oe.drawEllipse({x:r.x,y:r.y,xScale:n*.45,yScale:n*.45,color:r.dotColor,borderColor:void 0,borderWidth:0});return li.__spreadArrays([C.pushGraphicsState()],i,s,[C.popGraphicsState()])};oe.drawButton=function(r){var e=Me.asNumber(r.x),t=Me.asNumber(r.y),n=Me.asNumber(r.width),i=Me.asNumber(r.height),s=oe.drawRectangle({x:e,y:t,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}),a=oe.drawTextLines(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)});return li.__spreadArrays([C.pushGraphicsState()],s,a,[C.popGraphicsState()])};oe.drawTextLines=function(r,e){for(var t=[C.beginText(),cn.setFillingColor(e.color),C.setFontAndSize(e.font,e.size)],n=0,i=r.length;n<i;n++){var s=r[n],a=s.encoded,o=s.x,l=s.y;t.push(C.rotateAndSkewTextRadiansAndTranslate(he.toRadians(e.rotate),he.toRadians(e.xSkew),he.toRadians(e.ySkew),o,l),C.showText(a))}return t.push(C.endText()),t};oe.drawTextField=function(r){var e=Me.asNumber(r.x),t=Me.asNumber(r.y),n=Me.asNumber(r.width),i=Me.asNumber(r.height),s=Me.asNumber(r.borderWidth),a=Me.asNumber(r.padding),o=e+s/2+a,l=t+s/2+a,u=n-(s/2+a)*2,d=i-(s/2+a)*2,c=[C.moveTo(o,l),C.lineTo(o,l+d),C.lineTo(o+u,l+d),C.lineTo(o+u,l),C.closePath(),C.clip(),C.endPath()],h=oe.drawRectangle({x:e,y:t,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}),f=oe.drawTextLines(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}),p=li.__spreadArrays([C.beginMarkedContent("Tx"),C.pushGraphicsState()],f,[C.popGraphicsState(),C.endMarkedContent()]);return li.__spreadArrays([C.pushGraphicsState()],h,c,p,[C.popGraphicsState()])};oe.drawOptionList=function(r){for(var e=Me.asNumber(r.x),t=Me.asNumber(r.y),n=Me.asNumber(r.width),i=Me.asNumber(r.height),s=Me.asNumber(r.lineHeight),a=Me.asNumber(r.borderWidth),o=Me.asNumber(r.padding),l=e+a/2+o,u=t+a/2+o,d=n-(a/2+o)*2,c=i-(a/2+o)*2,h=[C.moveTo(l,u),C.lineTo(l,u+c),C.lineTo(l+d,u+c),C.lineTo(l+d,u),C.closePath(),C.clip(),C.endPath()],f=oe.drawRectangle({x:e,y:t,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}),p=[],g=0,v=r.selectedLines.length;g<v;g++){var m=r.textLines[r.selectedLines[g]];p.push.apply(p,oe.drawRectangle({x:m.x-o,y:m.y-(s-m.height)/2,width:n-a,height:m.height+(s-m.height)/2,borderWidth:0,color:r.selectedColor,borderColor:void 0,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}))}var y=oe.drawTextLines(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:he.degrees(0),xSkew:he.degrees(0),ySkew:he.degrees(0)}),w=li.__spreadArrays([C.beginMarkedContent("Tx"),C.pushGraphicsState()],y,[C.popGraphicsState(),C.endMarkedContent()]);return li.__spreadArrays([C.pushGraphicsState()],f,p,h,w,[C.popGraphicsState()])}});var Qa=E(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.InvalidMaxLengthError=Ne.ExceededMaxLengthError=Ne.CombedTextLayoutError=Ne.RichTextFieldReadError=Ne.FieldExistsAsNonTerminalError=Ne.InvalidFieldNamePartError=Ne.FieldAlreadyExistsError=Ne.MissingOnValueCheckError=Ne.UnexpectedFieldTypeError=Ne.NoSuchFieldError=Ne.RemovePageFromEmptyDocumentError=Ne.ForeignPageError=Ne.FontkitNotRegisteredError=Ne.EncryptedPDFError=void 0;var Sr=(j(),U(L)),GN=function(r){Sr.__extends(e,r);function e(){var t=this,n="Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.";return t=r.call(this,n)||this,t}return e}(Error);Ne.EncryptedPDFError=GN;var WN=function(r){Sr.__extends(e,r);function e(){var t=this,n="Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.";return t=r.call(this,n)||this,t}return e}(Error);Ne.FontkitNotRegisteredError=WN;var KN=function(r){Sr.__extends(e,r);function e(){var t=this,n="A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.";return t=r.call(this,n)||this,t}return e}(Error);Ne.ForeignPageError=KN;var XN=function(r){Sr.__extends(e,r);function e(){var t=this,n="PDFDocument has no pages so `PDFDocument.removePage` cannot be called";return t=r.call(this,n)||this,t}return e}(Error);Ne.RemovePageFromEmptyDocumentError=XN;var YN=function(r){Sr.__extends(e,r);function e(t){var n=this,i='PDFDocument has no form field with the name "'+t+'"';return n=r.call(this,i)||this,n}return e}(Error);Ne.NoSuchFieldError=YN;var ZN=function(r){Sr.__extends(e,r);function e(t,n,i){var s,a,o=this,l=n?.name,u=(a=(s=i?.constructor)===null||s===void 0?void 0:s.name)!==null&&a!==void 0?a:i,d='Expected field "'+t+'" to be of type '+l+", "+("but it is actually of type "+u);return o=r.call(this,d)||this,o}return e}(Error);Ne.UnexpectedFieldTypeError=ZN;var JN=function(r){Sr.__extends(e,r);function e(t){var n=this,i='Failed to select check box due to missing onValue: "'+t+'"';return n=r.call(this,i)||this,n}return e}(Error);Ne.MissingOnValueCheckError=JN;var QN=function(r){Sr.__extends(e,r);function e(t){var n=this,i='A field already exists with the specified name: "'+t+'"';return n=r.call(this,i)||this,n}return e}(Error);Ne.FieldAlreadyExistsError=QN;var $N=function(r){Sr.__extends(e,r);function e(t){var n=this,i='Field name contains invalid component: "'+t+'"';return n=r.call(this,i)||this,n}return e}(Error);Ne.InvalidFieldNamePartError=$N;var eL=function(r){Sr.__extends(e,r);function e(t){var n=this,i='A non-terminal field already exists with the specified name: "'+t+'"';return n=r.call(this,i)||this,n}return e}(Error);Ne.FieldExistsAsNonTerminalError=eL;var tL=function(r){Sr.__extends(e,r);function e(t){var n=this,i="Reading rich text fields is not supported: Attempted to read rich text field: "+t;return n=r.call(this,i)||this,n}return e}(Error);Ne.RichTextFieldReadError=tL;var rL=function(r){Sr.__extends(e,r);function e(t,n){var i=this,s="Failed to layout combed text as lineLength="+t+" is greater than cellCount="+n;return i=r.call(this,s)||this,i}return e}(Error);Ne.CombedTextLayoutError=rL;var nL=function(r){Sr.__extends(e,r);function e(t,n,i){var s=this,a="Attempted to set text with length="+t+" for TextField with maxLength="+n+" and name="+i;return s=r.call(this,a)||this,s}return e}(Error);Ne.ExceededMaxLengthError=nL;var iL=function(r){Sr.__extends(e,r);function e(t,n,i){var s=this,a="Attempted to set maxLength="+n+", which is less than "+t+", the length of this field's current value (name="+i+")";return s=r.call(this,a)||this,s}return e}(Error);Ne.InvalidMaxLengthError=iL});var Vl=E(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.TextAlignment=void 0;var sL;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right"})(sL=zl.TextAlignment||(zl.TextAlignment={}))});var l0=E(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.layoutSinglelineText=qi.layoutCombedText=qi.layoutMultilineText=void 0;var aL=Qa(),$a=Vl(),Ui=ae(),jS=4,BS=500,US=function(r,e,t,n){n===void 0&&(n=!1);for(var i=jS;i<BS;){for(var s=0,a=0,o=r.length;a<o;a++){s+=1;for(var l=r[a],u=l.split(" "),d=t.width,c=0,h=u.length;c<h;c++){var f=c===h-1,p=f?u[c]:u[c]+" ",g=e.widthOfTextAtSize(p,i);d-=g,d<=0&&(s+=1,d=t.width-g)}}if(!n&&s>r.length)return i-1;var v=e.heightAtSize(i),m=v+v*.2,y=m*s;if(y>Math.abs(t.height))return i-1;i+=1}return i},oL=function(r,e,t,n){for(var i=t.width/n,s=t.height,a=jS,o=Ui.charSplit(r);a<BS;){for(var l=0,u=o.length;l<u;l++){var d=o[l],c=e.widthOfTextAtSize(d,a)>i*.75;if(c)return a-1}var h=e.heightAtSize(a,{descender:!1});if(h>s)return a-1;a+=1}return a},lL=function(r){for(var e=r.length;e>0;e--)if(/\s/.test(r[e]))return e},uL=function(r,e,t,n){for(var i,s=r.length;s>0;){var a=r.substring(0,s),o=t.encodeText(a),l=t.widthOfTextAtSize(a,n);if(l<e){var u=r.substring(s)||void 0;return{line:a,encoded:o,width:l,remainder:u}}s=(i=lL(a))!==null&&i!==void 0?i:0}return{line:r,encoded:t.encodeText(r),width:t.widthOfTextAtSize(r,n),remainder:void 0}};qi.layoutMultilineText=function(r,e){var t=e.alignment,n=e.fontSize,i=e.font,s=e.bounds,a=Ui.lineSplit(Ui.cleanText(r));(n===void 0||n===0)&&(n=US(a,i,s,!0));for(var o=i.heightAtSize(n),l=o+o*.2,u=[],d=s.x,c=s.y,h=s.x+s.width,f=s.y+s.height,p=s.y+s.height,g=0,v=a.length;g<v;g++)for(var m=a[g];m!==void 0;){var y=uL(m,s.width,i,n),w=y.line,x=y.encoded,b=y.width,A=y.remainder,S=t===$a.TextAlignment.Left?s.x:t===$a.TextAlignment.Center?s.x+s.width/2-b/2:t===$a.TextAlignment.Right?s.x+s.width-b:s.x;p-=l,S<d&&(d=S),p<c&&(c=p),S+b>h&&(h=S+b),p+o>f&&(f=p+o),u.push({text:w,encoded:x,width:b,height:o,x:S,y:p}),m=A?.trim()}return{fontSize:n,lineHeight:l,lines:u,bounds:{x:d,y:c,width:h-d,height:f-c}}};qi.layoutCombedText=function(r,e){var t=e.fontSize,n=e.font,i=e.bounds,s=e.cellCount,a=Ui.mergeLines(Ui.cleanText(r));if(a.length>s)throw new aL.CombedTextLayoutError(a.length,s);(t===void 0||t===0)&&(t=oL(a,n,i,s));for(var o=i.width/s,l=n.heightAtSize(t,{descender:!1}),u=i.y+(i.height/2-l/2),d=[],c=i.x,h=i.y,f=i.x+i.width,p=i.y+i.height,g=0,v=0;g<s;){var m=Ui.charAtIndex(a,v),y=m[0],w=m[1],x=n.encodeText(y),b=n.widthOfTextAtSize(y,t),A=i.x+(o*g+o/2),S=A-b/2;S<c&&(c=S),u<h&&(h=u),S+b>f&&(f=S+b),u+l>p&&(p=u+l),d.push({text:a,encoded:x,width:b,height:l,x:S,y:u}),g+=1,v+=w}return{fontSize:t,cells:d,bounds:{x:c,y:h,width:f-c,height:p-h}}};qi.layoutSinglelineText=function(r,e){var t=e.alignment,n=e.fontSize,i=e.font,s=e.bounds,a=Ui.mergeLines(Ui.cleanText(r));(n===void 0||n===0)&&(n=US([a],i,s));var o=i.encodeText(a),l=i.widthOfTextAtSize(a,n),u=i.heightAtSize(n,{descender:!1}),d=t===$a.TextAlignment.Left?s.x:t===$a.TextAlignment.Center?s.x+s.width/2-l/2:t===$a.TextAlignment.Right?s.x+s.width-l:s.x,c=s.y+(s.height/2-u/2);return{fontSize:n,line:{text:a,encoded:o,width:l,height:u,x:d,y:c},bounds:{x:d,y:c,width:l,height:u}}}});var Vi=E(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.defaultOptionListAppearanceProvider=Jt.defaultDropdownAppearanceProvider=Jt.defaultTextFieldAppearanceProvider=Jt.defaultButtonAppearanceProvider=Jt.defaultRadioGroupAppearanceProvider=Jt.defaultCheckBoxAppearanceProvider=Jt.normalizeAppearance=void 0;var ge=(j(),U(L)),kt=Ja(),Xe=Wr(),Kr=Or(),Os=l0(),dh=Vl(),dL=Bi(),qS=ae();Jt.normalizeAppearance=function(r){return"normal"in r?r:{normal:r}};var cL=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,zi=function(r){var e,t,n=(e=r.getDefaultAppearance())!==null&&e!==void 0?e:"",i=(t=qS.findLastMatch(n,cL).match)!==null&&t!==void 0?t:[],s=Number(i[2]);return isFinite(s)?s:void 0},hL=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,Xr=function(r){var e,t=(e=r.getDefaultAppearance())!==null&&e!==void 0?e:"",n=qS.findLastMatch(t,hL).match,i=n??[],s=i[1],a=i[2],o=i[3],l=i[4],u=i[5];if(u==="g"&&s)return Xe.grayscale(Number(s));if(u==="rg"&&s&&a&&o)return Xe.rgb(Number(s),Number(a),Number(o));if(u==="k"&&s&&a&&o&&l)return Xe.cmyk(Number(s),Number(a),Number(o),Number(l))},Yr=function(r,e,t,n){var i;n===void 0&&(n=0);var s=[Xe.setFillingColor(e).toString(),dL.setFontAndSize((i=t?.name)!==null&&i!==void 0?i:"dummy__noop",n).toString()].join(`
|
|
54
|
+
`);r.setDefaultAppearance(s)};Jt.defaultCheckBoxAppearanceProvider=function(r,e){var t,n,i,s=Xr(e),a=Xr(r.acroField),o=e.getRectangle(),l=e.getAppearanceCharacteristics(),u=e.getBorderStyle(),d=(t=u?.getWidth())!==null&&t!==void 0?t:0,c=Kr.reduceRotation(l?.getRotation()),h=Kr.adjustDimsForRotation(o,c),f=h.width,p=h.height,g=kt.rotateInPlace(ge.__assign(ge.__assign({},o),{rotation:c})),v=Xe.rgb(0,0,0),m=(n=Xe.componentsToColor(l?.getBorderColor()))!==null&&n!==void 0?n:v,y=Xe.componentsToColor(l?.getBackgroundColor()),w=Xe.componentsToColor(l?.getBackgroundColor(),.8),x=(i=s??a)!==null&&i!==void 0?i:v;Yr(s?e:r.acroField,x);var b={x:0+d/2,y:0+d/2,width:f-d,height:p-d,thickness:1.5,borderWidth:d,borderColor:m,markColor:x};return{normal:{on:ge.__spreadArrays(g,kt.drawCheckBox(ge.__assign(ge.__assign({},b),{color:y,filled:!0}))),off:ge.__spreadArrays(g,kt.drawCheckBox(ge.__assign(ge.__assign({},b),{color:y,filled:!1})))},down:{on:ge.__spreadArrays(g,kt.drawCheckBox(ge.__assign(ge.__assign({},b),{color:w,filled:!0}))),off:ge.__spreadArrays(g,kt.drawCheckBox(ge.__assign(ge.__assign({},b),{color:w,filled:!1})))}}};Jt.defaultRadioGroupAppearanceProvider=function(r,e){var t,n,i,s=Xr(e),a=Xr(r.acroField),o=e.getRectangle(),l=e.getAppearanceCharacteristics(),u=e.getBorderStyle(),d=(t=u?.getWidth())!==null&&t!==void 0?t:0,c=Kr.reduceRotation(l?.getRotation()),h=Kr.adjustDimsForRotation(o,c),f=h.width,p=h.height,g=kt.rotateInPlace(ge.__assign(ge.__assign({},o),{rotation:c})),v=Xe.rgb(0,0,0),m=(n=Xe.componentsToColor(l?.getBorderColor()))!==null&&n!==void 0?n:v,y=Xe.componentsToColor(l?.getBackgroundColor()),w=Xe.componentsToColor(l?.getBackgroundColor(),.8),x=(i=s??a)!==null&&i!==void 0?i:v;Yr(s?e:r.acroField,x);var b={x:f/2,y:p/2,width:f-d,height:p-d,borderWidth:d,borderColor:m,dotColor:x};return{normal:{on:ge.__spreadArrays(g,kt.drawRadioButton(ge.__assign(ge.__assign({},b),{color:y,filled:!0}))),off:ge.__spreadArrays(g,kt.drawRadioButton(ge.__assign(ge.__assign({},b),{color:y,filled:!1})))},down:{on:ge.__spreadArrays(g,kt.drawRadioButton(ge.__assign(ge.__assign({},b),{color:w,filled:!0}))),off:ge.__spreadArrays(g,kt.drawRadioButton(ge.__assign(ge.__assign({},b),{color:w,filled:!1})))}}};Jt.defaultButtonAppearanceProvider=function(r,e,t){var n,i,s,a,o,l=Xr(e),u=Xr(r.acroField),d=zi(e),c=zi(r.acroField),h=e.getRectangle(),f=e.getAppearanceCharacteristics(),p=e.getBorderStyle(),g=f?.getCaptions(),v=(n=g?.normal)!==null&&n!==void 0?n:"",m=(s=(i=g?.down)!==null&&i!==void 0?i:v)!==null&&s!==void 0?s:"",y=(a=p?.getWidth())!==null&&a!==void 0?a:0,w=Kr.reduceRotation(f?.getRotation()),x=Kr.adjustDimsForRotation(h,w),b=x.width,A=x.height,S=kt.rotateInPlace(ge.__assign(ge.__assign({},h),{rotation:w})),P=Xe.rgb(0,0,0),F=Xe.componentsToColor(f?.getBorderColor()),k=Xe.componentsToColor(f?.getBackgroundColor()),D=Xe.componentsToColor(f?.getBackgroundColor(),.8),_={x:y,y,width:b-y*2,height:A-y*2},B=Os.layoutSinglelineText(v,{alignment:dh.TextAlignment.Center,fontSize:d??c,font:t,bounds:_}),N=Os.layoutSinglelineText(m,{alignment:dh.TextAlignment.Center,fontSize:d??c,font:t,bounds:_}),G=Math.min(B.fontSize,N.fontSize),O=(o=l??u)!==null&&o!==void 0?o:P;Yr(l||d!==void 0?e:r.acroField,O,t,G);var R={x:0+y/2,y:0+y/2,width:b-y,height:A-y,borderWidth:y,borderColor:F,textColor:O,font:t.name,fontSize:G};return{normal:ge.__spreadArrays(S,kt.drawButton(ge.__assign(ge.__assign({},R),{color:k,textLines:[B.line]}))),down:ge.__spreadArrays(S,kt.drawButton(ge.__assign(ge.__assign({},R),{color:D,textLines:[N.line]})))}};Jt.defaultTextFieldAppearanceProvider=function(r,e,t){var n,i,s,a,o=Xr(e),l=Xr(r.acroField),u=zi(e),d=zi(r.acroField),c=e.getRectangle(),h=e.getAppearanceCharacteristics(),f=e.getBorderStyle(),p=(n=r.getText())!==null&&n!==void 0?n:"",g=(i=f?.getWidth())!==null&&i!==void 0?i:0,v=Kr.reduceRotation(h?.getRotation()),m=Kr.adjustDimsForRotation(c,v),y=m.width,w=m.height,x=kt.rotateInPlace(ge.__assign(ge.__assign({},c),{rotation:v})),b=Xe.rgb(0,0,0),A=Xe.componentsToColor(h?.getBorderColor()),S=Xe.componentsToColor(h?.getBackgroundColor()),P,F,k=r.isCombed()?0:1,D={x:g+k,y:g+k,width:y-(g+k)*2,height:w-(g+k)*2};if(r.isMultiline()){var _=Os.layoutMultilineText(p,{alignment:r.getAlignment(),fontSize:u??d,font:t,bounds:D});P=_.lines,F=_.fontSize}else if(r.isCombed()){var _=Os.layoutCombedText(p,{fontSize:u??d,font:t,bounds:D,cellCount:(s=r.getMaxLength())!==null&&s!==void 0?s:0});P=_.cells,F=_.fontSize}else{var _=Os.layoutSinglelineText(p,{alignment:r.getAlignment(),fontSize:u??d,font:t,bounds:D});P=[_.line],F=_.fontSize}var B=(a=o??l)!==null&&a!==void 0?a:b;Yr(o||u!==void 0?e:r.acroField,B,t,F);var N={x:0+g/2,y:0+g/2,width:y-g,height:w-g,borderWidth:g??0,borderColor:A,textColor:B,font:t.name,fontSize:F,color:S,textLines:P,padding:k};return ge.__spreadArrays(x,kt.drawTextField(N))};Jt.defaultDropdownAppearanceProvider=function(r,e,t){var n,i,s,a=Xr(e),o=Xr(r.acroField),l=zi(e),u=zi(r.acroField),d=e.getRectangle(),c=e.getAppearanceCharacteristics(),h=e.getBorderStyle(),f=(n=r.getSelected()[0])!==null&&n!==void 0?n:"",p=(i=h?.getWidth())!==null&&i!==void 0?i:0,g=Kr.reduceRotation(c?.getRotation()),v=Kr.adjustDimsForRotation(d,g),m=v.width,y=v.height,w=kt.rotateInPlace(ge.__assign(ge.__assign({},d),{rotation:g})),x=Xe.rgb(0,0,0),b=Xe.componentsToColor(c?.getBorderColor()),A=Xe.componentsToColor(c?.getBackgroundColor()),S=1,P={x:p+S,y:p+S,width:m-(p+S)*2,height:y-(p+S)*2},F=Os.layoutSinglelineText(f,{alignment:dh.TextAlignment.Left,fontSize:l??u,font:t,bounds:P}),k=F.line,D=F.fontSize,_=(s=a??o)!==null&&s!==void 0?s:x;Yr(a||l!==void 0?e:r.acroField,_,t,D);var B={x:0+p/2,y:0+p/2,width:m-p,height:y-p,borderWidth:p??0,borderColor:b,textColor:_,font:t.name,fontSize:D,color:A,textLines:[k],padding:S};return ge.__spreadArrays(w,kt.drawTextField(B))};Jt.defaultOptionListAppearanceProvider=function(r,e,t){var n,i,s=Xr(e),a=Xr(r.acroField),o=zi(e),l=zi(r.acroField),u=e.getRectangle(),d=e.getAppearanceCharacteristics(),c=e.getBorderStyle(),h=(n=c?.getWidth())!==null&&n!==void 0?n:0,f=Kr.reduceRotation(d?.getRotation()),p=Kr.adjustDimsForRotation(u,f),g=p.width,v=p.height,m=kt.rotateInPlace(ge.__assign(ge.__assign({},u),{rotation:f})),y=Xe.rgb(0,0,0),w=Xe.componentsToColor(d?.getBorderColor()),x=Xe.componentsToColor(d?.getBackgroundColor()),b=r.getOptions(),A=r.getSelected();r.isSorted()&&b.sort();for(var S="",P=0,F=b.length;P<F;P++)S+=b[P],P<F-1&&(S+=`
|
|
55
|
+
`);for(var k=1,D={x:h+k,y:h+k,width:g-(h+k)*2,height:v-(h+k)*2},_=Os.layoutMultilineText(S,{alignment:dh.TextAlignment.Left,fontSize:o??l,font:t,bounds:D}),B=_.lines,N=_.fontSize,G=_.lineHeight,O=[],P=0,F=B.length;P<F;P++){var R=B[P];A.includes(R.text)&&O.push(P)}var J=Xe.rgb(153/255,193/255,218/255),le=(i=s??a)!==null&&i!==void 0?i:y;return Yr(s||o!==void 0?e:r.acroField,le,t,N),ge.__spreadArrays(m,kt.drawOptionList({x:0+h/2,y:0+h/2,width:g-h,height:v-h,borderWidth:h??0,borderColor:w,textColor:le,font:t.name,fontSize:N,color:x,textLines:B,lineHeight:G,selectedColor:J,selectedLines:O,padding:k}))}});var hh=E(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var u0=(j(),U(L)),fL=u0.__importDefault(Hi()),zS=St(),ch=ae(),pL=function(){function r(e,t,n){this.alreadyEmbedded=!1,ch.assertIs(e,"ref",[[zS.PDFRef,"PDFRef"]]),ch.assertIs(t,"doc",[[fL.default,"PDFDocument"]]),ch.assertIs(n,"embedder",[[zS.PDFPageEmbedder,"PDFPageEmbedder"]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return r.prototype.scale=function(e){return ch.assertIs(e,"factor",["number"]),{width:this.width*e,height:this.height*e}},r.prototype.size=function(){return this.scale(1)},r.prototype.embed=function(){return u0.__awaiter(this,void 0,void 0,function(){return u0.__generator(this,function(e){switch(e.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e.sent(),this.alreadyEmbedded=!0,e.label=2;case 2:return[2]}})})},r.of=function(e,t,n){return new r(e,t,n)},r}();d0.default=pL});var di=E(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var c0=(j(),U(L)),gL=c0.__importDefault(Hi()),fh=St(),ui=ae(),mL=function(){function r(e,t,n){this.modified=!0,ui.assertIs(e,"ref",[[fh.PDFRef,"PDFRef"]]),ui.assertIs(t,"doc",[[gL.default,"PDFDocument"]]),ui.assertIs(n,"embedder",[[fh.CustomFontEmbedder,"CustomFontEmbedder"],[fh.StandardFontEmbedder,"StandardFontEmbedder"]]),this.ref=e,this.doc=t,this.name=n.fontName,this.embedder=n}return r.prototype.encodeText=function(e){return ui.assertIs(e,"text",["string"]),this.modified=!0,this.embedder.encodeText(e)},r.prototype.widthOfTextAtSize=function(e,t){return ui.assertIs(e,"text",["string"]),ui.assertIs(t,"size",["number"]),this.embedder.widthOfTextAtSize(e,t)},r.prototype.heightAtSize=function(e,t){var n;return ui.assertIs(e,"size",["number"]),ui.assertOrUndefined(t?.descender,"options.descender",["boolean"]),this.embedder.heightOfFontAtSize(e,{descender:(n=t?.descender)!==null&&n!==void 0?n:!0})},r.prototype.sizeAtHeight=function(e){return ui.assertIs(e,"height",["number"]),this.embedder.sizeOfFontAtHeight(e)},r.prototype.getCharacterSet=function(){return this.embedder instanceof fh.StandardFontEmbedder?this.embedder.encoding.supportedCodePoints:this.embedder.font.characterSet},r.prototype.embed=function(){return c0.__awaiter(this,void 0,void 0,function(){return c0.__generator(this,function(e){switch(e.label){case 0:return this.modified?[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]:[3,2];case 1:e.sent(),this.modified=!1,e.label=2;case 2:return[2]}})})},r.of=function(e,t,n){return new r(e,t,n)},r}();h0.default=mL});var ph=E(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var p0=(j(),U(L)),vL=p0.__importDefault(Hi()),f0=St(),eo=ae(),yL=function(){function r(e,t,n){eo.assertIs(e,"ref",[[f0.PDFRef,"PDFRef"]]),eo.assertIs(t,"doc",[[vL.default,"PDFDocument"]]),eo.assertIs(n,"embedder",[[f0.JpegEmbedder,"JpegEmbedder"],[f0.PngEmbedder,"PngEmbedder"]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return r.prototype.scale=function(e){return eo.assertIs(e,"factor",["number"]),{width:this.width*e,height:this.height*e}},r.prototype.scaleToFit=function(e,t){eo.assertIs(e,"width",["number"]),eo.assertIs(t,"height",["number"]);var n=e/this.width,i=t/this.height,s=Math.min(n,i);return this.scale(s)},r.prototype.size=function(){return this.scale(1)},r.prototype.embed=function(){return p0.__awaiter(this,void 0,void 0,function(){var e,t,n;return p0.__generator(this,function(i){switch(i.label){case 0:return this.embedder?(this.embedTask||(e=this,t=e.doc,n=e.ref,this.embedTask=this.embedder.embedIntoContext(t.context,n)),[4,this.embedTask]):[2];case 1:return i.sent(),this.embedder=void 0,[2]}})})},r.of=function(e,t,n){return new r(e,t,n)},r}();g0.default=yL});var gh=E(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.ImageAlignment=void 0;var bL;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right"})(bL=Hl.ImageAlignment||(Hl.ImageAlignment={}))});var v0=E(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var wL=(j(),U(L));wL.__exportStar(gh(),m0)});var ci=E(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.assertFieldAppearanceOptions=void 0;var mh=(j(),U(L)),xL=mh.__importDefault(Hi()),y0=Wr(),Ms=Or(),Ot=St(),Mr=ae(),VS=v0(),HS=Ja();Gl.assertFieldAppearanceOptions=function(r){Mr.assertOrUndefined(r?.x,"options.x",["number"]),Mr.assertOrUndefined(r?.y,"options.y",["number"]),Mr.assertOrUndefined(r?.width,"options.width",["number"]),Mr.assertOrUndefined(r?.height,"options.height",["number"]),Mr.assertOrUndefined(r?.textColor,"options.textColor",[[Object,"Color"]]),Mr.assertOrUndefined(r?.backgroundColor,"options.backgroundColor",[[Object,"Color"]]),Mr.assertOrUndefined(r?.borderColor,"options.borderColor",[[Object,"Color"]]),Mr.assertOrUndefined(r?.borderWidth,"options.borderWidth",["number"]),Mr.assertOrUndefined(r?.rotate,"options.rotate",[[Object,"Rotation"]])};var AL=function(){function r(e,t,n){Mr.assertIs(e,"acroField",[[Ot.PDFAcroTerminal,"PDFAcroTerminal"]]),Mr.assertIs(t,"ref",[[Ot.PDFRef,"PDFRef"]]),Mr.assertIs(n,"doc",[[xL.default,"PDFDocument"]]),this.acroField=e,this.ref=t,this.doc=n}return r.prototype.getName=function(){var e;return(e=this.acroField.getFullyQualifiedName())!==null&&e!==void 0?e:""},r.prototype.isReadOnly=function(){return this.acroField.hasFlag(Ot.AcroFieldFlags.ReadOnly)},r.prototype.enableReadOnly=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.ReadOnly,!0)},r.prototype.disableReadOnly=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.ReadOnly,!1)},r.prototype.isRequired=function(){return this.acroField.hasFlag(Ot.AcroFieldFlags.Required)},r.prototype.enableRequired=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.Required,!0)},r.prototype.disableRequired=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.Required,!1)},r.prototype.isExported=function(){return!this.acroField.hasFlag(Ot.AcroFieldFlags.NoExport)},r.prototype.enableExporting=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.NoExport,!1)},r.prototype.disableExporting=function(){this.acroField.setFlagTo(Ot.AcroFieldFlags.NoExport,!0)},r.prototype.needsAppearancesUpdate=function(){throw new Ot.MethodNotImplementedError(this.constructor.name,"needsAppearancesUpdate")},r.prototype.defaultUpdateAppearances=function(e){throw new Ot.MethodNotImplementedError(this.constructor.name,"defaultUpdateAppearances")},r.prototype.markAsDirty=function(){this.doc.getForm().markFieldAsDirty(this.ref)},r.prototype.markAsClean=function(){this.doc.getForm().markFieldAsClean(this.ref)},r.prototype.isDirty=function(){return this.doc.getForm().fieldIsDirty(this.ref)},r.prototype.createWidget=function(e){var t,n=e.textColor,i=e.backgroundColor,s=e.borderColor,a=e.borderWidth,o=Ms.toDegrees(e.rotate),l=e.caption,u=e.x,d=e.y,c=e.width+a,h=e.height+a,f=!!e.hidden,p=e.page;Mr.assertMultiple(o,"degreesAngle",90);var g=Ot.PDFWidgetAnnotation.create(this.doc.context,this.ref),v=Ms.rotateRectangle({x:u,y:d,width:c,height:h},a,o);g.setRectangle(v),p&&g.setP(p);var m=g.getOrCreateAppearanceCharacteristics();i&&m.setBackgroundColor(y0.colorToComponents(i)),m.setRotation(o),l&&m.setCaptions({normal:l}),s&&m.setBorderColor(y0.colorToComponents(s));var y=g.getOrCreateBorderStyle();if(a!==void 0&&y.setWidth(a),g.setFlagTo(Ot.AnnotationFlags.Print,!0),g.setFlagTo(Ot.AnnotationFlags.Hidden,f),g.setFlagTo(Ot.AnnotationFlags.Invisible,!1),n){var w=(t=this.acroField.getDefaultAppearance())!==null&&t!==void 0?t:"",x=w+`
|
|
56
|
+
`+y0.setFillingColor(n).toString();this.acroField.setDefaultAppearance(x)}return g},r.prototype.updateWidgetAppearanceWithFont=function(e,t,n){var i=n.normal,s=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceStream(e,i,t),rollover:s&&this.createAppearanceStream(e,s,t),down:a&&this.createAppearanceStream(e,a,t)})},r.prototype.updateOnOffWidgetAppearance=function(e,t,n){var i=n.normal,s=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceDict(e,i,t),rollover:s&&this.createAppearanceDict(e,s,t),down:a&&this.createAppearanceDict(e,a,t)})},r.prototype.updateWidgetAppearances=function(e,t){var n=t.normal,i=t.rollover,s=t.down;e.setNormalAppearance(n),i?e.setRolloverAppearance(i):e.removeRolloverAppearance(),s?e.setDownAppearance(s):e.removeDownAppearance()},r.prototype.createAppearanceStream=function(e,t,n){var i,s=this.acroField.dict.context,a=e.getRectangle(),o=a.width,l=a.height,u=n&&{Font:(i={},i[n.name]=n.ref,i)},d=s.formXObject(t,{Resources:u,BBox:s.obj([0,0,o,l]),Matrix:s.obj([1,0,0,1,0,0])}),c=s.register(d);return c},r.prototype.createImageAppearanceStream=function(e,t,n){var i,s,a=this.acroField.dict.context,o=e.getRectangle(),l=e.getAppearanceCharacteristics(),u=e.getBorderStyle(),d=(s=u?.getWidth())!==null&&s!==void 0?s:0,c=Ms.reduceRotation(l?.getRotation()),h=HS.rotateInPlace(mh.__assign(mh.__assign({},o),{rotation:c})),f=Ms.adjustDimsForRotation(o,c),p=t.scaleToFit(f.width-d*2,f.height-d*2),g={x:d,y:d,width:p.width,height:p.height,rotate:Ms.degrees(0),xSkew:Ms.degrees(0),ySkew:Ms.degrees(0)};n===VS.ImageAlignment.Center?(g.x+=(f.width-d*2)/2-p.width/2,g.y+=(f.height-d*2)/2-p.height/2):n===VS.ImageAlignment.Right&&(g.x=f.width-d-p.width,g.y=f.height-d-p.height);var v=this.doc.context.addRandomSuffix("Image",10),m=mh.__spreadArrays(h,HS.drawImage(v,g)),y={XObject:(i={},i[v]=t.ref,i)},w=a.formXObject(m,{Resources:y,BBox:a.obj([0,0,o.width,o.height]),Matrix:a.obj([1,0,0,1,0,0])});return a.register(w)},r.prototype.createAppearanceDict=function(e,t,n){var i=this.acroField.dict.context,s=this.createAppearanceStream(e,t.on),a=this.createAppearanceStream(e,t.off),o=i.obj({});return o.set(n,s),o.set(Ot.PDFName.of("Off"),a),o},r}();Gl.default=AL});var S0=E(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var x0=(j(),U(L)),SL=x0.__importDefault(hi()),GS=Vi(),b0=Wr(),PL=Or(),WS=x0.__importStar(ci()),Ns=St(),w0=ae(),FL=function(r){x0.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return w0.assertIs(t,"acroCheckBox",[[Ns.PDFAcroCheckBox,"PDFAcroCheckBox"]]),s.acroField=t,s}return e.prototype.check=function(){var t,n=(t=this.acroField.getOnValue())!==null&&t!==void 0?t:Ns.PDFName.of("Yes");this.markAsDirty(),this.acroField.setValue(n)},e.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(Ns.PDFName.of("Off"))},e.prototype.isChecked=function(){var t=this.acroField.getOnValue();return!!t&&t===this.acroField.getValue()},e.prototype.addToPage=function(t,n){var i,s,a,o,l,u;w0.assertIs(t,"page",[[SL.default,"PDFPage"]]),WS.assertFieldAppearanceOptions(n),n||(n={}),"textColor"in n||(n.textColor=b0.rgb(0,0,0)),"backgroundColor"in n||(n.backgroundColor=b0.rgb(1,1,1)),"borderColor"in n||(n.borderColor=b0.rgb(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var d=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(s=n.y)!==null&&s!==void 0?s:0,width:(a=n.width)!==null&&a!==void 0?a:50,height:(o=n.height)!==null&&o!==void 0?o:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(l=n.borderWidth)!==null&&l!==void 0?l:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:PL.degrees(0),hidden:n.hidden,page:t.ref}),c=this.doc.context.register(d.dict);this.acroField.addWidget(c),d.setAppearanceState(Ns.PDFName.of("Off")),this.updateWidgetAppearance(d,Ns.PDFName.of("Yes")),t.node.addAnnot(c)},e.prototype.needsAppearancesUpdate=function(){for(var t,n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=a.getAppearanceState(),l=(t=a.getAppearances())===null||t===void 0?void 0:t.normal;if(!(l instanceof Ns.PDFDict)||o&&!l.has(o))return!0}return!1},e.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},e.prototype.updateAppearances=function(t){var n;w0.assertOrUndefined(t,"provider",[Function]);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s],l=(n=o.getOnValue())!==null&&n!==void 0?n:Ns.PDFName.of("Yes");l&&this.updateWidgetAppearance(o,l,t)}this.markAsClean()},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??GS.defaultCheckBoxAppearanceProvider,a=GS.normalizeAppearance(s(this,t));this.updateOnOffWidgetAppearance(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}(WS.default);A0.default=FL});var D0=E(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});var vh=(j(),U(L)),DL=vh.__importDefault(hi()),KS=vh.__importDefault(di()),XS=vh.__importStar(ci()),YS=Vi(),P0=Wr(),EL=Or(),Pt=St(),Nn=ae(),CL=function(r){vh.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return Nn.assertIs(t,"acroComboBox",[[Pt.PDFAcroComboBox,"PDFAcroComboBox"]]),s.acroField=t,s}return e.prototype.getOptions=function(){for(var t=this.acroField.getOptions(),n=new Array(t.length),i=0,s=n.length;i<s;i++){var a=t[i],o=a.display,l=a.value;n[i]=(o??l).decodeText()}return n},e.prototype.getSelected=function(){for(var t=this.acroField.getValues(),n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]=t[i].decodeText();return n},e.prototype.setOptions=function(t){Nn.assertIs(t,"options",[Array]);for(var n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]={value:Pt.PDFHexString.fromText(t[i])};this.acroField.setOptions(n)},e.prototype.addOptions=function(t){Nn.assertIs(t,"options",["string",Array]);for(var n=Array.isArray(t)?t:[t],i=this.acroField.getOptions(),s=new Array(n.length),a=0,o=n.length;a<o;a++)s[a]={value:Pt.PDFHexString.fromText(n[a])};this.acroField.setOptions(i.concat(s))},e.prototype.select=function(t,n){n===void 0&&(n=!1),Nn.assertIs(t,"options",["string",Array]),Nn.assertIs(n,"merge",["boolean"]);var i=Array.isArray(t)?t:[t],s=this.getOptions(),a=i.find(function(c){return!s.includes(c)});a&&this.enableEditing(),this.markAsDirty(),(i.length>1||i.length===1&&n)&&this.enableMultiselect();for(var o=new Array(i.length),l=0,u=i.length;l<u;l++)o[l]=Pt.PDFHexString.fromText(i[l]);if(n){var d=this.acroField.getValues();this.acroField.setValues(d.concat(o))}else this.acroField.setValues(o)},e.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},e.prototype.setFontSize=function(t){Nn.assertPositive(t,"fontSize"),this.acroField.setFontSize(t),this.markAsDirty()},e.prototype.isEditable=function(){return this.acroField.hasFlag(Pt.AcroChoiceFlags.Edit)},e.prototype.enableEditing=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.Edit,!0)},e.prototype.disableEditing=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.Edit,!1)},e.prototype.isSorted=function(){return this.acroField.hasFlag(Pt.AcroChoiceFlags.Sort)},e.prototype.enableSorting=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.Sort,!0)},e.prototype.disableSorting=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.Sort,!1)},e.prototype.isMultiselect=function(){return this.acroField.hasFlag(Pt.AcroChoiceFlags.MultiSelect)},e.prototype.enableMultiselect=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.MultiSelect,!0)},e.prototype.disableMultiselect=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.MultiSelect,!1)},e.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(Pt.AcroChoiceFlags.DoNotSpellCheck)},e.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.DoNotSpellCheck,!1)},e.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.DoNotSpellCheck,!0)},e.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(Pt.AcroChoiceFlags.CommitOnSelChange)},e.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.CommitOnSelChange,!0)},e.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(Pt.AcroChoiceFlags.CommitOnSelChange,!1)},e.prototype.addToPage=function(t,n){var i,s,a,o,l,u,d;Nn.assertIs(t,"page",[[DL.default,"PDFPage"]]),XS.assertFieldAppearanceOptions(n),n||(n={}),"textColor"in n||(n.textColor=P0.rgb(0,0,0)),"backgroundColor"in n||(n.backgroundColor=P0.rgb(1,1,1)),"borderColor"in n||(n.borderColor=P0.rgb(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var c=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(s=n.y)!==null&&s!==void 0?s:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(o=n.height)!==null&&o!==void 0?o:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(l=n.borderWidth)!==null&&l!==void 0?l:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:EL.degrees(0),hidden:n.hidden,page:t.ref}),h=this.doc.context.register(c.dict);this.acroField.addWidget(h);var f=(d=n.font)!==null&&d!==void 0?d:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(c,f),t.node.addAnnot(h)},e.prototype.needsAppearancesUpdate=function(){var t;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=((t=a.getAppearances())===null||t===void 0?void 0:t.normal)instanceof Pt.PDFStream;if(!o)return!0}return!1},e.prototype.defaultUpdateAppearances=function(t){Nn.assertIs(t,"font",[[KS.default,"PDFFont"]]),this.updateAppearances(t)},e.prototype.updateAppearances=function(t,n){Nn.assertIs(t,"font",[[KS.default,"PDFFont"]]),Nn.assertOrUndefined(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s];this.updateWidgetAppearance(o,t,n)}this.markAsClean()},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??YS.defaultDropdownAppearanceProvider,a=YS.normalizeAppearance(s(this,t,n));this.updateWidgetAppearanceWithFont(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}(XS.default);F0.default=CL});var T0=E(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var yh=(j(),U(L)),TL=yh.__importDefault(hi()),ZS=yh.__importDefault(di()),JS=yh.__importStar(ci()),QS=Vi(),E0=Wr(),kL=Or(),Pr=St(),hn=ae(),RL=function(r){yh.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return hn.assertIs(t,"acroListBox",[[Pr.PDFAcroListBox,"PDFAcroListBox"]]),s.acroField=t,s}return e.prototype.getOptions=function(){for(var t=this.acroField.getOptions(),n=new Array(t.length),i=0,s=n.length;i<s;i++){var a=t[i],o=a.display,l=a.value;n[i]=(o??l).decodeText()}return n},e.prototype.getSelected=function(){for(var t=this.acroField.getValues(),n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]=t[i].decodeText();return n},e.prototype.setOptions=function(t){hn.assertIs(t,"options",[Array]),this.markAsDirty();for(var n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]={value:Pr.PDFHexString.fromText(t[i])};this.acroField.setOptions(n)},e.prototype.addOptions=function(t){hn.assertIs(t,"options",["string",Array]),this.markAsDirty();for(var n=Array.isArray(t)?t:[t],i=this.acroField.getOptions(),s=new Array(n.length),a=0,o=n.length;a<o;a++)s[a]={value:Pr.PDFHexString.fromText(n[a])};this.acroField.setOptions(i.concat(s))},e.prototype.select=function(t,n){n===void 0&&(n=!1),hn.assertIs(t,"options",["string",Array]),hn.assertIs(n,"merge",["boolean"]);var i=Array.isArray(t)?t:[t],s=this.getOptions();hn.assertIsSubset(i,"option",s),this.markAsDirty(),(i.length>1||i.length===1&&n)&&this.enableMultiselect();for(var a=new Array(i.length),o=0,l=i.length;o<l;o++)a[o]=Pr.PDFHexString.fromText(i[o]);if(n){var u=this.acroField.getValues();this.acroField.setValues(u.concat(a))}else this.acroField.setValues(a)},e.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},e.prototype.setFontSize=function(t){hn.assertPositive(t,"fontSize"),this.acroField.setFontSize(t),this.markAsDirty()},e.prototype.isSorted=function(){return this.acroField.hasFlag(Pr.AcroChoiceFlags.Sort)},e.prototype.enableSorting=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.Sort,!0)},e.prototype.disableSorting=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.Sort,!1)},e.prototype.isMultiselect=function(){return this.acroField.hasFlag(Pr.AcroChoiceFlags.MultiSelect)},e.prototype.enableMultiselect=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.MultiSelect,!0)},e.prototype.disableMultiselect=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.MultiSelect,!1)},e.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(Pr.AcroChoiceFlags.CommitOnSelChange)},e.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.CommitOnSelChange,!0)},e.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(Pr.AcroChoiceFlags.CommitOnSelChange,!1)},e.prototype.addToPage=function(t,n){var i,s,a,o,l,u,d;hn.assertIs(t,"page",[[TL.default,"PDFPage"]]),JS.assertFieldAppearanceOptions(n),n||(n={}),"textColor"in n||(n.textColor=E0.rgb(0,0,0)),"backgroundColor"in n||(n.backgroundColor=E0.rgb(1,1,1)),"borderColor"in n||(n.borderColor=E0.rgb(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var c=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(s=n.y)!==null&&s!==void 0?s:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(o=n.height)!==null&&o!==void 0?o:100,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(l=n.borderWidth)!==null&&l!==void 0?l:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:kL.degrees(0),hidden:n.hidden,page:t.ref}),h=this.doc.context.register(c.dict);this.acroField.addWidget(h);var f=(d=n.font)!==null&&d!==void 0?d:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(c,f),t.node.addAnnot(h)},e.prototype.needsAppearancesUpdate=function(){var t;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=((t=a.getAppearances())===null||t===void 0?void 0:t.normal)instanceof Pr.PDFStream;if(!o)return!0}return!1},e.prototype.defaultUpdateAppearances=function(t){hn.assertIs(t,"font",[[ZS.default,"PDFFont"]]),this.updateAppearances(t)},e.prototype.updateAppearances=function(t,n){hn.assertIs(t,"font",[[ZS.default,"PDFFont"]]),hn.assertOrUndefined(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s];this.updateWidgetAppearance(o,t,n)}this.markAsClean()},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??QS.defaultOptionListAppearanceProvider,a=QS.normalizeAppearance(s(this,t,n));this.updateWidgetAppearanceWithFont(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}(JS.default);C0.default=RL});var I0=E(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var R0=(j(),U(L)),_L=R0.__importDefault(hi()),$S=R0.__importStar(ci()),eP=Vi(),k0=Wr(),IL=Or(),Zr=St(),to=ae(),OL=function(r){R0.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return to.assertIs(t,"acroRadioButton",[[Zr.PDFAcroRadioButton,"PDFAcroRadioButton"]]),s.acroField=t,s}return e.prototype.getOptions=function(){var t=this.acroField.getExportValues();if(t){for(var n=new Array(t.length),i=0,s=t.length;i<s;i++)n[i]=t[i].decodeText();return n}for(var a=this.acroField.getOnValues(),o=new Array(a.length),i=0,s=o.length;i<s;i++)o[i]=a[i].decodeText();return o},e.prototype.getSelected=function(){var t=this.acroField.getValue();if(t!==Zr.PDFName.of("Off")){var n=this.acroField.getExportValues();if(n){for(var i=this.acroField.getOnValues(),s=0,a=i.length;s<a;s++)if(i[s]===t)return n[s].decodeText()}return t.decodeText()}},e.prototype.select=function(t){to.assertIs(t,"option",["string"]);var n=this.getOptions();to.assertIsOneOf(t,"option",n),this.markAsDirty();var i=this.acroField.getOnValues(),s=this.acroField.getExportValues();if(s)for(var a=0,o=s.length;a<o;a++)s[a].decodeText()===t&&this.acroField.setValue(i[a]);else for(var a=0,o=i.length;a<o;a++){var l=i[a];l.decodeText()===t&&this.acroField.setValue(l)}},e.prototype.clear=function(){this.markAsDirty(),this.acroField.setValue(Zr.PDFName.of("Off"))},e.prototype.isOffToggleable=function(){return!this.acroField.hasFlag(Zr.AcroButtonFlags.NoToggleToOff)},e.prototype.enableOffToggling=function(){this.acroField.setFlagTo(Zr.AcroButtonFlags.NoToggleToOff,!1)},e.prototype.disableOffToggling=function(){this.acroField.setFlagTo(Zr.AcroButtonFlags.NoToggleToOff,!0)},e.prototype.isMutuallyExclusive=function(){return!this.acroField.hasFlag(Zr.AcroButtonFlags.RadiosInUnison)},e.prototype.enableMutualExclusion=function(){this.acroField.setFlagTo(Zr.AcroButtonFlags.RadiosInUnison,!1)},e.prototype.disableMutualExclusion=function(){this.acroField.setFlagTo(Zr.AcroButtonFlags.RadiosInUnison,!0)},e.prototype.addOptionToPage=function(t,n,i){var s,a,o,l,u,d,c,h,f;to.assertIs(t,"option",["string"]),to.assertIs(n,"page",[[_L.default,"PDFPage"]]),$S.assertFieldAppearanceOptions(i);var p=this.createWidget({x:(s=i?.x)!==null&&s!==void 0?s:0,y:(a=i?.y)!==null&&a!==void 0?a:0,width:(o=i?.width)!==null&&o!==void 0?o:50,height:(l=i?.height)!==null&&l!==void 0?l:50,textColor:(u=i?.textColor)!==null&&u!==void 0?u:k0.rgb(0,0,0),backgroundColor:(d=i?.backgroundColor)!==null&&d!==void 0?d:k0.rgb(1,1,1),borderColor:(c=i?.borderColor)!==null&&c!==void 0?c:k0.rgb(0,0,0),borderWidth:(h=i?.borderWidth)!==null&&h!==void 0?h:1,rotate:(f=i?.rotate)!==null&&f!==void 0?f:IL.degrees(0),hidden:i?.hidden,page:n.ref}),g=this.doc.context.register(p.dict),v=this.acroField.addWidgetWithOpt(g,Zr.PDFHexString.fromText(t),!this.isMutuallyExclusive());p.setAppearanceState(Zr.PDFName.of("Off")),this.updateWidgetAppearance(p,v),n.node.addAnnot(g)},e.prototype.needsAppearancesUpdate=function(){for(var t,n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=a.getAppearanceState(),l=(t=a.getAppearances())===null||t===void 0?void 0:t.normal;if(!(l instanceof Zr.PDFDict)||o&&!l.has(o))return!0}return!1},e.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},e.prototype.updateAppearances=function(t){to.assertOrUndefined(t,"provider",[Function]);for(var n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=a.getOnValue();o&&this.updateWidgetAppearance(a,o,t)}},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??eP.defaultRadioGroupAppearanceProvider,a=eP.normalizeAppearance(s(this,t));this.updateOnOffWidgetAppearance(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}($S.default);_0.default=OL});var M0=E(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var tP=(j(),U(L)),ML=tP.__importDefault(ci()),NL=St(),LL=ae(),jL=function(r){tP.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return LL.assertIs(t,"acroSignature",[[NL.PDFAcroSignature,"PDFAcroSignature"]]),s.acroField=t,s}return e.prototype.needsAppearancesUpdate=function(){return!1},e.of=function(t,n,i){return new e(t,n,i)},e}(ML.default);O0.default=jL});var U0=E(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});var bh=(j(),U(L)),BL=bh.__importDefault(hi()),rP=bh.__importDefault(di()),nP=bh.__importStar(ci()),iP=Vi(),N0=Wr(),UL=Or(),L0=Qa(),j0=gh(),Ls=Vl(),rt=St(),fi=ae(),qL=function(r){bh.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return fi.assertIs(t,"acroText",[[rt.PDFAcroText,"PDFAcroText"]]),s.acroField=t,s}return e.prototype.getText=function(){var t=this.acroField.getValue();if(!t&&this.isRichFormatted())throw new L0.RichTextFieldReadError(this.getName());return t?.decodeText()},e.prototype.setText=function(t){fi.assertOrUndefined(t,"text",["string"]);var n=this.getMaxLength();if(n!==void 0&&t&&t.length>n)throw new L0.ExceededMaxLengthError(t.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),t?this.acroField.setValue(rt.PDFHexString.fromText(t)):this.acroField.removeValue()},e.prototype.getAlignment=function(){var t=this.acroField.getQuadding();return t===0?Ls.TextAlignment.Left:t===1?Ls.TextAlignment.Center:t===2?Ls.TextAlignment.Right:Ls.TextAlignment.Left},e.prototype.setAlignment=function(t){fi.assertIsOneOf(t,"alignment",Ls.TextAlignment),this.markAsDirty(),this.acroField.setQuadding(t)},e.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},e.prototype.setMaxLength=function(t){if(fi.assertRangeOrUndefined(t,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),t===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>t)throw new L0.InvalidMaxLengthError(n.length,t,this.getName());this.acroField.setMaxLength(t)}},e.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},e.prototype.setImage=function(t){for(var n=this.getAlignment(),i=n===Ls.TextAlignment.Center?j0.ImageAlignment.Center:n===Ls.TextAlignment.Right?j0.ImageAlignment.Right:j0.ImageAlignment.Left,s=this.acroField.getWidgets(),a=0,o=s.length;a<o;a++){var l=s[a],u=this.createImageAppearanceStream(l,t,i);this.updateWidgetAppearances(l,{normal:u})}this.markAsClean()},e.prototype.setFontSize=function(t){fi.assertPositive(t,"fontSize"),this.acroField.setFontSize(t),this.markAsDirty()},e.prototype.isMultiline=function(){return this.acroField.hasFlag(rt.AcroTextFlags.Multiline)},e.prototype.enableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(rt.AcroTextFlags.Multiline,!0)},e.prototype.disableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(rt.AcroTextFlags.Multiline,!1)},e.prototype.isPassword=function(){return this.acroField.hasFlag(rt.AcroTextFlags.Password)},e.prototype.enablePassword=function(){this.acroField.setFlagTo(rt.AcroTextFlags.Password,!0)},e.prototype.disablePassword=function(){this.acroField.setFlagTo(rt.AcroTextFlags.Password,!1)},e.prototype.isFileSelector=function(){return this.acroField.hasFlag(rt.AcroTextFlags.FileSelect)},e.prototype.enableFileSelection=function(){this.acroField.setFlagTo(rt.AcroTextFlags.FileSelect,!0)},e.prototype.disableFileSelection=function(){this.acroField.setFlagTo(rt.AcroTextFlags.FileSelect,!1)},e.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(rt.AcroTextFlags.DoNotSpellCheck)},e.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(rt.AcroTextFlags.DoNotSpellCheck,!1)},e.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(rt.AcroTextFlags.DoNotSpellCheck,!0)},e.prototype.isScrollable=function(){return!this.acroField.hasFlag(rt.AcroTextFlags.DoNotScroll)},e.prototype.enableScrolling=function(){this.acroField.setFlagTo(rt.AcroTextFlags.DoNotScroll,!1)},e.prototype.disableScrolling=function(){this.acroField.setFlagTo(rt.AcroTextFlags.DoNotScroll,!0)},e.prototype.isCombed=function(){return this.acroField.hasFlag(rt.AcroTextFlags.Comb)&&!this.isMultiline()&&!this.isPassword()&&!this.isFileSelector()&&this.getMaxLength()!==void 0},e.prototype.enableCombing=function(){if(this.getMaxLength()===void 0){var t="PDFTextFields must have a max length in order to be combed";console.warn(t)}this.markAsDirty(),this.disableMultiline(),this.disablePassword(),this.disableFileSelection(),this.acroField.setFlagTo(rt.AcroTextFlags.Comb,!0)},e.prototype.disableCombing=function(){this.markAsDirty(),this.acroField.setFlagTo(rt.AcroTextFlags.Comb,!1)},e.prototype.isRichFormatted=function(){return this.acroField.hasFlag(rt.AcroTextFlags.RichText)},e.prototype.enableRichFormatting=function(){this.acroField.setFlagTo(rt.AcroTextFlags.RichText,!0)},e.prototype.disableRichFormatting=function(){this.acroField.setFlagTo(rt.AcroTextFlags.RichText,!1)},e.prototype.addToPage=function(t,n){var i,s,a,o,l,u,d;fi.assertIs(t,"page",[[BL.default,"PDFPage"]]),nP.assertFieldAppearanceOptions(n),n||(n={}),"textColor"in n||(n.textColor=N0.rgb(0,0,0)),"backgroundColor"in n||(n.backgroundColor=N0.rgb(1,1,1)),"borderColor"in n||(n.borderColor=N0.rgb(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var c=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(s=n.y)!==null&&s!==void 0?s:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(o=n.height)!==null&&o!==void 0?o:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(l=n.borderWidth)!==null&&l!==void 0?l:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:UL.degrees(0),hidden:n.hidden,page:t.ref}),h=this.doc.context.register(c.dict);this.acroField.addWidget(h);var f=(d=n.font)!==null&&d!==void 0?d:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(c,f),t.node.addAnnot(h)},e.prototype.needsAppearancesUpdate=function(){var t;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=((t=a.getAppearances())===null||t===void 0?void 0:t.normal)instanceof rt.PDFStream;if(!o)return!0}return!1},e.prototype.defaultUpdateAppearances=function(t){fi.assertIs(t,"font",[[rP.default,"PDFFont"]]),this.updateAppearances(t)},e.prototype.updateAppearances=function(t,n){fi.assertIs(t,"font",[[rP.default,"PDFFont"]]),fi.assertOrUndefined(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s];this.updateWidgetAppearance(o,t,n)}this.markAsClean()},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??iP.defaultTextFieldAppearanceProvider,a=iP.normalizeAppearance(s(this,t,n));this.updateWidgetAppearanceWithFont(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}(nP.default);B0.default=qL});var wh=E(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.StandardFonts=void 0;var zL;(function(r){r.Courier="Courier",r.CourierBold="Courier-Bold",r.CourierOblique="Courier-Oblique",r.CourierBoldOblique="Courier-BoldOblique",r.Helvetica="Helvetica",r.HelveticaBold="Helvetica-Bold",r.HelveticaOblique="Helvetica-Oblique",r.HelveticaBoldOblique="Helvetica-BoldOblique",r.TimesRoman="Times-Roman",r.TimesRomanBold="Times-Bold",r.TimesRomanItalic="Times-Italic",r.TimesRomanBoldItalic="Times-BoldItalic",r.Symbol="Symbol",r.ZapfDingbats="ZapfDingbats"})(zL=Wl.StandardFonts||(Wl.StandardFonts={}))});var V0=E(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});var Jr=(j(),U(L)),VL=Jr.__importDefault(Hi()),Ah=Jr.__importDefault(H0()),Kl=Jr.__importDefault(S0()),Sh=Jr.__importDefault(D0()),Ph=Jr.__importDefault(T0()),Xl=Jr.__importDefault(I0()),q0=Jr.__importDefault(M0()),Fh=Jr.__importDefault(U0()),fn=Qa(),HL=Jr.__importDefault(di()),GL=wh(),WL=Ja(),xh=Bi(),je=St(),dt=ae(),KL=function(){function r(e,t){var n=this;this.embedDefaultFont=function(){return n.doc.embedStandardFont(GL.StandardFonts.Helvetica)},dt.assertIs(e,"acroForm",[[je.PDFAcroForm,"PDFAcroForm"]]),dt.assertIs(t,"doc",[[VL.default,"PDFDocument"]]),this.acroForm=e,this.doc=t,this.dirtyFields=new Set,this.defaultFontCache=dt.Cache.populatedBy(this.embedDefaultFont)}return r.prototype.hasXFA=function(){return this.acroForm.dict.has(je.PDFName.of("XFA"))},r.prototype.deleteXFA=function(){this.acroForm.dict.delete(je.PDFName.of("XFA"))},r.prototype.getFields=function(){for(var e=this.acroForm.getAllFields(),t=[],n=0,i=e.length;n<i;n++){var s=e[n],a=s[0],o=s[1],l=XL(a,o,this.doc);l&&t.push(l)}return t},r.prototype.getFieldMaybe=function(e){dt.assertIs(e,"name",["string"]);for(var t=this.getFields(),n=0,i=t.length;n<i;n++){var s=t[n];if(s.getName()===e)return s}},r.prototype.getField=function(e){dt.assertIs(e,"name",["string"]);var t=this.getFieldMaybe(e);if(t)return t;throw new fn.NoSuchFieldError(e)},r.prototype.getButton=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Ah.default)return t;throw new fn.UnexpectedFieldTypeError(e,Ah.default,t)},r.prototype.getCheckBox=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Kl.default)return t;throw new fn.UnexpectedFieldTypeError(e,Kl.default,t)},r.prototype.getDropdown=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Sh.default)return t;throw new fn.UnexpectedFieldTypeError(e,Sh.default,t)},r.prototype.getOptionList=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Ph.default)return t;throw new fn.UnexpectedFieldTypeError(e,Ph.default,t)},r.prototype.getRadioGroup=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Xl.default)return t;throw new fn.UnexpectedFieldTypeError(e,Xl.default,t)},r.prototype.getSignature=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof q0.default)return t;throw new fn.UnexpectedFieldTypeError(e,q0.default,t)},r.prototype.getTextField=function(e){dt.assertIs(e,"name",["string"]);var t=this.getField(e);if(t instanceof Fh.default)return t;throw new fn.UnexpectedFieldTypeError(e,Fh.default,t)},r.prototype.createButton=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroPushButton.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Ah.default.of(i,i.ref,this.doc)},r.prototype.createCheckBox=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroCheckBox.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Kl.default.of(i,i.ref,this.doc)},r.prototype.createDropdown=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroComboBox.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Sh.default.of(i,i.ref,this.doc)},r.prototype.createOptionList=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroListBox.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Ph.default.of(i,i.ref,this.doc)},r.prototype.createRadioGroup=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroRadioButton.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Xl.default.of(i,i.ref,this.doc)},r.prototype.createTextField=function(e){dt.assertIs(e,"name",["string"]);var t=ro(e),n=this.findOrCreateNonTerminals(t.nonTerminal),i=je.PDFAcroText.create(this.doc.context);return i.setPartialName(t.terminal),no(n,[i,i.ref],t.terminal),Fh.default.of(i,i.ref,this.doc)},r.prototype.flatten=function(e){e===void 0&&(e={updateFieldAppearances:!0}),e.updateFieldAppearances&&this.updateFieldAppearances();for(var t=this.getFields(),n=0,i=t.length;n<i;n++){for(var s=t[n],a=s.acroField.getWidgets(),o=0,l=a.length;o<l;o++){var u=a[o],d=this.findWidgetPage(u),c=this.findWidgetAppearanceRef(s,u),h=d.node.newXObject("FlatWidget",c),f=u.getRectangle(),p=Jr.__spreadArrays([xh.pushGraphicsState(),xh.translate(f.x,f.y)],WL.rotateInPlace(Jr.__assign(Jr.__assign({},f),{rotation:0})),[xh.drawObject(h),xh.popGraphicsState()]).filter(Boolean);d.pushOperators.apply(d,p)}this.removeField(s)}},r.prototype.removeField=function(e){for(var t=e.acroField.getWidgets(),n=new Set,i=0,s=t.length;i<s;i++){var a=t[i],o=this.findWidgetAppearanceRef(e,a),l=this.findWidgetPage(a);n.add(l),l.node.removeAnnot(o)}n.forEach(function(f){return f.node.removeAnnot(e.ref)}),this.acroForm.removeField(e.acroField);for(var u=e.acroField.normalizedEntries().Kids,d=u.size(),c=0;c<d;c++){var h=u.get(c);h instanceof je.PDFRef&&this.doc.context.delete(h)}this.doc.context.delete(e.ref)},r.prototype.updateFieldAppearances=function(e){dt.assertOrUndefined(e,"font",[[HL.default,"PDFFont"]]),e=e??this.getDefaultFont();for(var t=this.getFields(),n=0,i=t.length;n<i;n++){var s=t[n];s.needsAppearancesUpdate()&&s.defaultUpdateAppearances(e)}},r.prototype.markFieldAsDirty=function(e){dt.assertOrUndefined(e,"fieldRef",[[je.PDFRef,"PDFRef"]]),this.dirtyFields.add(e)},r.prototype.markFieldAsClean=function(e){dt.assertOrUndefined(e,"fieldRef",[[je.PDFRef,"PDFRef"]]),this.dirtyFields.delete(e)},r.prototype.fieldIsDirty=function(e){return dt.assertOrUndefined(e,"fieldRef",[[je.PDFRef,"PDFRef"]]),this.dirtyFields.has(e)},r.prototype.getDefaultFont=function(){return this.defaultFontCache.access()},r.prototype.findWidgetPage=function(e){var t=e.P(),n=this.doc.getPages().find(function(s){return s.ref===t});if(n===void 0){var i=this.doc.context.getObjectRef(e.dict);if(i===void 0)throw new Error("Could not find PDFRef for PDFObject");if(n=this.doc.findPageForAnnotationRef(i),n===void 0)throw new Error("Could not find page for PDFRef "+i)}return n},r.prototype.findWidgetAppearanceRef=function(e,t){var n,i=t.getNormalAppearance();if(i instanceof je.PDFDict&&(e instanceof Kl.default||e instanceof Xl.default)){var s=e.acroField.getValue(),a=(n=i.get(s))!==null&&n!==void 0?n:i.get(je.PDFName.of("Off"));a instanceof je.PDFRef&&(i=a)}if(!(i instanceof je.PDFRef)){var o=e.getName();throw new Error("Failed to extract appearance ref for: "+o)}return i},r.prototype.findOrCreateNonTerminals=function(e){for(var t=[this.acroForm],n=0,i=e.length;n<i;n++){var s=e[n];if(!s)throw new fn.InvalidFieldNamePartError(s);var a=t[0],o=t[1],l=this.findNonTerminal(s,a);if(l)t=l;else{var u=je.PDFAcroNonTerminal.create(this.doc.context);u.setPartialName(s),u.setParent(o);var d=this.doc.context.register(u.dict);a.addField(d),t=[u,d]}}return t},r.prototype.findNonTerminal=function(e,t){for(var n=t instanceof je.PDFAcroForm?this.acroForm.getFields():je.createPDFAcroFields(t.Kids()),i=0,s=n.length;i<s;i++){var a=n[i],o=a[0],l=a[1];if(o.getPartialName()===e){if(o instanceof je.PDFAcroNonTerminal)return[o,l];throw new fn.FieldAlreadyExistsError(e)}}},r.of=function(e,t){return new r(e,t)},r}();z0.default=KL;var XL=function(r,e,t){if(r instanceof je.PDFAcroPushButton)return Ah.default.of(r,e,t);if(r instanceof je.PDFAcroCheckBox)return Kl.default.of(r,e,t);if(r instanceof je.PDFAcroComboBox)return Sh.default.of(r,e,t);if(r instanceof je.PDFAcroListBox)return Ph.default.of(r,e,t);if(r instanceof je.PDFAcroText)return Fh.default.of(r,e,t);if(r instanceof je.PDFAcroRadioButton)return Xl.default.of(r,e,t);if(r instanceof je.PDFAcroSignature)return q0.default.of(r,e,t)},ro=function(r){if(r.length===0)throw new Error("PDF field names must not be empty strings");for(var e=r.split("."),t=0,n=e.length;t<n;t++)if(e[t]==="")throw new Error('Periods in PDF field names must be separated by at least one character: "'+r+'"');return e.length===1?{nonTerminal:[],terminal:e[0]}:{nonTerminal:e.slice(0,e.length-1),terminal:e[e.length-1]}},no=function(r,e,t){for(var n=r[0],i=r[1],s=e[0],a=e[1],o=n.normalizedEntries(),l=je.createPDFAcroFields("Kids"in o?o.Kids:o.Fields),u=0,d=l.length;u<d;u++)if(l[u][0].getPartialName()===t)throw new fn.FieldAlreadyExistsError(t);n.addField(a),s.setParent(i)}});var G0=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.PageSizes=void 0;Dh.PageSizes={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],Executive:[521.86,756],Folio:[612,936],Legal:[612,1008],Letter:[612,792],Tabloid:[792,1224]}});var W0=E(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.ParseSpeeds=void 0;var YL;(function(r){r[r.Fastest=1/0]="Fastest",r[r.Fast=1500]="Fast",r[r.Medium=500]="Medium",r[r.Slow=100]="Slow"})(YL=Yl.ParseSpeeds||(Yl.ParseSpeeds={}))});var aP=E(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});var sP=(j(),U(L)),Vt=St(),ZL=function(){function r(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return r.prototype.embed=function(){return sP.__awaiter(this,void 0,void 0,function(){var e,t,n,i,s;return sP.__generator(this,function(a){switch(a.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e=a.sent(),this.doc.catalog.has(Vt.PDFName.of("Names"))||this.doc.catalog.set(Vt.PDFName.of("Names"),this.doc.context.obj({})),t=this.doc.catalog.lookup(Vt.PDFName.of("Names"),Vt.PDFDict),t.has(Vt.PDFName.of("EmbeddedFiles"))||t.set(Vt.PDFName.of("EmbeddedFiles"),this.doc.context.obj({})),n=t.lookup(Vt.PDFName.of("EmbeddedFiles"),Vt.PDFDict),n.has(Vt.PDFName.of("Names"))||n.set(Vt.PDFName.of("Names"),this.doc.context.obj([])),i=n.lookup(Vt.PDFName.of("Names"),Vt.PDFArray),i.push(Vt.PDFHexString.fromText(this.embedder.fileName)),i.push(e),this.doc.catalog.has(Vt.PDFName.of("AF"))||this.doc.catalog.set(Vt.PDFName.of("AF"),this.doc.context.obj([])),s=this.doc.catalog.lookup(Vt.PDFName.of("AF"),Vt.PDFArray),s.push(e),this.alreadyEmbedded=!0,a.label=2;case 2:return[2]}})})},r.of=function(e,t,n){return new r(e,t,n)},r}();K0.default=ZL});var Y0=E(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});var oP=(j(),U(L)),Nr=St(),JL=function(){function r(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return r.prototype.embed=function(){return oP.__awaiter(this,void 0,void 0,function(){var e,t,n,i,s,a,o;return oP.__generator(this,function(l){switch(l.label){case 0:return this.alreadyEmbedded?[3,2]:(e=this.doc,t=e.catalog,n=e.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:i=l.sent(),t.has(Nr.PDFName.of("Names"))||t.set(Nr.PDFName.of("Names"),n.obj({})),s=t.lookup(Nr.PDFName.of("Names"),Nr.PDFDict),s.has(Nr.PDFName.of("JavaScript"))||s.set(Nr.PDFName.of("JavaScript"),n.obj({})),a=s.lookup(Nr.PDFName.of("JavaScript"),Nr.PDFDict),a.has(Nr.PDFName.of("Names"))||a.set(Nr.PDFName.of("Names"),n.obj([])),o=a.lookup(Nr.PDFName.of("Names"),Nr.PDFArray),o.push(Nr.PDFHexString.fromText(this.embedder.scriptName)),o.push(i),this.alreadyEmbedded=!0,l.label=2;case 2:return[2]}})})},r.of=function(e,t,n){return new r(e,t,n)},r}();X0.default=JL});var lP=E(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});var Z0=(j(),U(L)),QL=Z0.__importDefault(gr()),$L=function(){function r(e,t){this.script=e,this.scriptName=t}return r.for=function(e,t){return new r(e,t)},r.prototype.embedIntoContext=function(e,t){return Z0.__awaiter(this,void 0,void 0,function(){var n;return Z0.__generator(this,function(i){return n=e.obj({Type:"Action",S:"JavaScript",JS:QL.default.fromText(this.script)}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},r}();J0.default=$L});var Hi=E(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});var be=(j(),U(L)),Eh=Qa(),ej=be.__importDefault(hh()),uP=be.__importDefault(di()),dP=be.__importDefault(ph()),io=be.__importDefault(hi()),tj=be.__importDefault(V0()),rj=G0(),se=St(),nj=W0(),re=ae(),cP=be.__importStar(_m()),ij=be.__importDefault(aP()),sj=be.__importDefault(Y0()),aj=be.__importDefault(lP()),oj=function(){function r(e,t,n){var i=this;if(this.defaultWordBreaks=[" "],this.computePages=function(){var s=[];return i.catalog.Pages().traverse(function(a,o){if(a instanceof se.PDFPageLeaf){var l=i.pageMap.get(a);l||(l=io.default.of(a,o,i),i.pageMap.set(a,l)),s.push(l)}}),s},this.getOrCreateForm=function(){var s=i.catalog.getOrCreateAcroForm();return tj.default.of(s,i)},re.assertIs(e,"context",[[se.PDFContext,"PDFContext"]]),re.assertIs(t,"ignoreEncryption",["boolean"]),this.context=e,this.catalog=e.lookup(e.trailerInfo.Root),this.isEncrypted=!!e.lookup(e.trailerInfo.Encrypt),this.pageCache=re.Cache.populatedBy(this.computePages),this.pageMap=new Map,this.formCache=re.Cache.populatedBy(this.getOrCreateForm),this.fonts=[],this.images=[],this.embeddedPages=[],this.embeddedFiles=[],this.javaScripts=[],!t&&this.isEncrypted)throw new Eh.EncryptedPDFError;n&&this.updateInfoDict()}return r.load=function(e,t){return t===void 0&&(t={}),be.__awaiter(this,void 0,void 0,function(){var n,i,s,a,o,l,u,d,c,h,f,p;return be.__generator(this,function(g){switch(g.label){case 0:return n=t.ignoreEncryption,i=n===void 0?!1:n,s=t.parseSpeed,a=s===void 0?nj.ParseSpeeds.Slow:s,o=t.throwOnInvalidObject,l=o===void 0?!1:o,u=t.updateMetadata,d=u===void 0?!0:u,c=t.capNumbers,h=c===void 0?!1:c,re.assertIs(e,"pdf",["string",Uint8Array,ArrayBuffer]),re.assertIs(i,"ignoreEncryption",["boolean"]),re.assertIs(a,"parseSpeed",["number"]),re.assertIs(l,"throwOnInvalidObject",["boolean"]),f=re.toUint8Array(e),[4,se.PDFParser.forBytesWithOptions(f,a,l,h).parseDocument()];case 1:return p=g.sent(),[2,new r(p,i,d)]}})})},r.create=function(e){return e===void 0&&(e={}),be.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o;return be.__generator(this,function(l){return t=e.updateMetadata,n=t===void 0?!0:t,i=se.PDFContext.create(),s=se.PDFPageTree.withContext(i),a=i.register(s),o=se.PDFCatalog.withContextAndPages(i,a),i.trailerInfo.Root=i.register(o),[2,new r(i,!1,n)]})})},r.prototype.registerFontkit=function(e){this.fontkit=e},r.prototype.getForm=function(){var e=this.formCache.access();return e.hasXFA()&&(console.warn("Removing XFA form data as pdf-lib does not support reading or writing XFA"),e.deleteXFA()),e},r.prototype.getTitle=function(){var e=this.getInfoDict().lookup(se.PDFName.Title);if(e)return Gi(e),e.decodeText()},r.prototype.getAuthor=function(){var e=this.getInfoDict().lookup(se.PDFName.Author);if(e)return Gi(e),e.decodeText()},r.prototype.getSubject=function(){var e=this.getInfoDict().lookup(se.PDFName.Subject);if(e)return Gi(e),e.decodeText()},r.prototype.getKeywords=function(){var e=this.getInfoDict().lookup(se.PDFName.Keywords);if(e)return Gi(e),e.decodeText()},r.prototype.getCreator=function(){var e=this.getInfoDict().lookup(se.PDFName.Creator);if(e)return Gi(e),e.decodeText()},r.prototype.getProducer=function(){var e=this.getInfoDict().lookup(se.PDFName.Producer);if(e)return Gi(e),e.decodeText()},r.prototype.getCreationDate=function(){var e=this.getInfoDict().lookup(se.PDFName.CreationDate);if(e)return Gi(e),e.decodeDate()},r.prototype.getModificationDate=function(){var e=this.getInfoDict().lookup(se.PDFName.ModDate);if(e)return Gi(e),e.decodeDate()},r.prototype.setTitle=function(e,t){re.assertIs(e,"title",["string"]);var n=se.PDFName.of("Title");if(this.getInfoDict().set(n,se.PDFHexString.fromText(e)),t?.showInWindowTitleBar){var i=this.catalog.getOrCreateViewerPreferences();i.setDisplayDocTitle(!0)}},r.prototype.setAuthor=function(e){re.assertIs(e,"author",["string"]);var t=se.PDFName.of("Author");this.getInfoDict().set(t,se.PDFHexString.fromText(e))},r.prototype.setSubject=function(e){re.assertIs(e,"author",["string"]);var t=se.PDFName.of("Subject");this.getInfoDict().set(t,se.PDFHexString.fromText(e))},r.prototype.setKeywords=function(e){re.assertIs(e,"keywords",[Array]);var t=se.PDFName.of("Keywords");this.getInfoDict().set(t,se.PDFHexString.fromText(e.join(" ")))},r.prototype.setCreator=function(e){re.assertIs(e,"creator",["string"]);var t=se.PDFName.of("Creator");this.getInfoDict().set(t,se.PDFHexString.fromText(e))},r.prototype.setProducer=function(e){re.assertIs(e,"creator",["string"]);var t=se.PDFName.of("Producer");this.getInfoDict().set(t,se.PDFHexString.fromText(e))},r.prototype.setLanguage=function(e){re.assertIs(e,"language",["string"]);var t=se.PDFName.of("Lang");this.catalog.set(t,se.PDFString.of(e))},r.prototype.setCreationDate=function(e){re.assertIs(e,"creationDate",[[Date,"Date"]]);var t=se.PDFName.of("CreationDate");this.getInfoDict().set(t,se.PDFString.fromDate(e))},r.prototype.setModificationDate=function(e){re.assertIs(e,"modificationDate",[[Date,"Date"]]);var t=se.PDFName.of("ModDate");this.getInfoDict().set(t,se.PDFString.fromDate(e))},r.prototype.getPageCount=function(){return this.pageCount===void 0&&(this.pageCount=this.getPages().length),this.pageCount},r.prototype.getPages=function(){return this.pageCache.access()},r.prototype.getPage=function(e){var t=this.getPages();return re.assertRange(e,"index",0,t.length-1),t[e]},r.prototype.getPageIndices=function(){return re.range(0,this.getPageCount())},r.prototype.removePage=function(e){var t=this.getPageCount();if(this.pageCount===0)throw new Eh.RemovePageFromEmptyDocumentError;re.assertRange(e,"index",0,t-1),this.catalog.removeLeafNode(e),this.pageCount=t-1},r.prototype.addPage=function(e){return re.assertIs(e,"page",["undefined",[io.default,"PDFPage"],Array]),this.insertPage(this.getPageCount(),e)},r.prototype.insertPage=function(e,t){var n=this.getPageCount();if(re.assertRange(e,"index",0,n),re.assertIs(t,"page",["undefined",[io.default,"PDFPage"],Array]),!t||Array.isArray(t)){var i=Array.isArray(t)?t:rj.PageSizes.A4;t=io.default.create(this),t.setSize.apply(t,i)}else if(t.doc!==this)throw new Eh.ForeignPageError;var s=this.catalog.insertLeafNode(t.ref,e);return t.node.setParent(s),this.pageMap.set(t.node,t),this.pageCache.invalidate(),this.pageCount=n+1,t},r.prototype.copyPages=function(e,t){return be.__awaiter(this,void 0,void 0,function(){var n,i,s,a,o,l,u,d;return be.__generator(this,function(c){switch(c.label){case 0:return re.assertIs(e,"srcDoc",[[r,"PDFDocument"]]),re.assertIs(t,"indices",[Array]),[4,e.flush()];case 1:for(c.sent(),n=se.PDFObjectCopier.for(e.context,this.context),i=e.getPages(),s=new Array(t.length),a=0,o=t.length;a<o;a++)l=i[t[a]],u=n.copy(l.node),d=this.context.register(u),s[a]=io.default.of(u,d,this);return[2,s]}})})},r.prototype.copy=function(){return be.__awaiter(this,void 0,void 0,function(){var e,t,n,i;return be.__generator(this,function(s){switch(s.label){case 0:return[4,r.create()];case 1:return e=s.sent(),[4,e.copyPages(this,this.getPageIndices())];case 2:for(t=s.sent(),n=0,i=t.length;n<i;n++)e.addPage(t[n]);return this.getAuthor()!==void 0&&e.setAuthor(this.getAuthor()),this.getCreationDate()!==void 0&&e.setCreationDate(this.getCreationDate()),this.getCreator()!==void 0&&e.setCreator(this.getCreator()),this.getModificationDate()!==void 0&&e.setModificationDate(this.getModificationDate()),this.getProducer()!==void 0&&e.setProducer(this.getProducer()),this.getSubject()!==void 0&&e.setSubject(this.getSubject()),this.getTitle()!==void 0&&e.setTitle(this.getTitle()),e.defaultWordBreaks=this.defaultWordBreaks,[2,e]}})})},r.prototype.addJavaScript=function(e,t){re.assertIs(e,"name",["string"]),re.assertIs(t,"script",["string"]);var n=aj.default.for(t,e),i=this.context.nextRef(),s=sj.default.of(i,this,n);this.javaScripts.push(s)},r.prototype.attach=function(e,t,n){return n===void 0&&(n={}),be.__awaiter(this,void 0,void 0,function(){var i,s,a,o;return be.__generator(this,function(l){return re.assertIs(e,"attachment",["string",Uint8Array,ArrayBuffer]),re.assertIs(t,"name",["string"]),re.assertOrUndefined(n.mimeType,"mimeType",["string"]),re.assertOrUndefined(n.description,"description",["string"]),re.assertOrUndefined(n.creationDate,"options.creationDate",[Date]),re.assertOrUndefined(n.modificationDate,"options.modificationDate",[Date]),re.assertIsOneOfOrUndefined(n.afRelationship,"options.afRelationship",cP.AFRelationship),i=re.toUint8Array(e),s=cP.default.for(i,t,n),a=this.context.nextRef(),o=ij.default.of(a,this,s),this.embeddedFiles.push(o),[2]})})},r.prototype.embedFont=function(e,t){return t===void 0&&(t={}),be.__awaiter(this,void 0,void 0,function(){var n,i,s,a,o,l,u,d,c,h;return be.__generator(this,function(f){switch(f.label){case 0:return n=t.subset,i=n===void 0?!1:n,s=t.customName,a=t.features,re.assertIs(e,"font",["string",Uint8Array,ArrayBuffer]),re.assertIs(i,"subset",["boolean"]),re.isStandardFont(e)?(o=se.StandardFontEmbedder.for(e,s),[3,7]):[3,1];case 1:return re.canBeConvertedToUint8Array(e)?(l=re.toUint8Array(e),u=this.assertFontkit(),i?[4,se.CustomFontSubsetEmbedder.for(u,l,s,a)]:[3,3]):[3,6];case 2:return d=f.sent(),[3,5];case 3:return[4,se.CustomFontEmbedder.for(u,l,s,a)];case 4:d=f.sent(),f.label=5;case 5:return o=d,[3,7];case 6:throw new TypeError("`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`");case 7:return c=this.context.nextRef(),h=uP.default.of(c,this,o),this.fonts.push(h),[2,h]}})})},r.prototype.embedStandardFont=function(e,t){if(re.assertIs(e,"font",["string"]),!re.isStandardFont(e))throw new TypeError("`font` must be one of type `StandardFonts`");var n=se.StandardFontEmbedder.for(e,t),i=this.context.nextRef(),s=uP.default.of(i,this,n);return this.fonts.push(s),s},r.prototype.embedJpg=function(e){return be.__awaiter(this,void 0,void 0,function(){var t,n,i,s;return be.__generator(this,function(a){switch(a.label){case 0:return re.assertIs(e,"jpg",["string",Uint8Array,ArrayBuffer]),t=re.toUint8Array(e),[4,se.JpegEmbedder.for(t)];case 1:return n=a.sent(),i=this.context.nextRef(),s=dP.default.of(i,this,n),this.images.push(s),[2,s]}})})},r.prototype.embedPng=function(e){return be.__awaiter(this,void 0,void 0,function(){var t,n,i,s;return be.__generator(this,function(a){switch(a.label){case 0:return re.assertIs(e,"png",["string",Uint8Array,ArrayBuffer]),t=re.toUint8Array(e),[4,se.PngEmbedder.for(t)];case 1:return n=a.sent(),i=this.context.nextRef(),s=dP.default.of(i,this,n),this.images.push(s),[2,s]}})})},r.prototype.embedPdf=function(e,t){return t===void 0&&(t=[0]),be.__awaiter(this,void 0,void 0,function(){var n,i,s;return be.__generator(this,function(a){switch(a.label){case 0:return re.assertIs(e,"pdf",["string",Uint8Array,ArrayBuffer,[r,"PDFDocument"]]),re.assertIs(t,"indices",[Array]),e instanceof r?(i=e,[3,3]):[3,1];case 1:return[4,r.load(e)];case 2:i=a.sent(),a.label=3;case 3:return n=i,s=re.pluckIndices(n.getPages(),t),[2,this.embedPages(s)]}})})},r.prototype.embedPage=function(e,t,n){return be.__awaiter(this,void 0,void 0,function(){var i;return be.__generator(this,function(s){switch(s.label){case 0:return re.assertIs(e,"page",[[io.default,"PDFPage"]]),[4,this.embedPages([e],[t],[n])];case 1:return i=s.sent()[0],[2,i]}})})},r.prototype.embedPages=function(e,t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),be.__awaiter(this,void 0,void 0,function(){var u,d,i,s,a,o,l,u,d,c,h,f,p,g,v;return be.__generator(this,function(m){switch(m.label){case 0:if(e.length===0)return[2,[]];for(u=0,d=e.length-1;u<d;u++)if(i=e[u],s=e[u+1],i.node.context!==s.node.context)throw new se.PageEmbeddingMismatchedContextError;a=e[0].node.context,o=a===this.context?function(y){return y}:se.PDFObjectCopier.for(a,this.context).copy,l=new Array(e.length),u=0,d=e.length,m.label=1;case 1:return u<d?(c=o(e[u].node),h=t[u],f=n[u],[4,se.PDFPageEmbedder.for(c,h,f)]):[3,4];case 2:p=m.sent(),g=this.context.nextRef(),l[u]=ej.default.of(g,this,p),m.label=3;case 3:return u++,[3,1];case 4:return(v=this.embeddedPages).push.apply(v,l),[2,l]}})})},r.prototype.flush=function(){return be.__awaiter(this,void 0,void 0,function(){return be.__generator(this,function(e){switch(e.label){case 0:return[4,this.embedAll(this.fonts)];case 1:return e.sent(),[4,this.embedAll(this.images)];case 2:return e.sent(),[4,this.embedAll(this.embeddedPages)];case 3:return e.sent(),[4,this.embedAll(this.embeddedFiles)];case 4:return e.sent(),[4,this.embedAll(this.javaScripts)];case 5:return e.sent(),[2]}})})},r.prototype.save=function(e){return e===void 0&&(e={}),be.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a,o,l,u,d,c;return be.__generator(this,function(h){switch(h.label){case 0:return t=e.useObjectStreams,n=t===void 0?!0:t,i=e.addDefaultPage,s=i===void 0?!0:i,a=e.objectsPerTick,o=a===void 0?50:a,l=e.updateFieldAppearances,u=l===void 0?!0:l,re.assertIs(n,"useObjectStreams",["boolean"]),re.assertIs(s,"addDefaultPage",["boolean"]),re.assertIs(o,"objectsPerTick",["number"]),re.assertIs(u,"updateFieldAppearances",["boolean"]),s&&this.getPageCount()===0&&this.addPage(),u&&(d=this.formCache.getValue(),d&&d.updateFieldAppearances()),[4,this.flush()];case 1:return h.sent(),c=n?se.PDFStreamWriter:se.PDFWriter,[2,c.forContext(this.context,o).serializeToBuffer()]}})})},r.prototype.saveAsBase64=function(e){return e===void 0&&(e={}),be.__awaiter(this,void 0,void 0,function(){var t,n,i,s,a;return be.__generator(this,function(o){switch(o.label){case 0:return t=e.dataUri,n=t===void 0?!1:t,i=be.__rest(e,["dataUri"]),re.assertIs(n,"dataUri",["boolean"]),[4,this.save(i)];case 1:return s=o.sent(),a=re.encodeToBase64(s),[2,n?"data:application/pdf;base64,"+a:a]}})})},r.prototype.findPageForAnnotationRef=function(e){for(var t=this.getPages(),n=0,i=t.length;n<i;n++){var s=t[n],a=s.node.Annots();if(a?.indexOf(e)!==void 0)return s}},r.prototype.embedAll=function(e){return be.__awaiter(this,void 0,void 0,function(){var t,n;return be.__generator(this,function(i){switch(i.label){case 0:t=0,n=e.length,i.label=1;case 1:return t<n?[4,e[t].embed()]:[3,4];case 2:i.sent(),i.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},r.prototype.updateInfoDict=function(){var e="pdf-lib (https://github.com/Hopding/pdf-lib)",t=new Date,n=this.getInfoDict();this.setProducer(e),this.setModificationDate(t),n.get(se.PDFName.of("Creator"))||this.setCreator(e),n.get(se.PDFName.of("CreationDate"))||this.setCreationDate(t)},r.prototype.getInfoDict=function(){var e=this.context.lookup(this.context.trailerInfo.Info);if(e instanceof se.PDFDict)return e;var t=this.context.obj({});return this.context.trailerInfo.Info=this.context.register(t),t},r.prototype.assertFontkit=function(){if(!this.fontkit)throw new Eh.FontkitNotRegisteredError;return this.fontkit},r}();Q0.default=oj;function Gi(r){if(!(r instanceof se.PDFHexString)&&!(r instanceof se.PDFString))throw new se.UnexpectedObjectTypeError([se.PDFHexString,se.PDFString],r)}});var $0=E(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.BlendMode=void 0;var lj;(function(r){r.Normal="Normal",r.Multiply="Multiply",r.Screen="Screen",r.Overlay="Overlay",r.Darken="Darken",r.Lighten="Lighten",r.ColorDodge="ColorDodge",r.ColorBurn="ColorBurn",r.HardLight="HardLight",r.SoftLight="SoftLight",r.Difference="Difference",r.Exclusion="Exclusion"})(lj=Zl.BlendMode||(Zl.BlendMode={}))});var hi=E(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});var Wi=(j(),U(L)),Jl=Wr(),js=Ja(),Ln=Bi(),hP=Wi.__importDefault(Hi()),uj=Wi.__importDefault(hh()),fP=Wi.__importDefault(di()),dj=Wi.__importDefault(ph()),Bs=$0(),or=Or(),cj=wh(),Mt=St(),T=ae(),hj=function(){function r(e,t,n){this.fontSize=24,this.fontColor=Jl.rgb(0,0,0),this.lineHeight=24,this.x=0,this.y=0,T.assertIs(e,"leafNode",[[Mt.PDFPageLeaf,"PDFPageLeaf"]]),T.assertIs(t,"ref",[[Mt.PDFRef,"PDFRef"]]),T.assertIs(n,"doc",[[hP.default,"PDFDocument"]]),this.node=e,this.ref=t,this.doc=n}return r.prototype.setRotation=function(e){var t=or.toDegrees(e);T.assertMultiple(t,"degreesAngle",90),this.node.set(Mt.PDFName.of("Rotate"),this.doc.context.obj(t))},r.prototype.getRotation=function(){var e=this.node.Rotate();return or.degrees(e?e.asNumber():0)},r.prototype.setSize=function(e,t){T.assertIs(e,"width",["number"]),T.assertIs(t,"height",["number"]);var n=this.getMediaBox();this.setMediaBox(n.x,n.y,e,t);var i=this.getCropBox(),s=this.getBleedBox(),a=this.getTrimBox(),o=this.getArtBox(),l=this.node.CropBox(),u=this.node.BleedBox(),d=this.node.TrimBox(),c=this.node.ArtBox();l&&T.rectanglesAreEqual(i,n)&&this.setCropBox(n.x,n.y,e,t),u&&T.rectanglesAreEqual(s,n)&&this.setBleedBox(n.x,n.y,e,t),d&&T.rectanglesAreEqual(a,n)&&this.setTrimBox(n.x,n.y,e,t),c&&T.rectanglesAreEqual(o,n)&&this.setArtBox(n.x,n.y,e,t)},r.prototype.setWidth=function(e){T.assertIs(e,"width",["number"]),this.setSize(e,this.getSize().height)},r.prototype.setHeight=function(e){T.assertIs(e,"height",["number"]),this.setSize(this.getSize().width,e)},r.prototype.setMediaBox=function(e,t,n,i){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),T.assertIs(n,"width",["number"]),T.assertIs(i,"height",["number"]);var s=this.doc.context.obj([e,t,e+n,t+i]);this.node.set(Mt.PDFName.MediaBox,s)},r.prototype.setCropBox=function(e,t,n,i){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),T.assertIs(n,"width",["number"]),T.assertIs(i,"height",["number"]);var s=this.doc.context.obj([e,t,e+n,t+i]);this.node.set(Mt.PDFName.CropBox,s)},r.prototype.setBleedBox=function(e,t,n,i){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),T.assertIs(n,"width",["number"]),T.assertIs(i,"height",["number"]);var s=this.doc.context.obj([e,t,e+n,t+i]);this.node.set(Mt.PDFName.BleedBox,s)},r.prototype.setTrimBox=function(e,t,n,i){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),T.assertIs(n,"width",["number"]),T.assertIs(i,"height",["number"]);var s=this.doc.context.obj([e,t,e+n,t+i]);this.node.set(Mt.PDFName.TrimBox,s)},r.prototype.setArtBox=function(e,t,n,i){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),T.assertIs(n,"width",["number"]),T.assertIs(i,"height",["number"]);var s=this.doc.context.obj([e,t,e+n,t+i]);this.node.set(Mt.PDFName.ArtBox,s)},r.prototype.getSize=function(){var e=this.getMediaBox(),t=e.width,n=e.height;return{width:t,height:n}},r.prototype.getWidth=function(){return this.getSize().width},r.prototype.getHeight=function(){return this.getSize().height},r.prototype.getMediaBox=function(){var e=this.node.MediaBox();return e.asRectangle()},r.prototype.getCropBox=function(){var e,t=this.node.CropBox();return(e=t?.asRectangle())!==null&&e!==void 0?e:this.getMediaBox()},r.prototype.getBleedBox=function(){var e,t=this.node.BleedBox();return(e=t?.asRectangle())!==null&&e!==void 0?e:this.getCropBox()},r.prototype.getTrimBox=function(){var e,t=this.node.TrimBox();return(e=t?.asRectangle())!==null&&e!==void 0?e:this.getCropBox()},r.prototype.getArtBox=function(){var e,t=this.node.ArtBox();return(e=t?.asRectangle())!==null&&e!==void 0?e:this.getCropBox()},r.prototype.translateContent=function(e,t){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(Ln.pushGraphicsState(),Ln.translate(e,t)),i=this.doc.context.register(n),s=this.createContentStream(Ln.popGraphicsState()),a=this.doc.context.register(s);this.node.wrapContentStreams(i,a)},r.prototype.scale=function(e,t){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),this.setSize(this.getWidth()*e,this.getHeight()*t),this.scaleContent(e,t),this.scaleAnnotations(e,t)},r.prototype.scaleContent=function(e,t){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(Ln.pushGraphicsState(),Ln.scale(e,t)),i=this.doc.context.register(n),s=this.createContentStream(Ln.popGraphicsState()),a=this.doc.context.register(s);this.node.wrapContentStreams(i,a)},r.prototype.scaleAnnotations=function(e,t){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]);var n=this.node.Annots();if(n)for(var i=0;i<n.size();i++){var s=n.lookup(i);s instanceof Mt.PDFDict&&this.scaleAnnot(s,e,t)}},r.prototype.resetPosition=function(){this.getContentStream(!1),this.x=0,this.y=0},r.prototype.setFont=function(e){T.assertIs(e,"font",[[fP.default,"PDFFont"]]),this.font=e,this.fontKey=this.node.newFontDictionary(this.font.name,this.font.ref)},r.prototype.setFontSize=function(e){T.assertIs(e,"fontSize",["number"]),this.fontSize=e},r.prototype.setFontColor=function(e){T.assertIs(e,"fontColor",[[Object,"Color"]]),this.fontColor=e},r.prototype.setLineHeight=function(e){T.assertIs(e,"lineHeight",["number"]),this.lineHeight=e},r.prototype.getPosition=function(){return{x:this.x,y:this.y}},r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.moveTo=function(e,t){T.assertIs(e,"x",["number"]),T.assertIs(t,"y",["number"]),this.x=e,this.y=t},r.prototype.moveDown=function(e){T.assertIs(e,"yDecrease",["number"]),this.y-=e},r.prototype.moveUp=function(e){T.assertIs(e,"yIncrease",["number"]),this.y+=e},r.prototype.moveLeft=function(e){T.assertIs(e,"xDecrease",["number"]),this.x-=e},r.prototype.moveRight=function(e){T.assertIs(e,"xIncrease",["number"]),this.x+=e},r.prototype.pushOperators=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];T.assertEachIs(e,"operator",[[Mt.PDFOperator,"PDFOperator"]]);var n=this.getContentStream();n.push.apply(n,e)},r.prototype.drawText=function(e,t){var n,i,s,a,o,l,u;t===void 0&&(t={}),T.assertIs(e,"text",["string"]),T.assertOrUndefined(t.color,"options.color",[[Object,"Color"]]),T.assertRangeOrUndefined(t.opacity,"opacity.opacity",0,1),T.assertOrUndefined(t.font,"options.font",[[fP.default,"PDFFont"]]),T.assertOrUndefined(t.size,"options.size",["number"]),T.assertOrUndefined(t.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(t.xSkew,"options.xSkew",[[Object,"Rotation"]]),T.assertOrUndefined(t.ySkew,"options.ySkew",[[Object,"Rotation"]]),T.assertOrUndefined(t.x,"options.x",["number"]),T.assertOrUndefined(t.y,"options.y",["number"]),T.assertOrUndefined(t.lineHeight,"options.lineHeight",["number"]),T.assertOrUndefined(t.maxWidth,"options.maxWidth",["number"]),T.assertOrUndefined(t.wordBreaks,"options.wordBreaks",[Array]),T.assertIsOneOfOrUndefined(t.blendMode,"options.blendMode",Bs.BlendMode);for(var d=this.setOrEmbedFont(t.font),c=d.oldFont,h=d.newFont,f=d.newFontKey,p=t.size||this.fontSize,g=t.wordBreaks||this.doc.defaultWordBreaks,v=function(S){return h.widthOfTextAtSize(S,p)},m=t.maxWidth===void 0?T.lineSplit(T.cleanText(e)):T.breakTextIntoLines(e,g,t.maxWidth,v),y=new Array(m.length),w=0,x=m.length;w<x;w++)y[w]=h.encodeText(m[w]);var b=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),A=this.getContentStream();A.push.apply(A,js.drawLinesOfText(y,{color:(n=t.color)!==null&&n!==void 0?n:this.fontColor,font:f,size:p,rotate:(i=t.rotate)!==null&&i!==void 0?i:or.degrees(0),xSkew:(s=t.xSkew)!==null&&s!==void 0?s:or.degrees(0),ySkew:(a=t.ySkew)!==null&&a!==void 0?a:or.degrees(0),x:(o=t.x)!==null&&o!==void 0?o:this.x,y:(l=t.y)!==null&&l!==void 0?l:this.y,lineHeight:(u=t.lineHeight)!==null&&u!==void 0?u:this.lineHeight,graphicsState:b})),t.font&&(c?this.setFont(c):this.resetFont())},r.prototype.drawImage=function(e,t){var n,i,s,a,o,l,u;t===void 0&&(t={}),T.assertIs(e,"image",[[dj.default,"PDFImage"]]),T.assertOrUndefined(t.x,"options.x",["number"]),T.assertOrUndefined(t.y,"options.y",["number"]),T.assertOrUndefined(t.width,"options.width",["number"]),T.assertOrUndefined(t.height,"options.height",["number"]),T.assertOrUndefined(t.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(t.xSkew,"options.xSkew",[[Object,"Rotation"]]),T.assertOrUndefined(t.ySkew,"options.ySkew",[[Object,"Rotation"]]),T.assertRangeOrUndefined(t.opacity,"opacity.opacity",0,1),T.assertIsOneOfOrUndefined(t.blendMode,"options.blendMode",Bs.BlendMode);var d=this.node.newXObject("Image",e.ref),c=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),h=this.getContentStream();h.push.apply(h,js.drawImage(d,{x:(n=t.x)!==null&&n!==void 0?n:this.x,y:(i=t.y)!==null&&i!==void 0?i:this.y,width:(s=t.width)!==null&&s!==void 0?s:e.size().width,height:(a=t.height)!==null&&a!==void 0?a:e.size().height,rotate:(o=t.rotate)!==null&&o!==void 0?o:or.degrees(0),xSkew:(l=t.xSkew)!==null&&l!==void 0?l:or.degrees(0),ySkew:(u=t.ySkew)!==null&&u!==void 0?u:or.degrees(0),graphicsState:c}))},r.prototype.drawPage=function(e,t){var n,i,s,a,o;t===void 0&&(t={}),T.assertIs(e,"embeddedPage",[[uj.default,"PDFEmbeddedPage"]]),T.assertOrUndefined(t.x,"options.x",["number"]),T.assertOrUndefined(t.y,"options.y",["number"]),T.assertOrUndefined(t.xScale,"options.xScale",["number"]),T.assertOrUndefined(t.yScale,"options.yScale",["number"]),T.assertOrUndefined(t.width,"options.width",["number"]),T.assertOrUndefined(t.height,"options.height",["number"]),T.assertOrUndefined(t.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(t.xSkew,"options.xSkew",[[Object,"Rotation"]]),T.assertOrUndefined(t.ySkew,"options.ySkew",[[Object,"Rotation"]]),T.assertRangeOrUndefined(t.opacity,"opacity.opacity",0,1),T.assertIsOneOfOrUndefined(t.blendMode,"options.blendMode",Bs.BlendMode);var l=this.node.newXObject("EmbeddedPdfPage",e.ref),u=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),d=t.width!==void 0?t.width/e.width:t.xScale!==void 0?t.xScale:1,c=t.height!==void 0?t.height/e.height:t.yScale!==void 0?t.yScale:1,h=this.getContentStream();h.push.apply(h,js.drawPage(l,{x:(n=t.x)!==null&&n!==void 0?n:this.x,y:(i=t.y)!==null&&i!==void 0?i:this.y,xScale:d,yScale:c,rotate:(s=t.rotate)!==null&&s!==void 0?s:or.degrees(0),xSkew:(a=t.xSkew)!==null&&a!==void 0?a:or.degrees(0),ySkew:(o=t.ySkew)!==null&&o!==void 0?o:or.degrees(0),graphicsState:u}))},r.prototype.drawSvgPath=function(e,t){var n,i,s,a,o,l,u,d,c;t===void 0&&(t={}),T.assertIs(e,"path",["string"]),T.assertOrUndefined(t.x,"options.x",["number"]),T.assertOrUndefined(t.y,"options.y",["number"]),T.assertOrUndefined(t.scale,"options.scale",["number"]),T.assertOrUndefined(t.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(t.borderWidth,"options.borderWidth",["number"]),T.assertOrUndefined(t.color,"options.color",[[Object,"Color"]]),T.assertRangeOrUndefined(t.opacity,"opacity.opacity",0,1),T.assertOrUndefined(t.borderColor,"options.borderColor",[[Object,"Color"]]),T.assertOrUndefined(t.borderDashArray,"options.borderDashArray",[Array]),T.assertOrUndefined(t.borderDashPhase,"options.borderDashPhase",["number"]),T.assertIsOneOfOrUndefined(t.borderLineCap,"options.borderLineCap",Ln.LineCapStyle),T.assertRangeOrUndefined(t.borderOpacity,"options.borderOpacity",0,1),T.assertIsOneOfOrUndefined(t.blendMode,"options.blendMode",Bs.BlendMode);var h=this.maybeEmbedGraphicsState({opacity:t.opacity,borderOpacity:t.borderOpacity,blendMode:t.blendMode});!("color"in t)&&!("borderColor"in t)&&(t.borderColor=Jl.rgb(0,0,0));var f=this.getContentStream();f.push.apply(f,js.drawSvgPath(e,{x:(n=t.x)!==null&&n!==void 0?n:this.x,y:(i=t.y)!==null&&i!==void 0?i:this.y,scale:t.scale,rotate:(s=t.rotate)!==null&&s!==void 0?s:or.degrees(0),color:(a=t.color)!==null&&a!==void 0?a:void 0,borderColor:(o=t.borderColor)!==null&&o!==void 0?o:void 0,borderWidth:(l=t.borderWidth)!==null&&l!==void 0?l:0,borderDashArray:(u=t.borderDashArray)!==null&&u!==void 0?u:void 0,borderDashPhase:(d=t.borderDashPhase)!==null&&d!==void 0?d:void 0,borderLineCap:(c=t.borderLineCap)!==null&&c!==void 0?c:void 0,graphicsState:h}))},r.prototype.drawLine=function(e){var t,n,i,s,a;T.assertIs(e.start,"options.start",[[Object,"{ x: number, y: number }"]]),T.assertIs(e.end,"options.end",[[Object,"{ x: number, y: number }"]]),T.assertIs(e.start.x,"options.start.x",["number"]),T.assertIs(e.start.y,"options.start.y",["number"]),T.assertIs(e.end.x,"options.end.x",["number"]),T.assertIs(e.end.y,"options.end.y",["number"]),T.assertOrUndefined(e.thickness,"options.thickness",["number"]),T.assertOrUndefined(e.color,"options.color",[[Object,"Color"]]),T.assertOrUndefined(e.dashArray,"options.dashArray",[Array]),T.assertOrUndefined(e.dashPhase,"options.dashPhase",["number"]),T.assertIsOneOfOrUndefined(e.lineCap,"options.lineCap",Ln.LineCapStyle),T.assertRangeOrUndefined(e.opacity,"opacity.opacity",0,1),T.assertIsOneOfOrUndefined(e.blendMode,"options.blendMode",Bs.BlendMode);var o=this.maybeEmbedGraphicsState({borderOpacity:e.opacity,blendMode:e.blendMode});"color"in e||(e.color=Jl.rgb(0,0,0));var l=this.getContentStream();l.push.apply(l,js.drawLine({start:e.start,end:e.end,thickness:(t=e.thickness)!==null&&t!==void 0?t:1,color:(n=e.color)!==null&&n!==void 0?n:void 0,dashArray:(i=e.dashArray)!==null&&i!==void 0?i:void 0,dashPhase:(s=e.dashPhase)!==null&&s!==void 0?s:void 0,lineCap:(a=e.lineCap)!==null&&a!==void 0?a:void 0,graphicsState:o}))},r.prototype.drawRectangle=function(e){var t,n,i,s,a,o,l,u,d,c,h,f,p;e===void 0&&(e={}),T.assertOrUndefined(e.x,"options.x",["number"]),T.assertOrUndefined(e.y,"options.y",["number"]),T.assertOrUndefined(e.width,"options.width",["number"]),T.assertOrUndefined(e.height,"options.height",["number"]),T.assertOrUndefined(e.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(e.xSkew,"options.xSkew",[[Object,"Rotation"]]),T.assertOrUndefined(e.ySkew,"options.ySkew",[[Object,"Rotation"]]),T.assertOrUndefined(e.borderWidth,"options.borderWidth",["number"]),T.assertOrUndefined(e.color,"options.color",[[Object,"Color"]]),T.assertRangeOrUndefined(e.opacity,"opacity.opacity",0,1),T.assertOrUndefined(e.borderColor,"options.borderColor",[[Object,"Color"]]),T.assertOrUndefined(e.borderDashArray,"options.borderDashArray",[Array]),T.assertOrUndefined(e.borderDashPhase,"options.borderDashPhase",["number"]),T.assertIsOneOfOrUndefined(e.borderLineCap,"options.borderLineCap",Ln.LineCapStyle),T.assertRangeOrUndefined(e.borderOpacity,"options.borderOpacity",0,1),T.assertIsOneOfOrUndefined(e.blendMode,"options.blendMode",Bs.BlendMode);var g=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!("color"in e)&&!("borderColor"in e)&&(e.color=Jl.rgb(0,0,0));var v=this.getContentStream();v.push.apply(v,js.drawRectangle({x:(t=e.x)!==null&&t!==void 0?t:this.x,y:(n=e.y)!==null&&n!==void 0?n:this.y,width:(i=e.width)!==null&&i!==void 0?i:150,height:(s=e.height)!==null&&s!==void 0?s:100,rotate:(a=e.rotate)!==null&&a!==void 0?a:or.degrees(0),xSkew:(o=e.xSkew)!==null&&o!==void 0?o:or.degrees(0),ySkew:(l=e.ySkew)!==null&&l!==void 0?l:or.degrees(0),borderWidth:(u=e.borderWidth)!==null&&u!==void 0?u:0,color:(d=e.color)!==null&&d!==void 0?d:void 0,borderColor:(c=e.borderColor)!==null&&c!==void 0?c:void 0,borderDashArray:(h=e.borderDashArray)!==null&&h!==void 0?h:void 0,borderDashPhase:(f=e.borderDashPhase)!==null&&f!==void 0?f:void 0,graphicsState:g,borderLineCap:(p=e.borderLineCap)!==null&&p!==void 0?p:void 0}))},r.prototype.drawSquare=function(e){e===void 0&&(e={});var t=e.size;T.assertOrUndefined(t,"size",["number"]),this.drawRectangle(Wi.__assign(Wi.__assign({},e),{width:t,height:t}))},r.prototype.drawEllipse=function(e){var t,n,i,s,a,o,l,u,d,c,h;e===void 0&&(e={}),T.assertOrUndefined(e.x,"options.x",["number"]),T.assertOrUndefined(e.y,"options.y",["number"]),T.assertOrUndefined(e.xScale,"options.xScale",["number"]),T.assertOrUndefined(e.yScale,"options.yScale",["number"]),T.assertOrUndefined(e.rotate,"options.rotate",[[Object,"Rotation"]]),T.assertOrUndefined(e.color,"options.color",[[Object,"Color"]]),T.assertRangeOrUndefined(e.opacity,"opacity.opacity",0,1),T.assertOrUndefined(e.borderColor,"options.borderColor",[[Object,"Color"]]),T.assertRangeOrUndefined(e.borderOpacity,"options.borderOpacity",0,1),T.assertOrUndefined(e.borderWidth,"options.borderWidth",["number"]),T.assertOrUndefined(e.borderDashArray,"options.borderDashArray",[Array]),T.assertOrUndefined(e.borderDashPhase,"options.borderDashPhase",["number"]),T.assertIsOneOfOrUndefined(e.borderLineCap,"options.borderLineCap",Ln.LineCapStyle),T.assertIsOneOfOrUndefined(e.blendMode,"options.blendMode",Bs.BlendMode);var f=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!("color"in e)&&!("borderColor"in e)&&(e.color=Jl.rgb(0,0,0));var p=this.getContentStream();p.push.apply(p,js.drawEllipse({x:(t=e.x)!==null&&t!==void 0?t:this.x,y:(n=e.y)!==null&&n!==void 0?n:this.y,xScale:(i=e.xScale)!==null&&i!==void 0?i:100,yScale:(s=e.yScale)!==null&&s!==void 0?s:100,rotate:(a=e.rotate)!==null&&a!==void 0?a:void 0,color:(o=e.color)!==null&&o!==void 0?o:void 0,borderColor:(l=e.borderColor)!==null&&l!==void 0?l:void 0,borderWidth:(u=e.borderWidth)!==null&&u!==void 0?u:0,borderDashArray:(d=e.borderDashArray)!==null&&d!==void 0?d:void 0,borderDashPhase:(c=e.borderDashPhase)!==null&&c!==void 0?c:void 0,borderLineCap:(h=e.borderLineCap)!==null&&h!==void 0?h:void 0,graphicsState:f}))},r.prototype.drawCircle=function(e){e===void 0&&(e={});var t=e.size,n=t===void 0?100:t;T.assertOrUndefined(n,"size",["number"]),this.drawEllipse(Wi.__assign(Wi.__assign({},e),{xScale:n,yScale:n}))},r.prototype.setOrEmbedFont=function(e){var t=this.font,n=this.fontKey;e?this.setFont(e):this.getFont();var i=this.font,s=this.fontKey;return{oldFont:t,oldFontKey:n,newFont:i,newFontKey:s}},r.prototype.getFont=function(){if(!this.font||!this.fontKey){var e=this.doc.embedStandardFont(cj.StandardFonts.Helvetica);this.setFont(e)}return[this.font,this.fontKey]},r.prototype.resetFont=function(){this.font=void 0,this.fontKey=void 0},r.prototype.getContentStream=function(e){return e===void 0&&(e=!0),e&&this.contentStream?this.contentStream:(this.contentStream=this.createContentStream(),this.contentStreamRef=this.doc.context.register(this.contentStream),this.node.addContentStream(this.contentStreamRef),this.contentStream)},r.prototype.createContentStream=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.doc.context.obj({}),i=Mt.PDFContentStream.of(n,e);return i},r.prototype.maybeEmbedGraphicsState=function(e){var t=e.opacity,n=e.borderOpacity,i=e.blendMode;if(!(t===void 0&&n===void 0&&i===void 0)){var s=this.doc.context.obj({Type:"ExtGState",ca:t,CA:n,BM:i}),a=this.node.newExtGState("GS",s);return a}},r.prototype.scaleAnnot=function(e,t,n){for(var i=["RD","CL","Vertices","QuadPoints","L","Rect"],s=0,a=i.length;s<a;s++){var o=e.lookup(Mt.PDFName.of(i[s]));o instanceof Mt.PDFArray&&o.scalePDFNumbers(t,n)}var l=e.lookup(Mt.PDFName.of("InkList"));if(l instanceof Mt.PDFArray)for(var s=0,a=l.size();s<a;s++){var u=l.lookup(s);u instanceof Mt.PDFArray&&u.scalePDFNumbers(t,n)}},r.of=function(e,t,n){return new r(e,t,n)},r.create=function(e){T.assertIs(e,"doc",[[hP.default,"PDFDocument"]]);var t=Mt.PDFRef.of(-1),n=Mt.PDFPageLeaf.withContextAndParent(e.context,t),i=e.context.register(n);return new r(n,i,e)},r}();ey.default=hj});var H0=E(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});var Ch=(j(),U(L)),fj=Ch.__importDefault(hi()),pP=Ch.__importDefault(di()),pj=gh(),gP=Vi(),mP=Ch.__importStar(ci()),vP=Wr(),gj=Or(),yP=St(),Us=ae(),mj=function(r){Ch.__extends(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return Us.assertIs(t,"acroButton",[[yP.PDFAcroPushButton,"PDFAcroPushButton"]]),s.acroField=t,s}return e.prototype.setImage=function(t,n){n===void 0&&(n=pj.ImageAlignment.Center);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s],l=this.createImageAppearanceStream(o,t,n);this.updateWidgetAppearances(o,{normal:l})}this.markAsClean()},e.prototype.setFontSize=function(t){Us.assertPositive(t,"fontSize"),this.acroField.setFontSize(t),this.markAsDirty()},e.prototype.addToPage=function(t,n,i){var s,a,o,l,u,d,c,h,f,p,g;Us.assertOrUndefined(t,"text",["string"]),Us.assertOrUndefined(n,"page",[[fj.default,"PDFPage"]]),mP.assertFieldAppearanceOptions(i);var v=this.createWidget({x:((s=i?.x)!==null&&s!==void 0?s:0)-((a=i?.borderWidth)!==null&&a!==void 0?a:0)/2,y:((o=i?.y)!==null&&o!==void 0?o:0)-((l=i?.borderWidth)!==null&&l!==void 0?l:0)/2,width:(u=i?.width)!==null&&u!==void 0?u:100,height:(d=i?.height)!==null&&d!==void 0?d:50,textColor:(c=i?.textColor)!==null&&c!==void 0?c:vP.rgb(0,0,0),backgroundColor:(h=i?.backgroundColor)!==null&&h!==void 0?h:vP.rgb(.75,.75,.75),borderColor:i?.borderColor,borderWidth:(f=i?.borderWidth)!==null&&f!==void 0?f:0,rotate:(p=i?.rotate)!==null&&p!==void 0?p:gj.degrees(0),caption:t,hidden:i?.hidden,page:n.ref}),m=this.doc.context.register(v.dict);this.acroField.addWidget(m);var y=(g=i?.font)!==null&&g!==void 0?g:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(v,y),n.node.addAnnot(m)},e.prototype.needsAppearancesUpdate=function(){var t;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,s=n.length;i<s;i++){var a=n[i],o=((t=a.getAppearances())===null||t===void 0?void 0:t.normal)instanceof yP.PDFStream;if(!o)return!0}return!1},e.prototype.defaultUpdateAppearances=function(t){Us.assertIs(t,"font",[[pP.default,"PDFFont"]]),this.updateAppearances(t)},e.prototype.updateAppearances=function(t,n){Us.assertIs(t,"font",[[pP.default,"PDFFont"]]),Us.assertOrUndefined(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),s=0,a=i.length;s<a;s++){var o=i[s];this.updateWidgetAppearance(o,t,n)}},e.prototype.updateWidgetAppearance=function(t,n,i){var s=i??gP.defaultButtonAppearanceProvider,a=gP.normalizeAppearance(s(this,t,n));this.updateWidgetAppearanceWithFont(t,n,a)},e.of=function(t,n,i){return new e(t,n,i)},e}(mP.default);ty.default=mj});var bP=E(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});var vj=(j(),U(L));vj.__exportStar(Vi(),Qr);var yj=H0();Object.defineProperty(Qr,"PDFButton",{enumerable:!0,get:function(){return yj.default}});var bj=S0();Object.defineProperty(Qr,"PDFCheckBox",{enumerable:!0,get:function(){return bj.default}});var wj=D0();Object.defineProperty(Qr,"PDFDropdown",{enumerable:!0,get:function(){return wj.default}});var xj=ci();Object.defineProperty(Qr,"PDFField",{enumerable:!0,get:function(){return xj.default}});var Aj=V0();Object.defineProperty(Qr,"PDFForm",{enumerable:!0,get:function(){return Aj.default}});var Sj=T0();Object.defineProperty(Qr,"PDFOptionList",{enumerable:!0,get:function(){return Sj.default}});var Pj=I0();Object.defineProperty(Qr,"PDFRadioGroup",{enumerable:!0,get:function(){return Pj.default}});var Fj=M0();Object.defineProperty(Qr,"PDFSignature",{enumerable:!0,get:function(){return Fj.default}});var Dj=U0();Object.defineProperty(Qr,"PDFTextField",{enumerable:!0,get:function(){return Dj.default}})});var xP=E(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var wP=(j(),U(L));wP.__exportStar(Vl(),Th);wP.__exportStar(l0(),Th)});var AP=E(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});var Lr=(j(),U(L));Lr.__exportStar(bP(),mt);Lr.__exportStar(xP(),mt);Lr.__exportStar(Wr(),mt);Lr.__exportStar(Qa(),mt);Lr.__exportStar(v0(),mt);Lr.__exportStar(nh(),mt);Lr.__exportStar(Ja(),mt);Lr.__exportStar(Bi(),mt);Lr.__exportStar(Or(),mt);Lr.__exportStar(G0(),mt);Lr.__exportStar($0(),mt);Lr.__exportStar(W0(),mt);Lr.__exportStar(wh(),mt);var Ej=Hi();Object.defineProperty(mt,"PDFDocument",{enumerable:!0,get:function(){return Ej.default}});var Cj=di();Object.defineProperty(mt,"PDFFont",{enumerable:!0,get:function(){return Cj.default}});var Tj=ph();Object.defineProperty(mt,"PDFImage",{enumerable:!0,get:function(){return Tj.default}});var kj=hi();Object.defineProperty(mt,"PDFPage",{enumerable:!0,get:function(){return kj.default}});var Rj=hh();Object.defineProperty(mt,"PDFEmbeddedPage",{enumerable:!0,get:function(){return Rj.default}});var _j=Y0();Object.defineProperty(mt,"PDFJavaScript",{enumerable:!0,get:function(){return _j.default}})});var PP=E(SP=>{"use strict";Object.defineProperty(SP,"__esModule",{value:!0})});var FP=E(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});var kh=(j(),U(L));kh.__exportStar(AP(),so);kh.__exportStar(St(),so);kh.__exportStar(PP(),so);kh.__exportStar(ae(),so)});var WP=jr(require("node:path")),KP=require("node:readline");var Oh=class extends Error{constructor(e="cancelled"){super(e),this.name="CancelledError"}};function ly(r){if(r?.aborted)throw new Oh}var uy=r=>void Promise.resolve().then(r),dy=uy;function cy(r){dy=r??uy}function tF(){return new Promise(r=>dy(r))}function hy(r=24,e=()=>Date.now()){let t=e();return{async tick(){e()-t>=r&&(await tF(),t=e())}}}var fy=Promise;typeof fy.withResolvers!="function"&&(fy.withResolvers=function(){let r,e;return{promise:new Promise((n,i)=>{r=n,e=i}),resolve:r,reject:e}});var Uy={},rF={9306:(r,e,t)=>{var n=t(4901),i=t(6823),s=TypeError;r.exports=function(a){if(n(a))return a;throw new s(i(a)+" is not a function")}},3506:(r,e,t)=>{var n=t(3925),i=String,s=TypeError;r.exports=function(a){if(n(a))return a;throw new s("Can't set "+i(a)+" as a prototype")}},7080:(r,e,t)=>{var n=t(4402).has;r.exports=function(i){return n(i),i}},679:(r,e,t)=>{var n=t(1625),i=TypeError;r.exports=function(s,a){if(n(a,s))return s;throw new i("Incorrect invocation")}},8551:(r,e,t)=>{var n=t(34),i=String,s=TypeError;r.exports=function(a){if(n(a))return a;throw new s(i(a)+" is not an object")}},7811:r=>{r.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394:(r,e,t)=>{var n=t(4576),i=t(6706),s=t(2195),a=n.ArrayBuffer,o=n.TypeError;r.exports=a&&i(a.prototype,"byteLength","get")||function(l){if(s(l)!=="ArrayBuffer")throw new o("ArrayBuffer expected");return l.byteLength}},3238:(r,e,t)=>{var n=t(4576),i=t(7476),s=t(7394),a=n.ArrayBuffer,o=a&&a.prototype,l=o&&i(o.slice);r.exports=function(u){if(s(u)!==0||!l)return!1;try{return l(u,0,0),!1}catch{return!0}}},5169:(r,e,t)=>{var n=t(3238),i=TypeError;r.exports=function(s){if(n(s))throw new i("ArrayBuffer is detached");return s}},5636:(r,e,t)=>{var n=t(4576),i=t(9504),s=t(6706),a=t(7696),o=t(5169),l=t(7394),u=t(4483),d=t(1548),c=n.structuredClone,h=n.ArrayBuffer,f=n.DataView,p=Math.min,g=h.prototype,v=f.prototype,m=i(g.slice),y=s(g,"resizable","get"),w=s(g,"maxByteLength","get"),x=i(v.getInt8),b=i(v.setInt8);r.exports=(d||u)&&function(A,S,P){var F=l(A),k=S===void 0?F:a(S),D=!y||!y(A),_;if(o(A),d&&(A=c(A,{transfer:[A]}),F===k&&(P||D)))return A;if(F>=k&&(!P||D))_=m(A,0,k);else{var B=P&&!D&&w?{maxByteLength:w(A)}:void 0;_=new h(k,B);for(var N=new f(A),G=new f(_),O=p(k,F),R=0;R<O;R++)b(G,R,x(N,R))}return d||u(A),_}},4644:(r,e,t)=>{var n=t(7811),i=t(3724),s=t(4576),a=t(4901),o=t(34),l=t(9297),u=t(6955),d=t(6823),c=t(6699),h=t(6840),f=t(2106),p=t(1625),g=t(2787),v=t(2967),m=t(8227),y=t(3392),w=t(1181),x=w.enforce,b=w.get,A=s.Int8Array,S=A&&A.prototype,P=s.Uint8ClampedArray,F=P&&P.prototype,k=A&&g(A),D=S&&g(S),_=Object.prototype,B=s.TypeError,N=m("toStringTag"),G=y("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",R=n&&!!v&&u(s.opera)!=="Opera",J=!1,le,_e,Be,we={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ye={BigInt64Array:8,BigUint64Array:8},$r=function(Ye){if(!o(Ye))return!1;var Ke=u(Ye);return Ke==="DataView"||l(we,Ke)||l(ye,Ke)},Ht=function(K){var Ye=g(K);if(o(Ye)){var Ke=b(Ye);return Ke&&l(Ke,O)?Ke[O]:Ht(Ye)}},W=function(K){if(!o(K))return!1;var Ye=u(K);return l(we,Ye)||l(ye,Ye)},M=function(K){if(W(K))return K;throw new B("Target is not a typed array")},H=function(K){if(a(K)&&(!v||p(k,K)))return K;throw new B(d(K)+" is not a typed array constructor")},ue=function(K,Ye,Ke,pn){if(i){if(Ke)for(var er in we){var Rt=s[er];if(Rt&&l(Rt.prototype,K))try{delete Rt.prototype[K]}catch{try{Rt.prototype[K]=Ye}catch{}}}(!D[K]||Ke)&&h(D,K,Ke?Ye:R&&S[K]||Ye,pn)}},Te=function(K,Ye,Ke){var pn,er;if(i){if(v){if(Ke){for(pn in we)if(er=s[pn],er&&l(er,K))try{delete er[K]}catch{}}if(!k[K]||Ke)try{return h(k,K,Ke?Ye:R&&k[K]||Ye)}catch{}else return}for(pn in we)er=s[pn],er&&(!er[K]||Ke)&&h(er,K,Ye)}};for(le in we)_e=s[le],Be=_e&&_e.prototype,Be?x(Be)[O]=_e:R=!1;for(le in ye)_e=s[le],Be=_e&&_e.prototype,Be&&(x(Be)[O]=_e);if((!R||!a(k)||k===Function.prototype)&&(k=function(){throw new B("Incorrect invocation")},R))for(le in we)s[le]&&v(s[le],k);if((!R||!D||D===_)&&(D=k.prototype,R))for(le in we)s[le]&&v(s[le].prototype,D);if(R&&g(F)!==D&&v(F,D),i&&!l(D,N)){J=!0,f(D,N,{configurable:!0,get:function(){return o(this)?this[G]:void 0}});for(le in we)s[le]&&c(s[le],G,le)}r.exports={NATIVE_ARRAY_BUFFER_VIEWS:R,TYPED_ARRAY_TAG:J&&G,aTypedArray:M,aTypedArrayConstructor:H,exportTypedArrayMethod:ue,exportTypedArrayStaticMethod:Te,getTypedArrayConstructor:Ht,isView:$r,isTypedArray:W,TypedArray:k,TypedArrayPrototype:D}},5370:(r,e,t)=>{var n=t(6198);r.exports=function(i,s,a){for(var o=0,l=arguments.length>2?a:n(s),u=new i(l);l>o;)u[o]=s[o++];return u}},9617:(r,e,t)=>{var n=t(5397),i=t(5610),s=t(6198),a=function(o){return function(l,u,d){var c=n(l),h=s(c);if(h===0)return!o&&-1;var f=i(d,h),p;if(o&&u!==u){for(;h>f;)if(p=c[f++],p!==p)return!0}else for(;h>f;f++)if((o||f in c)&&c[f]===u)return o||f||0;return!o&&-1}};r.exports={includes:a(!0),indexOf:a(!1)}},4527:(r,e,t)=>{var n=t(3724),i=t(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,o=n&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(l){return l instanceof TypeError}}();r.exports=o?function(l,u){if(i(l)&&!a(l,"length").writable)throw new s("Cannot set read only .length");return l.length=u}:function(l,u){return l.length=u}},7680:(r,e,t)=>{var n=t(9504);r.exports=n([].slice)},7628:(r,e,t)=>{var n=t(6198);r.exports=function(i,s){for(var a=n(i),o=new s(a),l=0;l<a;l++)o[l]=i[a-l-1];return o}},9928:(r,e,t)=>{var n=t(6198),i=t(1291),s=RangeError;r.exports=function(a,o,l,u){var d=n(a),c=i(l),h=c<0?d+c:c;if(h>=d||h<0)throw new s("Incorrect index");for(var f=new o(d),p=0;p<d;p++)f[p]=p===h?u:a[p];return f}},6319:(r,e,t)=>{var n=t(8551),i=t(9539);r.exports=function(s,a,o,l){try{return l?a(n(o)[0],o[1]):a(o)}catch(u){i(s,"throw",u)}}},2195:(r,e,t)=>{var n=t(9504),i=n({}.toString),s=n("".slice);r.exports=function(a){return s(i(a),8,-1)}},6955:(r,e,t)=>{var n=t(2140),i=t(4901),s=t(2195),a=t(8227),o=a("toStringTag"),l=Object,u=s(function(){return arguments}())==="Arguments",d=function(c,h){try{return c[h]}catch{}};r.exports=n?s:function(c){var h,f,p;return c===void 0?"Undefined":c===null?"Null":typeof(f=d(h=l(c),o))=="string"?f:u?s(h):(p=s(h))==="Object"&&i(h.callee)?"Arguments":p}},7740:(r,e,t)=>{var n=t(9297),i=t(5031),s=t(7347),a=t(4913);r.exports=function(o,l,u){for(var d=i(l),c=a.f,h=s.f,f=0;f<d.length;f++){var p=d[f];!n(o,p)&&!(u&&n(u,p))&&c(o,p,h(l,p))}}},2211:(r,e,t)=>{var n=t(9039);r.exports=!n(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})},2529:r=>{r.exports=function(e,t){return{value:e,done:t}}},6699:(r,e,t)=>{var n=t(3724),i=t(4913),s=t(6980);r.exports=n?function(a,o,l){return i.f(a,o,s(1,l))}:function(a,o,l){return a[o]=l,a}},6980:r=>{r.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},4659:(r,e,t)=>{var n=t(3724),i=t(4913),s=t(6980);r.exports=function(a,o,l){n?i.f(a,o,s(0,l)):a[o]=l}},2106:(r,e,t)=>{var n=t(283),i=t(4913);r.exports=function(s,a,o){return o.get&&n(o.get,a,{getter:!0}),o.set&&n(o.set,a,{setter:!0}),i.f(s,a,o)}},6840:(r,e,t)=>{var n=t(4901),i=t(4913),s=t(283),a=t(9433);r.exports=function(o,l,u,d){d||(d={});var c=d.enumerable,h=d.name!==void 0?d.name:l;if(n(u)&&s(u,h,d),d.global)c?o[l]=u:a(l,u);else{try{d.unsafe?o[l]&&(c=!0):delete o[l]}catch{}c?o[l]=u:i.f(o,l,{value:u,enumerable:!1,configurable:!d.nonConfigurable,writable:!d.nonWritable})}return o}},6279:(r,e,t)=>{var n=t(6840);r.exports=function(i,s,a){for(var o in s)n(i,o,s[o],a);return i}},9433:(r,e,t)=>{var n=t(4576),i=Object.defineProperty;r.exports=function(s,a){try{i(n,s,{value:a,configurable:!0,writable:!0})}catch{n[s]=a}return a}},3724:(r,e,t)=>{var n=t(9039);r.exports=!n(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483:(r,e,t)=>{var n=t(4576),i=t(9429),s=t(1548),a=n.structuredClone,o=n.ArrayBuffer,l=n.MessageChannel,u=!1,d,c,h,f;if(s)u=function(p){a(p,{transfer:[p]})};else if(o)try{l||(d=i("worker_threads"),d&&(l=d.MessageChannel)),l&&(c=new l,h=new o(2),f=function(p){c.port1.postMessage(null,[p])},h.byteLength===2&&(f(h),h.byteLength===0&&(u=f)))}catch{}r.exports=u},4055:(r,e,t)=>{var n=t(4576),i=t(34),s=n.document,a=i(s)&&i(s.createElement);r.exports=function(o){return a?s.createElement(o):{}}},6837:r=>{var e=TypeError,t=9007199254740991;r.exports=function(n){if(n>t)throw e("Maximum allowed index exceeded");return n}},5002:r=>{r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727:r=>{r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:(r,e,t)=>{var n=t(4215);r.exports=n==="NODE"},2839:(r,e,t)=>{var n=t(4576),i=n.navigator,s=i&&i.userAgent;r.exports=s?String(s):""},9519:(r,e,t)=>{var n=t(4576),i=t(2839),s=n.process,a=n.Deno,o=s&&s.versions||a&&a.version,l=o&&o.v8,u,d;l&&(u=l.split("."),d=u[0]>0&&u[0]<4?1:+(u[0]+u[1])),!d&&i&&(u=i.match(/Edge\/(\d+)/),(!u||u[1]>=74)&&(u=i.match(/Chrome\/(\d+)/),u&&(d=+u[1]))),r.exports=d},4215:(r,e,t)=>{var n=t(4576),i=t(2839),s=t(2195),a=function(o){return i.slice(0,o.length)===o};r.exports=function(){return a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&typeof Bun.version=="string"?"BUN":n.Deno&&typeof Deno.version=="object"?"DENO":s(n.process)==="process"?"NODE":n.window&&n.document?"BROWSER":"REST"}()},8574:(r,e,t)=>{var n=t(9504),i=Error,s=n("".replace),a=function(u){return String(new i(u).stack)}("zxcasd"),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);r.exports=function(u,d){if(l&&typeof u=="string"&&!i.prepareStackTrace)for(;d--;)u=s(u,o,"");return u}},6518:(r,e,t)=>{var n=t(4576),i=t(7347).f,s=t(6699),a=t(6840),o=t(9433),l=t(7740),u=t(2796);r.exports=function(d,c){var h=d.target,f=d.global,p=d.stat,g,v,m,y,w,x;if(f?v=n:p?v=n[h]||o(h,{}):v=n[h]&&n[h].prototype,v)for(m in c){if(w=c[m],d.dontCallGetSet?(x=i(v,m),y=x&&x.value):y=v[m],g=u(f?m:h+(p?".":"#")+m,d.forced),!g&&y!==void 0){if(typeof w==typeof y)continue;l(w,y)}(d.sham||y&&y.sham)&&s(w,"sham",!0),a(v,m,w,d)}}},9039:r=>{r.exports=function(e){try{return!!e()}catch{return!0}}},8745:(r,e,t)=>{var n=t(616),i=Function.prototype,s=i.apply,a=i.call;r.exports=typeof Reflect=="object"&&Reflect.apply||(n?a.bind(s):function(){return a.apply(s,arguments)})},6080:(r,e,t)=>{var n=t(7476),i=t(9306),s=t(616),a=n(n.bind);r.exports=function(o,l){return i(o),l===void 0?o:s?a(o,l):function(){return o.apply(l,arguments)}}},616:(r,e,t)=>{var n=t(9039);r.exports=!n(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")})},9565:(r,e,t)=>{var n=t(616),i=Function.prototype.call;r.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},350:(r,e,t)=>{var n=t(3724),i=t(9297),s=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=i(s,"name"),l=o&&function(){}.name==="something",u=o&&(!n||n&&a(s,"name").configurable);r.exports={EXISTS:o,PROPER:l,CONFIGURABLE:u}},6706:(r,e,t)=>{var n=t(9504),i=t(9306);r.exports=function(s,a,o){try{return n(i(Object.getOwnPropertyDescriptor(s,a)[o]))}catch{}}},7476:(r,e,t)=>{var n=t(2195),i=t(9504);r.exports=function(s){if(n(s)==="Function")return i(s)}},9504:(r,e,t)=>{var n=t(616),i=Function.prototype,s=i.call,a=n&&i.bind.bind(s,s);r.exports=n?a:function(o){return function(){return s.apply(o,arguments)}}},9429:(r,e,t)=>{var n=t(4576),i=t(6193);r.exports=function(s){if(i){try{return n.process.getBuiltinModule(s)}catch{}try{return Function('return require("'+s+'")')()}catch{}}}},7751:(r,e,t)=>{var n=t(4576),i=t(4901),s=function(a){return i(a)?a:void 0};r.exports=function(a,o){return arguments.length<2?s(n[a]):n[a]&&n[a][o]}},1767:r=>{r.exports=function(e){return{iterator:e,next:e.next,done:!1}}},8646:(r,e,t)=>{var n=t(9565),i=t(8551),s=t(1767),a=t(851);r.exports=function(o,l){(!l||typeof o!="string")&&i(o);var u=a(o);return s(i(u!==void 0?n(u,o):o))}},851:(r,e,t)=>{var n=t(6955),i=t(5966),s=t(4117),a=t(6269),o=t(8227),l=o("iterator");r.exports=function(u){if(!s(u))return i(u,l)||i(u,"@@iterator")||a[n(u)]}},81:(r,e,t)=>{var n=t(9565),i=t(9306),s=t(8551),a=t(6823),o=t(851),l=TypeError;r.exports=function(u,d){var c=arguments.length<2?o(u):d;if(i(c))return s(n(c,u));throw new l(a(u)+" is not iterable")}},5966:(r,e,t)=>{var n=t(9306),i=t(4117);r.exports=function(s,a){var o=s[a];return i(o)?void 0:n(o)}},3789:(r,e,t)=>{var n=t(9306),i=t(8551),s=t(9565),a=t(1291),o=t(1767),l="Invalid size",u=RangeError,d=TypeError,c=Math.max,h=function(f,p){this.set=f,this.size=c(p,0),this.has=n(f.has),this.keys=n(f.keys)};h.prototype={getIterator:function(){return o(i(s(this.keys,this.set)))},includes:function(f){return s(this.has,this.set,f)}},r.exports=function(f){i(f);var p=+f.size;if(p!==p)throw new d(l);var g=a(p);if(g<0)throw new u(l);return new h(f,g)}},4576:function(r){var e=function(t){return t&&t.Math===Math&&t};r.exports=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof global=="object"&&global)||e(typeof this=="object"&&this)||function(){return this}()||Function("return this")()},9297:(r,e,t)=>{var n=t(9504),i=t(8981),s=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(o,l){return s(i(o),l)}},421:r=>{r.exports={}},397:(r,e,t)=>{var n=t(7751);r.exports=n("document","documentElement")},5917:(r,e,t)=>{var n=t(3724),i=t(9039),s=t(4055);r.exports=!n&&!i(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!==7})},7055:(r,e,t)=>{var n=t(9504),i=t(9039),s=t(2195),a=Object,o=n("".split);r.exports=i(function(){return!a("z").propertyIsEnumerable(0)})?function(l){return s(l)==="String"?o(l,""):a(l)}:a},3167:(r,e,t)=>{var n=t(4901),i=t(34),s=t(2967);r.exports=function(a,o,l){var u,d;return s&&n(u=o.constructor)&&u!==l&&i(d=u.prototype)&&d!==l.prototype&&s(a,d),a}},3706:(r,e,t)=>{var n=t(9504),i=t(4901),s=t(7629),a=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(o){return a(o)}),r.exports=s.inspectSource},1181:(r,e,t)=>{var n=t(8622),i=t(4576),s=t(34),a=t(6699),o=t(9297),l=t(7629),u=t(6119),d=t(421),c="Object already initialized",h=i.TypeError,f=i.WeakMap,p,g,v,m=function(b){return v(b)?g(b):p(b,{})},y=function(b){return function(A){var S;if(!s(A)||(S=g(A)).type!==b)throw new h("Incompatible receiver, "+b+" required");return S}};if(n||l.state){var w=l.state||(l.state=new f);w.get=w.get,w.has=w.has,w.set=w.set,p=function(b,A){if(w.has(b))throw new h(c);return A.facade=b,w.set(b,A),A},g=function(b){return w.get(b)||{}},v=function(b){return w.has(b)}}else{var x=u("state");d[x]=!0,p=function(b,A){if(o(b,x))throw new h(c);return A.facade=b,a(b,x,A),A},g=function(b){return o(b,x)?b[x]:{}},v=function(b){return o(b,x)}}r.exports={set:p,get:g,has:v,enforce:m,getterFor:y}},4209:(r,e,t)=>{var n=t(8227),i=t(6269),s=n("iterator"),a=Array.prototype;r.exports=function(o){return o!==void 0&&(i.Array===o||a[s]===o)}},4376:(r,e,t)=>{var n=t(2195);r.exports=Array.isArray||function(s){return n(s)==="Array"}},1108:(r,e,t)=>{var n=t(6955);r.exports=function(i){var s=n(i);return s==="BigInt64Array"||s==="BigUint64Array"}},4901:r=>{var e=typeof document=="object"&&document.all;r.exports=typeof e>"u"&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"}},2796:(r,e,t)=>{var n=t(9039),i=t(4901),s=/#|\.prototype\./,a=function(c,h){var f=l[o(c)];return f===d?!0:f===u?!1:i(h)?n(h):!!h},o=a.normalize=function(c){return String(c).replace(s,".").toLowerCase()},l=a.data={},u=a.NATIVE="N",d=a.POLYFILL="P";r.exports=a},4117:r=>{r.exports=function(e){return e==null}},34:(r,e,t)=>{var n=t(4901);r.exports=function(i){return typeof i=="object"?i!==null:n(i)}},3925:(r,e,t)=>{var n=t(34);r.exports=function(i){return n(i)||i===null}},6395:r=>{r.exports=!1},757:(r,e,t)=>{var n=t(7751),i=t(4901),s=t(1625),a=t(7040),o=Object;r.exports=a?function(l){return typeof l=="symbol"}:function(l){var u=n("Symbol");return i(u)&&s(u.prototype,o(l))}},507:(r,e,t)=>{var n=t(9565);r.exports=function(i,s,a){for(var o=a?i:i.iterator,l=i.next,u,d;!(u=n(l,o)).done;)if(d=s(u.value),d!==void 0)return d}},2652:(r,e,t)=>{var n=t(6080),i=t(9565),s=t(8551),a=t(6823),o=t(4209),l=t(6198),u=t(1625),d=t(81),c=t(851),h=t(9539),f=TypeError,p=function(v,m){this.stopped=v,this.result=m},g=p.prototype;r.exports=function(v,m,y){var w=y&&y.that,x=!!(y&&y.AS_ENTRIES),b=!!(y&&y.IS_RECORD),A=!!(y&&y.IS_ITERATOR),S=!!(y&&y.INTERRUPTED),P=n(m,w),F,k,D,_,B,N,G,O=function(J){return F&&h(F,"normal",J),new p(!0,J)},R=function(J){return x?(s(J),S?P(J[0],J[1],O):P(J[0],J[1])):S?P(J,O):P(J)};if(b)F=v.iterator;else if(A)F=v;else{if(k=c(v),!k)throw new f(a(v)+" is not iterable");if(o(k)){for(D=0,_=l(v);_>D;D++)if(B=R(v[D]),B&&u(g,B))return B;return new p(!1)}F=d(v,k)}for(N=b?v.next:F.next;!(G=i(N,F)).done;){try{B=R(G.value)}catch(J){h(F,"throw",J)}if(typeof B=="object"&&B&&u(g,B))return B}return new p(!1)}},9539:(r,e,t)=>{var n=t(9565),i=t(8551),s=t(5966);r.exports=function(a,o,l){var u,d;i(a);try{if(u=s(a,"return"),!u){if(o==="throw")throw l;return l}u=n(u,a)}catch(c){d=!0,u=c}if(o==="throw")throw l;if(d)throw u;return i(u),l}},9462:(r,e,t)=>{var n=t(9565),i=t(2360),s=t(6699),a=t(6279),o=t(8227),l=t(1181),u=t(5966),d=t(7657).IteratorPrototype,c=t(2529),h=t(9539),f=o("toStringTag"),p="IteratorHelper",g="WrapForValidIterator",v=l.set,m=function(x){var b=l.getterFor(x?g:p);return a(i(d),{next:function(){var S=b(this);if(x)return S.nextHandler();try{var P=S.done?void 0:S.nextHandler();return c(P,S.done)}catch(F){throw S.done=!0,F}},return:function(){var A=b(this),S=A.iterator;if(A.done=!0,x){var P=u(S,"return");return P?n(P,S):c(void 0,!0)}if(A.inner)try{h(A.inner.iterator,"normal")}catch(F){return h(S,"throw",F)}return S&&h(S,"normal"),c(void 0,!0)}})},y=m(!0),w=m(!1);s(w,f,"Iterator Helper"),r.exports=function(x,b){var A=function(P,F){F?(F.iterator=P.iterator,F.next=P.next):F=P,F.type=b?g:p,F.nextHandler=x,F.counter=0,F.done=!1,v(this,F)};return A.prototype=b?y:w,A}},713:(r,e,t)=>{var n=t(9565),i=t(9306),s=t(8551),a=t(1767),o=t(9462),l=t(6319),u=o(function(){var d=this.iterator,c=s(n(this.next,d)),h=this.done=!!c.done;if(!h)return l(d,this.mapper,[c.value,this.counter++],!0)});r.exports=function(c){return s(this),i(c),new u(a(this),{mapper:c})}},7657:(r,e,t)=>{var n=t(9039),i=t(4901),s=t(34),a=t(2360),o=t(2787),l=t(6840),u=t(8227),d=t(6395),c=u("iterator"),h=!1,f,p,g;[].keys&&(g=[].keys(),"next"in g?(p=o(o(g)),p!==Object.prototype&&(f=p)):h=!0);var v=!s(f)||n(function(){var m={};return f[c].call(m)!==m});v?f={}:d&&(f=a(f)),i(f[c])||l(f,c,function(){return this}),r.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:h}},6269:r=>{r.exports={}},6198:(r,e,t)=>{var n=t(8014);r.exports=function(i){return n(i.length)}},283:(r,e,t)=>{var n=t(9504),i=t(9039),s=t(4901),a=t(9297),o=t(3724),l=t(350).CONFIGURABLE,u=t(3706),d=t(1181),c=d.enforce,h=d.get,f=String,p=Object.defineProperty,g=n("".slice),v=n("".replace),m=n([].join),y=o&&!i(function(){return p(function(){},"length",{value:8}).length!==8}),w=String(String).split("String"),x=r.exports=function(b,A,S){g(f(A),0,7)==="Symbol("&&(A="["+v(f(A),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),S&&S.getter&&(A="get "+A),S&&S.setter&&(A="set "+A),(!a(b,"name")||l&&b.name!==A)&&(o?p(b,"name",{value:A,configurable:!0}):b.name=A),y&&S&&a(S,"arity")&&b.length!==S.arity&&p(b,"length",{value:S.arity});try{S&&a(S,"constructor")&&S.constructor?o&&p(b,"prototype",{writable:!1}):b.prototype&&(b.prototype=void 0)}catch{}var P=c(b);return a(P,"source")||(P.source=m(w,typeof A=="string"?A:"")),b};Function.prototype.toString=x(function(){return s(this)&&h(this).source||u(this)},"toString")},741:r=>{var e=Math.ceil,t=Math.floor;r.exports=Math.trunc||function(i){var s=+i;return(s>0?t:e)(s)}},6043:(r,e,t)=>{var n=t(9306),i=TypeError,s=function(a){var o,l;this.promise=new a(function(u,d){if(o!==void 0||l!==void 0)throw new i("Bad Promise constructor");o=u,l=d}),this.resolve=n(o),this.reject=n(l)};r.exports.f=function(a){return new s(a)}},2603:(r,e,t)=>{var n=t(655);r.exports=function(i,s){return i===void 0?arguments.length<2?"":s:n(i)}},4149:r=>{var e=RangeError;r.exports=function(t){if(t===t)return t;throw new e("NaN is not allowed")}},2360:(r,e,t)=>{var n=t(8551),i=t(6801),s=t(8727),a=t(421),o=t(397),l=t(4055),u=t(6119),d=">",c="<",h="prototype",f="script",p=u("IE_PROTO"),g=function(){},v=function(b){return c+f+d+b+c+"/"+f+d},m=function(b){b.write(v("")),b.close();var A=b.parentWindow.Object;return b=null,A},y=function(){var b=l("iframe"),A="java"+f+":",S;return b.style.display="none",o.appendChild(b),b.src=String(A),S=b.contentWindow.document,S.open(),S.write(v("document.F=Object")),S.close(),S.F},w,x=function(){try{w=new ActiveXObject("htmlfile")}catch{}x=typeof document<"u"?document.domain&&w?m(w):y():m(w);for(var b=s.length;b--;)delete x[h][s[b]];return x()};a[p]=!0,r.exports=Object.create||function(A,S){var P;return A!==null?(g[h]=n(A),P=new g,g[h]=null,P[p]=A):P=x(),S===void 0?P:i.f(P,S)}},6801:(r,e,t)=>{var n=t(3724),i=t(8686),s=t(4913),a=t(8551),o=t(5397),l=t(1072);e.f=n&&!i?Object.defineProperties:function(d,c){a(d);for(var h=o(c),f=l(c),p=f.length,g=0,v;p>g;)s.f(d,v=f[g++],h[v]);return d}},4913:(r,e,t)=>{var n=t(3724),i=t(5917),s=t(8686),a=t(8551),o=t(6969),l=TypeError,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",h="configurable",f="writable";e.f=n?s?function(g,v,m){if(a(g),v=o(v),a(m),typeof g=="function"&&v==="prototype"&&"value"in m&&f in m&&!m[f]){var y=d(g,v);y&&y[f]&&(g[v]=m.value,m={configurable:h in m?m[h]:y[h],enumerable:c in m?m[c]:y[c],writable:!1})}return u(g,v,m)}:u:function(g,v,m){if(a(g),v=o(v),a(m),i)try{return u(g,v,m)}catch{}if("get"in m||"set"in m)throw new l("Accessors not supported");return"value"in m&&(g[v]=m.value),g}},7347:(r,e,t)=>{var n=t(3724),i=t(9565),s=t(8773),a=t(6980),o=t(5397),l=t(6969),u=t(9297),d=t(5917),c=Object.getOwnPropertyDescriptor;e.f=n?c:function(f,p){if(f=o(f),p=l(p),d)try{return c(f,p)}catch{}if(u(f,p))return a(!i(s.f,f,p),f[p])}},8480:(r,e,t)=>{var n=t(1828),i=t(8727),s=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(o){return n(o,s)}},3717:(r,e)=>{e.f=Object.getOwnPropertySymbols},2787:(r,e,t)=>{var n=t(9297),i=t(4901),s=t(8981),a=t(6119),o=t(2211),l=a("IE_PROTO"),u=Object,d=u.prototype;r.exports=o?u.getPrototypeOf:function(c){var h=s(c);if(n(h,l))return h[l];var f=h.constructor;return i(f)&&h instanceof f?f.prototype:h instanceof u?d:null}},1625:(r,e,t)=>{var n=t(9504);r.exports=n({}.isPrototypeOf)},1828:(r,e,t)=>{var n=t(9504),i=t(9297),s=t(5397),a=t(9617).indexOf,o=t(421),l=n([].push);r.exports=function(u,d){var c=s(u),h=0,f=[],p;for(p in c)!i(o,p)&&i(c,p)&&l(f,p);for(;d.length>h;)i(c,p=d[h++])&&(~a(f,p)||l(f,p));return f}},1072:(r,e,t)=>{var n=t(1828),i=t(8727);r.exports=Object.keys||function(a){return n(a,i)}},8773:(r,e)=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!t.call({1:2},1);e.f=i?function(a){var o=n(this,a);return!!o&&o.enumerable}:t},2967:(r,e,t)=>{var n=t(6706),i=t(34),s=t(7750),a=t(3506);r.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var o=!1,l={},u;try{u=n(Object.prototype,"__proto__","set"),u(l,[]),o=l instanceof Array}catch{}return function(c,h){return s(c),a(h),i(c)&&(o?u(c,h):c.__proto__=h),c}}():void 0)},4270:(r,e,t)=>{var n=t(9565),i=t(4901),s=t(34),a=TypeError;r.exports=function(o,l){var u,d;if(l==="string"&&i(u=o.toString)&&!s(d=n(u,o))||i(u=o.valueOf)&&!s(d=n(u,o))||l!=="string"&&i(u=o.toString)&&!s(d=n(u,o)))return d;throw new a("Can't convert object to primitive value")}},5031:(r,e,t)=>{var n=t(7751),i=t(9504),s=t(8480),a=t(3717),o=t(8551),l=i([].concat);r.exports=n("Reflect","ownKeys")||function(d){var c=s.f(o(d)),h=a.f;return h?l(c,h(d)):c}},8235:(r,e,t)=>{var n=t(9504),i=t(9297),s=SyntaxError,a=parseInt,o=String.fromCharCode,l=n("".charAt),u=n("".slice),d=n(/./.exec),c={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
57
|
+
`,"\\r":"\r","\\t":" "},h=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;r.exports=function(p,g){for(var v=!0,m="";g<p.length;){var y=l(p,g);if(y==="\\"){var w=u(p,g,g+2);if(i(c,w))m+=c[w],g+=2;else if(w==="\\u"){g+=2;var x=u(p,g,g+4);if(!d(h,x))throw new s("Bad Unicode escape at: "+g);m+=o(a(x,16)),g+=4}else throw new s('Unknown escape sequence: "'+w+'"')}else if(y==='"'){v=!1,g++;break}else{if(d(f,y))throw new s("Bad control character in string literal at: "+g);m+=y,g++}}if(v)throw new s("Unterminated string at: "+g);return{value:m,end:g}}},1103:r=>{r.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},7750:(r,e,t)=>{var n=t(4117),i=TypeError;r.exports=function(s){if(n(s))throw new i("Can't call method on "+s);return s}},9286:(r,e,t)=>{var n=t(4402),i=t(8469),s=n.Set,a=n.add;r.exports=function(o){var l=new s;return i(o,function(u){a(l,u)}),l}},3440:(r,e,t)=>{var n=t(7080),i=t(4402),s=t(9286),a=t(5170),o=t(3789),l=t(8469),u=t(507),d=i.has,c=i.remove;r.exports=function(f){var p=n(this),g=o(f),v=s(p);return a(p)<=g.size?l(p,function(m){g.includes(m)&&c(v,m)}):u(g.getIterator(),function(m){d(p,m)&&c(v,m)}),v}},4402:(r,e,t)=>{var n=t(9504),i=Set.prototype;r.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i}},8750:(r,e,t)=>{var n=t(7080),i=t(4402),s=t(5170),a=t(3789),o=t(8469),l=t(507),u=i.Set,d=i.add,c=i.has;r.exports=function(f){var p=n(this),g=a(f),v=new u;return s(p)>g.size?l(g.getIterator(),function(m){c(p,m)&&d(v,m)}):o(p,function(m){g.includes(m)&&d(v,m)}),v}},4449:(r,e,t)=>{var n=t(7080),i=t(4402).has,s=t(5170),a=t(3789),o=t(8469),l=t(507),u=t(9539);r.exports=function(c){var h=n(this),f=a(c);if(s(h)<=f.size)return o(h,function(g){if(f.includes(g))return!1},!0)!==!1;var p=f.getIterator();return l(p,function(g){if(i(h,g))return u(p,"normal",!1)})!==!1}},3838:(r,e,t)=>{var n=t(7080),i=t(5170),s=t(8469),a=t(3789);r.exports=function(l){var u=n(this),d=a(l);return i(u)>d.size?!1:s(u,function(c){if(!d.includes(c))return!1},!0)!==!1}},8527:(r,e,t)=>{var n=t(7080),i=t(4402).has,s=t(5170),a=t(3789),o=t(507),l=t(9539);r.exports=function(d){var c=n(this),h=a(d);if(s(c)<h.size)return!1;var f=h.getIterator();return o(f,function(p){if(!i(c,p))return l(f,"normal",!1)})!==!1}},8469:(r,e,t)=>{var n=t(9504),i=t(507),s=t(4402),a=s.Set,o=s.proto,l=n(o.forEach),u=n(o.keys),d=u(new a).next;r.exports=function(c,h,f){return f?i({iterator:u(c),next:d},h):l(c,h)}},4916:(r,e,t)=>{var n=t(7751),i=function(s){return{size:s,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};r.exports=function(s){var a=n("Set");try{new a()[s](i(0));try{return new a()[s](i(-1)),!1}catch{return!0}}catch{return!1}}},5170:(r,e,t)=>{var n=t(6706),i=t(4402);r.exports=n(i.proto,"size","get")||function(s){return s.size}},3650:(r,e,t)=>{var n=t(7080),i=t(4402),s=t(9286),a=t(3789),o=t(507),l=i.add,u=i.has,d=i.remove;r.exports=function(h){var f=n(this),p=a(h).getIterator(),g=s(f);return o(p,function(v){u(f,v)?d(g,v):l(g,v)}),g}},4204:(r,e,t)=>{var n=t(7080),i=t(4402).add,s=t(9286),a=t(3789),o=t(507);r.exports=function(u){var d=n(this),c=a(u).getIterator(),h=s(d);return o(c,function(f){i(h,f)}),h}},6119:(r,e,t)=>{var n=t(5745),i=t(3392),s=n("keys");r.exports=function(a){return s[a]||(s[a]=i(a))}},7629:(r,e,t)=>{var n=t(6395),i=t(4576),s=t(9433),a="__core-js_shared__",o=r.exports=i[a]||s(a,{});(o.versions||(o.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(r,e,t)=>{var n=t(7629);r.exports=function(i,s){return n[i]||(n[i]=s||{})}},1548:(r,e,t)=>{var n=t(4576),i=t(9039),s=t(9519),a=t(4215),o=n.structuredClone;r.exports=!!o&&!i(function(){if(a==="DENO"&&s>92||a==="NODE"&&s>94||a==="BROWSER"&&s>97)return!1;var l=new ArrayBuffer(8),u=o(l,{transfer:[l]});return l.byteLength!==0||u.byteLength!==8})},4495:(r,e,t)=>{var n=t(9519),i=t(9039),s=t(4576),a=s.String;r.exports=!!Object.getOwnPropertySymbols&&!i(function(){var o=Symbol("symbol detection");return!a(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&n&&n<41})},5610:(r,e,t)=>{var n=t(1291),i=Math.max,s=Math.min;r.exports=function(a,o){var l=n(a);return l<0?i(l+o,0):s(l,o)}},5854:(r,e,t)=>{var n=t(2777),i=TypeError;r.exports=function(s){var a=n(s,"number");if(typeof a=="number")throw new i("Can't convert number to bigint");return BigInt(a)}},7696:(r,e,t)=>{var n=t(1291),i=t(8014),s=RangeError;r.exports=function(a){if(a===void 0)return 0;var o=n(a),l=i(o);if(o!==l)throw new s("Wrong length or index");return l}},5397:(r,e,t)=>{var n=t(7055),i=t(7750);r.exports=function(s){return n(i(s))}},1291:(r,e,t)=>{var n=t(741);r.exports=function(i){var s=+i;return s!==s||s===0?0:n(s)}},8014:(r,e,t)=>{var n=t(1291),i=Math.min;r.exports=function(s){var a=n(s);return a>0?i(a,9007199254740991):0}},8981:(r,e,t)=>{var n=t(7750),i=Object;r.exports=function(s){return i(n(s))}},9590:(r,e,t)=>{var n=t(1291),i=RangeError;r.exports=function(s){var a=n(s);if(a<0)throw new i("The argument can't be less than 0");return a}},2777:(r,e,t)=>{var n=t(9565),i=t(34),s=t(757),a=t(5966),o=t(4270),l=t(8227),u=TypeError,d=l("toPrimitive");r.exports=function(c,h){if(!i(c)||s(c))return c;var f=a(c,d),p;if(f){if(h===void 0&&(h="default"),p=n(f,c,h),!i(p)||s(p))return p;throw new u("Can't convert object to primitive value")}return h===void 0&&(h="number"),o(c,h)}},6969:(r,e,t)=>{var n=t(2777),i=t(757);r.exports=function(s){var a=n(s,"string");return i(a)?a:a+""}},2140:(r,e,t)=>{var n=t(8227),i=n("toStringTag"),s={};s[i]="z",r.exports=String(s)==="[object z]"},655:(r,e,t)=>{var n=t(6955),i=String;r.exports=function(s){if(n(s)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i(s)}},6823:r=>{var e=String;r.exports=function(t){try{return e(t)}catch{return"Object"}}},3392:(r,e,t)=>{var n=t(9504),i=0,s=Math.random(),a=n(1 .toString);r.exports=function(o){return"Symbol("+(o===void 0?"":o)+")_"+a(++i+s,36)}},7040:(r,e,t)=>{var n=t(4495);r.exports=n&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686:(r,e,t)=>{var n=t(3724),i=t(9039);r.exports=n&&i(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812:r=>{var e=TypeError;r.exports=function(t,n){if(t<n)throw new e("Not enough arguments");return t}},8622:(r,e,t)=>{var n=t(4576),i=t(4901),s=n.WeakMap;r.exports=i(s)&&/native code/.test(String(s))},8227:(r,e,t)=>{var n=t(4576),i=t(5745),s=t(9297),a=t(3392),o=t(4495),l=t(7040),u=n.Symbol,d=i("wks"),c=l?u.for||u:u&&u.withoutSetter||a;r.exports=function(h){return s(d,h)||(d[h]=o&&s(u,h)?u[h]:c("Symbol."+h)),d[h]}},6573:(r,e,t)=>{var n=t(3724),i=t(2106),s=t(3238),a=ArrayBuffer.prototype;n&&!("detached"in a)&&i(a,"detached",{configurable:!0,get:function(){return s(this)}})},7936:(r,e,t)=>{var n=t(6518),i=t(5636);i&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},8100:(r,e,t)=>{var n=t(6518),i=t(5636);i&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},4114:(r,e,t)=>{var n=t(6518),i=t(8981),s=t(6198),a=t(4527),o=t(6837),l=t(9039),u=l(function(){return[].push.call({length:4294967296},1)!==4294967297}),d=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(h){return h instanceof TypeError}},c=u||!d();n({target:"Array",proto:!0,arity:1,forced:c},{push:function(f){var p=i(this),g=s(p),v=arguments.length;o(g+v);for(var m=0;m<v;m++)p[g]=arguments[m],g++;return a(p,g),g}})},8111:(r,e,t)=>{var n=t(6518),i=t(4576),s=t(679),a=t(8551),o=t(4901),l=t(2787),u=t(2106),d=t(4659),c=t(9039),h=t(9297),f=t(8227),p=t(7657).IteratorPrototype,g=t(3724),v=t(6395),m="constructor",y="Iterator",w=f("toStringTag"),x=TypeError,b=i[y],A=v||!o(b)||b.prototype!==p||!c(function(){b({})}),S=function(){if(s(this,p),l(this)===p)throw new x("Abstract class Iterator not directly constructable")},P=function(F,k){g?u(p,F,{configurable:!0,get:function(){return k},set:function(D){if(a(this),this===p)throw new x("You can't redefine this property");h(this,F)?this[F]=D:d(this,F,D)}}):p[F]=k};h(p,w)||P(w,y),(A||!h(p,m)||p[m]===Object)&&P(m,S),S.prototype=p,n({global:!0,constructor:!0,forced:A},{Iterator:S})},9314:(r,e,t)=>{var n=t(6518),i=t(9565),s=t(8551),a=t(1767),o=t(4149),l=t(9590),u=t(9462),d=t(6395),c=u(function(){for(var h=this.iterator,f=this.next,p,g;this.remaining;)if(this.remaining--,p=s(i(f,h)),g=this.done=!!p.done,g)return;if(p=s(i(f,h)),g=this.done=!!p.done,!g)return p.value});n({target:"Iterator",proto:!0,real:!0,forced:d},{drop:function(f){s(this);var p=l(o(+f));return new c(a(this),{remaining:p})}})},1148:(r,e,t)=>{var n=t(6518),i=t(2652),s=t(9306),a=t(8551),o=t(1767);n({target:"Iterator",proto:!0,real:!0},{every:function(u){a(this),s(u);var d=o(this),c=0;return!i(d,function(h,f){if(!u(h,c++))return f()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489:(r,e,t)=>{var n=t(6518),i=t(9565),s=t(9306),a=t(8551),o=t(1767),l=t(9462),u=t(6319),d=t(6395),c=l(function(){for(var h=this.iterator,f=this.predicate,p=this.next,g,v,m;;){if(g=a(i(p,h)),v=this.done=!!g.done,v)return;if(m=g.value,u(h,f,[m,this.counter++],!0))return m}});n({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(f){return a(this),s(f),new c(o(this),{predicate:f})}})},531:(r,e,t)=>{var n=t(6518),i=t(9565),s=t(9306),a=t(8551),o=t(1767),l=t(8646),u=t(9462),d=t(9539),c=t(6395),h=u(function(){for(var f=this.iterator,p=this.mapper,g,v;;){if(v=this.inner)try{if(g=a(i(v.next,v.iterator)),!g.done)return g.value;this.inner=null}catch(m){d(f,"throw",m)}if(g=a(i(this.next,f)),this.done=!!g.done)return;try{this.inner=l(p(g.value,this.counter++),!1)}catch(m){d(f,"throw",m)}}});n({target:"Iterator",proto:!0,real:!0,forced:c},{flatMap:function(p){return a(this),s(p),new h(o(this),{mapper:p,inner:null})}})},1701:(r,e,t)=>{var n=t(6518),i=t(713),s=t(6395);n({target:"Iterator",proto:!0,real:!0,forced:s},{map:i})},3579:(r,e,t)=>{var n=t(6518),i=t(2652),s=t(9306),a=t(8551),o=t(1767);n({target:"Iterator",proto:!0,real:!0},{some:function(u){a(this),s(u);var d=o(this),c=0;return i(d,function(h,f){if(u(h,c++))return f()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1689:(r,e,t)=>{var n=t(6518),i=t(4576),s=t(8745),a=t(7680),o=t(6043),l=t(9306),u=t(1103),d=i.Promise,c=!1,h=!d||!d.try||u(function(){d.try(function(f){c=f===8},8)}).error||!c;n({target:"Promise",stat:!0,forced:h},{try:function(f){var p=arguments.length>1?a(arguments,1):[],g=o.f(this),v=u(function(){return s(l(f),void 0,p)});return(v.error?g.reject:g.resolve)(v.value),g.promise}})},4628:(r,e,t)=>{var n=t(6518),i=t(6043);n({target:"Promise",stat:!0},{withResolvers:function(){var a=i.f(this);return{promise:a.promise,resolve:a.resolve,reject:a.reject}}})},7642:(r,e,t)=>{var n=t(6518),i=t(3440),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("difference")},{difference:i})},8004:(r,e,t)=>{var n=t(6518),i=t(9039),s=t(8750),a=t(4916),o=!a("intersection")||i(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});n({target:"Set",proto:!0,real:!0,forced:o},{intersection:s})},3853:(r,e,t)=>{var n=t(6518),i=t(4449),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("isDisjointFrom")},{isDisjointFrom:i})},5876:(r,e,t)=>{var n=t(6518),i=t(3838),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("isSubsetOf")},{isSubsetOf:i})},2475:(r,e,t)=>{var n=t(6518),i=t(8527),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("isSupersetOf")},{isSupersetOf:i})},5024:(r,e,t)=>{var n=t(6518),i=t(3650),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("symmetricDifference")},{symmetricDifference:i})},1698:(r,e,t)=>{var n=t(6518),i=t(4204),s=t(4916);n({target:"Set",proto:!0,real:!0,forced:!s("union")},{union:i})},7467:(r,e,t)=>{var n=t(7628),i=t(4644),s=i.aTypedArray,a=i.exportTypedArrayMethod,o=i.getTypedArrayConstructor;a("toReversed",function(){return n(s(this),o(this))})},4732:(r,e,t)=>{var n=t(4644),i=t(9504),s=t(9306),a=t(5370),o=n.aTypedArray,l=n.getTypedArrayConstructor,u=n.exportTypedArrayMethod,d=i(n.TypedArrayPrototype.sort);u("toSorted",function(h){h!==void 0&&s(h);var f=o(this),p=a(l(f),f);return d(p,h)})},9577:(r,e,t)=>{var n=t(9928),i=t(4644),s=t(1108),a=t(1291),o=t(5854),l=i.aTypedArray,u=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,c=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(h){return h===8}}();d("with",function(h,f){var p=l(this),g=a(h),v=s(p)?o(f):+f;return n(p,u(p),g,v)},!c)},8992:(r,e,t)=>{t(8111)},4743:(r,e,t)=>{t(9314)},3215:(r,e,t)=>{t(1148)},4520:(r,e,t)=>{t(2489)},670:(r,e,t)=>{t(531)},1454:(r,e,t)=>{t(1701)},7550:(r,e,t)=>{t(3579)},8335:(r,e,t)=>{var n=t(6518),i=t(3724),s=t(4576),a=t(7751),o=t(9504),l=t(9565),u=t(4901),d=t(34),c=t(4376),h=t(9297),f=t(655),p=t(6198),g=t(4659),v=t(9039),m=t(8235),y=t(4495),w=s.JSON,x=s.Number,b=s.SyntaxError,A=w&&w.parse,S=a("Object","keys"),P=Object.getOwnPropertyDescriptor,F=o("".charAt),k=o("".slice),D=o(/./.exec),_=o([].push),B=/^\d$/,N=/^[1-9]$/,G=/^[\d-]$/,O=/^[\t\n\r ]$/,R=0,J=1,le=function(W,M){W=f(W);var H=new ye(W,0,""),ue=H.parse(),Te=ue.value,K=H.skip(O,ue.end);if(K<W.length)throw new b('Unexpected extra character: "'+F(W,K)+'" after the parsed data at: '+K);return u(M)?_e({"":Te},"",M,ue):Te},_e=function(W,M,H,ue){var Te=W[M],K=ue&&Te===ue.value,Ye=K&&typeof ue.source=="string"?{source:ue.source}:{},Ke,pn,er,Rt,qs;if(d(Te)){var Ih=c(Te),eu=K?ue.nodes:Ih?[]:{};if(Ih)for(Ke=eu.length,er=p(Te),Rt=0;Rt<er;Rt++)Be(Te,Rt,_e(Te,""+Rt,H,Rt<Ke?eu[Rt]:void 0));else for(pn=S(Te),er=p(pn),Rt=0;Rt<er;Rt++)qs=pn[Rt],Be(Te,qs,_e(Te,qs,H,h(eu,qs)?eu[qs]:void 0))}return l(H,W,M,Te,Ye)},Be=function(W,M,H){if(i){var ue=P(W,M);if(ue&&!ue.configurable)return}H===void 0?delete W[M]:g(W,M,H)},we=function(W,M,H,ue){this.value=W,this.end=M,this.source=H,this.nodes=ue},ye=function(W,M){this.source=W,this.index=M};ye.prototype={fork:function(W){return new ye(this.source,W)},parse:function(){var W=this.source,M=this.skip(O,this.index),H=this.fork(M),ue=F(W,M);if(D(G,ue))return H.number();switch(ue){case"{":return H.object();case"[":return H.array();case'"':return H.string();case"t":return H.keyword(!0);case"f":return H.keyword(!1);case"n":return H.keyword(null)}throw new b('Unexpected character: "'+ue+'" at: '+M)},node:function(W,M,H,ue,Te){return new we(M,ue,W?null:k(this.source,H,ue),Te)},object:function(){for(var W=this.source,M=this.index+1,H=!1,ue={},Te={};M<W.length;){if(M=this.until(['"',"}"],M),F(W,M)==="}"&&!H){M++;break}var K=this.fork(M).string(),Ye=K.value;M=K.end,M=this.until([":"],M)+1,M=this.skip(O,M),K=this.fork(M).parse(),g(Te,Ye,K),g(ue,Ye,K.value),M=this.until([",","}"],K.end);var Ke=F(W,M);if(Ke===",")H=!0,M++;else if(Ke==="}"){M++;break}}return this.node(J,ue,this.index,M,Te)},array:function(){for(var W=this.source,M=this.index+1,H=!1,ue=[],Te=[];M<W.length;){if(M=this.skip(O,M),F(W,M)==="]"&&!H){M++;break}var K=this.fork(M).parse();if(_(Te,K),_(ue,K.value),M=this.until([",","]"],K.end),F(W,M)===",")H=!0,M++;else if(F(W,M)==="]"){M++;break}}return this.node(J,ue,this.index,M,Te)},string:function(){var W=this.index,M=m(this.source,this.index+1);return this.node(R,M.value,W,M.end)},number:function(){var W=this.source,M=this.index,H=M;if(F(W,H)==="-"&&H++,F(W,H)==="0")H++;else if(D(N,F(W,H)))H=this.skip(B,H+1);else throw new b("Failed to parse number at: "+H);if(F(W,H)==="."&&(H=this.skip(B,H+1)),F(W,H)==="e"||F(W,H)==="E"){H++,(F(W,H)==="+"||F(W,H)==="-")&&H++;var ue=H;if(H=this.skip(B,H),ue===H)throw new b("Failed to parse number's exponent value at: "+H)}return this.node(R,x(k(W,M,H)),M,H)},keyword:function(W){var M=""+W,H=this.index,ue=H+M.length;if(k(this.source,H,ue)!==M)throw new b("Failed to parse value at: "+H);return this.node(R,W,H,ue)},skip:function(W,M){for(var H=this.source;M<H.length&&D(W,F(H,M));M++);return M},until:function(W,M){M=this.skip(O,M);for(var H=F(this.source,M),ue=0;ue<W.length;ue++)if(W[ue]===H)return M;throw new b('Unexpected character: "'+H+'" at: '+M)}};var $r=v(function(){var W="9007199254740993",M;return A(W,function(H,ue,Te){M=Te.source}),M!==W}),Ht=y&&!v(function(){return 1/A("-0 ")!==-1/0});n({target:"JSON",stat:!0,forced:$r},{parse:function(M,H){return Ht&&!u(H)?A(M):le(M,H)}})},5247:(r,e,t)=>{t(1689)},4979:(r,e,t)=>{var n=t(6518),i=t(4576),s=t(7751),a=t(6980),o=t(4913).f,l=t(9297),u=t(679),d=t(3167),c=t(2603),h=t(5002),f=t(8574),p=t(3724),g=t(6395),v="DOMException",m=s("Error"),y=s(v),w=function(){u(this,x);var O=arguments.length,R=c(O<1?void 0:arguments[0]),J=c(O<2?void 0:arguments[1],"Error"),le=new y(R,J),_e=new m(R);return _e.name=v,o(le,"stack",a(1,f(_e.stack,1))),d(le,this,w),le},x=w.prototype=y.prototype,b="stack"in new m(v),A="stack"in new y(1,2),S=y&&p&&Object.getOwnPropertyDescriptor(i,v),P=!!S&&!(S.writable&&S.configurable),F=b&&!P&&!A;n({global:!0,constructor:!0,forced:g||F},{DOMException:F?w:y});var k=s(v),D=k.prototype;if(D.constructor!==k){g||o(D,"constructor",a(1,k));for(var _ in h)if(l(h,_)){var B=h[_],N=B.s;l(k,N)||o(k,N,a(6,B.c))}}},4603:(r,e,t)=>{var n=t(6840),i=t(9504),s=t(655),a=t(2812),o=URLSearchParams,l=o.prototype,u=i(l.append),d=i(l.delete),c=i(l.forEach),h=i([].push),f=new o("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&n(l,"delete",function(p){var g=arguments.length,v=g<2?void 0:arguments[1];if(g&&v===void 0)return d(this,p);var m=[];c(this,function(F,k){h(m,{key:k,value:F})}),a(g,1);for(var y=s(p),w=s(v),x=0,b=0,A=!1,S=m.length,P;x<S;)P=m[x++],A||P.key===y?(A=!0,d(this,P.key)):b++;for(;b<S;)P=m[b++],P.key===y&&P.value===w||u(this,P.key,P.value)},{enumerable:!0,unsafe:!0})},7566:(r,e,t)=>{var n=t(6840),i=t(9504),s=t(655),a=t(2812),o=URLSearchParams,l=o.prototype,u=i(l.getAll),d=i(l.has),c=new o("a=1");(c.has("a",2)||!c.has("a",void 0))&&n(l,"has",function(f){var p=arguments.length,g=p<2?void 0:arguments[1];if(p&&g===void 0)return d(this,f);var v=u(this,f);a(p,1);for(var m=s(g),y=0;y<v.length;)if(v[y++]===m)return!0;return!1},{enumerable:!0,unsafe:!0})},8721:(r,e,t)=>{var n=t(3724),i=t(9504),s=t(2106),a=URLSearchParams.prototype,o=i(a.forEach);n&&!("size"in a)&&s(a,"size",{get:function(){var u=0;return o(this,function(){u++}),u},configurable:!0,enumerable:!0})}},py={};function De(r){var e=py[r];if(e!==void 0)return e.exports;var t=py[r]={exports:{}};return rF[r].call(t.exports,t,t.exports,De),t.exports}De.d=(r,e)=>{for(var t in e)De.o(e,t)&&!De.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})};De.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var de=globalThis.pdfjsLib={};De.d(de,{AbortException:()=>vn,AnnotationEditorLayer:()=>op,AnnotationEditorParamsType:()=>Pe,AnnotationEditorType:()=>ve,AnnotationEditorUIManager:()=>$i,AnnotationLayer:()=>Jf,AnnotationMode:()=>pi,ColorPicker:()=>Nu,DOMSVGFactory:()=>Ao,DrawLayer:()=>lp,FeatureTest:()=>Nt,GlobalWorkerOptions:()=>Yi,ImageKind:()=>ou,InvalidPDFException:()=>po,MissingPDFException:()=>Zi,OPS:()=>en,OutputScale:()=>vo,PDFDataRangeTransport:()=>Pu,PDFDateString:()=>du,PDFWorker:()=>Hs,PasswordResponses:()=>oF,PermissionFlag:()=>aF,PixelsPerInch:()=>mi,RenderingCancelledException:()=>mo,TextLayer:()=>wo,TouchManager:()=>fu,UnexpectedResponseException:()=>Gs,Util:()=>Q,VerbosityLevel:()=>Bu,XfaLayer:()=>Eu,build:()=>YF,createValidAbsoluteUrl:()=>cF,fetchData:()=>Vu,getDocument:()=>GF,getFilenameFromUrl:()=>bF,getPdfFilenameFromUrl:()=>wF,getXfaPageViewport:()=>xF,isDataScheme:()=>Hu,isPdfFile:()=>cp,noContextMenu:()=>tn,normalizeUnicode:()=>mF,setLayerDimensions:()=>Ji,shadow:()=>xe,stopEvent:()=>Dr,version:()=>XF});var E8=De(4114),C8=De(6573),T8=De(8100),k8=De(7936),R8=De(7467),_8=De(4732),I8=De(9577),O8=De(5247),M8=De(4979),N8=De(4603),L8=De(7566),j8=De(8721),Kt=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Ty=[1,0,0,1,0,0],Uh=[.001,0,0,.001,0,0],nF=1e7,au=1.35,iF=.35,B8=iF/au,Fr={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},pi={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},sF="pdfjs_internal_editor_",ve={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Pe={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,DRAW_STEP:41},aF={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Gt={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ou={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ft={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};var oo={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};var Bu={ERRORS:0,WARNINGS:1,INFOS:5},en={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},oF={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Uu=Bu.WARNINGS;function lF(r){Number.isInteger(r)&&(Uu=r)}function uF(){return Uu}function qu(r){Uu>=Bu.INFOS&&console.log(`Info: ${r}`)}function fe(r){Uu>=Bu.WARNINGS&&console.log(`Warning: ${r}`)}function He(r){throw new Error(r)}function yt(r,e){r||He(e)}function dF(r){switch(r?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function cF(r,e=null,t=null){if(!r)return null;try{if(t&&typeof r=="string"&&(t.addDefaultProtocol&&r.startsWith("www.")&&r.match(/\./g)?.length>=2&&(r=`http://${r}`),t.tryConvertEncoding))try{r=gF(r)}catch{}let n=e?new URL(r,e):new URL(r);if(dF(n))return n}catch{}return null}function xe(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}var vi=function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}(),lu=class extends vi{constructor(e,t){super(e,"PasswordException"),this.code=t}},fo=class extends vi{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},po=class extends vi{constructor(e){super(e,"InvalidPDFException")}},Zi=class extends vi{constructor(e){super(e,"MissingPDFException")}},Gs=class extends vi{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},qh=class extends vi{constructor(e){super(e,"FormatError")}},vn=class extends vi{constructor(e){super(e,"AbortException")}};function ky(r){(typeof r!="object"||r?.length===void 0)&&He("Invalid argument for bytesToString");let e=r.length,t=8192;if(e<t)return String.fromCharCode.apply(null,r);let n=[];for(let i=0;i<e;i+=t){let s=Math.min(i+t,e),a=r.subarray(i,s);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function zu(r){typeof r!="string"&&He("Invalid argument for stringToBytes");let e=r.length,t=new Uint8Array(e);for(let n=0;n<e;++n)t[n]=r.charCodeAt(n)&255;return t}function hF(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r&255)}function up(r){let e=Object.create(null);for(let[t,n]of r)e[t]=n;return e}function fF(){let r=new Uint8Array(4);return r[0]=1,new Uint32Array(r.buffer,0,1)[0]===1}function pF(){try{return new Function(""),!0}catch{return!1}}var Nt=class{static get isLittleEndian(){return xe(this,"isLittleEndian",fF())}static get isEvalSupported(){return xe(this,"isEvalSupported",pF())}static get isOffscreenCanvasSupported(){return xe(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return xe(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?xe(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):xe(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return xe(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},Mh=Array.from(Array(256).keys(),r=>r.toString(16).padStart(2,"0")),Q=class{static makeHexColor(e,t,n){return`#${Mh[e]}${Mh[t]}${Mh[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){let n=e[0]*t[0]+e[1]*t[2]+t[4],i=e[0]*t[1]+e[1]*t[3]+t[5];return[n,i]}static applyInverseTransform(e,t){let n=t[0]*t[3]-t[1]*t[2],i=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,s=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n;return[i,s]}static getAxialAlignedBoundingBox(e,t){let n=this.applyTransform(e,t),i=this.applyTransform(e.slice(2,4),t),s=this.applyTransform([e[0],e[3]],t),a=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],i[0],s[0],a[0]),Math.min(n[1],i[1],s[1],a[1]),Math.max(n[0],i[0],s[0],a[0]),Math.max(n[1],i[1],s[1],a[1])]}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){let t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],i=e[0]*t[1]+e[1]*t[3],s=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],o=(n+a)/2,l=Math.sqrt((n+a)**2-4*(n*a-s*i))/2,u=o+l||1,d=o-l||1;return[Math.sqrt(u),Math.sqrt(d)]}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>i)return null;let s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[n,s,i,a]}static#e(e,t,n,i,s,a,o,l,u,d){if(u<=0||u>=1)return;let c=1-u,h=u*u,f=h*u,p=c*(c*(c*e+3*u*t)+3*h*n)+f*i,g=c*(c*(c*s+3*u*a)+3*h*o)+f*l;d[0]=Math.min(d[0],p),d[1]=Math.min(d[1],g),d[2]=Math.max(d[2],p),d[3]=Math.max(d[3],g)}static#t(e,t,n,i,s,a,o,l,u,d,c,h){if(Math.abs(u)<1e-12){Math.abs(d)>=1e-12&&this.#e(e,t,n,i,s,a,o,l,-c/d,h);return}let f=d**2-4*c*u;if(f<0)return;let p=Math.sqrt(f),g=2*u;this.#e(e,t,n,i,s,a,o,l,(-d+p)/g,h),this.#e(e,t,n,i,s,a,o,l,(-d-p)/g,h)}static bezierBoundingBox(e,t,n,i,s,a,o,l,u){return u?(u[0]=Math.min(u[0],e,o),u[1]=Math.min(u[1],t,l),u[2]=Math.max(u[2],e,o),u[3]=Math.max(u[3],t,l)):u=[Math.min(e,o),Math.min(t,l),Math.max(e,o),Math.max(t,l)],this.#t(e,n,s,o,t,i,a,l,3*(-e+3*(n-s)+o),6*(e-2*n+s),3*(n-e),u),this.#t(e,n,s,o,t,i,a,l,3*(-t+3*(i-a)+l),6*(t-2*i+a),3*(i-t),u),u}};function gF(r){return decodeURIComponent(escape(r))}var Nh=null,gy=null;function mF(r){return Nh||(Nh=/([\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,gy=new Map([["\uFB05","\u017Ft"]])),r.replaceAll(Nh,(e,t,n)=>t?t.normalize("NFKC"):gy.get(n))}function vF(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let r=new Uint8Array(32);return crypto.getRandomValues(r),ky(r)}var dp="pdfjs_internal_id_";function yF(r){return Uint8Array.prototype.toBase64?r.toBase64():btoa(ky(r))}var U8=De(4628),q8=De(7642),z8=De(8004),V8=De(3853),H8=De(5876),G8=De(2475),W8=De(5024),K8=De(1698),X8=De(1454),Y8=De(8992),Z8=De(4743),J8=De(3215),Q8=De(7550),$8=De(8335),jn="http://www.w3.org/2000/svg",mi=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function Vu(r,e="text"){if(ho(r,document.baseURI)){let t=await fetch(r);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,n)=>{let i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(i.response);return}t(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}var go=class r{constructor({viewBox:e,userUnit:t,scale:n,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=i,this.offsetX=s,this.offsetY=a,n*=t;let l=(e[2]+e[0])/2,u=(e[3]+e[1])/2,d,c,h,f;switch(i%=360,i<0&&(i+=360),i){case 180:d=-1,c=0,h=0,f=1;break;case 90:d=0,c=1,h=1,f=0;break;case 270:d=0,c=-1,h=-1,f=0;break;case 0:d=1,c=0,h=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(h=-h,f=-f);let p,g,v,m;d===0?(p=Math.abs(u-e[1])*n+s,g=Math.abs(l-e[0])*n+a,v=(e[3]-e[1])*n,m=(e[2]-e[0])*n):(p=Math.abs(l-e[0])*n+s,g=Math.abs(u-e[1])*n+a,v=(e[2]-e[0])*n,m=(e[3]-e[1])*n),this.transform=[d*n,c*n,h*n,f*n,p-d*n*l-h*n*u,g-c*n*l-f*n*u],this.width=v,this.height=m}get rawDims(){let{userUnit:e,viewBox:t}=this,n=t.map(i=>i*e);return xe(this,"rawDims",{pageWidth:n[2]-n[0],pageHeight:n[3]-n[1],pageX:n[0],pageY:n[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}={}){return new r({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:s})}convertToViewportPoint(e,t){return Q.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){let t=Q.applyTransform([e[0],e[1]],this.transform),n=Q.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return Q.applyInverseTransform([e,t],this.transform)}},mo=class extends vi{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};function Hu(r){let e=r.length,t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function cp(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function bF(r){return[r]=r.split(/[#?]/,1),r.substring(r.lastIndexOf("/")+1)}function wF(r,e="document.pdf"){if(typeof r!="string")return e;if(Hu(r))return fe('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=t.exec(r),s=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(s&&(s=s[0],s.includes("%")))try{s=n.exec(decodeURIComponent(s))[0]}catch{}return s||e}var uu=class{started=Object.create(null);times=[];time(e){e in this.started&&fe(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||fe(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:n}of this.times)t=Math.max(n.length,t);for(let{name:n,start:i,end:s}of this.times)e.push(`${n.padEnd(t)} ${s-i}ms
|
|
58
|
+
`);return e.join("")}};function ho(r,e){try{let{protocol:t}=e?new URL(r,e):new URL(r);return t==="http:"||t==="https:"}catch{return!1}}function tn(r){r.preventDefault()}function Dr(r){r.preventDefault(),r.stopPropagation()}var du=class{static#e;static toDateObject(e){if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;let u=t[7]||"Z",d=parseInt(t[8],10);d=d>=0&&d<=23?d:0;let c=parseInt(t[9],10)||0;return c=c>=0&&c<=59?c:0,u==="-"?(a+=d,o+=c):u==="+"&&(a-=d,o-=c),new Date(Date.UTC(n,i,s,a,o,l))}};function xF(r,{scale:e=1,rotation:t=0}){let{width:n,height:i}=r.attributes.style,s=[0,0,parseInt(n),parseInt(i)];return new go({viewBox:s,userUnit:1,scale:e,rotation:t})}function hp(r){if(r.startsWith("#")){let e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(fe(`Not a valid color format: "${r}"`),[0,0,0])}function AF(r){let e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(let t of r.keys()){e.style.color=t;let n=window.getComputedStyle(e).color;r.set(t,hp(n))}e.remove()}function Ze(r){let{a:e,b:t,c:n,d:i,e:s,f:a}=r.getTransform();return[e,t,n,i,s,a]}function gn(r){let{a:e,b:t,c:n,d:i,e:s,f:a}=r.getTransform().invertSelf();return[e,t,n,i,s,a]}function Ji(r,e,t=!1,n=!0){if(e instanceof go){let{pageWidth:i,pageHeight:s}=e.rawDims,{style:a}=r,o=Nt.isCSSRoundSupported,l=`var(--scale-factor) * ${i}px`,u=`var(--scale-factor) * ${s}px`,d=o?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,c=o?`round(down, ${u}, var(--scale-round-y, 1px))`:`calc(${u})`;!t||e.rotation%180===0?(a.width=d,a.height=c):(a.width=c,a.height=d)}n&&r.setAttribute("data-main-rotation",e.rotation)}var vo=class{constructor(){let e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}},zh=class r{#e=null;#t=null;#r;#n=null;#s=null;static#i=null;constructor(e){this.#r=e,r.#i||=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(){let e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=this.#r._uiManager._signal;e.addEventListener("contextmenu",tn,{signal:t}),e.addEventListener("pointerdown",r.#l,{signal:t});let n=this.#n=document.createElement("div");n.className="buttons",e.append(n);let i=this.#r.toolbarPosition;if(i){let{style:s}=e,a=this.#r._uiManager.direction==="ltr"?1-i[0]:i[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#h(),e}get div(){return this.#e}static#l(e){e.stopPropagation()}#o(e){this.#r._focusEventsAllowed=!1,Dr(e)}#d(e){this.#r._focusEventsAllowed=!0,Dr(e)}#u(e){let t=this.#r._uiManager._signal;e.addEventListener("focusin",this.#o.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",tn,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#s?.shown()}#h(){let{editorType:e,_uiManager:t}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",r.#i[e]),this.#u(n),n.addEventListener("click",i=>{t.delete()},{signal:t._signal}),this.#n.append(n)}get#c(){let e=document.createElement("div");return e.className="divider",e}async addAltText(e){let t=await e.render();this.#u(t),this.#n.prepend(t,this.#c),this.#s=e}addColorPicker(e){this.#t=e;let t=e.renderButton();this.#u(t),this.#n.prepend(t,this.#c)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Vh=class{#e=null;#t=null;#r;constructor(e){this.#r=e}#n(){let e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",tn,{signal:this.#r._signal});let t=this.#e=document.createElement("div");return t.className="buttons",e.append(t),this.#i(),e}#s(e,t){let n=0,i=0;for(let s of e){let a=s.y+s.height;if(a<n)continue;let o=s.x+(t?s.width:0);if(a>n){i=o,n=a;continue}t?o>i&&(i=o):o<i&&(i=o)}return[t?1-i:i,n]}show(e,t,n){let[i,s]=this.#s(t,n),{style:a}=this.#t||=this.#n();e.append(this.#t),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#i(){let e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");let t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");let n=this.#r._signal;e.addEventListener("contextmenu",tn,{signal:n}),e.addEventListener("click",()=>{this.#r.highlightSelection("floating_button")},{signal:n}),this.#e.append(e)}};function cu(r,e,t){for(let n of t)e.addEventListener(n,r[n].bind(r))}var Hh=class{#e=0;get id(){return`${sF}${this.#e++}`}},Gh=class r{#e=vF();#t=0;#r=null;static get _isSVGFittingCanvas(){let e='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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;let s=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return xe(this,"_isSVGFittingCanvas",s)}async#n(e,t){this.#r||=new Map;let n=this.#r.get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof t=="string"?(n.url=t,i=await Vu(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){let s=r._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((u,d)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,u()},a.onload=async()=>{let c=n.svgUrl=a.result;o.src=await s?`${c}#svgView(preserveAspectRatio(none))`:c},o.onerror=a.onerror=d});a.readAsDataURL(i),await l}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){fe(i),n=null}return this.#r.set(e,n),n&&this.#r.set(n.id,n),n}async getFromFile(e){let{lastModified:t,name:n,size:i,type:s}=e;return this.#n(`${t}_${n}_${i}_${s}`,e)}async getFromUrl(e){return this.#n(e,e)}async getFromBlob(e,t){let n=await t;return this.#n(e,n)}async getFromId(e){this.#r||=new Map;let t=this.#r.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:n}=t;return delete t.blobPromise,this.getFromBlob(t.id,n)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#r||=new Map;let n=this.#r.get(e);if(n?.bitmap)return n.refCounter+=1,n;let i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#r.set(e,n),this.#r.set(n.id,n),n}getSvgUrl(e){let t=this.#r.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#r||=new Map;let t=this.#r.get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=i.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},Wh=class{#e=[];#t=!1;#r;#n=-1;constructor(e=128){this.#r=e}add({cmd:e,undo:t,post:n,mustExec:i,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&e(),this.#t)return;let l={cmd:e,undo:t,post:n,type:s};if(this.#n===-1){this.#e.length>0&&(this.#e.length=0),this.#n=0,this.#e.push(l);return}if(a&&this.#e[this.#n].type===s){o&&(l.undo=this.#e[this.#n].undo),this.#e[this.#n]=l;return}let u=this.#n+1;u===this.#r?this.#e.splice(0,1):(this.#n=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(l)}undo(){if(this.#n===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1,this.#n-=1}redo(){if(this.#n<this.#e.length-1){this.#n+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#n!==-1}hasSomethingToRedo(){return this.#n<this.#e.length-1}cleanType(e){if(this.#n!==-1){for(let t=this.#n;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#n-t),this.#n=t;return}this.#e.length=0,this.#n=-1}}destroy(){this.#e=null}},Qi=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Nt.platform;for(let[n,i,s={}]of e)for(let a of n){let o=a.startsWith("mac+");t&&o?(this.callbacks.set(a.slice(4),{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1))):!t&&!o&&(this.callbacks.set(a,{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);let t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(this.#e(t));if(!n)return;let{callback:i,options:{bubbles:s=!1,args:a=[],checker:o=null}}=n;o&&!o(e,t)||(i.bind(e,...a,t)(),s||Dr(t))}},Kh=class r{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let e=new Map([["CanvasText",null],["Canvas",null]]);return AF(e),xe(this,"_colors",e)}convert(e){let t=hp(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(let[n,i]of this._colors)if(i.every((s,a)=>s===t[a]))return r._colorsMapping.get(n);return t}getHexCode(e){let t=this._colors.get(e);return t?Q.makeHexColor(...t):e}},$i=class r{#e=new AbortController;#t=null;#r=new Map;#n=new Map;#s=null;#i=null;#l=null;#o=new Wh;#d=null;#u=null;#h=0;#c=new Set;#f=null;#a=null;#p=new Set;_editorUndoBar=null;#m=!1;#g=!1;#v=!1;#w=null;#y=null;#x=null;#S=null;#F=!1;#E=null;#T=new Hh;#A=!1;#C=!1;#D=null;#R=null;#O=null;#N=null;#P=ve.NONE;#b=new Set;#I=null;#q=null;#z=null;#V={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#L=[0,0];#M=null;#j=null;#H=null;#_=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let e=r.prototype,t=a=>a.#j.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),n=(a,{target:o})=>{if(o instanceof HTMLInputElement){let{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return xe(this,"_keyboardManager",new Qi([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#j.contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#j.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}]]))}constructor(e,t,n,i,s,a,o,l,u,d,c,h,f){let p=this._signal=this.#e.signal;this.#j=e,this.#H=t,this.#s=n,this._eventBus=i,i._on("editingaction",this.onEditingAction.bind(this),{signal:p}),i._on("pagechanging",this.onPageChanging.bind(this),{signal:p}),i._on("scalechanging",this.onScaleChanging.bind(this),{signal:p}),i._on("rotationchanging",this.onRotationChanging.bind(this),{signal:p}),i._on("setpreference",this.onSetPreference.bind(this),{signal:p}),i._on("switchannotationeditorparams",g=>this.updateParams(g.type,g.value),{signal:p}),this.#te(),this.#se(),this.#X(),this.#i=s.annotationStorage,this.#w=s.filterFactory,this.#q=a,this.#S=o||null,this.#m=l,this.#g=u,this.#v=d,this.#N=c||null,this.viewParameters={realScale:mi.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=h||null,this._supportsPinchToZoom=f!==!1}destroy(){this.#_?.resolve(),this.#_=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#n.values())e.destroy();this.#n.clear(),this.#r.clear(),this.#p.clear(),this.#t=null,this.#b.clear(),this.#o.destroy(),this.#s?.destroy(),this.#E?.hide(),this.#E=null,this.#y&&(clearTimeout(this.#y),this.#y=null),this.#M&&(clearTimeout(this.#M),this.#M=null),this._editorUndoBar?.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#N}get useNewAltTextFlow(){return this.#g}get useNewAltTextWhenAddingImage(){return this.#v}get hcmFilter(){return xe(this,"hcmFilter",this.#q?this.#w.addHCMFilter(this.#q.foreground,this.#q.background):"none")}get direction(){return xe(this,"direction",getComputedStyle(this.#j).direction)}get highlightColors(){return xe(this,"highlightColors",this.#S?new Map(this.#S.split(",").map(e=>e.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return xe(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#u=e}setMainHighlightColorPicker(e){this.#O=e}editAltText(e,t=!1){this.#s?.editAltText(this,e,t)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":this.#v=t;break}}onPageChanging({pageNumber:e}){this.#h=e-1}focusMainContainer(){this.#j.focus()}findParent(e,t){for(let n of this.#n.values()){let{x:i,y:s,width:a,height:o}=n.div.getBoundingClientRect();if(e>=i&&e<=i+a&&t>=s&&t<=s+o)return n}return null}disableUserSelect(e=!1){this.#H.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*mi.PDF_TO_CSS_UNITS;for(let t of this.#p)t.onScaleChanging();this.#u?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#B({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#K(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let n of this.#n.values())if(n.hasTextLayer(e))return n;return null}highlightSelection(e=""){let t=document.getSelection();if(!t||t.isCollapsed)return;let{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:a}=t,o=t.toString(),u=this.#B(t).closest(".textLayer"),d=this.getSelectionBoxes(u);if(!d)return;t.empty();let c=this.#K(u),h=this.#P===ve.NONE,f=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:d,anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:a,text:o}),h&&this.showAllEditors("highlight",!0,!0)};if(h){this.switchToMode(ve.HIGHLIGHT,f);return}f()}#$(){let e=document.getSelection();if(!e||e.isCollapsed)return;let n=this.#B(e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(this.#E||=new Vh(this),this.#E.show(n,i,this.direction==="ltr"))}addToAnnotationStorage(e){!e.isEmpty()&&this.#i&&!this.#i.has(e.id)&&this.#i.setValue(e.id,e)}#ee(){let e=document.getSelection();if(!e||e.isCollapsed){this.#I&&(this.#E?.hide(),this.#I=null,this.#k({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#I)return;let i=this.#B(e).closest(".textLayer");if(!i){this.#I&&(this.#E?.hide(),this.#I=null,this.#k({hasSelectedText:!1}));return}if(this.#E?.hide(),this.#I=t,this.#k({hasSelectedText:!0}),!(this.#P!==ve.HIGHLIGHT&&this.#P!==ve.NONE)&&(this.#P===ve.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#F=this.isShiftKeyDown,!this.isShiftKeyDown)){let s=this.#P===ve.HIGHLIGHT?this.#K(i):null;s?.toggleDrawing();let a=new AbortController,o=this.combinedSignal(a),l=u=>{u.type==="pointerup"&&u.button!==0||(a.abort(),s?.toggleDrawing(!0),u.type==="pointerup"&&this.#W("main_toolbar"))};window.addEventListener("pointerup",l,{signal:o}),window.addEventListener("blur",l,{signal:o})}}#W(e=""){this.#P===ve.HIGHLIGHT?this.highlightSelection(e):this.#m&&this.#$()}#te(){document.addEventListener("selectionchange",this.#ee.bind(this),{signal:this._signal})}#re(){if(this.#x)return;this.#x=new AbortController;let e=this.combinedSignal(this.#x);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#ne(){this.#x?.abort(),this.#x=null}blur(){if(this.isShiftKeyDown=!1,this.#F&&(this.#F=!1,this.#W("main_toolbar")),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#b)if(t.div.contains(e)){this.#R=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#R)return;let[e,t]=this.#R;this.#R=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#X(){if(this.#D)return;this.#D=new AbortController;let e=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#ie(){this.#D?.abort(),this.#D=null}#Y(){if(this.#d)return;this.#d=new AbortController;let e=this.combinedSignal(this.#d);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#Z(){this.#d?.abort(),this.#d=null}#se(){let e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#X(),this.#Y()}removeEditListeners(){this.#ie(),this.#Z()}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#a)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#a)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let n of this.#b){let i=n.serialize(!0);i&&t.push(i)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let s of t.items)for(let a of this.#a)if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(s){fe(`paste: "${s.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let i=this.currentLayer;try{let s=[];for(let l of n){let u=await i.deserialize(l);if(!u)return;s.push(u)}let a=()=>{for(let l of s)this.#J(l);this.#Q(s)},o=()=>{for(let l of s)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){fe(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#P!==ve.NONE&&!this.isEditorHandlingKeyboard&&r._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#F&&(this.#F=!1,this.#W("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#k(e){Object.entries(e).some(([n,i])=>this.#V[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#V,e)}),this.#P===ve.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#U([[Pe.HIGHLIGHT_FREE,!0]]))}#U(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#Y(),this.#k({isEditing:this.#P!==ve.NONE,isEmpty:this.#G(),hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:this.#o.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#Z(),this.#k({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#a){this.#a=e;for(let t of this.#a)this.#U(t.defaultPropertiesToUpdate)}}getId(){return this.#T.id}get currentLayer(){return this.#n.get(this.#h)}getLayer(e){return this.#n.get(e)}get currentPageIndex(){return this.#h}addLayer(e){this.#n.set(e.pageIndex,e),this.#A?e.enable():e.disable()}removeLayer(e){this.#n.delete(e.pageIndex)}async updateMode(e,t=null,n=!1){if(this.#P!==e&&!(this.#_&&(await this.#_.promise,!this.#_))){if(this.#_=Promise.withResolvers(),this.#P=e,e===ve.NONE){this.setEditingState(!1),this.#oe(),this._editorUndoBar?.hide(),this.#_.resolve();return}this.setEditingState(!0),await this.#ae(),this.unselectAll();for(let i of this.#n.values())i.updateMode(e);if(!t){n&&this.addNewEditorFromKeyboard(),this.#_.resolve();return}for(let i of this.#r.values())i.annotationElementId===t?(this.setSelected(i),i.enterInEditMode()):i.unselect();this.#_.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#P&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#a){switch(e){case Pe.CREATE:this.currentLayer.addNewEditor();return;case Pe.HIGHLIGHT_DEFAULT_COLOR:this.#O?.updateColor(t);break;case Pe.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#z||=new Map).set(e,t),this.showAllEditors("highlight",t);break}for(let n of this.#b)n.updateParams(e,t);for(let n of this.#a)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let s of this.#r.values())s.editorType===e&&s.show(t);(this.#z?.get(Pe.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#U([[Pe.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#C!==e){this.#C=e;for(let t of this.#n.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#ae(){if(!this.#A){this.#A=!0;let e=[];for(let t of this.#n.values())e.push(t.enable());await Promise.all(e);for(let t of this.#r.values())t.enable()}}#oe(){if(this.unselectAll(),this.#A){this.#A=!1;for(let e of this.#n.values())e.disable();for(let e of this.#r.values())e.disable()}}getEditors(e){let t=[];for(let n of this.#r.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.focusMainContainer(),this.#y=null},0)),this.#r.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#c.has(e.annotationElementId))&&this.#i?.remove(e.id)}addDeletedAnnotationElement(e){this.#c.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#c.has(e)}removeDeletedAnnotationElement(e){this.#c.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#J(e){let t=this.#n.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#U(e.propertiesToUpdate))}get#le(){let e=null;for(e of this.#b);return e}updateUI(e){this.#le===e&&this.#U(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#U(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#b.has(e)){this.#b.delete(e),e.unselect(),this.#k({hasSelectedEditor:this.hasSelection});return}this.#b.add(e),e.select(),this.#U(e.propertiesToUpdate),this.#k({hasSelectedEditor:!0})}setSelected(e){this.#u?.commitOrRemove();for(let t of this.#b)t!==e&&t.unselect();this.#b.clear(),this.#b.add(e),e.select(),this.#U(e.propertiesToUpdate),this.#k({hasSelectedEditor:!0})}isSelected(e){return this.#b.has(e)}get firstSelectedEditor(){return this.#b.values().next().value}unselect(e){e.unselect(),this.#b.delete(e),this.#k({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#b.size!==0}get isEnterHandled(){return this.#b.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#o.undo(),this.#k({hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#G()}),this._editorUndoBar?.hide()}redo(){this.#o.redo(),this.#k({hasSomethingToUndo:!0,hasSomethingToRedo:this.#o.hasSomethingToRedo(),isEmpty:this.#G()})}addCommands(e){this.#o.add(e),this.#k({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#G()})}cleanUndoStack(e){this.#o.cleanType(e)}#G(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#b],n=()=>{this._editorUndoBar?.show(i,t.length===1?t[0].editorType:t.length);for(let s of t)s.remove()},i=()=>{for(let s of t)this.#J(s)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#Q(e){for(let t of this.#b)t.unselect();this.#b.clear();for(let t of e)t.isEmpty()||(this.#b.add(t),t.select());this.#k({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#b)e.commit();this.#Q(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#P!==ve.NONE))&&!this.#u?.commitOrRemove()&&this.hasSelection){for(let e of this.#b)e.unselect();this.#b.clear(),this.#k({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#L[0]+=e,this.#L[1]+=t;let[i,s]=this.#L,a=[...this.#b],o=1e3;this.#M&&clearTimeout(this.#M),this.#M=setTimeout(()=>{this.#M=null,this.#L[0]=this.#L[1]=0,this.addCommands({cmd:()=>{for(let l of a)this.#r.has(l.id)&&l.translateInPage(i,s)},undo:()=>{for(let l of a)this.#r.has(l.id)&&l.translateInPage(-i,-s)},mustExec:!1})},o);for(let l of a)l.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#f=new Map;for(let e of this.#b)this.#f.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#f)return!1;this.disableUserSelect(!1);let e=this.#f;this.#f=null;let t=!1;for(let[{x:i,y:s,pageIndex:a},o]of e)o.newX=i,o.newY=s,o.newPageIndex=a,t||=i!==o.savedX||s!==o.savedY||a!==o.savedPageIndex;if(!t)return!1;let n=(i,s,a,o)=>{if(this.#r.has(i.id)){let l=this.#n.get(o);l?i._setParentAndPosition(l,s,a):(i.pageIndex=o,i.x=s,i.y=a)}};return this.addCommands({cmd:()=>{for(let[i,{newX:s,newY:a,newPageIndex:o}]of e)n(i,s,a,o)},undo:()=>{for(let[i,{savedX:s,savedY:a,savedPageIndex:o}]of e)n(i,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#f)for(let n of this.#f.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#b.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#P}get imageManager(){return xe(this,"imageManager",new Gh)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let u=0,d=t.rangeCount;u<d;u++)if(!e.contains(t.getRangeAt(u).commonAncestorContainer))return null;let{x:n,y:i,width:s,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute("data-main-rotation")){case"90":o=(u,d,c,h)=>({x:(d-i)/a,y:1-(u+c-n)/s,width:h/a,height:c/s});break;case"180":o=(u,d,c,h)=>({x:1-(u+c-n)/s,y:1-(d+h-i)/a,width:c/s,height:h/a});break;case"270":o=(u,d,c,h)=>({x:1-(d+h-i)/a,y:(u-n)/s,width:h/a,height:c/s});break;default:o=(u,d,c,h)=>({x:(u-n)/s,y:(d-i)/a,width:c/s,height:h/a});break}let l=[];for(let u=0,d=t.rangeCount;u<d;u++){let c=t.getRangeAt(u);if(!c.collapsed)for(let{x:h,y:f,width:p,height:g}of c.getClientRects())p===0||g===0||l.push(o(h,f,p,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#l||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#l?.delete(e)}renderAnnotationElement(e){let t=this.#l?.get(e.data.id);if(!t)return;let n=this.#i.getRawValue(t);n&&(this.#P===ve.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}},hu=class r{#e=null;#t=!1;#r=null;#n=null;#s=null;#i=null;#l=!1;#o=null;#d=null;#u=null;#h=null;#c=!1;static#f=null;static _l10n=null;constructor(e){this.#d=e,this.#c=e._uiManager.useNewAltTextFlow,r.#f||=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(e){r._l10n??=e}async render(){let e=this.#r=document.createElement("button");e.className="altText",e.tabIndex="0";let t=this.#n=document.createElement("span");e.append(t),this.#c?(e.classList.add("new"),e.setAttribute("data-l10n-id",r.#f.missing),t.setAttribute("data-l10n-id",r.#f["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let n=this.#d._uiManager._signal;e.addEventListener("contextmenu",tn,{signal:n}),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:n});let i=s=>{s.preventDefault(),this.#d._uiManager.editAltText(this.#d),this.#c&&this.#d._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#a}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(this.#l=!0,i(s))},{signal:n}),await this.#p(),e}get#a(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#r&&(this.#r.focus({focusVisible:this.#l}),this.#l=!1)}isEmpty(){return this.#c?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#c?this.#e!==null||!!this.#u:this.isEmpty()}get guessedText(){return this.#u}async setGuessedText(e){this.#e===null&&(this.#u=e,this.#h=await r._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#p())}toggleAltTextBadge(e=!1){if(!this.#c||this.#e){this.#o?.remove(),this.#o=null;return}if(!this.#o){let t=this.#o=document.createElement("div");t.className="noAltTextBadge",this.#d.div.append(t)}this.#o.classList.toggle("hidden",!e)}serialize(e){let t=this.#e;return!e&&this.#u===t&&(t=this.#h),{altText:t,decorative:this.#t,guessedText:this.#u,textWithDisclaimer:this.#h}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:i,cancel:s=!1}){n&&(this.#u=n,this.#h=i),!(this.#e===e&&this.#t===t)&&(s||(this.#e=e,this.#t=t),this.#p())}toggle(e=!1){this.#r&&(!e&&this.#i&&(clearTimeout(this.#i),this.#i=null),this.#r.disabled=!e)}shown(){this.#d._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#a}})}destroy(){this.#r?.remove(),this.#r=null,this.#n=null,this.#s=null,this.#o?.remove(),this.#o=null}async#p(){let e=this.#r;if(!e)return;if(this.#c){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",r.#f[this.#a]),this.#n?.setAttribute("data-l10n-id",r.#f[`${this.#a}-label`]),!this.#e){this.#s?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#s?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#s;if(!t){this.#s=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#d.id}`;let i=100,s=this.#d._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout(this.#i),this.#i=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#i=setTimeout(()=>{this.#i=null,this.#s.classList.add("show"),this.#d._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:s}),e.addEventListener("mouseleave",()=>{this.#i&&(clearTimeout(this.#i),this.#i=null),this.#s?.classList.remove("show")},{signal:s})}this.#t?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#e),t.parentNode||e.append(t),this.#d.getImageForAltText()?.setAttribute("aria-describedby",t.id)}},fu=class r{#e;#t=!1;#r=null;#n;#s;#i;#l;#o;#d=null;#u;#h=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#r=n,this.#n=t,this.#s=i,this.#i=s,this.#l=a,this.#u=new AbortController,this.#o=AbortSignal.any([o,this.#u.signal]),e.addEventListener("touchstart",this.#c.bind(this),{passive:!1,signal:this.#o})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return xe(this,"MIN_TOUCH_DISTANCE_TO_PINCH",35/(window.devicePixelRatio||1))}#c(e){if(this.#n?.()||e.touches.length<2)return;if(!this.#h){this.#h=new AbortController;let i=AbortSignal.any([this.#o,this.#h.signal]),s=this.#e,a={signal:i,passive:!1};s.addEventListener("touchmove",this.#f.bind(this),a),s.addEventListener("touchend",this.#a.bind(this),a),s.addEventListener("touchcancel",this.#a.bind(this),a),this.#s?.()}if(Dr(e),e.touches.length!==2||this.#r?.()){this.#d=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#d={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#f(e){if(!this.#d||e.touches.length!==2)return;let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);let{screenX:i,screenY:s}=t,{screenX:a,screenY:o}=n,l=this.#d,{touch0X:u,touch0Y:d,touch1X:c,touch1Y:h}=l,f=c-u,p=h-d,g=a-i,v=o-s,m=Math.hypot(g,v)||1,y=Math.hypot(f,p)||1;if(!this.#t&&Math.abs(y-m)<=r.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=s,l.touch1X=a,l.touch1Y=o,e.preventDefault(),!this.#t){this.#t=!0;return}let w=[(i+a)/2,(s+o)/2];this.#i?.(w,y,m)}#a(e){this.#h.abort(),this.#h=null,this.#l?.(),this.#d&&(e.preventDefault(),this.#d=null,this.#t=!1)}destroy(){this.#u?.abort(),this.#u=null}},it=class r{#e=null;#t=null;#r=null;#n=!1;#s=null;#i="";#l=!1;#o=null;#d=null;#u=null;#h=null;#c="";#f=!1;#a=null;#p=!1;#m=!1;#g=!1;#v=null;#w=0;#y=0;#x=null;#S=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#F=!1;#E=r._zIndex++;static _borderLineWidth=-1;static _colorManager=new Kh;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let e=r.prototype._resizeWithKeyboard,t=$i.TRANSLATE_SMALL,n=$i.TRANSLATE_BIG;return xe(this,"_resizerKeyboardManager",new Qi([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],r.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;let{rotation:t,rawDims:{pageWidth:n,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[s,a];let[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return xe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new Xh({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(r._l10n??=e,r._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"}),r._borderLineWidth!==-1)return;let n=getComputedStyle(document.documentElement);r._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){He("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#F}set _isDraggable(e){this.#F=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#E}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#B(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#f?this.#f=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,i){let[s,a]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/s,this.y=(t+i)/a,this.fixAndSetPosition()}#T([e,t],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#T(this.parentDimensions,e,t)}translateInPage(e,t){this.#a||=[this.x,this.y,this.width,this.height],this.#T(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){this.#a||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[i,s]}=this;if(this.x+=e/i,this.y+=t/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:c,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[l,u]=this.getBaseTranslation();a+=l,o+=u;let{style:d}=n;d.left=`${(100*a).toFixed(2)}%`,d.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}get _hasBeenResized(){return!!this.#a&&(this.#a[2]!==this.width||this.#a[3]!==this.height)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:n}=r,i=n/e,s=n/t;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,i]}=this,{x:s,y:a,width:o,height:l}=this;if(o*=n,l*=i,s*=n,a*=i,this._mustFixPosition)switch(e){case 0:s=Math.max(0,Math.min(n-o,s)),a=Math.max(0,Math.min(i-l,a));break;case 90:s=Math.max(0,Math.min(n-l,s)),a=Math.min(i,Math.max(o,a));break;case 180:s=Math.min(n,Math.max(o,s)),a=Math.min(i,Math.max(l,a));break;case 270:s=Math.min(n,Math.max(l,s)),a=Math.max(0,Math.min(i-o,a));break}this.x=s/=n,this.y=a/=i;let[u,d]=this.getBaseTranslation();s+=u,a+=d,t.left=`${(100*s).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#A(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return r.#A(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return r.#A(e,t,360-this.parentRotation)}#C(e){switch(e){case 90:{let[t,n]=this.pageDimensions;return[0,-t/n,n/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,n]=this.pageDimensions;return[0,t/n,-n/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(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(e,t){let[n,i]=this.parentDimensions,{style:s}=this.div;s.width=`${(100*e/n).toFixed(2)}%`,this.#l||(s.height=`${(100*t/i).toFixed(2)}%`)}fixDims(){let{style:e}=this.div,{height:t,width:n}=e,i=n.endsWith("%"),s=!this.#l&&t.endsWith("%");if(i&&s)return;let[a,o]=this.parentDimensions;i||(e.width=`${(100*parseFloat(n)/a).toFixed(2)}%`),!this.#l&&!s&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#D(){if(this.#o)return;this.#o=document.createElement("div"),this.#o.classList.add("resizers");let e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(let n of e){let i=document.createElement("div");this.#o.append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",this.#R.bind(this,n),{signal:t}),i.addEventListener("contextmenu",tn,{signal:t}),i.tabIndex=-1}this.div.prepend(this.#o)}#R(e,t){t.preventDefault();let{isMac:n}=Nt.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#r?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,this.#d=[t.screenX,t.screenY];let s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#P.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Dr,{passive:!1,signal:a}),window.addEventListener("contextmenu",tn,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let u=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#r?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,this.#N()};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}#O(e,t,n,i){this.width=n,this.height=i,this.x=e,this.y=t;let[s,a]=this.parentDimensions;this.setDims(s*n,a*i),this.fixAndSetPosition(),this._onResized()}_onResized(){}#N(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:i}=this.#u;this.#u=null;let s=this.x,a=this.y,o=this.width,l=this.height;s===e&&a===t&&o===n&&l===i||this.addCommands({cmd:this.#O.bind(this,s,a,o,l),undo:this.#O.bind(this,e,t,n,i),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#P(e,t){let[n,i]=this.parentDimensions,s=this.x,a=this.y,o=this.width,l=this.height,u=r.MIN_SIZE/n,d=r.MIN_SIZE/i,c=this.#C(this.rotation),h=(O,R)=>[c[0]*O+c[2]*R,c[1]*O+c[3]*R],f=this.#C(360-this.rotation),p=(O,R)=>[f[0]*O+f[2]*R,f[1]*O+f[3]*R],g,v,m=!1,y=!1;switch(e){case"topLeft":m=!0,g=(O,R)=>[0,0],v=(O,R)=>[O,R];break;case"topMiddle":g=(O,R)=>[O/2,0],v=(O,R)=>[O/2,R];break;case"topRight":m=!0,g=(O,R)=>[O,0],v=(O,R)=>[0,R];break;case"middleRight":y=!0,g=(O,R)=>[O,R/2],v=(O,R)=>[0,R/2];break;case"bottomRight":m=!0,g=(O,R)=>[O,R],v=(O,R)=>[0,0];break;case"bottomMiddle":g=(O,R)=>[O/2,R],v=(O,R)=>[O/2,0];break;case"bottomLeft":m=!0,g=(O,R)=>[0,R],v=(O,R)=>[O,0];break;case"middleLeft":y=!0,g=(O,R)=>[0,R/2],v=(O,R)=>[O,R/2];break}let w=g(o,l),x=v(o,l),b=h(...x),A=r._round(s+b[0]),S=r._round(a+b[1]),P=1,F=1,k,D;if(t.fromKeyboard)({deltaX:k,deltaY:D}=t);else{let{screenX:O,screenY:R}=t,[J,le]=this.#d;[k,D]=this.screenToPageTranslation(O-J,R-le),this.#d[0]=O,this.#d[1]=R}if([k,D]=p(k/n,D/i),m){let O=Math.hypot(o,l);P=F=Math.max(Math.min(Math.hypot(x[0]-w[0]-k,x[1]-w[1]-D)/O,1/o,1/l),u/o,d/l)}else y?P=Math.max(u,Math.min(1,Math.abs(x[0]-w[0]-k)))/o:F=Math.max(d,Math.min(1,Math.abs(x[1]-w[1]-D)))/l;let _=r._round(o*P),B=r._round(l*F);b=h(...v(_,B));let N=A-b[0],G=S-b[1];this.#a||=[this.x,this.y,this.width,this.height],this.width=_,this.height=B,this.x=N,this.y=G,this.setDims(n*_,i*B),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#r?.finish()}async addEditToolbar(){return this._editToolbar||this.#m?this._editToolbar:(this._editToolbar=new zh(this),this.div.append(this._editToolbar.render()),this.#r&&await this._editToolbar.addAltText(this.#r),this._editToolbar)}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#r?.destroy())}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#r||(hu.initialize(r._l10n),this.#r=new hu(this),this.#e&&(this.#r.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#r?.data}set altTextData(e){this.#r&&(this.#r.data=e)}get guessedAltText(){return this.#r?.guessedText}async setGuessedAltText(e){await this.#r?.setGuessedText(e)}serializeAltText(e){return this.#r?.serialize(e)}hasAltText(){return!!this.#r&&!this.#r.isEmpty()}hasAltTextData(){return this.#r?.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.#n?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#L();let[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);let[n,i]=this.getInitialTranslation();return this.translate(n,i),cu(this,this.div,["pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#S||=new fu({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#b.bind(this),onPinching:this.#I.bind(this),onPinchEnd:this.#q.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),this.div}#b(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#r?.toggle(!1),this.parent.togglePointerEvents(!1)}#I(e,t,n){let s=.7*(n/t)+1-.7;if(s===1)return;let a=this.#C(this.rotation),o=(A,S)=>[a[0]*A+a[2]*S,a[1]*A+a[3]*S],[l,u]=this.parentDimensions,d=this.x,c=this.y,h=this.width,f=this.height,p=r.MIN_SIZE/l,g=r.MIN_SIZE/u;s=Math.max(Math.min(s,1/h,1/f),p/h,g/f);let v=r._round(h*s),m=r._round(f*s);if(v===h&&m===f)return;this.#a||=[d,c,h,f];let y=o(h/2,f/2),w=r._round(d+y[0]),x=r._round(c+y[1]),b=o(v/2,m/2);this.x=w-b[0],this.y=x-b[1],this.width=v,this.height=m,this.setDims(l*v,u*m),this.fixAndSetPosition(),this._onResizing()}#q(){this.#r?.toggle(!0),this.parent.togglePointerEvents(!0),this.#N()}pointerdown(e){let{isMac:t}=Nt.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#f=!0,this._isDraggable){this.#V(e);return}this.#z(e)}get isSelected(){return this._uiManager.isSelected(this)}#z(e){let{isMac:t}=Nt.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#V(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,i=new AbortController,s=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:s},o=u=>{i.abort(),this.#s=null,this.#f=!1,this._uiManager.endDragSession()||this.#z(u),n&&this._onStopDragging()};t&&(this.#w=e.clientX,this.#y=e.clientY,this.#s=e.pointerId,this.#i=e.pointerType,window.addEventListener("pointermove",u=>{n||(n=!0,this._onStartDragging());let{clientX:d,clientY:c,pointerId:h}=u;if(h!==this.#s){Dr(u);return}let[f,p]=this.screenToPageTranslation(d-this.#w,c-this.#y);this.#w=d,this.#y=c,this._uiManager.dragSelectedEditors(f,p)},a),window.addEventListener("touchmove",Dr,a),window.addEventListener("pointerdown",u=>{u.pointerType===this.#i&&(this.#S||u.isPrimary)&&o(u),Dr(u)},a));let l=u=>{if(!this.#s||this.#s===u.pointerId){o(u);return}Dr(u)};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#v&&clearTimeout(this.#v),this.#v=setTimeout(()=>{this.#v=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let i=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,u=e/i,d=t/i,c=this.x*s,h=this.y*a,f=this.width*s,p=this.height*a;switch(n){case 0:return[c+u+o,a-h-d-p+l,c+u+f+o,a-h-d+l];case 90:return[c+d+o,a-h+u+l,c+d+p+o,a-h+u+f+l];case 180:return[c-u-f+o,a-h+d+l,c-u+o,a-h+d+p+l];case 270:return[c-d-p+o,a-h-u-f+l,c-d+o,a-h-u+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){let[n,i,s,a]=e,o=s-n,l=a-i;switch(this.rotation){case 0:return[n,t-a,o,l];case 90:return[n,t-i,l,o];case 180:return[s,t-i,o,l];case 270:return[s,t-a,l,o];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){this.#m=!0}disableEditMode(){this.#m=!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#g}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return t<a&&i>0&&e<s&&n>0}#L(){if(this.#h||!this.div)return;this.#h=new AbortController;let e=this._uiManager.combinedSignal(this.#h);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#L()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){He("An editor must be serializable")}static async deserialize(e,t,n){let i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});i.rotation=e.rotation,i.#e=e.accessibilityData;let[s,a]=i.pageDimensions,[o,l,u,d]=i.getRectInCurrentCoords(e.rect,a);return i.x=o/s,i.y=l/a,i.width=u/s,i.height=d/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#h?.abort(),this.#h=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#v&&(clearTimeout(this.#v),this.#v=null),this.#B(),this.removeEditToolbar(),this.#x){for(let e of this.#x.values())clearTimeout(e);this.#x=null}this.parent=null,this.#S?.destroy(),this.#S=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#D(),this.#o.classList.remove("hidden"),cu(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let t=this.#o.children;if(!this.#t){this.#t=Array.from(t);let a=this.#M.bind(this),o=this.#j.bind(this),l=this._uiManager._signal;for(let u of this.#t){let d=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",a,{signal:l}),u.addEventListener("blur",o,{signal:l}),u.addEventListener("focus",this.#H.bind(this,d),{signal:l}),u.setAttribute("data-l10n-id",r._l10nResizer[d])}}let n=this.#t[0],i=0;for(let a of t){if(a===n)break;i++}let s=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(s!==i){if(s<i)for(let o=0;o<i-s;o++)this.#o.append(this.#o.firstChild);else if(s>i)for(let o=0;o<s-i;o++)this.#o.firstChild.before(this.#o.lastChild);let a=0;for(let o of t){let u=this.#t[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",r._l10nResizer[u])}}this.#_(0),this.#g=!0,this.#o.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#M(e){r._resizerKeyboardManager.exec(this,e)}#j(e){this.#g&&e.relatedTarget?.parentNode!==this.#o&&this.#B()}#H(e){this.#c=this.#g?e:""}#_(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#g&&this.#P(this.#c,{deltaX:e,deltaY:t,fromKeyboard:!0})}#B(){this.#g=!1,this.#_(-1),this.#N()}_stopResizingWithKeyboard(){this.#B(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#r?.toggleAltTextBadge(!1)}unselect(){this.#o?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#r?.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#p}set isEditing(e){this.#p=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#l=!0;let n=e/t,{style:i}=this.div;i.aspectRatio=n,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#x||=new Map;let{action:n}=e,i=this.#x.get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#x.delete(n),this.#x.size===0&&(this.#x=null)},r._telemetryTimeout),this.#x.set(n,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){let n=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),n.before(t)}return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}},Xh=class extends it{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},my=3285377520,Br=4294901760,mn=65535,pu=class{constructor(e){this.h1=e?e&4294967295:my,this.h2=e?e&4294967295:my}update(e){let t,n;if(typeof e=="string"){t=new Uint8Array(e.length*2),n=0;for(let g=0,v=e.length;g<v;g++){let m=e.charCodeAt(g);m<=255?t[n++]=m:(t[n++]=m>>>8,t[n++]=m&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let i=n>>2,s=n-i*4,a=new Uint32Array(t.buffer,0,i),o=0,l=0,u=this.h1,d=this.h2,c=3432918353,h=461845907,f=c&mn,p=h&mn;for(let g=0;g<i;g++)g&1?(o=a[g],o=o*c&Br|o*f&mn,o=o<<15|o>>>17,o=o*h&Br|o*p&mn,u^=o,u=u<<13|u>>>19,u=u*5+3864292196):(l=a[g],l=l*c&Br|l*f&mn,l=l<<15|l>>>17,l=l*h&Br|l*p&mn,d^=l,d=d<<13|d>>>19,d=d*5+3864292196);switch(o=0,s){case 3:o^=t[i*4+2]<<16;case 2:o^=t[i*4+1]<<8;case 1:o^=t[i*4],o=o*c&Br|o*f&mn,o=o<<15|o>>>17,o=o*h&Br|o*p&mn,i&1?u^=o:d^=o}this.h1=u,this.h2=d}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Br|e*36045&mn,t=t*4283543511&Br|((t<<16|e>>>16)*2950163797&Br)>>>16,e^=t>>>1,e=e*444984403&Br|e*60499&mn,t=t*3301882366&Br|((t<<16|e>>>16)*3120437893&Br)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},Yh=Object.freeze({map:null,hash:"",transfer:void 0}),yo=class{#e=!1;#t=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){if(this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(let t of this.#r.values())if(t instanceof it)return;this.onAnnotationEditor(null)}}setValue(e,t){let n=this.#r.get(e),i=!1;if(n!==void 0)for(let[s,a]of Object.entries(t))n[s]!==a&&(i=!0,n[s]=a);else i=!0,this.#r.set(e,t);i&&this.#n(),t instanceof it&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#r.has(e)}getAll(){return this.#r.size>0?up(this.#r):null}setAll(e){for(let[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#r.size}#n(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new gu(this)}get serializable(){if(this.#r.size===0)return Yh;let e=new Map,t=new pu,n=[],i=Object.create(null),s=!1;for(let[a,o]of this.#r){let l=o instanceof it?o.serialize(!1,i):o;l&&(e.set(a,l),t.update(`${a}:${JSON.stringify(l)}`),s||=!!l.bitmap)}if(s)for(let a of e.values())a.bitmap&&n.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:Yh}get editorStats(){let e=null,t=new Map;for(let n of this.#r.values()){if(!(n instanceof it))continue;let i=n.telemetryFinalData;if(!i)continue;let{type:s}=i;t.has(s)||t.set(s,Object.getPrototypeOf(n).constructor),e||=Object.create(null);let a=e[s]||=new Map;for(let[o,l]of Object.entries(i)){if(o==="type")continue;let u=a.get(o);u||(u=new Map,a.set(o,u));let d=u.get(l)??0;u.set(l,d+1)}}for(let[n,i]of t)e[n]=i.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;let e=[];for(let t of this.#r.values())!(t instanceof it)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}},gu=class extends yo{#e;constructor(e){super();let{map:t,hash:n,transfer:i}=e.serializable,s=structuredClone(t,i?{transfer:i}:null);this.#e={map:s,hash:n,transfer:i}}get print(){He("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return xe(this,"modifiedIds",{ids:new Set,hash:""})}},Zh=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(!(!e||this.#e.has(e.loadedName))){if(yt(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:n,src:i,style:s}=e,a=new FontFace(n,i,s);this.addNativeFontFace(a);try{await a.load(),this.#e.add(n),t?.(e)}catch{fe(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}He("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw fe(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{let i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return xe(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Kt||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),xe(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function t(){for(yt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){let s=n.shift();setTimeout(s.callback,0)}}let{loadingRequests:n}=this,i={done:!1,complete:t,callback:e};return n.push(i),i}get _loadTestFont(){let e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return xe(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(x,b){return x.charCodeAt(b)<<24|x.charCodeAt(b+1)<<16|x.charCodeAt(b+2)<<8|x.charCodeAt(b+3)&255}function i(x,b,A,S){let P=x.substring(0,b),F=x.substring(b+A);return P+S+F}let s,a,o=this._document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d"),u=0;function d(x,b){if(++u>30){fe("Load test font never loaded."),b();return}if(l.font="30px "+x,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){b();return}setTimeout(d.bind(null,x,b))}let c=`lt${Date.now()}${this.loadTestFontId++}`,h=this._loadTestFont;h=i(h,976,c.length,c);let p=16,g=1482184792,v=n(h,p);for(s=0,a=c.length-3;s<a;s+=4)v=v-g+n(c,s)|0;s<c.length&&(v=v-g+n(c+"XXX",s)|0),h=i(h,p,4,hF(v));let m=`url(data:font/opentype;base64,${btoa(h)});`,y=`@font-face {font-family:"${c}";src:${m}}`;this.insertRule(y);let w=this._document.createElement("div");w.style.visibility="hidden",w.style.width=w.style.height="10px",w.style.position="absolute",w.style.top=w.style.left="0px";for(let x of[e.loadedName,c]){let b=this._document.createElement("span");b.textContent="Hi",b.style.fontFamily=x,w.append(b)}this._document.body.append(w),d(c,()=>{w.remove(),t.complete()})}},Jh=class{constructor(e,{disableFontFace:t=!1,fontExtraProperties:n=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(let s in e)this[s]=e[s];this.disableFontFace=t===!0,this.fontExtraProperties=n===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${yF(this.data)});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+"_path_"+t,i;try{i=e.get(n)}catch(a){fe(`getPathGenerator - ignoring character: "${a}".`)}let s=new Path2D(i||"");return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=s}},ru={DATA:1,ERROR:2},vt={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function vy(){}function ur(r){if(r instanceof vn||r instanceof po||r instanceof Zi||r instanceof lu||r instanceof Gs||r instanceof fo)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||He('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new vn(r.message);case"InvalidPDFException":return new po(r.message);case"MissingPDFException":return new Zi(r.message);case"PasswordException":return new lu(r.message,r.code);case"UnexpectedResponseException":return new Gs(r.message,r.status);case"UnknownErrorException":return new fo(r.message,r.details)}return new fo(r.message,r.toString())}var Xi=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#n(e);return}if(e.callback){let n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===ru.DATA)i.resolve(e.data);else if(e.callback===ru.ERROR)i.reject(ur(e.reason));else throw new Error("Unexpected callback case");return}let t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,i=e.sourceName,s=this.comObj;Promise.try(t,e.data).then(function(a){s.postMessage({sourceName:n,targetName:i,callback:ru.DATA,callbackId:e.callbackId,data:a})},function(a){s.postMessage({sourceName:n,targetName:i,callback:ru.ERROR,callbackId:e.callbackId,reason:ur(a)})});return}if(e.streamId){this.#r(e);return}t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let i=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(a){s.reject(a)}return s.promise}sendWithStream(e,t,n,i){let s=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:u=>{let d=Promise.withResolvers();return this.streamControllers[s]={controller:u,startCall:d,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:s,data:t,desiredSize:u.desiredSize},i),d.promise},pull:u=>{let d=Promise.withResolvers();return this.streamControllers[s].pullCall=d,l.postMessage({sourceName:a,targetName:o,stream:vt.PULL,streamId:s,desiredSize:u.desiredSize}),d.promise},cancel:u=>{yt(u instanceof Error,"cancel must have a valid reason");let d=Promise.withResolvers();return this.streamControllers[s].cancelCall=d,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:vt.CANCEL,streamId:s,reason:ur(u)}),d.promise}},n)}#r(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,s=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(u,d=1,c){if(this.isCancelled)return;let h=this.desiredSize;this.desiredSize-=d,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:n,targetName:i,stream:vt.ENQUEUE,streamId:t,chunk:u},c)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:i,stream:vt.CLOSE,streamId:t}),delete a.streamSinks[t])},error(u){yt(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:n,targetName:i,stream:vt.ERROR,streamId:t,reason:ur(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,Promise.try(o,e.data,l).then(function(){s.postMessage({sourceName:n,targetName:i,stream:vt.START_COMPLETE,streamId:t,success:!0})},function(u){s.postMessage({sourceName:n,targetName:i,stream:vt.START_COMPLETE,streamId:t,reason:ur(u)})})}#n(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,s=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case vt.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(ur(e.reason));break;case vt.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(ur(e.reason));break;case vt.PULL:if(!o){s.postMessage({sourceName:n,targetName:i,stream:vt.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||vy).then(function(){s.postMessage({sourceName:n,targetName:i,stream:vt.PULL_COMPLETE,streamId:t,success:!0})},function(u){s.postMessage({sourceName:n,targetName:i,stream:vt.PULL_COMPLETE,streamId:t,reason:ur(u)})});break;case vt.ENQUEUE:if(yt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case vt.CLOSE:if(yt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#s(a,t);break;case vt.ERROR:yt(a,"error should have stream controller"),a.controller.error(ur(e.reason)),this.#s(a,t);break;case vt.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(ur(e.reason)),this.#s(a,t);break;case vt.CANCEL:if(!o)break;let l=ur(e.reason);Promise.try(o.onCancel||vy,l).then(function(){s.postMessage({sourceName:n,targetName:i,stream:vt.CANCEL_COMPLETE,streamId:t,success:!0})},function(u){s.postMessage({sourceName:n,targetName:i,stream:vt.CANCEL_COMPLETE,streamId:t,reason:ur(u)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#s(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},mu=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){He("Abstract method `_createCanvas` called.")}},Qh=class extends mu{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement("canvas");return n.width=e,n.height=t,n}},vu=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");let t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){He("Abstract method `_fetch` called.")}},yu=class extends vu{async _fetch(e){let t=await Vu(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):zu(t)}},e3=De(4520),bu=class{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,n,i,s){return"none"}destroy(e=!1){}},$h=class extends bu{#e;#t;#r;#n;#s;#i;#l=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#n=e,this.#s=t}get#o(){return this.#t||=new Map}get#d(){return this.#i||=new Map}get#u(){if(!this.#r){let e=this.#s.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;let n=this.#s.createElementNS(jn,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#r=this.#s.createElementNS(jn,"defs"),e.append(n),n.append(this.#r),this.#s.body.append(e)}return this.#r}#h(e){if(e.length===1){let l=e[0],u=new Array(256);for(let c=0;c<256;c++)u[c]=l[c]/255;let d=u.join(",");return[d,d,d]}let[t,n,i]=e,s=new Array(256),a=new Array(256),o=new Array(256);for(let l=0;l<256;l++)s[l]=t[l]/255,a[l]=n[l]/255,o[l]=i[l]/255;return[s.join(","),a.join(","),o.join(",")]}#c(e){if(this.#e===void 0){this.#e="";let t=this.#s.URL;t!==this.#s.baseURI&&(Hu(t)?fe('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=t.split("#",1)[0])}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let t=this.#o.get(e);if(t)return t;let[n,i,s]=this.#h(e),a=e.length===1?n:`${n}${i}${s}`;if(t=this.#o.get(a),t)return this.#o.set(e,t),t;let o=`g_${this.#n}_transfer_map_${this.#l++}`,l=this.#c(o);this.#o.set(e,l),this.#o.set(a,l);let u=this.#p(o);return this.#g(n,i,s,u),l}addHCMFilter(e,t){let n=`${e}-${t}`,i="base",s=this.#d.get(i);if(s?.key===n||(s?(s.filter?.remove(),s.key=n,s.url="none",s.filter=null):(s={key:n,url:"none",filter:null},this.#d.set(i,s)),!e||!t))return s.url;let a=this.#w(e);e=Q.makeHexColor(...a);let o=this.#w(t);if(t=Q.makeHexColor(...o),this.#u.style.color="",e==="#000000"&&t==="#ffffff"||e===t)return s.url;let l=new Array(256);for(let f=0;f<=255;f++){let p=f/255;l[f]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}let u=l.join(","),d=`g_${this.#n}_hcm_filter`,c=s.filter=this.#p(d);this.#g(u,u,u,c),this.#a(c);let h=(f,p)=>{let g=a[f]/255,v=o[f]/255,m=new Array(p+1);for(let y=0;y<=p;y++)m[y]=g+y/p*(v-g);return m.join(",")};return this.#g(h(0,5),h(1,5),h(2,5),c),s.url=this.#c(d),s.url}addAlphaFilter(e){let t=this.#o.get(e);if(t)return t;let[n]=this.#h([e]),i=`alpha_${n}`;if(t=this.#o.get(i),t)return this.#o.set(e,t),t;let s=`g_${this.#n}_alpha_map_${this.#l++}`,a=this.#c(s);this.#o.set(e,a),this.#o.set(i,a);let o=this.#p(s);return this.#v(n,o),a}addLuminosityFilter(e){let t=this.#o.get(e||"luminosity");if(t)return t;let n,i;if(e?([n]=this.#h([e]),i=`luminosity_${n}`):i="luminosity",t=this.#o.get(i),t)return this.#o.set(e,t),t;let s=`g_${this.#n}_luminosity_map_${this.#l++}`,a=this.#c(s);this.#o.set(e,a),this.#o.set(i,a);let o=this.#p(s);return this.#f(o),e&&this.#v(n,o),a}addHighlightHCMFilter(e,t,n,i,s){let a=`${t}-${n}-${i}-${s}`,o=this.#d.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},this.#d.set(e,o)),!t||!n))return o.url;let[l,u]=[t,n].map(this.#w.bind(this)),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),c=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[h,f]=[i,s].map(this.#w.bind(this));c<d&&([d,c,h,f]=[c,d,f,h]),this.#u.style.color="";let p=(m,y,w)=>{let x=new Array(256),b=(c-d)/w,A=m/255,S=(y-m)/(255*w),P=0;for(let F=0;F<=w;F++){let k=Math.round(d+F*b),D=A+F*S;for(let _=P;_<=k;_++)x[_]=D;P=k+1}for(let F=P;F<256;F++)x[F]=x[P-1];return x.join(",")},g=`g_${this.#n}_hcm_${e}_filter`,v=o.filter=this.#p(g);return this.#a(v),this.#g(p(h[0],f[0],5),p(h[1],f[1],5),p(h[2],f[2],5),v),o.url=this.#c(g),o.url}destroy(e=!1){e&&this.#i?.size||(this.#r?.parentNode.parentNode.remove(),this.#r=null,this.#t?.clear(),this.#t=null,this.#i?.clear(),this.#i=null,this.#l=0)}#f(e){let t=this.#s.createElementNS(jn,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#a(e){let t=this.#s.createElementNS(jn,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#p(e){let t=this.#s.createElementNS(jn,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#u.append(t),t}#m(e,t,n){let i=this.#s.createElementNS(jn,t);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),e.append(i)}#g(e,t,n,i){let s=this.#s.createElementNS(jn,"feComponentTransfer");i.append(s),this.#m(s,"feFuncR",e),this.#m(s,"feFuncG",t),this.#m(s,"feFuncB",n)}#v(e,t){let n=this.#s.createElementNS(jn,"feComponentTransfer");t.append(n),this.#m(n,"feFuncA",e)}#w(e){return this.#u.style.color=e,hp(getComputedStyle(this.#u).getPropertyValue("color"))}},wu=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){He("Abstract method `_fetch` called.")}},xu=class extends wu{async _fetch(e){let t=await Vu(e,"arraybuffer");return new Uint8Array(t)}};if(Kt){let r;try{let e=process.getBuiltinModule("module").createRequire(Uy.url);try{r=e("@napi-rs/canvas")}catch(t){fe(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(e){fe(`Cannot access the \`require\` function: "${e}".`)}globalThis.DOMMatrix||(r?.DOMMatrix?globalThis.DOMMatrix=r.DOMMatrix:fe("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(r?.ImageData?globalThis.ImageData=r.ImageData:fe("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(r?.Path2D?globalThis.Path2D=r.Path2D:fe("Cannot polyfill `Path2D`, rendering may be broken."))}async function Ry(r){let t=await process.getBuiltinModule("fs").promises.readFile(r);return new Uint8Array(t)}var ef=class extends bu{},tf=class extends mu{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(Uy.url)("@napi-rs/canvas").createCanvas(e,t)}},rf=class extends vu{async _fetch(e){return Ry(e)}},nf=class extends wu{async _fetch(e){return Ry(e)}},Wt={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function sf(r,e){if(!e)return;let t=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,n),r.clip(i)}var bo=class{getPattern(){He("Abstract method `getPattern` called.")}},af=class extends bo{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let n of this._colorStops)t.addColorStop(n[0],n[1]);return t}getPattern(e,t,n,i){let s;if(i===Wt.STROKE||i===Wt.FILL){let a=t.current.getClippedPathBoundingBox(i,Ze(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,u=t.cachedCanvases.getCanvas("pattern",o,l),d=u.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-a[0],-a[1]),n=Q.transform(n,[1,0,0,1,a[0],a[1]]),d.transform(...t.baseTransform),this.matrix&&d.transform(...this.matrix),sf(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),s=e.createPattern(u.canvas,"no-repeat");let c=new DOMMatrix(n);s.setTransform(c)}else sf(e,this._bbox),s=this._createGradient(e);return s}};function Lh(r,e,t,n,i,s,a,o){let l=e.coords,u=e.colors,d=r.data,c=r.width*4,h;l[t+1]>l[n+1]&&(h=t,t=n,n=h,h=s,s=a,a=h),l[n+1]>l[i+1]&&(h=n,n=i,i=h,h=a,a=o,o=h),l[t+1]>l[n+1]&&(h=t,t=n,n=h,h=s,s=a,a=h);let f=(l[t]+e.offsetX)*e.scaleX,p=(l[t+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,v=(l[n+1]+e.offsetY)*e.scaleY,m=(l[i]+e.offsetX)*e.scaleX,y=(l[i+1]+e.offsetY)*e.scaleY;if(p>=y)return;let w=u[s],x=u[s+1],b=u[s+2],A=u[a],S=u[a+1],P=u[a+2],F=u[o],k=u[o+1],D=u[o+2],_=Math.round(p),B=Math.round(y),N,G,O,R,J,le,_e,Be;for(let we=_;we<=B;we++){if(we<v){let M=we<p?0:(p-we)/(p-v);N=f-(f-g)*M,G=w-(w-A)*M,O=x-(x-S)*M,R=b-(b-P)*M}else{let M;we>y?M=1:v===y?M=0:M=(v-we)/(v-y),N=g-(g-m)*M,G=A-(A-F)*M,O=S-(S-k)*M,R=P-(P-D)*M}let ye;we<p?ye=0:we>y?ye=1:ye=(p-we)/(p-y),J=f-(f-m)*ye,le=w-(w-F)*ye,_e=x-(x-k)*ye,Be=b-(b-D)*ye;let $r=Math.round(Math.min(N,J)),Ht=Math.round(Math.max(N,J)),W=c*we+$r*4;for(let M=$r;M<=Ht;M++)ye=(N-M)/(N-J),ye<0?ye=0:ye>1&&(ye=1),d[W++]=G-(G-le)*ye|0,d[W++]=O-(O-_e)*ye|0,d[W++]=R-(R-Be)*ye|0,d[W++]=255}}function SF(r,e,t){let n=e.coords,i=e.colors,s,a;switch(e.type){case"lattice":let o=e.verticesPerRow,l=Math.floor(n.length/o)-1,u=o-1;for(s=0;s<l;s++){let d=s*o;for(let c=0;c<u;c++,d++)Lh(r,t,n[d],n[d+1],n[d+o],i[d],i[d+1],i[d+o]),Lh(r,t,n[d+o+1],n[d+1],n[d+o],i[d+o+1],i[d+1],i[d+o])}break;case"triangles":for(s=0,a=n.length;s<a;s+=3)Lh(r,t,n[s],n[s+1],n[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}var of=class extends bo{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,n){let o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-o,d=Math.ceil(this._bounds[3])-l,c=Math.min(Math.ceil(Math.abs(u*e[0]*1.1)),3e3),h=Math.min(Math.ceil(Math.abs(d*e[1]*1.1)),3e3),f=u/c,p=d/h,g={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/f,scaleY:1/p},v=c+2*2,m=h+2*2,y=n.getCanvas("mesh",v,m),w=y.context,x=w.createImageData(c,h);if(t){let A=x.data;for(let S=0,P=A.length;S<P;S+=4)A[S]=t[0],A[S+1]=t[1],A[S+2]=t[2],A[S+3]=255}for(let A of this._figures)SF(x,A,g);return w.putImageData(x,2,2),{canvas:y.canvas,offsetX:o-2*f,offsetY:l-2*p,scaleX:f,scaleY:p}}getPattern(e,t,n,i){sf(e,this._bbox);let s;if(i===Wt.SHADING)s=Q.singularValueDecompose2dScale(Ze(e));else if(s=Q.singularValueDecompose2dScale(t.baseTransform),this.matrix){let o=Q.singularValueDecompose2dScale(this.matrix);s=[s[0]*o[0],s[1]*o[1]]}let a=this._createMeshCanvas(s,i===Wt.SHADING?null:this._background,t.cachedCanvases);return i!==Wt.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}},lf=class extends bo{getPattern(){return"hotpink"}};function PF(r){switch(r[0]){case"RadialAxial":return new af(r);case"Mesh":return new of(r);case"Dummy":return new lf}throw new Error(`Unknown IR type: ${r[0]}`)}var yy={COLORED:1,UNCOLORED:2},uf=class r{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,i,s){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=n,this.canvasGraphicsFactory=i,this.baseTransform=s}createPatternCanvas(e){let{bbox:t,operatorList:n,paintType:i,tilingType:s,color:a,canvasGraphicsFactory:o}=this,{xstep:l,ystep:u}=this;l=Math.abs(l),u=Math.abs(u),qu("TilingType: "+s);let d=t[0],c=t[1],h=t[2],f=t[3],p=h-d,g=f-c,v=Q.singularValueDecompose2dScale(this.matrix),m=Q.singularValueDecompose2dScale(this.baseTransform),y=v[0]*m[0],w=v[1]*m[1],x=p,b=g,A=!1,S=!1,P=Math.ceil(l*y),F=Math.ceil(u*w),k=Math.ceil(p*y),D=Math.ceil(g*w);P>=k?x=l:A=!0,F>=D?b=u:S=!0;let _=this.getSizeAndScale(x,this.ctx.canvas.width,y),B=this.getSizeAndScale(b,this.ctx.canvas.height,w),N=e.cachedCanvases.getCanvas("pattern",_.size,B.size),G=N.context,O=o.createCanvasGraphics(G);if(O.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(O,i,a),G.translate(-_.scale*d,-B.scale*c),O.transform(_.scale,0,0,B.scale,0,0),G.save(),this.clipBbox(O,d,c,h,f),O.baseTransform=Ze(O.ctx),O.executeOperatorList(n),O.endDrawing(),G.restore(),A||S){let R=N.canvas;A&&(x=l),S&&(b=u);let J=this.getSizeAndScale(x,this.ctx.canvas.width,y),le=this.getSizeAndScale(b,this.ctx.canvas.height,w),_e=J.size,Be=le.size,we=e.cachedCanvases.getCanvas("pattern-workaround",_e,Be),ye=we.context,$r=A?Math.floor(p/l):0,Ht=S?Math.floor(g/u):0;for(let W=0;W<=$r;W++)for(let M=0;M<=Ht;M++)ye.drawImage(R,_e*W,Be*M,_e,Be,0,0,_e,Be);return{canvas:we.canvas,scaleX:J.scale,scaleY:le.scale,offsetX:d,offsetY:c}}return{canvas:N.canvas,scaleX:_.scale,scaleY:B.scale,offsetX:d,offsetY:c}}getSizeAndScale(e,t,n){let i=Math.max(r.MAX_PATTERN_SIZE,t),s=Math.ceil(e*n);return s>=i?s=i:n=s/e,{scale:n,size:s}}clipBbox(e,t,n,i,s){let a=i-t,o=s-n;e.ctx.rect(t,n,a,o),e.current.updateRectMinMax(Ze(e.ctx),[t,n,i,s]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let i=e.ctx,s=e.current;switch(t){case yy.COLORED:let a=this.ctx;i.fillStyle=a.fillStyle,i.strokeStyle=a.strokeStyle,s.fillColor=a.fillStyle,s.strokeColor=a.strokeStyle;break;case yy.UNCOLORED:let o=Q.makeHexColor(n[0],n[1],n[2]);i.fillStyle=o,i.strokeStyle=o,s.fillColor=o,s.strokeColor=o;break;default:throw new qh(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,i){let s=n;i!==Wt.SHADING&&(s=Q.transform(s,t.baseTransform),this.matrix&&(s=Q.transform(s,this.matrix)));let a=this.createPatternCanvas(t),o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);let l=e.createPattern(a.canvas,"repeat");return l.setTransform(o),l}};function FF({src:r,srcPos:e=0,dest:t,width:n,height:i,nonBlackColor:s=4294967295,inverseDecode:a=!1}){let o=Nt.isLittleEndian?4278190080:255,[l,u]=a?[s,o]:[o,s],d=n>>3,c=n&7,h=r.length;t=new Uint32Array(t.buffer);let f=0;for(let p=0;p<i;p++){for(let v=e+d;e<v;e++){let m=e<h?r[e]:255;t[f++]=m&128?u:l,t[f++]=m&64?u:l,t[f++]=m&32?u:l,t[f++]=m&16?u:l,t[f++]=m&8?u:l,t[f++]=m&4?u:l,t[f++]=m&2?u:l,t[f++]=m&1?u:l}if(c===0)continue;let g=e<h?r[e++]:255;for(let v=0;v<c;v++)t[f++]=g&1<<7-v?u:l}return{srcPos:e,destPos:f}}var by=16,wy=100,DF=15,xy=10,Ay=1e3,dr=16;function EF(r,e){if(r._removeMirroring)throw new Error("Context is already forwarding operations.");r.__originalSave=r.save,r.__originalRestore=r.restore,r.__originalRotate=r.rotate,r.__originalScale=r.scale,r.__originalTranslate=r.translate,r.__originalTransform=r.transform,r.__originalSetTransform=r.setTransform,r.__originalResetTransform=r.resetTransform,r.__originalClip=r.clip,r.__originalMoveTo=r.moveTo,r.__originalLineTo=r.lineTo,r.__originalBezierCurveTo=r.bezierCurveTo,r.__originalRect=r.rect,r.__originalClosePath=r.closePath,r.__originalBeginPath=r.beginPath,r._removeMirroring=()=>{r.save=r.__originalSave,r.restore=r.__originalRestore,r.rotate=r.__originalRotate,r.scale=r.__originalScale,r.translate=r.__originalTranslate,r.transform=r.__originalTransform,r.setTransform=r.__originalSetTransform,r.resetTransform=r.__originalResetTransform,r.clip=r.__originalClip,r.moveTo=r.__originalMoveTo,r.lineTo=r.__originalLineTo,r.bezierCurveTo=r.__originalBezierCurveTo,r.rect=r.__originalRect,r.closePath=r.__originalClosePath,r.beginPath=r.__originalBeginPath,delete r._removeMirroring},r.save=function(){e.save(),this.__originalSave()},r.restore=function(){e.restore(),this.__originalRestore()},r.translate=function(n,i){e.translate(n,i),this.__originalTranslate(n,i)},r.scale=function(n,i){e.scale(n,i),this.__originalScale(n,i)},r.transform=function(n,i,s,a,o,l){e.transform(n,i,s,a,o,l),this.__originalTransform(n,i,s,a,o,l)},r.setTransform=function(n,i,s,a,o,l){e.setTransform(n,i,s,a,o,l),this.__originalSetTransform(n,i,s,a,o,l)},r.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},r.rotate=function(n){e.rotate(n),this.__originalRotate(n)},r.clip=function(n){e.clip(n),this.__originalClip(n)},r.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},r.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},r.bezierCurveTo=function(t,n,i,s,a,o){e.bezierCurveTo(t,n,i,s,a,o),this.__originalBezierCurveTo(t,n,i,s,a,o)},r.rect=function(t,n,i,s){e.rect(t,n,i,s),this.__originalRect(t,n,i,s)},r.closePath=function(){e.closePath(),this.__originalClosePath()},r.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}var df=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,t,n)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function nu(r,e,t,n,i,s,a,o,l,u){let[d,c,h,f,p,g]=Ze(r);if(c===0&&h===0){let y=a*d+p,w=Math.round(y),x=o*f+g,b=Math.round(x),A=(a+l)*d+p,S=Math.abs(Math.round(A)-w)||1,P=(o+u)*f+g,F=Math.abs(Math.round(P)-b)||1;return r.setTransform(Math.sign(d),0,0,Math.sign(f),w,b),r.drawImage(e,t,n,i,s,0,0,S,F),r.setTransform(d,c,h,f,p,g),[S,F]}if(d===0&&f===0){let y=o*h+p,w=Math.round(y),x=a*c+g,b=Math.round(x),A=(o+u)*h+p,S=Math.abs(Math.round(A)-w)||1,P=(a+l)*c+g,F=Math.abs(Math.round(P)-b)||1;return r.setTransform(0,Math.sign(c),Math.sign(h),0,w,b),r.drawImage(e,t,n,i,s,0,0,F,S),r.setTransform(d,c,h,f,p,g),[F,S]}r.drawImage(e,t,n,i,s,a,o,l,u);let v=Math.hypot(d,c),m=Math.hypot(h,f);return[v*l,m*u]}function CF(r){let{width:e,height:t}=r;if(e>Ay||t>Ay)return null;let n=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1,a=new Uint8Array(s*(t+1)),o,l,u,d=e+7&-8,c=new Uint8Array(d*t),h=0;for(let m of r.data){let y=128;for(;y>0;)c[h++]=m&y?0:255,y>>=1}let f=0;for(h=0,c[h]!==0&&(a[0]=1,++f),l=1;l<e;l++)c[h]!==c[h+1]&&(a[l]=c[h]?2:1,++f),h++;for(c[h]!==0&&(a[l]=2,++f),o=1;o<t;o++){h=o*d,u=o*s,c[h-d]!==c[h]&&(a[u]=c[h]?1:8,++f);let m=(c[h]?4:0)+(c[h-d]?8:0);for(l=1;l<e;l++)m=(m>>2)+(c[h+1]?4:0)+(c[h-d+1]?8:0),i[m]&&(a[u+l]=i[m],++f),h++;if(c[h-d]!==c[h]&&(a[u+l]=c[h]?2:4,++f),f>n)return null}for(h=d*(t-1),u=o*s,c[h]!==0&&(a[u]=8,++f),l=1;l<e;l++)c[h]!==c[h+1]&&(a[u+l]=c[h]?4:8,++f),h++;if(c[h]!==0&&(a[u+l]=4,++f),f>n)return null;let p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(o=0;f&&o<=t;o++){let m=o*s,y=m+e;for(;m<y&&!a[m];)m++;if(m===y)continue;g.moveTo(m%s,o);let w=m,x=a[m];do{let b=p[x];do m+=b;while(!a[m]);let A=a[m];A!==5&&A!==10?(x=A,a[m]=0):(x=A&51*x>>4,a[m]&=x>>2|x<<2),g.lineTo(m%s,m/s|0),a[m]||--f}while(w!==m);--o}return c=null,a=null,function(m){m.save(),m.scale(1/e,-1/t),m.translate(0,-t),m.fill(g),m.beginPath(),m.restore()}}var Au=class{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Ty,this.textMatrixScale=1,this.fontMatrix=Uh,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=Gt.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=Q.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){let n=Q.applyTransform(t,e),i=Q.applyTransform(t.slice(2),e),s=Q.applyTransform([t[0],t[3]],e),a=Q.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,n[0],i[0],s[0],a[0]),this.minY=Math.min(this.minY,n[1],i[1],s[1],a[1]),this.maxX=Math.max(this.maxX,n[0],i[0],s[0],a[0]),this.maxY=Math.max(this.maxY,n[1],i[1],s[1],a[1])}updateScalingPathMinMax(e,t){Q.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,i,s,a,o,l,u,d){let c=Q.bezierBoundingBox(t,n,i,s,a,o,l,u,d);d||this.updateRectMinMax(e,c)}getPathBoundingBox(e=Wt.FILL,t=null){let n=[this.minX,this.minY,this.maxX,this.maxY];if(e===Wt.STROKE){t||He("Stroke bounding box must include transform.");let i=Q.singularValueDecompose2dScale(t),s=i[0]*this.lineWidth/2,a=i[1]*this.lineWidth/2;n[0]-=s,n[1]-=a,n[2]+=s,n[3]+=a}return n}updateClipFromPath(){let e=Q.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=Wt.FILL,t=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function Sy(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}let t=e.height,n=e.width,i=t%dr,s=(t-i)/dr,a=i===0?s:s+1,o=r.createImageData(n,dr),l=0,u,d=e.data,c=o.data,h,f,p,g;if(e.kind===ou.GRAYSCALE_1BPP){let v=d.byteLength,m=new Uint32Array(c.buffer,0,c.byteLength>>2),y=m.length,w=n+7>>3,x=4294967295,b=Nt.isLittleEndian?4278190080:255;for(h=0;h<a;h++){for(p=h<s?dr:i,u=0,f=0;f<p;f++){let A=v-l,S=0,P=A>w?n:A*8-7,F=P&-8,k=0,D=0;for(;S<F;S+=8)D=d[l++],m[u++]=D&128?x:b,m[u++]=D&64?x:b,m[u++]=D&32?x:b,m[u++]=D&16?x:b,m[u++]=D&8?x:b,m[u++]=D&4?x:b,m[u++]=D&2?x:b,m[u++]=D&1?x:b;for(;S<P;S++)k===0&&(D=d[l++],k=128),m[u++]=D&k?x:b,k>>=1}for(;u<y;)m[u++]=0;r.putImageData(o,0,h*dr)}}else if(e.kind===ou.RGBA_32BPP){for(f=0,g=n*dr*4,h=0;h<s;h++)c.set(d.subarray(l,l+g)),l+=g,r.putImageData(o,0,f),f+=dr;h<a&&(g=n*i*4,c.set(d.subarray(l,l+g)),r.putImageData(o,0,f))}else if(e.kind===ou.RGB_24BPP)for(p=dr,g=n*p,h=0;h<a;h++){for(h>=s&&(p=i,g=n*p),u=0,f=g;f--;)c[u++]=d[l++],c[u++]=d[l++],c[u++]=d[l++],c[u++]=255;r.putImageData(o,0,h*dr)}else throw new Error(`bad image kind: ${e.kind}`)}function Py(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}let t=e.height,n=e.width,i=t%dr,s=(t-i)/dr,a=i===0?s:s+1,o=r.createImageData(n,dr),l=0,u=e.data,d=o.data;for(let c=0;c<a;c++){let h=c<s?dr:i;({srcPos:l}=FF({src:u,srcPos:l,dest:d,width:n,height:h,nonBlackColor:0})),r.putImageData(o,0,c*dr)}}function lo(r,e){let t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let n of t)r[n]!==void 0&&(e[n]=r[n]);r.setLineDash!==void 0&&(e.setLineDash(r.getLineDash()),e.lineDashOffset=r.lineDashOffset)}function iu(r){if(r.strokeStyle=r.fillStyle="#000000",r.fillRule="nonzero",r.globalAlpha=1,r.lineWidth=1,r.lineCap="butt",r.lineJoin="miter",r.miterLimit=10,r.globalCompositeOperation="source-over",r.font="10px sans-serif",r.setLineDash!==void 0&&(r.setLineDash([]),r.lineDashOffset=0),!Kt){let{filter:e}=r;e!=="none"&&e!==""&&(r.filter="none")}}function Fy(r,e){if(e)return!0;let t=Q.singularValueDecompose2dScale(r);t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]);let n=Math.fround((globalThis.devicePixelRatio||1)*mi.PDF_TO_CSS_UNITS);return t[0]<=n&&t[1]<=n}var TF=["butt","round","square"],kF=["miter","round","bevel"],RF={},Dy={},Vs=class r{constructor(e,t,n,i,s,{optionalContentConfig:a,markedContentStack:o=null},l,u){this.ctx=e,this.current=new Au(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=i,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=o||[],this.optionalContentConfig=a,this.cachedCanvases=new df(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){let s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,n){let l=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Ze(this.compositeCtx))}this.ctx.save(),iu(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Ze(this.ctx)}executeOperatorList(e,t,n,i){let s=e.argsArray,a=e.fnArray,o=t||0,l=s.length;if(l===o)return o;let u=l-o>xy&&typeof n=="function",d=u?Date.now()+DF:0,c=0,h=this.commonObjs,f=this.objs,p;for(;;){if(i!==void 0&&o===i.nextBreakPoint)return i.breakIt(o,n),o;if(p=a[o],p!==en.dependency)this[p].apply(this,s[o]);else for(let g of s[o]){let v=g.startsWith("g_")?h:f;if(!v.has(g))return v.get(g,n),o}if(o++,o===l)return o;if(u&&++c>xy){if(Date.now()>d)return n(),o;c=0}}}#e(){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.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,i=e.height??e.displayHeight,s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=n,l=i,u="prescale1",d,c;for(;s>2&&o>1||a>2&&l>1;){let h=o,f=l;s>2&&o>1&&(h=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/h),a>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/f),d=this.cachedCanvases.getCanvas(u,h,f),c=d.context,c.clearRect(0,0,h,f),c.drawImage(e,0,0,o,l,0,0,h,f),e=d.canvas,o=h,l=f,u=u==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e){let t=this.ctx,{width:n,height:i}=e,s=this.current.fillColor,a=this.current.patternFill,o=Ze(t),l,u,d,c;if((e.bitmap||e.data)&&e.count>1){let P=e.bitmap||e.data.buffer;u=JSON.stringify(a?o:[o.slice(0,4),s]),l=this._cachedBitmapsMap.get(P),l||(l=new Map,this._cachedBitmapsMap.set(P,l));let F=l.get(u);if(F&&!a){let k=Math.round(Math.min(o[0],o[2])+o[4]),D=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:F,offsetX:k,offsetY:D}}d=F}d||(c=this.cachedCanvases.getCanvas("maskCanvas",n,i),Py(c.context,e));let h=Q.transform(o,[1/n,0,0,-1/i,0,0]);h=Q.transform(h,[1,0,0,1,0,-i]);let[f,p,g,v]=Q.getAxialAlignedBoundingBox([0,0,n,i],h),m=Math.round(g-f)||1,y=Math.round(v-p)||1,w=this.cachedCanvases.getCanvas("fillCanvas",m,y),x=w.context,b=f,A=p;x.translate(-b,-A),x.transform(...h),d||(d=this._scaleImage(c.canvas,gn(x)),d=d.img,l&&a&&l.set(u,d)),x.imageSmoothingEnabled=Fy(Ze(x),e.interpolate),nu(x,d,0,0,d.width,d.height,0,0,n,i),x.globalCompositeOperation="source-in";let S=Q.transform(gn(x),[1,0,0,1,-b,-A]);return x.fillStyle=a?s.getPattern(t,this,S,Wt.FILL):s,x.fillRect(0,0,n,i),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(u,w.canvas)),{canvas:w.canvas,offsetX:Math.round(b),offsetY:Math.round(A)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=TF[e]}setLineJoin(e){this.ctx.lineJoin=kF[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){let n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=i.context;let s=this.ctx;s.setTransform(...Ze(this.suspendedCtx)),lo(this.suspendedCtx,s),EF(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(),lo(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),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(e,t,n,i){let s=i[0],a=i[1],o=i[2]-s,l=i[3]-a;o===0||l===0||(this.genericComposeSMask(t.context,n,o,l,t.subtype,t.backdrop,t.transferMap,s,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,i,s,a,o,l,u,d,c){let h=e.canvas,f=l-d,p=u-c;if(a){let v=Q.makeHexColor(...a);if(f<0||p<0||f+n>h.width||p+i>h.height){let m=this.cachedCanvases.getCanvas("maskExtension",n,i),y=m.context;y.drawImage(h,-f,-p),y.globalCompositeOperation="destination-atop",y.fillStyle=v,y.fillRect(0,0,n,i),y.globalCompositeOperation="source-over",h=m.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let m=new Path2D;m.rect(f,p,n,i),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=v,e.fillRect(f,p,n,i),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));let g=new Path2D;g.rect(l,u,n,i),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(h,f,p,n,i,l,u,n,i),t.restore()}save(){this.inSMaskMode?(lo(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),lo(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,i,s,a){this.ctx.transform(e,t,n,i,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){let i=this.ctx,s=this.current,a=s.x,o=s.y,l,u,d=Ze(i),c=d[0]===0&&d[3]===0||d[1]===0&&d[2]===0,h=c?n.slice(0):null;for(let f=0,p=0,g=e.length;f<g;f++)switch(e[f]|0){case en.rectangle:a=t[p++],o=t[p++];let v=t[p++],m=t[p++],y=a+v,w=o+m;i.moveTo(a,o),v===0||m===0?i.lineTo(y,w):(i.lineTo(y,o),i.lineTo(y,w),i.lineTo(a,w)),c||s.updateRectMinMax(d,[a,o,y,w]),i.closePath();break;case en.moveTo:a=t[p++],o=t[p++],i.moveTo(a,o),c||s.updatePathMinMax(d,a,o);break;case en.lineTo:a=t[p++],o=t[p++],i.lineTo(a,o),c||s.updatePathMinMax(d,a,o);break;case en.curveTo:l=a,u=o,a=t[p+4],o=t[p+5],i.bezierCurveTo(t[p],t[p+1],t[p+2],t[p+3],a,o),s.updateCurvePathMinMax(d,l,u,t[p],t[p+1],t[p+2],t[p+3],a,o,h),p+=6;break;case en.curveTo2:l=a,u=o,i.bezierCurveTo(a,o,t[p],t[p+1],t[p+2],t[p+3]),s.updateCurvePathMinMax(d,l,u,a,o,t[p],t[p+1],t[p+2],t[p+3],h),a=t[p+2],o=t[p+3],p+=4;break;case en.curveTo3:l=a,u=o,a=t[p+2],o=t[p+3],i.bezierCurveTo(t[p],t[p+1],a,o,a,o),s.updateCurvePathMinMax(d,l,u,t[p],t[p+1],a,o,a,o,h),p+=4;break;case en.closePath:i.closePath();break}c&&s.updateScalingPathMinMax(d,h),s.setCurrentPoint(a,o)}closePath(){this.ctx.closePath()}stroke(e=!0){let t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n=="object"&&n?.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,gn(t),Wt.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){let t=this.ctx,n=this.current.fillColor,i=this.current.patternFill,s=!1;i&&(t.save(),t.fillStyle=n.getPattern(t,this,gn(t),Wt.FILL),s=!0);let a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),s&&t.restore(),e&&this.consumePath(a)}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=RF}eoClip(){this.pendingClip=Dy}beginText(){this.current.textMatrix=Ty,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let e=this.pendingTextPaths,t=this.ctx;if(e===void 0){t.beginPath();return}let n=new Path2D,i=t.getTransform().invertSelf();for(let{transform:s,x:a,y:o,fontSize:l,path:u}of e)n.addPath(u,new DOMMatrix(s).preMultiplySelf(i).translate(a,o).scale(l,-l));t.clip(n),t.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){let n=this.commonObjs.get(e),i=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=n.fontMatrix||Uh,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&fe("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;let s=n.loadedName||"sans-serif",a=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`,o="normal";n.black?o="900":n.bold&&(o="bold");let l=n.italic?"italic":"normal",u=t;t<by?u=by:t>wy&&(u=wy),this.current.fontSizeScale=t/u,this.ctx.font=`${l} ${o} ${u}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,i,s,a){this.current.textMatrix=[e,t,n,i,s,a],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#r(e,t,n){let i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),i}paintChar(e,t,n,i,s){let a=this.ctx,o=this.current,l=o.font,u=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,c=u&Gt.FILL_STROKE_MASK,h=!!(u&Gt.ADD_TO_PATH_FLAG),f=o.patternFill&&!l.missingFile,p=o.patternStroke&&!l.missingFile,g;if((l.disableFontFace||h||f||p)&&(g=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||f||p){if(a.save(),a.translate(t,n),a.scale(d,-d),c===Gt.FILL||c===Gt.FILL_STROKE)if(i){let v=a.getTransform();a.setTransform(...i),a.fill(this.#r(g,v,i))}else a.fill(g);if(c===Gt.STROKE||c===Gt.FILL_STROKE)if(s){let v=a.getTransform();a.setTransform(...s),a.stroke(this.#r(g,v,s))}else a.lineWidth/=d,a.stroke(g);a.restore()}else(c===Gt.FILL||c===Gt.FILL_STROKE)&&a.fillText(e,t,n),(c===Gt.STROKE||c===Gt.FILL_STROKE)&&a.strokeText(e,t,n);h&&(this.pendingTextPaths||=[]).push({transform:Ze(a),x:t,y:n,fontSize:d,path:g})}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){n=!0;break}return xe(this,"isFontSubpixelAAEnabled",n)}showText(e){let t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);let i=t.fontSize;if(i===0)return;let s=this.ctx,a=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,u=t.fontDirection,d=t.textHScale*u,c=e.length,h=n.vertical,f=h?1:-1,p=n.defaultVMetrics,g=i*t.fontMatrix[0],v=t.textRenderingMode===Gt.FILL&&!n.disableFontFace&&!t.patternFill;s.save(),s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),u>0?s.scale(d,-1):s.scale(d,1);let m,y;if(t.patternFill){s.save();let S=t.fillColor.getPattern(s,this,gn(s),Wt.FILL);m=Ze(s),s.restore(),s.fillStyle=S}if(t.patternStroke){s.save();let S=t.strokeColor.getPattern(s,this,gn(s),Wt.STROKE);y=Ze(s),s.restore(),s.strokeStyle=S}let w=t.lineWidth,x=t.textMatrixScale;if(x===0||w===0){let S=t.textRenderingMode&Gt.FILL_STROKE_MASK;(S===Gt.STROKE||S===Gt.FILL_STROKE)&&(w=this.getSinglePixelWidth())}else w/=x;if(a!==1&&(s.scale(a,a),w/=a),s.lineWidth=w,n.isInvalidPDFjsFont){let S=[],P=0;for(let F of e)S.push(F.unicode),P+=F.width;s.fillText(S.join(""),0,0),t.x+=P*g*d,s.restore(),this.compose();return}let b=0,A;for(A=0;A<c;++A){let S=e[A];if(typeof S=="number"){b+=f*S*i/1e3;continue}let P=!1,F=(S.isSpace?l:0)+o,k=S.fontChar,D=S.accent,_,B,N=S.width;if(h){let O=S.vmetric||p,R=-(S.vmetric?O[1]:N*.5)*g,J=O[2]*g;N=O?-O[0]:N,_=R/a,B=(b+J)/a}else _=b/a,B=0;if(n.remeasure&&N>0){let O=s.measureText(k).width*1e3/i*a;if(N<O&&this.isFontSubpixelAAEnabled){let R=N/O;P=!0,s.save(),s.scale(R,1),_/=R}else N!==O&&(_+=(N-O)/2e3*i/a)}if(this.contentVisible&&(S.isInFont||n.missingFile)){if(v&&!D)s.fillText(k,_,B);else if(this.paintChar(k,_,B,m,y),D){let O=_+i*D.offset.x/a,R=B-i*D.offset.y/a;this.paintChar(D.fontChar,O,R,m,y)}}let G=h?N*g-F*u:N*g+F*u;b+=G,P&&s.restore()}h?t.y-=b:t.x+=b*d,s.restore(),this.compose()}showType3Text(e){let t=this.ctx,n=this.current,i=n.font,s=n.fontSize,a=n.fontDirection,o=i.vertical?1:-1,l=n.charSpacing,u=n.wordSpacing,d=n.textHScale*a,c=n.fontMatrix||Uh,h=e.length,f=n.textRenderingMode===Gt.INVISIBLE,p,g,v,m;if(!(f||s===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...n.textMatrix),t.translate(n.x,n.y),t.scale(d,a),p=0;p<h;++p){if(g=e[p],typeof g=="number"){m=o*g*s/1e3,this.ctx.translate(m,0),n.x+=m*d;continue}let y=(g.isSpace?u:0)+l,w=i.charProcOperatorList[g.operatorListId];if(!w){fe(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),t.scale(s,s),t.transform(...c),this.executeOperatorList(w),this.restore()),v=Q.applyTransform([g.width,0],c)[0]*s+y,t.translate(v,0),n.x+=v*d}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,i,s,a){this.ctx.rect(n,i,s-n,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if(e[0]==="TilingPattern"){let n=e[1],i=this.baseTransform||Ze(this.ctx),s={createCanvasGraphics:a=>new r(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new uf(e,n,this.ctx,s,i)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){this.ctx.strokeStyle=this.current.strokeColor=Q.makeHexColor(e,t,n),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t,n){this.ctx.fillStyle=this.current.fillColor=Q.makeHexColor(e,t,n),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=PF(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;let t=this.ctx;this.save();let n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,gn(t),Wt.SHADING);let i=gn(t);if(i){let{width:s,height:a}=t.canvas,[o,l,u,d]=Q.getAxialAlignedBoundingBox([0,0,s,a],i);this.ctx.fillRect(o,l,u-o,d-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){He("Should not call beginInlineImage")}beginImageData(){He("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Ze(this.ctx),t)){let n=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],n,i),this.current.updateRectMinMax(Ze(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let t=this.ctx;e.isolated||qu("TODO: Support non-isolated groups."),e.knockout&&fe("Knockout groups not supported.");let n=Ze(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=Q.getAxialAlignedBoundingBox(e.bbox,Ze(t)),s=[0,0,t.canvas.width,t.canvas.height];i=Q.intersect(i,s)||[0,0,0,0];let a=Math.floor(i[0]),o=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-a,1),u=Math.max(Math.ceil(i[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,u]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);let c=this.cachedCanvases.getCanvas(d,l,u),h=c.context;h.translate(-a,-o),h.transform(...n),e.smask?this.smaskStack.push({canvas:c.canvas,context:h,offsetX:a,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,o),t.save()),lo(t,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;let t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let i=Ze(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);let s=Q.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],i);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,n,i,s){if(this.#e(),iu(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){let a=t[2]-t[0],o=t[3]-t[1];if(s&&this.annotationCanvasMap){n=n.slice(),n[4]-=t[0],n[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=a,t[3]=o;let[l,u]=Q.singularValueDecompose2dScale(Ze(this.ctx)),{viewportScale:d}=this,c=Math.ceil(a*this.outputScaleX*d),h=Math.ceil(o*this.outputScaleY*d);this.annotationCanvas=this.canvasFactory.create(c,h);let{canvas:f,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(l,0,0,-u,0,o*u),iu(this.ctx)}else iu(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],a,o),this.ctx.clip(),this.ctx.beginPath()}this.current=new Au(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;let t=e.count;e=this.getObject(e.data,e),e.count=t;let n=this.ctx,i=this.processingType3;if(i&&(i.compiled===void 0&&(i.compiled=CF(e)),i.compiled)){i.compiled(n);return}let s=this._createMaskCanvas(e),a=s.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(a,s.offsetX,s.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,i=0,s,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);let o=this.ctx;o.save();let l=Ze(o);o.transform(t,n,i,s,0,0);let u=this._createMaskCanvas(e);o.setTransform(1,0,0,1,u.offsetX-l[4],u.offsetY-l[5]);for(let d=0,c=a.length;d<c;d+=2){let h=Q.transform(l,[t,n,i,s,a[d],a[d+1]]),[f,p]=Q.applyTransform([0,0],h);o.drawImage(u.canvas,f,p)}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;let t=this.ctx,n=this.current.fillColor,i=this.current.patternFill;for(let s of e){let{data:a,width:o,height:l,transform:u}=s,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),c=d.context;c.save();let h=this.getObject(a,s);Py(c,h),c.globalCompositeOperation="source-in",c.fillStyle=i?n.getPattern(c,this,gn(t),Wt.FILL):n,c.fillRect(0,0,o,l),c.restore(),t.save(),t.transform(...u),t.scale(1,-1),nu(t,d.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;let t=this.getObject(e);if(!t){fe("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t)}paintImageXObjectRepeat(e,t,n,i){if(!this.contentVisible)return;let s=this.getObject(e);if(!s){fe("Dependent image isn't ready yet");return}let a=s.width,o=s.height,l=[];for(let u=0,d=i.length;u<d;u+=2)l.push({transform:[t,0,0,n,i[u],i[u+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;let{bitmap:t,width:n,height:i}=e,s=this.cachedCanvases.getCanvas("inlineImage",n,i),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",s.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;let t=e.width,n=e.height,i=this.ctx;if(this.save(),!Kt){let{filter:o}=i;o!=="none"&&o!==""&&(i.filter="none")}i.scale(1/t,-1/n);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{let l=this.cachedCanvases.getCanvas("inlineImage",t,n).context;Sy(l,e),s=this.applyTransferMapsToCanvas(l)}let a=this._scaleImage(s,gn(i));i.imageSmoothingEnabled=Fy(Ze(i),e.interpolate),nu(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,i;if(e.bitmap)i=e.bitmap;else{let s=e.width,a=e.height,l=this.cachedCanvases.getCanvas("inlineImage",s,a).context;Sy(l,e),i=this.applyTransferMapsToCanvas(l)}for(let s of t)n.save(),n.transform(...s.transform),n.scale(1,-1),nu(n,i,s.x,s.y,s.w,s.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){let t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);let n=this.ctx;this.pendingClip&&(t||(this.pendingClip===Dy?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=Ze(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:i,d:s}=this.ctx.getTransform(),a,o;if(n===0&&i===0){let l=Math.abs(t),u=Math.abs(s);if(l===u)if(e===0)a=o=1/l;else{let d=l*e;a=o=d<1?1/d:1}else if(e===0)a=1/l,o=1/u;else{let d=l*e,c=u*e;a=d<1?1/d:1,o=c<1?1/c:1}}else{let l=Math.abs(t*s-n*i),u=Math.hypot(t,n),d=Math.hypot(i,s);if(e===0)a=d/l,o=u/l;else{let c=e*l;a=d>c?d/c:1,o=u>c?u/c:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){let{ctx:t}=this,{lineWidth:n}=this.current,[i,s]=this.getScaleForStroking();if(t.lineWidth=n||1,i===1&&s===1){t.stroke();return}let a=t.getLineDash();if(e&&t.save(),t.scale(i,s),a.length>0){let o=Math.max(i,s);t.setLineDash(a.map(l=>l/o)),t.lineDashOffset/=o}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let r in en)Vs.prototype[r]!==void 0&&(Vs.prototype[en[r]]=Vs.prototype[r]);var Yi=class{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}},cf=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return up(this.#e)}has(e){return this.#e.has(e)}},zs=Symbol("INTERNAL"),hf=class{#e=!1;#t=!1;#r=!1;#n=!0;constructor(e,{name:t,intent:n,usage:i,rbGroups:s}){this.#e=!!(e&Fr.DISPLAY),this.#t=!!(e&Fr.PRINT),this.name=t,this.intent=n,this.usage=i,this.rbGroups=s}get visible(){if(this.#r)return this.#n;if(!this.#n)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,t,n=!1){e!==zs&&He("Internal method `_setVisible` called."),this.#r=n,this.#n=t}},ff=class{#e=null;#t=new Map;#r=null;#n=null;constructor(e,t=Fr.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#n=e.order;for(let n of e.groups)this.#t.set(n.id,new hf(t,n));if(e.baseState==="OFF")for(let n of this.#t.values())n._setVisible(zs,!1);for(let n of e.on)this.#t.get(n)._setVisible(zs,!0);for(let n of e.off)this.#t.get(n)._setVisible(zs,!1);this.#r=this.getHash()}}#s(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let i=1;i<t;i++){let s=e[i],a;if(Array.isArray(s))a=this.#s(s);else if(this.#t.has(s))a=this.#t.get(s).visible;else return fe(`Optional content group not found: ${s}`),!0;switch(n){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return n==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return qu("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(fe(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#s(e.expression);if(!e.policy||e.policy==="AnyOn"){for(let t of e.ids){if(!this.#t.has(t))return fe(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(let t of e.ids){if(!this.#t.has(t))return fe(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(let t of e.ids){if(!this.#t.has(t))return fe(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(let t of e.ids){if(!this.#t.has(t))return fe(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return fe(`Unknown optional content policy ${e.policy}.`),!0}return fe(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let i=this.#t.get(e);if(!i){fe(`Optional content group not found: ${e}`);return}if(n&&t&&i.rbGroups.length)for(let s of i.rbGroups)for(let a of s)a!==e&&this.#t.get(a)?._setVisible(zs,!1,!0);i._setVisible(zs,!!t,!0),this.#e=null}setOCGState({state:e,preserveRB:t}){let n;for(let i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}let s=this.#t.get(i);if(s)switch(n){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!s.visible,t);break}}this.#e=null}get hasInitialVisibility(){return this.#r===null||this.getHash()===this.#r}getOrder(){return this.#t.size?this.#n?this.#n.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?up(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new pu;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}},pf=class{constructor(e,{disableRange:t=!1,disableStream:n=!1}){yt(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:i,initialData:s,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,s?.length>0){let l=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,u)=>{this._onReceiveData({begin:l,chunk:u})}),e.addProgressListener((l,u)=>{this._onProgress({loaded:l,total:u})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{let i=this._rangeReaders.some(function(s){return s._begin!==e?!1:(s._enqueue(n),!0)});yt(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){yt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let e=this._queuedChunks;return this._queuedChunks=null,new gf(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new mf(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},gf=class{constructor(e,t,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=cp(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(let s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},mf=class{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let n of this._requests)n.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){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function _F(r){let e=!0,t=n("filename\\*","i").exec(r);if(t){t=t[1];let d=o(t);return d=unescape(d),d=l(d),d=u(d),s(d)}if(t=a(r),t){let d=u(t);return s(d)}if(t=n("filename","i").exec(r),t){t=t[1];let d=o(t);return d=u(d),s(d)}function n(d,c){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',c)}function i(d,c){if(d){if(!/^[\x00-\xFF]+$/.test(c))return c;try{let h=new TextDecoder(d,{fatal:!0}),f=zu(c);c=h.decode(f),e=!1}catch{}}return c}function s(d){return e&&/[\x80-\xff]/.test(d)&&(d=i("utf-8",d),e&&(d=i("iso-8859-1",d))),d}function a(d){let c=[],h,f=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=f.exec(d))!==null;){let[,g,v,m]=h;if(g=parseInt(g,10),g in c){if(g===0)break;continue}c[g]=[v,m]}let p=[];for(let g=0;g<c.length&&g in c;++g){let[v,m]=c[g];m=o(m),v&&(m=unescape(m),g===0&&(m=l(m))),p.push(m)}return p.join("")}function o(d){if(d.startsWith('"')){let c=d.slice(1).split('\\"');for(let h=0;h<c.length;++h){let f=c[h].indexOf('"');f!==-1&&(c[h]=c[h].slice(0,f),c.length=h+1),c[h]=c[h].replaceAll(/\\(.)/g,"$1")}d=c.join('"')}return d}function l(d){let c=d.indexOf("'");if(c===-1)return d;let h=d.slice(0,c),p=d.slice(c+1).replace(/^[^']*'/,"");return i(h,p)}function u(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(c,h,f,p){if(f==="q"||f==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,v){return String.fromCharCode(parseInt(v,16))}),i(h,p);try{p=atob(p)}catch{}return i(h,p)})}return""}function _y(r,e){let t=new Headers;if(!r||!e||typeof e!="object")return t;for(let n in e){let i=e[n];i!==void 0&&t.append(n,i)}return t}function Gu(r){try{return new URL(r).origin}catch{}return null}function Iy({responseHeaders:r,isHttp:e,rangeChunkSize:t,disableRange:n}){let i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(r.get("Content-Length"),10);return!Number.isInteger(s)||(i.suggestedLength=s,s<=2*t)||n||!e||r.get("Accept-Ranges")!=="bytes"||(r.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function Oy(r){let e=r.get("Content-Disposition");if(e){let t=_F(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(cp(t))return t}return null}function Wu(r,e){return r===404||r===0&&e.startsWith("file:")?new Zi('Missing PDF "'+e+'".'):new Gs(`Unexpected server response (${r}) while retrieving PDF "${e}".`,r)}function My(r){return r===200||r===206}function Ny(r,e,t){return{method:"GET",headers:r,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Ly(r){return r instanceof Uint8Array?r.buffer:r instanceof ArrayBuffer?r:(fe(`getArrayBuffer - unexpected data format: ${r}`),new Uint8Array(r).buffer)}var Su=class{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=_y(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return yt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new vf(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new yf(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},vf=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;let n=new Headers(e.headers),i=t.url;fetch(i,Ny(n,this._withCredentials,this._abortController)).then(s=>{if(e._responseOrigin=Gu(s.url),!My(s.status))throw Wu(s.status,i);this._reader=s.body.getReader(),this._headersCapability.resolve();let a=s.headers,{allowRangeRequests:o,suggestedLength:l}=Iy({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=Oy(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new vn("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;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Ly(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},yf=class{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;let i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;let s=new Headers(e.headers);s.append("Range",`bytes=${t}-${n-1}`);let a=i.url;fetch(a,Ny(s,this._withCredentials,this._abortController)).then(o=>{let l=Gu(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!My(o.status))throw Wu(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Ly(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},jh=200,Bh=206;function IF(r){let e=r.response;return typeof e!="string"?e:zu(e).buffer}var bf=class{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=_y(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(let[s,a]of this.headers)t.setRequestHeader(s,a);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=Bh):i.expectedStatus=jh,t.responseType="arraybuffer",yt(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){let n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){let n=this.pendingRequests[e];if(!n)return;let i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){n.onError(i.status);return}let s=i.status||jh;if(!(s===jh&&n.expectedStatus===Bh)&&s!==n.expectedStatus){n.onError(i.status);return}let o=IF(i);if(s===Bh){let l=i.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);u?n.onDone({begin:parseInt(u[1],10),chunk:o}):(fe('Missing or invalid "Content-Range" header.'),n.onError(0))}else o?n.onDone({begin:0,chunk:o}):n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},wf=class{constructor(e){this._source=e,this._manager=new bf(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return yt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new xf(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let n=new Af(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},xf=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=Gu(t.responseURL);let n=t.getAllResponseHeaders(),i=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{let[l,...u]=o.split(": ");return[l,u.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:a}=Iy({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Oy(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Wu(e,this._url),this._headersCapability.reject(this._storedError);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,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};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(let 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}},Af=class{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let e=Gu(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=Wu(e,this._url);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let 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()}},OF=/^[a-z][a-z0-9\-+.]+:/i;function MF(r){if(OF.test(r))return new URL(r);let e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(r))}var Sf=class{constructor(e){this.source=e,this.url=MF(e.url),yt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return yt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Pf(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new Ff(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},Pf=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=new Zi(`Missing PDF "${this._url}".`)),this._storedError=i,this._headersCapability.reject(i)})}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;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new vn("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},Ff=class{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let i=e.source;this._isStreamingSupported=!i.disableStream;let s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:t,end:n-1}))}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;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}},NF=1e5,lr=30,LF=.8,wo=class r{#e=Promise.withResolvers();#t=null;#r=!1;#n=!!globalThis.FontInspector?.enabled;#s=null;#i=null;#l=0;#o=0;#d=null;#u=null;#h=0;#c=0;#f=Object.create(null);#a=[];#p=null;#m=[];#g=new WeakMap;#v=null;static#w=new Map;static#y=new Map;static#x=new WeakMap;static#S=null;static#F=new Set;constructor({textContentSource:e,container:t,viewport:n}){if(e instanceof ReadableStream)this.#p=e;else if(typeof e=="object")this.#p=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#u=t,this.#c=n.scale*(globalThis.devicePixelRatio||1),this.#h=n.rotation,this.#i={div:null,properties:null,ctx:null};let{pageWidth:i,pageHeight:s,pageX:a,pageY:o}=n.rawDims;this.#v=[1,0,0,-1,-a,o+s],this.#o=i,this.#l=s,r.#R(),Ji(t,n),this.#e.promise.finally(()=>{r.#F.delete(this),this.#i=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Nt.platform;return xe(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){let e=()=>{this.#d.read().then(({value:t,done:n})=>{if(n){this.#e.resolve();return}this.#s??=t.lang,Object.assign(this.#f,t.styles),this.#E(t.items),e()},this.#e.reject)};return this.#d=this.#p.getReader(),r.#F.add(this),e(),this.#e.promise}update({viewport:e,onBefore:t=null}){let n=e.scale*(globalThis.devicePixelRatio||1),i=e.rotation;if(i!==this.#h&&(t?.(),this.#h=i,Ji(this.#u,{rotation:i})),n!==this.#c){t?.(),this.#c=n;let s={div:null,properties:null,ctx:r.#C(this.#s)};for(let a of this.#m)s.properties=this.#g.get(a),s.div=a,this.#A(s)}}cancel(){let e=new vn("TextLayer task cancelled.");this.#d?.cancel(e).catch(()=>{}),this.#d=null,this.#e.reject(e)}get textDivs(){return this.#m}get textContentItemsStr(){return this.#a}#E(e){if(this.#r)return;this.#i.ctx??=r.#C(this.#s);let t=this.#m,n=this.#a;for(let i of e){if(t.length>NF){fe("Ignoring additional textDivs for performance reasons."),this.#r=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){let s=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id!==null&&this.#t.setAttribute("id",`${i.id}`),s.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(i.str),this.#T(i)}}#T(e){let t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#m.push(t);let i=Q.transform(this.#v,e.transform),s=Math.atan2(i[1],i[0]),a=this.#f[e.fontName];a.vertical&&(s+=Math.PI/2);let o=this.#n&&a.fontSubstitution||a.fontFamily;o=r.fontFamilyMap.get(o)||o;let l=Math.hypot(i[2],i[3]),u=l*r.#O(o,this.#s),d,c;s===0?(d=i[4],c=i[5]-u):(d=i[4]+u*Math.sin(s),c=i[5]-u*Math.cos(s));let h="calc(var(--scale-factor)*",f=t.style;this.#t===this.#u?(f.left=`${(100*d/this.#o).toFixed(2)}%`,f.top=`${(100*c/this.#l).toFixed(2)}%`):(f.left=`${h}${d.toFixed(2)}px)`,f.top=`${h}${c.toFixed(2)}px)`),f.fontSize=`${h}${(r.#S*l).toFixed(2)}px)`,f.fontFamily=o,n.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#n&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),s!==0&&(n.angle=s*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){let g=Math.abs(e.transform[0]),v=Math.abs(e.transform[3]);g!==v&&Math.max(g,v)/Math.min(g,v)>1.5&&(p=!0)}if(p&&(n.canvasWidth=a.vertical?e.height:e.width),this.#g.set(t,n),this.#i.div=t,this.#i.properties=n,this.#A(this.#i),n.hasText&&this.#t.append(t),n.hasEOL){let g=document.createElement("br");g.setAttribute("role","presentation"),this.#t.append(g)}}#A(e){let{div:t,properties:n,ctx:i}=e,{style:s}=t,a="";if(r.#S>1&&(a=`scale(${1/r.#S})`),n.canvasWidth!==0&&n.hasText){let{fontFamily:o}=s,{canvasWidth:l,fontSize:u}=n;r.#D(i,u*this.#c,o);let{width:d}=i.measureText(t.textContent);d>0&&(a=`scaleX(${l*this.#c/d}) ${a}`)}n.angle!==0&&(a=`rotate(${n.angle}deg) ${a}`),a.length>0&&(s.transform=a)}static cleanup(){if(!(this.#F.size>0)){this.#w.clear();for(let{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#C(e=null){let t=this.#y.get(e||="");if(!t){let n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(e,t),this.#x.set(t,{size:0,family:""})}return t}static#D(e,t,n){let i=this.#x.get(e);t===i.size&&n===i.family||(e.font=`${t}px ${n}`,i.size=t,i.family=n)}static#R(){if(this.#S!==null)return;let e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#O(e,t){let n=this.#w.get(e);if(n)return n;let i=this.#C(t);i.canvas.width=i.canvas.height=lr,this.#D(i,lr,e);let s=i.measureText(""),a=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);if(a){let d=a/(a+o);return this.#w.set(e,d),i.canvas.width=i.canvas.height=0,d}i.strokeStyle="red",i.clearRect(0,0,lr,lr),i.strokeText("g",0,0);let l=i.getImageData(0,0,lr,lr).data;o=0;for(let d=l.length-1-3;d>=0;d-=4)if(l[d]>0){o=Math.ceil(d/4/lr);break}i.clearRect(0,0,lr,lr),i.strokeText("A",0,lr),l=i.getImageData(0,0,lr,lr).data,a=0;for(let d=0,c=l.length;d<c;d+=4)if(l[d]>0){a=lr-Math.floor(d/4/lr);break}i.canvas.width=i.canvas.height=0;let u=a?a/(a+o):LF;return this.#w.set(e,u),u}},xo=class r{static textContent(e){let t=[],n={items:t,styles:Object.create(null)};function i(s){if(!s)return;let a=null,o=s.name;if(o==="#text")a=s.value;else if(r.shouldBuildText(o))s?.attributes?.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&t.push({str:a}),!!s.children)for(let l of s.children)i(l)}return i(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}},jF=65536,BF=100,UF=5e3,qF=Kt?tf:Qh,zF=Kt?rf:yu,VF=Kt?ef:$h,HF=Kt?nf:xu;function GF(r={}){typeof r=="string"||r instanceof URL?r={url:r}:(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(r={data:r});let e=new Df,{docId:t}=e,n=r.url?WF(r.url):null,i=r.data?KF(r.data):null,s=r.httpHeaders||null,a=r.withCredentials===!0,o=r.password??null,l=r.range instanceof Pu?r.range:null,u=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:jF,d=r.worker instanceof Hs?r.worker:null,c=r.verbosity,h=typeof r.docBaseUrl=="string"&&!Hu(r.docBaseUrl)?r.docBaseUrl:null,f=typeof r.cMapUrl=="string"?r.cMapUrl:null,p=r.cMapPacked!==!1,g=r.CMapReaderFactory||zF,v=typeof r.standardFontDataUrl=="string"?r.standardFontDataUrl:null,m=r.StandardFontDataFactory||HF,y=r.stopAtErrors!==!0,w=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,x=r.isEvalSupported!==!1,b=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!Kt,A=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!Kt&&(Nt.platform.isFirefox||!globalThis.chrome),S=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,P=typeof r.disableFontFace=="boolean"?r.disableFontFace:Kt,F=r.fontExtraProperties===!0,k=r.enableXfa===!0,D=r.ownerDocument||globalThis.document,_=r.disableRange===!0,B=r.disableStream===!0,N=r.disableAutoFetch===!0,G=r.pdfBug===!0,O=r.CanvasFactory||qF,R=r.FilterFactory||VF,J=r.enableHWA===!0,le=l?l.length:r.length??NaN,_e=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!Kt&&!P,Be=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:g===yu&&m===xu&&f&&v&&ho(f,document.baseURI)&&ho(v,document.baseURI),we=null;lF(c);let ye={canvasFactory:new O({ownerDocument:D,enableHWA:J}),filterFactory:new R({docId:t,ownerDocument:D}),cMapReaderFactory:Be?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:Be?null:new m({baseUrl:v})};if(!d){let W={verbosity:c,port:Yi.workerPort};d=W.port?Hs.fromPort(W):new Hs(W),e._worker=d}let $r={docId:t,apiVersion:"4.10.38",data:i,password:o,disableAutoFetch:N,rangeChunkSize:u,length:le,docBaseUrl:h,enableXfa:k,evaluatorOptions:{maxImageSize:w,disableFontFace:P,ignoreErrors:y,isEvalSupported:x,isOffscreenCanvasSupported:b,isImageDecoderSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:F,useSystemFonts:_e,cMapUrl:Be?f:null,standardFontDataUrl:Be?v:null}},Ht={disableFontFace:P,fontExtraProperties:F,ownerDocument:D,pdfBug:G,styleElement:we,loadingParams:{disableAutoFetch:N,enableXfa:k}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");let W=d.messageHandler.sendWithPromise("GetDocRequest",$r,i?[i.buffer]:null),M;if(l)M=new pf(l,{disableRange:_,disableStream:B});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");let H;if(Kt)if(ho(n)){if(typeof fetch>"u"||typeof Response>"u"||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");H=Su}else H=Sf;else H=ho(n)?Su:wf;M=new H({url:n,length:le,httpHeaders:s,withCredentials:a,rangeChunkSize:u,disableRange:_,disableStream:B})}return W.then(H=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");let ue=new Xi(t,H,d.port),Te=new kf(ue,e,M,Ht,ye);e._transport=Te,ue.send("Ready",null)})}).catch(e._capability.reject),e}function WF(r){if(r instanceof URL)return r.href;try{return new URL(r,window.location).href}catch{if(Kt&&typeof r=="string")return r}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function KF(r){if(Kt&&typeof Buffer<"u"&&r instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength)return r;if(typeof r=="string")return zu(r);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof r=="object"&&!isNaN(r?.length))return new Uint8Array(r);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Ey(r){return typeof r=="object"&&Number.isInteger(r?.num)&&r.num>=0&&Number.isInteger(r?.gen)&&r.gen>=0}var Df=class r{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${r.#e++}`,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(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}},Pu=class{constructor(e,t,n=!1,i=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(let n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(let n of this._progressListeners)n(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(let t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){He("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Ef=class{constructor(e,t){this._pdfInfo=e,this._transport=t}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 xe(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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()}},Cf=class{#e=null;#t=!1;constructor(e,t,n,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new uu:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new Fu,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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:s=!1}={}){return new go({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:s})}getAnnotations({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return xe(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:i=pi.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:u=null,printAnnotationStorage:d=null,isEditing:c=!1}){this._stats?.time("Overall");let h=this._transport.getRenderingIntent(n,i,d,c),{renderingIntent:f,cacheKey:p}=h;this.#t=!1,this.#n(),o||=this._transport.getOptionalContentConfig(f);let g=this._intentStates.get(p);g||(g=Object.create(null),this._intentStates.set(p,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);let v=!!(f&Fr.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(h));let m=x=>{g.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#t=!0),this.#r(!v),x?(y.capability.reject(x),this._abortOperatorList({intentState:g,reason:x instanceof Error?x:new Error(x)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new _f({callback:m,params:{canvasContext:e,viewport:t,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:u});(g.renderTasks||=new Set).add(y);let w=y.task;return Promise.all([g.displayReadyCapability.promise,o]).then(([x,b])=>{if(this.destroyed){m();return}if(this._stats?.time("Rendering"),!(b.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:x,optionalContentConfig:b}),y.operatorListChanged()}).catch(m),w}getOperatorList({intent:e="display",annotationMode:t=pi.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}let a=this._transport.getRenderingIntent(e,t,n,i,!0),o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>xo.textContent(n));let t=this.streamTextContent(e);return new Promise(function(n,i){function s(){a.read().then(function({value:l,done:u}){if(u){n(o);return}o.lang??=l.lang,Object.assign(o.styles,l.styles),o.items.push(...l.items),s()},i)}let a=t.getReader(),o={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#n(),Promise.all(e)}cleanup(e=!1){this.#t=!0;let t=this.#r(!1);return e&&t&&(this._stats&&=new uu),t}#r(e=!1){if(this.#n(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#r(!1)},UF),!1;for(let{renderTasks:t,operatorList:n}of this._intentStates.values())if(t.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#n(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,i=e.length;n<i;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let n of t.renderTasks)n.operatorListChanged();e.lastChunk&&this.#r(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:i}){let{map:s,transfer:a}=n,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:s,modifiedIds:i},a).getReader(),u=this._intentStates.get(t);u.streamReader=l;let d=()=>{l.read().then(({value:c,done:h})=>{if(h){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(c,u),d())},c=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){u.operatorList.lastChunk=!0;for(let h of u.renderTasks)h.operatorListChanged();this.#r(!0)}if(u.displayReadyCapability)u.displayReadyCapability.reject(c);else if(u.opListReadCapability)u.opListReadCapability.reject(c);else throw c}})};d()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof mo){let i=BF;t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i);return}}if(e.streamReader.cancel(new vn(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[i,s]of this._intentStates)if(s===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}},Tf=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[i]of this.#e)i.call(this,n)})}addEventListener(e,t,n=null){let i=null;if(n?.signal instanceof AbortSignal){let{signal:s}=n;if(s.aborted){fe("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);i=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}this.#e.set(t,i)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},Hs=class r{static#e=0;static#t=!1;static#r;static{Kt&&(this.#t=!0,Yi.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{let n;try{if(n=new URL(e),!n.origin||n.origin==="null")return!1}catch{return!1}let i=new URL(t,n);return n.origin===i.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}}constructor({name:e=null,port:t=null,verbosity:n=uF()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if(r.#r?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");(r.#r||=new WeakMap).set(t,this),this._initializeFromPort(t);return}this._initialize()}get promise(){return this._readyCapability.promise}#n(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Xi("main","worker",e),this._messageHandler.on("ready",function(){}),this.#n()}_initialize(){if(r.#t||r.#s){this._setupFakeWorker();return}let{workerSrc:e}=r;try{r._isSameOrigin(window.location.href,e)||(e=r._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),n=new Xi("main","worker",t),i=()=>{s.abort(),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;t.addEventListener("error",()=>{this._webWorker||i()},{signal:s.signal}),n.on("test",o=>{if(s.abort(),this.destroyed||!o){i();return}this._messageHandler=n,this._port=t,this._webWorker=t,this.#n()}),n.on("ready",o=>{if(s.abort(),this.destroyed){i();return}try{a()}catch{this._setupFakeWorker()}});let a=()=>{let o=new Uint8Array;n.send("test",o,[o.buffer])};a();return}catch{qu("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){r.#t||(fe("Setting up fake worker."),r.#t=!0),r._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}let t=new Tf;this._port=t;let n=`fake${r.#e++}`,i=new Xi(n+"_worker",n,t);e.setup(i,t),this._messageHandler=new Xi(n,n+"_worker",t),this.#n()}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker?.terminate(),this._webWorker=null,r.#r?.delete(this._port),this._port=null,this._messageHandler?.destroy(),this._messageHandler=null}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");let t=this.#r?.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new r(e)}static get workerSrc(){if(Yi.workerSrc)return Yi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#s(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return xe(this,"_setupFakeWorkerGlobal",(async()=>this.#s?this.#s:(await import(this.workerSrc)).WorkerMessageHandler)())}},kf=class{#e=new Map;#t=new Map;#r=new Map;#n=new Map;#s=null;constructor(e,t,n,i,s){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Fu,this.fontLoader=new Zh({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#i(e,t=null){let n=this.#e.get(e);if(n)return n;let i=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,i),i}get annotationStorage(){return xe(this,"annotationStorage",new yo)}getRenderingIntent(e,t=pi.ENABLE,n=null,i=!1,s=!1){let a=Fr.DISPLAY,o=Yh;switch(e){case"any":a=Fr.ANY;break;case"display":break;case"print":a=Fr.PRINT;break;default:fe(`getRenderingIntent - invalid intent: ${e}`)}let l=a&Fr.PRINT&&n instanceof gu?n:this.annotationStorage;switch(t){case pi.DISABLE:a+=Fr.ANNOTATIONS_DISABLE;break;case pi.ENABLE:break;case pi.ENABLE_FORMS:a+=Fr.ANNOTATIONS_FORMS;break;case pi.ENABLE_STORAGE:a+=Fr.ANNOTATIONS_STORAGE,o=l.serializable;break;default:fe(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(a+=Fr.IS_EDITING),s&&(a+=Fr.OPLIST);let{ids:u,hash:d}=l.modifiedIds,c=[a,o.hash,d];return{renderingIntent:a,cacheKey:c.join("_"),annotationStorageSerializable:o,modifiedIds:u}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let n of this.#t.values())e.push(n._destroy());this.#t.clear(),this.#r.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),wo.cleanup(),this._networkStream?.cancelAllRequests(new vn("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(n,i)=>{yt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},i.onPull=()=>{this._fullReader.read().then(function({value:s,done:a}){if(a){i.close();return}yt(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{this._fullReader.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async n=>{await this._fullReader.headersReady;let{isStreamingSupported:i,isRangeSupported:s,contentLength:a}=this._fullReader;return(!i||!s)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{t.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(n,i)=>{yt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let s=this._networkStream.getRangeReader(n.begin,n.end);if(!s){i.close();return}i.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){i.close();return}yt(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{s.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new Ef(n,this))}),e.on("DocException",n=>{t._capability.reject(ur(n))}),e.on("PasswordRequest",n=>{this.#s=Promise.withResolvers();try{if(!t.onPassword)throw ur(n);let i=s=>{s instanceof Error?this.#s.reject(s):this.#s.resolve({password:s})};t.onPassword(i,n.code)}catch(i){this.#s.reject(i)}return this.#s.promise}),e.on("DataLoaded",n=>{t.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,s])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":let{disableFontFace:a,fontExtraProperties:o,pdfBug:l}=this._params;if("error"in s){let h=s.error;fe(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let u=l&&globalThis.FontInspector?.enabled?(h,f)=>globalThis.FontInspector.fontAdded(h,f):null,d=new Jh(s,{disableFontFace:a,fontExtraProperties:o,inspectFont:u});this.fontLoader.bind(d).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!o&&d.data&&(d.data=null),this.commonObjs.resolve(n,d)});break;case"CopyLocalImage":let{imageRef:c}=s;yt(c,"The imageRef must be defined.");for(let h of this.#t.values())for(let[,f]of h.objs)if(f?.ref===c)return f.dataLen?(this.commonObjs.resolve(n,structuredClone(f)),f.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,s);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,s,a])=>{if(this.destroyed)return;let o=this.#t.get(i);if(!o.objs.has(n)){if(o._intentStates.size===0){a?.bitmap?.close();return}switch(s){case"Image":o.objs.resolve(n,a),a?.dataLen>nF&&(o._maybeCleanupAfterRender=!0);break;case"Pattern":o.objs.resolve(n,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",n=>{this.destroyed||t.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBuiltInCMap",async n=>{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(n)}),e.on("FetchStandardFontData",async n=>{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(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&fe("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));let t=e-1,n=this.#r.get(t);if(n)return n;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&this.#n.set(s.refStr,e);let a=new Cf(t,s,this,this._params.pdfBug);return this.#t.set(t,a),a});return this.#r.set(t,i),i}getPageIndex(e){return Ey(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#i("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#i("GetOptionalContentConfig").then(t=>new ff(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata",t=this.#e.get(e);if(t)return t;let n=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new cf(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let t of this.#t.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),wo.cleanup()}}cachedPageNumber(e){if(!Ey(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#n.get(t)??null}},uo=Symbol("INITIAL_DATA"),Fu=class{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:uo}}get(e,t=null){if(t){let i=this.#t(e);return i.promise.then(()=>t(i.data)),null}let n=this.#e[e];if(!n||n.data===uo)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e[e];return!!t&&t.data!==uo}delete(e){let t=this.#e[e];return!t||t.data===uo?!1:(delete this.#e[e],!0)}resolve(e,t=null){let n=this.#t(e);n.data=t,n.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==uo&&(yield[e,t])}}},Rf=class{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},_f=class r{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:u,useRequestAnimationFrame:d=!1,pdfBug:c=!1,pageColors:h=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=u,this._pdfBug=c,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Rf(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(r.#t.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.");r.#t.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());let{canvasContext:n,viewport:i,transform:s,background:a}=this.params;this.gfx=new Vs(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),r.#t.delete(this._canvas),this.callback(e||new mo(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),r.#t.delete(this._canvas),this.callback())))}},XF="4.10.38",YF="f9bea397f",t3=De(670);function Cy(r){return Math.floor(Math.max(0,Math.min(1,r))*255).toString(16).padStart(2,"0")}function co(r){return Math.max(0,Math.min(255,255*r))}var Du=class{static CMYK_G([e,t,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=co(e),[e,e,e]}static G_HTML([e]){let t=Cy(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(co)}static RGB_HTML(e){return`#${e.map(Cy).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,n,i]){return[co(1-Math.min(1,e+i)),co(1-Math.min(1,n+i)),co(1-Math.min(1,t+i))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let i=1-e,s=1-t,a=1-n,o=Math.min(i,s,a);return["CMYK",i,s,a,o]}},If=class{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){He("Abstract method `_createSVG` called.")}},Ao=class extends If{_createSVG(e){return document.createElementNS(jn,e)}},Eu=class{static setupStorage(e,t,n,i,s){let a=i.getValue(t,{value:null});switch(n.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(a.value===n.attributes.xfaOn?e.setAttribute("checked",!0):a.value===n.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",o=>{i.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(let o of n.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{let l=o.target.options,u=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(t,{value:u})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:i,linkService:s}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(let[l,u]of Object.entries(a))if(u!=null)switch(l){case"class":u.length&&e.setAttribute(l,u.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",u);break;case"style":Object.assign(e.style,u);break;case"textContent":e.textContent=u;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,u)}o&&s.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static render(e){let t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,s=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:s,linkService:n});let o=s!=="richText",l=e.div;if(l.append(a),e.viewport){let c=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=c}o&&l.setAttribute("class","xfaLayer xfaFont");let u=[];if(i.children.length===0){if(i.value){let c=document.createTextNode(i.value);a.append(c),o&&xo.shouldBuildText(i.name)&&u.push(c)}return{textDivs:u}}let d=[[i,-1,a]];for(;d.length>0;){let[c,h,f]=d.at(-1);if(h+1===c.children.length){d.pop();continue}let p=c.children[++d.at(-1)[1]];if(p===null)continue;let{name:g}=p;if(g==="#text"){let m=document.createTextNode(p.value);u.push(m),f.append(m);continue}let v=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,g):document.createElement(g);if(f.append(v),p.attributes&&this.setAttributes({html:v,element:p,storage:t,intent:s,linkService:n}),p.children?.length>0)d.push([p,-1,v]);else if(p.value){let m=document.createTextNode(p.value);o&&xo.shouldBuildText(g)&&u.push(m),v.append(m)}}for(let c of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))c.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){let t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}},Eo=1e3,ZF=9,es=new WeakSet;function gi(r){return{width:r[2]-r[0],height:r[3]-r[1]}}var Of=class{static create(e){switch(e.data.annotationType){case Ft.LINK:return new Cu(e);case Ft.TEXT:return new Mf(e);case Ft.WIDGET:switch(e.data.fieldType){case"Tx":return new Nf(e);case"Btn":return e.data.radioButton?new Tu(e):e.data.checkBox?new jf(e):new Bf(e);case"Ch":return new Uf(e);case"Sig":return new Lf(e)}return new Bn(e);case Ft.POPUP:return new So(e);case Ft.FREETEXT:return new ku(e);case Ft.LINE:return new zf(e);case Ft.SQUARE:return new Vf(e);case Ft.CIRCLE:return new Hf(e);case Ft.POLYLINE:return new Ru(e);case Ft.CARET:return new Wf(e);case Ft.INK:return new Po(e);case Ft.POLYGON:return new Gf(e);case Ft.HIGHLIGHT:return new _u(e);case Ft.UNDERLINE:return new Kf(e);case Ft.SQUIGGLY:return new Xf(e);case Ft.STRIKEOUT:return new Yf(e);case Ft.STAMP:return new Iu(e);case Ft.FILEATTACHMENT:return new Zf(e);default:return new ct(e)}}},ct=class r{#e=null;#t=!1;#r=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:n}){return!!(e?.str||t?.str||n?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return r._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};let{rect:t}=e;t&&this.#n(t),this.#r?.popup.updateEdited(e)}resetEdited(){this.#e&&(this.#n(this.#e.rect),this.#r?.popup.resetEdited(),this.#e=null)}#n(e){let{container:{style:t},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}}}=this;n?.splice(0,4,...e);let{width:u,height:d}=gi(e);t.left=`${100*(e[0]-o)/s}%`,t.top=`${100*(a-e[3]+l)/a}%`,i===0?(t.width=`${100*u/s}%`,t.height=`${100*d/a}%`):this.setRotation(i)}_createContainer(e){let{data:t,parent:{page:n,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),this instanceof Bn||(s.tabIndex=Eo);let{style:a}=s;if(a.zIndex=this.parent.zIndex++,t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof So){let{rotation:g}=t;return!t.hasOwnCanvas&&g!==0&&this.setRotation(g,s),s}let{width:o,height:l}=gi(t.rect);if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let g=t.borderStyle.horizontalCornerRadius,v=t.borderStyle.verticalCornerRadius;if(g>0||v>0){let y=`calc(${g}px * var(--scale-factor)) / calc(${v}px * var(--scale-factor))`;a.borderRadius=y}else if(this instanceof Tu){let y=`calc(${o}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=y}switch(t.borderStyle.style){case oo.SOLID:a.borderStyle="solid";break;case oo.DASHED:a.borderStyle="dashed";break;case oo.BEVELED:fe("Unimplemented border style: beveled");break;case oo.INSET:fe("Unimplemented border style: inset");break;case oo.UNDERLINE:a.borderBottomStyle="solid";break;default:break}let m=t.borderColor||null;m?(this.#t=!0,a.borderColor=Q.makeHexColor(m[0]|0,m[1]|0,m[2]|0)):a.borderWidth=0}let u=Q.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:d,pageHeight:c,pageX:h,pageY:f}=i.rawDims;a.left=`${100*(u[0]-h)/d}%`,a.top=`${100*(u[1]-f)/c}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/d}%`,a.height=`${100*l/c}%`):this.setRotation(p,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:s,height:a}=gi(this.data.rect),o,l;e%180===0?(o=100*s/n,l=100*a/i):(o=100*a/n,l=100*s/i),t.style.width=`${o}%`,t.style.height=`${l}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){let e=(t,n,i)=>{let s=i.detail[t],a=s[0],o=s.slice(1);i.target.style[n]=Du[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[n]:Du[`${a}_rgb`](o)})};return xe(this,"_commonActions",{display:t=>{let{display:n}=t.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:n}=t.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:t=>{setTimeout(()=>t.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:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{let n=t.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let i of Object.keys(t.detail))(e[i]||n[i])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[i,s]of Object.entries(t)){let a=n[i];if(a){let o={detail:{[i]:s},target:e};a(o),delete t[i]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,i,s]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){let[g,v,m,y]=e.subarray(2,6);if(i===g&&s===v&&t===m&&n===y)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:g,borderWidth:v}=a;a.borderWidth=0,o=["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="${g}" stroke-width="${v}">`],this.container.classList.add("hasBorder")}let l=i-t,u=s-n,{svgFactory:d}=this,c=d.createElement("svg");c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0);let h=d.createElement("defs");c.append(h);let f=d.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),h.append(f);for(let g=2,v=e.length;g<v;g+=8){let m=e[g],y=e[g+1],w=e[g+2],x=e[g+3],b=d.createElement("rect"),A=(w-t)/l,S=(s-y)/u,P=(m-w)/l,F=(y-x)/u;b.setAttribute("x",A),b.setAttribute("y",S),b.setAttribute("width",P),b.setAttribute("height",F),f.append(b),o?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${S}" width="${P}" height="${F}"/>`)}this.#t&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(c),this.container.style.clipPath=`url(#${p})`}_createPopup(){let{data:e}=this,t=this.#r=new So({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(t.render())}render(){He("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let i=this._fieldObjects[e];if(i)for(let{page:s,id:a,exportValues:o}of i){if(s===-1||a===t)continue;let l=typeof o=="string"?o:null,u=document.querySelector(`[data-element-id="${a}"]`);if(u&&!es.has(u)){fe(`_getElementsByName - element not allowed: ${a}`);continue}n.push({id:a,exportValue:l,domElement:u})}return n}for(let i of document.getElementsByName(e)){let{exportValue:s}=i,a=i.getAttribute("data-element-id");a!==t&&es.has(i)&&n.push({id:a,exportValue:s,domElement:i})}return n}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(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}},Cu=class extends ct{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let i=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(n,e.action),i=!0):e.attachment?(this.#t(n,e.attachment,e.attachmentDest),i=!0):e.setOCGState?(this.#r(n,e.setOCGState),i=!0):e.dest?(this._bindLink(n,e.dest),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),i=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t==="")&&this.#e()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#e()}#t(e,t,n=null){e.href=this.linkService.getAnchorUrl(""),t.description&&(e.title=t.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#e()}#r(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");let n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let i of Object.keys(t.actions)){let s=n.get(i);s&&(e[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:i}}),!1))}e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,t){let n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){fe('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();let{fields:i,refs:s,include:a}=t,o=[];if(i.length!==0||s.length!==0){let d=new Set(s);for(let c of i){let h=this._fieldObjects[c]||[];for(let{id:f}of h)d.add(f)}for(let c of Object.values(this._fieldObjects))for(let h of c)d.has(h.id)===a&&o.push(h)}else for(let d of Object.values(this._fieldObjects))o.push(...d);let l=this.annotationStorage,u=[];for(let d of o){let{id:c}=d;switch(u.push(c),d.type){case"text":{let f=d.defaultValue||"";l.setValue(c,{value:f});break}case"checkbox":case"radiobutton":{let f=d.defaultValue===d.exportValues;l.setValue(c,{value:f});break}case"combobox":case"listbox":{let f=d.defaultValue||"";l.setValue(c,{value:f});break}default:continue}let h=document.querySelector(`[data-element-id="${c}"]`);if(h){if(!es.has(h)){fe(`_bindResetFormAction - element not allowed: ${c}`);continue}}else continue;h.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}},Mf=class extends ct{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}},Bn=class extends ct{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Nt.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,i,s){n.includes("mouse")?e.addEventListener(n,a=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(n,a=>{if(n==="blur"){if(!t.focused||!a.relatedTarget)return;t.focused=!1}else if(n==="focus"){if(t.focused)return;t.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a)}})})}_setEventListeners(e,t,n,i){for(let[s,a]of n)(a==="Action"||this.data.actions?.[a])&&((a==="Focus"||a==="Blur")&&(t||={focused:!1}),this._setEventListener(e,t,s,a,i),a==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,t,"blur","Blur",null):a==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":Q.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||ZF,s=e.style,a,o=2,l=u=>Math.round(10*u)/10;if(this.data.multiLine){let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o),d=Math.round(u/(au*i))||1,c=u/d;a=Math.min(i,l(c/au))}else{let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,l(u/au))}s.fontSize=`calc(${a}px * var(--scale-factor))`,s.color=Q.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}},Nf=class extends Bn{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,i){let s=this.annotationStorage;for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),s.setValue(a.id,{[i]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){let i=e.getValue(t,{value:this.data.fieldValue}),s=i.value||"",a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let o=i.formattedValue||this.data.textContent?.join(`
|
|
59
|
+
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));let l={userValue:s,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??s,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",o??s),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),es.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=Eo,this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener("input",d=>{e.setValue(t,{value:d.target.value}),this.setPropertyOnSiblings(n,"value",d.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",d=>{let c=this.data.defaultFieldValue??"";n.value=l.userValue=c,l.formattedValue=null});let u=d=>{let{formattedValue:c}=l;c!=null&&(d.target.value=c),d.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",c=>{if(l.focused)return;let{target:h}=c;l.userValue&&(h.value=l.userValue),l.lastCommittedValue=h.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",c=>{this.showElementAndHideCanvas(c.target);let h={value(f){l.userValue=f.detail.value??"",e.setValue(t,{value:l.userValue.toString()}),f.target.value=l.userValue},formattedValue(f){let{formattedValue:p}=f.detail;l.formattedValue=p,p!=null&&f.target!==document.activeElement&&(f.target.value=p),e.setValue(t,{formattedValue:p})},selRange(f){f.target.setSelectionRange(...f.detail.selRange)},charLimit:f=>{let{charLimit:p}=f.detail,{target:g}=f;if(p===0){g.removeAttribute("maxLength");return}g.setAttribute("maxLength",p);let v=l.userValue;!v||v.length<=p||(v=v.slice(0,p),g.value=l.userValue=v,e.setValue(t,{value:v}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(h,c)}),n.addEventListener("keydown",c=>{l.commitKey=1;let h=-1;if(c.key==="Escape"?h=0:c.key==="Enter"&&!this.data.multiLine?h=2:c.key==="Tab"&&(l.commitKey=3),h===-1)return;let{value:f}=c.target;l.lastCommittedValue!==f&&(l.lastCommittedValue=f,l.userValue=f,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:f,willCommit:!0,commitKey:h,selStart:c.target.selectionStart,selEnd:c.target.selectionEnd}}))});let d=u;u=null,n.addEventListener("blur",c=>{if(!l.focused||!c.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);let{value:h}=c.target;l.userValue=h,l.lastCommittedValue!==h&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:h,willCommit:!0,commitKey:l.commitKey,selStart:c.target.selectionStart,selEnd:c.target.selectionEnd}}),d(c)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",c=>{l.lastCommittedValue=null;let{data:h,target:f}=c,{value:p,selectionStart:g,selectionEnd:v}=f,m=g,y=v;switch(c.inputType){case"deleteWordBackward":{let w=p.substring(0,g).match(/\w*[^\w]*$/);w&&(m-=w[0].length);break}case"deleteWordForward":{let w=p.substring(g).match(/^[^\w]*\w*/);w&&(y+=w[0].length);break}case"deleteContentBackward":g===v&&(m-=1);break;case"deleteContentForward":g===v&&(y+=1);break}c.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:p,change:h||"",willCommit:!1,selStart:m,selEnd:y}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],c=>c.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){let c=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add("comb"),n.style.letterSpacing=`calc(${c}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},Lf=class extends Bn{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},jf=class extends Bn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let s=document.createElement("input");return es.add(s),s.setAttribute("data-element-id",n),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=t.fieldName,i&&s.setAttribute("checked",!0),s.setAttribute("exportValue",t.exportValue),s.tabIndex=Eo,s.addEventListener("change",a=>{let{name:o,checked:l}=a.target;for(let u of this._getElementsByName(o,n)){let d=l&&u.exportValue===t.exportValue;u.domElement&&(u.domElement.checked=d),e.setValue(u.id,{value:d})}e.setValue(n,{value:l})}),s.addEventListener("resetform",a=>{let o=t.defaultFieldValue||"Off";a.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{let o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(n,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},Tu=class extends Bn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,e.setValue(n,{value:i})),i)for(let a of this._getElementsByName(t.fieldName,n))e.setValue(a.id,{value:!1});let s=document.createElement("input");if(es.add(s),s.setAttribute("data-element-id",n),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=t.fieldName,i&&s.setAttribute("checked",!0),s.tabIndex=Eo,s.addEventListener("change",a=>{let{name:o,checked:l}=a.target;for(let u of this._getElementsByName(o,n))e.setValue(u.id,{value:!1});e.setValue(n,{value:l})}),s.addEventListener("resetform",a=>{let o=t.defaultFieldValue;a.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){let a=t.buttonValue;s.addEventListener("updatefromsandbox",o=>{let l={value:u=>{let d=a===u.detail.value;for(let c of this._getElementsByName(u.target.name)){let h=d&&c.id===n;c.domElement&&(c.domElement.checked=h),e.setValue(c.id,{value:h})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},Bf=class extends Cu{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),e}},Uf=class extends Bn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");es.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=Eo;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",d=>{let c=this.data.defaultFieldValue;for(let h of i.options)h.selected=h.value===c});for(let d of this.data.options){let c=document.createElement("option");c.textContent=d.displayValue,c.value=d.exportValue,n.value.includes(d.exportValue)&&(c.setAttribute("selected",!0),s=!1),i.append(c)}let a=null;if(s){let d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),i.prepend(d),a=()=>{d.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}let o=d=>{let c=d?"value":"textContent",{options:h,multiple:f}=i;return f?Array.prototype.filter.call(h,p=>p.selected).map(p=>p[c]):h.selectedIndex===-1?null:h[h.selectedIndex][c]},l=o(!1),u=d=>{let c=d.target.options;return Array.prototype.map.call(c,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",d=>{let c={value(h){a?.();let f=h.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(let g of i.options)g.selected=p.has(g.value);e.setValue(t,{value:o(!0)}),l=o(!1)},multipleSelection(h){i.multiple=!0},remove(h){let f=i.options,p=h.detail.remove;f[p].selected=!1,i.remove(p),f.length>0&&Array.prototype.findIndex.call(f,v=>v.selected)===-1&&(f[0].selected=!0),e.setValue(t,{value:o(!0),items:u(h)}),l=o(!1)},clear(h){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),l=o(!1)},insert(h){let{index:f,displayValue:p,exportValue:g}=h.detail.insert,v=i.children[f],m=document.createElement("option");m.textContent=p,m.value=g,v?v.before(m):i.append(m),e.setValue(t,{value:o(!0),items:u(h)}),l=o(!1)},items(h){let{items:f}=h.detail;for(;i.length!==0;)i.remove(0);for(let p of f){let{displayValue:g,exportValue:v}=p,m=document.createElement("option");m.textContent=g,m.value=v,i.append(m)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:o(!0),items:u(h)}),l=o(!1)},indices(h){let f=new Set(h.detail.indices);for(let p of h.target.options)p.selected=f.has(p.index);e.setValue(t,{value:o(!0)}),l=o(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(c,d)}),i.addEventListener("input",d=>{let c=o(!0),h=o(!1);e.setValue(t,{value:c}),d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:h,changeEx:c,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):i.addEventListener("input",function(d){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},So=class extends ct{constructor(e){let{data:t,elements:n}=e;super(e,{isRenderable:ct._hasPopupData(t)}),this.elements=n,this.popup=null}render(){this.container.classList.add("popupAnnotation");let e=this.popup=new qf({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(let n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(n=>`${dp}${n}`).join(",")),this.container}},qf=class{#e=this.#E.bind(this);#t=this.#D.bind(this);#r=this.#C.bind(this);#n=this.#A.bind(this);#s=null;#i=null;#l=null;#o=null;#d=null;#u=null;#h=null;#c=!1;#f=null;#a=null;#p=null;#m=null;#g=null;#v=null;#w=!1;constructor({container:e,color:t,elements:n,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:u,parentRect:d,open:c}){this.#i=e,this.#g=i,this.#l=a,this.#m=o,this.#u=l,this.#s=t,this.#p=u,this.#h=d,this.#d=n,this.#o=du.toDateObject(s),this.trigger=n.flatMap(h=>h.getElementsToTriggerPopup());for(let h of this.trigger)h.addEventListener("click",this.#n),h.addEventListener("mouseenter",this.#r),h.addEventListener("mouseleave",this.#t),h.classList.add("popupTriggerArea");for(let h of n)h.container?.addEventListener("keydown",this.#e);this.#i.hidden=!0,c&&this.#A()}render(){if(this.#f)return;let e=this.#f=document.createElement("div");if(e.className="popup",this.#s){let s=e.style.outlineColor=Q.makeHexColor(...this.#s);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`:e.style.backgroundColor=Q.makeHexColor(...this.#s.map(o=>Math.floor(.7*(255-o)+o)))}let t=document.createElement("span");t.className="header";let n=document.createElement("h1");if(t.append(n),{dir:n.dir,str:n.textContent}=this.#g,e.append(t),this.#o){let s=document.createElement("span");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#o.valueOf()})),t.append(s)}let i=this.#y;if(i)Eu.render({xfaHtml:i,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{let s=this._formatContents(this.#l);e.append(s)}this.#i.append(e)}get#y(){let e=this.#m,t=this.#l;return e?.str&&(!t?.str||t.str===e.str)&&this.#m.html||null}get#x(){return this.#y?.attributes?.style?.fontSize||0}get#S(){return this.#y?.attributes?.style?.color||null}#F(e){let t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:this.#S,fontSize:this.#x?`calc(${this.#x}px * var(--scale-factor))`:""}};for(let s of e.split(`
|
|
60
|
+
`))t.push({name:"span",value:s,attributes:i});return n}_formatContents({str:e,dir:t}){let n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;let i=e.split(/(?:\r\n?|\n)/);for(let s=0,a=i.length;s<a;++s){let o=i[s];n.append(document.createTextNode(o)),s<a-1&&n.append(document.createElement("br"))}return n}#E(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#c)&&this.#A()}updateEdited({rect:e,popupContent:t}){this.#v||={contentsObj:this.#l,richText:this.#m},e&&(this.#a=null),t&&(this.#m=this.#F(t),this.#l=null),this.#f?.remove(),this.#f=null}resetEdited(){this.#v&&({contentsObj:this.#l,richText:this.#m}=this.#v,this.#v=null,this.#f?.remove(),this.#f=null,this.#a=null)}#T(){if(this.#a!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:s}}}=this.#u,a=!!this.#h,o=a?this.#h:this.#p;for(let p of this.#d)if(!o||Q.intersect(p.data.rect,o)!==null){o=p.data.rect,a=!0;break}let l=Q.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),d=a?o[2]-o[0]+5:0,c=l[0]+d,h=l[1];this.#a=[100*(c-i)/t,100*(h-s)/n];let{style:f}=this.#i;f.left=`${this.#a[0]}%`,f.top=`${this.#a[1]}%`}#A(){this.#c=!this.#c,this.#c?(this.#C(),this.#i.addEventListener("click",this.#n),this.#i.addEventListener("keydown",this.#e)):(this.#D(),this.#i.removeEventListener("click",this.#n),this.#i.removeEventListener("keydown",this.#e))}#C(){this.#f||this.render(),this.isVisible?this.#c&&this.#i.classList.add("focused"):(this.#T(),this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#D(){this.#i.classList.remove("focused"),!(this.#c||!this.isVisible)&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#w=this.isVisible,this.#w&&(this.#i.hidden=!0)}maybeShow(){this.#w&&(this.#f||this.#C(),this.#w=!1,this.#i.hidden=!1)}get isVisible(){return this.#i.hidden===!1}},ku=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=ve.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(let t of this.textContent){let n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},zf=class extends ct{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let e=this.data,{width:t,height:n}=gi(e.rect),i=this.svgFactory.create(t,n,!0),s=this.#e=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),s.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),s.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),s.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Vf=class extends ct{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let e=this.data,{width:t,height:n}=gi(e.rect),i=this.svgFactory.create(t,n,!0),s=e.borderStyle.width,a=this.#e=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",t-s),a.setAttribute("height",n-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Hf=class extends ct{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let e=this.data,{width:t,height:n}=gi(e.rect),i=this.svgFactory.create(t,n,!0),s=e.borderStyle.width,a=this.#e=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",t/2),a.setAttribute("cy",n/2),a.setAttribute("rx",t/2-s/2),a.setAttribute("ry",n/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Ru=class extends ct{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:i}}=this;if(!t)return this.container;let{width:s,height:a}=gi(e),o=this.svgFactory.create(s,a,!0),l=[];for(let d=0,c=t.length;d<c;d+=2){let h=t[d]-e[0],f=e[3]-t[d+1];l.push(`${h},${f}`)}l=l.join(" ");let u=this.#e=this.svgFactory.createElement(this.svgElementName);return u.setAttribute("points",l),u.setAttribute("stroke-width",n.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),o.append(u),this.container.append(o),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Gf=class extends Ru{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},Wf=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}},Po=class extends ct{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?ve.HIGHLIGHT:ve.INK}#r(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:i,popupRef:s}}=this,{transform:a,width:o,height:l}=this.#r(t,e),u=this.svgFactory.create(o,l,!0),d=this.#e=this.svgFactory.createElement("svg:g");u.append(d),d.setAttribute("stroke-width",i.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",a);for(let c=0,h=n.length;c<h;c++){let f=this.svgFactory.createElement(this.svgElementName);this.#t.push(f),f.setAttribute("points",n[c].join(",")),d.append(f)}return!s&&this.hasPopupData&&this._createPopup(),this.container.append(u),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:i}=e,s=this.#e;if(t>=0&&s.setAttribute("stroke-width",t||1),n)for(let a=0,o=this.#t.length;a<o;a++)this.#t[a].setAttribute("points",n[a].join(","));if(i){let{transform:a,width:o,height:l}=this.#r(this.data.rotation,i);s.parentElement.setAttribute("viewBox",`0 0 ${o} ${l}`),s.setAttribute("transform",a)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}},_u=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=ve.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}},Kf=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}},Xf=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}},Yf=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}},Iu=class extends ct{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=ve.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},Zf=class extends ct{#e=null;constructor(e){super(e,{isRenderable:!0});let{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener("dblclick",this.#t.bind(this)),this.#e=n;let{isMac:i}=Nt.platform;return e.addEventListener("keydown",s=>{s.key==="Enter"&&(i?s.metaKey:s.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},Jf=class{#e=null;#t=null;#r=new Map;#n=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:i,page:s,viewport:a,structTreeLayer:o}){this.div=e,this.#e=t,this.#t=n,this.#n=o||null,this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i}hasEditableAnnotations(){return this.#r.size>0}async#s(e,t){let n=e.firstChild||e,i=n.id=`${dp}${t}`,s=await this.#n?.getAriaAttributes(i);if(s)for(let[a,o]of s)n.setAttribute(a,o);this.div.append(e),this.#e?.moveElementInDOM(this.div,e,n,!1)}async render(e){let{annotations:t}=e,n=this.div;Ji(n,this.viewport);let i=new Map,s={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new Ao,annotationStorage:e.annotationStorage||new yo,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let a of t){if(a.noHTML)continue;let o=a.annotationType===Ft.POPUP;if(o){let d=i.get(a.id);if(!d)continue;s.elements=d}else{let{width:d,height:c}=gi(a.rect);if(d<=0||c<=0)continue}s.data=a;let l=Of.create(s);if(!l.isRenderable)continue;if(!o&&a.popupRef){let d=i.get(a.popupRef);d?d.push(l):i.set(a.popupRef,[l])}let u=l.render();a.hidden&&(u.style.visibility="hidden"),await this.#s(u,a.id),l._isEditable&&(this.#r.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}this.#i()}update({viewport:e}){let t=this.div;this.viewport=e,Ji(t,{rotation:e.rotation}),this.#i(),t.hidden=!1}#i(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;n.className="annotationContent";let{firstChild:s}=i;s?s.nodeName==="CANVAS"?s.replaceWith(n):s.classList.contains("annotationContent")?s.after(n):s.before(n):i.append(n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#r.values())}getEditableAnnotation(e){return this.#r.get(e)}},su=/\r\n?|\n/g,Qf=class r extends it{#e;#t="";#r=`${this.id}-editor`;#n=null;#s;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let e=r.prototype,t=s=>s.isEmpty(),n=$i.TRANSLATE_SMALL,i=$i.TRANSLATE_BIG;return xe(this,"_keyboardManager",new Qi([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}]]))}static _type="freetext";static _editorType=ve.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#e=e.color||r._defaultColor||it._defaultLineColor,this.#s=e.fontSize||r._defaultFontSize}static initialize(e,t){it.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case Pe.FREETEXT_SIZE:r._defaultFontSize=t;break;case Pe.FREETEXT_COLOR:r._defaultColor=t;break}}updateParams(e,t){switch(e){case Pe.FREETEXT_SIZE:this.#i(t);break;case Pe.FREETEXT_COLOR:this.#l(t);break}}static get defaultPropertiesToUpdate(){return[[Pe.FREETEXT_SIZE,r._defaultFontSize],[Pe.FREETEXT_COLOR,r._defaultColor||it._defaultLineColor]]}get propertiesToUpdate(){return[[Pe.FREETEXT_SIZE,this.#s],[Pe.FREETEXT_COLOR,this.#e]]}#i(e){let t=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-this.#s)*this.parentScale),this.#s=i,this.#d()},n=this.#s;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pe.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#l(e){let t=i=>{this.#e=this.editorDiv.style.color=i},n=this.#e;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pe.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let e=this.parentScale;return[-r._internalPadding*e,-(r._internalPadding+this.#s)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(ve.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#r),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&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()}#o(){let e=[];this.editorDiv.normalize();let t=null;for(let n of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&n.nodeName==="BR"||(e.push(r.#u(n)),t=n);return e.join(`
|
|
61
|
+
`)}#d(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:i,div:s}=this,a=s.style.display,o=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",i.div.append(this.div),n=s.getBoundingClientRect(),s.remove(),s.style.display=a,s.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#t,t=this.#t=this.#o().trimEnd();if(e===t)return;let n=i=>{if(this.#t=i,!i){this.remove();return}this.#h(),this._uiManager.rebuild(this),this.#d()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#d()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){r._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#s}px * var(--scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),cu(this,this.div,["dblclick","keydown"]),this.width){let[i,s]=this.parentDimensions;if(this.annotationElementId){let{position:a}=this._initialData,[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);let[u,d]=this.pageDimensions,[c,h]=this.pageTranslation,f,p;switch(this.rotation){case 0:f=e+(a[0]-c)/u,p=t+this.height-(a[1]-h)/d;break;case 90:f=e+(a[0]-c)/u,p=t-(a[1]-h)/d,[o,l]=[l,-o];break;case 180:f=e-this.width+(a[0]-c)/u,p=t-(a[1]-h)/d,[o,l]=[-o,-l];break;case 270:f=e+(a[0]-c-this.height*d)/u,p=t+(a[1]-h-this.width*u)/d,[o,l]=[-l,o];break}this.setAt(f*i,p*s,o,l)}else this.setAt(e*i,t*s,this.width*i,this.height*s);this.#h(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#u(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(su,"")}editorDivPaste(e){let t=e.clipboardData||window.clipboardData,{types:n}=t;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();let i=r.#f(t.getData("text")||"").replaceAll(su,`
|
|
62
|
+
`);if(!i)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let a=s.getRangeAt(0);if(!i.includes(`
|
|
63
|
+
`)){a.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),s.collapseToStart();return}let{startContainer:o,startOffset:l}=a,u=[],d=[];if(o.nodeType===Node.TEXT_NODE){let f=o.parentElement;if(d.push(o.nodeValue.slice(l).replaceAll(su,"")),f!==this.editorDiv){let p=u;for(let g of this.editorDiv.childNodes){if(g===f){p=d;continue}p.push(r.#u(g))}}u.push(o.nodeValue.slice(0,l).replaceAll(su,""))}else if(o===this.editorDiv){let f=u,p=0;for(let g of this.editorDiv.childNodes)p++===l&&(f=d),f.push(r.#u(g))}this.#t=`${u.join(`
|
|
64
|
+
`)}${i}${d.join(`
|
|
65
|
+
`)}`,this.#h();let c=new Range,h=u.reduce((f,p)=>f+p.length,0);for(let{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){let p=f.nodeValue.length;if(h<=p){c.setStart(f,h),c.setEnd(f,h);break}h-=p}s.removeAllRanges(),s.addRange(c)}#h(){if(this.editorDiv.replaceChildren(),!!this.#t)for(let e of this.#t.split(`
|
|
66
|
+
`)){let t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#c(){return this.#t.replaceAll("\xA0"," ")}static#f(e){return e.replaceAll(" ","\xA0")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,n){let i=null;if(e instanceof ku){let{data:{defaultAppearanceData:{fontSize:a,fontColor:o},rect:l,rotation:u,id:d,popupRef:c},textContent:h,textPosition:f,parent:{page:{pageNumber:p}}}=e;if(!h||h.length===0)return null;i=e={annotationType:ve.FREETEXT,color:Array.from(o),fontSize:a,value:h.join(`
|
|
67
|
+
`),position:f,pageIndex:p-1,rect:l.slice(0),rotation:u,id:d,deleted:!1,popupRef:c}}let s=await super.deserialize(e,t,n);return s.#s=e.fontSize,s.#e=Q.makeHexColor(...e.color),s.#t=r.#f(e.value),s.annotationElementId=e.id||null,s._initialData=i,s}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=r._internalPadding*this.parentScale,n=this.getRect(t,t),i=it._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),s={annotationType:ve.FREETEXT,color:i,fontSize:this.#s,value:this.#c(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!this.#a(s)?null:(s.id=this.annotationElementId,s)}#a(e){let{value:t,fontSize:n,color:i,pageIndex:s}=this._initialData;return this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((a,o)=>a!==i[o])||e.pageIndex!==s}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(this.deleted)return t;let{style:n}=t;n.fontSize=`calc(${this.#s}px * var(--scale-factor))`,n.color=this.#e,t.replaceChildren();for(let s of this.#t.split(`
|
|
68
|
+
`)){let a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),t.append(a)}let i=r._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(i,i),popupContent:this.#t}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},Z=class{static PRECISION=1e-4;toSVGPath(){He("Abstract method `toSVGPath` must be implemented.")}get box(){He("Abstract getter `box` must be implemented.")}serialize(e,t){He("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,i,s,a){a||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o]*i,a[o+1]=n+e[o+1]*s;return a}static _rescaleAndSwap(e,t,n,i,s,a){a||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o+1]*i,a[o+1]=n+e[o]*s;return a}static _translate(e,t,n,i){i||=new Float32Array(e.length);for(let s=0,a=e.length;s<a;s+=2)i[s]=t+e[s],i[s+1]=n+e[s+1];return i}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,i,s){switch(s){case 90:return[1-t/n,e/i];case 180:return[1-e/n,1-t/i];case 270:return[t/n,1-e/i];default:return[e/n,t/i]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,i,s,a){return[(e+5*n)/6,(t+5*i)/6,(5*n+s)/6,(5*i+a)/6,(n+s)/2,(i+a)/2]}},Ou=class r{#e;#t=[];#r;#n;#s=[];#i=new Float32Array(18);#l;#o;#d;#u;#h;#c;#f=[];static#a=8;static#p=2;static#m=r.#a+r.#p;constructor({x:e,y:t},n,i,s,a,o=0){this.#e=n,this.#c=s*i,this.#n=a,this.#i.set([NaN,NaN,NaN,NaN,e,t],6),this.#r=o,this.#u=r.#a*i,this.#d=r.#m*i,this.#h=i,this.#f.push(e,t)}isEmpty(){return isNaN(this.#i[8])}#g(){let e=this.#i.subarray(4,6),t=this.#i.subarray(16,18),[n,i,s,a]=this.#e;return[(this.#l+(e[0]-t[0])/2-n)/s,(this.#o+(e[1]-t[1])/2-i)/a,(this.#l+(t[0]-e[0])/2-n)/s,(this.#o+(t[1]-e[1])/2-i)/a]}add({x:e,y:t}){this.#l=e,this.#o=t;let[n,i,s,a]=this.#e,[o,l,u,d]=this.#i.subarray(8,12),c=e-u,h=t-d,f=Math.hypot(c,h);if(f<this.#d)return!1;let p=f-this.#u,g=p/f,v=g*c,m=g*h,y=o,w=l;o=u,l=d,u+=v,d+=m,this.#f?.push(e,t);let x=-m/p,b=v/p,A=x*this.#c,S=b*this.#c;return this.#i.set(this.#i.subarray(2,8),0),this.#i.set([u+A,d+S],4),this.#i.set(this.#i.subarray(14,18),12),this.#i.set([u-A,d-S],16),isNaN(this.#i[6])?(this.#s.length===0&&(this.#i.set([o+A,l+S],2),this.#s.push(NaN,NaN,NaN,NaN,(o+A-n)/s,(l+S-i)/a),this.#i.set([o-A,l-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-A-n)/s,(l-S-i)/a)),this.#i.set([y,w,o,l,u,d],6),!this.isEmpty()):(this.#i.set([y,w,o,l,u,d],6),Math.abs(Math.atan2(w-l,y-o)-Math.atan2(m,v))<Math.PI/2?([o,l,u,d]=this.#i.subarray(2,6),this.#s.push(NaN,NaN,NaN,NaN,((o+u)/2-n)/s,((l+d)/2-i)/a),[o,l,y,w]=this.#i.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((y+o)/2-n)/s,((w+l)/2-i)/a),!0):([y,w,o,l,u,d]=this.#i.subarray(0,6),this.#s.push(((y+5*o)/6-n)/s,((w+5*l)/6-i)/a,((5*o+u)/6-n)/s,((5*l+d)/6-i)/a,((o+u)/2-n)/s,((l+d)/2-i)/a),[u,d,o,l,y,w]=this.#i.subarray(12,18),this.#t.push(((y+5*o)/6-n)/s,((w+5*l)/6-i)/a,((5*o+u)/6-n)/s,((5*l+d)/6-i)/a,((o+u)/2-n)/s,((l+d)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";let e=this.#s,t=this.#t;if(isNaN(this.#i[6])&&!this.isEmpty())return this.#v();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?n.push(`L${e[i+4]} ${e[i+5]}`):n.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);this.#y(n);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?n.push(`L${t[i+4]} ${t[i+5]}`):n.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return this.#w(n),n.join(" ")}#v(){let[e,t,n,i]=this.#e,[s,a,o,l]=this.#g();return`M${(this.#i[2]-e)/n} ${(this.#i[3]-t)/i} L${(this.#i[4]-e)/n} ${(this.#i[5]-t)/i} L${s} ${a} L${o} ${l} L${(this.#i[16]-e)/n} ${(this.#i[17]-t)/i} L${(this.#i[14]-e)/n} ${(this.#i[15]-t)/i} Z`}#w(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,i,s]=this.#e,a=this.#i.subarray(4,6),o=this.#i.subarray(16,18),[l,u,d,c]=this.#g();e.push(`L${(a[0]-t)/i} ${(a[1]-n)/s} L${l} ${u} L${d} ${c} L${(o[0]-t)/i} ${(o[1]-n)/s}`)}newFreeDrawOutline(e,t,n,i,s,a){return new Mu(e,t,n,i,s,a)}getOutlines(){let e=this.#s,t=this.#t,n=this.#i,[i,s,a,o]=this.#e,l=new Float32Array((this.#f?.length??0)+2);for(let c=0,h=l.length-2;c<h;c+=2)l[c]=(this.#f[c]-i)/a,l[c+1]=(this.#f[c+1]-s)/o;if(l[l.length-2]=(this.#l-i)/a,l[l.length-1]=(this.#o-s)/o,isNaN(n[6])&&!this.isEmpty())return this.#x(l);let u=new Float32Array(this.#s.length+24+this.#t.length),d=e.length;for(let c=0;c<d;c+=2){if(isNaN(e[c])){u[c]=u[c+1]=NaN;continue}u[c]=e[c],u[c+1]=e[c+1]}d=this.#F(u,d);for(let c=t.length-6;c>=6;c-=6)for(let h=0;h<6;h+=2){if(isNaN(t[c+h])){u[d]=u[d+1]=NaN,d+=2;continue}u[d]=t[c+h],u[d+1]=t[c+h+1],d+=2}return this.#S(u,d),this.newFreeDrawOutline(u,l,this.#e,this.#h,this.#r,this.#n)}#x(e){let t=this.#i,[n,i,s,a]=this.#e,[o,l,u,d]=this.#g(),c=new Float32Array(36);return c.set([NaN,NaN,NaN,NaN,(t[2]-n)/s,(t[3]-i)/a,NaN,NaN,NaN,NaN,(t[4]-n)/s,(t[5]-i)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(t[16]-n)/s,(t[17]-i)/a,NaN,NaN,NaN,NaN,(t[14]-n)/s,(t[15]-i)/a],0),this.newFreeDrawOutline(c,e,this.#e,this.#h,this.#r,this.#n)}#S(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#F(e,t){let n=this.#i.subarray(4,6),i=this.#i.subarray(16,18),[s,a,o,l]=this.#e,[u,d,c,h]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-s)/o,(n[1]-a)/l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/l],t),t+=24}},Mu=class extends Z{#e;#t=new Float32Array(4);#r;#n;#s;#i;#l;constructor(e,t,n,i,s,a){super(),this.#l=e,this.#s=t,this.#e=n,this.#i=i,this.#r=s,this.#n=a,this.lastPoint=[NaN,NaN],this.#o(a);let[o,l,u,d]=this.#t;for(let c=0,h=e.length;c<h;c+=2)e[c]=(e[c]-o)/u,e[c+1]=(e[c+1]-l)/d;for(let c=0,h=t.length;c<h;c+=2)t[c]=(t[c]-o)/u,t[c+1]=(t[c+1]-l)/d}toSVGPath(){let e=[`M${this.#l[4]} ${this.#l[5]}`];for(let t=6,n=this.#l.length;t<n;t+=6){if(isNaN(this.#l[t])){e.push(`L${this.#l[t+4]} ${this.#l[t+5]}`);continue}e.push(`C${this.#l[t]} ${this.#l[t+1]} ${this.#l[t+2]} ${this.#l[t+3]} ${this.#l[t+4]} ${this.#l[t+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,t,n,i],s){let a=n-e,o=i-t,l,u;switch(s){case 0:l=Z._rescale(this.#l,e,i,a,-o),u=Z._rescale(this.#s,e,i,a,-o);break;case 90:l=Z._rescaleAndSwap(this.#l,e,t,a,o),u=Z._rescaleAndSwap(this.#s,e,t,a,o);break;case 180:l=Z._rescale(this.#l,n,t,-a,o),u=Z._rescale(this.#s,n,t,-a,o);break;case 270:l=Z._rescaleAndSwap(this.#l,n,i,-a,-o),u=Z._rescaleAndSwap(this.#s,n,i,-a,-o);break}return{outline:Array.from(l),points:[Array.from(u)]}}#o(e){let t=this.#l,n=t[4],i=t[5],s=n,a=i,o=n,l=i,u=n,d=i,c=e?Math.max:Math.min;for(let f=6,p=t.length;f<p;f+=6){if(isNaN(t[f]))s=Math.min(s,t[f+4]),a=Math.min(a,t[f+5]),o=Math.max(o,t[f+4]),l=Math.max(l,t[f+5]),d<t[f+5]?(u=t[f+4],d=t[f+5]):d===t[f+5]&&(u=c(u,t[f+4]));else{let g=Q.bezierBoundingBox(n,i,...t.slice(f,f+6));s=Math.min(s,g[0]),a=Math.min(a,g[1]),o=Math.max(o,g[2]),l=Math.max(l,g[3]),d<g[3]?(u=g[2],d=g[3]):d===g[3]&&(u=c(u,g[2]))}n=t[f+4],i=t[f+5]}let h=this.#t;h[0]=s-this.#r,h[1]=a-this.#r,h[2]=o-s+2*this.#r,h[3]=l-a+2*this.#r,this.lastPoint=[u,d]}get box(){return this.#t}newOutliner(e,t,n,i,s,a=0){return new Ou(e,t,n,i,s,a)}getNewOutline(e,t){let[n,i,s,a]=this.#t,[o,l,u,d]=this.#e,c=s*u,h=a*d,f=n*u+o,p=i*d+l,g=this.newOutliner({x:this.#s[0]*c+f,y:this.#s[1]*h+p},this.#e,this.#i,e,this.#n,t??this.#r);for(let v=2;v<this.#s.length;v+=2)g.add({x:this.#s[v]*c+f,y:this.#s[v+1]*h+p});return g.getOutlines()}},Fo=class{#e;#t;#r=[];#n=[];constructor(e,t=0,n=0,i=!0){let s=1/0,a=-1/0,o=1/0,l=-1/0,d=10**-4;for(let{x:m,y,width:w,height:x}of e){let b=Math.floor((m-t)/d)*d,A=Math.ceil((m+w+t)/d)*d,S=Math.floor((y-t)/d)*d,P=Math.ceil((y+x+t)/d)*d,F=[b,S,P,!0],k=[A,S,P,!1];this.#r.push(F,k),s=Math.min(s,b),a=Math.max(a,A),o=Math.min(o,S),l=Math.max(l,P)}let c=a-s+2*n,h=l-o+2*n,f=s-n,p=o-n,g=this.#r.at(i?-1:-2),v=[g[0],g[2]];for(let m of this.#r){let[y,w,x]=m;m[0]=(y-f)/c,m[1]=(w-p)/h,m[2]=(x-p)/h}this.#e=new Float32Array([f,p,c,h]),this.#t=v}getOutlines(){this.#r.sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);let e=[];for(let t of this.#r)t[3]?(e.push(...this.#d(t)),this.#l(t)):(this.#o(t),e.push(...this.#d(t)));return this.#s(e)}#s(e){let t=[],n=new Set;for(let a of e){let[o,l,u]=a;t.push([o,l,a],[o,u,a])}t.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=t.length;a<o;a+=2){let l=t[a][2],u=t[a+1][2];l.push(u),u.push(l),n.add(l),n.add(u)}let i=[],s;for(;n.size>0;){let a=n.values().next().value,[o,l,u,d,c]=a;n.delete(a);let h=o,f=l;for(s=[o,u],i.push(s);;){let p;if(n.has(d))p=d;else if(n.has(c))p=c;else break;n.delete(p),[o,l,u,d,c]=p,h!==o&&(s.push(h,f,o,f===l?l:u),h=o),f=f===l?u:l}s.push(h,f)}return new $f(i,this.#e,this.#t)}#i(e){let t=this.#n,n=0,i=t.length-1;for(;n<=i;){let s=n+i>>1,a=t[s][0];if(a===e)return s;a<e?n=s+1:i=s-1}return i+1}#l([,e,t]){let n=this.#i(e);this.#n.splice(n,0,[e,t])}#o([,e,t]){let n=this.#i(e);for(let i=n;i<this.#n.length;i++){let[s,a]=this.#n[i];if(s!==e)break;if(s===e&&a===t){this.#n.splice(i,1);return}}for(let i=n-1;i>=0;i--){let[s,a]=this.#n[i];if(s!==e)break;if(s===e&&a===t){this.#n.splice(i,1);return}}}#d(e){let[t,n,i]=e,s=[[t,n,i]],a=this.#i(i);for(let o=0;o<a;o++){let[l,u]=this.#n[o];for(let d=0,c=s.length;d<c;d++){let[,h,f]=s[d];if(!(u<=h||f<=l)){if(h>=l){if(f>u)s[d][1]=u;else{if(c===1)return[];s.splice(d,1),d--,c--}continue}s[d][2]=l,f>u&&s.push([t,u,f])}}}return s}},$f=class extends Z{#e;#t;constructor(e,t,n){super(),this.#t=e,this.#e=t,this.lastPoint=n}toSVGPath(){let e=[];for(let t of this.#t){let[n,i]=t;e.push(`M${n} ${i}`);for(let s=2;s<t.length;s+=2){let a=t[s],o=t[s+1];a===n?(e.push(`V${o}`),i=o):o===i&&(e.push(`H${a}`),n=a)}e.push("Z")}return e.join(" ")}serialize([e,t,n,i],s){let a=[],o=n-e,l=i-t;for(let u of this.#t){let d=new Array(u.length);for(let c=0;c<u.length;c+=2)d[c]=e+u[c]*o,d[c+1]=i-u[c+1]*l;a.push(d)}return a}get box(){return this.#e}get classNamesForOutlining(){return["highlightOutline"]}},Do=class extends Ou{newFreeDrawOutline(e,t,n,i,s,a){return new ep(e,t,n,i,s,a)}},ep=class extends Mu{newOutliner(e,t,n,i,s,a=0){return new Do(e,t,n,i,s,a)}},Nu=class r{#e=null;#t=null;#r;#n=null;#s=!1;#i=!1;#l=null;#o;#d=null;#u=null;#h;static#c=null;static get _keyboardManager(){return xe(this,"_keyboardManager",new Qi([[["Escape","mac+Escape"],r.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],r.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],r.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],r.prototype._moveToPrevious],[["Home","mac+Home"],r.prototype._moveToBeginning],[["End","mac+End"],r.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#i=!1,this.#h=Pe.HIGHLIGHT_COLOR,this.#l=e):(this.#i=!0,this.#h=Pe.HIGHLIGHT_DEFAULT_COLOR),this.#u=e?._uiManager||t,this.#o=this.#u._eventBus,this.#r=e?.color||this.#u?.highlightColors.values().next().value||"#FFFF98",r.#c||=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(){let e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);let t=this.#u._signal;e.addEventListener("click",this.#m.bind(this),{signal:t}),e.addEventListener("keydown",this.#p.bind(this),{signal:t});let n=this.#t=document.createElement("span");return n.className="swatch",n.setAttribute("aria-hidden",!0),n.style.backgroundColor=this.#r,e.append(n),e}renderMainDropdown(){let e=this.#n=this.#f();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#f(){let e=document.createElement("div"),t=this.#u._signal;e.addEventListener("contextmenu",tn,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(let[n,i]of this.#u.highlightColors){let s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",i),s.title=n,s.setAttribute("data-l10n-id",r.#c[n]);let a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=i,s.setAttribute("aria-selected",i===this.#r),s.addEventListener("click",this.#a.bind(this,i),{signal:t}),e.append(s)}return e.addEventListener("keydown",this.#p.bind(this),{signal:t}),e}#a(e,t){t.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:this.#h,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#m(e);return}let t=e.target.getAttribute("data-color");t&&this.#a(t,e)}_moveToNext(e){if(!this.#v){this.#m(e);return}if(e.target===this.#e){this.#n.firstChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#n?.firstChild||e.target===this.#e){this.#v&&this._hideDropdownFromKeyboard();return}this.#v||this.#m(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#v){this.#m(e);return}this.#n.firstChild?.focus()}_moveToEnd(e){if(!this.#v){this.#m(e);return}this.#n.lastChild?.focus()}#p(e){r._keyboardManager.exec(this,e)}#m(e){if(this.#v){this.hideDropdown();return}if(this.#s=e.detail===0,this.#d||(this.#d=new AbortController,window.addEventListener("pointerdown",this.#g.bind(this),{signal:this.#u.combinedSignal(this.#d)})),this.#n){this.#n.classList.remove("hidden");return}let t=this.#n=this.#f();this.#e.append(t)}#g(e){this.#n?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#n?.classList.add("hidden"),this.#d?.abort(),this.#d=null}get#v(){return this.#n&&!this.#n.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#i){if(!this.#v){this.#l?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#s})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#n)return;let t=this.#u.highlightColors.values();for(let n of this.#n.children)n.setAttribute("aria-selected",t.next().value===e)}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#n?.remove(),this.#n=null}},Lu=class r extends it{#e=null;#t=0;#r;#n=null;#s=null;#i=null;#l=null;#o=0;#d=null;#u=null;#h=null;#c=!1;#f=null;#a;#p=null;#m="";#g;#v="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=ve.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){let e=r.prototype;return xe(this,"_keyboardManager",new Qi([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||r._defaultColor,this.#g=e.thickness||r._defaultThickness,this.#a=e.opacity||r._defaultOpacity,this.#r=e.boxes||null,this.#v=e.methodOfCreation||"",this.#m=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#c=!0,this.#y(e),this.#T()):this.#r&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#l=e.focusNode,this.#o=e.focusOffset,this.#w(),this.#T(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#c?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#g,methodOfCreation:this.#v}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#w(){let e=new Fo(this.#r,.001);this.#u=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#u.box;let t=new Fo(this.#r,.0025,.001,this._uiManager.direction==="ltr");this.#i=t.getOutlines();let{lastPoint:n}=this.#i;this.#f=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#y({highlightOutlines:e,highlightId:t,clipPathId:n}){this.#u=e;let i=1.5;if(this.#i=e.getNewOutline(this.#g/2+i,.0025),t>=0)this.#h=t,this.#n=n,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#p=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#i.box,path:{d:this.#i.toSVGPath()}},!0);else if(this.parent){let d=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#h,{bbox:r.#A(this.#u.box,(d-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#p,{bbox:r.#A(this.#i.box,d),path:{d:this.#i.toSVGPath()}})}let[s,a,o,l]=e.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=o,this.height=l;break;case 90:{let[d,c]=this.parentDimensions;this.x=a,this.y=1-s,this.width=o*c/d,this.height=l*d/c;break}case 180:this.x=1-s,this.y=1-a,this.width=o,this.height=l;break;case 270:{let[d,c]=this.parentDimensions;this.x=1-a,this.y=s,this.width=o*c/d,this.height=l*d/c;break}}let{lastPoint:u}=this.#i;this.#f=[(u[0]-s)/o,(u[1]-a)/l]}static initialize(e,t){it.initialize(e,t),r._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case Pe.HIGHLIGHT_DEFAULT_COLOR:r._defaultColor=t;break;case Pe.HIGHLIGHT_THICKNESS:r._defaultThickness=t;break}}translateInPage(e,t){}get toolbarPosition(){return this.#f}updateParams(e,t){switch(e){case Pe.HIGHLIGHT_COLOR:this.#x(t);break;case Pe.HIGHLIGHT_THICKNESS:this.#S(t);break}}static get defaultPropertiesToUpdate(){return[[Pe.HIGHLIGHT_DEFAULT_COLOR,r._defaultColor],[Pe.HIGHLIGHT_THICKNESS,r._defaultThickness]]}get propertiesToUpdate(){return[[Pe.HIGHLIGHT_COLOR,this.color||r._defaultColor],[Pe.HIGHLIGHT_THICKNESS,this.#g||r._defaultThickness],[Pe.HIGHLIGHT_FREE,this.#c]]}#x(e){let t=(s,a)=>{this.color=s,this.#a=a,this.parent?.drawLayer.updateProperties(this.#h,{root:{fill:s,"fill-opacity":a}}),this.#s?.updateColor(s)},n=this.color,i=this.#a;this.addCommands({cmd:t.bind(this,e,r._defaultOpacity),undo:t.bind(this,n,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pe.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#S(e){let t=this.#g,n=i=>{this.#g=i,this.#F(i)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pe.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){let e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#s=new Nu({editor:this}),e.addColorPicker(this.#s)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#R())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#R())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#E(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#T(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#E():e&&(this.#T(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#F(e){if(!this.#c)return;this.#y({highlightOutlines:this.#u.getNewOutline(e/2)}),this.fixAndSetPosition();let[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}#E(){this.#h===null||!this.parent||(this.parent.drawLayer.remove(this.#h),this.#h=null,this.parent.drawLayer.remove(this.#p),this.#p=null)}#T(e=this.parent){this.#h===null&&({id:this.#h,clipPathId:this.#n}=e.drawLayer.draw({bbox:this.#u.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#a},rootClass:{highlight:!0,free:this.#c},path:{d:this.#u.toSVGPath()}},!1,!0),this.#p=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#c},bbox:this.#i.box,path:{d:this.#i.toSVGPath()}},this.#c),this.#d&&(this.#d.style.clipPath=this.#n))}static#A([e,t,n,i],s){switch(s){case 90:return[1-t-i,e,i,n];case 180:return[1-e-n,1-t-i,n,i];case 270:return[t,1-e-n,i,n]}return[e,t,n,i]}rotate(e){let{drawLayer:t}=this.parent,n;this.#c?(e=(e-this.rotation+360)%360,n=r.#A(this.#u.box,e)):n=r.#A([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#h,{bbox:n,root:{"data-main-rotation":e}}),t.updateProperties(this.#p,{bbox:r.#A(this.#i.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;let e=super.render();this.#m&&(e.setAttribute("aria-label",this.#m),e.setAttribute("role","mark")),this.#c?e.classList.add("free"):this.div.addEventListener("keydown",this.#C.bind(this),{signal:this._uiManager._signal});let t=this.#d=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#n;let[n,i]=this.parentDimensions;return this.setDims(this.width*n,this.height*i),cu(this,this.#d,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!1}})}#C(e){r._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#D(!0);break;case 1:case 3:this.#D(!1);break}}#D(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#l,this.#o)}select(){super.select(),this.#p&&this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#p&&(this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{selected:!1}}),this.#c||this.#D(!1))}get _mustFixPosition(){return!this.#c}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#h,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#p,{rootClass:{hidden:!e}}))}#R(){return this.#c?this.rotation:0}#O(){if(this.#c)return null;let[e,t]=this.pageDimensions,[n,i]=this.pageTranslation,s=this.#r,a=new Float32Array(s.length*8),o=0;for(let{x:l,y:u,width:d,height:c}of s){let h=l*e+n,f=(1-u)*t+i;a[o]=a[o+4]=h,a[o+1]=a[o+3]=f,a[o+2]=a[o+6]=h+d*e,a[o+5]=a[o+7]=f-c*t,o+=8}return a}#N(e){return this.#u.serialize(e,this.#R())}static startHighlighting(e,t,{target:n,x:i,y:s}){let{x:a,y:o,width:l,height:u}=n.getBoundingClientRect(),d=new AbortController,c=e.combinedSignal(d),h=f=>{d.abort(),this.#b(e,f)};window.addEventListener("blur",h,{signal:c}),window.addEventListener("pointerup",h,{signal:c}),window.addEventListener("pointerdown",Dr,{capture:!0,passive:!1,signal:c}),window.addEventListener("contextmenu",tn,{signal:c}),n.addEventListener("pointermove",this.#P.bind(this,e),{signal:c}),this._freeHighlight=new Do({x:i,y:s},[a,o,l,u],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#P(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#b(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!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(e,t,n){let i=null;if(e instanceof _u){let{data:{quadPoints:p,rect:g,rotation:v,id:m,color:y,opacity:w,popupRef:x},parent:{page:{pageNumber:b}}}=e;i=e={annotationType:ve.HIGHLIGHT,color:Array.from(y),opacity:w,quadPoints:p,boxes:null,pageIndex:b-1,rect:g.slice(0),rotation:v,id:m,deleted:!1,popupRef:x}}else if(e instanceof Po){let{data:{inkLists:p,rect:g,rotation:v,id:m,color:y,borderStyle:{rawWidth:w},popupRef:x},parent:{page:{pageNumber:b}}}=e;i=e={annotationType:ve.HIGHLIGHT,color:Array.from(y),thickness:w,inkLists:p,boxes:null,pageIndex:b-1,rect:g.slice(0),rotation:v,id:m,deleted:!1,popupRef:x}}let{color:s,quadPoints:a,inkLists:o,opacity:l}=e,u=await super.deserialize(e,t,n);u.color=Q.makeHexColor(...s),u.#a=l||1,o&&(u.#g=e.thickness),u.annotationElementId=e.id||null,u._initialData=i;let[d,c]=u.pageDimensions,[h,f]=u.pageTranslation;if(a){let p=u.#r=[];for(let g=0;g<a.length;g+=8)p.push({x:(a[g]-h)/d,y:1-(a[g+1]-f)/c,width:(a[g+2]-a[g])/d,height:(a[g+1]-a[g+5])/c});u.#w(),u.#T(),u.rotate(u.rotation)}else if(o){u.#c=!0;let p=o[0],g={x:p[0]-h,y:c-(p[1]-f)},v=new Do(g,[0,0,d,c],1,u.#g/2,!0,.001);for(let w=0,x=p.length;w<x;w+=2)g.x=p[w]-h,g.y=c-(p[w+1]-f),v.add(g);let{id:m,clipPathId:y}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:v.toSVGPath()}},!0,!0);u.#y({highlightOutlines:v.getOutlines(),highlightId:m,clipPathId:y}),u.#T()}return u}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=this.getRect(0,0),n=it._colorManager.convert(this.color),i={annotationType:ve.HIGHLIGHT,color:n,opacity:this.#a,thickness:this.#g,quadPoints:this.#O(),outlines:this.#N(t),pageIndex:this.pageIndex,rect:t,rotation:this.#R(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#I(i)?null:(i.id=this.annotationElementId,i)}#I(e){let{color:t}=this._initialData;return e.color.some((n,i)=>n!==t[i])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}},tp=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){He("Not implemented")}},rp=class r extends it{#e=null;#t;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#r=null;static#n=null;static#s=null;static#i=NaN;static#l=null;static#o=null;static#d=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,e.drawOutlines&&(this.#u(e),this.#f())}#u({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#h(e,this.parent),this.#m(e.box)}#h(e,t){let{id:n}=t.drawLayer.draw(r._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return n}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[i,s]of Object.entries(t))n.has(i)?Object.assign(e[i],s):e[i]=s;return e}static getDefaultDrawingOptions(e){He("Not implemented")}static get typesMap(){He("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,t){let n=this.typesMap.get(e);n&&this._defaultDrawingOptions.updateProperty(n,t),this._currentParent&&(r.#r.updateProperty(n,t),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,i]of this.typesMap)e.push([n,t[i]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,i]of this.constructor.typesMap)e.push([n,t[i]]);return e}_updateProperty(e,t,n){let i=this._drawingOptions,s=i[t],a=o=>{i.updateProperty(t,o);let l=this.#e.updateProperty(t,o);l&&this.#m(l),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties())};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,r._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#p()),{bbox:this.#g()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,r._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#p()),{bbox:this.#g()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#g(e,t)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,r._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#p(),this.parentDimensions),{bbox:this.#g()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#c(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#f(),this.#m(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#c()):e&&(this._uiManager.addShouldRescale(this),this.#f(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),t&&this.select()}#c(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#f(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#h(this.#e,e)}}#a([e,t,n,i]){let{parentDimensions:[s,a],rotation:o}=this;switch(o){case 90:return[t,1-e,n*(a/s),i*(s/a)];case 180:return[1-e,1-t,n,i];case 270:return[1-t,e,n*(a/s),i*(s/a)];default:return[e,t,n,i]}}#p(){let{x:e,y:t,width:n,height:i,parentDimensions:[s,a],rotation:o}=this;switch(o){case 90:return[1-t,e,n*(s/a),i*(a/s)];case 180:return[1-e,1-t,n,i];case 270:return[t,1-e,n*(s/a),i*(a/s)];default:return[e,t,n,i]}}#m(e){if([this.x,this.y,this.width,this.height]=this.#a(e),this.div){this.fixAndSetPosition();let[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}this._onResized()}#g(){let{x:e,y:t,width:n,height:i,rotation:s,parentRotation:a,parentDimensions:[o,l]}=this;switch((s*4+a)/90){case 1:return[1-t-i,e,i,n];case 2:return[1-e-n,1-t-i,n,i];case 3:return[t,1-e-n,i,n];case 4:return[e,t-n*(o/l),i*(l/o),n*(o/l)];case 5:return[1-t,e,n*(o/l),i*(l/o)];case 6:return[1-e-i*(l/o),1-t,i*(l/o),n*(o/l)];case 7:return[t-n*(o/l),1-e-i*(l/o),n*(o/l),i*(l/o)];case 8:return[e-n,t-i,n,i];case 9:return[1-t,e-n,i,n];case 10:return[1-e,1-t,n,i];case 11:return[t-i,1-e,i,n];case 12:return[e-i*(l/o),t,i*(l/o),n*(o/l)];case 13:return[1-t-n*(o/l),e-i*(l/o),n*(o/l),i*(l/o)];case 14:return[1-e,1-t-n*(o/l),i*(l/o),n*(o/l)];case 15:return[t,1-e,n*(o/l),i*(l/o)];default:return[e,t,n,i]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,r._mergeSVGProperties({bbox:this.#g()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#m(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e=super.render();e.classList.add("draw");let t=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal";let[n,i]=this.parentDimensions;return this.setDims(this.width*n,this.height*i),this._uiManager.addShouldRescale(this),this.disableEditing(),e}static createDrawerInstance(e,t,n,i,s){He("Not implemented")}static startDrawing(e,t,n,i){let{target:s,offsetX:a,offsetY:o,pointerId:l,pointerType:u}=i;if(r.#l&&r.#l!==u)return;let{viewport:{rotation:d}}=e,{width:c,height:h}=s.getBoundingClientRect(),f=r.#n=new AbortController,p=e.combinedSignal(f);if(r.#i||=l,r.#l??=u,window.addEventListener("pointerup",g=>{r.#i===g.pointerId?this._endDraw(g):r.#o?.delete(g.pointerId)},{signal:p}),window.addEventListener("pointercancel",g=>{r.#i===g.pointerId?this._currentParent.endDrawingSession():r.#o?.delete(g.pointerId)},{signal:p}),window.addEventListener("pointerdown",g=>{r.#l===g.pointerType&&((r.#o||=new Set).add(g.pointerId),r.#r.isCancellable()&&(r.#r.removeLastElement(),r.#r.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",tn,{signal:p}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:p}),s.addEventListener("touchmove",g=>{g.timeStamp===r.#d&&Dr(g)},{signal:p}),e.toggleDrawing(),t._editorUndoBar?.hide(),r.#r){e.drawLayer.updateProperties(this._currentDrawId,r.#r.startNew(a,o,c,h,d));return}t.updateUIForDefaultProperties(this),r.#r=this.createDrawerInstance(a,o,c,h,d),r.#s=this.getDefaultDrawingOptions(),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(r.#s.toSVGProperties(),r.#r.defaultSVGProperties),!0,!1)}static _drawMove(e){if(r.#d=-1,!r.#r)return;let{offsetX:t,offsetY:n,pointerId:i}=e;if(r.#i===i){if(r.#o?.size>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,r.#r.add(t,n)),r.#d=e.timeStamp,Dr(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,r.#r=null,r.#s=null,r.#l=null,r.#d=NaN),r.#n&&(r.#n.abort(),r.#n=null,r.#i=NaN,r.#o=null)}static _endDraw(e){let t=this._currentParent;if(t){if(t.toggleDrawing(!0),this._cleanup(!1),e&&t.drawLayer.updateProperties(this._currentDrawId,r.#r.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){let n=r.#r,i=this._currentDrawId,s=n.getLastElement();t.addCommands({cmd:()=>{t.drawLayer.updateProperties(i,n.setLastElement(s))},undo:()=>{t.drawLayer.updateProperties(i,n.removeLastElement())},mustExec:!1,type:Pe.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){let t=this._currentParent;if(!t)return null;if(t.toggleDrawing(!0),t.cleanUndoStack(Pe.DRAW_STEP),!r.#r.isEmpty()){let{pageDimensions:[n,i],scale:s}=t,a=t.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:r.#r.getOutlines(n*s,i*s,s,this._INNER_MARGIN),drawingOptions:r.#s,mustBeCommitted:!e});return this._cleanup(!0),a}return t.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,i,s,a){He("Not implemented")}static async deserialize(e,t,n){let{rawDims:{pageWidth:i,pageHeight:s,pageX:a,pageY:o}}=t.viewport,l=this.deserializeDraw(a,o,i,s,this._INNER_MARGIN,e),u=await super.deserialize(e,t,n);return u.createDrawingOptions(e),u.#u({drawOutlines:l}),u.#f(),u.onScaleChanging(),u.rotate(),u}serializeDraw(e){let[t,n]=this.pageTranslation,[i,s]=this.pageDimensions;return this.#e.serialize([t,n,i,s],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}},np=class{#e=new Float64Array(6);#t;#r;#n;#s;#i;#l="";#o=0;#d=new ju;#u;#h;constructor(e,t,n,i,s,a){this.#u=n,this.#h=i,this.#n=s,this.#s=a,[e,t]=this.#c(e,t);let o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#i=[e,t],this.#r=[{line:o,points:this.#i}],this.#e.set(o,0)}updateProperty(e,t){e==="stroke-width"&&(this.#s=t)}#c(e,t){return Z._normalizePoint(e,t,this.#u,this.#h,this.#n)}isEmpty(){return!this.#r||this.#r.length===0}isCancellable(){return this.#i.length<=10}add(e,t){[e,t]=this.#c(e,t);let[n,i,s,a]=this.#e.subarray(2,6),o=e-s,l=t-a;return Math.hypot(this.#u*o,this.#h*l)<=2?null:(this.#i.push(e,t),isNaN(n)?(this.#e.set([s,a,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,i,s,a,e,t],0),this.#t.push(...Z.createBezierPoints(n,i,s,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){let n=this.add(e,t);return n||(this.#i.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,i,s){this.#u=n,this.#h=i,this.#n=s,[e,t]=this.#c(e,t);let a=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#i=[e,t];let o=this.#r.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#r.push({line:a,points:this.#i}),this.#e.set(a,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#r.at(-1)}setLastElement(e){return this.#r?(this.#r.push(e),this.#t=e.line,this.#i=e.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#d.setLastElement(e)}removeLastElement(){if(!this.#r)return this.#d.removeLastElement();this.#r.pop(),this.#l="";for(let e=0,t=this.#r.length;e<t;e++){let{line:n,points:i}=this.#r[e];this.#t=n,this.#i=i,this.#o=0,this.toSVGPath()}return{path:{d:this.#l}}}toSVGPath(){let e=Z.svgRound(this.#t[4]),t=Z.svgRound(this.#t[5]);if(this.#i.length===2)return this.#l=`${this.#l} M ${e} ${t} Z`,this.#l;if(this.#i.length<=6){let i=this.#l.lastIndexOf("M");this.#l=`${this.#l.slice(0,i)} M ${e} ${t}`,this.#o=6}if(this.#i.length===4){let i=Z.svgRound(this.#t[10]),s=Z.svgRound(this.#t[11]);return this.#l=`${this.#l} L ${i} ${s}`,this.#o=12,this.#l}let n=[];this.#o===0&&(n.push(`M ${e} ${t}`),this.#o=6);for(let i=this.#o,s=this.#t.length;i<s;i+=6){let[a,o,l,u,d,c]=this.#t.slice(i,i+6).map(Z.svgRound);n.push(`C${a} ${o} ${l} ${u} ${d} ${c}`)}return this.#l+=n.join(" "),this.#o=this.#t.length,this.#l}getOutlines(e,t,n,i){let s=this.#r.at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),this.#d.build(this.#r,e,t,n,this.#n,this.#s,i),this.#e=null,this.#t=null,this.#r=null,this.#l=null,this.#d}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}},ju=class r extends Z{#e;#t=0;#r;#n;#s;#i;#l;#o;#d;build(e,t,n,i,s,a,o){this.#s=t,this.#i=n,this.#l=i,this.#o=s,this.#d=a,this.#r=o??0,this.#n=e,this.#c()}setLastElement(e){return this.#n.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#n.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#n){if(e.push(`M${Z.svgRound(t[4])} ${Z.svgRound(t[5])}`),t.length===6){e.push("Z");continue}if(t.length===12){e.push(`L${Z.svgRound(t[10])} ${Z.svgRound(t[11])}`);continue}for(let n=6,i=t.length;n<i;n+=6){let[s,a,o,l,u,d]=t.subarray(n,n+6).map(Z.svgRound);e.push(`C${s} ${a} ${o} ${l} ${u} ${d}`)}}return e.join("")}serialize([e,t,n,i],s){let a=[],o=[],[l,u,d,c]=this.#h(),h,f,p,g,v,m,y,w,x;switch(this.#o){case 0:x=Z._rescale,h=e,f=t+i,p=n,g=-i,v=e+l*n,m=t+(1-u-c)*i,y=e+(l+d)*n,w=t+(1-u)*i;break;case 90:x=Z._rescaleAndSwap,h=e,f=t,p=n,g=i,v=e+u*n,m=t+l*i,y=e+(u+c)*n,w=t+(l+d)*i;break;case 180:x=Z._rescale,h=e+n,f=t,p=-n,g=i,v=e+(1-l-d)*n,m=t+u*i,y=e+(1-l)*n,w=t+(u+c)*i;break;case 270:x=Z._rescaleAndSwap,h=e+n,f=t+i,p=-n,g=-i,v=e+(1-u-c)*n,m=t+(1-l-d)*i,y=e+(1-u)*n,w=t+(1-l)*i;break}for(let{line:b,points:A}of this.#n)a.push(x(b,h,f,p,g,s?new Array(b.length):null)),o.push(x(A,h,f,p,g,s?new Array(A.length):null));return{lines:a,points:o,rect:[v,m,y,w]}}static deserialize(e,t,n,i,s,{paths:{lines:a,points:o},rotation:l,thickness:u}){let d=[],c,h,f,p,g;switch(l){case 0:g=Z._rescale,c=-e/n,h=t/i+1,f=1/n,p=-1/i;break;case 90:g=Z._rescaleAndSwap,c=-t/i,h=-e/n,f=1/i,p=1/n;break;case 180:g=Z._rescale,c=e/n+1,h=-t/i,f=-1/n,p=1/i;break;case 270:g=Z._rescaleAndSwap,c=t/i+1,h=e/n+1,f=-1/i,p=-1/n;break}if(!a){a=[];for(let m of o){let y=m.length;if(y===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,m[0],m[1]]));continue}if(y===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,m[0],m[1],NaN,NaN,NaN,NaN,m[2],m[3]]));continue}let w=new Float32Array(3*(y-2));a.push(w);let[x,b,A,S]=m.subarray(0,4);w.set([NaN,NaN,NaN,NaN,x,b],0);for(let P=4;P<y;P+=2){let F=m[P],k=m[P+1];w.set(Z.createBezierPoints(x,b,A,S,F,k),(P-2)*3),[x,b,A,S]=[A,S,F,k]}}}for(let m=0,y=a.length;m<y;m++)d.push({line:g(a[m].map(w=>w??NaN),c,h,f,p),points:g(o[m].map(w=>w??NaN),c,h,f,p)});let v=new r;return v.build(d,n,i,1,l,u,s),v}#u(e=this.#d){let t=this.#r+e/2*this.#l;return this.#o%180===0?[t/this.#s,t/this.#i]:[t/this.#i,t/this.#s]}#h(){let[e,t,n,i]=this.#e,[s,a]=this.#u(0);return[e+s,t+a,n-2*s,i-2*a]}#c(){let e=this.#e=new Float32Array([1/0,1/0,-1/0,-1/0]);for(let{line:i}of this.#n){if(i.length<=12){for(let o=4,l=i.length;o<l;o+=6){let[u,d]=i.subarray(o,o+2);e[0]=Math.min(e[0],u),e[1]=Math.min(e[1],d),e[2]=Math.max(e[2],u),e[3]=Math.max(e[3],d)}continue}let s=i[4],a=i[5];for(let o=6,l=i.length;o<l;o+=6){let[u,d,c,h,f,p]=i.subarray(o,o+6);Q.bezierBoundingBox(s,a,u,d,c,h,f,p,e),s=f,a=p}}let[t,n]=this.#u();e[0]=Math.min(1,Math.max(0,e[0]-t)),e[1]=Math.min(1,Math.max(0,e[1]-n)),e[2]=Math.min(1,Math.max(0,e[2]+t)),e[3]=Math.min(1,Math.max(0,e[3]+n)),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e==="stroke-width"?this.#f(t):null}#f(e){let[t,n]=this.#u();this.#d=e;let[i,s]=this.#u(),[a,o]=[i-t,s-n],l=this.#e;return l[0]-=a,l[1]-=o,l[2]+=2*a,l[3]+=2*o,l}updateParentDimensions([e,t],n){let[i,s]=this.#u();this.#s=e,this.#i=t,this.#l=n;let[a,o]=this.#u(),l=a-i,u=o-s,d=this.#e;return d[0]-=l,d[1]-=u,d[2]+=2*l,d[3]+=2*u,d}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(Z.svgRound).join(" ")}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Z.svgRound(e)} ${Z.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,i=0,s=0,a=0,o=0,l=0;switch(this.#t){case 90:i=t/e,s=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,l=t;break;case 270:i=-t/e,s=e/t,l=t;break;default:return""}return`matrix(${n} ${i} ${s} ${a} ${Z.svgRound(o)} ${Z.svgRound(l)})`}getPathResizingSVGProperties([e,t,n,i]){let[s,a]=this.#u(),[o,l,u,d]=this.#e;if(Math.abs(u-s)<=Z.PRECISION||Math.abs(d-a)<=Z.PRECISION){let g=e+n/2-(o+u/2),v=t+i/2-(l+d/2);return{path:{"transform-origin":`${Z.svgRound(e)} ${Z.svgRound(t)}`,transform:`${this.rotationTransform} translate(${g} ${v})`}}}let c=(n-2*s)/(u-2*s),h=(i-2*a)/(d-2*a),f=u/n,p=d/i;return{path:{"transform-origin":`${Z.svgRound(o)} ${Z.svgRound(l)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${Z.svgRound(s)} ${Z.svgRound(a)}) scale(${c} ${h}) translate(${Z.svgRound(-s)} ${Z.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,i]){let[s,a]=this.#u(),o=this.#e,[l,u,d,c]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=i,Math.abs(d-s)<=Z.PRECISION||Math.abs(c-a)<=Z.PRECISION){let v=e+n/2-(l+d/2),m=t+i/2-(u+c/2);for(let{line:y,points:w}of this.#n)Z._translate(y,v,m,y),Z._translate(w,v,m,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Z.svgRound(e)} ${Z.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let h=(n-2*s)/(d-2*s),f=(i-2*a)/(c-2*a),p=-h*(l+s)+e+s,g=-f*(u+a)+t+a;if(h!==1||f!==1||p!==0||g!==0)for(let{line:v,points:m}of this.#n)Z._rescale(v,p,g,h,f,v),Z._rescale(m,p,g,h,f,m);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Z.svgRound(e)} ${Z.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[i,s]=n,a=this.#e,o=e-a[0],l=t-a[1];if(this.#s===i&&this.#i===s)for(let{line:u,points:d}of this.#n)Z._translate(u,o,l,u),Z._translate(d,o,l,d);else{let u=this.#s/i,d=this.#i/s;this.#s=i,this.#i=s;for(let{line:c,points:h}of this.#n)Z._rescale(c,o,l,u,d,c),Z._rescale(h,o,l,u,d,h);a[2]*=u,a[3]*=d}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Z.svgRound(e)} ${Z.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Z.svgRound(e[0])} ${Z.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},ip=class r extends tp{#e;constructor(e){super(),this.#e=e,super.updateProperties({fill:"none",stroke:it._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??=this["stroke-width"],t*=this.#e.realScale),super.updateSVGProperty(e,t)}clone(){let e=new r(this.#e);return e.updateAll(this),e}},sp=class r extends rp{static _type="ink";static _editorType=ve.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0}static initialize(e,t){it.initialize(e,t),this._defaultDrawingOptions=new ip(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return xe(this,"typesMap",new Map([[Pe.INK_THICKNESS,"stroke-width"],[Pe.INK_COLOR,"stroke"],[Pe.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,n,i,s){return new np(e,t,n,i,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,n,i,s,a){return ju.deserialize(e,t,n,i,s,a)}static async deserialize(e,t,n){let i=null;if(e instanceof Po){let{data:{inkLists:a,rect:o,rotation:l,id:u,color:d,opacity:c,borderStyle:{rawWidth:h},popupRef:f},parent:{page:{pageNumber:p}}}=e;i=e={annotationType:ve.INK,color:Array.from(d),thickness:h,opacity:c,paths:{points:a},boxes:null,pageIndex:p-1,rect:o.slice(0),rotation:l,id:u,deleted:!1,popupRef:f}}let s=await super.deserialize(e,t,n);return s.annotationElementId=e.id||null,s._initialData=i,s}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:n}){this._drawingOptions=r.getDefaultDrawingOptions({stroke:Q.makeHexColor(...e),"stroke-width":t,"stroke-opacity":n})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n,rect:i}=this.serializeDraw(e),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":o}}=this,l={annotationType:ve.INK,color:it._colorManager.convert(s),opacity:a,thickness:o,paths:{lines:t,points:n},pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?l:this.annotationElementId&&!this.#e(l)?null:(l.id=this.annotationElementId,l)}#e(e){let{color:t,thickness:n,opacity:i,pageIndex:s}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||e.color.some((a,o)=>a!==t[o])||e.thickness!==n||e.opacity!==i||e.pageIndex!==s}renderAnnotationElement(e){let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:t}),null}},ap=class r extends it{#e=null;#t=null;#r=null;#n=null;#s=null;#i="";#l=null;#o=null;#d=!1;#u=!1;static _type="stamp";static _editorType=ve.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#n=e.bitmapUrl,this.#s=e.bitmapFile}static initialize(e,t){it.initialize(e,t)}static get supportedTypes(){return xe(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return xe(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(ve.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#h(e,t=!1){if(!e){this.remove();return}this.#e=e.bitmap,t||(this.#t=e.id,this.#d=e.isSvg),e.file&&(this.#i=e.file.name),this.#a()}#c(){if(this.#r=null,this._uiManager.enableWaiting(!1),!!this.#l){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._editToolbar.hide(),this._uiManager.editAltText(this,!0);return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){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(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");let{data:i,width:s,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:"altText",request:{data:i,width:s,height:a,channels:i.length/(s*a)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");let l=o.output;return await this.setGuessedAltText(l),t&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#f(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(n=>this.#h(n,!0)).finally(()=>this.#c());return}if(this.#n){let n=this.#n;this.#n=null,this._uiManager.enableWaiting(!0),this.#r=this._uiManager.imageManager.getFromUrl(n).then(i=>this.#h(i)).finally(()=>this.#c());return}if(this.#s){let n=this.#s;this.#s=null,this._uiManager.enableWaiting(!0),this.#r=this._uiManager.imageManager.getFromFile(n).then(i=>this.#h(i)).finally(()=>this.#c());return}let e=document.createElement("input");e.type="file",e.accept=r.supportedTypesStr;let t=this._uiManager._signal;this.#r=new Promise(n=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let i=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#h(i)}n()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#c()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#l?.remove(),this.#l=null,this.#o&&(clearTimeout(this.#o),this.#o=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#f();return}super.rebuild(),this.div!==null&&(this.#t&&this.#l===null&&this.#f(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#r||this.#e||this.#n||this.#s||this.#t)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#e?this.#a():this.#f(),this.width&&!this.annotationElementId){let[n,i]=this.parentDimensions;this.setAt(e*n,t*i,this.width*n,this.height*i)}return this._uiManager.addShouldRescale(this),this.div}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#o!==null&&clearTimeout(this.#o);let e=200;this.#o=setTimeout(()=>{this.#o=null,this.#m()},e)}#a(){let{div:e}=this,{width:t,height:n}=this.#e,[i,s]=this.pageDimensions,a=.75;if(this.width)t=this.width*i,n=this.height*s;else if(t>a*i||n>a*s){let d=Math.min(a*i/t,a*s/n);t*=d,n*=d}let[o,l]=this.parentDimensions;this.setDims(t*o/i,n*l/s),this._uiManager.enableWaiting(!1);let u=this.#l=document.createElement("canvas");u.setAttribute("role","img"),this.addContainer(u),this.width=t/i,this.height=n/s,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#m(),this.#u||(this.parent.addUndoableEditor(this),this.#u=!0),this._reportTelemetry({action:"inserted_image"}),this.#i&&u.setAttribute("aria-label",this.#i)}copyCanvas(e,t,n=!1){e||(e=224);let{width:i,height:s}=this.#e,a=new vo,o=this.#e,l=i,u=s,d=null;if(t){if(i>t||s>t){let A=Math.min(t/i,t/s);l=Math.floor(i*A),u=Math.floor(s*A)}d=document.createElement("canvas");let h=d.width=Math.ceil(l*a.sx),f=d.height=Math.ceil(u*a.sy);this.#d||(o=this.#p(h,f));let p=d.getContext("2d");p.filter=this._uiManager.hcmFilter;let g="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(g="#8f8f9d",v="#42414d");let m=15,y=m*a.sx,w=m*a.sy,x=new OffscreenCanvas(y*2,w*2),b=x.getContext("2d");b.fillStyle=g,b.fillRect(0,0,y*2,w*2),b.fillStyle=v,b.fillRect(0,0,y,w),b.fillRect(y,w,y,w),p.fillStyle=p.createPattern(x,"repeat"),p.fillRect(0,0,h,f),p.drawImage(o,0,0,o.width,o.height,0,0,h,f)}let c=null;if(n){let h,f;if(a.symmetric&&o.width<e&&o.height<e)h=o.width,f=o.height;else if(o=this.#e,i>e||s>e){let v=Math.min(e/i,e/s);h=Math.floor(i*v),f=Math.floor(s*v),this.#d||(o=this.#p(h,f))}let g=new OffscreenCanvas(h,f).getContext("2d",{willReadFrequently:!0});g.drawImage(o,0,0,o.width,o.height,0,0,h,f),c={width:h,height:f,data:g.getImageData(0,0,h,f).data}}return{canvas:d,width:l,height:u,imageData:c}}#p(e,t){let{width:n,height:i}=this.#e,s=n,a=i,o=this.#e;for(;s>2*e||a>2*t;){let l=s,u=a;s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));let d=new OffscreenCanvas(s,a);d.getContext("2d").drawImage(o,0,0,l,u,0,0,s,a),o=d.transferToImageBitmap()}return o}#m(){let[e,t]=this.parentDimensions,{width:n,height:i}=this,s=new vo,a=Math.ceil(n*e*s.sx),o=Math.ceil(i*t*s.sy),l=this.#l;if(!l||l.width===a&&l.height===o)return;l.width=a,l.height=o;let u=this.#d?this.#e:this.#p(a,o),d=l.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(u,0,0,u.width,u.height,0,0,a,o)}getImageForAltText(){return this.#l}#g(e){if(e){if(this.#d){let i=this._uiManager.imageManager.getSvgUrl(this.#t);if(i)return i}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#e,t.getContext("2d").drawImage(this.#e,0,0),t.toDataURL()}if(this.#d){let[t,n]=this.pageDimensions,i=Math.round(this.width*t*mi.PDF_TO_CSS_UNITS),s=Math.round(this.height*n*mi.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(i,s);return a.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,i,s),a.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let i=null;if(e instanceof Iu){let{data:{rect:p,rotation:g,id:v,structParent:m,popupRef:y},container:w,parent:{page:{pageNumber:x}}}=e,b=w.querySelector("canvas"),A=n.imageManager.getFromCanvas(w.id,b);b.remove();let S=(await t._structTree.getAriaAttributes(`${dp}${v}`))?.get("aria-label")||"";i=e={annotationType:ve.STAMP,bitmapId:A.id,bitmap:A.bitmap,pageIndex:x-1,rect:p.slice(0),rotation:g,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:S},isSvg:!1,structParent:m,popupRef:y}}let s=await super.deserialize(e,t,n),{rect:a,bitmap:o,bitmapUrl:l,bitmapId:u,isSvg:d,accessibilityData:c}=e;u&&n.imageManager.isValidId(u)?(s.#t=u,o&&(s.#e=o)):s.#n=l,s.#d=d;let[h,f]=s.pageDimensions;return s.width=(a[2]-a[0])/h,s.height=(a[3]-a[1])/f,s.annotationElementId=e.id||null,c&&(s.altTextData=c),s._initialData=i,s.#u=!!i,s}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n={annotationType:ve.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#d,structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=this.#g(!0),n.accessibilityData=this.serializeAltText(!0),n;let{decorative:i,altText:s}=this.serializeAltText(!1);if(!i&&s&&(n.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){let o=this.#v(n);if(o.isSame)return null;o.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,t===null)return n;t.stamps||=new Map;let a=this.#d?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#g(!1);else if(this.#d){let o=t.stamps.get(this.#t);a>o.area&&(o.area=a,o.serialized.bitmap.close(),o.serialized.bitmap=this.#g(!1))}return n}#v(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,i=e.pageIndex===t,s=(e.accessibilityData?.alt||"")===n;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&i&&s,isSameAltText:s}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}},op=class r{#e;#t=!1;#r=null;#n=null;#s=null;#i=new Map;#l=!1;#o=!1;#d=!1;#u=null;#h=null;#c=null;#f=null;#a;static _initialized=!1;static#p=new Map([Qf,sp,ap,Lu].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:i,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:u,l10n:d}){let c=[...r.#p.values()];if(!r._initialized){r._initialized=!0;for(let h of c)h.initialize(d,e)}e.registerEditorTypes(c),this.#a=e,this.pageIndex=t,this.div=n,this.#e=s,this.#r=a,this.viewport=u,this.#c=l,this.drawLayer=o,this._structTree=i,this.#a.addLayer(this)}get isEmpty(){return this.#i.size===0}get isInvisible(){return this.isEmpty&&this.#a.getMode()===ve.NONE}updateToolbar(e){this.#a.updateToolbar(e)}updateMode(e=this.#a.getMode()){switch(this.#y(),e){case ve.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case ve.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case ve.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:t}=this.div;for(let n of r.#p.values())t.toggle(`${n._type}Editing`,e===n._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#c?.div}setEditingState(e){this.#a.setEditingState(e)}addCommands(e){this.#a.addCommands(e)}cleanUndoStack(e){this.#a.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#r?.div.classList.toggle("disabled",!e)}async enable(){this.#d=!0,this.div.tabIndex=0,this.togglePointerEvents(!0);let e=new Set;for(let n of this.#i.values())n.enableEditing(),n.show(!0),n.annotationElementId&&(this.#a.removeChangedExistingAnnotation(n),e.add(n.annotationElementId));if(!this.#r){this.#d=!1;return}let t=this.#r.getEditableAnnotations();for(let n of t){if(n.hide(),this.#a.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let i=await this.deserialize(n);i&&(this.addOrRebuild(i),i.enableEditing())}this.#d=!1}disable(){this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);let e=new Map,t=new Map;for(let i of this.#i.values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){e.set(i.annotationElementId,i);continue}else t.set(i.annotationElementId,i);this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()}if(this.#r){let i=this.#r.getEditableAnnotations();for(let s of i){let{id:a}=s.data;if(this.#a.isDeletedAnnotationElement(a))continue;let o=t.get(a);if(o){o.resetAnnotationElement(s),o.show(!1),s.show();continue}o=e.get(a),o&&(this.#a.addChangedExistingAnnotation(o),o.renderAnnotationElement(s)&&o.show(!1)),s.show()}}this.#y(),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let i of r.#p.values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#o=!1}getEditableAnnotation(e){return this.#r?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#a.getActive()!==e&&this.#a.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#c?.div&&!this.#f){this.#f=new AbortController;let e=this.#a.combinedSignal(this.#f);this.#c.div.addEventListener("pointerdown",this.#m.bind(this),{signal:e}),this.#c.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#c?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#c.div.classList.remove("highlighting"))}#m(e){this.#a.unselectAll();let{target:t}=e;if(t===this.#c.div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&this.#c.div.contains(t)){let{isMac:n}=Nt.platform;if(e.button!==0||e.ctrlKey&&n)return;this.#a.showAllEditors("highlight",!0,!0),this.#c.div.classList.add("free"),this.toggleDrawing(),Lu.startHighlighting(this,this.#a.direction==="ltr",{target:this.#c.div,x:e.x,y:e.y}),this.#c.div.addEventListener("pointerup",()=>{this.#c.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#a._signal}),e.preventDefault()}}enableClick(){if(this.#n)return;this.#n=new AbortController;let e=this.#a.combinedSignal(this.#n);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){this.#n?.abort(),this.#n=null}attach(e){this.#i.set(e.id,e);let{annotationElementId:t}=e;t&&this.#a.isDeletedAnnotationElement(t)&&this.#a.removeDeletedAnnotationElement(e)}detach(e){this.#i.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#o&&e.annotationElementId&&this.#a.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#a.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#a.addDeletedAnnotationElement(e.annotationElementId),it.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#a.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#d),this.#a.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#s&&(e._focusEventsAllowed=!1,this.#s=setTimeout(()=>{this.#s=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#a._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){let t=()=>e._uiManager.rebuild(e),n=()=>{e.remove()};this.addCommands({cmd:t,undo:n,mustExec:!1})}getNextId(){return this.#a.getId()}get#g(){return r.#p.get(this.#a.getMode())}combinedSignal(e){return this.#a.combinedSignal(e)}#v(e){let t=this.#g;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#g?.canCreateNewEmptyEditor()}pasteEditor(e,t){this.#a.updateToolbar(e),this.#a.updateMode(e);let{offsetX:n,offsetY:i}=this.#w(),s=this.getNextId(),a=this.#v({parent:this,id:s,x:n,y:i,uiManager:this.#a,isCentered:!0,...t});a&&this.add(a)}async deserialize(e){return await r.#p.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#a)||null}createAndAddNewEditor(e,t,n={}){let i=this.getNextId(),s=this.#v({parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:this.#a,isCentered:t,...n});return s&&this.add(s),s}#w(){let{x:e,y:t,width:n,height:i}=this.div.getBoundingClientRect(),s=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),l=Math.min(window.innerHeight,t+i),u=(s+o)/2-e,d=(a+l)/2-t,[c,h]=this.viewport.rotation%180===0?[u,d]:[d,u];return{offsetX:c,offsetY:h}}addNewEditor(){this.createAndAddNewEditor(this.#w(),!0)}setSelected(e){this.#a.setSelected(e)}toggleSelected(e){this.#a.toggleSelected(e)}unselect(e){this.#a.unselect(e)}pointerup(e){let{isMac:t}=Nt.platform;if(!(e.button!==0||e.ctrlKey&&t)&&e.target===this.div&&this.#l&&(this.#l=!1,!(this.#g?.isDrawer&&this.#g.supportMultipleDrawings))){if(!this.#t){this.#t=!0;return}if(this.#a.getMode()===ve.STAMP){this.#a.unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(this.#a.getMode()===ve.HIGHLIGHT&&this.enableTextSelection(),this.#l){this.#l=!1;return}let{isMac:t}=Nt.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#l=!0,this.#g?.isDrawer){this.startDrawingSession(e);return}let n=this.#a.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus(),this.#u){this.#g.startDrawing(this,this.#a,!1,e);return}this.#a.setCurrentDrawingSession(this),this.#u=new AbortController;let t=this.#a.combinedSignal(this.#u);this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(this.#h=null,this.commitOrRemove())},{signal:t}),this.#g.startDrawing(this,this.#a,!1,e)}pause(e){if(e){let{activeElement:t}=document;this.div.contains(t)&&(this.#h=t);return}this.#h&&setTimeout(()=>{this.#h?.focus(),this.#h=null},0)}endDrawingSession(e=!1){return this.#u?(this.#a.setCurrentDrawingSession(null),this.#u.abort(),this.#u=null,this.#h=null,this.#g.endDrawing(e)):null}findNewParent(e,t,n){let i=this.#a.findParent(t,n);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return this.#u?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#u&&this.#g.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#a.getActive()?.parent===this&&(this.#a.commitOrRemove(),this.#a.setActiveEditor(null)),this.#s&&(clearTimeout(this.#s),this.#s=null);for(let e of this.#i.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#i.clear(),this.#a.removeLayer(this)}#y(){for(let e of this.#i.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,Ji(this.div,e);for(let t of this.#a.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){this.#a.commitOrRemove(),this.#y();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Ji(this.div,{rotation:n}),t!==n)for(let i of this.#i.values())i.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#a.viewParameters.realScale}},lp=class r{#e=null;#t=0;#r=new Map;#n=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#r.size>0)for(let t of this.#r.values())t.remove(),e.append(t);this.#e=e}}static get _svgFactory(){return xe(this,"_svgFactory",new Ao)}static#s(e,[t,n,i,s]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*i}%`,a.height=`${100*s}%`}#i(){let e=r._svgFactory.create(1,1,!0);return this.#e.append(e),e.setAttribute("aria-hidden",!0),e}#l(e,t){let n=r._svgFactory.createElement("clipPath");e.append(n);let i=`clip_${t}`;n.setAttribute("id",i),n.setAttribute("clipPathUnits","objectBoundingBox");let s=r._svgFactory.createElement("use");return n.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),i}#o(e,t){for(let[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.setAttribute(n,i)}draw(e,t=!1,n=!1){let i=this.#t++,s=this.#i(),a=r._svgFactory.createElement("defs");s.append(a);let o=r._svgFactory.createElement("path");a.append(o);let l=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#n.set(i,o);let u=n?this.#l(a,l):null,d=r._svgFactory.createElement("use");return s.append(d),d.setAttribute("href",`#${l}`),this.updateProperties(s,e),this.#r.set(i,s),{id:i,clipPathId:`url(#${u})`}}drawOutline(e,t){let n=this.#t++,i=this.#i(),s=r._svgFactory.createElement("defs");i.append(s);let a=r._svgFactory.createElement("path");s.append(a);let o=`path_p${this.pageIndex}_${n}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){let c=r._svgFactory.createElement("mask");s.append(c),l=`mask_p${this.pageIndex}_${n}`,c.setAttribute("id",l),c.setAttribute("maskUnits","objectBoundingBox");let h=r._svgFactory.createElement("rect");c.append(h),h.setAttribute("width","1"),h.setAttribute("height","1"),h.setAttribute("fill","white");let f=r._svgFactory.createElement("use");c.append(f),f.setAttribute("href",`#${o}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}let u=r._svgFactory.createElement("use");i.append(u),u.setAttribute("href",`#${o}`),l&&u.setAttribute("mask",`url(#${l})`);let d=u.cloneNode();return i.append(d),u.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(i,e),this.#r.set(n,i),n}finalizeDraw(e,t){this.#n.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;let{root:n,bbox:i,rootClass:s,path:a}=t,o=typeof e=="number"?this.#r.get(e):e;if(o){if(n&&this.#o(o,n),i&&r.#s(o,i),s){let{classList:l}=o;for(let[u,d]of Object.entries(s))l.toggle(u,d)}if(a){let u=o.firstChild.firstChild;this.#o(u,a)}}}updateParent(e,t){if(t===this)return;let n=this.#r.get(e);n&&(t.#e.append(n),this.#r.delete(e),t.#r.set(e,n))}remove(e){this.#n.delete(e),this.#e!==null&&(this.#r.get(e).remove(),this.#r.delete(e))}destroy(){this.#e=null;for(let e of this.#r.values())e.remove();this.#r.clear(),this.#n.clear()}};globalThis.pdfjsTestingUtils={HighlightOutliner:Fo};var r3=de.AbortException,n3=de.AnnotationEditorLayer,i3=de.AnnotationEditorParamsType,s3=de.AnnotationEditorType,a3=de.AnnotationEditorUIManager,o3=de.AnnotationLayer,l3=de.AnnotationMode,u3=de.ColorPicker,d3=de.DOMSVGFactory,c3=de.DrawLayer,h3=de.FeatureTest,jy=de.GlobalWorkerOptions,f3=de.ImageKind,p3=de.InvalidPDFException,g3=de.MissingPDFException,m3=de.OPS,v3=de.OutputScale,y3=de.PDFDataRangeTransport,b3=de.PDFDateString,w3=de.PDFWorker,x3=de.PasswordResponses,A3=de.PermissionFlag,S3=de.PixelsPerInch,P3=de.RenderingCancelledException,F3=de.TextLayer,D3=de.TouchManager,E3=de.UnexpectedResponseException,C3=de.Util,T3=de.VerbosityLevel,k3=de.XfaLayer,R3=de.build,_3=de.createValidAbsoluteUrl,I3=de.fetchData,By=de.getDocument,O3=de.getFilenameFromUrl,M3=de.getPdfFilenameFromUrl,N3=de.getXfaPageViewport,L3=de.isDataScheme,j3=de.isPdfFile,B3=de.noContextMenu,U3=de.normalizeUnicode,q3=de.setLayerDimensions,z3=de.shadow,V3=de.stopEvent,H3=de.version;var fp;function qy(r){fp=r}function zy(){if(!fp)throw new Error("No PDF engine is installed. The host must call setPdfEngine() before reading a PDF.");return fp}function Vy(r){jy.workerSrc=r,qy({getDocument:By})}var pe=class extends Error{};function Hy(r,e){let t=new Set(e.values),n={positional:[],values:new Map,bools:new Set},i=s=>e.aliases?.[s]??s;for(let s=0;s<r.length;s++){let a=r[s];if(a==="--"){n.positional.push(...r.slice(s+1));break}if(!a.startsWith("-")||a==="-"||/^-\d/.test(a)){n.positional.push(a);continue}let o=a.replace(/^--?/,""),l=o.indexOf("="),u=i(l>=0?o.slice(0,l):o);if(t.has(u)){let d;if(l>=0?d=o.slice(l+1):d=r[++s],d===void 0)throw new pe(`--${u} needs a value`);n.values.set(u,[...n.values.get(u)??[],d])}else n.bools.add(u)}return n}function Ee(r,e){let t=r.values.get(e);return t?.[t.length-1]}function Co(r,e){return r.values.get(e)??[]}function ke(r,e){return r.bools.has(e)||r.values.has(e)}function ts(r,e){let t=Ee(r,e);if(t===void 0)return;let n=Number(t);if(!Number.isFinite(n))throw new pe(`--${e} must be a number, got "${t}"`);return n}function To(r,e){return Co(r,e).flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}var ko=require("node:fs"),Un=jr(require("node:path"));var Ws={reviewFolder:".eddie",importPdfs:!1,stampOutput:"reviewFolder",reportOutput:"reviewFolder",matchThreshold:.5,showResolved:!0,autoAnchor:!0,inlineMarkers:!0,expandThreads:!1,highConfidence:.75,semanticFallback:!1,ollamaUrl:"http://localhost:11434",embedModel:"embeddinggemma",semanticThreshold:.62,lexicalFallback:!0,authorName:"",lexicalThreshold:.6},Ku=class{listeners=new Set;event=e=>(this.listeners.add(e),{dispose:()=>void this.listeners.delete(e)});fire(e){for(let t of[...this.listeners])try{t(e)}catch{}}dispose(){this.listeners.clear()}};var JF=[".eddie.json",".vscode",".eddie",".git"];function Wy(r){let e=Un.resolve(r);for(;;){if(JF.some(n=>(0,ko.existsSync)(Un.join(e,n))))return e;let t=Un.dirname(e);if(t===e)return Un.resolve(r);e=t}}function QF(r){let e="",t=0;for(;t<r.length;){let n=r[t];if(n==='"'){let i=t+1;for(;i<r.length&&r[i]!=='"';)i+=r[i]==="\\"?2:1;e+=r.slice(t,i+1),t=i+1}else if(n==="/"&&r[t+1]==="/")for(;t<r.length&&r[t]!==`
|
|
69
|
+
`;)t++;else if(n==="/"&&r[t+1]==="*"){let i=r.indexOf("*/",t+2);t=i<0?r.length:i+2}else e+=n,t++}return e.replace(/,(\s*[}\]])/g,"$1")}function $F(r,e){let t=Ws[r];if(typeof e!="string")return typeof e==typeof t?e:void 0;if(typeof t=="boolean"){if(/^(1|true|yes|on)$/i.test(e))return!0;if(/^(0|false|no|off)$/i.test(e))return!1;throw new pe(`${r} must be true or false, got "${e}"`)}if(typeof t=="number"){let n=Number(e);if(!Number.isFinite(n))throw new pe(`${r} must be a number, got "${e}"`);return n}return e}function eD(r){return Object.prototype.hasOwnProperty.call(Ws,r)}function pp(r){let e=r.replace(/^eddieDoc\./,"").toLowerCase().replace(/[-_]+([a-z0-9])/g,(t,n)=>n.toUpperCase());return Object.keys(Ws).find(t=>t.toLowerCase()===e.toLowerCase())}function Gy(r){if((0,ko.existsSync)(r))try{let e=JSON.parse(QF((0,ko.readFileSync)(r,"utf8")));return e&&typeof e=="object"?e:void 0}catch(e){throw new pe(`cannot parse ${r}: ${e.message}`)}}function Ky(r,e=[],t=process.env){let n={...Ws},i={};for(let c of Object.keys(Ws))i[c]="default";let s=[],a=(c,h,f)=>{let p=$F(c,h);p!==void 0&&(n[c]=p,i[c]=f)},o=Un.join(r,".vscode","settings.json"),l=Gy(o);if(l){s.push(o);for(let[c,h]of Object.entries(l)){if(!c.startsWith("eddieDoc."))continue;let f=c.slice(9);eD(f)&&a(f,h,"vscode")}}let u=Un.join(r,".eddie.json"),d=Gy(u);if(d){s.push(u);for(let[c,h]of Object.entries(d)){let f=pp(c);f&&a(f,h,"eddie.json")}}for(let[c,h]of Object.entries(t)){if(!c.startsWith("EDDIE_DOC_")||h===void 0)continue;let f=pp(c.slice(10));f&&a(f,h,"env")}for(let[c,h]of e){let f=pp(c);if(!f)throw new pe(`unknown setting "${c}" (see: eddie config)`);a(f,h,"flag")}return{settings:n,source:i,files:s}}function Xy(r){let e=r.indexOf("=");if(e<=0)throw new pe(`--set expects key=value, got "${r}"`);return[r.slice(0,e).trim(),r.slice(e+1)]}var Oe=require("node:fs"),LP=jr(require("node:os")),ot=jr(require("node:path"));var Bb=require("node:child_process"),gd=require("node:fs"),vd=jr(require("node:os")),tr=jr(require("node:path"));var Ur=require("node:fs"),yi=jr(require("node:path")),Ks=class{constructor(e=process.cwd()){this.root=e}abs(e){return yi.isAbsolute(e)?e:yi.resolve(this.root,e)}async readText(e){return Ur.promises.readFile(this.abs(e),"utf8")}async readBytes(e){return new Uint8Array(await Ur.promises.readFile(this.abs(e)))}async writeText(e,t){let n=this.abs(e);await Ur.promises.mkdir(yi.dirname(n),{recursive:!0}),await Ur.promises.writeFile(n,t,"utf8")}async writeBytes(e,t){let n=this.abs(e);await Ur.promises.mkdir(yi.dirname(n),{recursive:!0}),await Ur.promises.writeFile(n,t)}async exists(e){try{return await Ur.promises.access(this.abs(e)),!0}catch{return!1}}async remove(e){try{await Ur.promises.unlink(this.abs(e))}catch(t){if(t.code!=="ENOENT")throw t}}async copy(e,t){let n=this.abs(t);await Ur.promises.mkdir(yi.dirname(n),{recursive:!0}),await Ur.promises.copyFile(this.abs(e),n)}async list(e){try{return(await Ur.promises.readdir(this.abs(e),{withFileTypes:!0})).map(n=>({name:n.name,isDirectory:n.isDirectory()}))}catch{return[]}}};function Yy(r){return r.replace(/\\/g,"/")}function Xs(r){return r.startsWith("/")||/^[A-Za-z]:\//.test(r)}function qn(r){r=Yy(r);let e=/^[A-Za-z]:(?=\/|$)/.exec(r)?.[0]??"",t=e?r.slice(e.length):r,n=t.startsWith("/"),i=[];for(let a of t.split("/"))if(!(!a||a===".")){if(a===".."){i.length&&i[i.length-1]!==".."?i.pop():!n&&!e&&i.push("..");continue}i.push(a)}let s=i.join("/");return e?e+"/"+s:n?"/"+s:s||"."}function Je(...r){let e="";for(let t of r)t&&(e=Xs(Yy(t))||!e?t:e+"/"+t);return qn(e||".")}function Xu(r,...e){return Je(r,...e)}function bi(r){r=qn(r);let e=r.lastIndexOf("/");return e<0?".":e===0?"/":/^[A-Za-z]:$/.test(r.slice(0,e))?r.slice(0,e)+"/":r.slice(0,e)}function Lt(r,e){r=qn(r);let t=r.slice(r.lastIndexOf("/")+1);return e&&t.endsWith(e)&&t!==e&&(t=t.slice(0,-e.length)),t}function Yu(r,e){let t=qn(r).split("/").filter(a=>a&&a!=="."),n=qn(e).split("/").filter(a=>a&&a!=="."),i=0;for(;i<t.length&&i<n.length&&t[i]===n[i];)i++;return[...t.slice(i).map(()=>".."),...n.slice(i)].join("/")}function Zy(r){let e=new Uint8Array(r),t=typeof crypto>"u"?void 0:crypto;if(t?.getRandomValues)t.getRandomValues(e);else for(let i=0;i<r;i++)e[i]=Math.floor(Math.random()*256);let n="";for(let i of e)n+=i.toString(16).padStart(2,"0");return n}var tD=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yn=(r,e)=>r>>>e|r<<32-e;function gp(r){let e=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t=new Uint32Array(64),n=r.length,i=new Uint8Array(n+9+63>>6<<6);i.set(r),i[n]=128;let s=new DataView(i.buffer);s.setUint32(i.length-8,Math.floor(n/536870912),!1),s.setUint32(i.length-4,n<<3>>>0,!1);for(let o=0;o<i.length;o+=64){for(let v=0;v<16;v++)t[v]=s.getUint32(o+v*4,!1);for(let v=16;v<64;v++){let m=yn(t[v-15],7)^yn(t[v-15],18)^t[v-15]>>>3,y=yn(t[v-2],17)^yn(t[v-2],19)^t[v-2]>>>10;t[v]=t[v-16]+m+t[v-7]+y|0}let[l,u,d,c,h,f,p,g]=e;for(let v=0;v<64;v++){let m=yn(h,6)^yn(h,11)^yn(h,25),y=h&f^~h&p,w=g+m+y+tD[v]+t[v]|0,x=yn(l,2)^yn(l,13)^yn(l,22),b=l&u^l&d^u&d,A=x+b|0;g=p,p=f,f=h,h=c+w|0,c=d,d=u,u=l,l=w+A|0}e[0]+=l,e[1]+=u,e[2]+=d,e[3]+=c,e[4]+=h,e[5]+=f,e[6]+=p,e[7]+=g}let a="";for(let o=0;o<8;o++)a+=(e[o]>>>0).toString(16).padStart(8,"0");return a}function cr(r){return gp(new TextEncoder().encode(r))}function mp(r){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(r)}function Ro(r,e){return e.pdfId?r.extraPdfs?.find(t=>t.id===e.pdfId)?.path??r.pdfPath:r.pdfPath}function _o(r,e){let t=e.pdfId?r.extraPdfs?.find(n=>n.id===e.pdfId):void 0;return t?.reviewer||t?.origin||r.mapping.reviewer||r.mapping.origin||void 0}function jt(r){return r.mapping.label||r.mapping.origin||r.mapping.id||"review"}function zn(r){let e=`Revision ${r.ordinal}`;return r.label?`${e} \u2014 ${r.label}`:e}var bt={highlight:"Highlight",strikeout:"Delete",underline:"Underline",comment:"Comment",insert:"Insert",replace:"Replace",other:"Note"};var rD=[[/xref:[^[]*\[([^\]]*)\]/g," $1 "],[/link:[^[]*\[([^\]]*)\]/g," $1 "],[/https?:\/\/\S+\[([^\]]*)\]/g," $1 "],[/https?:\/\/\S+/g," "],[/footnote:[^[]*\[[^\]]*\]/g," "],[/<<[^>]*>>/g," "],[/\[\[[^\]]*\]\]/g," "],[/\{[a-zA-Z0-9_-]+\}/g," "],[/[*_`^~#]+/g," "],[/i(?:mage|con):[^[]*\[[^\]]*\]/g," "]];function Io(r){let e=r.trim();return!!(e===""||/^[=\-.*_+/]{4,}$/.test(e)||/^\[[^\]]*\]$/.test(e)||/^:[^:]+:/.test(e)||/^\/\//.test(e)||/^ifdef::|^ifndef::|^endif::|^include::/.test(e))}function Jy(r){if(/^(-{4,}|\.{4,}|\+{4,})$/.test(r))return r[0];if(/^`{3,}$/.test(r))return"`"}function Qy(r){return Jy(r.trim())!==void 0}function Zu(r){let e=Array.from({length:r.length},()=>!1),t;for(let n=0;n<r.length;n++){let i=Jy(r[n].trim());if(t!==void 0){e[n]=!0,i===t&&(t=void 0);continue}i!==void 0&&(t=i,e[n]=!0)}return e}function Ju(r){let e=Array.from({length:r.length},()=>!1),t=!1;for(let n=0;n<r.length;n++){let i=r[n].trim();if(/^\/{4,}$/.test(i)){e[n]=!0,t=!t;continue}e[n]=t||i.startsWith("//")}return e}function nD(r){return r.replace(/^\s*={1,6}\s+/,"").replace(/^\s*[*\-.]+\s+/,"").replace(/^\s*\d+\.\s+/,"").replace(/^\s*\[[A-Z]+\]\s*/,"").replace(/^\s*(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+/,"").replace(/^\s*\|=*/,"").replace(/^\s*<\d+>\s*/,"")}function bn(r){let e=" "+r+" ";for(let[t,n]of rD)e=e.replace(t,n);return e=e.toLowerCase(),e=e.replace(/[^\p{L}\p{N}\s]/gu," "),e.replace(/\s+/g," ").trim()}function vp(r){let e=bn(r);return e?e.split(" "):[]}function yp(r){return Io(r)?[]:vp(nD(r))}var Qu=class{entries=new Map;get(e){return this.entries.get(e)}set(e,t){this.entries.set(e,t)}},Oo=class{constructor(e,t,n=1024){this.storage=e;this.file=t;this.maxEntries=n}entries=new Map;loaded=null;dirty=!1;load(){return this.loaded??=(async()=>{try{let e=JSON.parse(await this.storage.readText(this.file));for(let[t,n]of Object.entries(e))Array.isArray(n)&&this.entries.set(t,n)}catch{}})(),this.loaded}get(e){let t=this.entries,n=t.get(e);return n&&(t.delete(e),t.set(e,n)),n}set(e,t){let n=this.entries;for(n.delete(e),n.set(e,t.map(i=>Number(i.toFixed(5))));n.size>this.maxEntries;){let i=n.keys().next().value;if(i===void 0)break;n.delete(i)}this.dirty=!0}async flush(){if(this.dirty)try{await this.storage.writeText(this.file,JSON.stringify(Object.fromEntries(this.entries))),this.dirty=!1}catch{}}};function Zs(r){let e=r.split(/\r?\n/),t=Ju(e),n=[],i=-1,s=[],a=o=>{i>=0&&s.length&&n.push({startLine:i,endLine:o-1,text:s.join(" ").replace(/\s+/g," ").trim()}),i=-1,s=[]};for(let o=0;o<e.length;o++){if(t[o]||Io(e[o])){a(o);continue}i<0&&(i=o),s.push(e[o])}return a(e.length),n.filter(o=>o.text.length>0)}function iD(r,e){let t=Math.min(r.length,e.length),n=0,i=0,s=0;for(let o=0;o<t;o++)n+=r[o]*e[o],i+=r[o]*r[o],s+=e[o]*e[o];let a=Math.sqrt(i)*Math.sqrt(s);return a?n/a:0}var tb=2e3,$y=64;function eb(r,e){return cr(r+"\0"+e.slice(0,tb))}async function sD(r,e){let t=r.fetchFn;if(!t)return null;let n=r.url.replace(/\/+$/,""),i=e.map(a=>a.slice(0,tb));try{let a=await t(`${n}/api/embed`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({model:r.model,input:i})});if(a.ok){let o=await a.json();if(Array.isArray(o.embeddings)&&o.embeddings.length===i.length)return o.embeddings.map(l=>Array.isArray(l)?l:null)}}catch{return null}let s=[];for(let a of i)try{let o=await t(`${n}/api/embeddings`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({model:r.model,prompt:a})});if(!o.ok){s.push(null);continue}let l=await o.json();s.push(Array.isArray(l.embedding)?l.embedding:null)}catch{return null}return s}async function aD(r,e){let t=r.cache,n=new Map,i=[];for(let a of new Set(e)){let o=t?.get(eb(r.model,a));o?n.set(a,o):i.push(a)}let s=!0;for(let a=0;a<i.length;a+=$y){let o=i.slice(a,a+$y),l=await sD(r,o);if(l===null){s=!1;break}for(let u=0;u<o.length;u++){let d=l[u];d&&(n.set(o[u],d),t?.set(eb(r.model,o[u]),d))}}return{vecs:n,reachable:s}}async function rb(r,e,t){let n=r.filter(u=>!u.match&&u.manualLine==null&&(u.anchoredText||u.comment).trim().length>0);if(n.length===0)return{applied:0,ok:!0};let i=Zs(e);if(i.length===0)return{applied:0,ok:!0};let s=n.map(u=>(u.anchoredText||u.comment).trim()),{vecs:a,reachable:o}=await aD(t,[...i.map(u=>u.text),...s]),l=0;for(let u=0;u<n.length;u++){let d=a.get(s[u]);if(!d)continue;let c=-1,h=-1;for(let f=0;f<i.length;f++){let p=a.get(i[f].text);if(!p)continue;let g=iD(d,p);g>c&&(c=g,h=f)}if(h>=0&&c>=t.threshold){let f=i[h];n[u].match={startLine:f.startLine,endLine:f.endLine,score:c,sourceExcerpt:f.text.slice(0,200),method:"semantic"},l++}}return await t.cache?.flush?.(),{applied:l,ok:o}}var sb=/^\s*\/\/\s*eddie:([0-9a-f]{6,32})\s*$/;function oD(r){return`// eddie:${r}`}function $u(r){return sb.test(r)}function Js(r){let e=r.split(/\r?\n/),t=Zu(e),n=new Map;for(let i=0;i<e.length;i++){if(t[i])continue;let s=sb.exec(e[i]);if(!s)continue;let a=s[1];n.has(a)||n.set(a,{id:a,markerLine:i,targetLine:ob(e,i)})}return n}function ab(r){let e=r.includes(`\r
|
|
70
|
+
`)?`\r
|
|
71
|
+
`:`
|
|
72
|
+
`,t=r.split(/\r?\n/),n=Zu(t);return t.filter((i,s)=>n[s]||!$u(i)).join(e)}function ob(r,e){for(let t=e+1;t<r.length;t++){let n=r[t].trim();if(n!==""&&!$u(r[t])&&!wp(n)&&!Qy(n))return t}return Math.min(e+1,Math.max(0,r.length-1))}function wp(r){return!!(/^\[[^\]]*\]$/.test(r)||/^\.[^.\s]/.test(r))}function bp(r,e){let t=Math.max(0,Math.min(e,r.length-1)),n=Zu(r);if(n[t])for(;t>0&&n[t-1];)t--;else for(;t>0;){let i=r[t-1];if(i.trim()===""||Io(i))break;t--}for(;t>0;){let i=r[t-1].trim();if(wp(i)||$u(r[t-1]))t--;else break}return t}function lD(r,e){let t=r.split(/\r?\n/),n=bp(t,e);for(let i=n;i<t.length&&i<=e;i++){let s=t[i].trim(),a=/^\[#([A-Za-z0-9_:.-]+)/.exec(s);if(a)return a[1];let o=/^\[\[([A-Za-z0-9_:.-]+)\]\]$/.exec(s);if(o)return o[1];if(!wp(s)&&s!==""&&!$u(t[i]))break}}function lb(r){return cr(bn(r)).slice(0,16)}function nb(r,e,t){let n=bn(r).split(" ").filter(Boolean);return n.length?(t?n.slice(-e):n.slice(0,e)).join(" "):""}var ib=8;function ed(r,e,t){let n=Zs(r),i=n.findIndex(l=>e>=l.startLine&&e<=l.endLine),s=i>=0?n[i]:void 0,a={};t&&(a.marker=t);let o=lD(r,e);if(o&&(a.blockId=o),s){a.blockFingerprint=lb(s.text);let l=n[i-1],u=n[i+1];l&&(a.contextBefore=nb(l.text,ib,!0)),u&&(a.contextAfter=nb(u.text,ib,!1))}return a}function td(r,e){let t=r.includes(`\r
|
|
73
|
+
`)?`\r
|
|
74
|
+
`:`
|
|
75
|
+
`,n=r.split(/\r?\n/),i=new Map;if(!e.length)return{source:r,assigned:i,inserted:0};let s=Js(r),a=new Set(s.keys()),o=new Map;for(let d of s.values())o.set(bp(n,d.targetLine),d.id);let l=new Map;for(let d of e){if(d.line<0||d.line>=n.length)continue;let c=bp(n,d.line),h=o.get(c)??l.get(c);if(h){i.set(d.itemId,h);continue}let f=uD(d.itemId,a);a.add(f),l.set(c,f),i.set(d.itemId,f)}let u=[...n];for(let d of[...l.keys()].sort((c,h)=>h-c))u.splice(d,0,oD(l.get(d)));return{source:u.join(t),assigned:i,inserted:l.size}}function uD(r,e){let t=cr(r);for(let n=8;n<=32;n+=4){let i=t.slice(0,n);if(!e.has(i))return i}return t.slice(0,32)}function rd(r,e){if(!e)return null;let t=Zs(r),n=(i,s)=>{let a=t.find(o=>i>=o.startLine&&i<=o.endLine);return a?{line:a.startLine,endLine:a.endLine,excerpt:a.text,method:s}:{line:i,endLine:i,excerpt:"",method:s}};if(e.marker){let i=Js(r).get(e.marker);if(i)return n(i.targetLine,"marker")}if(e.blockId){let i=r.split(/\r?\n/);for(let s=0;s<i.length;s++){let a=i[s].trim(),o=/^\[#([A-Za-z0-9_:.-]+)/.exec(a)??/^\[\[([A-Za-z0-9_:.-]+)\]\]$/.exec(a);if(o&&o[1]===e.blockId)return n(ob(i,s),"blockId")}}if(e.blockFingerprint){for(let i of t)if(lb(i.text)===e.blockFingerprint)return{line:i.startLine,endLine:i.endLine,excerpt:i.text,method:"fingerprint"}}return null}function wi(r){let e=r.split(/\r?\n/),t=Ju(e),n=e.map((a,o)=>({index:o,tokens:t[o]?[]:yp(a)})),i=[],s=new Map;for(let a of n)for(let o of a.tokens)i.push({t:o,line:a.index}),s.set(o,(s.get(o)||0)+1);return{lines:n,raw:e,flat:i,freq:s}}function dD(r){let e=new Map;for(let t of r)e.set(t,(e.get(t)||0)+1);return e}function db(r,e){let n=yp(r);if(!n.length){let i=bn(r);n=i?i.split(" "):[]}return cD(n,e.freq)}function cD(r,e){if(r.length<2)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n],s=r[n+1];if(s!==void 0){let a=i+s;if(e.has(a)&&(!e.has(i)||!e.has(s))){t.push(a),n++;continue}}t.push(i)}return t}function ub(r,e){let t=r.get(e);return t?1/(1+Math.log(t)):1}var cb={maxSpanLines:8},hD=1-1e-9;function hb(r,e,t,n){let i=e.flat,s=dD(r),a=new Map,o=0;for(let u of r){let d=a.get(u);d===void 0&&(d=ub(e.freq,u),a.set(u,d)),o+=d}let l=Math.min(i.length,r.length*2+8);for(let u=0;u<i.length;u++){if(!s.has(i[u].t))continue;let d=new Map,c=0,h=0,f=Math.min(i.length,u+l),p=i[u].line;for(let g=u;g<f;g++){let v=i[g].line;if(v-p>=t)break;let m=i[g].t,y=a.get(m);y===void 0&&(y=ub(e.freq,m),a.set(m,y)),h+=y;let w=(d.get(m)||0)+1;d.set(m,w),w<=(s.get(m)||0)&&(c+=y);let x=2*c/(o+h);if(n(p,v,x))return}}}function fb(r,e,t={}){let{maxSpanLines:n}={...cb,...t},i=db(r,e);if(i.length===0||e.flat.length===0)return null;let s=null;return hb(i,e,n,(a,o,l)=>((!s||l>s.score)&&(s={startLine:a,endLine:o,score:l}),l>=hD)),s?fD(s,e):null}function fD(r,e){return{startLine:r.startLine,endLine:r.endLine,score:r.score,sourceExcerpt:e.raw.slice(r.startLine,r.endLine+1).join(" ").replace(/\s+/g," ").trim().slice(0,200)}}function nd(r,e,t,n={}){let{maxSpanLines:i}={...cb,...n},s=db(r,e);if(s.length===0||e.flat.length===0||t<=0)return[];let a=new Map;hb(s,e,i,(l,u,d)=>{let c=a.get(l);return(!c||d>c.score)&&a.set(l,{endLine:u,score:d}),!1});let o=[];for(let[l,u]of a)o.push({startLine:l,endLine:u.endLine,score:u.score});return o.sort((l,u)=>u.score-l.score||l.startLine-u.startLine),o.slice(0,t)}function xp(r,e,t){let n=r.anchoredText||r.comment,i=fb(n,e);return i&&i.score>=t?i:null}function id(r){let e=n=>vp(n??"").join(" "),t=[r.kind,(r.author??"").trim().toLowerCase(),e(r.comment),e(r.anchoredText)].join("\0");return cr(t).slice(0,16)}function pD(r){return r.resolved||r.note!=null||r.manualLine!=null||!!r.replies?.length||!!r.anchor}var gD=.05;function Vn(r,e){return r.stale?!1:r.manualLine!=null||r.confirmed?!0:(r.match?.score??0)>=e}function mD(r){return{startLine:r.line,endLine:r.endLine,score:1,method:r.method,sourceExcerpt:r.excerpt.slice(0,200)}}function vD(r,e,t,n,i){if(e?.anchor){let a=rd(t,e.anchor);return a?{match:mD(a),method:"anchor"}:{match:e.match??null,method:"kept",anchorLost:!0,stale:!0}}if(e?.match&&(e.manualLine!=null||e.confirmed))return{match:e.match,method:"kept",stale:e.stale};let s=xp(r,n,i);return e?.match?s?s.score+gD<e.match.score?{match:e.match,method:"kept",stale:!0}:{match:s,method:"search"}:{match:e.match,method:"kept",stale:!0}:{match:s,method:"search"}}function rs(r,e,t,n,i){let s=wi(e),a=new Map((n||[]).map(g=>[g.id,g])),o=new Set(r.map(g=>g.id)),l=new Map;for(let g of n||[]){if(o.has(g.id)||!pD(g))continue;let v=id(g),m=l.get(v);m?m.push(g):l.set(v,[g])}let u=0,d=0,c=0,h=0,f=0,p=r.map(g=>{let v=a.get(g.id);if(!v&&l.size>0){let y=l.get(id(g));y&&y.length&&(v=y.shift(),u++)}let m=vD(g,v,e,s,t.threshold);return m.method==="anchor"?d++:m.method==="kept"&&f++,m.anchorLost&&c++,m.stale&&h++,{...g,match:m.match,resolved:v?.resolved??!1,manualLine:v?.manualLine,confirmed:v?.confirmed,stale:m.stale||void 0,note:v?.note,replies:v?.replies,anchor:v?.anchor,number:g.number??v?.number,initials:g.initials??v?.initials}});return i&&(i.carried=u,i.anchored=d,i.anchorsLost=c,i.stale=h,i.kept=f),p.sort(ns)}function ns(r,e){let t=ht(r),n=ht(e);return t!==n?t-n:r.page-e.page}function ht(r){return r.manualLine!=null?r.manualLine:r.match?r.match.startLine:Number.MAX_SAFE_INTEGER}function pb(r){let e=(r??"").trim();if(!e)return;e=e.replace(/@.*$/,"");let t=/^([^,]+),\s*(.+)$/.exec(e);t&&(e=`${t[2]} ${t[1]}`);let n=e.replace(new RegExp("(\\p{Ll})(\\p{Lu})","gu"),"$1 $2").split(/[\s._-]+/).map(i=>i.replace(/[^\p{L}\p{N}]/gu,"")).filter(i=>new RegExp("^\\p{L}","u").test(i));if(n.length)return n.slice(0,3).map(i=>i[0].toLocaleUpperCase()).join("")}var yD=new Set(["editor","author","reviewer","user","guest","unknown","anonymous","admin","administrator"]);function bD(r){return yD.has((r??"").trim().toLowerCase())}function sd(r,e){return(r.pdfId??"").localeCompare(e.pdfId??"",void 0,{numeric:!0})||r.page-e.page||Math.round(e.rect[3])-Math.round(r.rect[3])||r.rect[0]-e.rect[0]||r.id.localeCompare(e.id)}function Qs(r,e=()=>{}){let t=!1,n=new Set,i=r.slice().sort(sd);for(let a of i)if(a.number!=null){if(!Number.isInteger(a.number)||a.number<1||n.has(a.number)){a.number=void 0,t=!0;continue}n.add(a.number)}let s=n.size?Math.max(...n)+1:1;for(let a of i)if(a.number==null&&(a.number=s++,t=!0),!a.initials){let o=bD(a.author)?void 0:a.author,l=pb(o)??pb(e(a));l&&(a.initials=l,t=!0)}return t}function gb(r){return r.reduce((e,t)=>Math.max(e,t.number??0),0)}function ad(r){if(r.number!=null)return r.initials?`#${r.number} ${r.initials}`:`#${r.number}`}function Ap(r,e=[]){let t=[...(r.extraPdfs??[]).map(i=>i.id),...e],n=2;for(let i of t){let s=/^pdf-(\d+)$/.exec(i);s&&(n=Math.max(n,Number(s[1])+1))}return`pdf-${n}`}function mb(r,e){return r?`${r}/${e}`:e}function vb(r){let e=r.pdfId?`${r.pdfId}/`:"";return e&&r.id.startsWith(e)?r.id.slice(e.length):r.id}function $s(r){return`${id(r)}@${r.page}`}function yb(r){let e=new Map;for(let t of r){let n=$s(t),i=e.get(n);i?i.push(t):e.set(n,[t])}return e}function bb(r,e,t,n=()=>{}){let i=yb(r.items),s=[],a=0;for(let o of t.slice().sort(sd)){let l=i.get($s(o));if(l?.length){l.shift(),a++;continue}s.push({...o,id:mb(e.id,vb(o)),pdfId:e.id,number:void 0,initials:void 0})}return r.extraPdfs=[...r.extraPdfs??[],e],r.items=[...r.items,...s].sort(ns),Qs(r.items,n),{added:s,duplicates:a}}function wb(r,e,t=new Date().toISOString()){let n=0,i=0,s=0,a=_o;for(let o of e){Qs(o.items,v=>a(o,v));let l=new Map,u=[],d=[],c=(v,m)=>{let y=Ap(r,u);u.push(y),l.set(v,y),d.push({id:y,...m})};c(void 0,{path:o.pdfPath,role:o.pdf?.role??"annotated",imported:o.pdf?.imported,importedFrom:o.pdf?.importedFrom,sha256:o.integrity?.pdfSha256,annotationCount:o.integrity?.pdfAnnotationCount,addedAt:t,...wD(o.mapping)});for(let v of o.extraPdfs??[]){let{id:m,...y}=v;c(m,{...y,origin:y.origin??o.mapping.origin,reviewer:y.reviewer??o.mapping.reviewer,addedAt:y.addedAt??t})}r.extraPdfs=[...r.extraPdfs??[],...d],s+=d.length;let h=yb(r.items),f=o.items.slice().sort((v,m)=>(v.number??1/0)-(m.number??1/0)||sd(v,m)),p=gb(r.items)+1,g=[];for(let v of f){let m=h.get($s(v))?.shift();if(m){xD(m,v),i++;continue}let y=l.get(v.pdfId)??l.get(void 0);g.push({...v,id:mb(y,vb(v)),pdfId:y,number:p++,initials:v.initials})}n+=g.length,r.items=[...r.items,...g],o.artifacts?.length&&(r.artifacts=[...r.artifacts??[],...o.artifacts])}return r.items.sort(ns),Qs(r.items,o=>a(r,o)),{moved:n,folded:i,pdfsAdded:s}}function wD(r){return{origin:r.origin||r.label||void 0,reviewer:r.reviewer||void 0}}function xD(r,e){if(r.resolved=r.resolved||e.resolved,r.confirmed=r.confirmed||e.confirmed||void 0,r.manualLine=r.manualLine??e.manualLine,r.anchor=r.anchor??e.anchor,e.note&&e.note!==r.note&&(r.note=r.note?`${r.note}
|
|
76
|
+
|
|
77
|
+
${e.note}`:e.note),e.replies?.length){let t=new Set((r.replies??[]).map(i=>i.id)),n=e.replies.filter(i=>!t.has(i.id));n.length&&(r.replies=[...r.replies??[],...n].sort((i,s)=>i.createdAt.localeCompare(s.createdAt)))}}var AD="https://volland.github.io/eddie-doc/schema/review-v3.schema.json",SD=3,rn={name:"eddie-doc",version:"1.4.6"};function is(r){return gp(r)}var PD="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";function ta(r){return r&&r!==PD?r:void 0}function ea(r,e){return Yu(bi(r),e)}function xi(r,e){return Xs(e)?e:Xu(bi(r),e)}function ft(r){for(let e of Object.keys(r))r[e]===void 0&&delete r[e];return r}function FD(r){if(r?.exact?.trim())return ft({exact:r.exact,prefix:r.prefix||void 0,suffix:r.suffix||void 0})}function Ab(r){if(!r)return;let e=ft({marker:r.marker||void 0,blockId:r.blockId||void 0,blockFingerprint:r.blockFingerprint||void 0,contextBefore:r.contextBefore||void 0,contextAfter:r.contextAfter||void 0,selector:FD(r.selector)});return Object.keys(e).length?e:void 0}function ra(){return{id:"rev-1",ordinal:1}}function od(r){return{id:Lt(r).replace(/\.review\.json$/i,"")||"review",kind:"annotations"}}function Sp(){return{role:"annotated"}}function xb(r){return["annotated","proof","clean","stamped","other"].includes(r)?r:"annotated"}function DD(r){return["annotations","manual","other"].includes(r)?r:"annotations"}function Sb(r){if(!r?.length)return;let e=r.filter(t=>t&&typeof t.body=="string"&&t.body.length>0).map(t=>({id:t.id,author:t.author,createdAt:t.createdAt,body:t.body}));return e.length?e:void 0}function ED(r,e){let t=r.integrity??{},n=ft({path:ea(e,r.adocPath),sha256:ta(t.sourceSha256),bytes:t.sourceBytes}),i=r.pdf??Sp(),s=ft({path:ea(e,r.pdfPath),sha256:ta(t.pdfSha256),bytes:void 0,annotationCount:t.pdfAnnotationCount,role:i.role??"annotated",imported:i.imported||void 0,importedFrom:i.importedFrom?ea(e,i.importedFrom):void 0}),a=r.revision??ra(),o=ft({id:a.id,ordinal:a.ordinal,label:a.label||void 0,receivedAt:a.receivedAt||void 0,note:a.note||void 0}),l=r.mapping??od(e),u=ft({id:l.id,kind:l.kind??"annotations",label:l.label||void 0,origin:l.origin||void 0,reviewer:l.reviewer||void 0,reviewType:l.reviewType||void 0,createdAt:l.createdAt||void 0}),d=r.artifacts?.length?r.artifacts.map(f=>ft({kind:f.kind,path:ea(e,f.path),createdAt:f.createdAt||void 0,note:f.note||void 0})):void 0,c=r.extraPdfs?.length?r.extraPdfs.map(f=>ft({id:f.id,path:ea(e,f.path),sha256:ta(f.sha256),annotationCount:f.annotationCount,role:f.role??"annotated",imported:f.imported||void 0,importedFrom:f.importedFrom?ea(e,f.importedFrom):void 0,addedAt:f.addedAt||void 0,origin:f.origin||void 0,reviewer:f.reviewer||void 0})):void 0,h=r.items.map(f=>{let p=ft({kind:f.kind,author:f.author,comment:f.comment||void 0,anchoredText:f.anchoredText||void 0,markedText:f.markedText,beforeText:f.beforeText,pdf:f.pdfId||void 0,geometry:{page:f.page,unit:"pt",origin:"bottom-left",rect:f.rect}}),g=f.match?ft({startLine:f.match.startLine,endLine:f.match.endLine,score:f.match.score,method:f.match.method,sourceExcerpt:f.match.sourceExcerpt}):null,v=ft({resolved:!!f.resolved,confirmed:f.confirmed||void 0,stale:f.stale||void 0,manualLine:f.manualLine,note:f.note,replies:Sb(f.replies)});return ft({id:f.id,number:f.number,initials:f.initials||void 0,annotation:p,anchor:Ab(f.anchor),match:g,state:v})});return ft({$schema:AD,version:SD,producer:{...rn},createdAt:r.createdAt,updatedAt:r.updatedAt,revision:o,mapping:u,source:n,pdf:s,pdfs:c,artifacts:d,items:h})}function Mo(r,e){return JSON.stringify(ED(r,e),null,2)+`
|
|
78
|
+
`}function na(r,e,t){let n;try{n=JSON.parse(r)}catch{return null}if(!n||typeof n!="object")return null;let i=n.version;return i===3?CD(n,e,t):i===2?TD(n,e,t):i===1?kD(n,e,t):null}function ia(r,e){let t;try{t=JSON.parse(r)}catch{return}let n=t;if(n?.version!==2&&n?.version!==3)return;let i=n.source?.path;return typeof i=="string"&&i?xi(e,i):void 0}function Pb(r){return(r.items??[]).map(e=>{let t=e.annotation??{},n=t.geometry??{},i=e.state??{resolved:!1};return ft({id:e.id,kind:t.kind??"other",page:n.page??1,comment:t.comment??"",anchoredText:t.anchoredText??"",markedText:t.markedText,beforeText:t.beforeText,author:t.author,rect:n.rect??[0,0,0,0],pdfId:typeof t.pdf=="string"&&t.pdf?t.pdf:void 0,number:Number.isInteger(e.number)&&e.number>0?e.number:void 0,initials:typeof e.initials=="string"&&e.initials?e.initials:void 0,match:e.match??null,resolved:!!i.resolved,confirmed:i.confirmed||void 0,stale:i.stale||void 0,manualLine:i.manualLine,note:i.note,replies:Sb(i.replies),anchor:Ab(e.anchor)})})}function Fb(r){return ft({sourceSha256:ta(r.source?.sha256),sourceBytes:r.source?.bytes,pdfSha256:ta(r.pdf?.sha256),pdfAnnotationCount:r.pdf?.annotationCount})}function Db(r,e,t){return t||(r.source?.path?xi(e,r.source.path):"")}function CD(r,e,t){let n=r.revision,i=r.mapping,s=od(e);return{version:3,sidecarPath:e,adocPath:Db(r,e,t),pdfPath:r.pdf?.path?xi(e,r.pdf.path):"",revision:n?.id?ft({id:n.id,ordinal:n.ordinal??1,label:n.label,receivedAt:n.receivedAt,note:n.note}):ra(),mapping:ft({id:i?.id||s.id,kind:DD(i?.kind),label:i?.label,origin:i?.origin,reviewer:i?.reviewer,reviewType:i?.reviewType,createdAt:i?.createdAt}),pdf:ft({role:xb(r.pdf?.role),imported:r.pdf?.imported||void 0,importedFrom:r.pdf?.importedFrom?xi(e,r.pdf.importedFrom):void 0}),createdAt:r.createdAt,updatedAt:r.updatedAt,integrity:Fb(r),artifacts:r.artifacts?.length?r.artifacts.map(a=>ft({kind:a.kind,path:xi(e,a.path),createdAt:a.createdAt,note:a.note})):void 0,extraPdfs:r.pdfs?.length?r.pdfs.filter(a=>a&&typeof a.id=="string"&&typeof a.path=="string").map(a=>ft({id:a.id,path:xi(e,a.path),role:xb(a.role),imported:a.imported||void 0,importedFrom:a.importedFrom?xi(e,a.importedFrom):void 0,sha256:ta(a.sha256),annotationCount:a.annotationCount,addedAt:a.addedAt,origin:a.origin,reviewer:a.reviewer})):void 0,items:Pb(r)}}function TD(r,e,t){return{version:2,sidecarPath:e,adocPath:Db(r,e,t),pdfPath:r.pdf?.path?xi(e,r.pdf.path):"",revision:ra(),mapping:od(e),pdf:Sp(),createdAt:r.createdAt,updatedAt:r.updatedAt,integrity:Fb(r),items:Pb(r)}}function kD(r,e,t){let n=(r.items??[]).map(i=>ft({id:i.id,kind:i.kind,page:i.page,comment:i.comment??"",anchoredText:i.anchoredText??"",markedText:i.markedText,beforeText:i.beforeText,author:i.author,rect:i.rect,match:i.match??null,resolved:!!i.resolved,confirmed:i.confirmed||void 0,manualLine:i.manualLine,note:i.note}));return{version:1,sidecarPath:e,adocPath:t??r.adocPath??"",pdfPath:r.pdfPath??"",revision:ra(),mapping:od(e),pdf:Sp(),createdAt:r.createdAt,updatedAt:r.updatedAt,items:n}}var Eb=".review.json",RD=".review.md";function ld(r,e){let t=(r.reviewFolder??"").trim();if(!t)return;if(Xs(t))return qn(t);let n=r.workspaceRoot??(e?bi(e):void 0);if(n!==void 0)return Xu(n,t)}function Pp(r){return r.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"untitled"}function Hn(r,e){let t=ld(r,e);if(!t)return;let n=Lt(e).replace(/\.(adoc|asciidoc|asc|ad)$/i,""),i=r.workspaceRoot??bi(e),s=Yu(i,bi(e));return(s.startsWith("..")||Xs(s))&&(s=Pp(bi(e))),Je(t,s,Pp(n))}function ud(r){return`rev-${Math.max(1,Math.floor(r))}`}function Fp(r,e){return Je(r,e)}function dd(r,e){return Je(Fp(r,e),"pdf")}function Dp(r,e,t){return Je(Fp(r,e),t+Eb)}function Cb(r,e,t){return Je(Fp(r,e),t+RD)}function Ep(r){return r.replace(/\.(adoc|asciidoc|asc|ad)$/i,"")+Eb}function Tb(r,e=[]){let t=Lt(r).replace(/\.pdf$/i,"").replace(/\.(annotated|reviewed|marked|commented)$/i,"");return _D(Pp(t),e)}function _D(r,e){let t=new Set(e);if(!t.has(r))return r;for(let n=2;;n++){let i=`${r}-${n}`;if(!t.has(i))return i}}function kb(r){let e=r.replace(/\.review\.json$/i,"");return[e,e+".adoc",e+".asciidoc"]}function ID(r){switch((r||"").toLowerCase()){case"highlight":return"highlight";case"strikeout":return"strikeout";case"underline":case"squiggly":return"underline";case"text":case"freetext":case"popup":return"comment";case"caret":return"insert";default:return"other"}}function OD(r){if(!r)return[];let e;Array.isArray(r)&&Array.isArray(r[0])?e=r.flat():e=Array.from(r);let t=[];for(let n=0;n+7<e.length;n+=8){let i=[e[n],e[n+2],e[n+4],e[n+6]],s=[e[n+1],e[n+3],e[n+5],e[n+7]];t.push({x0:Math.min(...i),y0:Math.min(...s),x1:Math.max(...i),y1:Math.max(...s)})}return t}function MD(r){return!r||r.length<4?null:{x0:Math.min(r[0],r[2]),y0:Math.min(r[1],r[3]),x1:Math.max(r[0],r[2]),y1:Math.max(r[1],r[3])}}function ND(r){let e=r.transform;if(!e||e.length<6)return null;let t=e[4],n=e[5],i=r.width||0,s=r.height||Math.hypot(e[1],e[3])||10;return{x0:t,y0:n-s*.25,x1:t+i,y1:n+s*.85}}function LD(r,e){let t=(r.y0+r.y1)/2;return t>=e.y0-2&&t<=e.y1+2?Math.min(r.x1,e.x1)-Math.max(r.x0,e.x0)>0:!1}function jD(r,e){if(r.length===0)return"";let t=e.filter(n=>r.some(i=>LD(n.box,i)));return cd(t)}function BD(r,e){let t=r.str,n=t.length;if(n===0)return"";let i=(r.box.x1-r.box.x0)/n;if(i<=0)return"";let s=u=>{let d=r.box.x0+(u+.5)*i;return d>=e.x0&&d<=e.x1},a=u=>/[\p{L}\p{N}]/u.test(u),o=[],l=0;for(;l<n;){if(!a(t[l])){l++;continue}let u=l,d=0;for(;u<n&&a(t[u]);)s(u)&&d++,u++;d/(u-l)>.5&&o.push(t.slice(l,u)),l=u}return o.join(" ")}function UD(r,e){if(r.length===0)return"";let t=[];for(let n of e){let i=(n.box.y0+n.box.y1)/2;for(let s of r){if(i<s.y0-2||i>s.y1+2)continue;let a=BD(n,s);a.trim()&&t.push({str:a,box:n.box});break}}return cd(t)}function qD(r,e){let t=(r.y0+r.y1)/2,n=(r.x0+r.x1)/2,i=e.filter(s=>{let a=(s.box.y0+s.box.y1)/2;return Math.abs(a-t)<=4&&(s.box.x0+s.box.x1)/2<n});return cd(i)}function zD(r,e){let t=(r.x0+r.x1)/2,n=(r.y0+r.y1)/2,i=null,s=1/0;for(let l of e){let u=Math.max(l.box.x0-t,0,t-l.box.x1),d=Math.max(l.box.y0-n,0,n-l.box.y1),c=Math.hypot(u,3*d);c<s&&(s=c,i=l)}if(!i)return"";let a=(i.box.y0+i.box.y1)/2,o=e.filter(l=>Math.abs((l.box.y0+l.box.y1)/2-a)<=3);return cd(o)}function cd(r){return[...r].sort((t,n)=>{let i=n.box.y1-t.box.y1;return Math.abs(i)>4?i:t.box.x0-n.box.x0}).map(t=>t.str).join(" ").replace(/\s+/g," ").trim()}function VD(r){return(r.contentsObj?.str||r.contents||"").trim()}function HD(r){return(r.titleObj?.str||r.title||"").trim()||void 0}function GD(r,e,t){return`p${e}-${r}-${Math.round(t.x0)}-${Math.round(t.y0)}`}function WD(r){return r.toLowerCase().replace(/\d+/g,"#").replace(/\s+/g," ").trim()}function Rb(r){let n=new Map,i=r.map(s=>{let a=new Map;s.texts.forEach((l,u)=>{let d=Math.round(l.box.y0/3),c=a.get(d);c?c.push(u):a.set(d,[u])});let o=[];for(let l of a.values()){let u=s.texts[l[0]].box.y0,d=s.height>0&&(u<s.height*.12||u>s.height*(1-.12)),c=WD(l.map(h=>s.texts[h].str).join(" "));if(o.push({sig:c,idxs:l,edge:d}),d&&c.length>=2){let h=n.get(c);h?h.add(s.p):n.set(c,new Set([s.p]))}}return o});r.forEach((s,a)=>{let o=new Set;for(let l of i[a]){if(!l.edge)continue;let u=(n.get(l.sig)?.size??0)>=3,d=/^#$/.test(l.sig);if(u||d)for(let c of l.idxs)o.add(c)}o.size&&(s.texts=s.texts.filter((l,u)=>!o.has(u)))})}function _b(r){return zy().getDocument({data:new Uint8Array(r),useSystemFonts:!0,isEvalSupported:!1,disableFontFace:!0,verbosity:0}).promise}async function Ib(r,e){let t=await _b(r);try{let n=await Ob(t,e);return Rb(n),n.map(i=>{let s=i.view;return{page:i.p,height:i.height,width:(s?.[2]??0)-(s?.[0]??0),texts:i.texts}})}finally{await t.destroy()}}async function Ob(r,e){let t=[],n=hy();for(let i=1;i<=r.numPages;i++){ly(e?.signal);let s=await r.getPage(i),[a,o]=await Promise.all([s.getAnnotations({intent:"display"}),s.getTextContent()]),l=[];for(let d of o.items){if(!("str"in d)||!d.str.trim())continue;let c=ND(d);c&&l.push({str:d.str,box:c})}let u=s.view;t.push({p:i,annots:a,texts:l,height:(u?.[3]??0)-(u?.[1]??0),view:u}),s.cleanup?.(),e?.report?.(i,r.numPages,"page"),await n.tick()}return t}async function sa(r,e){let t=await _b(r),n=[];try{let i=await Ob(t,e);Rb(i);for(let{p:s,annots:a,texts:o}of i)for(let l of a){let u=ID(l.subtype),d=(l.subtype||"").toLowerCase();if(d==="link"||d==="widget"||d==="popup"||l.inReplyTo)continue;let c=MD(l.rect),h=OD(l.quadPoints),f=h.length>0?{x0:Math.min(...h.map(w=>w.x0)),y0:Math.min(...h.map(w=>w.y0)),x1:Math.max(...h.map(w=>w.x1)),y1:Math.max(...h.map(w=>w.y1))}:c;if(!f)continue;let p="",g,v,m=h.length?h:c?[c]:[];u==="highlight"||u==="strikeout"||u==="underline"?(p=jD(m,o),g=UD(m,o)||void 0):(u==="comment"||u==="insert"||u==="other")&&(p=zD(f,o),u==="insert"&&(v=qD(f,o)||void 0));let y=VD(l);!p&&!y||n.push({id:GD(u,s,f),kind:u,page:s,comment:y,anchoredText:p,markedText:g,beforeText:v,author:HD(l),rect:[f.x0,f.y0,f.x1,f.y1]})}}finally{await t.destroy()}return KD(n)}function KD(r){let e=new Map;for(let t of r){let n=e.get(t.id)??0;e.set(t.id,n+1),n>0&&(t.id=`${t.id}#${n}`)}return r}var Mb=3;function Nb(r){let e=bn(r),t=new Map;if(!e)return t;let n=` ${e} `;for(let i=0;i+Mb<=n.length;i++){let s=n.slice(i,i+Mb);s.trim()&&t.set(s,(t.get(s)||0)+1)}return t}function hd(r,e,t){let n=r.filter(d=>!d.match&&d.manualLine==null&&(d.anchoredText||d.comment).trim().length>0);if(n.length===0)return 0;let i=Zs(e);if(i.length===0)return 0;let s=i.map(d=>Nb(d.text)),a=new Map;for(let d of s)for(let c of d.keys())a.set(c,(a.get(c)||0)+1);let o=d=>Math.log(1+i.length/(a.get(d)??.5)),l=6,u=0;for(let d of n){let c=Nb(d.anchoredText||d.comment);if(c.size<l)continue;let h=0;for(let[g,v]of c)h+=v*o(g);if(h<=0)continue;let f=0,p=-1;for(let g=0;g<i.length;g++){let v=s[g],m=0;for(let[w,x]of c){let b=v.get(w);b&&(m+=Math.min(x,b)*o(w))}let y=m/h;y>f&&(f=y,p=g)}if(p>=0&&f>=t){let g=i[p];d.match={startLine:g.startLine,endLine:g.endLine,score:f,sourceExcerpt:g.text.slice(0,200),method:"lexical"},u++}}return u}function XD(r,e){let t=e.endLine-e.startLine,n=e.newLineCount-t;return n===0||r<=e.startLine?r:r>e.endLine?r+n:e.startLine+e.newLineCount}function fd(r,e){let t=r;for(let n of e)t=XD(t,n);return t<0?0:t}function Lb(r){let{match:e,resolved:t,manualLine:n,confirmed:i,note:s,replies:a,anchor:o,...l}=r;return l}function YD(){return"r-"+Zy(4)}function Ge(r){return qn(r)}function No(r,e){return Ge(r)===Ge(e)}var pd=class{constructor(e){this.host=e}sessions=new Map;activeByDoc=new Map;_onDidChange=new Ku;onDidChange=this._onDidChange.event;semanticWarned=!1;embedCache=new Qu;layout={reviewFolder:""};pending=new Set;writer=null;stamps=new Map;useEmbedCacheFile(e){this.embedCache=new Oo(this.host.storage,e)}configure(e){this.layout=e}get layoutConfig(){return this.layout}get(e){let t=Ge(e),n=this.activeByDoc.get(t);if(n){let a=this.sessions.get(n);if(a)return a;this.activeByDoc.delete(t)}let i=this.sessionsFor(e),s=i[i.length-1];return s&&this.activeByDoc.set(t,s.sidecarPath),s}getBySidecar(e){return this.sessions.get(Ge(e))}all(){return[...this.sessions.values()]}sessionsFor(e){return this.all().filter(t=>t.adocPath&&No(t.adocPath,e)).sort((t,n)=>t.revision.ordinal-n.revision.ordinal||t.createdAt.localeCompare(n.createdAt)||t.mapping.id.localeCompare(n.mapping.id))}revisionsFor(e){let t=new Map;for(let n of this.sessionsFor(e))t.has(n.revision.id)||t.set(n.revision.id,n.revision);return[...t.values()].sort((n,i)=>n.ordinal-i.ordinal)}latestRevision(e){let t=this.revisionsFor(e);return t[t.length-1]}nextRevision(e){let t=(this.latestRevision(e)?.ordinal??0)+1;return{id:ud(t),ordinal:t}}documents(){let e=new Set;for(let t of this.all())t.adocPath&&e.add(t.adocPath);return[...e]}setActive(e){let t=this.getBySidecar(e);return t?(this.activeByDoc.set(Ge(t.adocPath),Ge(e)),this._onDidChange.fire(t.adocPath),!0):!1}locate(e){for(let t of this.activeByDoc.values()){let n=this.sessions.get(t);if(n?.items.some(i=>i.id===e))return n}return this.all().find(t=>t.items.some(n=>n.id===e))}async tryLoadSidecar(e){let t=!1,n=Ep(e);!this.sessions.has(Ge(n))&&await this.host.storage.exists(n)&&(t=!!await this.loadSidecarFile(n,e)||t);for(let i of await this.discoverSidecars(e))this.sessions.has(Ge(i))||(t=!!await this.loadSidecarFile(i,e)||t);return t&&this._onDidChange.fire(e),this.get(e)}async discoverSidecars(e){let t=Hn(this.layout,e);if(!t)return[];let n=[];for(let i of await this.host.storage.list(t)){if(!i.isDirectory)continue;let s=Je(t,i.name);for(let a of await this.host.storage.list(s))!a.isDirectory&&/\.review\.json$/i.test(a.name)&&n.push(Je(s,a.name))}return n.sort()}async loadSidecarFile(e,t){try{let n=await this.host.storage.readText(e),i=t??ia(n,e);if(!i||!await this.host.storage.exists(i))return;let s=na(n,e,i);return s?(s.sidecarPath=Ge(e),this.stamps.set(s.sidecarPath,cr(n)),this.number(s),this.sessions.set(s.sidecarPath,s),s):void 0}catch{return}}async loadReview(e,t,n){let i=n.revision??this.latestRevision(e)??this.nextRevision(e),s=n.sidecarPath?this.getBySidecar(n.sidecarPath):void 0,a=s?.mapping.id??n.mapping?.id??this.mintMappingId(e,i,t),o=n.sidecarPath??this.sidecarPathFor(e,i,a),l=t,u={role:n.pdfRole??"annotated"};if(n.importPdf){let x=await this.importPdf(e,i,a,t);x&&(l=x,u.imported=!0,u.importedFrom=t)}let d=await this.host.storage.readBytes(l),c=await this.host.storage.readBytes(e),h=mp(c),f=is(d),p=await sa(d,n.progress),g=s?s.items.filter(x=>!x.pdfId):this.carrySource(e,i,n.mapping?.origin)?.items,v={carried:0},m=rs(p,h,{threshold:n.threshold},g,v);if(s){let x=new Map,b=new Set(m.map(S=>S.number).filter(S=>S!=null));for(let S of g??[]){if(S.number==null||b.has(S.number))continue;let P=$s(S);x.set(P,[...x.get(P)??[],S])}for(let S of m){if(S.number!=null)continue;let P=x.get($s(S))?.shift();P&&(S.number=P.number,S.initials=P.initials)}let A=s.items.filter(S=>S.pdfId);if(A.length){let S=rs(A.map(Lb),h,{threshold:n.threshold},A);m=[...m,...S].sort(ns)}}else for(let x of m)x.number=x.initials=void 0;await this.runFallbacks(m,h),this.warnNewlyStale(v.stale??0),v.carried>0&&this.host.notify.info(`Eddie Doc: carried review state for ${v.carried} annotation(s) from the previous round.`);let y=new Date().toISOString(),w={version:3,sidecarPath:Ge(o),adocPath:e,pdfPath:l,revision:i,mapping:{kind:"annotations",createdAt:y,...s?jb(s.mapping):{},...jb(n.mapping??{}),id:a},pdf:u,createdAt:s?.createdAt??y,updatedAt:y,integrity:{sourceSha256:is(c),sourceBytes:c.length,pdfSha256:f,pdfAnnotationCount:p.length},artifacts:s?.artifacts,extraPdfs:s?.extraPdfs,items:m};return this.sessions.set(w.sidecarPath,w),this.activeByDoc.set(Ge(e),w.sidecarPath),this.persist(w),this._onDidChange.fire(e),w}carrySource(e,t,n){let i=this.sessionsFor(e).filter(o=>o.revision.ordinal<t.ordinal);if(!i.length)return;let s=i[i.length-1].revision.ordinal,a=i.filter(o=>o.revision.ordinal===s);if(n){let o=a.find(l=>l.mapping.origin?.toLowerCase()===n.toLowerCase());if(o)return o}return a.slice().sort((o,l)=>o.updatedAt.localeCompare(l.updatedAt)).pop()}mintMappingId(e,t,n){let i=this.sessionsFor(e).filter(s=>s.revision.id===t.id).map(s=>s.mapping.id);return Tb(n,i)}sidecarPathFor(e,t,n){let i=Hn(this.layout,e);if(i)return Dp(i,t.id,n);let s=Ep(e);return t.ordinal===1&&!this.sessionsFor(e).length?s:s.replace(/\.review\.json$/i,`.${t.id}-${n}.review.json`)}async importPdf(e,t,n,i){let s=Hn(this.layout,e);if(!s)return;let a=dd(s,t.id),o=Je(a,`${n}.pdf`);try{return No(o,i)||await this.host.storage.copy(i,o),o}catch(l){this.host.notify.warn(`Eddie Doc: could not import the PDF into the review folder \u2014 ${String(l)}`);return}}async appendPdf(e,t,n){let i=this.getBySidecar(e);if(!i)throw new Error("that mapping is not loaded");let s=await this.host.storage.readBytes(t),a=is(s);if([i.integrity?.pdfSha256,...(i.extraPdfs??[]).map(p=>p.sha256)].includes(a))return{added:[],duplicates:0,alreadyPresent:!0};let l=Ap(i),u={id:l,path:t,role:n.pdfRole??"annotated",sha256:a,addedAt:new Date().toISOString(),origin:n.origin||void 0,reviewer:n.reviewer||void 0};if(n.importPdf){let p=await this.importPdf(i.adocPath,i.revision,`${i.mapping.id}-${l}`,t);p&&(u.path=p,u.imported=!0,u.importedFrom=t)}let d=await this.host.storage.readText(i.adocPath),c=await sa(s,n.progress);u.annotationCount=c.length;let h=rs(c,d,{threshold:n.threshold}).map(p=>({...p,pdfId:l}));await this.runFallbacks(h,d);let f=bb(i,u,h,p=>_o(i,p));return i.updatedAt=new Date().toISOString(),this.persist(i),this._onDidChange.fire(i.adocPath),{...f,source:u}}async mergeMappings(e,t){let n=this.getBySidecar(e);if(!n)throw new Error("the mapping to merge into is not loaded");let i=t.map(l=>this.getBySidecar(l)).filter(l=>!!l&&l!==n);for(let l of i)if(!No(l.adocPath,n.adocPath))throw new Error(`${jt(l)} reviews a different document; only mappings of the same source can be merged`);let s=wb(n,i);n.updatedAt=new Date().toISOString(),this.persist(n),await this.flush();let a=[],o=[];for(let l of i)try{await this.host.storage.remove(l.sidecarPath),this.sessions.delete(l.sidecarPath),this.stamps.delete(l.sidecarPath),this.pending.delete(l),a.push(l.sidecarPath)}catch(u){o.push(`${Lt(l.sidecarPath)}: ${String(u)}`)}return this.activeByDoc.set(Ge(n.adocPath),n.sidecarPath),this._onDidChange.fire(n.adocPath),{...s,removed:a,failed:o}}async remap(e,t){let n=this.get(e);if(!n)return;let i=await this.remapSession(n,t,!1);this.warnNewlyStale(i.newlyStale),this._onDidChange.fire(e)}async remapAll(e,t,n={}){let i=0,s=0;for(let a of this.sessionsFor(e)){let o=await this.remapSession(a,t,n.onlyIfSourceChanged??!1);o.changed&&i++,s+=o.newlyStale}return this.warnNewlyStale(s),i>0&&this._onDidChange.fire(e),i}async remapSession(e,t,n){let i=await this.host.storage.readBytes(e.adocPath),s=is(i);if(n&&e.integrity?.sourceSha256===s)return{changed:!1,newlyStale:0};let a=mp(i),o=e.items.map(Lb),l=e.items.filter(c=>c.stale).length,u=rs(o,a,{threshold:t},e.items);await this.runFallbacks(u,a);let d=Math.max(0,u.filter(c=>c.stale).length-l);return e.items=u,e.version=3,e.updatedAt=new Date().toISOString(),e.integrity={...e.integrity,sourceSha256:s,sourceBytes:i.length},this.persist(e),{changed:!0,newlyStale:d}}warnNewlyStale(e){e<=0||this.host.notify.warn(`Eddie Doc: ${e} annotation(s) no longer match the text they were linked to. They are held at their last known place and marked stale under "Needs review" \u2014 confirm or re-link them.`)}async runFallbacks(e,t){let n=this.host.settings();if(n.semanticFallback&&this.host.capabilities.semanticFallback){let i=n.ollamaUrl,s=n.embedModel;this.embedCache instanceof Oo&&await this.embedCache.load(),!(await rb(e,t,{url:i,model:s,threshold:n.semanticThreshold,cache:this.embedCache,fetchFn:this.host.fetch})).ok&&!this.semanticWarned&&(this.semanticWarned=!0,this.host.notify.warn(`Eddie Doc: semantic fallback couldn't reach Ollama at ${i}. Start Ollama (with the '${s}' model pulled) or turn off the semantic fallback setting.`))}n.lexicalFallback&&hd(e,t,n.lexicalThreshold)}describeMapping(e,t){let n=this.getBySidecar(e);if(!n)return;let{revision:i,pdfRole:s,...a}=t;if(n.mapping={...n.mapping,...a,id:n.mapping.id},i){let o={...n.revision,...i,id:n.revision.id};for(let l of this.sessionsFor(n.adocPath))l.revision.id===n.revision.id&&(l.revision={...o},l!==n&&this.persist(l))}s&&(n.pdf={...n.pdf,role:s}),n.updatedAt=new Date().toISOString(),this.persist(n),this._onDidChange.fire(n.adocPath)}recordArtifact(e,t){let n=this.getBySidecar(e);if(!n)return;let i=(n.artifacts??[]).filter(s=>!(s.kind===t.kind&&No(s.path,t.path)));n.artifacts=[...i,t],n.updatedAt=new Date().toISOString(),this.persist(n),this._onDidChange.fire(n.adocPath)}async deleteMapping(e){let t=this.getBySidecar(e);if(!t)return!1;this.pending.delete(t);try{await this.host.storage.remove(t.sidecarPath)}catch(n){return this.host.notify.warn(`Eddie Doc: could not delete ${Lt(t.sidecarPath)} \u2014 ${String(n)}`),!1}return this.sessions.delete(t.sidecarPath),this.stamps.delete(t.sidecarPath),this.activeByDoc.get(Ge(t.adocPath))===t.sidecarPath&&this.activeByDoc.delete(Ge(t.adocPath)),this._onDidChange.fire(t.adocPath),!0}planMigration(){let e=[];for(let t of this.all()){let n=Hn(this.layout,t.adocPath);if(!n)continue;let i=Dp(n,t.revision.id,t.mapping.id);No(i,t.sidecarPath)||e.push({from:t.sidecarPath,to:i,adocPath:t.adocPath})}return e}async migrate(e){let t=[],n=0;await this.flush();for(let i of e){let s=this.getBySidecar(i.from);if(!s)continue;let a=s.sidecarPath;try{s.sidecarPath=Ge(i.to),s.version=3;let o=Mo(s,s.sidecarPath);await this.host.storage.writeText(s.sidecarPath,o),this.stamps.set(s.sidecarPath,cr(o)),this.stamps.delete(a),await this.host.storage.remove(a),this.sessions.delete(a),this.sessions.set(s.sidecarPath,s),this.activeByDoc.get(Ge(s.adocPath))===a&&this.activeByDoc.set(Ge(s.adocPath),s.sidecarPath),n++}catch(o){s.sidecarPath=a,t.push(`${Lt(i.from)}: ${String(o)}`)}}return n&&this._onDidChange.fire(void 0),{moved:n,failed:t}}shiftPositions(e,t){if(t.length===0)return!1;let n=!1;for(let i of this.sessionsFor(e).flatMap(s=>s.items)){if(i.manualLine!=null){let s=fd(i.manualLine,t);s!==i.manualLine&&(i.manualLine=s,n=!0)}if(i.match){let s=fd(i.match.startLine,t),a=fd(i.match.endLine,t);(s!==i.match.startLine||a!==i.match.endLine)&&(i.match={...i.match,startLine:s,endLine:a},n=!0)}}return n}findItem(e,t){return this.get(e)?.items.find(n=>n.id===t)}toggleResolved(e,t){let n=this.findItem(e,t);n&&(n.resolved=!n.resolved,this.touch(e))}relink(e,t,n){let i=this.findItem(e,t);i&&(i.manualLine=n,i.confirmed=!0,i.stale=void 0,this.touch(e))}addReply(e,t,n,i){let s=this.findItem(e,t);if(!s)return;let a=i.trim();if(!a)return;let o={id:YD(),author:n,createdAt:new Date().toISOString(),body:a};s.replies=[...s.replies??[],o],this.touch(e)}editReply(e,t,n,i){let s=this.findItem(e,t),a=i.trim();if(!s?.replies||!a)return;let o=s.replies.findIndex(l=>l.id===n);o<0||(s.replies[o]={...s.replies[o],body:a},this.touch(e))}deleteReply(e,t,n){let i=this.findItem(e,t);if(!i?.replies)return;let s=i.replies.filter(a=>a.id!==n);s.length!==i.replies.length&&(i.replies=s.length?s:void 0,this.touch(e))}confirmMatch(e,t){let n=this.findItem(e,t);n&&(n.confirmed=!0,n.stale=void 0,this.touch(e))}async remapItem(e,t,n){let i=this.findItem(e,t);if(!i)return;let s=await this.host.storage.readText(e),a=rd(s,i.anchor);if(a){i.match={startLine:a.line,endLine:a.endLine,score:1,method:a.method,sourceExcerpt:a.excerpt.slice(0,200)},i.manualLine=void 0,i.confirmed=!0,i.stale=void 0,this.touch(e);return}let o=wi(s),l=xp(i,o,n);i.stale=l?void 0:!0,l&&(i.match=l),i.manualLine=void 0,i.confirmed=!1,this.touch(e)}buildAnchors(e,t){let n=this.get(e);if(!n)return;let i=[];for(let l of n.items){let u=ht(l);u!==Number.MAX_SAFE_INTEGER&&i.push({itemId:l.id,line:u})}if(!i.length)return{source:t,inserted:0,anchored:0};let s=td(t,i),a=Js(s.source),o=0;for(let l of n.items){let u=s.assigned.get(l.id);if(!u)continue;let d=a.get(u);d&&(l.anchor=ed(s.source,d.targetLine,u),o++)}return{source:s.source,inserted:s.inserted,anchored:o}}touch(e){let t=this.get(e);t&&(t.updatedAt=new Date().toISOString(),this.persist(t),this._onDidChange.fire(e))}number(e){return Qs(e.items,t=>_o(e,t))}persist(e){this.number(e),e.version=3,this.pending.add(e),this.writer??=this.drain()}async drain(){await Promise.resolve();try{for(;this.pending.size;){let e=this.pending.values().next().value;if(this.pending.delete(e),this.sessions.get(e.sidecarPath)===e)try{await this.writeSidecar(e)}catch(t){this.host.notify.warn(`Eddie Doc: could not save review sidecar: ${String(t)}`)}}}finally{this.writer=null}}async writeSidecar(e){let t=e.sidecarPath,n=this.stamps.get(t);if(n!==void 0){let s;try{s=await this.host.storage.exists(t)?await this.host.storage.readText(t):void 0}catch{s=void 0}s!==void 0&&cr(s)!==n&&await this.resolveConflict(e,s)}this.number(e);let i=Mo(e,t);await this.host.storage.writeText(t,i),this.stamps.set(t,cr(i))}async resolveConflict(e,t){let n=e.sidecarPath,i=na(t,n,e.adocPath),s=new Date().toISOString().replace(/[-:]/g,"").replace(/\..*/,""),a=n.replace(/\.review\.json$/i,"")+`.conflict-${s}.txt`;try{await this.host.storage.writeText(a,t)}catch{}i&&ZD(e,i),this.host.notify.warn(`Eddie Doc: ${Lt(n)} was changed elsewhere while you were editing it. Replies and new annotations from the other copy were merged in; the other copy is kept as ${Lt(a)}.`)}async reloadFromDisk(e){let t=Ge(e),n=this.sessions.get(t);if(n&&this.pending.has(n))return"pending";if(!await this.host.storage.exists(t))return n?(this.dropSession(t),"missing"):"unchanged";let i;try{i=await this.host.storage.readText(t)}catch{return"unchanged"}if(cr(i)===this.stamps.get(t))return"unchanged";if(!n)return await this.loadSidecarFile(t)?(this._onDidChange.fire(void 0),"reloaded"):"unchanged";if(this.pending.has(n))return"pending";let s=na(i,t,n.adocPath);return s?(s.sidecarPath=t,this.number(s),this.sessions.set(t,s),this.stamps.set(t,cr(i)),this._onDidChange.fire(s.adocPath),"reloaded"):"unchanged"}dropSession(e){let t=Ge(e),n=this.sessions.get(t);n&&(this.pending.delete(n),this.sessions.delete(t),this.stamps.delete(t),this.activeByDoc.get(Ge(n.adocPath))===t&&this.activeByDoc.delete(Ge(n.adocPath)),this._onDidChange.fire(n.adocPath))}rebindPaths(e,t){let n=Ge(e),i=Ge(t),s=o=>{if(!o)return o;let l=Ge(o);return l===n?i:l.startsWith(n+"/")?i+l.slice(n.length):o},a=0;for(let o of[...this.sessions.values()]){let l=JSON.stringify([o.sidecarPath,o.adocPath,o.pdfPath,o.pdf?.importedFrom,o.extraPdfs?.map(p=>p.path),o.artifacts?.map(p=>p.path)]),u=o.sidecarPath,d=Ge(o.adocPath);o.adocPath=s(o.adocPath)??o.adocPath,o.pdfPath=s(o.pdfPath)??o.pdfPath,o.pdf?.importedFrom&&(o.pdf={...o.pdf,importedFrom:s(o.pdf.importedFrom)}),o.extraPdfs&&(o.extraPdfs=o.extraPdfs.map(p=>({...p,path:s(p.path)??p.path,importedFrom:s(p.importedFrom)}))),o.artifacts&&(o.artifacts=o.artifacts.map(p=>({...p,path:s(p.path)??p.path})));let c=Ge(s(u)??u);o.sidecarPath=c;let h=JSON.stringify([o.sidecarPath,o.adocPath,o.pdfPath,o.pdf?.importedFrom,o.extraPdfs?.map(p=>p.path),o.artifacts?.map(p=>p.path)]);if(l===h)continue;if(a++,c!==u){this.sessions.delete(u),this.sessions.set(c,o);let p=this.stamps.get(u);this.stamps.delete(u),p!==void 0&&this.stamps.set(c,p)}let f=Ge(o.adocPath);if(f!==d||c!==u){let p=this.activeByDoc.get(d);p!==void 0&&(this.activeByDoc.delete(d),this.activeByDoc.set(f,p===u?c:p))}o.updatedAt=new Date().toISOString(),this.persist(o)}return a&&this._onDidChange.fire(void 0),a}async flush(){for(;this.writer;)await this.writer}dispose(){this._onDidChange.dispose()}};function ZD(r,e){let t=new Map(r.items.map(a=>[a.id,a])),n=!1;for(let a of e.items){let o=t.get(a.id);if(!o){r.items.push(a),n=!0;continue}let l=new Set((o.replies??[]).map(d=>d.id)),u=(a.replies??[]).filter(d=>!l.has(d.id));u.length&&(o.replies=[...o.replies??[],...u].sort((d,c)=>d.createdAt.localeCompare(c.createdAt)))}n&&r.items.sort(ns);let i=new Set((r.extraPdfs??[]).map(a=>a.id)),s=(e.extraPdfs??[]).filter(a=>!i.has(a.id));s.length&&(r.extraPdfs=[...r.extraPdfs??[],...s])}function jb(r){let e={};for(let t of Object.keys(r))r[t]!==void 0&&(e[t]=r[t]);return e}var Qe=class extends Error{},md=class{constructor(e,t){this.opts=e;this.io=t;let n=()=>e.loaded.settings;this.host={storage:this.storage,notify:{info:i=>void(e.quiet?void 0:t.note(i)),warn:i=>t.note(`warning: ${i}`)},settings:n,authorName:()=>this.authorName(),capabilities:{semanticFallback:!0,externalFiles:!0},fetch:(i,s)=>fetch(i,s)},this.store=new pd(this.host),this.store.configure({workspaceRoot:e.root,reviewFolder:n().reviewFolder}),this.store.useEmbedCacheFile(tr.join(process.env.XDG_CACHE_HOME||tr.join(vd.homedir(),".cache"),"eddie-doc","embed-cache.json"))}store;storage=new Ks;host;cachedAuthor;get settings(){return this.opts.loaded.settings}authorName(){if(this.opts.author?.trim())return this.opts.author.trim();if(this.settings.authorName.trim())return this.settings.authorName.trim();if(this.cachedAuthor!==void 0)return this.cachedAuthor;try{this.cachedAuthor=(0,Bb.execFileSync)("git",["config","user.name"],{encoding:"utf8",timeout:2e3,cwd:this.opts.root,stdio:["ignore","pipe","ignore"]}).trim()}catch{this.cachedAuthor=""}if(!this.cachedAuthor)try{this.cachedAuthor=vd.userInfo().username||"Author"}catch{this.cachedAuthor="Author"}return this.cachedAuthor}abs(e){return tr.resolve(e)}async requireDoc(e){if(!e)throw new pe("missing <source.adoc>");let t=this.abs(e);try{await gd.promises.access(t)}catch{throw new Qe(`no such file: ${e}`)}if(await this.store.tryLoadSidecar(t),!this.store.sessionsFor(t).length)throw new Qe(`no review for ${tr.basename(t)} \u2014 map one first: eddie open ${e} <annotated.pdf>`);return t}pickMapping(e,t,n){let i=this.store.sessionsFor(e);if(n!=null&&(i=i.filter(a=>a.revision.ordinal===n),!i.length))throw new Qe(`${tr.basename(e)} has no round ${n}`);let s;if(t){let a=t.toLowerCase(),o=tr.resolve(t),l=[u=>tr.resolve(u.sidecarPath)===o,u=>`${u.revision.id}/${u.mapping.id}`.toLowerCase()===a,u=>u.mapping.id.toLowerCase()===a,u=>(u.mapping.label??"").toLowerCase()===a,u=>(u.mapping.origin??"").toLowerCase()===a];for(let u of l){let d=i.filter(u);if(d.length===1){s=d[0];break}if(d.length>1){s=d[d.length-1];break}}if(!s)throw new Qe(`no mapping "${t}" for ${tr.basename(e)} \u2014 see: eddie rounds ${tr.relative(process.cwd(),e)}`)}else s=i[i.length-1];return this.store.setActive(s.sidecarPath),s}findItem(e,t){if(!t)throw new pe("missing <item> (a number like #3, or an id)");let n=/^#?(\d+)$/.exec(t.trim());if(n){let a=Number(n[1]),o=e.items.find(l=>l.number===a);if(o)return o}let i=e.items.find(a=>a.id===t);if(i)return i;let s=e.items.filter(a=>a.id.startsWith(t));if(s.length===1)return s[0];throw s.length>1?new Qe(`"${t}" matches ${s.length} annotations; give more of the id`):new Qe(`no annotation "${t}" in this mapping \u2014 see: eddie list`)}async loadAll(){for(let e of await JD(this.opts.root)){if(this.store.getBySidecar(e))continue;let t;try{t=ia(await gd.promises.readFile(e,"utf8"),e)}catch{continue}if(!t||!await this.storage.exists(t)){t=void 0;for(let n of kb(e))if(/\.(adoc|asciidoc)$/i.test(n)&&await this.storage.exists(n)){t=n;break}}t&&await this.store.loadSidecarFile(e,t)}}show(e){let t=tr.relative(process.cwd(),e);return t&&!t.startsWith("..")&&t.length<e.length?t:e}};async function JD(r){let e=new Set(["node_modules",".git",".hg",".svn","dist","out"]),t=[],n=async(i,s)=>{if(s>12)return;let a;try{a=await gd.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let o of a){let l=tr.join(i,o.name);o.isDirectory()?e.has(o.name)||await n(l,s+1):/\.review\.json$/i.test(o.name)&&t.push(l)}};return await n(r,0),t.sort()}var Si=require("node:fs"),Hb=require("node:child_process"),Ai=jr(require("node:path"));var Ub=/\[\s*([A-Za-z#]{0,3}\s?\d{1,4}(?:\s?[-–—]\s?\d{1,4})?[a-z]?)\s*\]/;function qb(r){let e=Ub.exec(r??"");return e?`[${e[1].replace(/\s+/g,"")}]`:void 0}function zb(r){let e=r??"";return qb(e)?e.replace(Ub," ").replace(/^[\s:;.\-–—]+/,"").replace(/\s+/g," ").trim()||e.trim():e}function Cp(r){let e=[ad(r),qb(r.comment)].filter(Boolean);return e.length?e.join(" "):void 0}var Tp=Number.MAX_SAFE_INTEGER;function QD(r){return r.replace(/\s+/g," ").trim()}function yd(r,e=300){let t=QD(r);return t.length>e?t.slice(0,e)+"\u2026":t}function $D(r){let e=ht(r);if(e===Tp)return"no source match";let t=r.match,n=t&&t.endLine>t.startLine&&r.manualLine==null?`lines ${t.startLine+1}\u2013${t.endLine+1}`:`line ${e+1}`;if(r.manualLine!=null)return`${n} \xB7 manual`;if(!t)return n;let i=t.method&&t.method!=="fuzzy"?`${t.method} `:"";return`${n} \xB7 ${i}${t.score.toFixed(2)}`}function eE(r){let t=[`- ${[Cp(r)?`**${Cp(r)}** ${bt[r.kind]}`:`**${bt[r.kind]}**`,`p${r.page}`,$D(r),r.author?r.author:void 0].filter(Boolean).join(" \xB7 ")}`];r.comment&&t.push(` > ${yd(zb(r.comment))}`);let n=r.markedText||r.anchoredText;return n&&t.push(` - marked: \u201C${yd(n,160)}\u201D`),r.match?.sourceExcerpt&&t.push(` - source: \`${yd(r.match.sourceExcerpt,160)}\``),r.note&&t.push(` - note: ${yd(r.note)}`),t.join(`
|
|
79
|
+
`)}function bd(r,e){return e.length?[`## ${r} (${e.length})`,"",...e.map(eE),""]:[]}function wd(r,e={}){let t=e.highConfidence??.75,n=e.includeResolved??!0,i=r.items,s=i.filter(g=>!g.resolved),a=s.filter(g=>ht(g)!==Tp),o=a.filter(g=>Vn(g,t)),l=a.filter(g=>!Vn(g,t)),u=s.filter(g=>ht(g)===Tp),d=i.filter(g=>g.resolved),c=Lt(r.adocPath),h=r.pdfPath?[`\`${Lt(r.pdfPath)}\``]:[];for(let g of r.extraPdfs??[]){let v=g.reviewer||g.origin;h.push(`\`${Lt(g.path)}\`${v?` (${v})`:""}`)}let f=h.length?h.join(", "):"`(unknown)`",p=[`# Review report \u2014 ${c}`,"",`- **Source:** \`${c}\``,`- **Annotated PDF${h.length>1?"s":""}:** ${f}`,`- **Generated:** ${e.generatedAt??r.updatedAt}`,`- **Progress:** ${d.length} of ${i.length} resolved \xB7 ${o.length} open \xB7 ${l.length} need review \xB7 ${u.length} unmatched`,""];return e.stale&&p.push("> \u26A0\uFE0F The source or PDF changed after this mapping ran \u2014 line numbers may be off. Re-run **Re-map Annotations** before relying on them.",""),p.push(...bd("Open",o)),p.push(...bd("Needs review",l)),p.push(...bd("Unmatched",u)),n&&p.push(...bd("Resolved",d)),p.join(`
|
|
80
|
+
`).replace(/\n{3,}/g,`
|
|
81
|
+
|
|
82
|
+
`).trimEnd()+`
|
|
83
|
+
`}async function Vb(r,e){let t=r.integrity;if(!t)return!1;let n=async(i,s)=>{if(!s)return!1;try{return is(await e.readBytes(i))!==s}catch{return!0}};if(await n(r.adocPath,t.sourceSha256)||await n(r.pdfPath,t.pdfSha256))return!0;for(let i of r.extraPdfs??[])if(await n(i.path,i.sha256))return!0;return!1}function kp(r,e,t,n,i){if(t!=="reviewFolder")return n;let s=Hn(r.store.layoutConfig,e.adocPath);return s?i==="report"?Cb(s,e.revision.id,e.mapping.id):Ai.join(dd(s,e.revision.id),Ai.basename(n)):n}async function Rp(r,e,t=!0){return wd(e,{highConfidence:r.settings.highConfidence,includeResolved:t,stale:await Vb(e,r.storage),generatedAt:new Date().toISOString()})}async function xd(r,e,t={}){let n=await Rp(r,e,t.includeResolved??!0),i=t.outPath??kp(r,e,r.settings.reportOutput,e.adocPath.replace(/\.(adoc|asciidoc)$/i,"")+".review.md","report");return(0,Si.mkdirSync)(Ai.dirname(i),{recursive:!0}),(0,Si.writeFileSync)(i,n,"utf8"),r.store.recordArtifact(e.sidecarPath,{kind:"report",path:i,createdAt:new Date().toISOString()}),await r.store.flush(),i}function Lo(r){let[e,t]=process.platform==="darwin"?["open",[r]]:process.platform==="win32"?["cmd",["/c","start","",r]]:["xdg-open",[r]];(0,Hb.spawn)(e,t,{detached:!0,stdio:"ignore"}).unref()}function Gb(r){let e=[...new Set(r.map(t=>Ai.dirname(t)))].sort((t,n)=>n.length-t.length);for(let t of e)for(let n=t;!/[\\/]\.?[a-z]+[\\/]skills$/i.test(n);n=Ai.dirname(n))try{if((0,Si.readdirSync)(n).length)break;(0,Si.rmdirSync)(n)}catch{break}}var Kn=require("node:fs"),Xn=jr(require("node:path"));function tE(r){if(r>=48&&r<=57||r>=97&&r<=122||r>=65&&r<=90)return!0;let e=String.fromCharCode(r);return/[\p{L}\p{N}]/u.test(e)}function Wb(r){let e=[],t=[],n=!0;for(let i=0;i<r.length;i++){let s=r[i];tE(s.codePointAt(0))?(e.push(s.toLowerCase()),t.push(i),n=!1):n||(e.push(" "),t.push(i),n=!0)}return e.length&&e[e.length-1]===" "&&(e.pop(),t.pop()),{norm:e.join(""),map:t}}function jo(r,e,t=.8){let n=Wb(e),i=Wb(r).norm;if(!i||!n.norm)return null;let s=n.norm.indexOf(i);if(s>=0)return{start:n.map[s],end:n.map[s+i.length-1]+1,score:1};let a=i.length;if(n.norm.length<a){let u=Kb(i,n.norm);return u>=t?{start:n.map[0],end:n.map[n.map.length-1]+1,score:u}:null}let o=-1,l=0;for(let u=0;u+a<=n.norm.length;u++){let d=Kb(i,n.norm.slice(u,u+a));d>l&&(l=d,o=u)}return o>=0&&l>=t?{start:n.map[o],end:n.map[o+a-1]+1,score:l}:null}function Kb(r,e){let t=Math.min(r.length,e.length);if(t===0)return 0;let n=0;for(let i=0;i<t;i++)r[i]===e[i]&&n++;return n/Math.max(r.length,e.length)}var Xb=Number.MAX_SAFE_INTEGER,wn={open:"Open",review:"Needs review",unmatched:"Unmatched",resolved:"Resolved"},aa=["open","review","unmatched","resolved"];function Gn(r){return ht(r)!==Xb}function Wn(r,e){return r.resolved?"resolved":Gn(r)?Vn(r,e)?"open":"review":"unmatched"}function Ad(r,e,t){let n=e.text?.trim().toLowerCase();return r.filter(i=>!(e.hideResolved&&i.resolved||e.buckets?.length&&!e.buckets.includes(Wn(i,t))||e.kinds?.length&&!e.kinds.includes(i.kind)||e.page!=null&&i.page!==e.page||n&&![i.comment,i.markedText,i.anchoredText,i.author,i.note].filter(Boolean).join(`
|
|
84
|
+
`).toLowerCase().includes(n)))}function Er(r,e){let t={open:0,review:0,unmatched:0,resolved:0,total:r.length};for(let n of r)t[Wn(n,e)]++;return t}function Yb(r,e){let t=new Map;for(let n of r){let i=Wn(n,e);t.set(i,[...t.get(i)??[],n])}return aa.filter(n=>t.has(n)).map(n=>({bucket:n,label:`${wn[n]} (${t.get(n).length})`,items:t.get(n)}))}function _p(r){let e=ht(r);if(e===Xb)return null;let t=r.manualLine!=null?e:r.match?.endLine??e;return{start:e,end:Math.max(e,t)}}function rE(r){let e=[0];for(let t=0;t<r.length;t++)r[t]===`
|
|
85
|
+
`&&e.push(t+1);return e}function Ip(r,e,t){let n=e[t+1];return n===void 0?r.length:r[n-2]==="\r"?n-2:n-1}function Fd(r,e){let t=rE(r),n=_p(e);if(!n||n.start>=t.length)return null;let i=Math.min(n.end,t.length-1);return{starts:t,start:n.start,end:i}}function Pd(r,e){let t=Fd(r,e),n=e.markedText||e.anchoredText;if(!t||!n)return null;let i=t.starts[t.start],s=r.slice(i,Ip(r,t.starts,t.end)),a=jo(n,s);return a?{from:i+a.start,to:i+a.end}:null}function Zb(r,e){let t=Fd(r,e);if(!t)return null;let n=t.starts[t.start],i=r.slice(n,Ip(r,t.starts,t.start));if(e.beforeText){let s=jo(e.beforeText,i);if(s)return n+s.end}return n+i.length}function nE(r,e){return r[e.to]===" "?{from:e.from,to:e.to+1}:e.from>0&&r[e.from-1]===" "?{from:e.from-1,to:e.to}:e}function Dd(r,e){let t=Pd(r,e);if(!t)return null;let n=nE(r,t);return{from:n.from,to:n.to,insert:""}}function Ed(r,e){let t=Fd(r,e);if(!t)return null;let n=t.starts[t.start],i=t.end+1<t.starts.length?t.starts[t.end+1]:r.length;return{from:n,to:i,insert:""}}function Cd(r,e,t){let n=Pd(r,e);return n?{from:n.from,to:n.to,insert:t}:null}function Td(r,e,t){let n=Zb(r,e);return n==null?null:{from:n,to:n,insert:t}}function kd(r,e){let t=Fd(r,e);if(!t||!e.comment)return null;let n=t.starts[t.start],i=/^[ \t]*/.exec(r.slice(n,Ip(r,t.starts,t.start)))?.[0]??"",s=e.author?`${e.author}: `:"",a=r.includes(`\r
|
|
86
|
+
`)?`\r
|
|
87
|
+
`:`
|
|
88
|
+
`,o=e.comment.replace(/\r?\n/g," ").replace(/\s+/g," ").trim();return{from:n,to:n,insert:`${i}// \u270E ${bt[e.kind]} \u2014 ${s}${o}${a}`}}function Rd(r,e){if(!e)return[];let t=[];return r.kind==="strikeout"&&(t.push({action:"delete-struck",label:"Delete struck text",needsText:!1}),t.push({action:"replace-marked",label:"Replace struck text\u2026",needsText:!0}),t.push({action:"delete-lines",label:"Delete whole line(s)",needsText:!1})),(r.kind==="highlight"||r.kind==="underline")&&r.comment&&t.push({action:"replace-marked",label:"Replace highlighted text\u2026",needsText:!0}),r.kind==="insert"&&t.push({action:"insert-at-mark",label:"Insert text at mark\u2026",needsText:!0}),r.comment&&t.push({action:"insert-note",label:"Insert editor note as comment",needsText:!1}),t}function la(r,e){let t=r;for(let n of[...e].sort((i,s)=>s.from-i.from))t=t.slice(0,n.from)+n.insert+t.slice(n.to);return t}function oa(r){let e=r.replace(/\s+/g," ").trim(),t=e.match(/['"“”‘’«»]([^'"“”‘’«»]{2,})['"“”‘’«»]/);return t?t[1].trim():e.replace(/^(reword|replace(?:\s+with)?|change(?:\s+to)?|use|rewrite(?:\s+as)?)\s*[:\-–—]?\s*/i,"").trim()}function Sd(r,e){let t=r.replace(/\s+/g," ").trim();return t.length>e?t.slice(0,e)+"\u2026":t}function _d(r,e,t){let n=[];for(let i of e)if(!(i.resolved||!_p(i)||!t(i))){if(i.kind==="strikeout"){let s=Pd(r,i);if(!s)continue;n.push({id:i.id,label:`Delete \u201C${Sd(r.slice(s.from,s.to),50)}\u201D`,edit:{from:s.from,to:s.to,insert:""}})}else if(i.kind==="replace"||(i.kind==="highlight"||i.kind==="underline")&&i.comment){let s=Pd(r,i),a=oa(i.comment);if(!s||!a)continue;n.push({id:i.id,label:`Replace \u201C${Sd(r.slice(s.from,s.to),32)}\u201D \u2192 \u201C${Sd(a,32)}\u201D`,edit:{from:s.from,to:s.to,insert:a}})}else if(i.kind==="insert"){let s=Zb(r,i),a=oa(i.comment);if(s==null||!a)continue;n.push({id:i.id,label:`Insert \u201C${Sd(a,50)}\u201D`,edit:{from:s,to:s,insert:` ${a}`}})}}return n}function Id(r){let e=[...r].sort((t,n)=>t.from-n.from||t.to-n.to);for(let t=1;t<e.length;t++)if(e[t].from<e[t-1].to||e[t].from===e[t-1].from&&e[t].to===e[t-1].to)return!0;return!1}var iE=Number.MAX_SAFE_INTEGER;function nn(r,e=80){let t=(r??"").replace(/\s+/g," ").trim();return t.length>e?t.slice(0,e)+"\u2026":t}function Cr(r){let e=ht(r);return e===iE?null:e+1}function Ue(r){return r.number==null?r.id:r.initials?`#${r.number} ${r.initials}`:`#${r.number}`}function Jb(r){let e=Cr(r),t=e==null?"unmatched":`L${e}`,n=r.manualLine!=null?"manual":r.match?`${r.match.score.toFixed(2)} ${r.match.method??"fuzzy"}`:"",i=[r.resolved?"resolved":"",r.stale?"stale":"",r.confirmed?"confirmed":""].filter(Boolean).join(","),s=r.replies?.length?` \u{1F4AC}${r.replies.length}`:"",a=nn(r.comment||r.markedText||r.anchoredText,70);return`${Ue(r).padEnd(8)} ${`[${bt[r.kind]}]`.padEnd(12)} p${String(r.page).padEnd(3)} ${t.padEnd(10)} ${n.padEnd(14)} ${a}${s}${i?` (${i})`:""}`}function ss(r,e){let t=Cr(r);return{id:r.id,number:r.number??null,initials:r.initials??null,kind:r.kind,bucket:Wn(r,e),page:r.page,line:t,endLine:t==null?null:r.manualLine!=null?t:(r.match?.endLine??t-1)+1,score:r.match?.score??null,method:r.manualLine!=null?"manual":r.match?.method??null,resolved:r.resolved,confirmed:!!r.confirmed,stale:!!r.stale,author:r.author??null,comment:r.comment,markedText:r.markedText??null,anchoredText:r.anchoredText,anchor:r.anchor?.marker??r.anchor?.blockId??null,replies:r.replies??[]}}function Bo(r){return`${r.total} annotation(s): ${r.open} ${wn.open.toLowerCase()}, ${r.review} ${wn.review.toLowerCase()}, ${r.unmatched} unmatched, ${r.resolved} resolved`}function ua(r,e,t){return{id:r.mapping.id,ref:`${r.revision.id}/${r.mapping.id}`,label:jt(r),round:r.revision.ordinal,roundLabel:r.revision.label??null,origin:r.mapping.origin??null,reviewer:r.mapping.reviewer??null,reviewType:r.mapping.reviewType??null,pdfRole:r.pdf?.role??null,sidecar:r.sidecarPath,source:r.adocPath,pdf:r.pdfPath,extraPdfs:(r.extraPdfs??[]).map(n=>n.path),updatedAt:r.updatedAt,default:t,counts:e}}var Qb="eddie-doc";function Op(r,e,t){return["---",`name: ${r}`,`description: ${JSON.stringify(e)}`,"license: MIT","metadata:",` generator: ${Qb}`,` version: "${t}"`,"---",""].join(`
|
|
89
|
+
`)}var sE="Work through an editor's PDF review of an AsciiDoc manuscript with the `eddie` CLI (Eddie Doc): list open remarks, read each in its source context, edit the .adoc, reply, resolve, apply suggested edits and place unmatched marks. Use when the user mentions editor or copyeditor comments, review remarks, an annotated PDF, `.eddie/` folders or `*.review.json` files, or asks to address, answer or resolve review feedback on .adoc files. Do not use for writing new content unrelated to a review.",aE="Rules for editing AsciiDoc (.adoc) files that contain `// eddie:<id>` comment lines placed by Eddie Doc. Use whenever editing, rewriting, reflowing, splitting, reordering or reformatting a .adoc file that contains `// eddie:` lines, so review marks stay attached to the right paragraphs.",oE="Run Eddie Doc's review round-trip from scripts or the terminal: map a newly returned annotated PDF (new round or second reviewer), inspect rounds and mappings, export Markdown review reports, stamp replies into a fresh asciidoctor-pdf render, and gate CI on open remarks. Use when the user asks to import an editor's PDF, start a review round, send a review back, stamp or build reviewed PDFs, or automate Eddie Doc in a build.";function lE(r){return{name:"eddie-review",summary:"Work through an editor's remarks: read, edit, reply, resolve, apply",files:[{path:"SKILL.md",content:Op("eddie-review",sE,r)+`# Working through an editorial review with \`eddie\`
|
|
90
|
+
|
|
91
|
+
An editor marked up a PDF rendered from the user's AsciiDoc source. Eddie Doc
|
|
92
|
+
mapped every mark (highlight, strikeout, comment, insert) onto the source line it
|
|
93
|
+
refers to. Your job is to work through those remarks: change the prose where the
|
|
94
|
+
editor is right, answer where a decision needs explaining, and record what was
|
|
95
|
+
done so the editor sees it.
|
|
96
|
+
|
|
97
|
+
## Before you start
|
|
98
|
+
|
|
99
|
+
1. Check the CLI: \`eddie version\`. If it is missing, use \`npx @eddie-doc/cli\` in
|
|
100
|
+
place of \`eddie\` in every command below, or ask the user to install it
|
|
101
|
+
(\`npm install -g @eddie-doc/cli\`, or from VS Code: *Eddie Doc: Install 'eddie'
|
|
102
|
+
Command in PATH*).
|
|
103
|
+
2. Find what is under review: \`eddie status\` (every reviewed document) or
|
|
104
|
+
\`eddie rounds <file.adoc>\` (one document's rounds and mappings).
|
|
105
|
+
3. If the editor's PDF has not been mapped yet, see the \`eddie-pipeline\` skill
|
|
106
|
+
(\`eddie open <file.adoc> <annotated.pdf>\`).
|
|
107
|
+
|
|
108
|
+
Always pass \`--json\` when you read output, and work on one document at a time.
|
|
109
|
+
|
|
110
|
+
## The loop
|
|
111
|
+
|
|
112
|
+
\`\`\`bash
|
|
113
|
+
# What still needs a decision, in reading order. Each item has a stable "number".
|
|
114
|
+
eddie list ch04.adoc --bucket open,review --json
|
|
115
|
+
|
|
116
|
+
# One remark in full: the editor's comment, the marked words, the source lines
|
|
117
|
+
# it points at ("line"/"endLine", 1-based), and any replies so far.
|
|
118
|
+
eddie show ch04.adoc 7 --json
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
For each remark:
|
|
122
|
+
|
|
123
|
+
1. **Read it in context.** \`show\` gives the line range; read those lines of the
|
|
124
|
+
.adoc (and a little around them) before deciding.
|
|
125
|
+
2. **Decide.**
|
|
126
|
+
- *Agree:* edit the .adoc. Keep every \`// eddie:\` line exactly as it is (see
|
|
127
|
+
the \`eddie-anchors\` skill). Then reply with what you changed and resolve:
|
|
128
|
+
\`eddie reply ch04.adoc 7 "Reworded to 'trust or lineage'."\`
|
|
129
|
+
\`eddie resolve ch04.adoc 7\`
|
|
130
|
+
- *Mechanical edit the editor spelled out* (delete struck words, replace with
|
|
131
|
+
quoted text, insert at a caret): \`eddie fix ch04.adoc 7\` lists the actions,
|
|
132
|
+
\`eddie fix ch04.adoc 7 delete-struck --dry-run\` previews,
|
|
133
|
+
then run it without \`--dry-run\`. It resolves the remark itself.
|
|
134
|
+
- *Disagree or unsure:* do not change the text. Reply with your reasoning and
|
|
135
|
+
leave it open for the author:
|
|
136
|
+
\`eddie reply ch04.adoc 7 "Kept: the term is defined in chapter 2."\`
|
|
137
|
+
- *Needs the author* (a factual claim, a figure, a structural change): reply
|
|
138
|
+
with a question or a proposal, leave it open, and tell the user.
|
|
139
|
+
3. Move on. Re-run \`list\` now and then; numbers never change.
|
|
140
|
+
|
|
141
|
+
### Many mechanical edits at once
|
|
142
|
+
|
|
143
|
+
\`eddie apply ch04.adoc --dry-run\` prints every confident deletion, replacement
|
|
144
|
+
and insertion. Show the plan to the user; run \`eddie apply ch04.adoc --yes\` only
|
|
145
|
+
after they agree. It edits the source and resolves those remarks.
|
|
146
|
+
|
|
147
|
+
### Remarks without a place ("unmatched") or with a doubtful one ("review")
|
|
148
|
+
|
|
149
|
+
- \`eddie triage ch04.adoc --json\` lists ranked candidate lines for each unmatched
|
|
150
|
+
remark. If one clearly fits, link it: \`eddie relink ch04.adoc 12 48\` (line 48).
|
|
151
|
+
- A \`review\` remark is placed but uncertain, or *stale* (its text changed). Read
|
|
152
|
+
the line; if the placement is right, \`eddie confirm ch04.adoc 9\`; if not,
|
|
153
|
+
\`relink\` it.
|
|
154
|
+
- Never guess. If no line fits, leave it and say so.
|
|
155
|
+
|
|
156
|
+
### After editing the source outside a remark
|
|
157
|
+
|
|
158
|
+
\`eddie remap ch04.adoc\` re-matches every round against the current text.
|
|
159
|
+
|
|
160
|
+
## Rules
|
|
161
|
+
|
|
162
|
+
- **Never resolve a remark you did not address.** Resolving means "done"; the
|
|
163
|
+
editor will read it that way.
|
|
164
|
+
- **Reply when you decline, when you change something other than what was
|
|
165
|
+
asked, or when the fix is not obvious.** Replies are written into the PDF that
|
|
166
|
+
goes back to the editor; keep them short, factual and polite.
|
|
167
|
+
- **Do not hand-edit \`*.review.json\`.** Every change goes through \`eddie\`.
|
|
168
|
+
- **Preserve \`// eddie:<id>\` lines** in the .adoc (\`eddie-anchors\` skill).
|
|
169
|
+
- **Ask before \`apply --yes\`, \`delete\`, \`merge\`, \`strip\`** \u2014 they change the
|
|
170
|
+
manuscript or remove review state.
|
|
171
|
+
- A document with several mappings (rounds, or several reviewers): commands use
|
|
172
|
+
the newest unless you pass \`--mapping <id>\` or \`--round N\`; check with
|
|
173
|
+
\`eddie rounds\`.
|
|
174
|
+
- Remarks are numbered per mapping (\`#7\`, shown with the reviewer's initials as
|
|
175
|
+
\`#7 AC\`); use the number, not the id.
|
|
176
|
+
|
|
177
|
+
## Finishing
|
|
178
|
+
|
|
179
|
+
Summarise for the user: how many remarks you resolved, which you answered but
|
|
180
|
+
left open and why, and any you could not place. Then suggest
|
|
181
|
+
\`eddie report <file.adoc>\` (a Markdown report for the editor) and, once the PDF is
|
|
182
|
+
rebuilt, \`eddie stamp\` (see \`eddie-pipeline\`).
|
|
183
|
+
|
|
184
|
+
The full command list is in [references/commands.md](references/commands.md);
|
|
185
|
+
\`eddie help <command>\` prints any command's options.
|
|
186
|
+
`},{path:"references/commands.md",content:cE}]}}function uE(r){return{name:"eddie-anchors",summary:"Keep `// eddie:` markers intact when editing .adoc files",files:[{path:"SKILL.md",content:Op("eddie-anchors",aE,r)+`# Editing an anchored AsciiDoc manuscript
|
|
187
|
+
|
|
188
|
+
Lines like \`// eddie:a3f21c94\` bind an editor's PDF annotation to the block
|
|
189
|
+
below them. They are AsciiDoc comments: Asciidoctor drops them before rendering,
|
|
190
|
+
so they never reach a PDF or a delivered file. They are also the only thing
|
|
191
|
+
keeping each editorial mark attached to the right paragraph. Without them, a
|
|
192
|
+
rewrite silently moves marks to whatever text still resembles the editor's
|
|
193
|
+
original wording. Nothing visible breaks when a marker is lost, which is why
|
|
194
|
+
these rules matter.
|
|
195
|
+
|
|
196
|
+
## Rules
|
|
197
|
+
|
|
198
|
+
- **Rewrite the prose freely.** That is what the anchor is for: the mark stays
|
|
199
|
+
attached however completely the text beneath the marker changes.
|
|
200
|
+
- **Never edit, renumber, reformat or reflow a marker line.** Carry it through
|
|
201
|
+
verbatim, on its own line, including when rewriting a whole file. The line is
|
|
202
|
+
matched strictly: lowercase \`eddie:\`, no space after the colon, a lower-case
|
|
203
|
+
hex id. \`// Eddie: a3f21c94\` is not a marker; tidying the comment destroys the
|
|
204
|
+
anchor.
|
|
205
|
+
- **Keep each marker immediately above its block**, and above any attribute list
|
|
206
|
+
or title attached to that block (\`[#id]\`, \`[source,ruby]\`, \`[NOTE]\`,
|
|
207
|
+
\`.Caption\`), never between an attribute line and its block.
|
|
208
|
+
- **Do not insert a new block between a marker and the block it anchors.** A
|
|
209
|
+
marker binds to the first content line beneath it, so an inserted paragraph
|
|
210
|
+
takes the mark.
|
|
211
|
+
- **Move markers with their block**, as one unit, when reordering.
|
|
212
|
+
- **Splitting a block:** the marker stays with the part the editor's remark is
|
|
213
|
+
about.
|
|
214
|
+
- **Copying a block: delete the copied markers.** An id must appear once per
|
|
215
|
+
file.
|
|
216
|
+
- **Delete a marker only when deleting the paragraph it anchors.** That mark is
|
|
217
|
+
then genuinely homeless, and Eddie Doc will say so.
|
|
218
|
+
- **Several markers may stack above one block** (several marks, or several
|
|
219
|
+
review rounds). Keep the whole stack.
|
|
220
|
+
- **Never add markers by hand.** Eddie Doc writes them when a PDF is mapped;
|
|
221
|
+
\`eddie strip <file.adoc>\` removes them all, only when the user asks.
|
|
222
|
+
|
|
223
|
+
## Example
|
|
224
|
+
|
|
225
|
+
Before:
|
|
226
|
+
|
|
227
|
+
\`\`\`asciidoc
|
|
228
|
+
// eddie:c673e3ed
|
|
229
|
+
[#graph-intro]
|
|
230
|
+
A knowledge graph is a structured representation of information.
|
|
231
|
+
\`\`\`
|
|
232
|
+
|
|
233
|
+
Rewriting the sentence keeps the first two lines untouched:
|
|
234
|
+
|
|
235
|
+
\`\`\`asciidoc
|
|
236
|
+
// eddie:c673e3ed
|
|
237
|
+
[#graph-intro]
|
|
238
|
+
A knowledge graph represents information as entities and the relationships between them.
|
|
239
|
+
\`\`\`
|
|
240
|
+
|
|
241
|
+
## Afterwards
|
|
242
|
+
|
|
243
|
+
If you moved or rewrote anchored text, run \`eddie remap <file.adoc>\` so review
|
|
244
|
+
positions follow the new text. Review state lives in \`*.review.json\` files
|
|
245
|
+
(by default under \`.eddie/\`); it is generated, never hand-edited, and belongs in
|
|
246
|
+
the same commit as the manuscript change.
|
|
247
|
+
`}]}}function dE(r){return{name:"eddie-pipeline",summary:"Map new PDFs, manage rounds, export reports, stamp, automate in CI",files:[{path:"SKILL.md",content:Op("eddie-pipeline",oE,r)+'# Eddie Doc review round-trip\n\nThe cycle: render the AsciiDoc to PDF \u2192 an editor annotates it \u2192 **map** the\nannotated PDF onto the source \u2192 work through the remarks (`eddie-review` skill)\n\u2192 **report** and **stamp** the answers back into a fresh render \u2192 repeat for the\nnext round.\n\nCheck the CLI first: `eddie version` (or use `npx @eddie-doc/cli` instead of\n`eddie`). Settings come from `.vscode/settings.json` (`eddieDoc.*`), `.eddie.json`\nor `EDDIE_DOC_*` variables; `eddie config` shows them and the workspace root.\n\n## Map an annotated PDF\n\n```bash\neddie open ch04.adoc ~/Downloads/ch04-acme.pdf --origin "Acme" --type copyedit\n```\n\n- First PDF for a document: round 1 is created.\n- A second reviewer\'s copy of the **same draft**: run `open` again; it joins the\n current round as another mapping.\n- The editor\'s marks on a **new draft**: add `--new-round`. Resolutions and\n replies carry forward to matching remarks.\n- The same editor sent the chapter again with **more marks**:\n `eddie append ch04.adoc more.pdf` adds only the new ones to the mapping.\n- `open` writes `// eddie:` anchor comments into the .adoc by default (they never\n render). Pass `--no-anchor` if the user does not want the source touched. Tell\n the user the source changed either way.\n- If `open` warns that few annotations mapped, the PDF is probably for another\n file or a much older draft. Check with the user before going on.\n\nInspect: `eddie rounds ch04.adoc`, `eddie rounds` (whole workspace),\n`eddie status`. Label a mapping or round:\n`eddie describe ch04.adoc --round-label "Copyedit" --received 2026-10-01`.\n\n## Send it back\n\n```bash\neddie report ch04.adoc # Markdown report into the round folder\nasciidoctor-pdf -o build/ch04.pdf ch04.adoc\neddie stamp build/ch04.pdf ch04.adoc # marks + replies written into a copy\n```\n\n`stamp` never modifies the clean render; it prints where the stamped PDF went\nand lists any mark it could not place. `--all-in-round` puts every reviewer of the\nround on one PDF. With several reviewers, export one report per mapping\n(`--mapping <id>`).\n\n## Automate\n\n- Everything prints results on stdout and messages on stderr; add `--json` to\n parse. Exit codes: 0 ok, 1 failed, 2 usage error.\n- Commands that change the manuscript or delete review state need `--yes`\n without a terminal. Do not add `--yes` on the user\'s behalf unless they asked.\n- Count open remarks:\n `eddie list ch04.adoc --json | jq \'[.items[] | select(.bucket != "resolved")] | length\'`\n- Stamp every reviewed chapter after a build:\n\n```bash\nfor src in manuscript/*.adoc; do\n name=$(basename "$src" .adoc)\n asciidoctor-pdf -o "build/$name.pdf" "$src"\n eddie rounds "$src" >/dev/null 2>&1 && eddie stamp "build/$name.pdf" "$src" --all-in-round\ndone\n```\n\n## Do not\n\n- Hand-edit `*.review.json` or move files inside `.eddie/`; use `eddie migrate`\n to move old sidecars into the review folder.\n- Run `delete`, `merge` or `strip` without the user\'s go-ahead.\n- Commit the stamped PDF over the clean render.\n\n`eddie help` lists every command; `eddie help <command>` shows its options.\n'}]}}var cE="# eddie command reference\n\nLine numbers are 1-based. `<item>` is a remark number (`7` or `#7`) or an id.\nPer-document commands use the newest mapping unless given `--mapping <id>` or\n`--round N`. Add `--json` to any reading command. `eddie help <command>` has the\nfull options.\n\n## Reviews and rounds\n\n| Command | Does |\n| --- | --- |\n| `eddie open <file.adoc> <annotated.pdf> [--new-round] [--origin O] [--no-anchor]` | Map an annotated PDF onto the source. |\n| `eddie append <file.adoc> <more.pdf>...` | Add more PDFs' marks to the mapping. |\n| `eddie merge <file.adoc> <mapping>... --into <mapping>` | Fold mappings into one (asks first). |\n| `eddie rounds [file.adoc]` | Rounds and mappings of a document, or of the workspace. |\n| `eddie describe <file.adoc> [--label L] [--round-label L] \u2026` | Label a mapping and its round. |\n| `eddie delete <file.adoc> --mapping M` | Delete a mapping's sidecar (asks first). |\n| `eddie remap <file.adoc>` | Re-match every round against the current text. |\n\n## Annotations\n\n| Command | Does |\n| --- | --- |\n| `eddie list <file.adoc> [--bucket open,review,unmatched,resolved] [--text T]` | Remarks grouped Open / Needs review / Unmatched / Resolved. |\n| `eddie show <file.adoc> <item>` | One remark: comment, marked text, source lines, replies. |\n| `eddie resolve <file.adoc> <item>...` / `eddie reopen \u2026` | Mark done / open again. |\n| `eddie confirm <file.adoc> <item>...` | Accept a doubtful or stale placement. |\n| `eddie relink <file.adoc> <item> <line>` | Place a remark on a line by hand. |\n| `eddie remap-item <file.adoc> <item>` | Re-match one remark automatically. |\n| `eddie triage <file.adoc> [-i]` | Candidate lines for unmatched remarks. |\n| `eddie reply <file.adoc> <item> <text>` | Answer a remark (`--edit <id>`, `--delete <id>`). |\n| `eddie preview <file.adoc> <item> [--open]` | The PDF page a remark came from. |\n\n## Editing the source\n\n| Command | Does |\n| --- | --- |\n| `eddie apply <file.adoc> [--dry-run] [--yes]` | Apply every confident delete / replace / insert. |\n| `eddie fix <file.adoc> <item> [action] [--text T]` | One remark's edit: delete-struck, delete-lines, replace-marked, insert-at-mark, insert-note. |\n| `eddie anchor <file.adoc>` | Write `// eddie:` markers for placed remarks. |\n| `eddie strip <file.adoc>` | Remove every marker. |\n\n## Outputs\n\n| Command | Does |\n| --- | --- |\n| `eddie report <file.adoc> [-o out.md]` | Markdown review report. |\n| `eddie stamp <fresh.pdf> <file.adoc> [--all-in-round]` | Write marks and replies into a fresh render. |\n| `eddie extract <annotated.pdf>` | Annotations as standalone AsciiDoc or JSON. |\n| `eddie map <annotated.pdf> <file.adoc>` | Extract and match without saving. |\n\n## Workspace\n\n| Command | Does |\n| --- | --- |\n| `eddie status` | Every reviewed document with open counts. |\n| `eddie tui [file.adoc]` | Full-screen browser (for people, not agents). |\n| `eddie skills [install, list, remove]` | Install these agent skills for Claude Code, Codex, Cursor\u2026 |\n| `eddie folder` / `eddie migrate` / `eddie config` / `eddie version` | Review folder, move old sidecars, settings, version. |\n";function Uo(r){return[lE(r),uE(r),dE(r)]}function Od(r){let e=/^---\r?\n([\s\S]*?)\r?\n---/.exec(r)?.[1];if(!(!e||!new RegExp(`^\\s+generator:\\s*${Qb}\\s*$`,"m").test(e)))return/^\s+version:\s*"?([^"\n]+)"?\s*$/m.exec(e)?.[1]?.trim()??"unknown"}var Xt=[{id:"claude",label:"Claude Code",project:[".claude/skills"],user:[".claude/skills"],detectProject:[".claude","CLAUDE.md"],detectUser:[".claude"]},{id:"codex",label:"OpenAI Codex",project:[".agents/skills"],user:[".agents/skills"],detectProject:["AGENTS.md",".codex"],detectUser:[".codex"]},{id:"cursor",label:"Cursor",project:[".agents/skills",".cursor/skills",".claude/skills",".codex/skills"],user:[".agents/skills",".cursor/skills",".claude/skills",".codex/skills"],detectProject:[".cursor",".cursorrules"],detectUser:[".cursor"]},{id:"gemini",label:"Gemini CLI",project:[".agents/skills",".gemini/skills"],user:[".agents/skills",".gemini/skills"],detectProject:[".gemini","GEMINI.md"],detectUser:[".gemini"]},{id:"copilot",label:"GitHub Copilot",project:[".agents/skills",".github/skills",".claude/skills"],user:[".agents/skills",".copilot/skills"],detectProject:[".github/copilot-instructions.md",".github/skills"],detectUser:[".copilot"]},{id:"other",label:"Other (any tool that reads .agents/skills: OpenCode, Amp, Kiro\u2026)",project:[".agents/skills"],user:[".agents/skills"],detectProject:[],detectUser:[]}],$b=[".agents/skills",".claude/skills"];function Nd(r){let e=Xt.find(t=>t.id===r);if(!e)throw new Error(`unknown tool ${r}`);return e}function ew(r){let e=r.trim().toLowerCase().replace(/[\s_-]+/g,"");return{claude:"claude",claudecode:"claude",codex:"codex",openai:"codex",openaicodex:"codex",cursor:"cursor",gemini:"gemini",geminicli:"gemini",copilot:"copilot",githubcopilot:"copilot",vscode:"copilot",other:"other",agents:"other",opencode:"other",amp:"other",kiro:"other"}[e]}function qo(r,e,t){let n=[...new Set(r)],i=o=>Nd(o)[e],s=[],a=[...n];for(;a.length;){let o=[...new Set(a.flatMap(i))],l=d=>{let c=$b.indexOf(d);return c<0?$b.length:c};o.sort((d,c)=>a.filter(h=>i(h).includes(c)).length-a.filter(h=>i(h).includes(d)).length||l(d)-l(c));let u=o[0];s.push({dir:u,tools:[]}),a=a.filter(d=>!i(d).includes(u))}for(let o of s)o.tools=n.filter(l=>i(l).includes(o.dir));return s.map(o=>({...o,dir:Je(t,o.dir)}))}async function Ld(r,e,t){let n=[];for(let i of Xt){let s=!1;for(let a of i.detectProject)!s&&await r.exists(Je(e,a))&&(s=!0);if(t)for(let a of i.detectUser)!s&&await r.exists(Je(t,a))&&(s=!0);s&&n.push(i.id)}return n}async function Md(r,e){if(await r.exists(e))try{return await r.readText(e)}catch{return}}async function jd(r,e,t,n={}){let i=[];for(let s of e)for(let a of t){let o=Je(s.dir,a.name),l=await Md(r,Je(o,"SKILL.md"));if(l!==void 0&&Od(l)===void 0&&!n.force){i.push({dir:s.dir,skill:a.name,status:"skipped",reason:"a skill with this name exists that Eddie Doc did not write (use force to replace it)"});continue}let u=l!==void 0;if(u){for(let d of a.files)if(await Md(r,Je(o,d.path))!==d.content){u=!1;break}}if(u){i.push({dir:s.dir,skill:a.name,status:"unchanged"});continue}if(!n.dryRun)for(let d of a.files)await r.writeText(Je(o,d.path),d.content);i.push({dir:s.dir,skill:a.name,status:l===void 0?"installed":"updated"})}return i}async function Mp(r,e,t,n={}){let i=[],s=[];for(let a of e)for(let o of t){let l=Je(a.dir,o.name),u=await Md(r,Je(l,"SKILL.md"));if(u!==void 0){if(Od(u)===void 0){s.push(l);continue}for(let d of o.files){let c=Je(l,d.path);await r.exists(c)&&(n.dryRun||await r.remove(c),i.push(c))}}}return{removed:i,skipped:s}}async function zo(r,e,t){let n=[];for(let i of["project","user"]){let s=i==="project"?t.project:t.user;if(s===void 0)continue;let a=[...new Set(Xt.flatMap(o=>o[i]))];for(let o of a){let l=Je(s,o);for(let u of e){let d=await Md(r,Je(l,u.name,"SKILL.md"));d!==void 0&&n.push({dir:l,scope:i,tools:Xt.filter(c=>c[i].includes(o)).map(c=>c.id),skill:u.name,version:Od(d)??"foreign"})}}}return n}var hE={open:"OPEN",review:"REVIEW",unmatched:"UNMATCHED",resolved:"DONE"},fE=[["\u2191 \u2193 j k","move"],["PgUp PgDn g G","page / first / last"],["Enter \u2192","open"],["Esc \u2190 Backspace","back"],["q Ctrl-C","quit"],["S","install agent skills for your AI tools"],["",""],["Annotations",""],["Enter","replies (link it, if unmatched)"],["r","resolve / reopen"],["c","confirm the match"],["a","add a reply"],["e","edit or delete a reply"],["l","link to a line number"],["t","suggest lines and link one (triage)"],["m","re-match automatically"],["f","fix: apply this mark's edit to the source"],["A","apply every confident edit"],["o","open the PDF"],["b","filter by group (cycles)"],["/","search text (empty clears)"],["h","hide / show resolved"],["",""],["Mappings",""],["R","re-map every round of the document"],["p","export the mapping's report"]],Bd=class{constructor(e,t={}){this.ws=e;this.opts=t;let n=t.color??!1,i=s=>a=>n&&a?`\x1B[${s}m${a}\x1B[0m`:a;this.st={bold:i("1"),dim:i("2"),inverse:i("7"),red:i("31"),green:i("32"),yellow:i("33"),cyan:i("36"),magenta:i("35")}}stack=[];input;message="";messageIsError=!1;done=!1;onRedraw;sources=new Map;st;async start(e){e?this.openDoc(await this.ws.requireDoc(e),!0):(await this.ws.loadAll(),this.stack.push({kind:"docs",cursor:0,scroll:0}),this.docs().length===1&&this.openDoc(this.docs()[0].adoc,!0));let t=Uo(rn.version);(await zo(this.ws.storage,t,{project:this.ws.opts.root,user:this.opts.home})).some(i=>i.version!=="foreign")||this.flash("Tip: press S to install agent skills so Claude Code, Codex, Cursor\u2026 know how to use eddie")}flash(e,t=!1){this.message=e.replace(/\s+/g," ").trim(),this.messageIsError=t,this.onRedraw?.()}get hc(){return this.ws.settings.highConfidence}docs(){return this.ws.store.documents().map(e=>{let t=this.ws.store.sessionsFor(e),n=t[t.length-1];return{adoc:e,sessions:t,rounds:this.ws.store.revisionsFor(e).length,counts:n?Er(n.items,this.hc):void 0,updatedAt:t.map(i=>i.updatedAt).sort().pop()??""}}).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}session(e){return this.ws.store.getBySidecar(e.sidecar)}items(e){let t=this.session(e);if(!t)return[];let n=Ad(t.items,{hideResolved:e.hideResolved,buckets:e.bucket?[e.bucket]:[],text:e.text},this.hc),i=s=>aa.indexOf(Wn(s,this.hc));return n.map((s,a)=>({it:s,i:a})).sort((s,a)=>i(s.it)-i(a.it)||s.i-a.i).map(s=>s.it)}current(e){return this.items(e)[e.cursor]}lines(e){let t=this.sources.get(e);if(!t){try{t=(0,Kn.readFileSync)(e,"utf8").split(/\r?\n/)}catch{t=[]}this.sources.set(e,t)}return t}count(e){switch(e.kind){case"docs":return this.docs().length;case"mappings":return this.ws.store.sessionsFor(e.adoc).length;case"items":return this.items(e).length;case"menu":return e.options.length}}rel(e){let t=Xn.relative(this.ws.opts.root,e);return t&&!t.startsWith("..")&&!Xn.isAbsolute(t)?t:e}top(){return this.stack[this.stack.length-1]}openDoc(e,t=!1){let n=this.ws.store.sessionsFor(e);this.stack.push({kind:"mappings",adoc:e,cursor:Math.max(0,n.length-1),scroll:0}),t&&n.length===1&&this.pushItems(e,n[0].sidecarPath)}pushItems(e,t){this.ws.store.setActive(t),this.stack.push({kind:"items",adoc:e,sidecar:t,cursor:0,scroll:0,hideResolved:!this.ws.settings.showResolved})}menu(e,t,n){this.stack.push({kind:"menu",title:e,options:t,detail:n,cursor:0,scroll:0})}back(){this.stack.length>1?this.stack.pop():this.done=!0}ask(e,t,n){this.input={prompt:e,value:t,submit:n}}async key(e){if(e.ctrl&&e.name==="c"){this.done=!0;return}if(this.input)return this.inputKey(e);this.message="";let t=this.top(),n=e.sequence&&e.sequence.length===1&&!e.ctrl?e.sequence:void 0,i=this.count(t),s=10,a=l=>t.cursor=Math.max(0,Math.min(i-1,l));if(e.name==="up"||n==="k")return void a(t.cursor-1);if(e.name==="down"||n==="j")return void a(t.cursor+1);if(e.name==="pageup")return void a(t.cursor-s);if(e.name==="pagedown")return void a(t.cursor+s);if(e.name==="home"||n==="g")return void a(0);if(e.name==="end"||n==="G")return void a(i-1);if(e.name==="escape"||e.name==="left"||e.name==="backspace")return this.back();if(n==="q"){this.done=!0;return}if(n==="?")return this.menu("Keys",fE.map(([l,u])=>({label:l?`${l.padEnd(18)} ${u}`:u||""})));if(n==="S")return this.skillsFlow();let o=e.name==="return"||e.name==="enter"||e.name==="right";switch(t.kind){case"docs":{let l=this.docs()[t.cursor];o&&l&&this.openDoc(l.adoc);return}case"mappings":return this.mappingsKey(t,n,o);case"items":return this.itemsKey(t,n,o);case"menu":{let l=t.options[t.cursor];if((o||e.name==="space")&&l?.checked!==void 0){l.checked=!l.checked;return}o&&l?.run?(this.stack.pop(),await l.run()):o&&this.stack.pop();return}}}async inputKey(e){let t=this.input;if(e.name==="escape"){this.input=void 0;return}if(e.name==="return"||e.name==="enter"){this.input=void 0,await t.submit(t.value);return}if(e.name==="backspace"){t.value=t.value.slice(0,-1);return}if(e.ctrl&&e.name==="u"){t.value="";return}let n=e.sequence??"";!e.ctrl&&!e.meta&&n&&!pE(n)&&(t.value+=n)}async mappingsKey(e,t,n){let i=this.ws.store.sessionsFor(e.adoc)[e.cursor];if(i){if(n)return this.pushItems(e.adoc,i.sidecarPath);if(t==="R"){this.flash("re-mapping\u2026");let s=await this.ws.store.remapAll(e.adoc,this.ws.settings.matchThreshold);await this.ws.store.flush(),this.sources.delete(e.adoc),this.flash(`re-mapped ${s} mapping(s)`)}if(t==="p"){let s=await xd(this.ws,i);this.flash(`report written: ${this.rel(s)}`)}}}async itemsKey(e,t,n){let i=this.ws.store;i.setActive(e.sidecar);let s=this.current(e),a=async o=>{await i.flush();let l=s?this.items(e).findIndex(u=>u.id===s.id):-1;l>=0&&(e.cursor=l),e.cursor=Math.max(0,Math.min(e.cursor,this.items(e).length-1)),this.flash(o)};if(t==="b"){let o=[void 0,...aa];return e.bucket=o[(o.indexOf(e.bucket)+1)%o.length],e.cursor=0,this.flash(e.bucket?`showing ${wn[e.bucket]}`:"showing all groups")}if(t==="h")return e.hideResolved=!e.hideResolved,e.cursor=0,this.flash(e.hideResolved?"resolved hidden":"resolved shown");if(t==="/")return this.ask("Search: ",e.text??"",o=>{e.text=o.trim()||void 0,e.cursor=0});if(t==="A")return this.applyAll(e);if(s){if(n)return Gn(s)?this.replyMenu(e,s):this.triageMenu(e,s);switch(t){case"r":return i.toggleResolved(e.adoc,s.id),a(`${Ue(s)} ${s.resolved?"resolved":"reopened"}`);case"c":return i.confirmMatch(e.adoc,s.id),a(`${Ue(s)} confirmed`);case"a":return this.replyPrompt(e,s);case"e":return this.replyMenu(e,s);case"l":{let o=this.lines(e.adoc).length;return this.ask(`Link ${Ue(s)} to line (1-${o}): `,String(Cr(s)??""),async l=>{let u=Number(l);if(!Number.isInteger(u)||u<1||u>o)return this.flash(`not a line number: ${l}`,!0);i.setActive(e.sidecar),i.relink(e.adoc,s.id,u-1),await a(`${Ue(s)} \u2192 line ${u}`)})}case"m":await i.remapItem(e.adoc,s.id,this.ws.settings.matchThreshold);{let o=i.findItem(e.adoc,s.id);return a(o&&Cr(o)!=null&&!o.stale?`${Ue(s)} \u2192 line ${Cr(o)}`:`${Ue(s)}: no confident match \u2014 press t or l`)}case"t":return this.triageMenu(e,s);case"f":return this.fixMenu(e,s);case"o":{let o=this.session(e);if(!o)return;let l=Ro(o,s);return(this.opts.open??Lo)(l),this.flash(`opened ${Xn.basename(l)} \u2014 page ${s.page}`)}}}}async skillsFlow(){let e=this.ws.opts.root,t=await Ld(this.ws.storage,e,this.opts.home),n=Xt.map(a=>({label:a.label,hint:t.includes(a.id)?"found here":void 0,checked:t.includes(a.id)}));t.length||(n[0].checked=!0);let i=()=>Xt.filter((a,o)=>n[o].checked).map(a=>a.id),s=async a=>{let o=i(),l=a==="project"?e:this.opts.home,u=qo(o,a,l),d=await jd(this.ws.storage,u,Uo(rn.version)),c=d.filter(p=>p.status==="installed"||p.status==="updated").length,h=d.filter(p=>p.status==="skipped").length,f=u.map(p=>a==="project"?this.rel(p.dir):"~/"+Xn.relative(l,p.dir)).join(", ");this.flash(`skills ${c?`installed/updated (${c})`:"already up to date"} in ${f}`+(h?` \xB7 ${h} skipped: a skill of that name is not Eddie's`:""),h>0)};this.menu("Which AI coding tools do you use?",[...n,{label:"Continue \u2192",run:()=>{if(!i().length)return this.flash("tick at least one tool",!0);let a=[{label:`This project \u2014 ${e}`,hint:"commit it so collaborators get it",run:()=>s("project")}];this.opts.home&&a.push({label:`My user account \u2014 ${this.opts.home}`,hint:"every project on this machine",run:()=>s("user")}),this.menu("Install the skills for\u2026",a)}}],[[["Eddie installs three skills: eddie-review, eddie-anchors, eddie-pipeline.",this.st.dim]],[["Claude Code reads .claude/skills; Codex, Gemini, Cursor, Copilot share .agents/skills.",this.st.dim]]])}replyPrompt(e,t){this.ask(`Reply to ${Ue(t)}: `,"",async n=>{n.trim()&&(this.ws.store.setActive(e.sidecar),this.ws.store.addReply(e.adoc,t.id,this.ws.authorName(),n),await this.ws.store.flush(),this.flash("reply added"))})}replyMenu(e,t){let n=t.replies??[];this.menu(`Replies on ${Ue(t)}`,[{label:"Add a reply\u2026",run:()=>this.replyPrompt(e,t)}].concat(n.flatMap(i=>[{label:`Edit ${i.author}: ${i.body.replace(/\s+/g," ")}`,run:()=>this.ask("Edit reply: ",i.body,async s=>{s.trim()&&(this.ws.store.setActive(e.sidecar),this.ws.store.editReply(e.adoc,t.id,i.id,s),await this.ws.store.flush(),this.flash("reply edited"))})},{label:`Delete ${i.author}: ${i.body.replace(/\s+/g," ")}`,run:()=>this.menu("Delete this reply?",[{label:"Yes, delete it",run:async()=>{this.ws.store.setActive(e.sidecar),this.ws.store.deleteReply(e.adoc,t.id,i.id),await this.ws.store.flush(),this.flash("reply deleted")}},{label:"Cancel"}])}])),this.itemDetail(e,t,200))}triageMenu(e,t){let n=this.lines(e.adoc),i=wi(n.join(`
|
|
248
|
+
`)),s=nd(t.anchoredText||t.comment||"",i,9);if(!s.length)return this.flash("no candidate lines \u2014 press l to link by number");this.menu(`Link ${Ue(t)} to\u2026`,s.map(a=>({label:`L${String(a.startLine+1).padEnd(5)} ${a.score.toFixed(2)} ${n[a.startLine]?.trim()??""}`,run:async()=>{this.ws.store.setActive(e.sidecar),this.ws.store.relink(e.adoc,t.id,a.startLine),await this.ws.store.flush(),this.flash(`${Ue(t)} \u2192 line ${a.startLine+1}`)}})),this.itemDetail(e,t,200).slice(0,4))}fixMenu(e,t){let n=Rd(t,Gn(t));if(!n.length)return this.flash(Gn(t)?"no edit for this mark":"unmatched \u2014 link it first");this.menu(`Fix ${Ue(t)}`,n.map(i=>({label:i.label,run:()=>{if(!i.needsText)return this.confirmFix(e,t,i,"");this.ask(`${i.label.replace(/…$/,"")}: `,oa(t.comment||""),s=>s.trim()?this.confirmFix(e,t,i,s):void 0)}})))}planFix(e,t,n,i){switch(n.action){case"delete-struck":return Dd(e,t);case"delete-lines":return Ed(e,t);case"insert-note":return kd(e,t);case"replace-marked":return Cd(e,t,i);case"insert-at-mark":return Td(e,t,i)}}confirmFix(e,t,n,i){let s=(0,Kn.readFileSync)(e.adoc,"utf8"),a=this.planFix(s,t,n,i);if(!a)return this.flash("could not locate the marked text precisely \u2014 edit it by hand",!0);let o=s.slice(a.from,a.to);this.menu(`${n.label.replace(/…$/,"")} in ${Xn.basename(e.adoc)}?`,[{label:"Apply",run:async()=>{(0,Kn.writeFileSync)(e.adoc,la((0,Kn.readFileSync)(e.adoc,"utf8"),[a]),"utf8");let l=this.ws.store;l.setActive(e.sidecar),n.action!=="insert-note"&&!t.resolved&&l.toggleResolved(e.adoc,t.id),await l.remapAll(e.adoc,this.ws.settings.matchThreshold,{onlyIfSourceChanged:!0}),await l.flush(),this.sources.delete(e.adoc),this.flash(`${Ue(t)}: applied`)}},{label:"Cancel"}],[[["- ",this.st.red],[JSON.stringify(o),this.st.red]],[["+ ",this.st.green],[JSON.stringify(a.insert),this.st.green]]])}applyAll(e){let t=this.session(e);if(!t)return;let n=(0,Kn.readFileSync)(e.adoc,"utf8"),i=_d(n,t.items,s=>Vn(s,this.hc));if(!i.length)return this.flash("no confident edits to apply");if(Id(i.map(s=>s.edit)))return this.flash("edits overlap \u2014 apply them one at a time with f",!0);this.menu(`Apply ${i.length} edit(s) to ${Xn.basename(e.adoc)}?`,[{label:`Apply all ${i.length}`,run:async()=>{(0,Kn.writeFileSync)(e.adoc,la((0,Kn.readFileSync)(e.adoc,"utf8"),i.map(a=>a.edit)),"utf8");let s=this.ws.store;s.setActive(e.sidecar);for(let a of i)s.toggleResolved(e.adoc,a.id);await s.remapAll(e.adoc,this.ws.settings.matchThreshold,{onlyIfSourceChanged:!0}),await s.flush(),this.sources.delete(e.adoc),this.flash(`applied ${i.length} edit(s)`)}},{label:"Cancel"}],i.map((s,a)=>[[`${String(a+1).padStart(3)}. ${s.label}`]]))}render(e,t){let n=this.top(),i=[],s=` eddie \xB7 ${this.breadcrumb()}`;i.push(this.st.inverse(da(s.length>e?"\u2026"+s.slice(s.length-e+1):s,e)));let a=Math.max(1,t-2),o=this.detail(n,e),l=a;if(o.length){let c=n.kind==="items"?.5:.35,h=Math.min(o.length+1,Math.max(3,Math.floor(a*c)));l=Math.max(1,a-h)}let u=this.count(n);n.cursor=Math.max(0,Math.min(n.cursor,u-1)),n.cursor<n.scroll&&(n.scroll=n.cursor),n.cursor>=n.scroll+l&&(n.scroll=n.cursor-l+1),n.scroll=Math.max(0,Math.min(n.scroll,Math.max(0,u-l)));let d=this.rows(n);for(let c=0;c<l;c++){let h=n.scroll+c,f=d[h];if(!f){i.push(c===0&&u===0?this.st.dim(da(` ${this.emptyText(n)}`,e)):"");continue}i.push(h===n.cursor?this.st.inverse(da(`\u203A ${nw(f)}`,e)):tw([[" "],...f],e))}if(o.length){i.push(this.st.dim("\u2500".repeat(e)));for(let c of o.slice(0,a-l-1))i.push(tw(c,e));for(;i.length<t-1;)i.push("")}return i.push(this.footer(e)),i.slice(0,t)}breadcrumb(){let e=[];for(let t of this.stack){if(t.kind==="docs"&&e.push("workspace"),t.kind==="mappings"&&e.push(this.rel(t.adoc)),t.kind==="items"){let n=this.session(t);n&&e.push(`${zn(n.revision)} \xB7 ${jt(n)}`);let i=[t.bucket?wn[t.bucket]:"",t.text?`"${t.text}"`:"",t.hideResolved?"resolved hidden":""].filter(Boolean).join(", ");i&&e.push(`[${i}]`)}t.kind==="menu"&&e.push(t.title)}return e.join(" \u203A ")}emptyText(e){return e.kind==="docs"?"No reviews in this workspace. Map one with: eddie open <source.adoc> <annotated.pdf>":e.kind==="items"?"No annotations match. Press b, h or / to change the filter.":"Nothing here."}footer(e){if(this.input)return da(`${this.input.prompt}${this.input.value}\u2588`,e);if(this.message)return(this.messageIsError?this.st.red:this.st.cyan)(da(` ${this.message}`,e));let t=this.top(),n=t.kind==="items"?"r resolve c confirm a reply l link t triage f fix o pdf b group / search ? keys \u2190 back":t.kind==="mappings"?"Enter annotations R re-map p report ? keys \u2190 back q quit":t.kind==="menu"?t.options.some(i=>i.checked!==void 0)?"Space/Enter tick \u2193 Continue Esc cancel":"Enter choose Esc cancel":"Enter open ? keys q quit";return this.st.dim(da(` ${n}`,e))}countsSegs(e){return e?[[`${e.open} open`,this.st.green],[" \xB7 "],[`${e.review} review`,this.st.yellow],[" \xB7 "],[`${e.unmatched} unmatched`,this.st.red],[" \xB7 "],[`${e.resolved} done`,this.st.dim]]:[]}rows(e){switch(e.kind){case"docs":return this.docs().map(t=>[[this.rel(t.adoc).padEnd(36),this.st.bold],[` ${t.rounds} round(s) `,this.st.dim],...this.countsSegs(t.counts)]);case"mappings":{let t=this.ws.store.sessionsFor(e.adoc);return t.map((n,i)=>[[i===t.length-1?"* ":" ",this.st.yellow],[`${n.revision.id}/${n.mapping.id}`.padEnd(30)],[` ${jt(n)}`.padEnd(22),this.st.bold],...this.countsSegs(Er(n.items,this.hc))])}case"items":return this.items(e).map(t=>{let n=Wn(t,this.hc),i=Cr(t);return[[Ue(t).padEnd(8)],[hE[n].padEnd(10),this.bucketStyle(n)],[bt[t.kind].padEnd(10),this.st.magenta],[(i==null?"\u2014":`L${i}`).padEnd(7),this.st.dim],[Np(t.comment||t.markedText||t.anchoredText)],[t.replies?.length?` \u21B3${t.replies.length}`:"",this.st.cyan]]});case"menu":return e.options.map(t=>[[t.checked===void 0?"":t.checked?"[x] ":"[ ] ",this.st.green],[t.label],[t.hint?` ${t.hint}`:"",this.st.dim]])}}bucketStyle(e){return e==="open"?this.st.green:e==="review"?this.st.yellow:e==="unmatched"?this.st.red:this.st.dim}detail(e,t){if(e.kind==="menu")return e.detail??[];if(e.kind==="mappings"){let n=this.ws.store.sessionsFor(e.adoc)[e.cursor];if(!n)return[];let i=[n.mapping.origin,n.mapping.reviewer,n.mapping.reviewType].filter(Boolean).join(" \xB7 ");return[[[`${zn(n.revision)} \xB7 ${jt(n)}`,this.st.bold],[i?` ${i}`:"",this.st.dim]],[["sidecar ",this.st.dim],[this.rel(n.sidecarPath)]],[["pdf ",this.st.dim],[this.rel(n.pdfPath)],[n.extraPdfs?.length?` +${n.extraPdfs.length} more`:""]],[["updated ",this.st.dim],[n.updatedAt.slice(0,16).replace("T"," ")]],...n.revision.note?[[["note ",this.st.dim],[n.revision.note]]]:[]]}if(e.kind==="items"){let n=this.current(e);return n?this.itemDetail(e,n,t):[]}return[]}itemDetail(e,t,n){let i=Wn(t,this.hc),s=Cr(t),a=s==null?"unmatched":t.manualLine!=null?`line ${s}, linked by hand`:`line ${s}, ${t.match?.method??"fuzzy"} ${t.match?.score.toFixed(2)}`,o=[[[`${Ue(t)} `,this.st.bold],[`${bt[t.kind]} `,this.st.magenta],[`${wn[i]}`,this.bucketStyle(i)],[` page ${t.page} \xB7 ${a}${t.confirmed?" \xB7 confirmed":""}${t.stale?" \xB7 STALE":""}`,this.st.dim]]],l=Math.max(20,n-4),u=(d,c,h)=>{c?.trim()&&rw(Np(c),l-d.length).forEach((f,p)=>o.push([[p?" ".repeat(d.length):d,this.st.dim],[f,h]]))};if(u(`${t.author??"Editor"}: `,t.comment),u("marked: ",t.markedText||t.anchoredText,this.st.yellow),s!=null){let d=this.lines(e.adoc),c=t.manualLine!=null?s:(t.match?.endLine??s-1)+1;for(let h=Math.max(1,s-1);h<=Math.min(d.length,c+1);h++){let f=h>=s&&h<=c;o.push([[`${f?"\u258C":" "}${String(h).padStart(5)} \u2502 `,this.st.dim],[d[h-1]??"",f?void 0:this.st.dim]])}}for(let d of t.replies??[]){o.push([[` \u21B3 ${d.author} \xB7 ${d.createdAt.slice(0,10)}`,this.st.cyan]]);for(let c of rw(Np(d.body),l-4))o.push([[" "],[c]])}return o}};function Np(r){return(r??"").replace(/\s+/g," ").trim()}function da(r,e){if(e<=0)return"";let t=r.replace(/[\r\n\t]/g," ");return t.length>e?t.slice(0,e-1)+"\u2026":t.padEnd(e)}function nw(r){return r.map(([e])=>e).join("")}function tw(r,e){let t=e,n="",i=nw(r).length;for(let[s,a]of r){if(t<=0)break;let o=s.replace(/[\r\n\t]/g," ");(o.length>t||o.length===t&&i>e)&&(o=o.slice(0,Math.max(0,t-1))+"\u2026"),t-=o.length,n+=a?a(o):o}return n}function rw(r,e){let t=Math.max(10,e),n=[],i="";for(let s of r.split(" "))for(i?i.length+1+s.length<=t?i+=" "+s:(n.push(i),i=s):i=s;i.length>t;)n.push(i.slice(0,t)),i=i.slice(t);return i&&n.push(i),n}function pE(r){for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);if(t<32||t===127)return!0}return!1}var iw=require("node:readline");function sw(r){let{stdin:e,stdout:t}=process;(0,iw.emitKeypressEvents)(e),e.setRawMode(!0),e.resume(),t.write("\x1B[?1049h\x1B[?25l");let n=()=>{let i=t.rows||24,s=t.columns||80,a=r.render(s,i);t.write("\x1B[H"+a.map(o=>o+"\x1B[K").join(`\r
|
|
249
|
+
`)+"\x1B[J")};return r.onRedraw=n,new Promise(i=>{let s=Promise.resolve(),a=!1,o=()=>{a||(a=!0,e.off("keypress",u),t.off("resize",n),process.off("exit",l),l(),e.pause(),i())},l=()=>{try{e.setRawMode(!1)}catch{}t.write("\x1B[?25h\x1B[?1049l")},u=(d,c)=>{s=s.then(async()=>{if(!a){try{await r.key(c??{sequence:d})}catch(h){r.flash(String(h?.message??h),!0)}r.done?o():n()}})};e.on("keypress",u),t.on("resize",n),process.on("exit",l),n()})}var ow=jr(require("node:os")),Pi=jr(require("node:path"));var ca=new Ks;function gE(r){return Pi.resolve(Ee(r.args,"home")??ow.homedir())}function aw(r){if(ke(r.args,"user"))return"user";if(ke(r.args,"project"))return"project";let e=Ee(r.args,"scope");if(e!==void 0){if(e!=="project"&&e!=="user")throw new pe("--scope must be project or user");return e}}function Lp(r){if(ke(r.args,"all"))return Xt.map(t=>t.id);let e=To(r.args,"tool");if(e.length)return e.map(t=>{let n=ew(t);if(!n)throw new pe(`unknown tool "${t}" \u2014 one of: ${Xt.map(i=>i.id).join(", ")}`);return n})}async function mE(r,e){r.io.note("Which AI coding tools do you use? Eddie's skills will be installed where each one looks."),Xt.forEach((n,i)=>r.io.note(` ${i+1}) ${n.label}${e.includes(n.id)?" (found here)":""}`));let t=e.length?e.map(n=>Xt.findIndex(i=>i.id===n)+1).join(","):"1";for(;;){let n=await r.io.ask(`Numbers separated by commas, or "a" for all [${t}]: `)||t;if(/^a(ll)?$/i.test(n))return Xt.map(s=>s.id);let i=n.split(/[\s,]+/).filter(Boolean).map(Number);if(i.length&&i.every(s=>Number.isInteger(s)&&s>=1&&s<=Xt.length))return[...new Set(i.map(s=>Xt[s-1].id))];r.io.note(" ? answer with numbers from the list, e.g. 1,3")}}async function vE(r,e,t){for(r.io.note("Install for:"),r.io.note(` p) this project \u2014 ${e} (commit them so collaborators get them)`),r.io.note(` u) your user account \u2014 ${t} (every project on this machine)`);;){let n=(await r.io.ask("p or u [p]: ")||"p").toLowerCase();if(n==="p"||n==="project")return"project";if(n==="u"||n==="user")return"user"}}function yE(r,e){let t=[];for(let n of[...new Set(r.map(i=>i.dir))]){let i=r.filter(s=>s.dir===n);t.push(`${e(n)}`);for(let s of i)t.push(` ${s.status.padEnd(9)} ${s.skill}${s.reason?` \u2014 ${s.reason}`:""}`)}return t}var lw={name:"skills",group:"Workspace",summary:"Install the agent skills that teach Claude Code, Codex, Cursor\u2026 to use eddie",usage:`skills [install] [--tool claude,codex,cursor,gemini,copilot,other | --all] [--scope project|user]
|
|
250
|
+
[--force] [--dry-run]
|
|
251
|
+
skills list [--json]
|
|
252
|
+
skills remove [--tool \u2026] [--scope project|user] [--yes]
|
|
253
|
+
skills show <eddie-review|eddie-anchors|eddie-pipeline>`,details:`Three skills: eddie-review (work through an editor's remarks), eddie-anchors (keep
|
|
254
|
+
// eddie: markers intact when editing .adoc) and eddie-pipeline (map PDFs, rounds,
|
|
255
|
+
reports, stamping, CI). Without --tool, a terminal is asked which tools you use, with
|
|
256
|
+
the ones found in the project preselected; in a script the detected tools are used.
|
|
257
|
+
Each tool's folder: Claude Code .claude/skills; Codex, Gemini CLI, Cursor, Copilot and
|
|
258
|
+
others share .agents/skills. The fewest folders that reach every chosen tool are used.
|
|
259
|
+
Project scope writes under the workspace root, user scope under your home (--home).
|
|
260
|
+
A skill folder Eddie Doc did not write is never replaced (unless --force) or removed.`,spec:{values:["tool","scope","home"]},async run(r){let[e="install",t]=r.args.positional,n=rn.version,i=Uo(n),s=r.root(),a=gE(r),o=f=>{let p=Pi.relative(process.cwd(),f);if(p&&!p.startsWith("..")&&!Pi.isAbsolute(p))return p;let g=Pi.relative(a,f);return g&&!g.startsWith("..")&&!Pi.isAbsolute(g)?`~/${g}`:f};if(e==="show"){let f=i.find(p=>p.name===t);if(!f)throw new pe(`skills show needs one of: ${i.map(p=>p.name).join(", ")}`);return r.io.out(f.files[0].content),0}if(e==="list"){let f=await zo(ca,i,{project:s,user:a});if(r.json)return r.io.out(JSON.stringify({version:n,skills:i.map(p=>({name:p.name,summary:p.summary})),installed:f},null,2)),0;r.io.out(`Eddie Doc ${n} ships:`);for(let p of i)r.io.out(` ${p.name.padEnd(16)} ${p.summary}`);if(r.io.out(""),!f.length)return r.io.out("Not installed anywhere yet \u2014 run: eddie skills"),0;for(let p of[...new Set(f.map(g=>g.dir))]){let g=f.filter(m=>m.dir===p),v=g[0].tools.map(m=>Nd(m).label.replace(/ \(.*/,"")).join(", ");r.io.out(`${o(p)} (${g[0].scope}; read by ${v})`);for(let m of g){let y=m.version==="foreign"?"not Eddie's \u2014 left alone":m.version===n?`v${m.version}`:`v${m.version}, outdated \u2014 run: eddie skills`;r.io.out(` ${m.skill.padEnd(16)} ${y}`)}}return 0}if(e==="remove"||e==="uninstall"){let f=Lp(r),p=aw(r),g;if(f)g=(p?[p]:["project","user"]).flatMap(y=>qo(f,y,y==="project"?s:a));else{let y=(await zo(ca,i,{project:s,user:a})).filter(w=>w.version!=="foreign"&&(!p||w.scope===p));g=[...new Set(y.map(w=>w.dir))].map(w=>({dir:w,tools:[]}))}let v=await Mp(ca,g,i,{dryRun:!0});if(!v.removed.length)return r.io.out("no Eddie Doc skills to remove"),0;for(let y of v.removed)r.io.note(` ${o(y)}`);if(r.dryRun)return r.io.out(`would remove ${v.removed.length} file(s)`),0;if(!r.yes){if(!r.io.interactive)throw new Qe("remove asks first \u2014 pass --yes in a script");if(!/^y(es)?$/i.test(await r.io.ask(`Remove ${v.removed.length} file(s)? [y/N] `)))return 1}let m=await Mp(ca,g,i);return Gb(m.removed),r.io.out(`removed ${m.removed.length} file(s)`),0}if(e!=="install")throw new pe(`unknown subcommand "${e}" \u2014 install, list, remove or show`);let l=await Ld(ca,s,a),u=Lp(r),d=aw(r);if(!u)if(r.io.interactive&&!r.json)u=await mE(r,l);else if(l.length)u=l,r.io.note(`no --tool given; using the tools found here: ${l.join(", ")}`);else throw new pe(`which tools? pass --tool ${Xt.map(f=>f.id).join(",")} (or --all)`);d||(d=r.io.interactive&&!r.json&&!Lp(r)?await vE(r,s,a):"project");let c=qo(u,d,d==="project"?s:a),h=await jd(ca,c,i,{force:ke(r.args,"force"),dryRun:r.dryRun});if(r.json)r.io.out(JSON.stringify({version:n,scope:d,tools:u,targets:c,outcomes:h},null,2));else{for(let f of yE(h,o))r.io.out(r.dryRun?`(dry run) ${f}`:f);for(let f of c)r.io.note(` ${o(f.dir)} is read by ${f.tools.map(p=>Nd(p).label.replace(/ \(.*/,"")).join(", ")}`);d==="project"&&!r.dryRun&&r.io.note("Commit these folders so everyone on the project gets the skills.")}return h.some(f=>f.status==="skipped")?1:0}};function bE(r){return/[\p{L}\p{N}]/u.test(r)}function wE(r,e){let t=e.box.y1-r.box.y1;return Math.abs(t)>4?t:r.box.x0-e.box.x0}function dw(r){return{pages:r.map(e=>{let t=[...e.texts].sort(wE),n=[],i=[],s=[],a=!0;for(let o=0;o<t.length;o++){let l=t[o].str,u=/[\p{L}]-$/u.test(l),d=u?l.length-1:l.length;for(let c=0;c<d;c++){let h=l[c];bE(h)?(n.push(h.toLowerCase()),i.push(o),s.push(c),a=!1):a||(n.push(" "),i.push(o),s.push(c),a=!0)}!u&&!a&&(n.push(" "),i.push(o),s.push(Math.max(0,d-1)),a=!0)}for(;n.length&&n[n.length-1]===" ";)n.pop(),i.pop(),s.pop();return{page:e.page,runs:t,norm:n.join(""),runOf:i,offOf:s}})}}var xE=120;function AE(r,e,t){let n=0;for(;n<t.length&&e+n<r.length&&r[e+n]===t[n];)n++;return n}function SE(r,e){if(r.length<=e)return r;let t=r.slice(0,e),n=t.lastIndexOf(" ");return n>e/2?t.slice(0,n):t}function jp(r,e,t={}){let n=t.minScore??.9,i=t.limit??5,s=bn(r);if(!s)return[];let a=SE(s,t.probeChars??xE),o=t.page?e.pages.filter(u=>u.page===t.page):e.pages,l=[];for(let u of o){if(!u.norm)continue;let d=0;for(;;){let c=u.norm.indexOf(a,d);if(c<0)break;let h=Math.max(a.length,AE(u.norm,c,s)),f=cw(u,c,c+h-1,1);if(f&&l.push(f),d=c+1,l.length>=i*4)break}}if(l.length)return l.sort((u,d)=>uw(d)-uw(u)),l.slice(0,i);for(let u of o){let d=PE(u,a,n);d&&l.push(d)}return l.sort((u,d)=>d.score-u.score),l.slice(0,i)}function uw(r){let e=0;for(let t=0;t+7<r.quadPoints.length;t+=8)e+=Math.abs(r.quadPoints[t+2]-r.quadPoints[t]);return e}function PE(r,e,t){let n=e.length;if(r.norm.length<n)return null;let i=-1,s=0;for(let a=0;a+n<=r.norm.length;a++){let o=0;for(let u=0;u<n;u++)r.norm[a+u]===e[u]&&o++;let l=o/n;if(l>s&&(s=l,i=a,l===1))break}return i<0||s<t?null:cw(r,i,i+n-1,s)}function cw(r,e,t,n){if(e>t)return null;let i=new Map;for(let d=e;d<=t;d++){let c=r.runOf[d],h=r.offOf[d];if(c===void 0)continue;let f=i.get(c);f?(h<f.lo&&(f.lo=h),h>f.hi&&(f.hi=h)):i.set(c,{lo:h,hi:h})}if(!i.size)return null;let s=[],a=1/0,o=1/0,l=-1/0,u=-1/0;for(let[d,c]of[...i.entries()].sort((h,f)=>h[0]-f[0])){let h=r.runs[d],f=h.box,p=h.str.length||1,g=(f.x1-f.x0)/p,v=f.x0+c.lo*g,m=f.x0+(c.hi+1)*g,y=FE({x0:v,y0:f.y0,x1:m,y1:f.y1},f);s.push(y.x0,y.y1,y.x1,y.y1,y.x0,y.y0,y.x1,y.y0),a=Math.min(a,y.x0),o=Math.min(o,y.y0),l=Math.max(l,y.x1),u=Math.max(u,y.y1)}return{page:r.page,rect:[a,o,l,u],quadPoints:s,score:n}}function FE(r,e){return{x0:Math.max(e.x0,Math.min(r.x0,e.x1)),x1:Math.max(e.x0,Math.min(r.x1,e.x1)),y0:e.y0,y1:e.y1}}var hw=Number.MAX_SAFE_INTEGER;function DE(r,e){let t=ht(r);if(t===hw||t>=e.length)return"";let n=r.manualLine!=null?t:Math.min(r.match?.endLine??t,e.length-1);return e.slice(t,Math.max(t,n)+1).join(" ")}function fw(r,e,t,n={}){let i=dw(t),s=e.split(/\r?\n/),a=n.minScore??.9,o=[],l=[];for(let u of r){let d=EE(u,s,i,n,a);"reason"in d?l.push({item:u,reason:d.reason}):o.push(d)}return o.sort((u,d)=>u.hit.page-d.hit.page||d.hit.rect[3]-u.hit.rect[3]),{anchored:o,unstamped:l}}function EE(r,e,t,n,i){let s=r.anchor?.blockId;if(s&&n.destinations?.has(s)){let d=n.destinations.get(s);return{item:r,hit:TE(d),precision:"block"}}let a=DE(r,e);if(!a.trim())return{reason:ht(r)===hw?"no source location \u2014 triage it in the editor first":"the source lines it points at are empty"};let l=jp(a,t,{minScore:i})[0];if(!l)return{reason:"current source text not found in the rendered PDF"};if(l.score<i)return{reason:`weak match (${l.score.toFixed(2)}) \u2014 the anchor looks stale`};let u=r.markedText?.trim();if(u&&CE(r)&&jo(u,a,.9)){let c=jp(u,t,{minScore:i,page:l.page});if(c[0]&&c[0].score>=i)return{item:r,hit:c[0],precision:"exact"}}return{item:r,hit:l,precision:"line"}}function CE(r){return r.kind==="strikeout"||r.kind==="highlight"||r.kind==="underline"||r.kind==="replace"}function TE(r){let n=r.y-12,i=r.y;return{page:r.page,rect:[48,n,564,i],quadPoints:[48,i,564,i,48,n,564,n],score:1}}var Qt=jr(FP());var DP={highlight:[1,.86,.2],strikeout:[.94,.35,.33],underline:[.3,.62,.95],comment:[1,.78,.36],insert:[.42,.78,.45],replace:[.85,.5,.9],other:[.75,.75,.78]};function ry(r){switch(r){case"highlight":return"Highlight";case"strikeout":case"replace":return"StrikeOut";case"underline":return"Underline";case"insert":return"Caret";default:return"Text"}}function EP(r){let e=new Date(r),t=Number.isNaN(e.getTime())?new Date(0):e,n=(i,s=2)=>String(i).padStart(s,"0");return`D:${t.getUTCFullYear()}${n(t.getUTCMonth()+1)}${n(t.getUTCDate())}${n(t.getUTCHours())}${n(t.getUTCMinutes())}${n(t.getUTCSeconds())}Z`}function ao(r){return Ij(r)?Qt.PDFString.of(r):Qt.PDFHexString.fromText(r)}function Ij(r){for(let e=0;e<r.length;e++)if(r.charCodeAt(e)>255)return!1;return!0}var CP=16;function Oj(r){let e=r[0],t=r[1];return[e-CP-2,t-CP,e-2,t]}function Mj(r,e=1){let t=1/0,n=1/0,i=-1/0,s=-1/0;for(let a=0;a+1<r.length;a+=2)t=Math.min(t,r[a]),i=Math.max(i,r[a]),n=Math.min(n,r[a+1]),s=Math.max(s,r[a+1]);return[t-e,n-e,i+e,s+e]}function Nj(r,e,t,n){let[i,s,a]=t,o=["q"];o.push("/GS0 gs");for(let l=0;l+7<e.length;l+=8){let u=Math.min(e[l],e[l+4]),d=Math.max(e[l+2],e[l+6]),c=Math.max(e[l+1],e[l+3]),h=Math.min(e[l+5],e[l+7]),f=c-h,p=d-u;if(!(p<=0||f<=0))switch(r){case"highlight":o.push(`${i} ${s} ${a} rg`,`${u} ${h} ${p} ${f} re`,"f");break;case"strikeout":case"replace":{let g=h+f*.45;o.push(`${i} ${s} ${a} RG`,"1.2 w",`${u} ${g} m`,`${d} ${g} l`,"S");break}case"underline":{let g=h+f*.08;o.push(`${i} ${s} ${a} RG`,"1.2 w",`${u} ${g} m`,`${d} ${g} l`,"S");break}case"insert":{let g=u;o.push(`${i} ${s} ${a} rg`,`${g-4} ${h} m`,`${g+4} ${h} l`,`${g} ${h+8} l`,"f");break}default:{o.push(`${i} ${s} ${a} rg`,"0.25 0.25 0.28 RG","0.7 w",`${u} ${h} ${Math.min(p,18)} ${Math.min(f,16)} re`,"B");break}}}return o.push("Q"),o.join(`
|
|
261
|
+
`)}function Lj(r,e,t,n,i,s){let a=Nj(e,t,i,s),o=r.context.obj({Type:"ExtGState",BM:e==="highlight"?"Multiply":"Normal",CA:s,ca:s}),l=Qt.PDFRawStream.of(r.context.obj({Type:"XObject",Subtype:"Form",FormType:1,BBox:[n[0],n[1],n[2],n[3]],Resources:r.context.obj({ExtGState:r.context.obj({GS0:o})}),Length:a.length}),new TextEncoder().encode(a));return r.context.register(l)}function TP(r,e){let t=r.getPage(e),n=t.node.lookup(Qt.PDFName.of("Annots"));if(n instanceof Qt.PDFArray)return n;let i=r.context.obj([]);return t.node.set(Qt.PDFName.of("Annots"),i),i}function ny(r){return r==="strikeout"||r==="replace"||r==="underline"}function jj(r,e){return e&&ny(r.kind)?"highlight":r.kind}function Bj(r,e){let t=[],n=ad(r);if(n&&t.push(n),r.resolved&&t.push("[resolved]"),e&&ny(r.kind)){let i=(r.markedText||"").replace(/\s+/g," ").trim();t.push(`[${bt[r.kind].toLowerCase()} \u2014 the marked text has since been rewritten, so this marks the paragraph`+(i?`; originally: \u201C${i.slice(0,120)}\u201D`:"")+"]")}return r.comment&&t.push(r.comment),t.join(" ")}async function kP(r,e,t={}){let n=t.includeResolved??!0,i=t.resolvedOpacity??.25,s=t.replyAuthorFallback??"Author",a=await Qt.PDFDocument.load(r,{updateMetadata:!1}),o=a.getPageCount(),l=0,u=0,d=0;for(let{item:h,hit:f,precision:p}of e){if(h.resolved&&!n){d++;continue}let g=f.page-1;if(g<0||g>=o)continue;let v=p!=="exact",m=jj(h,v),y=DP[h.kind]??DP.other,w=h.resolved?i:v&&ny(h.kind)?.35:1,x=f.quadPoints.length?f.quadPoints:[f.rect[0],f.rect[3],f.rect[2],f.rect[3],f.rect[0],f.rect[1],f.rect[2],f.rect[1]],b=ry(m)==="Text"?Oj(x):Mj(x),A=ry(m)==="Text"?[b[0],b[3],b[2],b[3],b[0],b[1],b[2],b[1]]:x,S=Lj(a,m,A,b,y,w),P=ry(m),F=a.context.obj({Type:"Annot",Subtype:P,Rect:b,NM:ao(h.id),T:ao(h.author||"Editor"),Contents:ao(Bj(h,v)),M:Qt.PDFString.of(EP(new Date().toISOString())),C:y,CA:w,F:4,AP:a.context.obj({N:S}),...P==="Text"||P==="Caret"?{}:{QuadPoints:x}}),k=a.context.register(F);TP(a,g).push(k),l++;for(let D of h.replies??[]){let _=a.context.obj({Type:"Annot",Subtype:"Text",Rect:[b[2]-18,b[1],b[2],b[1]+18],T:ao(D.author||s),Contents:ao(D.body),M:Qt.PDFString.of(EP(D.createdAt)),C:y,F:4,IRT:k,RT:Qt.PDFName.of("R"),NM:ao(`${h.id}#${D.id}`)});TP(a,g).push(a.context.register(_)),u++}}return{bytes:await a.save({useObjectStreams:!1}),marks:l,replies:u,skippedResolved:d}}function Ql(r){return r.replace(/\s+/g," ").trim()}function RP(r,e,t){let n=Lt(r),i=[`= Annotations: ${Ql(n)}`,`:source-pdf: ${n}`,`:generated: ${t}`,`:annotation-count: ${e.length}`,"",`Extracted ${e.length} annotation(s) from \`${Ql(n)}\`.`,""];if(e.length===0)return i.push("No annotations found in this PDF.",""),i.join(`
|
|
262
|
+
`);let s=new Map;for(let a of e){let o=s.get(a.page)??[];o.push(a),s.set(a.page,o)}for(let a of[...s.keys()].sort((o,l)=>o-l)){i.push(`== Page ${a}`,"");for(let o of s.get(a)){let l=bt[o.kind]??o.kind;i.push(`=== ${l}${o.author?` \u2014 ${Ql(o.author)}`:""}`,"");let u=Ql(o.markedText||o.anchoredText);u&&i.push("Context:","","[quote]","____",u,"____",""),o.comment&&i.push(`Comment:: ${Ql(o.comment)}`,""),!u&&!o.comment&&i.push("_(no anchored text or comment)_","")}}return i.join(`
|
|
263
|
+
`).replace(/\n{3,}/g,`
|
|
264
|
+
|
|
265
|
+
`).trimEnd()+`
|
|
266
|
+
`}function _P(r){return`${r.replace(/(\.annotated)?\.pdf$/i,"")}.annotations.adoc`}var $l=Number.MAX_SAFE_INTEGER,jP=["Reviews and rounds","Annotations","Editing the source","Outputs","Workspace"];function Ki(r){return r.settings.matchThreshold}function nt(r,e){r.io.out(JSON.stringify(e,null,2))}async function Rh(r,e){if(r.yes)return!0;if(!r.io.interactive)throw new Qe(`${e} \u2014 refusing without a terminal to ask on; pass --yes`);let t=await r.io.ask(`${e} [y/N] `);return/^y(es)?$/i.test(t)}async function $t(r,e){let t=r.ws(),n=await t.requireDoc(e),i=t.pickMapping(n,Ee(r.args,"mapping"),ts(r.args,"round"));return{ws:t,adoc:n,session:i}}async function Uj(r,e){return e.length===1&&e[0]==="-"?r.io.readStdin():e.join(" ")}async function qj(r,e){let t=(0,Oe.readFileSync)(e,"utf8"),n=r.store.buildAnchors(e,t);return!n||n.inserted===0||((0,Oe.writeFileSync)(e,n.source,"utf8"),await r.store.remapAll(e,Ki(r))),n}var IP=["copyedit","proofread","developmental","technical","legal","other"],OP=["annotated","proof","clean","stamped","other"];function BP(r){if(!(r===void 0||r==="")){if(!IP.includes(r))throw new pe(`--type must be one of ${IP.join(", ")}`);return r}}function iy(r){if(r!==void 0){if(!OP.includes(r))throw new pe(`--role must be one of ${OP.join(", ")}`);return r}}var zj={name:"open",aliases:["review"],group:"Reviews and rounds",vscode:"Open PDF Review / Start New Review Round / Add Annotated PDF to Current Round",summary:"Map an annotated PDF onto its AsciiDoc source",usage:`open <source.adoc> <annotated.pdf> [--new-round | --round N] [--label L] [--origin O]
|
|
267
|
+
[--reviewer R] [--type copyedit|proofread|\u2026] [--import] [--no-anchor]`,details:`Extracts every highlight, strikeout, comment and insert from the PDF and links each
|
|
268
|
+
to the source line it marks. By default the PDF joins the document's current round
|
|
269
|
+
(a second editor's copy of the same pass); --new-round starts the next one, carrying
|
|
270
|
+
resolved state and replies forward. Re-opening the same PDF in the same round
|
|
271
|
+
refreshes that mapping in place. Unless --no-anchor (or autoAnchor=false), \`// eddie:\`
|
|
272
|
+
marker comments are written into the source so the marks survive later rewrites.`,spec:{values:["label","origin","reviewer","type","role"]},async run(r){let[e,t]=r.args.positional;if(!e||!t)throw new pe("open needs <source.adoc> <annotated.pdf>");let n=r.ws(),i=n.abs(e),s=n.abs(t);for(let[v,m]of[[i,e],[s,t]])if(!(0,Oe.existsSync)(v))throw new Qe(`no such file: ${m}`);if(/\.pdf$/i.test(i)&&/\.(adoc|asciidoc)$/i.test(s))throw new pe("arguments are <source.adoc> <annotated.pdf> \u2014 in that order");await n.store.tryLoadSidecar(i);let a=n.store.sessionsFor(i),o,l=ts(r.args,"round");ke(r.args,"new-round")?o=n.store.nextRevision(i):l!=null?o=n.store.revisionsFor(i).find(v=>v.ordinal===l)??{id:ud(l),ordinal:l}:o=n.store.latestRevision(i)??n.store.nextRevision(i);let u=a.find(v=>v.revision.id===o.id&&v.pdfPath&&(ot.resolve(v.pdfPath)===s||v.pdf?.importedFrom&&ot.resolve(v.pdf.importedFrom)===s)),d={label:Ee(r.args,"label"),origin:Ee(r.args,"origin"),reviewer:Ee(r.args,"reviewer"),reviewType:BP(Ee(r.args,"type"))};r.io.note(`${u?"re-mapping":"mapping"} ${ot.basename(s)} \u2192 ${ot.basename(i)}\u2026`);let c=await n.store.loadReview(i,s,{threshold:Ki(n),revision:o,sidecarPath:u?.sidecarPath,mapping:d,pdfRole:iy(Ee(r.args,"role"))??u?.pdf?.role??"annotated",importPdf:ke(r.args,"import")||n.settings.importPdfs&&!ke(r.args,"no-import")}),h=c.items.filter(v=>ht(v)!==$l).length;c.items.length>=5&&h/c.items.length<.4&&r.io.note(`warning: only ${h} of ${c.items.length} annotations mapped \u2014 check that ${ot.basename(s)} is really the annotated PDF for ${ot.basename(i)}, then run: eddie triage`);let f;n.settings.autoAnchor&&!ke(r.args,"no-anchor")&&(f=await qj(n,i)),await n.store.flush();let p=n.store.getBySidecar(c.sidecarPath)??c,g=Er(p.items,n.settings.highConfidence);return r.json?(nt(r,{...ua(p,g,!0),anchored:f?.anchored??0,markers:f?.inserted??0}),0):(r.io.out(n.show(p.sidecarPath)),r.io.note(`${zn(p.revision)} \xB7 ${jt(p)} \u2014 ${p.items.length} annotation(s), ${h} mapped to source`),r.io.note(Bo(g)),f?.inserted&&r.io.note(`anchored ${f.anchored} annotation(s) with ${f.inserted} marker comment(s) in ${ot.basename(i)} (eddie strip removes them)`),0)}},Vj={name:"append",group:"Reviews and rounds",vscode:"Add PDFs to This Mapping\u2026",summary:"Add more PDFs' marks to an existing mapping",usage:"append <source.adoc> <file.pdf>... [--mapping M] [--origin O] [--reviewer R] [--role R] [--import]",details:`The editor sent the chapter again with more marks, or a second copy of the same pass
|
|
273
|
+
arrived. New marks join the mapping and continue its numbering; marks it already has
|
|
274
|
+
are skipped; numbers, resolutions and replies stay as they were.`,spec:{values:["origin","reviewer","role"]},async run(r){let[e,...t]=r.args.positional;if(!t.length)throw new pe("append needs <source.adoc> and at least one PDF");let{ws:n,session:i}=await $t(r,e),s=[];for(let a of t){let o=n.abs(a);if(!(0,Oe.existsSync)(o))throw new Qe(`no such file: ${a}`);let l=await n.store.appendPdf(i.sidecarPath,o,{threshold:Ki(n),origin:Ee(r.args,"origin"),reviewer:Ee(r.args,"reviewer"),pdfRole:iy(Ee(r.args,"role")),importPdf:ke(r.args,"import")||n.settings.importPdfs});s.push({pdf:o,added:l.added.length,duplicates:l.duplicates,alreadyPresent:!!l.alreadyPresent}),r.io.note(l.alreadyPresent?`${ot.basename(o)}: already part of ${jt(i)}, skipped`:`${ot.basename(o)}: ${l.added.length} new mark(s), ${l.duplicates} already present`)}return await n.store.flush(),r.json?nt(r,{mapping:i.sidecarPath,results:s}):r.io.out(n.show(i.sidecarPath)),0}},Hj={name:"merge",group:"Reviews and rounds",vscode:"Merge Mappings into This One\u2026",summary:"Fold other mappings of a document into one",usage:"merge <source.adoc> <mapping>... --into <mapping>",details:`Moves the PDFs, marks and review state of each named mapping into the --into mapping
|
|
275
|
+
(default: the newest), then deletes their sidecars. The target is written first.`,spec:{values:["into"]},async run(r){let[e,...t]=r.args.positional;if(!t.length)throw new pe("merge needs <source.adoc> and the mappings to fold in");let n=r.ws(),i=await n.requireDoc(e),s=n.pickMapping(i,Ee(r.args,"into")??Ee(r.args,"mapping")),a=t.map(l=>n.pickMapping(i,l).sidecarPath);if(n.store.setActive(s.sidecarPath),!await Rh(r,`Merge ${a.length} mapping(s) into ${jt(s)} and delete their sidecars?`))return 1;let o=await n.store.mergeMappings(s.sidecarPath,a);return r.json?nt(r,{into:s.sidecarPath,...o}):(r.io.out(n.show(s.sidecarPath)),r.io.note(`removed ${o.removed.length} mapping(s)`+(o.failed.length?`; failed: ${o.failed.join("; ")}`:""))),o.failed.length?1:0}},Gj={name:"rounds",aliases:["mappings"],group:"Reviews and rounds",vscode:"Switch Round / Mapping",summary:"List the rounds and mappings of a document, or of every reviewed document",usage:"rounds [source.adoc] [--json]",details:`Without a source, lists every mapping in the workspace, grouped by document.
|
|
276
|
+
The CLI has no 'active' mapping between runs: every per-document command acts on the
|
|
277
|
+
newest mapping (marked *) unless given --mapping <id> or --round N.
|
|
278
|
+
To browse and act on them interactively, run: eddie tui`,async run(r){let e=r.ws(),t=e.settings.highConfidence,n;if(r.args.positional[0])n=[await e.requireDoc(r.args.positional[0])];else if(await e.loadAll(),n=e.store.documents().sort(),!n.length&&!r.json)return r.io.out("no reviews in this workspace \u2014 start one with: eddie open <source.adoc> <annotated.pdf>"),0;if(r.json)return nt(r,n.flatMap(i=>{let s=e.store.sessionsFor(i),a=s[s.length-1];return s.map(o=>ua(o,Er(o.items,t),o===a))})),0;for(let i of n){(n.length>1||!r.args.positional[0])&&r.io.out(`${e.show(i)}`);let s=n.length>1||!r.args.positional[0]?" ":"";Wj(r,e,i,s)}return 0}};function Wj(r,e,t,n){let i=e.settings.highConfidence,s=e.store.sessionsFor(t),a=s[s.length-1];for(let o of e.store.revisionsFor(t)){r.io.out(`${n}${zn(o)}${o.receivedAt?` (received ${o.receivedAt})`:""}`);for(let l of s.filter(u=>u.revision.id===o.id)){let u=Er(l.items,i),d=[l.mapping.origin,l.mapping.reviewer].filter(Boolean).join(" / ");r.io.out(`${n} ${l===a?"*":" "} ${`${o.id}/${l.mapping.id}`.padEnd(32)} ${jt(l)}${d&&d!==jt(l)?` \u2014 ${d}`:""}`),r.io.out(`${n} ${Bo(u)}`),r.io.out(`${n} ${e.show(l.sidecarPath)}`)}}}var Kj={name:"describe",aliases:["edit-round"],group:"Reviews and rounds",vscode:"Edit Round Details\u2026",summary:"Set a mapping's label, origin, reviewer, type, and its round's details",usage:`describe <source.adoc> [--mapping M] [--label L] [--origin O] [--reviewer R] [--type T]
|
|
279
|
+
[--role R] [--round-label L] [--received YYYY-MM-DD] [--round-note N]`,details:"An empty value clears a field: --label ''. Round details are shared by every mapping in the round.",spec:{values:["label","origin","reviewer","type","role","round-label","received","round-note"]},async run(r){let{ws:e,session:t}=await $t(r,r.args.positional[0]),n={},i=(u,d,c=h=>h)=>{let h=Ee(r.args,u);h!==void 0&&(n[d]=h===""?void 0:c(h))};i("label","label"),i("origin","origin"),i("reviewer","reviewer"),i("type","reviewType",u=>BP(u));let s={},a=!1;for(let[u,d]of[["round-label","label"],["received","receivedAt"],["round-note","note"]]){let c=Ee(r.args,u);c!==void 0&&(s[d]=c===""?void 0:c,a=!0)}a&&(n.revision=s);let o=iy(Ee(r.args,"role"));if(o&&(n.pdfRole=o),!Object.keys(n).length)throw new pe("nothing to change \u2014 pass --label, --origin, --reviewer, --type, --role or a --round-* flag");e.store.describeMapping(t.sidecarPath,n),await e.store.flush();let l=e.store.getBySidecar(t.sidecarPath);return r.json?nt(r,ua(l,Er(l.items,e.settings.highConfidence),!0)):r.io.out(`${zn(l.revision)} \xB7 ${jt(l)}`),0}},Xj={name:"delete",aliases:["delete-mapping","rm"],group:"Reviews and rounds",vscode:"Remove This Mapping\u2026",summary:"Delete a mapping's sidecar (the source and PDFs are untouched)",usage:"delete <source.adoc> --mapping M [--yes]",async run(r){if(!Ee(r.args,"mapping")&&ts(r.args,"round")==null)throw new pe("delete needs --mapping (or --round) so nothing is removed by default");let{ws:e,session:t}=await $t(r,r.args.positional[0]);if(!await Rh(r,`Delete mapping ${jt(t)} (${t.items.length} annotations, their replies and resolutions)?`))return 1;let n=await e.store.deleteMapping(t.sidecarPath);return n&&r.io.out(e.show(t.sidecarPath)),n?0:1}},Yj={name:"remap",aliases:["refresh"],group:"Reviews and rounds",vscode:"Re-map Annotations",summary:"Re-run matching for every round against the current source",usage:"remap <source.adoc> [--only-changed]",details:`Re-uses the annotations already extracted \u2014 the PDF is not re-read. Run it after
|
|
280
|
+
editing the source outside the editor. --only-changed skips mappings whose source
|
|
281
|
+
hash has not changed since they were last matched.`,async run(r){let e=r.ws(),t=await e.requireDoc(r.args.positional[0]),n=await e.store.remapAll(t,Ki(e),{onlyIfSourceChanged:ke(r.args,"only-changed")});await e.store.flush();let i=e.store.sessionsFor(t);if(r.json)return nt(r,{remapped:n,mappings:i.map(a=>ua(a,Er(a.items,e.settings.highConfidence),!1))}),0;r.io.out(`re-mapped ${n} mapping(s) across ${e.store.revisionsFor(t).length} round(s)`);let s=i[i.length-1];return s&&r.io.note(`newest: ${Bo(Er(s.items,e.settings.highConfidence))}`),0}},MP=aa,NP=["highlight","strikeout","underline","comment","insert","replace","other"],Zj={name:"list",aliases:["ls"],group:"Annotations",vscode:"the PDF Annotations tree",summary:"List annotations grouped as Open / Needs review / Unmatched / Resolved",usage:`list <source.adoc> [--mapping M] [--bucket open,review,unmatched,resolved] [--kind K]
|
|
282
|
+
[--page N] [--text T] [--hide-resolved] [--json]`,spec:{values:["bucket","kind","page","text"]},async run(r){let{ws:e,session:t}=await $t(r,r.args.positional[0]),n=e.settings.highConfidence,i=To(r.args,"bucket");for(let o of i)if(!MP.includes(o))throw new pe(`--bucket must be one of ${MP.join(", ")}`);let s=To(r.args,"kind").map(o=>o==="delete"?"strikeout":o);for(let o of s)if(!NP.includes(o))throw new pe(`--kind must be one of ${NP.join(", ")}`);let a=Ad(t.items,{hideResolved:ke(r.args,"hide-resolved")||!e.settings.showResolved,buckets:i,kinds:s,page:ts(r.args,"page"),text:Ee(r.args,"text")},n);if(r.json)return nt(r,{mapping:ua(t,Er(t.items,n),!0),items:a.map(o=>ss(o,n))}),0;r.io.note(`${zn(t.revision)} \xB7 ${jt(t)} \u2014 ${Bo(Er(t.items,n))}`);for(let o of Yb(a,n)){r.io.out(o.label);for(let l of o.items)r.io.out(` ${Jb(l)}`)}return 0}},Jj={name:"show",group:"Annotations",vscode:"Reveal in Source / the comment thread",summary:"Show one annotation: marks, source lines, match and reply thread",usage:"show <source.adoc> <item> [--mapping M] [--context N] [--json]",details:"<item> is a remark number (3 or #3), an annotation id, or a unique id prefix.",spec:{values:["context"]},async run(r){let[e,t]=r.args.positional,{ws:n,adoc:i,session:s}=await $t(r,e),a=n.findItem(s,t),o=n.settings.highConfidence;if(r.json)return nt(r,{...ss(a,o),pdf:Ro(s,a),mapping:s.sidecarPath}),0;let l=(0,Oe.readFileSync)(i,"utf8").split(/\r?\n/),u=Cr(a);if(r.io.out(`${Ue(a)} [${bt[a.kind]}] page ${a.page} ${wn[ss(a,o).bucket]}`),r.io.out(`id: ${a.id}`),a.author&&r.io.out(`author: ${a.author}`),a.comment&&r.io.out(`comment: ${a.comment.replace(/\s+/g," ").trim()}`),a.markedText&&r.io.out(`marked: "${nn(a.markedText,200)}"`),a.anchoredText&&r.io.out(`context: "${nn(a.anchoredText,200)}"`),u==null)r.io.out("source: unmatched \u2014 eddie triage, or eddie relink <adoc> <item> <line>");else{let d=a.manualLine!=null?"linked by hand":`${a.match?.method??"fuzzy"} ${a.match?.score.toFixed(2)}`;r.io.out(`source: line ${u} (${d}${a.confirmed?", confirmed":""}${a.stale?", STALE":""})`);let c=ts(r.args,"context")??1,h=a.manualLine!=null?u:(a.match?.endLine??u-1)+1;for(let f=Math.max(1,u-c);f<=Math.min(l.length,h+c);f++){let p=f>=u&&f<=h?">":" ";r.io.out(` ${p}${String(f).padStart(5)} \u2502 ${l[f-1]}`)}}a.anchor&&r.io.out(`anchor: ${a.anchor.marker?`marker ${a.anchor.marker}`:a.anchor.blockId?`block ${a.anchor.blockId}`:"fingerprint"}`),a.note&&r.io.out(`note: ${a.note}`);for(let d of a.replies??[]){r.io.out(` \u21B3 ${d.author} \xB7 ${d.createdAt.slice(0,16).replace("T"," ")} \xB7 ${d.id}`);for(let c of d.body.split(/\r?\n/))r.io.out(` ${c}`)}return 0}};function sy(r,e){return{...e,name:r,usage:`${r} <source.adoc> <item>... [--mapping M] [--all-located]`,async run(t){let[n,...i]=t.args.positional,{ws:s,adoc:a,session:o}=await $t(t,n),l=ke(t.args,"all-located")?o.items.filter(Gn):i.map(d=>s.findItem(o,d));if(!l.length)throw new pe(`${r} needs at least one <item>`);let u=[];for(let d of l){let c=e.apply(s,a,d);c&&(u.push(d.id),t.io.note(`${Ue(d)}: ${c}`))}return await s.store.flush(),t.json?nt(t,{changed:u}):t.io.out(`${u.length} annotation(s) updated`),0}}}var Qj=sy("resolve",{group:"Annotations",vscode:"Toggle Resolved",summary:"Mark annotations resolved",apply(r,e,t){if(!t.resolved)return r.store.toggleResolved(e,t.id),"resolved"}}),$j=sy("reopen",{aliases:["unresolve"],group:"Annotations",vscode:"Toggle Resolved",summary:"Mark annotations open again",apply(r,e,t){if(t.resolved)return r.store.toggleResolved(e,t.id),"reopened"}}),e8=sy("confirm",{group:"Annotations",vscode:"Confirm Match",summary:"Vouch for low-confidence or stale matches (moves them out of Needs review)",apply(r,e,t){if(!(t.confirmed&&!t.stale))return r.store.confirmMatch(e,t.id),"confirmed"}}),t8={name:"relink",group:"Annotations",vscode:"Re-link to Current Cursor Line / Reselect Source Line",summary:"Link an annotation to a source line by hand",usage:"relink <source.adoc> <item> <line> [--mapping M]",details:"<line> is 1-based, as an editor shows it. A hand-picked link counts as confirmed.",async run(r){let[e,t,n]=r.args.positional,{ws:i,adoc:s,session:a}=await $t(r,e),o=i.findItem(a,t),l=Number(n),u=(0,Oe.readFileSync)(s,"utf8").split(/\r?\n/).length;if(!Number.isInteger(l)||l<1||l>u)throw new pe(`<line> must be between 1 and ${u}`);return i.store.relink(s,o.id,l-1),await i.store.flush(),r.json?nt(r,ss(i.store.findItem(s,o.id),i.settings.highConfidence)):r.io.out(`${Ue(o)} \u2192 line ${l}`),0}},r8={name:"remap-item",group:"Annotations",vscode:"Re-map This Annotation",summary:"Re-run automatic matching for one annotation, dropping a manual link",usage:"remap-item <source.adoc> <item> [--mapping M]",async run(r){let[e,t]=r.args.positional,{ws:n,adoc:i,session:s}=await $t(r,e),a=n.findItem(s,t);await n.store.remapItem(i,a.id,Ki(n)),await n.store.flush();let o=n.store.findItem(i,a.id),l=Cr(o)!=null&&!o.stale;return r.json?nt(r,ss(o,n.settings.highConfidence)):l?r.io.out(`${Ue(o)} \u2192 line ${Cr(o)}`):r.io.out(`${Ue(o)}: no confident source match \u2014 link it by hand with: eddie relink`),l?0:1}},n8={name:"triage",group:"Annotations",vscode:"Triage Unmatched Annotations",summary:"Suggest source lines for unmatched annotations; -i to link them one by one",usage:"triage <source.adoc> [--mapping M] [--candidates N] [-i | --interactive] [--json]",details:"Without -i, prints each unmatched annotation with a ranked shortlist of candidate\nlines (link one with `eddie relink`). With -i, asks for each: a candidate number,\nL<line> for any line, s to skip, q to stop.",spec:{values:["candidates"],aliases:{i:"interactive"}},async run(r){let{ws:e,adoc:t,session:n}=await $t(r,r.args.positional[0]),i=(0,Oe.readFileSync)(t,"utf8"),s=i.split(/\r?\n/),a=wi(i),o=ts(r.args,"candidates")??5,l=n.items.filter(f=>!f.resolved&&ht(f)===$l),u=l.map(f=>({item:f,candidates:nd(f.anchoredText||f.comment||"",a,o)}));if(r.json)return nt(r,u.map(f=>({...ss(f.item,e.settings.highConfidence),candidates:f.candidates.map(p=>({line:p.startLine+1,endLine:p.endLine+1,score:p.score,text:s[p.startLine]}))}))),0;if(!l.length)return r.io.out("no unmatched annotations to triage"),0;let d=ke(r.args,"interactive");if(d&&!r.io.interactive)throw new Qe("triage -i needs a terminal");let c=0,h=0;for(let f=0;f<u.length;f++){let{item:p,candidates:g}=u[f];if(r.io.out(`
|
|
283
|
+
[${f+1}/${u.length}] ${Ue(p)} [${bt[p.kind]}] p${p.page}`),p.comment&&r.io.out(` comment: ${nn(p.comment,120)}`),p.anchoredText&&r.io.out(` marked: "${nn(p.anchoredText,120)}"`),g.forEach((v,m)=>r.io.out(` ${m+1}) L${String(v.startLine+1).padEnd(5)} ${v.score.toFixed(2)} ${nn(s[v.startLine],90)}`)),g.length||r.io.out(" (no candidates \u2014 give a line with L<n>)"),!!d)for(;;){let v=(await r.io.ask(" link [1-9 | L<line> | s skip | q quit] > ")).toLowerCase();if(v==="q")return r.io.out(`
|
|
284
|
+
triage \u2014 ${c} linked, ${h} skipped, ${u.length-f} not reached`),await e.store.flush(),0;if(v==="s"||v===""){h++;break}let m,y=/^l(\d+)$/.exec(v);if(y?m=Number(y[1])-1:/^\d+$/.test(v)&&g[Number(v)-1]&&(m=g[Number(v)-1].startLine),m==null||m<0||m>=s.length){r.io.note(" ? answer with a candidate number, L<line>, s or q");continue}e.store.relink(t,p.id,m),c++,r.io.out(` \u2192 linked to line ${m+1}`);break}}return await e.store.flush(),d?r.io.out(`
|
|
285
|
+
triage \u2014 ${c} linked, ${h} skipped`):r.io.note(`
|
|
286
|
+
link one with: eddie relink ${e.show(t)} <item> <line> (or run triage -i)`),0}},i8={name:"reply",group:"Annotations",vscode:"Reply / Edit Reply / Delete Reply",summary:"Add, edit or delete a reply in an annotation's thread",usage:`reply <source.adoc> <item> <text...> add a reply (text '-' reads stdin)
|
|
287
|
+
reply <source.adoc> <item> --edit <reply-id> <text...>
|
|
288
|
+
reply <source.adoc> <item> --delete <reply-id>
|
|
289
|
+
[--mapping M] [--author NAME]`,details:`Replies are stored in the sidecar and are stamped into reviewed PDFs. The author
|
|
290
|
+
defaults to authorName, then git config user.name.`,spec:{values:["edit","delete"]},async run(r){let[e,t,...n]=r.args.positional,{ws:i,adoc:s,session:a}=await $t(r,e),o=i.findItem(a,t),l=Ee(r.args,"delete"),u=Ee(r.args,"edit");if(l){if(!o.replies?.some(c=>c.id===l))throw new Qe(`no reply ${l} on ${Ue(o)}`);i.store.deleteReply(s,o.id,l)}else{let c=(await Uj(r,n)).trim();if(!c)throw new pe("reply needs some text");if(u){if(!o.replies?.some(h=>h.id===u))throw new Qe(`no reply ${u} on ${Ue(o)}`);i.store.editReply(s,o.id,u,c)}else i.store.addReply(s,o.id,i.authorName(),c)}await i.store.flush();let d=i.store.findItem(s,o.id);return r.json?nt(r,d.replies??[]):l?r.io.out(`deleted ${l}`):r.io.out(u??d.replies[d.replies.length-1].id),0}},s8={name:"preview",group:"Annotations",vscode:"Preview in PDF",summary:"Print (or --open) the PDF and page an annotation came from",usage:"preview <source.adoc> <item> [--mapping M] [--open]",async run(r){let[e,t]=r.args.positional,{ws:n,session:i}=await $t(r,e),s=n.findItem(i,t),a=Ro(i,s);return r.json?nt(r,{pdf:a,page:s.page,rect:s.rect}):r.io.out(`${a}#page=${s.page}`),ke(r.args,"open")&&Lo(a),0}},a8={name:"apply",group:"Editing the source",vscode:"Apply All Confident Edits",summary:"Apply every confident deletion, replacement and insertion to the source",usage:"apply <source.adoc> [--mapping M] [--dry-run] [--yes]",details:`Struck text is deleted; highlights and replacements whose note carries a suggestion
|
|
291
|
+
are replaced; insert marks get the suggested text. Only unresolved, precisely located
|
|
292
|
+
items at or above highConfidence are touched. Applied items are marked resolved.`,async run(r){let{ws:e,adoc:t,session:n}=await $t(r,r.args.positional[0]),i=(0,Oe.readFileSync)(t,"utf8"),s=e.settings.highConfidence,a=_d(i,n.items,o=>Vn(o,s));if(r.json&&(r.dryRun||!a.length))return nt(r,a.map(o=>({id:o.id,label:o.label,...o.edit}))),0;if(!a.length)return r.io.out("no actionable, confident edits to apply"),0;if(Id(a.map(o=>o.edit)))throw new Qe("some edits overlap \u2014 apply them one at a time with: eddie fix");if(a.forEach((o,l)=>r.io.note(`${String(l+1).padStart(3)}. ${o.label}`)),r.dryRun)return r.io.out(`would apply ${a.length} edit(s) to ${ot.basename(t)}`),0;if(!await Rh(r,`Apply ${a.length} edit(s) to ${ot.basename(t)}?`))return 1;(0,Oe.writeFileSync)(t,la(i,a.map(o=>o.edit)),"utf8");for(let o of a)e.store.toggleResolved(t,o.id);return await e.store.remapAll(t,Ki(e),{onlyIfSourceChanged:!0}),await e.store.flush(),r.json?nt(r,a.map(o=>({id:o.id,label:o.label,...o.edit}))):r.io.out(`applied ${a.length} edit(s) to ${e.show(t)}`),0}},o8=["delete-struck","delete-lines","replace-marked","insert-at-mark","insert-note"],l8={name:"fix",group:"Editing the source",vscode:"the lightbulb Quick Fixes",summary:"Apply one annotation's suggested edit (delete, replace, insert, note)",usage:`fix <source.adoc> <item> [action] [--text T] [--mapping M] [--dry-run] [--keep-open]
|
|
293
|
+
actions: delete-struck | delete-lines | replace-marked | insert-at-mark | insert-note`,details:`Without an action, lists the actions available for the item. replace-marked and
|
|
294
|
+
insert-at-mark use --text, else the suggestion parsed from the editor's note. The
|
|
295
|
+
item is marked resolved afterwards unless --keep-open (insert-note never resolves).`,spec:{values:["text"]},async run(r){let[e,t,n]=r.args.positional,{ws:i,adoc:s,session:a}=await $t(r,e),o=i.findItem(a,t),l=Rd(o,Gn(o));if(!n){if(r.json)nt(r,l);else if(!l.length)r.io.out(`${Ue(o)} has no edit actions${Gn(o)?"":" (it is unmatched)"}`);else for(let f of l)r.io.out(`${f.action.padEnd(16)} ${f.label}`);return 0}if(!o8.includes(n))throw new pe(`unknown action "${n}"`);if(!l.some(f=>f.action===n))throw new Qe(`${n} does not apply to ${Ue(o)} \u2014 run: eddie fix ${e} ${t}`);let u=(0,Oe.readFileSync)(s,"utf8"),d=Ee(r.args,"text")??oa(o.comment||""),c=null;switch(n){case"delete-struck":c=Dd(u,o);break;case"delete-lines":c=Ed(u,o);break;case"insert-note":c=kd(u,o);break;case"replace-marked":if(!d)throw new pe("replace-marked needs --text (the note has no suggestion)");c=Cd(u,o,d);break;case"insert-at-mark":if(!d)throw new pe("insert-at-mark needs --text (the note has no suggestion)");c=Td(u,o,d);break}if(!c)throw new Qe(`could not locate the marked text precisely \u2014 edit by hand at line ${Cr(o)}`);let h=u.slice(c.from,c.to);return r.io.note(`- ${JSON.stringify(h)}
|
|
296
|
+
+ ${JSON.stringify(c.insert)}`),r.dryRun?(r.json&&nt(r,c),0):((0,Oe.writeFileSync)(s,la(u,[c]),"utf8"),n!=="insert-note"&&!ke(r.args,"keep-open")&&!o.resolved&&i.store.toggleResolved(s,o.id),await i.store.remapAll(s,Ki(i),{onlyIfSourceChanged:!0}),await i.store.flush(),r.json?nt(r,c):r.io.out(`${Ue(o)}: ${n} applied to ${i.show(s)}`),0)}},u8={name:"anchor",group:"Editing the source",vscode:"Anchor Annotations in Source",summary:"Write `// eddie:` marker comments so marks survive rewrites",usage:"anchor <source.adoc> [--mapping M] [--review sidecar.json] [--dry-run]",details:"Markers are AsciiDoc comments: they never render, and they keep annotations attached\nto their paragraph when the text is rewritten. `eddie strip` removes them.\n--review anchors from one sidecar file directly, without the review folder.",spec:{values:["review"]},async run(r){let e=r.args.positional[0],t=Ee(r.args,"review");if(t)return d8(r,e,t);let{ws:n,adoc:i}=await $t(r,e),s=(0,Oe.readFileSync)(i,"utf8"),a=n.store.buildAnchors(i,s);return a?r.dryRun?(r.io.out(`would insert ${a.inserted} marker(s) and anchor ${a.anchored} annotation(s)`),0):a.inserted===0?(r.io.out(a.anchored?`all ${a.anchored} located annotation(s) were already anchored`:"nothing to anchor \u2014 no annotation has a source location yet"),0):((0,Oe.writeFileSync)(i,a.source,"utf8"),await n.store.remapAll(i,Ki(n)),await n.store.flush(),r.io.out(n.show(i)),r.io.note(`inserted ${a.inserted} marker(s); anchored ${a.anchored} annotation(s)`),0):1}};async function d8(r,e,t){if(!e)throw new pe("usage: anchor <source.adoc> --review <sidecar.json> [--dry-run]");let n=UP(t,e);if(!n)throw new Qe(`cannot read ${t}`);let i=(0,Oe.readFileSync)(e,"utf8"),s=[];for(let u of n.items){let d=ht(u);d!==$l&&s.push({itemId:u.id,line:d})}let a=td(i,s),o=Js(a.source),l=0;for(let u of n.items){let d=a.assigned.get(u.id),c=d?o.get(d):void 0;!d||!c||(u.anchor=ed(a.source,c.targetLine,d),l++)}return r.dryRun?(r.io.note(`would insert ${a.inserted} marker(s) and anchor ${l} annotation(s)`),0):((0,Oe.writeFileSync)(e,a.source),n.updatedAt=new Date().toISOString(),(0,Oe.writeFileSync)(t,Mo(n,t),"utf8"),r.io.out(`${e}`),r.io.note(`inserted ${a.inserted} marker(s); anchored ${l} annotation(s)`),0)}var c8={name:"strip",group:"Editing the source",vscode:"Remove Source Anchors",summary:"Remove every `// eddie:` marker from a source file",usage:"strip <source.adoc> [--dry-run]",async run(r){let e=r.args.positional[0];if(!e)throw new pe("usage: strip <source.adoc> [--dry-run]");let t=(0,Oe.readFileSync)(e,"utf8"),n=ab(t),i=t.split(/\r?\n/).length-n.split(/\r?\n/).length;return r.dryRun?(r.io.note(`would remove ${i} marker(s)`),0):(n!==t&&(0,Oe.writeFileSync)(e,n),r.io.out(`${e}`),r.io.note(`removed ${i} marker(s)`),0)}},h8={name:"report",aliases:["export"],group:"Outputs",vscode:"Export Review Report",summary:"Write a mapping's Markdown review report",usage:"report <source.adoc> [--mapping M] [-o out.md | --stdout] [--no-resolved]",details:`Groups annotations as Open / Needs review / Unmatched / Resolved with line numbers,
|
|
297
|
+
comments and replies. Goes to the round's folder unless reportOutput=besideSource or -o.`,async run(r){let{ws:e,session:t}=await $t(r,r.args.positional[0]),n=!ke(r.args,"no-resolved");if(ke(r.args,"stdout"))return process.stdout.write(await Rp(e,t,n)),0;let i=Ee(r.args,"out"),s=await xd(e,t,{outPath:i?e.abs(i):void 0,includeResolved:n});return r.io.out(e.show(s)),0}},f8={name:"stamp",group:"Outputs",vscode:"Stamp Reviewed PDF",summary:"Write the review's marks and replies into a freshly rendered PDF",usage:`stamp <fresh.pdf> <source.adoc> [--mapping M | --all-in-round] [-o out.pdf] [--no-resolved]
|
|
298
|
+
stamp <fresh.pdf> --review <sidecar.json>... [-o out.pdf] [--no-resolved] [--fail-on-unstamped]`,details:`Positions are re-derived from the current source, never from stored geometry, so
|
|
299
|
+
repagination does not matter. The clean render is never modified. With a source,
|
|
300
|
+
the output goes where stampOutput says (the round's pdf/ folder by default);
|
|
301
|
+
--all-in-round stamps every mapping of the selected round onto one PDF.`,spec:{values:["review"]},async run(r){let[e,t]=r.args.positional;if(!e)throw new pe("stamp needs <fresh.pdf>");let n=Co(r.args,"review"),i,s,a;if(n.length){i=[];for(let g of n){let v=UP(g);v?i.push(v):r.io.note(` ! ${ot.basename(g)}: unreadable, skipped`)}}else{if(!t)throw new pe("stamp needs <source.adoc> or --review <sidecar.json>");let g=await $t(r,t);s=g.ws,a=g.session,i=ke(r.args,"all-in-round")?s.store.sessionsFor(g.adoc).filter(v=>v.revision.id===a.revision.id):[a]}let o=ot.resolve(e),l=o.replace(/\.pdf$/i,"")+".reviewed.pdf",u=Ee(r.args,"out")?ot.resolve(Ee(r.args,"out")):s&&a?kp(s,a,s.settings.stampOutput,l,"pdf"):l;if(u===o)throw new pe("refusing to overwrite the clean render in place \u2014 pass -o");let d=new Uint8Array((0,Oe.readFileSync)(o)),c=await Ib(d);r.io.note(`${ot.basename(o)}: ${c.length} page(s)`);let h={anchored:[],unstamped:[]};for(let g of i){let v=(0,Oe.readFileSync)(g.adocPath,"utf8"),m=fw(g.items,v,c);h.anchored.push(...m.anchored),h.unstamped.push(...m.unstamped),r.io.note(` ${ot.basename(g.sidecarPath)}: ${m.anchored.length} placed, ${m.unstamped.length} un-stampable of ${g.items.length}`)}let f=await kP(d,h.anchored,{includeResolved:!ke(r.args,"no-resolved")});if((0,Oe.mkdirSync)(ot.dirname(u),{recursive:!0}),(0,Oe.writeFileSync)(u,f.bytes),s){for(let g of i)s.store.recordArtifact(g.sidecarPath,{kind:"stampedPdf",path:u,createdAt:new Date().toISOString(),note:`stamped from ${ot.basename(o)}`});await s.store.flush()}let p=A8(h.anchored.map(g=>g.precision));if(r.io.out(`${s?s.show(u):u}`),r.io.note(`wrote ${f.marks} mark(s) and ${f.replies} repl(ies) \u2014 ${p.exact??0} exact, ${p.line??0} line-level, ${p.block??0} block`+(f.skippedResolved?`, ${f.skippedResolved} resolved skipped`:"")),h.unstamped.length){r.io.note(`
|
|
302
|
+
${h.unstamped.length} annotation(s) could not be placed:`);for(let g of h.unstamped)r.io.note(` \xB7 [${bt[g.item.kind]}] ${nn(g.item.comment||g.item.anchoredText,60)}`),r.io.note(` ${g.reason}`)}return ke(r.args,"fail-on-unstamped")&&h.unstamped.length?1:0}},p8={name:"extract",group:"Outputs",vscode:"Extract Annotations as AsciiDoc",summary:"Dump a PDF's annotations as a standalone AsciiDoc file (or JSON)",usage:"extract <annotated.pdf> [-o out.adoc | --stdout] [--json]",async run(r){let e=r.args.positional[0];if(!e)throw new pe("extract needs <annotated.pdf>");let t=ot.resolve(e),n=await sa(new Uint8Array((0,Oe.readFileSync)(t)));if(r.json)return nt(r,n),0;let i=RP(t,n,new Date().toISOString());if(ke(r.args,"stdout"))return process.stdout.write(i),0;let s=ot.resolve(Ee(r.args,"out")??_P(t));return(0,Oe.writeFileSync)(s,i,"utf8"),r.io.out(s),r.io.note(`extracted ${n.length} annotation(s)`),0}},g8={name:"map",group:"Outputs",summary:"Extract and match without saving anything (inspection harness)",usage:"map <annotated.pdf> <source.adoc> [--json] [--report] [--lexical]",details:"Nothing is written. Useful in CI to check a PDF still maps onto its source.",async run(r){let[e,t]=r.args.positional;if(!e||!t)throw new pe("map needs <annotated.pdf> <source.adoc>");let n=new Uint8Array((0,Oe.readFileSync)(e)),i=(0,Oe.readFileSync)(t,"utf8"),s=await sa(n),a=rs(s,i,{threshold:.5});if(ke(r.args,"lexical")&&hd(a,i,.6),r.json)return r.io.out(JSON.stringify(a,null,2)),0;if(ke(r.args,"report")){let l=new Date().toISOString();return r.io.out(wd({version:3,sidecarPath:"",adocPath:t,pdfPath:e,revision:ra(),mapping:{id:"map",kind:"annotations"},pdf:{role:"annotated"},createdAt:l,updatedAt:l,items:a})),0}let o=i.split(/\r?\n/);r.io.out(`Extracted ${s.length} annotation(s):
|
|
303
|
+
`);for(let l of a){let u=ht(l),d=u===$l?"UNMATCHED":`L${u+1} (score ${l.match?.score.toFixed(2)??"manual"})`;r.io.out(`\u25CF [${bt[l.kind]}] p${l.page} \u2192 ${d}`),l.anchoredText&&r.io.out(` anchored: "${nn(l.anchoredText,90)}"`),l.comment&&r.io.out(` comment: "${nn(l.comment,90)}"`),u!==$l&&r.io.out(` source: ${nn(o[u]||"",90)}`),r.io.out()}return 0}},m8={name:"status",aliases:["reviews"],group:"Workspace",vscode:"Switch Review",summary:"Every reviewed document in the workspace, with open counts",usage:"status [--json]",async run(r){let e=r.ws();await e.loadAll();let t=e.settings.highConfidence,n=e.store.documents().map(i=>{let s=e.store.sessionsFor(i),a=s[s.length-1];return{source:i,rounds:e.store.revisionsFor(i).length,mappings:s.length,open:s.reduce((o,l)=>o+l.items.filter(u=>!u.resolved).length,0),total:s.reduce((o,l)=>o+l.items.length,0),newest:a?{ref:`${a.revision.id}/${a.mapping.id}`,counts:Er(a.items,t)}:null,updatedAt:s.map(o=>o.updatedAt).sort().pop()??""}});if(n.sort((i,s)=>s.updatedAt.localeCompare(i.updatedAt)),r.json)return nt(r,{root:e.opts.root,reviewFolder:ld(e.store.layoutConfig)??null,documents:n}),0;if(!n.length)return r.io.out("no reviews in this workspace \u2014 start one with: eddie open <source.adoc> <annotated.pdf>"),0;for(let i of n)r.io.out(`${e.show(i.source)}`),r.io.out(` ${i.open} open of ${i.total} \xB7 ${i.rounds} round(s)`+(i.mappings>i.rounds?` \xB7 ${i.mappings} mappings`:"")+(i.newest?` \xB7 newest ${i.newest.ref}`:""));return 0}},v8={name:"folder",group:"Workspace",vscode:"Open Review Folder",summary:"Print the review folder (or one document's folder in it)",usage:"folder [source.adoc] [--open]",async run(r){let e=r.ws(),t=r.args.positional[0],n=t?Hn(e.store.layoutConfig,e.abs(t)):ld(e.store.layoutConfig);return n?(r.io.out(n),ke(r.args,"open")&&Lo(n),0):(r.io.out("(legacy layout: sidecars sit beside each .adoc \u2014 reviewFolder is empty)"),0)}},y8={name:"migrate",group:"Workspace",vscode:"Move Reviews into Review Folder\u2026",summary:"Move sidecars that sit beside their .adoc into the review folder",usage:"migrate [--dry-run] [--yes]",async run(r){let e=r.ws();await e.loadAll();let t=e.store.planMigration();if(!t.length)return r.io.out("nothing to move \u2014 every review is already in the review folder"),0;for(let i of t)r.io.note(`${e.show(i.from)}
|
|
304
|
+
\u2192 ${e.show(i.to)}`);if(r.dryRun)return r.json?nt(r,t):r.io.out(`would move ${t.length} sidecar(s)`),0;if(!await Rh(r,`Move ${t.length} sidecar(s) into the review folder?`))return 1;let n=await e.store.migrate(t);return r.json?nt(r,n):r.io.out(`moved ${n.moved} sidecar(s)`+(n.failed.length?`; failed: ${n.failed.join("; ")}`:"")),n.failed.length?1:0}},b8={name:"tui",aliases:["browse","ui"],group:"Workspace",vscode:"the Eddie Doc sidebar, in a terminal",summary:"Browse documents, mappings and annotations full-screen, and act on them",usage:"tui [source.adoc]",details:`Documents \u2192 mappings \u2192 annotations, with the selected annotation's comment, source
|
|
305
|
+
lines and replies below the list. Keys: \u2191\u2193/jk move, Enter open, Esc/\u2190 back, q quit,
|
|
306
|
+
? all keys. On an annotation: r resolve, c confirm, a reply, e edit replies, l link to a
|
|
307
|
+
line, t triage, m re-match, f fix, A apply all, o open the PDF, b group, / search,
|
|
308
|
+
h hide resolved. On a mapping: R re-map, p export report. Set NO_COLOR to disable colour.`,async run(r){if(!process.stdin.isTTY||!process.stdout.isTTY)throw new Qe("tui needs an interactive terminal \u2014 use list/show/rounds in scripts");let e=r.ws(),t=new Bd(e,{color:!process.env.NO_COLOR,home:LP.homedir()});await t.start(r.args.positional[0]);let n=r.io.note;r.io.note=(i="")=>t.flash(i.replace(/^warning: /,""),/^warning:/.test(i));try{await sw(t)}finally{r.io.note=n}return await e.store.flush(),0}},w8={name:"config",group:"Workspace",summary:"Show the workspace root and effective settings, and where each came from",usage:"config [--json]",details:`Settings are read, lowest first, from: built-in defaults, .vscode/settings.json
|
|
309
|
+
(eddieDoc.* keys), .eddie.json, EDDIE_DOC_* environment variables, then
|
|
310
|
+
--set key=value / --review-folder / --threshold flags.`,async run(r){let e=r.loaded();if(r.json)return nt(r,{root:r.root(),files:e.files,settings:e.settings,source:e.source}),0;r.io.out(`root: ${r.root()}`),r.io.out(`files: ${e.files.join(", ")||"(none)"}`);for(let[t,n]of Object.entries(e.settings))r.io.out(` ${t.padEnd(18)} ${JSON.stringify(n).padEnd(28)} ${e.source[t]}`);return 0}},x8={name:"version",group:"Workspace",summary:"Print the version (the sidecar producer version)",usage:"version",async run(r){return r.io.out(rn.version),0}},ay=[zj,Vj,Hj,Gj,Kj,Xj,Yj,Zj,Jj,Qj,$j,e8,t8,r8,n8,i8,s8,a8,l8,u8,c8,h8,f8,p8,g8,m8,b8,lw,v8,y8,w8,x8];function _h(r){return ay.find(e=>e.name===r||e.aliases?.includes(r))}function UP(r,e){try{let t=(0,Oe.readFileSync)(r,"utf8"),n=e??ia(t,r)??r.replace(/\.review\.json$/i,"")+".adoc";return na(t,r,n)}catch{return null}}function A8(r){let e={};for(let t of r)e[t]=(e[t]??0)+1;return e}var S8=["root","set","review-folder","threshold","mapping","round","author","out"],P8={o:"out",h:"help",y:"yes",q:"quiet",m:"mapping",r:"round"},VP=`Global options:
|
|
311
|
+
--root DIR workspace root (default: nearest folder with .eddie.json,
|
|
312
|
+
.vscode, .eddie or .git above the current directory)
|
|
313
|
+
-m, --mapping M which mapping: id, rev-N/id, label, origin or sidecar path
|
|
314
|
+
-r, --round N which round (default: the newest mapping of the document)
|
|
315
|
+
--review-folder DIR override eddieDoc.reviewFolder ('' = sidecar beside .adoc)
|
|
316
|
+
--threshold X override eddieDoc.matchThreshold (0-1)
|
|
317
|
+
--set key=value override any eddieDoc.* setting (repeatable)
|
|
318
|
+
--author NAME name stamped on replies
|
|
319
|
+
--json machine-readable output on stdout
|
|
320
|
+
--dry-run show what would change, change nothing
|
|
321
|
+
-y, --yes do not ask before changing the manuscript
|
|
322
|
+
-q, --quiet fewer notices on stderr
|
|
323
|
+
-h, --help help for a command`;function qP(){let r=[`eddie ${rn.version} \u2014 map PDF review annotations back onto AsciiDoc sources`,"","Usage: eddie <command> [arguments] [options]"];for(let e of jP){r.push("",`${e}:`);for(let t of ay.filter(n=>n.group===e))r.push(` ${t.name.padEnd(12)} ${t.summary}`)}return r.push("",VP,"","Run `eddie help <command>` for a command's arguments."),r.join(`
|
|
324
|
+
`)}function zP(r){let e=[`eddie ${r.name} \u2014 ${r.summary}`,"",...r.usage.split(`
|
|
325
|
+
`).map((t,n)=>n===0?`Usage: eddie ${t}`:` ${t.startsWith(" ")?t:"eddie "+t}`)];return r.aliases?.length&&e.push("",`Aliases: ${r.aliases.join(", ")}`),r.vscode&&e.push(`VS Code: ${r.vscode}`),r.details&&e.push("",r.details),e.push("",VP),e.join(`
|
|
326
|
+
`)}async function HP(r,e,t={}){let n=r[0];if(!n)return e.note(qP()),2;if(n==="-h"||n==="--help"||n==="help"){let a=n==="help"?r[1]:void 0,o=a?_h(a):void 0;return a&&!o?(e.note(`unknown command "${a}"`),2):(e.out(o?zP(o):qP()),0)}if(n==="-v"||n==="--version")return e.out(rn.version),0;let i=_h(n),s=r.slice(1);if(!i&&/\.pdf$/i.test(n)&&(i=_h("map"),s=r),!i)return e.note(`unknown command "${n}" \u2014 run: eddie help`),2;try{let a={values:[...S8,...i.spec?.values??[]],aliases:{...P8,...i.spec?.aliases??{}}},o=Hy(s,a);if(ke(o,"help"))return e.out(zP(i)),0;let l,u,d,c=()=>l??=Ee(o,"root")??Wy(t.cwd??process.cwd()),h=()=>{if(u)return u;let g=Co(o,"set").map(Xy),v=Ee(o,"review-folder");v!==void 0&&g.push(["reviewFolder",v]);let m=Ee(o,"threshold");return m!==void 0&&g.push(["matchThreshold",m]),u=Ky(c(),g,t.env??process.env)},f={args:o,io:e,json:ke(o,"json"),yes:ke(o,"yes"),dryRun:ke(o,"dry-run"),root:c,loaded:h,ws:()=>d??=new md({root:c(),loaded:h(),author:Ee(o,"author"),quiet:ke(o,"quiet")},e)},p=await i.run(f);return d&&await d.store.flush(),p}catch(a){if(a instanceof pe)return e.note(`error: ${a.message}`),e.note(`usage: eddie ${i.usage.split(`
|
|
327
|
+
`)[0]}`),2;if(a instanceof Qe)return e.note(`error: ${a.message}`),1;let o=a;if(o?.code==="ENOENT"&&o.path)return e.note(`error: no such file: ${o.path}`),1;throw a}}Vy(WP.join(__dirname,"pdf.worker.mjs"));cy(r=>void setImmediate(r));var GP={out:(r="")=>void process.stdout.write(r+`
|
|
328
|
+
`),note:(r="")=>void process.stderr.write(r+`
|
|
329
|
+
`),interactive:!!process.stdin.isTTY&&!!process.stderr.isTTY,ask:r=>new Promise(e=>{let t=(0,KP.createInterface)({input:process.stdin,output:process.stderr});t.question(r,n=>{t.close(),e(n.trim())})}),readStdin:async()=>{let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf8")}};HP(process.argv.slice(2),GP).then(r=>process.exit(r)).catch(r=>{GP.note(String(r&&r.stack?r.stack:r)),process.exit(1)});
|
|
330
|
+
/*! Bundled license information:
|
|
331
|
+
|
|
332
|
+
tslib/tslib.es6.js:
|
|
333
|
+
(*! *****************************************************************************
|
|
334
|
+
Copyright (c) Microsoft Corporation.
|
|
335
|
+
|
|
336
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
337
|
+
purpose with or without fee is hereby granted.
|
|
338
|
+
|
|
339
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
340
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
341
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
342
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
343
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
344
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
345
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
346
|
+
***************************************************************************** *)
|
|
347
|
+
*/
|