@pdfme/ui 3.2.3-dev.2 → 3.3.0-dev.0
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/dist/index.es.js +60 -47
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -39,7 +39,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
39
39
|
*
|
40
40
|
* @author Feross Aboukhadijeh <https://feross.org>
|
41
41
|
* @license MIT
|
42
|
-
*/(function(a){const s=base64Js,$=ieee754,_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=at,a.SlowBuffer=gt,a.INSPECT_MAX_BYTES=50;const _e=2147483647;a.kMaxLength=_e,at.TYPED_ARRAY_SUPPORT=tt(),!at.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function tt(){try{const Xt=new Uint8Array(1),Gt={foo:function(){return 42}};return Object.setPrototypeOf(Gt,Uint8Array.prototype),Object.setPrototypeOf(Xt,Gt),Xt.foo()===42}catch{return!1}}Object.defineProperty(at.prototype,"parent",{enumerable:!0,get:function(){if(at.isBuffer(this))return this.buffer}}),Object.defineProperty(at.prototype,"offset",{enumerable:!0,get:function(){if(at.isBuffer(this))return this.byteOffset}});function nt(Xt){if(Xt>_e)throw new RangeError('The value "'+Xt+'" is invalid for option "size"');const Gt=new Uint8Array(Xt);return Object.setPrototypeOf(Gt,at.prototype),Gt}function at(Xt,Gt,Wt){if(typeof Xt=="number"){if(typeof Gt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return lt(Xt)}return ot(Xt,Gt,Wt)}at.poolSize=8192;function ot(Xt,Gt,Wt){if(typeof Xt=="string")return et(Xt,Gt);if(ArrayBuffer.isView(Xt))return ut(Xt);if(Xt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Xt);if(tr(Xt,ArrayBuffer)||Xt&&tr(Xt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tr(Xt,SharedArrayBuffer)||Xt&&tr(Xt.buffer,SharedArrayBuffer)))return ft(Xt,Gt,Wt);if(typeof Xt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const er=Xt.valueOf&&Xt.valueOf();if(er!=null&&er!==Xt)return at.from(er,Gt,Wt);const lr=ht(Xt);if(lr)return lr;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Xt[Symbol.toPrimitive]=="function")return at.from(Xt[Symbol.toPrimitive]("string"),Gt,Wt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Xt)}at.from=function(Xt,Gt,Wt){return ot(Xt,Gt,Wt)},Object.setPrototypeOf(at.prototype,Uint8Array.prototype),Object.setPrototypeOf(at,Uint8Array);function rt(Xt){if(typeof Xt!="number")throw new TypeError('"size" argument must be of type number');if(Xt<0)throw new RangeError('The value "'+Xt+'" is invalid for option "size"')}function st(Xt,Gt,Wt){return rt(Xt),Xt<=0?nt(Xt):Gt!==void 0?typeof Wt=="string"?nt(Xt).fill(Gt,Wt):nt(Xt).fill(Gt):nt(Xt)}at.alloc=function(Xt,Gt,Wt){return st(Xt,Gt,Wt)};function lt(Xt){return rt(Xt),nt(Xt<0?0:dt(Xt)|0)}at.allocUnsafe=function(Xt){return lt(Xt)},at.allocUnsafeSlow=function(Xt){return lt(Xt)};function et(Xt,Gt){if((typeof Gt!="string"||Gt==="")&&(Gt="utf8"),!at.isEncoding(Gt))throw new TypeError("Unknown encoding: "+Gt);const Wt=pt(Xt,Gt)|0;let er=nt(Wt);const lr=er.write(Xt,Gt);return lr!==Wt&&(er=er.slice(0,lr)),er}function it(Xt){const Gt=Xt.length<0?0:dt(Xt.length)|0,Wt=nt(Gt);for(let er=0;er<Gt;er+=1)Wt[er]=Xt[er]&255;return Wt}function ut(Xt){if(tr(Xt,Uint8Array)){const Gt=new Uint8Array(Xt);return ft(Gt.buffer,Gt.byteOffset,Gt.byteLength)}return it(Xt)}function ft(Xt,Gt,Wt){if(Gt<0||Xt.byteLength<Gt)throw new RangeError('"offset" is outside of buffer bounds');if(Xt.byteLength<Gt+(Wt||0))throw new RangeError('"length" is outside of buffer bounds');let er;return Gt===void 0&&Wt===void 0?er=new Uint8Array(Xt):Wt===void 0?er=new Uint8Array(Xt,Gt):er=new Uint8Array(Xt,Gt,Wt),Object.setPrototypeOf(er,at.prototype),er}function ht(Xt){if(at.isBuffer(Xt)){const Gt=dt(Xt.length)|0,Wt=nt(Gt);return Wt.length===0||Xt.copy(Wt,0,0,Gt),Wt}if(Xt.length!==void 0)return typeof Xt.length!="number"||ar(Xt.length)?nt(0):it(Xt);if(Xt.type==="Buffer"&&Array.isArray(Xt.data))return it(Xt.data)}function dt(Xt){if(Xt>=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return Xt|0}function gt(Xt){return+Xt!=Xt&&(Xt=0),at.alloc(+Xt)}at.isBuffer=function(Gt){return Gt!=null&&Gt._isBuffer===!0&&Gt!==at.prototype},at.compare=function(Gt,Wt){if(tr(Gt,Uint8Array)&&(Gt=at.from(Gt,Gt.offset,Gt.byteLength)),tr(Wt,Uint8Array)&&(Wt=at.from(Wt,Wt.offset,Wt.byteLength)),!at.isBuffer(Gt)||!at.isBuffer(Wt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Gt===Wt)return 0;let er=Gt.length,lr=Wt.length;for(let ur=0,pr=Math.min(er,lr);ur<pr;++ur)if(Gt[ur]!==Wt[ur]){er=Gt[ur],lr=Wt[ur];break}return er<lr?-1:lr<er?1:0},at.isEncoding=function(Gt){switch(String(Gt).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},at.concat=function(Gt,Wt){if(!Array.isArray(Gt))throw new TypeError('"list" argument must be an Array of Buffers');if(Gt.length===0)return at.alloc(0);let er;if(Wt===void 0)for(Wt=0,er=0;er<Gt.length;++er)Wt+=Gt[er].length;const lr=at.allocUnsafe(Wt);let ur=0;for(er=0;er<Gt.length;++er){let pr=Gt[er];if(tr(pr,Uint8Array))ur+pr.length>lr.length?(at.isBuffer(pr)||(pr=at.from(pr)),pr.copy(lr,ur)):Uint8Array.prototype.set.call(lr,pr,ur);else if(at.isBuffer(pr))pr.copy(lr,ur);else throw new TypeError('"list" argument must be an Array of Buffers');ur+=pr.length}return lr};function pt(Xt,Gt){if(at.isBuffer(Xt))return Xt.length;if(ArrayBuffer.isView(Xt)||tr(Xt,ArrayBuffer))return Xt.byteLength;if(typeof Xt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Xt);const Wt=Xt.length,er=arguments.length>2&&arguments[2]===!0;if(!er&&Wt===0)return 0;let lr=!1;for(;;)switch(Gt){case"ascii":case"latin1":case"binary":return Wt;case"utf8":case"utf-8":return Jt(Xt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt*2;case"hex":return Wt>>>1;case"base64":return Kt(Xt).length;default:if(lr)return er?-1:Jt(Xt).length;Gt=(""+Gt).toLowerCase(),lr=!0}}at.byteLength=pt;function mt(Xt,Gt,Wt){let er=!1;if((Gt===void 0||Gt<0)&&(Gt=0),Gt>this.length||((Wt===void 0||Wt>this.length)&&(Wt=this.length),Wt<=0)||(Wt>>>=0,Gt>>>=0,Wt<=Gt))return"";for(Xt||(Xt="utf8");;)switch(Xt){case"hex":return Pt(this,Gt,Wt);case"utf8":case"utf-8":return Tt(this,Gt,Wt);case"ascii":return It(this,Gt,Wt);case"latin1":case"binary":return yt(this,Gt,Wt);case"base64":return Rt(this,Gt,Wt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,Gt,Wt);default:if(er)throw new TypeError("Unknown encoding: "+Xt);Xt=(Xt+"").toLowerCase(),er=!0}}at.prototype._isBuffer=!0;function ct(Xt,Gt,Wt){const er=Xt[Gt];Xt[Gt]=Xt[Wt],Xt[Wt]=er}at.prototype.swap16=function(){const Gt=this.length;if(Gt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Wt=0;Wt<Gt;Wt+=2)ct(this,Wt,Wt+1);return this},at.prototype.swap32=function(){const Gt=this.length;if(Gt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Wt=0;Wt<Gt;Wt+=4)ct(this,Wt,Wt+3),ct(this,Wt+1,Wt+2);return this},at.prototype.swap64=function(){const Gt=this.length;if(Gt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Wt=0;Wt<Gt;Wt+=8)ct(this,Wt,Wt+7),ct(this,Wt+1,Wt+6),ct(this,Wt+2,Wt+5),ct(this,Wt+3,Wt+4);return this},at.prototype.toString=function(){const Gt=this.length;return Gt===0?"":arguments.length===0?Tt(this,0,Gt):mt.apply(this,arguments)},at.prototype.toLocaleString=at.prototype.toString,at.prototype.equals=function(Gt){if(!at.isBuffer(Gt))throw new TypeError("Argument must be a Buffer");return this===Gt?!0:at.compare(this,Gt)===0},at.prototype.inspect=function(){let Gt="";const Wt=a.INSPECT_MAX_BYTES;return Gt=this.toString("hex",0,Wt).replace(/(.{2})/g,"$1 ").trim(),this.length>Wt&&(Gt+=" ... "),"<Buffer "+Gt+">"},_&&(at.prototype[_]=at.prototype.inspect),at.prototype.compare=function(Gt,Wt,er,lr,ur){if(tr(Gt,Uint8Array)&&(Gt=at.from(Gt,Gt.offset,Gt.byteLength)),!at.isBuffer(Gt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Gt);if(Wt===void 0&&(Wt=0),er===void 0&&(er=Gt?Gt.length:0),lr===void 0&&(lr=0),ur===void 0&&(ur=this.length),Wt<0||er>Gt.length||lr<0||ur>this.length)throw new RangeError("out of range index");if(lr>=ur&&Wt>=er)return 0;if(lr>=ur)return-1;if(Wt>=er)return 1;if(Wt>>>=0,er>>>=0,lr>>>=0,ur>>>=0,this===Gt)return 0;let pr=ur-lr,yr=er-Wt;const Er=Math.min(pr,yr),br=this.slice(lr,ur),gr=Gt.slice(Wt,er);for(let Ar=0;Ar<Er;++Ar)if(br[Ar]!==gr[Ar]){pr=br[Ar],yr=gr[Ar];break}return pr<yr?-1:yr<pr?1:0};function vt(Xt,Gt,Wt,er,lr){if(Xt.length===0)return-1;if(typeof Wt=="string"?(er=Wt,Wt=0):Wt>2147483647?Wt=2147483647:Wt<-2147483648&&(Wt=-2147483648),Wt=+Wt,ar(Wt)&&(Wt=lr?0:Xt.length-1),Wt<0&&(Wt=Xt.length+Wt),Wt>=Xt.length){if(lr)return-1;Wt=Xt.length-1}else if(Wt<0)if(lr)Wt=0;else return-1;if(typeof Gt=="string"&&(Gt=at.from(Gt,er)),at.isBuffer(Gt))return Gt.length===0?-1:At(Xt,Gt,Wt,er,lr);if(typeof Gt=="number")return Gt=Gt&255,typeof Uint8Array.prototype.indexOf=="function"?lr?Uint8Array.prototype.indexOf.call(Xt,Gt,Wt):Uint8Array.prototype.lastIndexOf.call(Xt,Gt,Wt):At(Xt,[Gt],Wt,er,lr);throw new TypeError("val must be string, number or Buffer")}function At(Xt,Gt,Wt,er,lr){let ur=1,pr=Xt.length,yr=Gt.length;if(er!==void 0&&(er=String(er).toLowerCase(),er==="ucs2"||er==="ucs-2"||er==="utf16le"||er==="utf-16le")){if(Xt.length<2||Gt.length<2)return-1;ur=2,pr/=2,yr/=2,Wt/=2}function Er(gr,Ar){return ur===1?gr[Ar]:gr.readUInt16BE(Ar*ur)}let br;if(lr){let gr=-1;for(br=Wt;br<pr;br++)if(Er(Xt,br)===Er(Gt,gr===-1?0:br-gr)){if(gr===-1&&(gr=br),br-gr+1===yr)return gr*ur}else gr!==-1&&(br-=br-gr),gr=-1}else for(Wt+yr>pr&&(Wt=pr-yr),br=Wt;br>=0;br--){let gr=!0;for(let Ar=0;Ar<yr;Ar++)if(Er(Xt,br+Ar)!==Er(Gt,Ar)){gr=!1;break}if(gr)return br}return-1}at.prototype.includes=function(Gt,Wt,er){return this.indexOf(Gt,Wt,er)!==-1},at.prototype.indexOf=function(Gt,Wt,er){return vt(this,Gt,Wt,er,!0)},at.prototype.lastIndexOf=function(Gt,Wt,er){return vt(this,Gt,Wt,er,!1)};function xt(Xt,Gt,Wt,er){Wt=Number(Wt)||0;const lr=Xt.length-Wt;er?(er=Number(er),er>lr&&(er=lr)):er=lr;const ur=Gt.length;er>ur/2&&(er=ur/2);let pr;for(pr=0;pr<er;++pr){const yr=parseInt(Gt.substr(pr*2,2),16);if(ar(yr))return pr;Xt[Wt+pr]=yr}return pr}function bt(Xt,Gt,Wt,er){return nr(Jt(Gt,Xt.length-Wt),Xt,Wt,er)}function Et(Xt,Gt,Wt,er){return nr(rr(Gt),Xt,Wt,er)}function St(Xt,Gt,Wt,er){return nr(Kt(Gt),Xt,Wt,er)}function Dt(Xt,Gt,Wt,er){return nr(Yt(Gt,Xt.length-Wt),Xt,Wt,er)}at.prototype.write=function(Gt,Wt,er,lr){if(Wt===void 0)lr="utf8",er=this.length,Wt=0;else if(er===void 0&&typeof Wt=="string")lr=Wt,er=this.length,Wt=0;else if(isFinite(Wt))Wt=Wt>>>0,isFinite(er)?(er=er>>>0,lr===void 0&&(lr="utf8")):(lr=er,er=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ur=this.length-Wt;if((er===void 0||er>ur)&&(er=ur),Gt.length>0&&(er<0||Wt<0)||Wt>this.length)throw new RangeError("Attempt to write outside buffer bounds");lr||(lr="utf8");let pr=!1;for(;;)switch(lr){case"hex":return xt(this,Gt,Wt,er);case"utf8":case"utf-8":return bt(this,Gt,Wt,er);case"ascii":case"latin1":case"binary":return Et(this,Gt,Wt,er);case"base64":return St(this,Gt,Wt,er);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,Gt,Wt,er);default:if(pr)throw new TypeError("Unknown encoding: "+lr);lr=(""+lr).toLowerCase(),pr=!0}},at.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rt(Xt,Gt,Wt){return Gt===0&&Wt===Xt.length?s.fromByteArray(Xt):s.fromByteArray(Xt.slice(Gt,Wt))}function Tt(Xt,Gt,Wt){Wt=Math.min(Xt.length,Wt);const er=[];let lr=Gt;for(;lr<Wt;){const ur=Xt[lr];let pr=null,yr=ur>239?4:ur>223?3:ur>191?2:1;if(lr+yr<=Wt){let Er,br,gr,Ar;switch(yr){case 1:ur<128&&(pr=ur);break;case 2:Er=Xt[lr+1],(Er&192)===128&&(Ar=(ur&31)<<6|Er&63,Ar>127&&(pr=Ar));break;case 3:Er=Xt[lr+1],br=Xt[lr+2],(Er&192)===128&&(br&192)===128&&(Ar=(ur&15)<<12|(Er&63)<<6|br&63,Ar>2047&&(Ar<55296||Ar>57343)&&(pr=Ar));break;case 4:Er=Xt[lr+1],br=Xt[lr+2],gr=Xt[lr+3],(Er&192)===128&&(br&192)===128&&(gr&192)===128&&(Ar=(ur&15)<<18|(Er&63)<<12|(br&63)<<6|gr&63,Ar>65535&&Ar<1114112&&(pr=Ar))}}pr===null?(pr=65533,yr=1):pr>65535&&(pr-=65536,er.push(pr>>>10&1023|55296),pr=56320|pr&1023),er.push(pr),lr+=yr}return Ct(er)}const wt=4096;function Ct(Xt){const Gt=Xt.length;if(Gt<=wt)return String.fromCharCode.apply(String,Xt);let Wt="",er=0;for(;er<Gt;)Wt+=String.fromCharCode.apply(String,Xt.slice(er,er+=wt));return Wt}function It(Xt,Gt,Wt){let er="";Wt=Math.min(Xt.length,Wt);for(let lr=Gt;lr<Wt;++lr)er+=String.fromCharCode(Xt[lr]&127);return er}function yt(Xt,Gt,Wt){let er="";Wt=Math.min(Xt.length,Wt);for(let lr=Gt;lr<Wt;++lr)er+=String.fromCharCode(Xt[lr]);return er}function Pt(Xt,Gt,Wt){const er=Xt.length;(!Gt||Gt<0)&&(Gt=0),(!Wt||Wt<0||Wt>er)&&(Wt=er);let lr="";for(let ur=Gt;ur<Wt;++ur)lr+=sr[Xt[ur]];return lr}function kt(Xt,Gt,Wt){const er=Xt.slice(Gt,Wt);let lr="";for(let ur=0;ur<er.length-1;ur+=2)lr+=String.fromCharCode(er[ur]+er[ur+1]*256);return lr}at.prototype.slice=function(Gt,Wt){const er=this.length;Gt=~~Gt,Wt=Wt===void 0?er:~~Wt,Gt<0?(Gt+=er,Gt<0&&(Gt=0)):Gt>er&&(Gt=er),Wt<0?(Wt+=er,Wt<0&&(Wt=0)):Wt>er&&(Wt=er),Wt<Gt&&(Wt=Gt);const lr=this.subarray(Gt,Wt);return Object.setPrototypeOf(lr,at.prototype),lr};function jt(Xt,Gt,Wt){if(Xt%1!==0||Xt<0)throw new RangeError("offset is not uint");if(Xt+Gt>Wt)throw new RangeError("Trying to access beyond buffer length")}at.prototype.readUintLE=at.prototype.readUIntLE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt],ur=1,pr=0;for(;++pr<Wt&&(ur*=256);)lr+=this[Gt+pr]*ur;return lr},at.prototype.readUintBE=at.prototype.readUIntBE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt+--Wt],ur=1;for(;Wt>0&&(ur*=256);)lr+=this[Gt+--Wt]*ur;return lr},at.prototype.readUint8=at.prototype.readUInt8=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,1,this.length),this[Gt]},at.prototype.readUint16LE=at.prototype.readUInt16LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,2,this.length),this[Gt]|this[Gt+1]<<8},at.prototype.readUint16BE=at.prototype.readUInt16BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,2,this.length),this[Gt]<<8|this[Gt+1]},at.prototype.readUint32LE=at.prototype.readUInt32LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),(this[Gt]|this[Gt+1]<<8|this[Gt+2]<<16)+this[Gt+3]*16777216},at.prototype.readUint32BE=at.prototype.readUInt32BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]*16777216+(this[Gt+1]<<16|this[Gt+2]<<8|this[Gt+3])},at.prototype.readBigUInt64LE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=Wt+this[++Gt]*2**8+this[++Gt]*2**16+this[++Gt]*2**24,ur=this[++Gt]+this[++Gt]*2**8+this[++Gt]*2**16+er*2**24;return BigInt(lr)+(BigInt(ur)<<BigInt(32))}),at.prototype.readBigUInt64BE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=Wt*2**24+this[++Gt]*2**16+this[++Gt]*2**8+this[++Gt],ur=this[++Gt]*2**24+this[++Gt]*2**16+this[++Gt]*2**8+er;return(BigInt(lr)<<BigInt(32))+BigInt(ur)}),at.prototype.readIntLE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt],ur=1,pr=0;for(;++pr<Wt&&(ur*=256);)lr+=this[Gt+pr]*ur;return ur*=128,lr>=ur&&(lr-=Math.pow(2,8*Wt)),lr},at.prototype.readIntBE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=Wt,ur=1,pr=this[Gt+--lr];for(;lr>0&&(ur*=256);)pr+=this[Gt+--lr]*ur;return ur*=128,pr>=ur&&(pr-=Math.pow(2,8*Wt)),pr},at.prototype.readInt8=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,1,this.length),this[Gt]&128?(255-this[Gt]+1)*-1:this[Gt]},at.prototype.readInt16LE=function(Gt,Wt){Gt=Gt>>>0,Wt||jt(Gt,2,this.length);const er=this[Gt]|this[Gt+1]<<8;return er&32768?er|4294901760:er},at.prototype.readInt16BE=function(Gt,Wt){Gt=Gt>>>0,Wt||jt(Gt,2,this.length);const er=this[Gt+1]|this[Gt]<<8;return er&32768?er|4294901760:er},at.prototype.readInt32LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]|this[Gt+1]<<8|this[Gt+2]<<16|this[Gt+3]<<24},at.prototype.readInt32BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]<<24|this[Gt+1]<<16|this[Gt+2]<<8|this[Gt+3]},at.prototype.readBigInt64LE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=this[Gt+4]+this[Gt+5]*2**8+this[Gt+6]*2**16+(er<<24);return(BigInt(lr)<<BigInt(32))+BigInt(Wt+this[++Gt]*2**8+this[++Gt]*2**16+this[++Gt]*2**24)}),at.prototype.readBigInt64BE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=(Wt<<24)+this[++Gt]*2**16+this[++Gt]*2**8+this[++Gt];return(BigInt(lr)<<BigInt(32))+BigInt(this[++Gt]*2**24+this[++Gt]*2**16+this[++Gt]*2**8+er)}),at.prototype.readFloatLE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),$.read(this,Gt,!0,23,4)},at.prototype.readFloatBE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),$.read(this,Gt,!1,23,4)},at.prototype.readDoubleLE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,8,this.length),$.read(this,Gt,!0,52,8)},at.prototype.readDoubleBE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,8,this.length),$.read(this,Gt,!1,52,8)};function Ht(Xt,Gt,Wt,er,lr,ur){if(!at.isBuffer(Xt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Gt>lr||Gt<ur)throw new RangeError('"value" argument is out of bounds');if(Wt+er>Xt.length)throw new RangeError("Index out of range")}at.prototype.writeUintLE=at.prototype.writeUIntLE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,er=er>>>0,!lr){const yr=Math.pow(2,8*er)-1;Ht(this,Gt,Wt,er,yr,0)}let ur=1,pr=0;for(this[Wt]=Gt&255;++pr<er&&(ur*=256);)this[Wt+pr]=Gt/ur&255;return Wt+er},at.prototype.writeUintBE=at.prototype.writeUIntBE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,er=er>>>0,!lr){const yr=Math.pow(2,8*er)-1;Ht(this,Gt,Wt,er,yr,0)}let ur=er-1,pr=1;for(this[Wt+ur]=Gt&255;--ur>=0&&(pr*=256);)this[Wt+ur]=Gt/pr&255;return Wt+er},at.prototype.writeUint8=at.prototype.writeUInt8=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,1,255,0),this[Wt]=Gt&255,Wt+1},at.prototype.writeUint16LE=at.prototype.writeUInt16LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,65535,0),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,Wt+2},at.prototype.writeUint16BE=at.prototype.writeUInt16BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,65535,0),this[Wt]=Gt>>>8,this[Wt+1]=Gt&255,Wt+2},at.prototype.writeUint32LE=at.prototype.writeUInt32LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,4294967295,0),this[Wt+3]=Gt>>>24,this[Wt+2]=Gt>>>16,this[Wt+1]=Gt>>>8,this[Wt]=Gt&255,Wt+4},at.prototype.writeUint32BE=at.prototype.writeUInt32BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,4294967295,0),this[Wt]=Gt>>>24,this[Wt+1]=Gt>>>16,this[Wt+2]=Gt>>>8,this[Wt+3]=Gt&255,Wt+4};function Ft(Xt,Gt,Wt,er,lr){Vt(Gt,er,lr,Xt,Wt,7);let ur=Number(Gt&BigInt(4294967295));Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur;let pr=Number(Gt>>BigInt(32)&BigInt(4294967295));return Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,Wt}function Lt(Xt,Gt,Wt,er,lr){Vt(Gt,er,lr,Xt,Wt,7);let ur=Number(Gt&BigInt(4294967295));Xt[Wt+7]=ur,ur=ur>>8,Xt[Wt+6]=ur,ur=ur>>8,Xt[Wt+5]=ur,ur=ur>>8,Xt[Wt+4]=ur;let pr=Number(Gt>>BigInt(32)&BigInt(4294967295));return Xt[Wt+3]=pr,pr=pr>>8,Xt[Wt+2]=pr,pr=pr>>8,Xt[Wt+1]=pr,pr=pr>>8,Xt[Wt]=pr,Wt+8}at.prototype.writeBigUInt64LE=cr(function(Gt,Wt=0){return Ft(this,Gt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),at.prototype.writeBigUInt64BE=cr(function(Gt,Wt=0){return Lt(this,Gt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),at.prototype.writeIntLE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,!lr){const Er=Math.pow(2,8*er-1);Ht(this,Gt,Wt,er,Er-1,-Er)}let ur=0,pr=1,yr=0;for(this[Wt]=Gt&255;++ur<er&&(pr*=256);)Gt<0&&yr===0&&this[Wt+ur-1]!==0&&(yr=1),this[Wt+ur]=(Gt/pr>>0)-yr&255;return Wt+er},at.prototype.writeIntBE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,!lr){const Er=Math.pow(2,8*er-1);Ht(this,Gt,Wt,er,Er-1,-Er)}let ur=er-1,pr=1,yr=0;for(this[Wt+ur]=Gt&255;--ur>=0&&(pr*=256);)Gt<0&&yr===0&&this[Wt+ur+1]!==0&&(yr=1),this[Wt+ur]=(Gt/pr>>0)-yr&255;return Wt+er},at.prototype.writeInt8=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,1,127,-128),Gt<0&&(Gt=255+Gt+1),this[Wt]=Gt&255,Wt+1},at.prototype.writeInt16LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,32767,-32768),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,Wt+2},at.prototype.writeInt16BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,32767,-32768),this[Wt]=Gt>>>8,this[Wt+1]=Gt&255,Wt+2},at.prototype.writeInt32LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,2147483647,-2147483648),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,this[Wt+2]=Gt>>>16,this[Wt+3]=Gt>>>24,Wt+4},at.prototype.writeInt32BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,2147483647,-2147483648),Gt<0&&(Gt=4294967295+Gt+1),this[Wt]=Gt>>>24,this[Wt+1]=Gt>>>16,this[Wt+2]=Gt>>>8,this[Wt+3]=Gt&255,Wt+4},at.prototype.writeBigInt64LE=cr(function(Gt,Wt=0){return Ft(this,Gt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),at.prototype.writeBigInt64BE=cr(function(Gt,Wt=0){return Lt(this,Gt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nt(Xt,Gt,Wt,er,lr,ur){if(Wt+er>Xt.length)throw new RangeError("Index out of range");if(Wt<0)throw new RangeError("Index out of range")}function Bt(Xt,Gt,Wt,er,lr){return Gt=+Gt,Wt=Wt>>>0,lr||Nt(Xt,Gt,Wt,4),$.write(Xt,Gt,Wt,er,23,4),Wt+4}at.prototype.writeFloatLE=function(Gt,Wt,er){return Bt(this,Gt,Wt,!0,er)},at.prototype.writeFloatBE=function(Gt,Wt,er){return Bt(this,Gt,Wt,!1,er)};function _t(Xt,Gt,Wt,er,lr){return Gt=+Gt,Wt=Wt>>>0,lr||Nt(Xt,Gt,Wt,8),$.write(Xt,Gt,Wt,er,52,8),Wt+8}at.prototype.writeDoubleLE=function(Gt,Wt,er){return _t(this,Gt,Wt,!0,er)},at.prototype.writeDoubleBE=function(Gt,Wt,er){return _t(this,Gt,Wt,!1,er)},at.prototype.copy=function(Gt,Wt,er,lr){if(!at.isBuffer(Gt))throw new TypeError("argument should be a Buffer");if(er||(er=0),!lr&&lr!==0&&(lr=this.length),Wt>=Gt.length&&(Wt=Gt.length),Wt||(Wt=0),lr>0&&lr<er&&(lr=er),lr===er||Gt.length===0||this.length===0)return 0;if(Wt<0)throw new RangeError("targetStart out of bounds");if(er<0||er>=this.length)throw new RangeError("Index out of range");if(lr<0)throw new RangeError("sourceEnd out of bounds");lr>this.length&&(lr=this.length),Gt.length-Wt<lr-er&&(lr=Gt.length-Wt+er);const ur=lr-er;return this===Gt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Wt,er,lr):Uint8Array.prototype.set.call(Gt,this.subarray(er,lr),Wt),ur},at.prototype.fill=function(Gt,Wt,er,lr){if(typeof Gt=="string"){if(typeof Wt=="string"?(lr=Wt,Wt=0,er=this.length):typeof er=="string"&&(lr=er,er=this.length),lr!==void 0&&typeof lr!="string")throw new TypeError("encoding must be a string");if(typeof lr=="string"&&!at.isEncoding(lr))throw new TypeError("Unknown encoding: "+lr);if(Gt.length===1){const pr=Gt.charCodeAt(0);(lr==="utf8"&&pr<128||lr==="latin1")&&(Gt=pr)}}else typeof Gt=="number"?Gt=Gt&255:typeof Gt=="boolean"&&(Gt=Number(Gt));if(Wt<0||this.length<Wt||this.length<er)throw new RangeError("Out of range index");if(er<=Wt)return this;Wt=Wt>>>0,er=er===void 0?this.length:er>>>0,Gt||(Gt=0);let ur;if(typeof Gt=="number")for(ur=Wt;ur<er;++ur)this[ur]=Gt;else{const pr=at.isBuffer(Gt)?Gt:at.from(Gt,lr),yr=pr.length;if(yr===0)throw new TypeError('The value "'+Gt+'" is invalid for argument "value"');for(ur=0;ur<er-Wt;++ur)this[ur+Wt]=pr[ur%yr]}return this};const $t={};function Ot(Xt,Gt,Wt){$t[Xt]=class extends Wt{constructor(){super(),Object.defineProperty(this,"message",{value:Gt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Xt}]`,this.stack,delete this.name}get code(){return Xt}set code(lr){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:lr,writable:!0})}toString(){return`${this.name} [${Xt}]: ${this.message}`}}}Ot("ERR_BUFFER_OUT_OF_BOUNDS",function(Xt){return Xt?`${Xt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ot("ERR_INVALID_ARG_TYPE",function(Xt,Gt){return`The "${Xt}" argument must be of type number. Received type ${typeof Gt}`},TypeError),Ot("ERR_OUT_OF_RANGE",function(Xt,Gt,Wt){let er=`The value of "${Xt}" is out of range.`,lr=Wt;return Number.isInteger(Wt)&&Math.abs(Wt)>2**32?lr=Mt(String(Wt)):typeof Wt=="bigint"&&(lr=String(Wt),(Wt>BigInt(2)**BigInt(32)||Wt<-(BigInt(2)**BigInt(32)))&&(lr=Mt(lr)),lr+="n"),er+=` It must be ${Gt}. Received ${lr}`,er},RangeError);function Mt(Xt){let Gt="",Wt=Xt.length;const er=Xt[0]==="-"?1:0;for(;Wt>=er+4;Wt-=3)Gt=`_${Xt.slice(Wt-3,Wt)}${Gt}`;return`${Xt.slice(0,Wt)}${Gt}`}function Ut(Xt,Gt,Wt){Qt(Gt,"offset"),(Xt[Gt]===void 0||Xt[Gt+Wt]===void 0)&&qt(Gt,Xt.length-(Wt+1))}function Vt(Xt,Gt,Wt,er,lr,ur){if(Xt>Wt||Xt<Gt){const pr=typeof Gt=="bigint"?"n":"";let yr;throw ur>3?Gt===0||Gt===BigInt(0)?yr=`>= 0${pr} and < 2${pr} ** ${(ur+1)*8}${pr}`:yr=`>= -(2${pr} ** ${(ur+1)*8-1}${pr}) and < 2 ** ${(ur+1)*8-1}${pr}`:yr=`>= ${Gt}${pr} and <= ${Wt}${pr}`,new $t.ERR_OUT_OF_RANGE("value",yr,Xt)}Ut(er,lr,ur)}function Qt(Xt,Gt){if(typeof Xt!="number")throw new $t.ERR_INVALID_ARG_TYPE(Gt,"number",Xt)}function qt(Xt,Gt,Wt){throw Math.floor(Xt)!==Xt?(Qt(Xt,Wt),new $t.ERR_OUT_OF_RANGE(Wt||"offset","an integer",Xt)):Gt<0?new $t.ERR_BUFFER_OUT_OF_BOUNDS:new $t.ERR_OUT_OF_RANGE(Wt||"offset",`>= ${Wt?1:0} and <= ${Gt}`,Xt)}const Zt=/[^+/0-9A-Za-z-_]/g;function ir(Xt){if(Xt=Xt.split("=")[0],Xt=Xt.trim().replace(Zt,""),Xt.length<2)return"";for(;Xt.length%4!==0;)Xt=Xt+"=";return Xt}function Jt(Xt,Gt){Gt=Gt||1/0;let Wt;const er=Xt.length;let lr=null;const ur=[];for(let pr=0;pr<er;++pr){if(Wt=Xt.charCodeAt(pr),Wt>55295&&Wt<57344){if(!lr){if(Wt>56319){(Gt-=3)>-1&&ur.push(239,191,189);continue}else if(pr+1===er){(Gt-=3)>-1&&ur.push(239,191,189);continue}lr=Wt;continue}if(Wt<56320){(Gt-=3)>-1&&ur.push(239,191,189),lr=Wt;continue}Wt=(lr-55296<<10|Wt-56320)+65536}else lr&&(Gt-=3)>-1&&ur.push(239,191,189);if(lr=null,Wt<128){if((Gt-=1)<0)break;ur.push(Wt)}else if(Wt<2048){if((Gt-=2)<0)break;ur.push(Wt>>6|192,Wt&63|128)}else if(Wt<65536){if((Gt-=3)<0)break;ur.push(Wt>>12|224,Wt>>6&63|128,Wt&63|128)}else if(Wt<1114112){if((Gt-=4)<0)break;ur.push(Wt>>18|240,Wt>>12&63|128,Wt>>6&63|128,Wt&63|128)}else throw new Error("Invalid code point")}return ur}function rr(Xt){const Gt=[];for(let Wt=0;Wt<Xt.length;++Wt)Gt.push(Xt.charCodeAt(Wt)&255);return Gt}function Yt(Xt,Gt){let Wt,er,lr;const ur=[];for(let pr=0;pr<Xt.length&&!((Gt-=2)<0);++pr)Wt=Xt.charCodeAt(pr),er=Wt>>8,lr=Wt%256,ur.push(lr),ur.push(er);return ur}function Kt(Xt){return s.toByteArray(ir(Xt))}function nr(Xt,Gt,Wt,er){let lr;for(lr=0;lr<er&&!(lr+Wt>=Gt.length||lr>=Xt.length);++lr)Gt[lr+Wt]=Xt[lr];return lr}function tr(Xt,Gt){return Xt instanceof Gt||Xt!=null&&Xt.constructor!=null&&Xt.constructor.name!=null&&Xt.constructor.name===Gt.name}function ar(Xt){return Xt!==Xt}const sr=function(){const Xt="0123456789abcdef",Gt=new Array(256);for(let Wt=0;Wt<16;++Wt){const er=Wt*16;for(let lr=0;lr<16;++lr)Gt[er+lr]=Xt[Wt]+Xt[lr]}return Gt}();function cr(Xt){return typeof BigInt>"u"?or:Xt}function or(){throw new Error("BigInt not supported")}})(buffer$1);const langs=["en","ja","ar","th","pl","it","de"],Lang=z.enum(langs);z.object({cancel:z.string(),field:z.string(),fieldName:z.string(),align:z.string(),width:z.string(),opacity:z.string(),height:z.string(),rotate:z.string(),edit:z.string(),plsInputName:z.string(),fieldMustUniq:z.string(),notUniq:z.string(),noKeyName:z.string(),fieldsList:z.string(),addNewField:z.string(),editField:z.string(),type:z.string(),errorOccurred:z.string(),errorBulkUpdateFieldName:z.string(),commitBulkUpdateFieldName:z.string(),bulkUpdateFieldName:z.string(),hexColorPrompt:z.string(),"schemas.color":z.string(),"schemas.borderWidth":z.string(),"schemas.borderColor":z.string(),"schemas.textColor":z.string(),"schemas.bgColor":z.string(),"schemas.horizontal":z.string(),"schemas.vertical":z.string(),"schemas.left":z.string(),"schemas.center":z.string(),"schemas.right":z.string(),"schemas.top":z.string(),"schemas.middle":z.string(),"schemas.bottom":z.string(),"schemas.text.fontName":z.string(),"schemas.text.size":z.string(),"schemas.text.spacing":z.string(),"schemas.text.textAlign":z.string(),"schemas.text.verticalAlign":z.string(),"schemas.text.lineHeight":z.string(),"schemas.text.min":z.string(),"schemas.text.max":z.string(),"schemas.text.fit":z.string(),"schemas.text.dynamicFontSize":z.string(),"schemas.barcodes.barColor":z.string(),"schemas.barcodes.includetext":z.string()}),z.enum(["viewer","form","designer"]),z.object({height:z.number(),width:z.number()});const Schema$1=z.object({type:z.string(),readOnly:z.boolean().optional(),readOnlyValue:z.string().optional(),position:z.object({x:z.number(),y:z.number()}),width:z.number(),height:z.number(),rotate:z.number().optional(),opacity:z.number().optional()}).passthrough(),SchemaForUIAdditionalInfo=z.object({id:z.string(),key:z.string(),data:z.string()});Schema$1.merge(SchemaForUIAdditionalInfo);const ArrayBufferSchema=z.any().refine(a=>a instanceof ArrayBuffer),Uint8ArraySchema=z.any().refine(a=>a instanceof Uint8Array),Font=z.record(z.object({data:z.union([z.string(),ArrayBufferSchema,Uint8ArraySchema]),fallback:z.boolean().optional(),subset:z.boolean().optional()})),BasePdf=z.union([z.string(),ArrayBufferSchema,Uint8ArraySchema]),Template=z.object({schemas:z.array(z.record(Schema$1)),basePdf:BasePdf,sampledata:z.array(z.record(z.string())).length(1).optional(),columns:z.array(z.string()).optional()}),Inputs=z.array(z.record(z.string())).min(1),CommonOptions=z.object({font:Font.optional()}).passthrough(),CommonProps=z.object({template:Template,options:CommonOptions.optional(),plugins:z.record(z.object({ui:z.any(),pdf:z.any(),propPanel:z.any()})).optional()}),GeneratorOptions=CommonOptions.extend({author:z.string().optional(),creationDate:z.date().optional(),creator:z.string().optional(),keywords:z.array(z.string()).optional(),language:z.string().optional(),modificationDate:z.date().optional(),producer:z.string().optional(),subject:z.string().optional(),title:z.string().optional()});CommonProps.extend({inputs:Inputs,options:GeneratorOptions.optional()}).strict();const UIOptions=CommonOptions.extend({lang:Lang.optional(),labels:z.record(z.string(),z.string()).optional(),theme:z.record(z.string(),z.unknown()).optional()}),HTMLElementSchema=z.any().refine(a=>a instanceof HTMLElement),UIProps=CommonProps.extend({domContainer:HTMLElementSchema,options:UIOptions.optional()}),PreviewProps=UIProps.extend({inputs:Inputs}).strict(),DesignerProps=UIProps.extend({}).strict(),uniq=a=>Array.from(new Set(a)),getFallbackFontName=a=>{const s="",$=Object.entries(a).reduce((_,_e)=>{const[tt,nt]=_e;return!_&&nt.fallback?tt:_},s);if($===s)throw Error("[@pdfme/common] fallback flag is not found in font. true fallback flag must be only one.");return $},getDefaultFont=()=>({[DEFAULT_FONT_NAME]:{data:b64toUint8Array(DEFAULT_FONT_VALUE),fallback:!0}}),mm2pt=a=>parseFloat(String(a))*MM_TO_PT_RATIO,pt2mm=a=>a*PT_TO_MM_RATIO,pt2px=a=>a*PT_TO_PX_RATIO,blob2Base64Pdf=a=>new Promise((s,$)=>{const _=new FileReader;_.onloadend=()=>{_.result.startsWith("data:application/pdf;")?s(_.result):$(Error("[@pdfme/common] template.basePdf must be pdf data."))},_.readAsDataURL(a)}),isHexValid=a=>/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/i.test(a),getB64BasePdf=a=>typeof a=="string"&&!a.startsWith("data:application/pdf;")&&typeof window<"u"?fetch(a).then($=>$.blob()).then(blob2Base64Pdf).catch($=>{throw $}):a,getByteString=a=>buffer$1.Buffer.from(a,"base64").toString("binary"),b64toUint8Array=a=>{const s=a.split(";base64,")[1]?a.split(";base64,")[1]:a,$=getByteString(s),_=new Uint8Array($.length);for(let _e=0;_e<$.length;_e+=1)_[_e]=$.charCodeAt(_e);return _},getFontNamesInSchemas=a=>uniq(a.map(s=>Object.values(s).map($=>$.fontName??"")).reduce((s,$)=>s.concat($),[]).filter(Boolean)),checkFont=a=>{const{font:s,template:{schemas:$}}=a,_e=Object.values(s).reduce((at,ot)=>ot.fallback?at+1:at,0);if(_e===0)throw Error(`[@pdfme/common] fallback flag is not found in font. true fallback flag must be only one.
|
42
|
+
*/(function(a){const s=base64Js,$=ieee754,_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=at,a.SlowBuffer=gt,a.INSPECT_MAX_BYTES=50;const _e=2147483647;a.kMaxLength=_e,at.TYPED_ARRAY_SUPPORT=tt(),!at.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function tt(){try{const Xt=new Uint8Array(1),Gt={foo:function(){return 42}};return Object.setPrototypeOf(Gt,Uint8Array.prototype),Object.setPrototypeOf(Xt,Gt),Xt.foo()===42}catch{return!1}}Object.defineProperty(at.prototype,"parent",{enumerable:!0,get:function(){if(at.isBuffer(this))return this.buffer}}),Object.defineProperty(at.prototype,"offset",{enumerable:!0,get:function(){if(at.isBuffer(this))return this.byteOffset}});function nt(Xt){if(Xt>_e)throw new RangeError('The value "'+Xt+'" is invalid for option "size"');const Gt=new Uint8Array(Xt);return Object.setPrototypeOf(Gt,at.prototype),Gt}function at(Xt,Gt,Wt){if(typeof Xt=="number"){if(typeof Gt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return lt(Xt)}return ot(Xt,Gt,Wt)}at.poolSize=8192;function ot(Xt,Gt,Wt){if(typeof Xt=="string")return et(Xt,Gt);if(ArrayBuffer.isView(Xt))return ut(Xt);if(Xt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Xt);if(tr(Xt,ArrayBuffer)||Xt&&tr(Xt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tr(Xt,SharedArrayBuffer)||Xt&&tr(Xt.buffer,SharedArrayBuffer)))return ft(Xt,Gt,Wt);if(typeof Xt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const er=Xt.valueOf&&Xt.valueOf();if(er!=null&&er!==Xt)return at.from(er,Gt,Wt);const lr=ht(Xt);if(lr)return lr;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Xt[Symbol.toPrimitive]=="function")return at.from(Xt[Symbol.toPrimitive]("string"),Gt,Wt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Xt)}at.from=function(Xt,Gt,Wt){return ot(Xt,Gt,Wt)},Object.setPrototypeOf(at.prototype,Uint8Array.prototype),Object.setPrototypeOf(at,Uint8Array);function rt(Xt){if(typeof Xt!="number")throw new TypeError('"size" argument must be of type number');if(Xt<0)throw new RangeError('The value "'+Xt+'" is invalid for option "size"')}function st(Xt,Gt,Wt){return rt(Xt),Xt<=0?nt(Xt):Gt!==void 0?typeof Wt=="string"?nt(Xt).fill(Gt,Wt):nt(Xt).fill(Gt):nt(Xt)}at.alloc=function(Xt,Gt,Wt){return st(Xt,Gt,Wt)};function lt(Xt){return rt(Xt),nt(Xt<0?0:dt(Xt)|0)}at.allocUnsafe=function(Xt){return lt(Xt)},at.allocUnsafeSlow=function(Xt){return lt(Xt)};function et(Xt,Gt){if((typeof Gt!="string"||Gt==="")&&(Gt="utf8"),!at.isEncoding(Gt))throw new TypeError("Unknown encoding: "+Gt);const Wt=pt(Xt,Gt)|0;let er=nt(Wt);const lr=er.write(Xt,Gt);return lr!==Wt&&(er=er.slice(0,lr)),er}function it(Xt){const Gt=Xt.length<0?0:dt(Xt.length)|0,Wt=nt(Gt);for(let er=0;er<Gt;er+=1)Wt[er]=Xt[er]&255;return Wt}function ut(Xt){if(tr(Xt,Uint8Array)){const Gt=new Uint8Array(Xt);return ft(Gt.buffer,Gt.byteOffset,Gt.byteLength)}return it(Xt)}function ft(Xt,Gt,Wt){if(Gt<0||Xt.byteLength<Gt)throw new RangeError('"offset" is outside of buffer bounds');if(Xt.byteLength<Gt+(Wt||0))throw new RangeError('"length" is outside of buffer bounds');let er;return Gt===void 0&&Wt===void 0?er=new Uint8Array(Xt):Wt===void 0?er=new Uint8Array(Xt,Gt):er=new Uint8Array(Xt,Gt,Wt),Object.setPrototypeOf(er,at.prototype),er}function ht(Xt){if(at.isBuffer(Xt)){const Gt=dt(Xt.length)|0,Wt=nt(Gt);return Wt.length===0||Xt.copy(Wt,0,0,Gt),Wt}if(Xt.length!==void 0)return typeof Xt.length!="number"||ar(Xt.length)?nt(0):it(Xt);if(Xt.type==="Buffer"&&Array.isArray(Xt.data))return it(Xt.data)}function dt(Xt){if(Xt>=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return Xt|0}function gt(Xt){return+Xt!=Xt&&(Xt=0),at.alloc(+Xt)}at.isBuffer=function(Gt){return Gt!=null&&Gt._isBuffer===!0&&Gt!==at.prototype},at.compare=function(Gt,Wt){if(tr(Gt,Uint8Array)&&(Gt=at.from(Gt,Gt.offset,Gt.byteLength)),tr(Wt,Uint8Array)&&(Wt=at.from(Wt,Wt.offset,Wt.byteLength)),!at.isBuffer(Gt)||!at.isBuffer(Wt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Gt===Wt)return 0;let er=Gt.length,lr=Wt.length;for(let ur=0,pr=Math.min(er,lr);ur<pr;++ur)if(Gt[ur]!==Wt[ur]){er=Gt[ur],lr=Wt[ur];break}return er<lr?-1:lr<er?1:0},at.isEncoding=function(Gt){switch(String(Gt).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},at.concat=function(Gt,Wt){if(!Array.isArray(Gt))throw new TypeError('"list" argument must be an Array of Buffers');if(Gt.length===0)return at.alloc(0);let er;if(Wt===void 0)for(Wt=0,er=0;er<Gt.length;++er)Wt+=Gt[er].length;const lr=at.allocUnsafe(Wt);let ur=0;for(er=0;er<Gt.length;++er){let pr=Gt[er];if(tr(pr,Uint8Array))ur+pr.length>lr.length?(at.isBuffer(pr)||(pr=at.from(pr)),pr.copy(lr,ur)):Uint8Array.prototype.set.call(lr,pr,ur);else if(at.isBuffer(pr))pr.copy(lr,ur);else throw new TypeError('"list" argument must be an Array of Buffers');ur+=pr.length}return lr};function pt(Xt,Gt){if(at.isBuffer(Xt))return Xt.length;if(ArrayBuffer.isView(Xt)||tr(Xt,ArrayBuffer))return Xt.byteLength;if(typeof Xt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Xt);const Wt=Xt.length,er=arguments.length>2&&arguments[2]===!0;if(!er&&Wt===0)return 0;let lr=!1;for(;;)switch(Gt){case"ascii":case"latin1":case"binary":return Wt;case"utf8":case"utf-8":return Jt(Xt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt*2;case"hex":return Wt>>>1;case"base64":return Kt(Xt).length;default:if(lr)return er?-1:Jt(Xt).length;Gt=(""+Gt).toLowerCase(),lr=!0}}at.byteLength=pt;function mt(Xt,Gt,Wt){let er=!1;if((Gt===void 0||Gt<0)&&(Gt=0),Gt>this.length||((Wt===void 0||Wt>this.length)&&(Wt=this.length),Wt<=0)||(Wt>>>=0,Gt>>>=0,Wt<=Gt))return"";for(Xt||(Xt="utf8");;)switch(Xt){case"hex":return Pt(this,Gt,Wt);case"utf8":case"utf-8":return Tt(this,Gt,Wt);case"ascii":return It(this,Gt,Wt);case"latin1":case"binary":return yt(this,Gt,Wt);case"base64":return Rt(this,Gt,Wt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,Gt,Wt);default:if(er)throw new TypeError("Unknown encoding: "+Xt);Xt=(Xt+"").toLowerCase(),er=!0}}at.prototype._isBuffer=!0;function ct(Xt,Gt,Wt){const er=Xt[Gt];Xt[Gt]=Xt[Wt],Xt[Wt]=er}at.prototype.swap16=function(){const Gt=this.length;if(Gt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Wt=0;Wt<Gt;Wt+=2)ct(this,Wt,Wt+1);return this},at.prototype.swap32=function(){const Gt=this.length;if(Gt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Wt=0;Wt<Gt;Wt+=4)ct(this,Wt,Wt+3),ct(this,Wt+1,Wt+2);return this},at.prototype.swap64=function(){const Gt=this.length;if(Gt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Wt=0;Wt<Gt;Wt+=8)ct(this,Wt,Wt+7),ct(this,Wt+1,Wt+6),ct(this,Wt+2,Wt+5),ct(this,Wt+3,Wt+4);return this},at.prototype.toString=function(){const Gt=this.length;return Gt===0?"":arguments.length===0?Tt(this,0,Gt):mt.apply(this,arguments)},at.prototype.toLocaleString=at.prototype.toString,at.prototype.equals=function(Gt){if(!at.isBuffer(Gt))throw new TypeError("Argument must be a Buffer");return this===Gt?!0:at.compare(this,Gt)===0},at.prototype.inspect=function(){let Gt="";const Wt=a.INSPECT_MAX_BYTES;return Gt=this.toString("hex",0,Wt).replace(/(.{2})/g,"$1 ").trim(),this.length>Wt&&(Gt+=" ... "),"<Buffer "+Gt+">"},_&&(at.prototype[_]=at.prototype.inspect),at.prototype.compare=function(Gt,Wt,er,lr,ur){if(tr(Gt,Uint8Array)&&(Gt=at.from(Gt,Gt.offset,Gt.byteLength)),!at.isBuffer(Gt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Gt);if(Wt===void 0&&(Wt=0),er===void 0&&(er=Gt?Gt.length:0),lr===void 0&&(lr=0),ur===void 0&&(ur=this.length),Wt<0||er>Gt.length||lr<0||ur>this.length)throw new RangeError("out of range index");if(lr>=ur&&Wt>=er)return 0;if(lr>=ur)return-1;if(Wt>=er)return 1;if(Wt>>>=0,er>>>=0,lr>>>=0,ur>>>=0,this===Gt)return 0;let pr=ur-lr,yr=er-Wt;const Er=Math.min(pr,yr),br=this.slice(lr,ur),gr=Gt.slice(Wt,er);for(let Ar=0;Ar<Er;++Ar)if(br[Ar]!==gr[Ar]){pr=br[Ar],yr=gr[Ar];break}return pr<yr?-1:yr<pr?1:0};function vt(Xt,Gt,Wt,er,lr){if(Xt.length===0)return-1;if(typeof Wt=="string"?(er=Wt,Wt=0):Wt>2147483647?Wt=2147483647:Wt<-2147483648&&(Wt=-2147483648),Wt=+Wt,ar(Wt)&&(Wt=lr?0:Xt.length-1),Wt<0&&(Wt=Xt.length+Wt),Wt>=Xt.length){if(lr)return-1;Wt=Xt.length-1}else if(Wt<0)if(lr)Wt=0;else return-1;if(typeof Gt=="string"&&(Gt=at.from(Gt,er)),at.isBuffer(Gt))return Gt.length===0?-1:At(Xt,Gt,Wt,er,lr);if(typeof Gt=="number")return Gt=Gt&255,typeof Uint8Array.prototype.indexOf=="function"?lr?Uint8Array.prototype.indexOf.call(Xt,Gt,Wt):Uint8Array.prototype.lastIndexOf.call(Xt,Gt,Wt):At(Xt,[Gt],Wt,er,lr);throw new TypeError("val must be string, number or Buffer")}function At(Xt,Gt,Wt,er,lr){let ur=1,pr=Xt.length,yr=Gt.length;if(er!==void 0&&(er=String(er).toLowerCase(),er==="ucs2"||er==="ucs-2"||er==="utf16le"||er==="utf-16le")){if(Xt.length<2||Gt.length<2)return-1;ur=2,pr/=2,yr/=2,Wt/=2}function Er(gr,Ar){return ur===1?gr[Ar]:gr.readUInt16BE(Ar*ur)}let br;if(lr){let gr=-1;for(br=Wt;br<pr;br++)if(Er(Xt,br)===Er(Gt,gr===-1?0:br-gr)){if(gr===-1&&(gr=br),br-gr+1===yr)return gr*ur}else gr!==-1&&(br-=br-gr),gr=-1}else for(Wt+yr>pr&&(Wt=pr-yr),br=Wt;br>=0;br--){let gr=!0;for(let Ar=0;Ar<yr;Ar++)if(Er(Xt,br+Ar)!==Er(Gt,Ar)){gr=!1;break}if(gr)return br}return-1}at.prototype.includes=function(Gt,Wt,er){return this.indexOf(Gt,Wt,er)!==-1},at.prototype.indexOf=function(Gt,Wt,er){return vt(this,Gt,Wt,er,!0)},at.prototype.lastIndexOf=function(Gt,Wt,er){return vt(this,Gt,Wt,er,!1)};function xt(Xt,Gt,Wt,er){Wt=Number(Wt)||0;const lr=Xt.length-Wt;er?(er=Number(er),er>lr&&(er=lr)):er=lr;const ur=Gt.length;er>ur/2&&(er=ur/2);let pr;for(pr=0;pr<er;++pr){const yr=parseInt(Gt.substr(pr*2,2),16);if(ar(yr))return pr;Xt[Wt+pr]=yr}return pr}function bt(Xt,Gt,Wt,er){return nr(Jt(Gt,Xt.length-Wt),Xt,Wt,er)}function Et(Xt,Gt,Wt,er){return nr(rr(Gt),Xt,Wt,er)}function St(Xt,Gt,Wt,er){return nr(Kt(Gt),Xt,Wt,er)}function Dt(Xt,Gt,Wt,er){return nr(Yt(Gt,Xt.length-Wt),Xt,Wt,er)}at.prototype.write=function(Gt,Wt,er,lr){if(Wt===void 0)lr="utf8",er=this.length,Wt=0;else if(er===void 0&&typeof Wt=="string")lr=Wt,er=this.length,Wt=0;else if(isFinite(Wt))Wt=Wt>>>0,isFinite(er)?(er=er>>>0,lr===void 0&&(lr="utf8")):(lr=er,er=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ur=this.length-Wt;if((er===void 0||er>ur)&&(er=ur),Gt.length>0&&(er<0||Wt<0)||Wt>this.length)throw new RangeError("Attempt to write outside buffer bounds");lr||(lr="utf8");let pr=!1;for(;;)switch(lr){case"hex":return xt(this,Gt,Wt,er);case"utf8":case"utf-8":return bt(this,Gt,Wt,er);case"ascii":case"latin1":case"binary":return Et(this,Gt,Wt,er);case"base64":return St(this,Gt,Wt,er);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,Gt,Wt,er);default:if(pr)throw new TypeError("Unknown encoding: "+lr);lr=(""+lr).toLowerCase(),pr=!0}},at.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rt(Xt,Gt,Wt){return Gt===0&&Wt===Xt.length?s.fromByteArray(Xt):s.fromByteArray(Xt.slice(Gt,Wt))}function Tt(Xt,Gt,Wt){Wt=Math.min(Xt.length,Wt);const er=[];let lr=Gt;for(;lr<Wt;){const ur=Xt[lr];let pr=null,yr=ur>239?4:ur>223?3:ur>191?2:1;if(lr+yr<=Wt){let Er,br,gr,Ar;switch(yr){case 1:ur<128&&(pr=ur);break;case 2:Er=Xt[lr+1],(Er&192)===128&&(Ar=(ur&31)<<6|Er&63,Ar>127&&(pr=Ar));break;case 3:Er=Xt[lr+1],br=Xt[lr+2],(Er&192)===128&&(br&192)===128&&(Ar=(ur&15)<<12|(Er&63)<<6|br&63,Ar>2047&&(Ar<55296||Ar>57343)&&(pr=Ar));break;case 4:Er=Xt[lr+1],br=Xt[lr+2],gr=Xt[lr+3],(Er&192)===128&&(br&192)===128&&(gr&192)===128&&(Ar=(ur&15)<<18|(Er&63)<<12|(br&63)<<6|gr&63,Ar>65535&&Ar<1114112&&(pr=Ar))}}pr===null?(pr=65533,yr=1):pr>65535&&(pr-=65536,er.push(pr>>>10&1023|55296),pr=56320|pr&1023),er.push(pr),lr+=yr}return Ct(er)}const wt=4096;function Ct(Xt){const Gt=Xt.length;if(Gt<=wt)return String.fromCharCode.apply(String,Xt);let Wt="",er=0;for(;er<Gt;)Wt+=String.fromCharCode.apply(String,Xt.slice(er,er+=wt));return Wt}function It(Xt,Gt,Wt){let er="";Wt=Math.min(Xt.length,Wt);for(let lr=Gt;lr<Wt;++lr)er+=String.fromCharCode(Xt[lr]&127);return er}function yt(Xt,Gt,Wt){let er="";Wt=Math.min(Xt.length,Wt);for(let lr=Gt;lr<Wt;++lr)er+=String.fromCharCode(Xt[lr]);return er}function Pt(Xt,Gt,Wt){const er=Xt.length;(!Gt||Gt<0)&&(Gt=0),(!Wt||Wt<0||Wt>er)&&(Wt=er);let lr="";for(let ur=Gt;ur<Wt;++ur)lr+=sr[Xt[ur]];return lr}function kt(Xt,Gt,Wt){const er=Xt.slice(Gt,Wt);let lr="";for(let ur=0;ur<er.length-1;ur+=2)lr+=String.fromCharCode(er[ur]+er[ur+1]*256);return lr}at.prototype.slice=function(Gt,Wt){const er=this.length;Gt=~~Gt,Wt=Wt===void 0?er:~~Wt,Gt<0?(Gt+=er,Gt<0&&(Gt=0)):Gt>er&&(Gt=er),Wt<0?(Wt+=er,Wt<0&&(Wt=0)):Wt>er&&(Wt=er),Wt<Gt&&(Wt=Gt);const lr=this.subarray(Gt,Wt);return Object.setPrototypeOf(lr,at.prototype),lr};function jt(Xt,Gt,Wt){if(Xt%1!==0||Xt<0)throw new RangeError("offset is not uint");if(Xt+Gt>Wt)throw new RangeError("Trying to access beyond buffer length")}at.prototype.readUintLE=at.prototype.readUIntLE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt],ur=1,pr=0;for(;++pr<Wt&&(ur*=256);)lr+=this[Gt+pr]*ur;return lr},at.prototype.readUintBE=at.prototype.readUIntBE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt+--Wt],ur=1;for(;Wt>0&&(ur*=256);)lr+=this[Gt+--Wt]*ur;return lr},at.prototype.readUint8=at.prototype.readUInt8=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,1,this.length),this[Gt]},at.prototype.readUint16LE=at.prototype.readUInt16LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,2,this.length),this[Gt]|this[Gt+1]<<8},at.prototype.readUint16BE=at.prototype.readUInt16BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,2,this.length),this[Gt]<<8|this[Gt+1]},at.prototype.readUint32LE=at.prototype.readUInt32LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),(this[Gt]|this[Gt+1]<<8|this[Gt+2]<<16)+this[Gt+3]*16777216},at.prototype.readUint32BE=at.prototype.readUInt32BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]*16777216+(this[Gt+1]<<16|this[Gt+2]<<8|this[Gt+3])},at.prototype.readBigUInt64LE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=Wt+this[++Gt]*2**8+this[++Gt]*2**16+this[++Gt]*2**24,ur=this[++Gt]+this[++Gt]*2**8+this[++Gt]*2**16+er*2**24;return BigInt(lr)+(BigInt(ur)<<BigInt(32))}),at.prototype.readBigUInt64BE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=Wt*2**24+this[++Gt]*2**16+this[++Gt]*2**8+this[++Gt],ur=this[++Gt]*2**24+this[++Gt]*2**16+this[++Gt]*2**8+er;return(BigInt(lr)<<BigInt(32))+BigInt(ur)}),at.prototype.readIntLE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=this[Gt],ur=1,pr=0;for(;++pr<Wt&&(ur*=256);)lr+=this[Gt+pr]*ur;return ur*=128,lr>=ur&&(lr-=Math.pow(2,8*Wt)),lr},at.prototype.readIntBE=function(Gt,Wt,er){Gt=Gt>>>0,Wt=Wt>>>0,er||jt(Gt,Wt,this.length);let lr=Wt,ur=1,pr=this[Gt+--lr];for(;lr>0&&(ur*=256);)pr+=this[Gt+--lr]*ur;return ur*=128,pr>=ur&&(pr-=Math.pow(2,8*Wt)),pr},at.prototype.readInt8=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,1,this.length),this[Gt]&128?(255-this[Gt]+1)*-1:this[Gt]},at.prototype.readInt16LE=function(Gt,Wt){Gt=Gt>>>0,Wt||jt(Gt,2,this.length);const er=this[Gt]|this[Gt+1]<<8;return er&32768?er|4294901760:er},at.prototype.readInt16BE=function(Gt,Wt){Gt=Gt>>>0,Wt||jt(Gt,2,this.length);const er=this[Gt+1]|this[Gt]<<8;return er&32768?er|4294901760:er},at.prototype.readInt32LE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]|this[Gt+1]<<8|this[Gt+2]<<16|this[Gt+3]<<24},at.prototype.readInt32BE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),this[Gt]<<24|this[Gt+1]<<16|this[Gt+2]<<8|this[Gt+3]},at.prototype.readBigInt64LE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=this[Gt+4]+this[Gt+5]*2**8+this[Gt+6]*2**16+(er<<24);return(BigInt(lr)<<BigInt(32))+BigInt(Wt+this[++Gt]*2**8+this[++Gt]*2**16+this[++Gt]*2**24)}),at.prototype.readBigInt64BE=cr(function(Gt){Gt=Gt>>>0,Qt(Gt,"offset");const Wt=this[Gt],er=this[Gt+7];(Wt===void 0||er===void 0)&&qt(Gt,this.length-8);const lr=(Wt<<24)+this[++Gt]*2**16+this[++Gt]*2**8+this[++Gt];return(BigInt(lr)<<BigInt(32))+BigInt(this[++Gt]*2**24+this[++Gt]*2**16+this[++Gt]*2**8+er)}),at.prototype.readFloatLE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),$.read(this,Gt,!0,23,4)},at.prototype.readFloatBE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,4,this.length),$.read(this,Gt,!1,23,4)},at.prototype.readDoubleLE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,8,this.length),$.read(this,Gt,!0,52,8)},at.prototype.readDoubleBE=function(Gt,Wt){return Gt=Gt>>>0,Wt||jt(Gt,8,this.length),$.read(this,Gt,!1,52,8)};function Ht(Xt,Gt,Wt,er,lr,ur){if(!at.isBuffer(Xt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Gt>lr||Gt<ur)throw new RangeError('"value" argument is out of bounds');if(Wt+er>Xt.length)throw new RangeError("Index out of range")}at.prototype.writeUintLE=at.prototype.writeUIntLE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,er=er>>>0,!lr){const yr=Math.pow(2,8*er)-1;Ht(this,Gt,Wt,er,yr,0)}let ur=1,pr=0;for(this[Wt]=Gt&255;++pr<er&&(ur*=256);)this[Wt+pr]=Gt/ur&255;return Wt+er},at.prototype.writeUintBE=at.prototype.writeUIntBE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,er=er>>>0,!lr){const yr=Math.pow(2,8*er)-1;Ht(this,Gt,Wt,er,yr,0)}let ur=er-1,pr=1;for(this[Wt+ur]=Gt&255;--ur>=0&&(pr*=256);)this[Wt+ur]=Gt/pr&255;return Wt+er},at.prototype.writeUint8=at.prototype.writeUInt8=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,1,255,0),this[Wt]=Gt&255,Wt+1},at.prototype.writeUint16LE=at.prototype.writeUInt16LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,65535,0),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,Wt+2},at.prototype.writeUint16BE=at.prototype.writeUInt16BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,65535,0),this[Wt]=Gt>>>8,this[Wt+1]=Gt&255,Wt+2},at.prototype.writeUint32LE=at.prototype.writeUInt32LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,4294967295,0),this[Wt+3]=Gt>>>24,this[Wt+2]=Gt>>>16,this[Wt+1]=Gt>>>8,this[Wt]=Gt&255,Wt+4},at.prototype.writeUint32BE=at.prototype.writeUInt32BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,4294967295,0),this[Wt]=Gt>>>24,this[Wt+1]=Gt>>>16,this[Wt+2]=Gt>>>8,this[Wt+3]=Gt&255,Wt+4};function Ft(Xt,Gt,Wt,er,lr){Vt(Gt,er,lr,Xt,Wt,7);let ur=Number(Gt&BigInt(4294967295));Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur,ur=ur>>8,Xt[Wt++]=ur;let pr=Number(Gt>>BigInt(32)&BigInt(4294967295));return Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,pr=pr>>8,Xt[Wt++]=pr,Wt}function Lt(Xt,Gt,Wt,er,lr){Vt(Gt,er,lr,Xt,Wt,7);let ur=Number(Gt&BigInt(4294967295));Xt[Wt+7]=ur,ur=ur>>8,Xt[Wt+6]=ur,ur=ur>>8,Xt[Wt+5]=ur,ur=ur>>8,Xt[Wt+4]=ur;let pr=Number(Gt>>BigInt(32)&BigInt(4294967295));return Xt[Wt+3]=pr,pr=pr>>8,Xt[Wt+2]=pr,pr=pr>>8,Xt[Wt+1]=pr,pr=pr>>8,Xt[Wt]=pr,Wt+8}at.prototype.writeBigUInt64LE=cr(function(Gt,Wt=0){return Ft(this,Gt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),at.prototype.writeBigUInt64BE=cr(function(Gt,Wt=0){return Lt(this,Gt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),at.prototype.writeIntLE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,!lr){const Er=Math.pow(2,8*er-1);Ht(this,Gt,Wt,er,Er-1,-Er)}let ur=0,pr=1,yr=0;for(this[Wt]=Gt&255;++ur<er&&(pr*=256);)Gt<0&&yr===0&&this[Wt+ur-1]!==0&&(yr=1),this[Wt+ur]=(Gt/pr>>0)-yr&255;return Wt+er},at.prototype.writeIntBE=function(Gt,Wt,er,lr){if(Gt=+Gt,Wt=Wt>>>0,!lr){const Er=Math.pow(2,8*er-1);Ht(this,Gt,Wt,er,Er-1,-Er)}let ur=er-1,pr=1,yr=0;for(this[Wt+ur]=Gt&255;--ur>=0&&(pr*=256);)Gt<0&&yr===0&&this[Wt+ur+1]!==0&&(yr=1),this[Wt+ur]=(Gt/pr>>0)-yr&255;return Wt+er},at.prototype.writeInt8=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,1,127,-128),Gt<0&&(Gt=255+Gt+1),this[Wt]=Gt&255,Wt+1},at.prototype.writeInt16LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,32767,-32768),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,Wt+2},at.prototype.writeInt16BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,2,32767,-32768),this[Wt]=Gt>>>8,this[Wt+1]=Gt&255,Wt+2},at.prototype.writeInt32LE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,2147483647,-2147483648),this[Wt]=Gt&255,this[Wt+1]=Gt>>>8,this[Wt+2]=Gt>>>16,this[Wt+3]=Gt>>>24,Wt+4},at.prototype.writeInt32BE=function(Gt,Wt,er){return Gt=+Gt,Wt=Wt>>>0,er||Ht(this,Gt,Wt,4,2147483647,-2147483648),Gt<0&&(Gt=4294967295+Gt+1),this[Wt]=Gt>>>24,this[Wt+1]=Gt>>>16,this[Wt+2]=Gt>>>8,this[Wt+3]=Gt&255,Wt+4},at.prototype.writeBigInt64LE=cr(function(Gt,Wt=0){return Ft(this,Gt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),at.prototype.writeBigInt64BE=cr(function(Gt,Wt=0){return Lt(this,Gt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nt(Xt,Gt,Wt,er,lr,ur){if(Wt+er>Xt.length)throw new RangeError("Index out of range");if(Wt<0)throw new RangeError("Index out of range")}function Bt(Xt,Gt,Wt,er,lr){return Gt=+Gt,Wt=Wt>>>0,lr||Nt(Xt,Gt,Wt,4),$.write(Xt,Gt,Wt,er,23,4),Wt+4}at.prototype.writeFloatLE=function(Gt,Wt,er){return Bt(this,Gt,Wt,!0,er)},at.prototype.writeFloatBE=function(Gt,Wt,er){return Bt(this,Gt,Wt,!1,er)};function _t(Xt,Gt,Wt,er,lr){return Gt=+Gt,Wt=Wt>>>0,lr||Nt(Xt,Gt,Wt,8),$.write(Xt,Gt,Wt,er,52,8),Wt+8}at.prototype.writeDoubleLE=function(Gt,Wt,er){return _t(this,Gt,Wt,!0,er)},at.prototype.writeDoubleBE=function(Gt,Wt,er){return _t(this,Gt,Wt,!1,er)},at.prototype.copy=function(Gt,Wt,er,lr){if(!at.isBuffer(Gt))throw new TypeError("argument should be a Buffer");if(er||(er=0),!lr&&lr!==0&&(lr=this.length),Wt>=Gt.length&&(Wt=Gt.length),Wt||(Wt=0),lr>0&&lr<er&&(lr=er),lr===er||Gt.length===0||this.length===0)return 0;if(Wt<0)throw new RangeError("targetStart out of bounds");if(er<0||er>=this.length)throw new RangeError("Index out of range");if(lr<0)throw new RangeError("sourceEnd out of bounds");lr>this.length&&(lr=this.length),Gt.length-Wt<lr-er&&(lr=Gt.length-Wt+er);const ur=lr-er;return this===Gt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Wt,er,lr):Uint8Array.prototype.set.call(Gt,this.subarray(er,lr),Wt),ur},at.prototype.fill=function(Gt,Wt,er,lr){if(typeof Gt=="string"){if(typeof Wt=="string"?(lr=Wt,Wt=0,er=this.length):typeof er=="string"&&(lr=er,er=this.length),lr!==void 0&&typeof lr!="string")throw new TypeError("encoding must be a string");if(typeof lr=="string"&&!at.isEncoding(lr))throw new TypeError("Unknown encoding: "+lr);if(Gt.length===1){const pr=Gt.charCodeAt(0);(lr==="utf8"&&pr<128||lr==="latin1")&&(Gt=pr)}}else typeof Gt=="number"?Gt=Gt&255:typeof Gt=="boolean"&&(Gt=Number(Gt));if(Wt<0||this.length<Wt||this.length<er)throw new RangeError("Out of range index");if(er<=Wt)return this;Wt=Wt>>>0,er=er===void 0?this.length:er>>>0,Gt||(Gt=0);let ur;if(typeof Gt=="number")for(ur=Wt;ur<er;++ur)this[ur]=Gt;else{const pr=at.isBuffer(Gt)?Gt:at.from(Gt,lr),yr=pr.length;if(yr===0)throw new TypeError('The value "'+Gt+'" is invalid for argument "value"');for(ur=0;ur<er-Wt;++ur)this[ur+Wt]=pr[ur%yr]}return this};const $t={};function Ot(Xt,Gt,Wt){$t[Xt]=class extends Wt{constructor(){super(),Object.defineProperty(this,"message",{value:Gt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Xt}]`,this.stack,delete this.name}get code(){return Xt}set code(lr){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:lr,writable:!0})}toString(){return`${this.name} [${Xt}]: ${this.message}`}}}Ot("ERR_BUFFER_OUT_OF_BOUNDS",function(Xt){return Xt?`${Xt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ot("ERR_INVALID_ARG_TYPE",function(Xt,Gt){return`The "${Xt}" argument must be of type number. Received type ${typeof Gt}`},TypeError),Ot("ERR_OUT_OF_RANGE",function(Xt,Gt,Wt){let er=`The value of "${Xt}" is out of range.`,lr=Wt;return Number.isInteger(Wt)&&Math.abs(Wt)>2**32?lr=Mt(String(Wt)):typeof Wt=="bigint"&&(lr=String(Wt),(Wt>BigInt(2)**BigInt(32)||Wt<-(BigInt(2)**BigInt(32)))&&(lr=Mt(lr)),lr+="n"),er+=` It must be ${Gt}. Received ${lr}`,er},RangeError);function Mt(Xt){let Gt="",Wt=Xt.length;const er=Xt[0]==="-"?1:0;for(;Wt>=er+4;Wt-=3)Gt=`_${Xt.slice(Wt-3,Wt)}${Gt}`;return`${Xt.slice(0,Wt)}${Gt}`}function Ut(Xt,Gt,Wt){Qt(Gt,"offset"),(Xt[Gt]===void 0||Xt[Gt+Wt]===void 0)&&qt(Gt,Xt.length-(Wt+1))}function Vt(Xt,Gt,Wt,er,lr,ur){if(Xt>Wt||Xt<Gt){const pr=typeof Gt=="bigint"?"n":"";let yr;throw ur>3?Gt===0||Gt===BigInt(0)?yr=`>= 0${pr} and < 2${pr} ** ${(ur+1)*8}${pr}`:yr=`>= -(2${pr} ** ${(ur+1)*8-1}${pr}) and < 2 ** ${(ur+1)*8-1}${pr}`:yr=`>= ${Gt}${pr} and <= ${Wt}${pr}`,new $t.ERR_OUT_OF_RANGE("value",yr,Xt)}Ut(er,lr,ur)}function Qt(Xt,Gt){if(typeof Xt!="number")throw new $t.ERR_INVALID_ARG_TYPE(Gt,"number",Xt)}function qt(Xt,Gt,Wt){throw Math.floor(Xt)!==Xt?(Qt(Xt,Wt),new $t.ERR_OUT_OF_RANGE(Wt||"offset","an integer",Xt)):Gt<0?new $t.ERR_BUFFER_OUT_OF_BOUNDS:new $t.ERR_OUT_OF_RANGE(Wt||"offset",`>= ${Wt?1:0} and <= ${Gt}`,Xt)}const Zt=/[^+/0-9A-Za-z-_]/g;function ir(Xt){if(Xt=Xt.split("=")[0],Xt=Xt.trim().replace(Zt,""),Xt.length<2)return"";for(;Xt.length%4!==0;)Xt=Xt+"=";return Xt}function Jt(Xt,Gt){Gt=Gt||1/0;let Wt;const er=Xt.length;let lr=null;const ur=[];for(let pr=0;pr<er;++pr){if(Wt=Xt.charCodeAt(pr),Wt>55295&&Wt<57344){if(!lr){if(Wt>56319){(Gt-=3)>-1&&ur.push(239,191,189);continue}else if(pr+1===er){(Gt-=3)>-1&&ur.push(239,191,189);continue}lr=Wt;continue}if(Wt<56320){(Gt-=3)>-1&&ur.push(239,191,189),lr=Wt;continue}Wt=(lr-55296<<10|Wt-56320)+65536}else lr&&(Gt-=3)>-1&&ur.push(239,191,189);if(lr=null,Wt<128){if((Gt-=1)<0)break;ur.push(Wt)}else if(Wt<2048){if((Gt-=2)<0)break;ur.push(Wt>>6|192,Wt&63|128)}else if(Wt<65536){if((Gt-=3)<0)break;ur.push(Wt>>12|224,Wt>>6&63|128,Wt&63|128)}else if(Wt<1114112){if((Gt-=4)<0)break;ur.push(Wt>>18|240,Wt>>12&63|128,Wt>>6&63|128,Wt&63|128)}else throw new Error("Invalid code point")}return ur}function rr(Xt){const Gt=[];for(let Wt=0;Wt<Xt.length;++Wt)Gt.push(Xt.charCodeAt(Wt)&255);return Gt}function Yt(Xt,Gt){let Wt,er,lr;const ur=[];for(let pr=0;pr<Xt.length&&!((Gt-=2)<0);++pr)Wt=Xt.charCodeAt(pr),er=Wt>>8,lr=Wt%256,ur.push(lr),ur.push(er);return ur}function Kt(Xt){return s.toByteArray(ir(Xt))}function nr(Xt,Gt,Wt,er){let lr;for(lr=0;lr<er&&!(lr+Wt>=Gt.length||lr>=Xt.length);++lr)Gt[lr+Wt]=Xt[lr];return lr}function tr(Xt,Gt){return Xt instanceof Gt||Xt!=null&&Xt.constructor!=null&&Xt.constructor.name!=null&&Xt.constructor.name===Gt.name}function ar(Xt){return Xt!==Xt}const sr=function(){const Xt="0123456789abcdef",Gt=new Array(256);for(let Wt=0;Wt<16;++Wt){const er=Wt*16;for(let lr=0;lr<16;++lr)Gt[er+lr]=Xt[Wt]+Xt[lr]}return Gt}();function cr(Xt){return typeof BigInt>"u"?or:Xt}function or(){throw new Error("BigInt not supported")}})(buffer$1);const langs=["en","ja","ar","th","pl","it","de"],Lang=z.enum(langs);z.object({cancel:z.string(),field:z.string(),fieldName:z.string(),align:z.string(),width:z.string(),opacity:z.string(),height:z.string(),rotate:z.string(),edit:z.string(),plsInputName:z.string(),fieldMustUniq:z.string(),notUniq:z.string(),noKeyName:z.string(),fieldsList:z.string(),addNewField:z.string(),editField:z.string(),type:z.string(),errorOccurred:z.string(),errorBulkUpdateFieldName:z.string(),commitBulkUpdateFieldName:z.string(),bulkUpdateFieldName:z.string(),hexColorPrompt:z.string(),"schemas.color":z.string(),"schemas.borderWidth":z.string(),"schemas.borderColor":z.string(),"schemas.textColor":z.string(),"schemas.bgColor":z.string(),"schemas.horizontal":z.string(),"schemas.vertical":z.string(),"schemas.left":z.string(),"schemas.center":z.string(),"schemas.right":z.string(),"schemas.top":z.string(),"schemas.middle":z.string(),"schemas.bottom":z.string(),"schemas.text.fontName":z.string(),"schemas.text.size":z.string(),"schemas.text.spacing":z.string(),"schemas.text.textAlign":z.string(),"schemas.text.verticalAlign":z.string(),"schemas.text.lineHeight":z.string(),"schemas.text.min":z.string(),"schemas.text.max":z.string(),"schemas.text.fit":z.string(),"schemas.text.dynamicFontSize":z.string(),"schemas.barcodes.barColor":z.string(),"schemas.barcodes.includetext":z.string()}),z.enum(["viewer","form","designer"]);const ColorType=z.enum(["rgb","cmyk"]).optional();z.object({height:z.number(),width:z.number()});const Schema$1=z.object({type:z.string(),readOnly:z.boolean().optional(),readOnlyValue:z.string().optional(),position:z.object({x:z.number(),y:z.number()}),width:z.number(),height:z.number(),rotate:z.number().optional(),opacity:z.number().optional()}).passthrough(),SchemaForUIAdditionalInfo=z.object({id:z.string(),key:z.string(),data:z.string()});Schema$1.merge(SchemaForUIAdditionalInfo);const ArrayBufferSchema=z.any().refine(a=>a instanceof ArrayBuffer),Uint8ArraySchema=z.any().refine(a=>a instanceof Uint8Array),Font=z.record(z.object({data:z.union([z.string(),ArrayBufferSchema,Uint8ArraySchema]),fallback:z.boolean().optional(),subset:z.boolean().optional()})),BasePdf=z.union([z.string(),ArrayBufferSchema,Uint8ArraySchema]),Template=z.object({schemas:z.array(z.record(Schema$1)),basePdf:BasePdf,sampledata:z.array(z.record(z.string())).length(1).optional(),columns:z.array(z.string()).optional()}),Inputs=z.array(z.record(z.string())).min(1),CommonOptions=z.object({font:Font.optional()}).passthrough(),CommonProps=z.object({template:Template,options:CommonOptions.optional(),plugins:z.record(z.object({ui:z.any(),pdf:z.any(),propPanel:z.any()})).optional()}),GeneratorOptions=CommonOptions.extend({colorType:ColorType,author:z.string().optional(),creationDate:z.date().optional(),creator:z.string().optional(),keywords:z.array(z.string()).optional(),language:z.string().optional(),modificationDate:z.date().optional(),producer:z.string().optional(),subject:z.string().optional(),title:z.string().optional()});CommonProps.extend({inputs:Inputs,options:GeneratorOptions.optional()}).strict();const UIOptions=CommonOptions.extend({lang:Lang.optional(),labels:z.record(z.string(),z.string()).optional(),theme:z.record(z.string(),z.unknown()).optional()}),HTMLElementSchema=z.any().refine(a=>a instanceof HTMLElement),UIProps=CommonProps.extend({domContainer:HTMLElementSchema,options:UIOptions.optional()}),PreviewProps=UIProps.extend({inputs:Inputs}).strict(),DesignerProps=UIProps.extend({}).strict(),uniq=a=>Array.from(new Set(a)),getFallbackFontName=a=>{const s="",$=Object.entries(a).reduce((_,_e)=>{const[tt,nt]=_e;return!_&&nt.fallback?tt:_},s);if($===s)throw Error("[@pdfme/common] fallback flag is not found in font. true fallback flag must be only one.");return $},getDefaultFont=()=>({[DEFAULT_FONT_NAME]:{data:b64toUint8Array(DEFAULT_FONT_VALUE),fallback:!0}}),mm2pt=a=>parseFloat(String(a))*MM_TO_PT_RATIO,pt2mm=a=>a*PT_TO_MM_RATIO,pt2px=a=>a*PT_TO_PX_RATIO,blob2Base64Pdf=a=>new Promise((s,$)=>{const _=new FileReader;_.onloadend=()=>{_.result.startsWith("data:application/pdf;")?s(_.result):$(Error("[@pdfme/common] template.basePdf must be pdf data."))},_.readAsDataURL(a)}),isHexValid=a=>/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/i.test(a),getB64BasePdf=a=>typeof a=="string"&&!a.startsWith("data:application/pdf;")&&typeof window<"u"?fetch(a).then($=>$.blob()).then(blob2Base64Pdf).catch($=>{throw $}):a,getByteString=a=>buffer$1.Buffer.from(a,"base64").toString("binary"),b64toUint8Array=a=>{const s=a.split(";base64,")[1]?a.split(";base64,")[1]:a,$=getByteString(s),_=new Uint8Array($.length);for(let _e=0;_e<$.length;_e+=1)_[_e]=$.charCodeAt(_e);return _},getFontNamesInSchemas=a=>uniq(a.map(s=>Object.values(s).map($=>$.fontName??"")).reduce((s,$)=>s.concat($),[]).filter(Boolean)),checkFont=a=>{const{font:s,template:{schemas:$}}=a,_e=Object.values(s).reduce((at,ot)=>ot.fallback?at+1:at,0);if(_e===0)throw Error(`[@pdfme/common] fallback flag is not found in font. true fallback flag must be only one.
|
43
43
|
Check this document: https://pdfme.com/docs/custom-fonts#about-font-type`);if(_e>1)throw Error(`[@pdfme/common] ${_e} fallback flags found in font. true fallback flag must be only one.
|
44
44
|
Check this document: https://pdfme.com/docs/custom-fonts#about-font-type`);const tt=getFontNamesInSchemas($),nt=Object.keys(s);if(tt.some(at=>!nt.includes(at)))throw Error(`[@pdfme/common] ${tt.filter(at=>!nt.includes(at)).join()} of template.schemas is not found in font.
|
45
45
|
Check this document: https://pdfme.com/docs/custom-fonts`)},checkPlugins=a=>{const{plugins:s,template:{schemas:$}}=a,_=uniq($.map(tt=>Object.values(tt).map(nt=>nt.type)).flat()),_e=Object.values(s).map(tt=>tt==null?void 0:tt.propPanel.defaultSchema.type);if(_.some(tt=>!_e.includes(tt)))throw Error(`[@pdfme/common] ${_.filter(tt=>!_e.includes(tt)).join()} of template.schemas is not found in plugins.`)},checkProps=(a,s)=>{try{s.parse(a)}catch($){if($ instanceof z.ZodError){const _e=$.issues.map(tt=>`ERROR POSITION: ${tt.path.join(".")}
|
@@ -122,10 +122,10 @@ stream
|
|
122
122
|
`,s+=this.getContentsString(),s+=`
|
123
123
|
endstream`,s}copyBytesInto(s,$){this.updateDict();const _=$;$+=this.dict.copyBytesInto(s,$),s[$++]=CharCodes$1.Newline,s[$++]=CharCodes$1.s,s[$++]=CharCodes$1.t,s[$++]=CharCodes$1.r,s[$++]=CharCodes$1.e,s[$++]=CharCodes$1.a,s[$++]=CharCodes$1.m,s[$++]=CharCodes$1.Newline;const _e=this.getContents();for(let tt=0,nt=_e.length;tt<nt;tt++)s[$++]=_e[tt];return s[$++]=CharCodes$1.Newline,s[$++]=CharCodes$1.e,s[$++]=CharCodes$1.n,s[$++]=CharCodes$1.d,s[$++]=CharCodes$1.s,s[$++]=CharCodes$1.t,s[$++]=CharCodes$1.r,s[$++]=CharCodes$1.e,s[$++]=CharCodes$1.a,s[$++]=CharCodes$1.m,$-_}}class PDFRawStream extends PDFStream{constructor(s,$,_){super(s),this.contents=$,this.transform=_}asUint8Array(){return this.contents.slice()}clone(s){return PDFRawStream.of(this.dict.clone(s),this.contents.slice())}getContentsString(){return arrayAsString(this.contents)}getContents(){return this.contents}getContentsSize(){return this.contents.length}}PDFRawStream.of=(a,s,$)=>new PDFRawStream(a,s,$);const ENFORCER={},pool=new Map;class PDFRef extends PDFObject{constructor(s,$,_){if(s!==ENFORCER)throw new PrivateConstructorError("PDFRef");super(),this.objectNumber=$,this.generationNumber=_,this.tag=`${$} ${_} R`}clone(){return this}toString(){return this.tag}sizeInBytes(){return this.tag.length}copyBytesInto(s,$){return $+=copyStringIntoBuffer(this.tag,s,$),this.tag.length}}PDFRef.of=(a,s=0)=>{const $=`${a} ${s} R`;let _=pool.get($);return _||(_=new PDFRef(ENFORCER,a,s),pool.set($,_)),_};var PDFOperatorNames;(function(a){a.NonStrokingColor="sc",a.NonStrokingColorN="scn",a.NonStrokingColorRgb="rg",a.NonStrokingColorGray="g",a.NonStrokingColorCmyk="k",a.NonStrokingColorspace="cs",a.StrokingColor="SC",a.StrokingColorN="SCN",a.StrokingColorRgb="RG",a.StrokingColorGray="G",a.StrokingColorCmyk="K",a.StrokingColorspace="CS",a.BeginMarkedContentSequence="BDC",a.BeginMarkedContent="BMC",a.EndMarkedContent="EMC",a.MarkedContentPointWithProps="DP",a.MarkedContentPoint="MP",a.DrawObject="Do",a.ConcatTransformationMatrix="cm",a.PopGraphicsState="Q",a.PushGraphicsState="q",a.SetFlatness="i",a.SetGraphicsStateParams="gs",a.SetLineCapStyle="J",a.SetLineDashPattern="d",a.SetLineJoinStyle="j",a.SetLineMiterLimit="M",a.SetLineWidth="w",a.SetTextMatrix="Tm",a.SetRenderingIntent="ri",a.AppendRectangle="re",a.BeginInlineImage="BI",a.BeginInlineImageData="ID",a.EndInlineImage="EI",a.ClipEvenOdd="W*",a.ClipNonZero="W",a.CloseAndStroke="s",a.CloseFillEvenOddAndStroke="b*",a.CloseFillNonZeroAndStroke="b",a.ClosePath="h",a.AppendBezierCurve="c",a.CurveToReplicateFinalPoint="y",a.CurveToReplicateInitialPoint="v",a.EndPath="n",a.FillEvenOddAndStroke="B*",a.FillEvenOdd="f*",a.FillNonZeroAndStroke="B",a.FillNonZero="f",a.LegacyFillNonZero="F",a.LineTo="l",a.MoveTo="m",a.ShadingFill="sh",a.StrokePath="S",a.BeginText="BT",a.EndText="ET",a.MoveText="Td",a.MoveTextSetLeading="TD",a.NextLine="T*",a.SetCharacterSpacing="Tc",a.SetFontAndSize="Tf",a.SetTextHorizontalScaling="Tz",a.SetTextLineHeight="TL",a.SetTextRenderingMode="Tr",a.SetTextRise="Ts",a.SetWordSpacing="Tw",a.ShowText="Tj",a.ShowTextAdjusted="TJ",a.ShowTextLine="'",a.ShowTextLineAndSpace='"',a.Type3D0="d0",a.Type3D1="d1",a.BeginCompatibilitySection="BX",a.EndCompatibilitySection="EX"})(PDFOperatorNames||(PDFOperatorNames={}));class PDFFlateStream extends PDFStream{constructor(s,$){super(s),this.computeContents=()=>{const _=this.getUnencodedContents();return this.encode?pako$1.deflate(_):_},this.encode=$,$&&s.set(PDFName.of("Filter"),PDFName.of("FlateDecode")),this.contentsCache=Cache.populatedBy(this.computeContents)}getContents(){return this.contentsCache.access()}getContentsSize(){return this.contentsCache.access().length}getUnencodedContents(){throw new MethodNotImplementedError(this.constructor.name,"getUnencodedContents")}}class PDFContentStream extends PDFFlateStream{constructor(s,$,_=!0){super(s,_),this.operators=$}push(...s){this.operators.push(...s)}clone(s){const $=new Array(this.operators.length);for(let tt=0,nt=this.operators.length;tt<nt;tt++)$[tt]=this.operators[tt].clone(s);const{dict:_,encode:_e}=this;return PDFContentStream.of(_.clone(s),$,_e)}getContentsString(){let s="";for(let $=0,_=this.operators.length;$<_;$++)s+=`${this.operators[$]}
|
124
124
|
`;return s}getUnencodedContents(){const s=new Uint8Array(this.getUnencodedContentsSize());let $=0;for(let _=0,_e=this.operators.length;_<_e;_++)$+=this.operators[_].copyBytesInto(s,$),s[$++]=CharCodes$1.Newline;return s}getUnencodedContentsSize(){let s=0;for(let $=0,_=this.operators.length;$<_;$++)s+=this.operators[$].sizeInBytes()+1;return s}}PDFContentStream.of=(a,s,$=!0)=>new PDFContentStream(a,s,$);class PDFPageLeaf extends PDFDict{constructor(s,$,_=!0){super(s,$),this.normalized=!1,this.autoNormalizeCTM=_}clone(s){const $=PDFPageLeaf.fromMapWithContext(new Map,s||this.context,this.autoNormalizeCTM),_=this.entries();for(let _e=0,tt=_.length;_e<tt;_e++){const[nt,at]=_[_e];$.set(nt,at)}return $}Parent(){return this.lookupMaybe(PDFName.Parent,PDFDict)}Contents(){return this.lookup(PDFName.of("Contents"))}Annots(){return this.lookupMaybe(PDFName.Annots,PDFArray)}BleedBox(){return this.lookupMaybe(PDFName.BleedBox,PDFArray)}TrimBox(){return this.lookupMaybe(PDFName.TrimBox,PDFArray)}ArtBox(){return this.lookupMaybe(PDFName.ArtBox,PDFArray)}Resources(){const s=this.getInheritableAttribute(PDFName.Resources);return this.context.lookupMaybe(s,PDFDict)}MediaBox(){const s=this.getInheritableAttribute(PDFName.MediaBox);return this.context.lookup(s,PDFArray)}CropBox(){const s=this.getInheritableAttribute(PDFName.CropBox);return this.context.lookupMaybe(s,PDFArray)}Rotate(){const s=this.getInheritableAttribute(PDFName.Rotate);return this.context.lookupMaybe(s,PDFNumber)}getInheritableAttribute(s){let $;return this.ascend(_=>{$||($=_.get(s))}),$}setParent(s){this.set(PDFName.Parent,s)}addContentStream(s){const $=this.normalizedEntries().Contents||this.context.obj([]);this.set(PDFName.Contents,$),$.push(s)}wrapContentStreams(s,$){const _=this.Contents();return _ instanceof PDFArray?(_.insert(0,s),_.push($),!0):!1}addAnnot(s){const{Annots:$}=this.normalizedEntries();$.push(s)}removeAnnot(s){const{Annots:$}=this.normalizedEntries(),_=$.indexOf(s);_!==void 0&&$.remove(_)}setFontDictionary(s,$){const{Font:_}=this.normalizedEntries();_.set(s,$)}newFontDictionaryKey(s){const{Font:$}=this.normalizedEntries();return $.uniqueKey(s)}newFontDictionary(s,$){const _=this.newFontDictionaryKey(s);return this.setFontDictionary(_,$),_}setXObject(s,$){const{XObject:_}=this.normalizedEntries();_.set(s,$)}newXObjectKey(s){const{XObject:$}=this.normalizedEntries();return $.uniqueKey(s)}newXObject(s,$){const _=this.newXObjectKey(s);return this.setXObject(_,$),_}setExtGState(s,$){const{ExtGState:_}=this.normalizedEntries();_.set(s,$)}newExtGStateKey(s){const{ExtGState:$}=this.normalizedEntries();return $.uniqueKey(s)}newExtGState(s,$){const _=this.newExtGStateKey(s);return this.setExtGState(_,$),_}ascend(s){s(this);const $=this.Parent();$&&$.ascend(s)}normalize(){if(this.normalized)return;const{context:s}=this,$=this.get(PDFName.Contents);this.context.lookup($)instanceof PDFStream&&this.set(PDFName.Contents,s.obj([$])),this.autoNormalizeCTM&&this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(),this.context.getPopGraphicsStateContentStream());const _e=this.getInheritableAttribute(PDFName.Resources),tt=s.lookupMaybe(_e,PDFDict)||s.obj({});this.set(PDFName.Resources,tt);const nt=tt.lookupMaybe(PDFName.Font,PDFDict)||s.obj({});tt.set(PDFName.Font,nt);const at=tt.lookupMaybe(PDFName.XObject,PDFDict)||s.obj({});tt.set(PDFName.XObject,at);const ot=tt.lookupMaybe(PDFName.ExtGState,PDFDict)||s.obj({});tt.set(PDFName.ExtGState,ot);const rt=this.Annots()||s.obj([]);this.set(PDFName.Annots,rt),this.normalized=!0}normalizedEntries(){this.normalize();const s=this.Annots(),$=this.Resources(),_=this.Contents();return{Annots:s,Resources:$,Contents:_,Font:$.lookup(PDFName.Font,PDFDict),XObject:$.lookup(PDFName.XObject,PDFDict),ExtGState:$.lookup(PDFName.ExtGState,PDFDict)}}}PDFPageLeaf.InheritableEntries=["Resources","MediaBox","CropBox","Rotate"],PDFPageLeaf.withContextAndParent=(a,s)=>{const $=new Map;return $.set(PDFName.Type,PDFName.Page),$.set(PDFName.Parent,s),$.set(PDFName.Resources,a.obj({})),$.set(PDFName.MediaBox,a.obj([0,0,612,792])),new PDFPageLeaf($,a,!1)},PDFPageLeaf.fromMapWithContext=(a,s,$=!0)=>new PDFPageLeaf(a,s,$);class PDFObjectStream extends PDFFlateStream{constructor(s,$,_=!0){super(s.obj({}),_),this.objects=$,this.offsets=this.computeObjectOffsets(),this.offsetsString=this.computeOffsetsString(),this.dict.set(PDFName.of("Type"),PDFName.of("ObjStm")),this.dict.set(PDFName.of("N"),PDFNumber.of(this.objects.length)),this.dict.set(PDFName.of("First"),PDFNumber.of(this.offsetsString.length))}getObjectsCount(){return this.objects.length}clone(s){return PDFObjectStream.withContextAndObjects(s||this.dict.context,this.objects.slice(),this.encode)}getContentsString(){let s=this.offsetsString;for(let $=0,_=this.objects.length;$<_;$++){const[,_e]=this.objects[$];s+=`${_e}
|
125
|
-
`}return s}getUnencodedContents(){const s=new Uint8Array(this.getUnencodedContentsSize());let $=copyStringIntoBuffer(this.offsetsString,s,0);for(let _=0,_e=this.objects.length;_<_e;_++){const[,tt]=this.objects[_];$+=tt.copyBytesInto(s,$),s[$++]=CharCodes$1.Newline}return s}getUnencodedContentsSize(){return this.offsetsString.length+last$1(this.offsets)[1]+last$1(this.objects)[1].sizeInBytes()+1}computeOffsetsString(){let s="";for(let $=0,_=this.offsets.length;$<_;$++){const[_e,tt]=this.offsets[$];s+=`${_e} ${tt} `}return s}computeObjectOffsets(){let s=0;const $=new Array(this.objects.length);for(let _=0,_e=this.objects.length;_<_e;_++){const[tt,nt]=this.objects[_];$[_]=[tt.objectNumber,s],s+=nt.sizeInBytes()+1}return $}}PDFObjectStream.withContextAndObjects=(a,s,$=!0)=>new PDFObjectStream(a,s,$);class PDFInvalidObject extends PDFObject{constructor(s){super(),this.data=s}clone(){return PDFInvalidObject.of(this.data.slice())}toString(){return`PDFInvalidObject(${this.data.length} bytes)`}sizeInBytes(){return this.data.length}copyBytesInto(s,$){const _=this.data.length;for(let _e=0;_e<_;_e++)s[$++]=this.data[_e];return _}}PDFInvalidObject.of=a=>new PDFInvalidObject(a);var EntryType;(function(a){a[a.Deleted=0]="Deleted",a[a.Uncompressed=1]="Uncompressed",a[a.Compressed=2]="Compressed"})(EntryType||(EntryType={}));class PDFCrossRefStream extends PDFFlateStream{constructor(s,$,_=!0){super(s,_),this.computeIndex=()=>{const _e=[];let tt=0;for(let nt=0,at=this.entries.length;nt<at;nt++){const ot=this.entries[nt],rt=this.entries[nt-1];nt===0?_e.push(ot.ref.objectNumber):ot.ref.objectNumber-rt.ref.objectNumber>1&&(_e.push(tt),_e.push(ot.ref.objectNumber),tt=0),tt+=1}return _e.push(tt),_e},this.computeEntryTuples=()=>{const _e=new Array(this.entries.length);for(let tt=0,nt=this.entries.length;tt<nt;tt++){const at=this.entries[tt];if(at.type===EntryType.Deleted){const{type:ot,nextFreeObjectNumber:rt,ref:st}=at;_e[tt]=[ot,rt,st.generationNumber]}if(at.type===EntryType.Uncompressed){const{type:ot,offset:rt,ref:st}=at;_e[tt]=[ot,rt,st.generationNumber]}if(at.type===EntryType.Compressed){const{type:ot,objectStreamRef:rt,index:st}=at;_e[tt]=[ot,rt.objectNumber,st]}}return _e},this.computeMaxEntryByteWidths=()=>{const _e=this.entryTuplesCache.access(),tt=[0,0,0];for(let nt=0,at=_e.length;nt<at;nt++){const[ot,rt,st]=_e[nt],lt=sizeInBytes(ot),et=sizeInBytes(rt),it=sizeInBytes(st);lt>tt[0]&&(tt[0]=lt),et>tt[1]&&(tt[1]=et),it>tt[2]&&(tt[2]=it)}return tt},this.entries=$||[],this.entryTuplesCache=Cache.populatedBy(this.computeEntryTuples),this.maxByteWidthsCache=Cache.populatedBy(this.computeMaxEntryByteWidths),this.indexCache=Cache.populatedBy(this.computeIndex),s.set(PDFName.of("Type"),PDFName.of("XRef"))}addDeletedEntry(s,$){const _=EntryType.Deleted;this.entries.push({type:_,ref:s,nextFreeObjectNumber:$}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}addUncompressedEntry(s,$){const _=EntryType.Uncompressed;this.entries.push({type:_,ref:s,offset:$}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}addCompressedEntry(s,$,_){const _e=EntryType.Compressed;this.entries.push({type:_e,ref:s,objectStreamRef:$,index:_}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}clone(s){const{dict:$,entries:_,encode:_e}=this;return PDFCrossRefStream.of($.clone(s),_.slice(),_e)}getContentsString(){const s=this.entryTuplesCache.access(),$=this.maxByteWidthsCache.access();let _="";for(let _e=0,tt=s.length;_e<tt;_e++){const[nt,at,ot]=s[_e],rt=reverseArray(bytesFor(nt)),st=reverseArray(bytesFor(at)),lt=reverseArray(bytesFor(ot));for(let et=$[0]-1;et>=0;et--)_+=(rt[et]||0).toString(2);for(let et=$[1]-1;et>=0;et--)_+=(st[et]||0).toString(2);for(let et=$[2]-1;et>=0;et--)_+=(lt[et]||0).toString(2)}return _}getUnencodedContents(){const s=this.entryTuplesCache.access(),$=this.maxByteWidthsCache.access(),_=new Uint8Array(this.getUnencodedContentsSize());let _e=0;for(let tt=0,nt=s.length;tt<nt;tt++){const[at,ot,rt]=s[tt],st=reverseArray(bytesFor(at)),lt=reverseArray(bytesFor(ot)),et=reverseArray(bytesFor(rt));for(let it=$[0]-1;it>=0;it--)_[_e++]=st[it]||0;for(let it=$[1]-1;it>=0;it--)_[_e++]=lt[it]||0;for(let it=$[2]-1;it>=0;it--)_[_e++]=et[it]||0}return _}getUnencodedContentsSize(){const s=this.maxByteWidthsCache.access();return sum$1(s)*this.entries.length}updateDict(){super.updateDict();const s=this.maxByteWidthsCache.access(),$=this.indexCache.access(),{context:_}=this.dict;this.dict.set(PDFName.of("W"),_.obj(s)),this.dict.set(PDFName.of("Index"),_.obj($))}}PDFCrossRefStream.create=(a,s=!0)=>{const $=new PDFCrossRefStream(a,[],s);return $.addDeletedEntry(PDFRef.of(0,65535),0),$},PDFCrossRefStream.of=(a,s,$=!0)=>new PDFCrossRefStream(a,s,$);class PDFHexString extends PDFObject{constructor(s){super(),this.value=s}asBytes(){const s=this.value+(this.value.length%2===1?"0":""),$=s.length,_=new Uint8Array(s.length/2);let _e=0,tt=0;for(;_e<$;){const nt=parseInt(s.substring(_e,_e+2),16);_[tt]=nt,_e+=2,tt+=1}return _}decodeText(){const s=this.asBytes();return hasUtf16BOM(s)?utf16Decode(s):pdfDocEncodingDecode(s)}decodeDate(){const s=this.decodeText(),$=parseDate(s);if(!$)throw new InvalidPDFDateStringError(s);return $}asString(){return this.value}clone(){return PDFHexString.of(this.value)}toString(){return`<${this.value}>`}sizeInBytes(){return this.value.length+2}copyBytesInto(s,$){return s[$++]=CharCodes$1.LessThan,$+=copyStringIntoBuffer(this.value,s,$),s[$++]=CharCodes$1.GreaterThan,this.value.length+2}}PDFHexString.of=a=>new PDFHexString(a),PDFHexString.fromText=a=>{const s=utf16Encode(a);let $="";for(let _=0,_e=s.length;_<_e;_++)$+=toHexStringOfMinLength(s[_],4);return new PDFHexString($)};class PDFString extends PDFObject{constructor(s){super(),this.value=s}asBytes(){const s=[];let $="",_=!1;const _e=tt=>{tt!==void 0&&s.push(tt),_=!1};for(let tt=0,nt=this.value.length;tt<nt;tt++){const at=this.value[tt],ot=toCharCode(at),rt=this.value[tt+1];_?ot===CharCodes$1.Newline||ot===CharCodes$1.CarriageReturn?_e():ot===CharCodes$1.n?_e(CharCodes$1.Newline):ot===CharCodes$1.r?_e(CharCodes$1.CarriageReturn):ot===CharCodes$1.t?_e(CharCodes$1.Tab):ot===CharCodes$1.b?_e(CharCodes$1.Backspace):ot===CharCodes$1.f?_e(CharCodes$1.FormFeed):ot===CharCodes$1.LeftParen?_e(CharCodes$1.LeftParen):ot===CharCodes$1.RightParen?_e(CharCodes$1.RightParen):ot===CharCodes$1.Backspace?_e(CharCodes$1.BackSlash):ot>=CharCodes$1.Zero&&ot<=CharCodes$1.Seven?($+=at,($.length===3||!(rt>="0"&&rt<="7"))&&(_e(parseInt($,8)),$="")):_e(ot):ot===CharCodes$1.BackSlash?_=!0:_e(ot)}return new Uint8Array(s)}decodeText(){const s=this.asBytes();return hasUtf16BOM(s)?utf16Decode(s):pdfDocEncodingDecode(s)}decodeDate(){const s=this.decodeText(),$=parseDate(s);if(!$)throw new InvalidPDFDateStringError(s);return $}asString(){return this.value}clone(){return PDFString.of(this.value)}toString(){return`(${this.value})`}sizeInBytes(){return this.value.length+2}copyBytesInto(s,$){return s[$++]=CharCodes$1.LeftParen,$+=copyStringIntoBuffer(this.value,s,$),s[$++]=CharCodes$1.RightParen,this.value.length+2}}PDFString.of=a=>new PDFString(a),PDFString.fromDate=a=>{const s=padStart$1(String(a.getUTCFullYear()),4,"0"),$=padStart$1(String(a.getUTCMonth()+1),2,"0"),_=padStart$1(String(a.getUTCDate()),2,"0"),_e=padStart$1(String(a.getUTCHours()),2,"0"),tt=padStart$1(String(a.getUTCMinutes()),2,"0"),nt=padStart$1(String(a.getUTCSeconds()),2,"0");return new PDFString(`D:${s}${$}${_}${_e}${tt}${nt}Z`)};var AFRelationship;(function(a){a.Source="Source",a.Data="Data",a.Alternative="Alternative",a.Supplement="Supplement",a.EncryptedPayload="EncryptedPayload",a.FormData="EncryptedPayload",a.Schema="Schema",a.Unspecified="Unspecified"})(AFRelationship||(AFRelationship={}));var ColorSpace;(function(a){a.DeviceGray="DeviceGray",a.DeviceRGB="DeviceRGB",a.DeviceCMYK="DeviceCMYK"})(ColorSpace||(ColorSpace={})),ColorSpace.DeviceGray,ColorSpace.DeviceRGB,ColorSpace.DeviceCMYK;var UPNG={};UPNG.toRGBA8=function(a){var s=a.width,$=a.height;if(a.tabs.acTL==null)return[UPNG.toRGBA8.decodeImage(a.data,s,$,a).buffer];var _=[];a.frames[0].data==null&&(a.frames[0].data=a.data);for(var _e=s*$*4,tt=new Uint8Array(_e),nt=new Uint8Array(_e),at=new Uint8Array(_e),ot=0;ot<a.frames.length;ot++){var rt=a.frames[ot],st=rt.rect.x,lt=rt.rect.y,et=rt.rect.width,it=rt.rect.height,ut=UPNG.toRGBA8.decodeImage(rt.data,et,it,a);if(ot!=0)for(var ft=0;ft<_e;ft++)at[ft]=tt[ft];if(rt.blend==0?UPNG._copyTile(ut,et,it,tt,s,$,st,lt,0):rt.blend==1&&UPNG._copyTile(ut,et,it,tt,s,$,st,lt,1),_.push(tt.buffer.slice(0)),rt.dispose!=0){if(rt.dispose==1)UPNG._copyTile(nt,et,it,tt,s,$,st,lt,0);else if(rt.dispose==2)for(var ft=0;ft<_e;ft++)tt[ft]=at[ft]}}return _},UPNG.toRGBA8.decodeImage=function(a,s,$,_){var _e=s*$,tt=UPNG.decode._getBPP(_),nt=Math.ceil(s*tt/8),at=new Uint8Array(_e*4),ot=new Uint32Array(at.buffer),rt=_.ctype,st=_.depth,lt=UPNG._bin.readUshort;if(rt==6){var et=_e<<2;if(st==8)for(var it=0;it<et;it+=4)at[it]=a[it],at[it+1]=a[it+1],at[it+2]=a[it+2],at[it+3]=a[it+3];if(st==16)for(var it=0;it<et;it++)at[it]=a[it<<1]}else if(rt==2){var ut=_.tabs.tRNS;if(ut==null){if(st==8)for(var it=0;it<_e;it++){var ft=it*3;ot[it]=255<<24|a[ft+2]<<16|a[ft+1]<<8|a[ft]}if(st==16)for(var it=0;it<_e;it++){var ft=it*6;ot[it]=255<<24|a[ft+4]<<16|a[ft+2]<<8|a[ft]}}else{var ht=ut[0],dt=ut[1],gt=ut[2];if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,ft=it*3;ot[it]=255<<24|a[ft+2]<<16|a[ft+1]<<8|a[ft],a[ft]==ht&&a[ft+1]==dt&&a[ft+2]==gt&&(at[pt+3]=0)}if(st==16)for(var it=0;it<_e;it++){var pt=it<<2,ft=it*6;ot[it]=255<<24|a[ft+4]<<16|a[ft+2]<<8|a[ft],lt(a,ft)==ht&<(a,ft+2)==dt&<(a,ft+4)==gt&&(at[pt+3]=0)}}}else if(rt==3){var mt=_.tabs.PLTE,ct=_.tabs.tRNS,vt=ct?ct.length:0;if(st==1)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>3)]>>7-((it&7)<<0)&1,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==2)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>2)]>>6-((it&3)<<1)&3,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==4)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>1)]>>4-((it&1)<<2)&15,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,Et=a[it],St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}}else if(rt==4){if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,Dt=it<<1,Rt=a[Dt];at[pt]=Rt,at[pt+1]=Rt,at[pt+2]=Rt,at[pt+3]=a[Dt+1]}if(st==16)for(var it=0;it<_e;it++){var pt=it<<2,Dt=it<<2,Rt=a[Dt];at[pt]=Rt,at[pt+1]=Rt,at[pt+2]=Rt,at[pt+3]=a[Dt+2]}}else if(rt==0)for(var ht=_.tabs.tRNS?_.tabs.tRNS:-1,At=0;At<$;At++){var Tt=At*nt,wt=At*s;if(st==1)for(var Ct=0;Ct<s;Ct++){var Rt=255*(a[Tt+(Ct>>>3)]>>>7-(Ct&7)&1),It=Rt==ht*255?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==2)for(var Ct=0;Ct<s;Ct++){var Rt=85*(a[Tt+(Ct>>>2)]>>>6-((Ct&3)<<1)&3),It=Rt==ht*85?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==4)for(var Ct=0;Ct<s;Ct++){var Rt=17*(a[Tt+(Ct>>>1)]>>>4-((Ct&1)<<2)&15),It=Rt==ht*17?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==8)for(var Ct=0;Ct<s;Ct++){var Rt=a[Tt+Ct],It=Rt==ht?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==16)for(var Ct=0;Ct<s;Ct++){var Rt=a[Tt+(Ct<<1)],It=lt(a,Tt+(Ct<<it))==ht?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}}return at},UPNG.decode=function(a){for(var s=new Uint8Array(a),$=8,_=UPNG._bin,_e=_.readUshort,tt=_.readUint,nt={tabs:{},frames:[]},at=new Uint8Array(s.length),ot=0,rt,st=0,lt=[137,80,78,71,13,10,26,10],et=0;et<8;et++)if(s[et]!=lt[et])throw"The input is not a PNG file!";for(;$<s.length;){var it=_.readUint(s,$);$+=4;var ut=_.readASCII(s,$,4);if($+=4,ut=="IHDR")UPNG.decode._IHDR(s,$,nt);else if(ut=="IDAT"){for(var et=0;et<it;et++)at[ot+et]=s[$+et];ot+=it}else if(ut=="acTL")nt.tabs[ut]={num_frames:tt(s,$),num_plays:tt(s,$+4)},rt=new Uint8Array(s.length);else if(ut=="fcTL"){if(st!=0){var ft=nt.frames[nt.frames.length-1];ft.data=UPNG.decode._decompress(nt,rt.slice(0,st),ft.rect.width,ft.rect.height),st=0}var ht={x:tt(s,$+12),y:tt(s,$+16),width:tt(s,$+4),height:tt(s,$+8)},dt=_e(s,$+22);dt=_e(s,$+20)/(dt==0?100:dt);var gt={rect:ht,delay:Math.round(dt*1e3),dispose:s[$+24],blend:s[$+25]};nt.frames.push(gt)}else if(ut=="fdAT"){for(var et=0;et<it-4;et++)rt[st+et]=s[$+et+4];st+=it-4}else if(ut=="pHYs")nt.tabs[ut]=[_.readUint(s,$),_.readUint(s,$+4),s[$+8]];else if(ut=="cHRM"){nt.tabs[ut]=[];for(var et=0;et<8;et++)nt.tabs[ut].push(_.readUint(s,$+et*4))}else if(ut=="tEXt"){nt.tabs[ut]==null&&(nt.tabs[ut]={});var pt=_.nextZero(s,$),mt=_.readASCII(s,$,pt-$),ct=_.readASCII(s,pt+1,$+it-pt-1);nt.tabs[ut][mt]=ct}else if(ut=="iTXt"){nt.tabs[ut]==null&&(nt.tabs[ut]={});var pt=0,vt=$;pt=_.nextZero(s,vt);var mt=_.readASCII(s,vt,pt-vt);vt=pt+1,s[vt],s[vt+1],vt+=2,pt=_.nextZero(s,vt),_.readASCII(s,vt,pt-vt),vt=pt+1,pt=_.nextZero(s,vt),_.readUTF8(s,vt,pt-vt),vt=pt+1;var ct=_.readUTF8(s,vt,it-(vt-$));nt.tabs[ut][mt]=ct}else if(ut=="PLTE")nt.tabs[ut]=_.readBytes(s,$,it);else if(ut=="hIST"){var At=nt.tabs.PLTE.length/3;nt.tabs[ut]=[];for(var et=0;et<At;et++)nt.tabs[ut].push(_e(s,$+et*2))}else if(ut=="tRNS")nt.ctype==3?nt.tabs[ut]=_.readBytes(s,$,it):nt.ctype==0?nt.tabs[ut]=_e(s,$):nt.ctype==2&&(nt.tabs[ut]=[_e(s,$),_e(s,$+2),_e(s,$+4)]);else if(ut=="gAMA")nt.tabs[ut]=_.readUint(s,$)/1e5;else if(ut=="sRGB")nt.tabs[ut]=s[$];else if(ut=="bKGD")nt.ctype==0||nt.ctype==4?nt.tabs[ut]=[_e(s,$)]:nt.ctype==2||nt.ctype==6?nt.tabs[ut]=[_e(s,$),_e(s,$+2),_e(s,$+4)]:nt.ctype==3&&(nt.tabs[ut]=s[$]);else if(ut=="IEND")break;$+=it,_.readUint(s,$),$+=4}if(st!=0){var ft=nt.frames[nt.frames.length-1];ft.data=UPNG.decode._decompress(nt,rt.slice(0,st),ft.rect.width,ft.rect.height),st=0}return nt.data=UPNG.decode._decompress(nt,at,nt.width,nt.height),delete nt.compress,delete nt.interlace,delete nt.filter,nt},UPNG.decode._decompress=function(a,s,$,_){var _e=UPNG.decode._getBPP(a),tt=Math.ceil($*_e/8),nt=new Uint8Array((tt+1+a.interlace)*_);return s=UPNG.decode._inflate(s,nt),a.interlace==0?s=UPNG.decode._filterZero(s,a,0,$,_):a.interlace==1&&(s=UPNG.decode._readInterlace(s,a)),s},UPNG.decode._inflate=function(a,s){var $=UPNG.inflateRaw(new Uint8Array(a.buffer,2,a.length-6),s);return $},UPNG.inflateRaw=function(){var a={};return a.H={},a.H.N=function(s,$){var _=Uint8Array,_e=0,tt=0,nt=0,at=0,ot=0,rt=0,st=0,lt=0,et=0,it,ut;if(s[0]==3&&s[1]==0)return $||new _(0);var ft=a.H,ht=ft.b,dt=ft.e,gt=ft.R,pt=ft.n,mt=ft.A,ct=ft.Z,vt=ft.m,At=$==null;for(At&&($=new _(s.length>>>2<<3));_e==0;){if(_e=ht(s,et,1),tt=ht(s,et+1,2),et+=3,tt==0){et&7&&(et+=8-(et&7));var xt=(et>>>3)+4,bt=s[xt-4]|s[xt-3]<<8;At&&($=a.H.W($,lt+bt)),$.set(new _(s.buffer,s.byteOffset+xt,bt),lt),et=xt+bt<<3,lt+=bt;continue}if(At&&($=a.H.W($,lt+(1<<17))),tt==1&&(it=vt.J,ut=vt.h,rt=511,st=31),tt==2){nt=dt(s,et,5)+257,at=dt(s,et+5,5)+1,ot=dt(s,et+10,4)+4,et+=14;for(var Et=1,St=0;St<38;St+=2)vt.Q[St]=0,vt.Q[St+1]=0;for(var St=0;St<ot;St++){var Dt=dt(s,et+St*3,3);vt.Q[(vt.X[St]<<1)+1]=Dt,Dt>Et&&(Et=Dt)}et+=3*ot,pt(vt.Q,Et),mt(vt.Q,Et,vt.u),it=vt.w,ut=vt.d,et=gt(vt.u,(1<<Et)-1,nt+at,s,et,vt.v);var Rt=ft.V(vt.v,0,nt,vt.C);rt=(1<<Rt)-1;var Tt=ft.V(vt.v,nt,at,vt.D);st=(1<<Tt)-1,pt(vt.C,Rt),mt(vt.C,Rt,it),pt(vt.D,Tt),mt(vt.D,Tt,ut)}for(;;){var wt=it[ct(s,et)&rt];et+=wt&15;var Ct=wt>>>4;if(!(Ct>>>8))$[lt++]=Ct;else{if(Ct==256)break;var It=lt+Ct-254;if(Ct>264){var yt=vt.q[Ct-257];It=lt+(yt>>>3)+dt(s,et,yt&7),et+=yt&7}var Pt=ut[ct(s,et)&st];et+=Pt&15;var kt=Pt>>>4,jt=vt.c[kt],Ht=(jt>>>4)+ht(s,et,jt&15);for(et+=jt&15;lt<It;)$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht];lt=It}}}return $.length==lt?$:$.slice(0,lt)},a.H.W=function(s,$){var _=s.length;if($<=_)return s;var _e=new Uint8Array(_<<1);return _e.set(s,0),_e},a.H.R=function(s,$,_,_e,tt,nt){for(var at=a.H.e,ot=a.H.Z,rt=0;rt<_;){var st=s[ot(_e,tt)&$];tt+=st&15;var lt=st>>>4;if(lt<=15)nt[rt]=lt,rt++;else{var et=0,it=0;lt==16?(it=3+at(_e,tt,2),tt+=2,et=nt[rt-1]):lt==17?(it=3+at(_e,tt,3),tt+=3):lt==18&&(it=11+at(_e,tt,7),tt+=7);for(var ut=rt+it;rt<ut;)nt[rt]=et,rt++}}return tt},a.H.V=function(s,$,_,_e){for(var tt=0,nt=0,at=_e.length>>>1;nt<_;){var ot=s[nt+$];_e[nt<<1]=0,_e[(nt<<1)+1]=ot,ot>tt&&(tt=ot),nt++}for(;nt<at;)_e[nt<<1]=0,_e[(nt<<1)+1]=0,nt++;return tt},a.H.n=function(s,$){for(var _=a.H.m,_e=s.length,tt,nt,at,ot,rt,st=_.j,ot=0;ot<=$;ot++)st[ot]=0;for(ot=1;ot<_e;ot+=2)st[s[ot]]++;var lt=_.K;for(tt=0,st[0]=0,nt=1;nt<=$;nt++)tt=tt+st[nt-1]<<1,lt[nt]=tt;for(at=0;at<_e;at+=2)rt=s[at+1],rt!=0&&(s[at]=lt[rt],lt[rt]++)},a.H.A=function(s,$,_){for(var _e=s.length,tt=a.H.m,nt=tt.r,at=0;at<_e;at+=2)if(s[at+1]!=0)for(var ot=at>>1,rt=s[at+1],st=ot<<4|rt,lt=$-rt,et=s[at]<<lt,it=et+(1<<lt);et!=it;){var ut=nt[et]>>>15-$;_[ut]=st,et++}},a.H.l=function(s,$){for(var _=a.H.m.r,_e=15-$,tt=0;tt<s.length;tt+=2){var nt=s[tt]<<$-s[tt+1];s[tt]=_[nt]>>>_e}},a.H.M=function(s,$,_){_=_<<($&7);var _e=$>>>3;s[_e]|=_,s[_e+1]|=_>>>8},a.H.I=function(s,$,_){_=_<<($&7);var _e=$>>>3;s[_e]|=_,s[_e+1]|=_>>>8,s[_e+2]|=_>>>16},a.H.e=function(s,$,_){return(s[$>>>3]|s[($>>>3)+1]<<8)>>>($&7)&(1<<_)-1},a.H.b=function(s,$,_){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16)>>>($&7)&(1<<_)-1},a.H.Z=function(s,$){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16)>>>($&7)},a.H.i=function(s,$){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16|s[($>>>3)+3]<<24)>>>($&7)},a.H.m=function(){var s=Uint16Array,$=Uint32Array;return{K:new s(16),j:new s(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 s(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 $(32),J:new s(512),_:[],h:new s(32),$:[],w:new s(32768),C:[],v:[],d:new s(32768),D:[],u:new s(512),Q:[],r:new s(32768),s:new $(286),Y:new $(30),a:new $(19),t:new $(15e3),k:new s(65536),g:new s(32768)}}(),function(){for(var s=a.H.m,$=32768,_=0;_<$;_++){var _e=_;_e=(_e&2863311530)>>>1|(_e&1431655765)<<1,_e=(_e&3435973836)>>>2|(_e&858993459)<<2,_e=(_e&4042322160)>>>4|(_e&252645135)<<4,_e=(_e&4278255360)>>>8|(_e&16711935)<<8,s.r[_]=(_e>>>16|_e<<16)>>>17}function tt(nt,at,ot){for(;at--!=0;)nt.push(0,ot)}for(var _=0;_<32;_++)s.q[_]=s.S[_]<<3|s.T[_],s.c[_]=s.p[_]<<4|s.z[_];tt(s._,144,8),tt(s._,112,9),tt(s._,24,7),tt(s._,8,8),a.H.n(s._,9),a.H.A(s._,9,s.J),a.H.l(s._,9),tt(s.$,32,5),a.H.n(s.$,5),a.H.A(s.$,5,s.h),a.H.l(s.$,5),tt(s.Q,19,0),tt(s.C,286,0),tt(s.D,30,0),tt(s.v,320,0)}(),a.H.N}(),UPNG.decode._readInterlace=function(a,s){for(var $=s.width,_=s.height,_e=UPNG.decode._getBPP(s),tt=_e>>3,nt=Math.ceil($*_e/8),at=new Uint8Array(_*nt),ot=0,rt=[0,0,4,0,2,0,1],st=[0,4,0,2,0,1,0],lt=[8,8,8,4,4,2,2],et=[8,8,4,4,2,2,1],it=0;it<7;){for(var ut=lt[it],ft=et[it],ht=0,dt=0,gt=rt[it];gt<_;)gt+=ut,dt++;for(var pt=st[it];pt<$;)pt+=ft,ht++;var mt=Math.ceil(ht*_e/8);UPNG.decode._filterZero(a,s,ot,ht,dt);for(var ct=0,vt=rt[it];vt<_;){for(var At=st[it],xt=ot+ct*mt<<3;At<$;){if(_e==1){var bt=a[xt>>3];bt=bt>>7-(xt&7)&1,at[vt*nt+(At>>3)]|=bt<<7-((At&7)<<0)}if(_e==2){var bt=a[xt>>3];bt=bt>>6-(xt&7)&3,at[vt*nt+(At>>2)]|=bt<<6-((At&3)<<1)}if(_e==4){var bt=a[xt>>3];bt=bt>>4-(xt&7)&15,at[vt*nt+(At>>1)]|=bt<<4-((At&1)<<2)}if(_e>=8)for(var Et=vt*nt+At*tt,St=0;St<tt;St++)at[Et+St]=a[(xt>>3)+St];xt+=_e,At+=ft}ct++,vt+=ut}ht*dt!=0&&(ot+=dt*(1+mt)),it=it+1}return at},UPNG.decode._getBPP=function(a){var s=[1,null,3,1,2,null,4][a.ctype];return s*a.depth},UPNG.decode._filterZero=function(a,s,$,_,_e){var tt=UPNG.decode._getBPP(s),nt=Math.ceil(_*tt/8),at=UPNG.decode._paeth;tt=Math.ceil(tt/8);var ot=0,rt=1,st=a[$],lt=0;if(st>1&&(a[$]=[0,0,1][st-2]),st==3)for(lt=tt;lt<nt;lt++)a[lt+1]=a[lt+1]+(a[lt+1-tt]>>>1)&255;for(var et=0;et<_e;et++)if(ot=$+et*nt,rt=ot+et+1,st=a[rt-1],lt=0,st==0)for(;lt<nt;lt++)a[ot+lt]=a[rt+lt];else if(st==1){for(;lt<tt;lt++)a[ot+lt]=a[rt+lt];for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+a[ot+lt-tt]}else if(st==2)for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+a[ot+lt-nt];else if(st==3){for(;lt<tt;lt++)a[ot+lt]=a[rt+lt]+(a[ot+lt-nt]>>>1);for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+(a[ot+lt-nt]+a[ot+lt-tt]>>>1)}else{for(;lt<tt;lt++)a[ot+lt]=a[rt+lt]+at(0,a[ot+lt-nt],0);for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+at(a[ot+lt-tt],a[ot+lt-nt],a[ot+lt-tt-nt])}return a},UPNG.decode._paeth=function(a,s,$){var _=a+s-$,_e=_-a,tt=_-s,nt=_-$;return _e*_e<=tt*tt&&_e*_e<=nt*nt?a:tt*tt<=nt*nt?s:$},UPNG.decode._IHDR=function(a,s,$){var _=UPNG._bin;$.width=_.readUint(a,s),s+=4,$.height=_.readUint(a,s),s+=4,$.depth=a[s],s++,$.ctype=a[s],s++,$.compress=a[s],s++,$.filter=a[s],s++,$.interlace=a[s],s++},UPNG._bin={nextZero:function(a,s){for(;a[s]!=0;)s++;return s},readUshort:function(a,s){return a[s]<<8|a[s+1]},writeUshort:function(a,s,$){a[s]=$>>8&255,a[s+1]=$&255},readUint:function(a,s){return a[s]*(256*256*256)+(a[s+1]<<16|a[s+2]<<8|a[s+3])},writeUint:function(a,s,$){a[s]=$>>24&255,a[s+1]=$>>16&255,a[s+2]=$>>8&255,a[s+3]=$&255},readASCII:function(a,s,$){for(var _="",_e=0;_e<$;_e++)_+=String.fromCharCode(a[s+_e]);return _},writeASCII:function(a,s,$){for(var _=0;_<$.length;_++)a[s+_]=$.charCodeAt(_)},readBytes:function(a,s,$){for(var _=[],_e=0;_e<$;_e++)_.push(a[s+_e]);return _},pad:function(a){return a.length<2?"0"+a:a},readUTF8:function(a,s,$){for(var _="",_e,tt=0;tt<$;tt++)_+="%"+UPNG._bin.pad(a[s+tt].toString(16));try{_e=decodeURIComponent(_)}catch{return UPNG._bin.readASCII(a,s,$)}return _e}},UPNG._copyTile=function(a,s,$,_,_e,tt,nt,at,ot){for(var rt=Math.min(s,_e),st=Math.min($,tt),lt=0,et=0,it=0;it<st;it++)for(var ut=0;ut<rt;ut++)if(nt>=0&&at>=0?(lt=it*s+ut<<2,et=(at+it)*_e+nt+ut<<2):(lt=(-at+it)*s-nt+ut<<2,et=it*_e+ut<<2),ot==0)_[et]=a[lt],_[et+1]=a[lt+1],_[et+2]=a[lt+2],_[et+3]=a[lt+3];else if(ot==1){var ft=a[lt+3]*.00392156862745098,ht=a[lt]*ft,dt=a[lt+1]*ft,gt=a[lt+2]*ft,pt=_[et+3]*(1/255),mt=_[et]*pt,ct=_[et+1]*pt,vt=_[et+2]*pt,At=1-ft,xt=ft+pt*At,bt=xt==0?0:1/xt;_[et+3]=255*xt,_[et+0]=(ht+mt*At)*bt,_[et+1]=(dt+ct*At)*bt,_[et+2]=(gt+vt*At)*bt}else if(ot==2){var ft=a[lt+3],ht=a[lt],dt=a[lt+1],gt=a[lt+2],pt=_[et+3],mt=_[et],ct=_[et+1],vt=_[et+2];ft==pt&&ht==mt&&dt==ct&>==vt?(_[et]=0,_[et+1]=0,_[et+2]=0,_[et+3]=0):(_[et]=ht,_[et+1]=dt,_[et+2]=gt,_[et+3]=ft)}else if(ot==3){var ft=a[lt+3],ht=a[lt],dt=a[lt+1],gt=a[lt+2],pt=_[et+3],mt=_[et],ct=_[et+1],vt=_[et+2];if(ft==pt&&ht==mt&&dt==ct&>==vt)continue;if(ft<220&&pt>20)return!1}return!0},UPNG.encode=function(a,s,$,_,_e,tt,nt){_==null&&(_=0),nt==null&&(nt=!1);var at=UPNG.encode.compress(a,s,$,_,[!1,!1,!1,0,nt]);return UPNG.encode.compressPNG(at,-1),UPNG.encode._main(at,s,$,_e,tt)},UPNG.encodeLL=function(a,s,$,_,_e,tt,nt,at){for(var ot={ctype:0+(_==1?0:2)+(_e==0?0:4),depth:tt,frames:[]},rt=(_+_e)*tt,st=rt*s,lt=0;lt<a.length;lt++)ot.frames.push({rect:{x:0,y:0,width:s,height:$},img:new Uint8Array(a[lt]),blend:0,dispose:1,bpp:Math.ceil(rt/8),bpl:Math.ceil(st/8)});UPNG.encode.compressPNG(ot,0,!0);var et=UPNG.encode._main(ot,s,$,nt,at);return et},UPNG.encode._main=function(a,s,$,_,_e){_e==null&&(_e={});var tt=UPNG.crc.crc,nt=UPNG._bin.writeUint,at=UPNG._bin.writeUshort,ot=UPNG._bin.writeASCII,rt=8,st=a.frames.length>1,lt=!1,et=33+(st?20:0);if(_e.sRGB!=null&&(et+=13),_e.pHYs!=null&&(et+=21),a.ctype==3){for(var it=a.plte.length,ut=0;ut<it;ut++)a.plte[ut]>>>24!=255&&(lt=!0);et+=8+it*3+4+(lt?8+it*1+4:0)}for(var ft=0;ft<a.frames.length;ft++){var ht=a.frames[ft];st&&(et+=38),et+=ht.cimg.length+12,ft!=0&&(et+=4)}et+=12;for(var dt=new Uint8Array(et),gt=[137,80,78,71,13,10,26,10],ut=0;ut<8;ut++)dt[ut]=gt[ut];if(nt(dt,rt,13),rt+=4,ot(dt,rt,"IHDR"),rt+=4,nt(dt,rt,s),rt+=4,nt(dt,rt,$),rt+=4,dt[rt]=a.depth,rt++,dt[rt]=a.ctype,rt++,dt[rt]=0,rt++,dt[rt]=0,rt++,dt[rt]=0,rt++,nt(dt,rt,tt(dt,rt-17,17)),rt+=4,_e.sRGB!=null&&(nt(dt,rt,1),rt+=4,ot(dt,rt,"sRGB"),rt+=4,dt[rt]=_e.sRGB,rt++,nt(dt,rt,tt(dt,rt-5,5)),rt+=4),_e.pHYs!=null&&(nt(dt,rt,9),rt+=4,ot(dt,rt,"pHYs"),rt+=4,nt(dt,rt,_e.pHYs[0]),rt+=4,nt(dt,rt,_e.pHYs[1]),rt+=4,dt[rt]=_e.pHYs[2],rt++,nt(dt,rt,tt(dt,rt-13,13)),rt+=4),st&&(nt(dt,rt,8),rt+=4,ot(dt,rt,"acTL"),rt+=4,nt(dt,rt,a.frames.length),rt+=4,nt(dt,rt,_e.loop!=null?_e.loop:0),rt+=4,nt(dt,rt,tt(dt,rt-12,12)),rt+=4),a.ctype==3){var it=a.plte.length;nt(dt,rt,it*3),rt+=4,ot(dt,rt,"PLTE"),rt+=4;for(var ut=0;ut<it;ut++){var pt=ut*3,mt=a.plte[ut],ct=mt&255,vt=mt>>>8&255,At=mt>>>16&255;dt[rt+pt+0]=ct,dt[rt+pt+1]=vt,dt[rt+pt+2]=At}if(rt+=it*3,nt(dt,rt,tt(dt,rt-it*3-4,it*3+4)),rt+=4,lt){nt(dt,rt,it),rt+=4,ot(dt,rt,"tRNS"),rt+=4;for(var ut=0;ut<it;ut++)dt[rt+ut]=a.plte[ut]>>>24&255;rt+=it,nt(dt,rt,tt(dt,rt-it-4,it+4)),rt+=4}}for(var xt=0,ft=0;ft<a.frames.length;ft++){var ht=a.frames[ft];st&&(nt(dt,rt,26),rt+=4,ot(dt,rt,"fcTL"),rt+=4,nt(dt,rt,xt++),rt+=4,nt(dt,rt,ht.rect.width),rt+=4,nt(dt,rt,ht.rect.height),rt+=4,nt(dt,rt,ht.rect.x),rt+=4,nt(dt,rt,ht.rect.y),rt+=4,at(dt,rt,_[ft]),rt+=2,at(dt,rt,1e3),rt+=2,dt[rt]=ht.dispose,rt++,dt[rt]=ht.blend,rt++,nt(dt,rt,tt(dt,rt-30,30)),rt+=4);var bt=ht.cimg,it=bt.length;nt(dt,rt,it+(ft==0?0:4)),rt+=4;var Et=rt;ot(dt,rt,ft==0?"IDAT":"fdAT"),rt+=4,ft!=0&&(nt(dt,rt,xt++),rt+=4),dt.set(bt,rt),rt+=it,nt(dt,rt,tt(dt,Et,rt-Et)),rt+=4}return nt(dt,rt,0),rt+=4,ot(dt,rt,"IEND"),rt+=4,nt(dt,rt,tt(dt,rt-4,4)),rt+=4,dt.buffer},UPNG.encode.compressPNG=function(a,s,$){for(var _=0;_<a.frames.length;_++){var _e=a.frames[_];_e.rect.width;var tt=_e.rect.height,nt=new Uint8Array(tt*_e.bpl+tt);_e.cimg=UPNG.encode._filterZero(_e.img,tt,_e.bpp,_e.bpl,nt,s,$)}},UPNG.encode.compress=function(a,s,$,_,_e){for(var tt=_e[0],nt=_e[1],at=_e[2],ot=_e[3],rt=_e[4],st=6,lt=8,et=255,it=0;it<a.length;it++)for(var ut=new Uint8Array(a[it]),ft=ut.length,ht=0;ht<ft;ht+=4)et&=ut[ht+3];var dt=et!=255,gt=UPNG.encode.framize(a,s,$,tt,nt,at),pt={},mt=[],ct=[];if(_!=0){for(var vt=[],ht=0;ht<gt.length;ht++)vt.push(gt[ht].img.buffer);for(var At=UPNG.encode.concatRGBA(vt),xt=UPNG.quantize(At,_),bt=0,Et=new Uint8Array(xt.abuf),ht=0;ht<gt.length;ht++){var St=gt[ht].img,Dt=St.length;ct.push(new Uint8Array(xt.inds.buffer,bt>>2,Dt>>2));for(var it=0;it<Dt;it+=4)St[it]=Et[bt+it],St[it+1]=Et[bt+it+1],St[it+2]=Et[bt+it+2],St[it+3]=Et[bt+it+3];bt+=Dt}for(var ht=0;ht<xt.plte.length;ht++)mt.push(xt.plte[ht].est.rgba)}else for(var it=0;it<gt.length;it++){var Rt=gt[it],Tt=new Uint32Array(Rt.img.buffer),wt=Rt.rect.width,ft=Tt.length,Ct=new Uint8Array(ft);ct.push(Ct);for(var ht=0;ht<ft;ht++){var It=Tt[ht];if(ht!=0&&It==Tt[ht-1])Ct[ht]=Ct[ht-1];else if(ht>wt&&It==Tt[ht-wt])Ct[ht]=Ct[ht-wt];else{var yt=pt[It];if(yt==null&&(pt[It]=yt=mt.length,mt.push(It),mt.length>=300))break;Ct[ht]=yt}}}var Pt=mt.length;Pt<=256&&rt==!1&&(Pt<=2?lt=1:Pt<=4?lt=2:Pt<=16?lt=4:lt=8,lt=Math.max(lt,ot));for(var it=0;it<gt.length;it++){var Rt=gt[it];Rt.rect.x,Rt.rect.y;var wt=Rt.rect.width,kt=Rt.rect.height,jt=Rt.img;new Uint32Array(jt.buffer);var Ht=4*wt,Ft=4;if(Pt<=256&&rt==!1){Ht=Math.ceil(lt*wt/8);for(var Lt=new Uint8Array(Ht*kt),Nt=ct[it],Bt=0;Bt<kt;Bt++){var ht=Bt*Ht,_t=Bt*wt;if(lt==8)for(var $t=0;$t<wt;$t++)Lt[ht+$t]=Nt[_t+$t];else if(lt==4)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>1)]|=Nt[_t+$t]<<4-($t&1)*4;else if(lt==2)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>2)]|=Nt[_t+$t]<<6-($t&3)*2;else if(lt==1)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>3)]|=Nt[_t+$t]<<7-($t&7)*1}jt=Lt,st=3,Ft=1}else if(dt==!1&>.length==1){for(var Lt=new Uint8Array(wt*kt*3),Ot=wt*kt,ht=0;ht<Ot;ht++){var St=ht*3,Mt=ht*4;Lt[St]=jt[Mt],Lt[St+1]=jt[Mt+1],Lt[St+2]=jt[Mt+2]}jt=Lt,st=2,Ft=3,Ht=3*wt}Rt.img=jt,Rt.bpl=Ht,Rt.bpp=Ft}return{ctype:st,depth:lt,plte:mt,frames:gt}},UPNG.encode.framize=function(a,s,$,_,_e,tt){for(var nt=[],at=0;at<a.length;at++){var ot=new Uint8Array(a[at]),rt=new Uint32Array(ot.buffer),st,lt=0,et=0,it=s,ut=$,ft=_?1:0;if(at!=0){for(var ht=tt||_||at==1||nt[at-2].dispose!=0?1:2,dt=0,gt=1e9,pt=0;pt<ht;pt++){for(var Rt=new Uint8Array(a[at-1-pt]),mt=new Uint32Array(a[at-1-pt]),ct=s,vt=$,At=-1,xt=-1,bt=0;bt<$;bt++)for(var Et=0;Et<s;Et++){var St=bt*s+Et;rt[St]!=mt[St]&&(Et<ct&&(ct=Et),Et>At&&(At=Et),bt<vt&&(vt=bt),bt>xt&&(xt=bt))}At==-1&&(ct=vt=At=xt=0),_e&&((ct&1)==1&&ct--,(vt&1)==1&&vt--);var Dt=(At-ct+1)*(xt-vt+1);Dt<gt&&(gt=Dt,dt=pt,lt=ct,et=vt,it=At-ct+1,ut=xt-vt+1)}var Rt=new Uint8Array(a[at-1-dt]);dt==1&&(nt[at-1].dispose=2),st=new Uint8Array(it*ut*4),UPNG._copyTile(Rt,s,$,st,it,ut,-lt,-et,0),ft=UPNG._copyTile(ot,s,$,st,it,ut,-lt,-et,3)?1:0,ft==1?UPNG.encode._prepareDiff(ot,s,$,st,{x:lt,y:et,width:it,height:ut}):UPNG._copyTile(ot,s,$,st,it,ut,-lt,-et,0)}else st=ot.slice(0);nt.push({rect:{x:lt,y:et,width:it,height:ut},img:st,blend:ft,dispose:0})}if(_)for(var at=0;at<nt.length;at++){var Tt=nt[at];if(Tt.blend!=1){var wt=Tt.rect,Ct=nt[at-1].rect,It=Math.min(wt.x,Ct.x),yt=Math.min(wt.y,Ct.y),Pt=Math.max(wt.x+wt.width,Ct.x+Ct.width),kt=Math.max(wt.y+wt.height,Ct.y+Ct.height),jt={x:It,y:yt,width:Pt-It,height:kt-yt};nt[at-1].dispose=1,at-1!=0&&UPNG.encode._updateFrame(a,s,$,nt,at-1,jt,_e),UPNG.encode._updateFrame(a,s,$,nt,at,jt,_e)}}var Ht=0;if(a.length!=1)for(var St=0;St<nt.length;St++){var Tt=nt[St];Ht+=Tt.rect.width*Tt.rect.height}return nt},UPNG.encode._updateFrame=function(a,s,$,_,_e,tt,nt){for(var at=Uint8Array,ot=Uint32Array,rt=new at(a[_e-1]),st=new ot(a[_e-1]),lt=_e+1<a.length?new at(a[_e+1]):null,et=new at(a[_e]),it=new ot(et.buffer),ut=s,ft=$,ht=-1,dt=-1,gt=0;gt<tt.height;gt++)for(var pt=0;pt<tt.width;pt++){var mt=tt.x+pt,ct=tt.y+gt,vt=ct*s+mt,At=it[vt];At==0||_[_e-1].dispose==0&&st[vt]==At&&(lt==null||lt[vt*4+3]!=0)||(mt<ut&&(ut=mt),mt>ht&&(ht=mt),ct<ft&&(ft=ct),ct>dt&&(dt=ct))}ht==-1&&(ut=ft=ht=dt=0),nt&&((ut&1)==1&&ut--,(ft&1)==1&&ft--),tt={x:ut,y:ft,width:ht-ut+1,height:dt-ft+1};var xt=_[_e];xt.rect=tt,xt.blend=1,xt.img=new Uint8Array(tt.width*tt.height*4),_[_e-1].dispose==0?(UPNG._copyTile(rt,s,$,xt.img,tt.width,tt.height,-tt.x,-tt.y,0),UPNG.encode._prepareDiff(et,s,$,xt.img,tt)):UPNG._copyTile(et,s,$,xt.img,tt.width,tt.height,-tt.x,-tt.y,0)},UPNG.encode._prepareDiff=function(a,s,$,_,_e){UPNG._copyTile(a,s,$,_,_e.width,_e.height,-_e.x,-_e.y,2)},UPNG.encode._filterZero=function(a,s,$,_,_e,tt,nt){var at=[],ot=[0,1,2,3,4];tt!=-1?ot=[tt]:(s*_>5e5||$==1)&&(ot=[0]);var rt;nt&&(rt={level:0});for(var st=nt&&UZIP!=null?UZIP:pako$1,lt=0;lt<ot.length;lt++){for(var et=0;et<s;et++)UPNG.encode._filterLine(_e,a,et,_,$,ot[lt]);at.push(st.deflate(_e,rt))}for(var it,ut=1e9,lt=0;lt<at.length;lt++)at[lt].length<ut&&(it=lt,ut=at[lt].length);return at[it]},UPNG.encode._filterLine=function(a,s,$,_,_e,tt){var nt=$*_,at=nt+$,ot=UPNG.decode._paeth;if(a[at]=tt,at++,tt==0)if(_<500)for(var rt=0;rt<_;rt++)a[at+rt]=s[nt+rt];else a.set(new Uint8Array(s.buffer,nt,_),at);else if(tt==1){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt];for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-s[nt+rt-_e]+256&255}else if($==0){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt];if(tt==2)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt];if(tt==3)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-(s[nt+rt-_e]>>1)+256&255;if(tt==4)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-ot(s[nt+rt-_e],0,0)+256&255}else{if(tt==2)for(var rt=0;rt<_;rt++)a[at+rt]=s[nt+rt]+256-s[nt+rt-_]&255;if(tt==3){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt]+256-(s[nt+rt-_]>>1)&255;for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]+256-(s[nt+rt-_]+s[nt+rt-_e]>>1)&255}if(tt==4){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt]+256-ot(0,s[nt+rt-_],0)&255;for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]+256-ot(s[nt+rt-_e],s[nt+rt-_],s[nt+rt-_e-_])&255}}},UPNG.crc={table:function(){for(var a=new Uint32Array(256),s=0;s<256;s++){for(var $=s,_=0;_<8;_++)$&1?$=3988292384^$>>>1:$=$>>>1;a[s]=$}return a}(),update:function(a,s,$,_){for(var _e=0;_e<_;_e++)a=UPNG.crc.table[(a^s[$+_e])&255]^a>>>8;return a},crc:function(a,s,$){return UPNG.crc.update(4294967295,a,s,$)^4294967295}},UPNG.quantize=function(a,s){var $=new Uint8Array(a),_=$.slice(0),_e=new Uint32Array(_.buffer),tt=UPNG.quantize.getKDtree(_,s),nt=tt[0],at=tt[1];UPNG.quantize.planeDst;for(var ot=$,rt=_e,st=ot.length,lt=new Uint8Array($.length>>2),et=0;et<st;et+=4){var it=ot[et]*.00392156862745098,ut=ot[et+1]*(1/255),ft=ot[et+2]*(1/255),ht=ot[et+3]*(1/255),dt=UPNG.quantize.getNearest(nt,it,ut,ft,ht);lt[et>>2]=dt.ind,rt[et>>2]=dt.est.rgba}return{abuf:_.buffer,inds:lt,plte:at}},UPNG.quantize.getKDtree=function(a,s,$){$==null&&($=1e-4);var _=new Uint32Array(a.buffer),_e={i0:0,i1:a.length,bst:null,est:null,tdst:0,left:null,right:null};_e.bst=UPNG.quantize.stats(a,_e.i0,_e.i1),_e.est=UPNG.quantize.estats(_e.bst);for(var tt=[_e];tt.length<s;){for(var nt=0,at=0,ot=0;ot<tt.length;ot++)tt[ot].est.L>nt&&(nt=tt[ot].est.L,at=ot);if(nt<$)break;var rt=tt[at],st=UPNG.quantize.splitPixels(a,_,rt.i0,rt.i1,rt.est.e,rt.est.eMq255),lt=rt.i0>=st||rt.i1<=st;if(lt){rt.est.L=0;continue}var et={i0:rt.i0,i1:st,bst:null,est:null,tdst:0,left:null,right:null};et.bst=UPNG.quantize.stats(a,et.i0,et.i1),et.est=UPNG.quantize.estats(et.bst);var it={i0:st,i1:rt.i1,bst:null,est:null,tdst:0,left:null,right:null};it.bst={R:[],m:[],N:rt.bst.N-et.bst.N};for(var ot=0;ot<16;ot++)it.bst.R[ot]=rt.bst.R[ot]-et.bst.R[ot];for(var ot=0;ot<4;ot++)it.bst.m[ot]=rt.bst.m[ot]-et.bst.m[ot];it.est=UPNG.quantize.estats(it.bst),rt.left=et,rt.right=it,tt[at]=et,tt.push(it)}tt.sort(function(ut,ft){return ft.bst.N-ut.bst.N});for(var ot=0;ot<tt.length;ot++)tt[ot].ind=ot;return[_e,tt]},UPNG.quantize.getNearest=function(a,s,$,_,_e){if(a.left==null)return a.tdst=UPNG.quantize.dist(a.est.q,s,$,_,_e),a;var tt=UPNG.quantize.planeDst(a.est,s,$,_,_e),nt=a.left,at=a.right;tt>0&&(nt=a.right,at=a.left);var ot=UPNG.quantize.getNearest(nt,s,$,_,_e);if(ot.tdst<=tt*tt)return ot;var rt=UPNG.quantize.getNearest(at,s,$,_,_e);return rt.tdst<ot.tdst?rt:ot},UPNG.quantize.planeDst=function(a,s,$,_,_e){var tt=a.e;return tt[0]*s+tt[1]*$+tt[2]*_+tt[3]*_e-a.eMq},UPNG.quantize.dist=function(a,s,$,_,_e){var tt=s-a[0],nt=$-a[1],at=_-a[2],ot=_e-a[3];return tt*tt+nt*nt+at*at+ot*ot},UPNG.quantize.splitPixels=function(a,s,$,_,_e,tt){var nt=UPNG.quantize.vecDot;for(_-=4;$<_;){for(;nt(a,$,_e)<=tt;)$+=4;for(;nt(a,_,_e)>tt;)_-=4;if($>=_)break;var at=s[$>>2];s[$>>2]=s[_>>2],s[_>>2]=at,$+=4,_-=4}for(;nt(a,$,_e)>tt;)$-=4;return $+4},UPNG.quantize.vecDot=function(a,s,$){return a[s]*$[0]+a[s+1]*$[1]+a[s+2]*$[2]+a[s+3]*$[3]},UPNG.quantize.stats=function(a,s,$){for(var _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_e=[0,0,0,0],tt=$-s>>2,nt=s;nt<$;nt+=4){var at=a[nt]*.00392156862745098,ot=a[nt+1]*(1/255),rt=a[nt+2]*(1/255),st=a[nt+3]*(1/255);_e[0]+=at,_e[1]+=ot,_e[2]+=rt,_e[3]+=st,_[0]+=at*at,_[1]+=at*ot,_[2]+=at*rt,_[3]+=at*st,_[5]+=ot*ot,_[6]+=ot*rt,_[7]+=ot*st,_[10]+=rt*rt,_[11]+=rt*st,_[15]+=st*st}return _[4]=_[1],_[8]=_[2],_[9]=_[6],_[12]=_[3],_[13]=_[7],_[14]=_[11],{R:_,m:_e,N:tt}},UPNG.quantize.estats=function(a){var s=a.R,$=a.m,_=a.N,_e=$[0],tt=$[1],nt=$[2],at=$[3],ot=_==0?0:1/_,rt=[s[0]-_e*_e*ot,s[1]-_e*tt*ot,s[2]-_e*nt*ot,s[3]-_e*at*ot,s[4]-tt*_e*ot,s[5]-tt*tt*ot,s[6]-tt*nt*ot,s[7]-tt*at*ot,s[8]-nt*_e*ot,s[9]-nt*tt*ot,s[10]-nt*nt*ot,s[11]-nt*at*ot,s[12]-at*_e*ot,s[13]-at*tt*ot,s[14]-at*nt*ot,s[15]-at*at*ot],st=rt,lt=UPNG.M4,et=[.5,.5,.5,.5],it=0,ut=0;if(_!=0)for(var ft=0;ft<10&&(et=lt.multVec(st,et),ut=Math.sqrt(lt.dot(et,et)),et=lt.sml(1/ut,et),!(Math.abs(ut-it)<1e-9));ft++)it=ut;var ht=[_e*ot,tt*ot,nt*ot,at*ot],dt=lt.dot(lt.sml(255,ht),et);return{Cov:rt,q:ht,e:et,L:it,eMq255:dt,eMq:lt.dot(et,ht),rgba:(Math.round(255*ht[3])<<24|Math.round(255*ht[2])<<16|Math.round(255*ht[1])<<8|Math.round(255*ht[0])<<0)>>>0}},UPNG.M4={multVec:function(a,s){return[a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]*s[3],a[4]*s[0]+a[5]*s[1]+a[6]*s[2]+a[7]*s[3],a[8]*s[0]+a[9]*s[1]+a[10]*s[2]+a[11]*s[3],a[12]*s[0]+a[13]*s[1]+a[14]*s[2]+a[15]*s[3]]},dot:function(a,s){return a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]*s[3]},sml:function(a,s){return[a*s[0],a*s[1],a*s[2],a*s[3]]}},UPNG.encode.concatRGBA=function(a){for(var s=0,$=0;$<a.length;$++)s+=a[$].byteLength;for(var _=new Uint8Array(s),_e=0,$=0;$<a.length;$++){for(var tt=new Uint8Array(a[$]),nt=tt.length,at=0;at<nt;at+=4){var ot=tt[at],rt=tt[at+1],st=tt[at+2],lt=tt[at+3];lt==0&&(ot=rt=st=0),_[_e+at]=ot,_[_e+at+1]=rt,_[_e+at+2]=st,_[_e+at+3]=lt}_e+=nt}return _.buffer};var PngType;(function(a){a.Greyscale="Greyscale",a.Truecolour="Truecolour",a.IndexedColour="IndexedColour",a.GreyscaleWithAlpha="GreyscaleWithAlpha",a.TruecolourWithAlpha="TruecolourWithAlpha"})(PngType||(PngType={}));const asEnum=(a,s)=>{if(a!==void 0)return s[a]};var NonFullScreenPageMode;(function(a){a.UseNone="UseNone",a.UseOutlines="UseOutlines",a.UseThumbs="UseThumbs",a.UseOC="UseOC"})(NonFullScreenPageMode||(NonFullScreenPageMode={}));var ReadingDirection;(function(a){a.L2R="L2R",a.R2L="R2L"})(ReadingDirection||(ReadingDirection={}));var PrintScaling;(function(a){a.None="None",a.AppDefault="AppDefault"})(PrintScaling||(PrintScaling={}));var Duplex;(function(a){a.Simplex="Simplex",a.DuplexFlipShortEdge="DuplexFlipShortEdge",a.DuplexFlipLongEdge="DuplexFlipLongEdge"})(Duplex||(Duplex={}));class ViewerPreferences{constructor(s){this.dict=s}lookupBool(s){const $=this.dict.lookup(PDFName.of(s));if($ instanceof PDFBool)return $}lookupName(s){const $=this.dict.lookup(PDFName.of(s));if($ instanceof PDFName)return $}HideToolbar(){return this.lookupBool("HideToolbar")}HideMenubar(){return this.lookupBool("HideMenubar")}HideWindowUI(){return this.lookupBool("HideWindowUI")}FitWindow(){return this.lookupBool("FitWindow")}CenterWindow(){return this.lookupBool("CenterWindow")}DisplayDocTitle(){return this.lookupBool("DisplayDocTitle")}NonFullScreenPageMode(){return this.lookupName("NonFullScreenPageMode")}Direction(){return this.lookupName("Direction")}PrintScaling(){return this.lookupName("PrintScaling")}Duplex(){return this.lookupName("Duplex")}PickTrayByPDFSize(){return this.lookupBool("PickTrayByPDFSize")}PrintPageRange(){const s=this.dict.lookup(PDFName.of("PrintPageRange"));if(s instanceof PDFArray)return s}NumCopies(){const s=this.dict.lookup(PDFName.of("NumCopies"));if(s instanceof PDFNumber)return s}getHideToolbar(){var s,$;return($=(s=this.HideToolbar())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getHideMenubar(){var s,$;return($=(s=this.HideMenubar())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getHideWindowUI(){var s,$;return($=(s=this.HideWindowUI())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getFitWindow(){var s,$;return($=(s=this.FitWindow())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getCenterWindow(){var s,$;return($=(s=this.CenterWindow())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getDisplayDocTitle(){var s,$;return($=(s=this.DisplayDocTitle())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getNonFullScreenPageMode(){var s,$;const _=(s=this.NonFullScreenPageMode())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,NonFullScreenPageMode))!==null&&$!==void 0?$:NonFullScreenPageMode.UseNone}getReadingDirection(){var s,$;const _=(s=this.Direction())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,ReadingDirection))!==null&&$!==void 0?$:ReadingDirection.L2R}getPrintScaling(){var s,$;const _=(s=this.PrintScaling())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,PrintScaling))!==null&&$!==void 0?$:PrintScaling.AppDefault}getDuplex(){var s;const $=(s=this.Duplex())===null||s===void 0?void 0:s.decodeText();return asEnum($,Duplex)}getPickTrayByPDFSize(){var s;return(s=this.PickTrayByPDFSize())===null||s===void 0?void 0:s.asBoolean()}getPrintPageRange(){const s=this.PrintPageRange();if(!s)return[];const $=[];for(let _=0;_<s.size();_+=2){const _e=s.lookup(_,PDFNumber).asNumber(),tt=s.lookup(_+1,PDFNumber).asNumber();$.push({start:_e,end:tt})}return $}getNumCopies(){var s,$;return($=(s=this.NumCopies())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:1}setHideToolbar(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideToolbar"),$)}setHideMenubar(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideMenubar"),$)}setHideWindowUI(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideWindowUI"),$)}setFitWindow(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("FitWindow"),$)}setCenterWindow(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("CenterWindow"),$)}setDisplayDocTitle(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("DisplayDocTitle"),$)}setNonFullScreenPageMode(s){assertIsOneOf(s,"nonFullScreenPageMode",NonFullScreenPageMode);const $=PDFName.of(s);this.dict.set(PDFName.of("NonFullScreenPageMode"),$)}setReadingDirection(s){assertIsOneOf(s,"readingDirection",ReadingDirection);const $=PDFName.of(s);this.dict.set(PDFName.of("Direction"),$)}setPrintScaling(s){assertIsOneOf(s,"printScaling",PrintScaling);const $=PDFName.of(s);this.dict.set(PDFName.of("PrintScaling"),$)}setDuplex(s){assertIsOneOf(s,"duplex",Duplex);const $=PDFName.of(s);this.dict.set(PDFName.of("Duplex"),$)}setPickTrayByPDFSize(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("PickTrayByPDFSize"),$)}setPrintPageRange(s){Array.isArray(s)||(s=[s]);const $=[];for(let _e=0,tt=s.length;_e<tt;_e++)$.push(s[_e].start),$.push(s[_e].end);assertEachIs($,"printPageRange",["number"]);const _=this.dict.context.obj($);this.dict.set(PDFName.of("PrintPageRange"),_)}setNumCopies(s){assertRange(s,"numCopies",1,Number.MAX_VALUE),assertInteger(s,"numCopies");const $=this.dict.context.obj(s);this.dict.set(PDFName.of("NumCopies"),$)}}ViewerPreferences.fromDict=a=>new ViewerPreferences(a),ViewerPreferences.create=a=>{const s=a.obj({});return new ViewerPreferences(s)};const tfRegex=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/;class PDFAcroField{constructor(s,$){this.dict=s,this.ref=$}T(){return this.dict.lookupMaybe(PDFName.of("T"),PDFString,PDFHexString)}Ff(){const s=this.getInheritableAttribute(PDFName.of("Ff"));return this.dict.context.lookupMaybe(s,PDFNumber)}V(){const s=this.getInheritableAttribute(PDFName.of("V"));return this.dict.context.lookup(s)}Kids(){return this.dict.lookupMaybe(PDFName.of("Kids"),PDFArray)}DA(){const s=this.dict.lookup(PDFName.of("DA"));if(s instanceof PDFString||s instanceof PDFHexString)return s}setKids(s){this.dict.set(PDFName.of("Kids"),this.dict.context.obj(s))}getParent(){const s=this.dict.get(PDFName.of("Parent"));if(s instanceof PDFRef){const $=this.dict.lookup(PDFName.of("Parent"),PDFDict);return new PDFAcroField($,s)}}setParent(s){s?this.dict.set(PDFName.of("Parent"),s):this.dict.delete(PDFName.of("Parent"))}getFullyQualifiedName(){const s=this.getParent();return s?`${s.getFullyQualifiedName()}.${this.getPartialName()}`:this.getPartialName()}getPartialName(){var s;return(s=this.T())===null||s===void 0?void 0:s.decodeText()}setPartialName(s){s?this.dict.set(PDFName.of("T"),PDFHexString.fromText(s)):this.dict.delete(PDFName.of("T"))}setDefaultAppearance(s){this.dict.set(PDFName.of("DA"),PDFString.of(s))}getDefaultAppearance(){const s=this.DA();return s instanceof PDFHexString?s.decodeText():s==null?void 0:s.asString()}setFontSize(s){var $;const _=($=this.getFullyQualifiedName())!==null&&$!==void 0?$:"",_e=this.getDefaultAppearance();if(!_e)throw new MissingDAEntryError(_);const tt=findLastMatch(_e,tfRegex);if(!tt.match)throw new MissingTfOperatorError(_);const nt=_e.slice(0,tt.pos-tt.match[0].length),at=tt.pos<=_e.length?_e.slice(tt.pos):"",ot=tt.match[1],rt=`${nt} /${ot} ${s} Tf ${at}`;this.setDefaultAppearance(rt)}getFlags(){var s,$;return($=(s=this.Ff())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:0}setFlags(s){this.dict.set(PDFName.of("Ff"),PDFNumber.of(s))}hasFlag(s){return(this.getFlags()&s)!==0}setFlag(s){const $=this.getFlags();this.setFlags($|s)}clearFlag(s){const $=this.getFlags();this.setFlags($&~s)}setFlagTo(s,$){$?this.setFlag(s):this.clearFlag(s)}getInheritableAttribute(s){let $;return this.ascend(_=>{$||($=_.dict.get(s))}),$}ascend(s){s(this);const $=this.getParent();$&&$.ascend(s)}}class BorderStyle{constructor(s){this.dict=s}W(){const s=this.dict.lookup(PDFName.of("W"));if(s instanceof PDFNumber)return s}getWidth(){var s,$;return($=(s=this.W())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:1}setWidth(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("W"),$)}}BorderStyle.fromDict=a=>new BorderStyle(a);class PDFAnnotation{constructor(s){this.dict=s}Rect(){return this.dict.lookup(PDFName.of("Rect"),PDFArray)}AP(){return this.dict.lookupMaybe(PDFName.of("AP"),PDFDict)}F(){const s=this.dict.lookup(PDFName.of("F"));return this.dict.context.lookupMaybe(s,PDFNumber)}getRectangle(){var s;const $=this.Rect();return(s=$==null?void 0:$.asRectangle())!==null&&s!==void 0?s:{x:0,y:0,width:0,height:0}}setRectangle(s){const{x:$,y:_,width:_e,height:tt}=s,nt=this.dict.context.obj([$,_,$+_e,_+tt]);this.dict.set(PDFName.of("Rect"),nt)}getAppearanceState(){const s=this.dict.lookup(PDFName.of("AS"));if(s instanceof PDFName)return s}setAppearanceState(s){this.dict.set(PDFName.of("AS"),s)}setAppearances(s){this.dict.set(PDFName.of("AP"),s)}ensureAP(){let s=this.AP();return s||(s=this.dict.context.obj({}),this.dict.set(PDFName.of("AP"),s)),s}getNormalAppearance(){const $=this.ensureAP().get(PDFName.of("N"));if($ instanceof PDFRef||$ instanceof PDFDict)return $;throw new Error(`Unexpected N type: ${$==null?void 0:$.constructor.name}`)}setNormalAppearance(s){this.ensureAP().set(PDFName.of("N"),s)}setRolloverAppearance(s){this.ensureAP().set(PDFName.of("R"),s)}setDownAppearance(s){this.ensureAP().set(PDFName.of("D"),s)}removeRolloverAppearance(){const s=this.AP();s==null||s.delete(PDFName.of("R"))}removeDownAppearance(){const s=this.AP();s==null||s.delete(PDFName.of("D"))}getAppearances(){const s=this.AP();if(!s)return;const $=s.lookup(PDFName.of("N"),PDFDict,PDFStream),_=s.lookupMaybe(PDFName.of("R"),PDFDict,PDFStream),_e=s.lookupMaybe(PDFName.of("D"),PDFDict,PDFStream);return{normal:$,rollover:_,down:_e}}getFlags(){var s,$;return($=(s=this.F())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:0}setFlags(s){this.dict.set(PDFName.of("F"),PDFNumber.of(s))}hasFlag(s){return(this.getFlags()&s)!==0}setFlag(s){const $=this.getFlags();this.setFlags($|s)}clearFlag(s){const $=this.getFlags();this.setFlags($&~s)}setFlagTo(s,$){$?this.setFlag(s):this.clearFlag(s)}}PDFAnnotation.fromDict=a=>new PDFAnnotation(a);class AppearanceCharacteristics{constructor(s){this.dict=s}R(){const s=this.dict.lookup(PDFName.of("R"));if(s instanceof PDFNumber)return s}BC(){const s=this.dict.lookup(PDFName.of("BC"));if(s instanceof PDFArray)return s}BG(){const s=this.dict.lookup(PDFName.of("BG"));if(s instanceof PDFArray)return s}CA(){const s=this.dict.lookup(PDFName.of("CA"));if(s instanceof PDFHexString||s instanceof PDFString)return s}RC(){const s=this.dict.lookup(PDFName.of("RC"));if(s instanceof PDFHexString||s instanceof PDFString)return s}AC(){const s=this.dict.lookup(PDFName.of("AC"));if(s instanceof PDFHexString||s instanceof PDFString)return s}getRotation(){var s;return(s=this.R())===null||s===void 0?void 0:s.asNumber()}getBorderColor(){const s=this.BC();if(!s)return;const $=[];for(let _=0,_e=s==null?void 0:s.size();_<_e;_++){const tt=s.get(_);tt instanceof PDFNumber&&$.push(tt.asNumber())}return $}getBackgroundColor(){const s=this.BG();if(!s)return;const $=[];for(let _=0,_e=s==null?void 0:s.size();_<_e;_++){const tt=s.get(_);tt instanceof PDFNumber&&$.push(tt.asNumber())}return $}getCaptions(){const s=this.CA(),$=this.RC(),_=this.AC();return{normal:s==null?void 0:s.decodeText(),rollover:$==null?void 0:$.decodeText(),down:_==null?void 0:_.decodeText()}}setRotation(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("R"),$)}setBorderColor(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("BC"),$)}setBackgroundColor(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("BG"),$)}setCaptions(s){const $=PDFHexString.fromText(s.normal);if(this.dict.set(PDFName.of("CA"),$),s.rollover){const _=PDFHexString.fromText(s.rollover);this.dict.set(PDFName.of("RC"),_)}else this.dict.delete(PDFName.of("RC"));if(s.down){const _=PDFHexString.fromText(s.down);this.dict.set(PDFName.of("AC"),_)}else this.dict.delete(PDFName.of("AC"))}}AppearanceCharacteristics.fromDict=a=>new AppearanceCharacteristics(a);class PDFWidgetAnnotation extends PDFAnnotation{MK(){const s=this.dict.lookup(PDFName.of("MK"));if(s instanceof PDFDict)return s}BS(){const s=this.dict.lookup(PDFName.of("BS"));if(s instanceof PDFDict)return s}DA(){const s=this.dict.lookup(PDFName.of("DA"));if(s instanceof PDFString||s instanceof PDFHexString)return s}P(){const s=this.dict.get(PDFName.of("P"));if(s instanceof PDFRef)return s}setP(s){this.dict.set(PDFName.of("P"),s)}setDefaultAppearance(s){this.dict.set(PDFName.of("DA"),PDFString.of(s))}getDefaultAppearance(){const s=this.DA();return s instanceof PDFHexString?s.decodeText():s==null?void 0:s.asString()}getAppearanceCharacteristics(){const s=this.MK();if(s)return AppearanceCharacteristics.fromDict(s)}getOrCreateAppearanceCharacteristics(){const s=this.MK();if(s)return AppearanceCharacteristics.fromDict(s);const $=AppearanceCharacteristics.fromDict(this.dict.context.obj({}));return this.dict.set(PDFName.of("MK"),$.dict),$}getBorderStyle(){const s=this.BS();if(s)return BorderStyle.fromDict(s)}getOrCreateBorderStyle(){const s=this.BS();if(s)return BorderStyle.fromDict(s);const $=BorderStyle.fromDict(this.dict.context.obj({}));return this.dict.set(PDFName.of("BS"),$.dict),$}getOnValue(){var s;const $=(s=this.getAppearances())===null||s===void 0?void 0:s.normal;if($ instanceof PDFDict){const _=$.keys();for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e];if(nt!==PDFName.of("Off"))return nt}}}}PDFWidgetAnnotation.fromDict=a=>new PDFWidgetAnnotation(a),PDFWidgetAnnotation.create=(a,s)=>{const $=a.obj({Type:"Annot",Subtype:"Widget",Rect:[0,0,0,0],Parent:s});return new PDFWidgetAnnotation($)};class PDFAcroTerminal extends PDFAcroField{FT(){const s=this.getInheritableAttribute(PDFName.of("FT"));return this.dict.context.lookup(s,PDFName)}getWidgets(){const s=this.Kids();if(!s)return[PDFWidgetAnnotation.fromDict(this.dict)];const $=new Array(s.size());for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_,PDFDict);$[_]=PDFWidgetAnnotation.fromDict(tt)}return $}addWidget(s){const{Kids:$}=this.normalizedEntries();$.push(s)}removeWidget(s){const $=this.Kids();if($){if(s<0||s>$.size())throw new IndexOutOfBoundsError(s,0,$.size());$.remove(s)}else{if(s!==0)throw new IndexOutOfBoundsError(s,0,0);this.setKids([])}}normalizedEntries(){let s=this.Kids();return s||(s=this.dict.context.obj([this.ref]),this.dict.set(PDFName.of("Kids"),s)),{Kids:s}}}PDFAcroTerminal.fromDict=(a,s)=>new PDFAcroTerminal(a,s);class PDFAcroButton extends PDFAcroTerminal{Opt(){return this.dict.lookupMaybe(PDFName.of("Opt"),PDFString,PDFHexString,PDFArray)}setOpt(s){this.dict.set(PDFName.of("Opt"),this.dict.context.obj(s))}getExportValues(){const s=this.Opt();if(!s)return;if(s instanceof PDFString||s instanceof PDFHexString)return[s];const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);(tt instanceof PDFString||tt instanceof PDFHexString)&&$.push(tt)}return $}removeExportValue(s){const $=this.Opt();if($)if($ instanceof PDFString||$ instanceof PDFHexString){if(s!==0)throw new IndexOutOfBoundsError(s,0,0);this.setOpt([])}else{if(s<0||s>$.size())throw new IndexOutOfBoundsError(s,0,$.size());$.remove(s)}}normalizeExportValues(){var s,$,_,_e;const tt=(s=this.getExportValues())!==null&&s!==void 0?s:[],nt=[],at=this.getWidgets();for(let ot=0,rt=at.length;ot<rt;ot++){const st=at[ot],lt=($=tt[ot])!==null&&$!==void 0?$:PDFHexString.fromText((_e=(_=st.getOnValue())===null||_===void 0?void 0:_.decodeText())!==null&&_e!==void 0?_e:"");nt.push(lt)}this.setOpt(nt)}addOpt(s,$){var _;this.normalizeExportValues();const _e=s.decodeText();let tt;if($){const at=(_=this.getExportValues())!==null&&_!==void 0?_:[];for(let ot=0,rt=at.length;ot<rt;ot++)at[ot].decodeText()===_e&&(tt=ot)}const nt=this.Opt();return nt.push(s),tt??nt.size()-1}addWidgetWithOpt(s,$,_){const _e=this.addOpt($,_),tt=PDFName.of(String(_e));return this.addWidget(s),tt}}class PDFAcroCheckBox extends PDFAcroButton{setValue(s){var $;const _=($=this.getOnValue())!==null&&$!==void 0?$:PDFName.of("Yes");if(s!==_&&s!==PDFName.of("Off"))throw new InvalidAcroFieldValueError;this.dict.set(PDFName.of("V"),s);const _e=this.getWidgets();for(let tt=0,nt=_e.length;tt<nt;tt++){const at=_e[tt],ot=at.getOnValue()===s?s:PDFName.of("Off");at.setAppearanceState(ot)}}getValue(){const s=this.V();return s instanceof PDFName?s:PDFName.of("Off")}getOnValue(){const[s]=this.getWidgets();return s==null?void 0:s.getOnValue()}}PDFAcroCheckBox.fromDict=(a,s)=>new PDFAcroCheckBox(a,s),PDFAcroCheckBox.create=a=>{const s=a.obj({FT:"Btn",Kids:[]}),$=a.register(s);return new PDFAcroCheckBox(s,$)};const flag$1=a=>1<<a;var AcroFieldFlags;(function(a){a[a.ReadOnly=flag$1(0)]="ReadOnly",a[a.Required=flag$1(1)]="Required",a[a.NoExport=flag$1(2)]="NoExport"})(AcroFieldFlags||(AcroFieldFlags={}));var AcroButtonFlags;(function(a){a[a.NoToggleToOff=flag$1(14)]="NoToggleToOff",a[a.Radio=flag$1(15)]="Radio",a[a.PushButton=flag$1(16)]="PushButton",a[a.RadiosInUnison=flag$1(25)]="RadiosInUnison"})(AcroButtonFlags||(AcroButtonFlags={}));var AcroTextFlags;(function(a){a[a.Multiline=flag$1(12)]="Multiline",a[a.Password=flag$1(13)]="Password",a[a.FileSelect=flag$1(20)]="FileSelect",a[a.DoNotSpellCheck=flag$1(22)]="DoNotSpellCheck",a[a.DoNotScroll=flag$1(23)]="DoNotScroll",a[a.Comb=flag$1(24)]="Comb",a[a.RichText=flag$1(25)]="RichText"})(AcroTextFlags||(AcroTextFlags={}));var AcroChoiceFlags;(function(a){a[a.Combo=flag$1(17)]="Combo",a[a.Edit=flag$1(18)]="Edit",a[a.Sort=flag$1(19)]="Sort",a[a.MultiSelect=flag$1(21)]="MultiSelect",a[a.DoNotSpellCheck=flag$1(22)]="DoNotSpellCheck",a[a.CommitOnSelChange=flag$1(26)]="CommitOnSelChange"})(AcroChoiceFlags||(AcroChoiceFlags={}));class PDFAcroChoice extends PDFAcroTerminal{setValues(s){if(this.hasFlag(AcroChoiceFlags.Combo)&&!this.hasFlag(AcroChoiceFlags.Edit)&&!this.valuesAreValid(s))throw new InvalidAcroFieldValueError;if(s.length===0&&this.dict.delete(PDFName.of("V")),s.length===1&&this.dict.set(PDFName.of("V"),s[0]),s.length>1){if(!this.hasFlag(AcroChoiceFlags.MultiSelect))throw new MultiSelectValueError;this.dict.set(PDFName.of("V"),this.dict.context.obj(s))}this.updateSelectedIndices(s)}valuesAreValid(s){const $=this.getOptions();for(let _=0,_e=s.length;_<_e;_++){const tt=s[_].decodeText();if(!$.find(nt=>tt===(nt.display||nt.value).decodeText()))return!1}return!0}updateSelectedIndices(s){if(s.length>1){const $=new Array(s.length),_=this.getOptions();for(let _e=0,tt=s.length;_e<tt;_e++){const nt=s[_e].decodeText();$[_e]=_.findIndex(at=>nt===(at.display||at.value).decodeText())}this.dict.set(PDFName.of("I"),this.dict.context.obj($.sort()))}else this.dict.delete(PDFName.of("I"))}getValues(){const s=this.V();if(s instanceof PDFString||s instanceof PDFHexString)return[s];if(s instanceof PDFArray){const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);(tt instanceof PDFString||tt instanceof PDFHexString)&&$.push(tt)}return $}return[]}Opt(){return this.dict.lookupMaybe(PDFName.of("Opt"),PDFString,PDFHexString,PDFArray)}setOptions(s){const $=new Array(s.length);for(let _=0,_e=s.length;_<_e;_++){const{value:tt,display:nt}=s[_];$[_]=this.dict.context.obj([tt,nt||tt])}this.dict.set(PDFName.of("Opt"),this.dict.context.obj($))}getOptions(){const s=this.Opt();if(s instanceof PDFString||s instanceof PDFHexString)return[{value:s,display:s}];if(s instanceof PDFArray){const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);if((tt instanceof PDFString||tt instanceof PDFHexString)&&$.push({value:tt,display:tt}),tt instanceof PDFArray&&tt.size()>0){const nt=tt.lookup(0,PDFString,PDFHexString),at=tt.lookupMaybe(1,PDFString,PDFHexString);$.push({value:nt,display:at||nt})}}return $}return[]}}class PDFAcroComboBox extends PDFAcroChoice{}PDFAcroComboBox.fromDict=(a,s)=>new PDFAcroComboBox(a,s),PDFAcroComboBox.create=a=>{const s=a.obj({FT:"Ch",Ff:AcroChoiceFlags.Combo,Kids:[]}),$=a.register(s);return new PDFAcroComboBox(s,$)};class PDFAcroNonTerminal extends PDFAcroField{addField(s){const{Kids:$}=this.normalizedEntries();$==null||$.push(s)}normalizedEntries(){let s=this.Kids();return s||(s=this.dict.context.obj([]),this.dict.set(PDFName.of("Kids"),s)),{Kids:s}}}PDFAcroNonTerminal.fromDict=(a,s)=>new PDFAcroNonTerminal(a,s),PDFAcroNonTerminal.create=a=>{const s=a.obj({}),$=a.register(s);return new PDFAcroNonTerminal(s,$)};class PDFAcroSignature extends PDFAcroTerminal{}PDFAcroSignature.fromDict=(a,s)=>new PDFAcroSignature(a,s);class PDFAcroText extends PDFAcroTerminal{MaxLen(){const s=this.dict.lookup(PDFName.of("MaxLen"));if(s instanceof PDFNumber)return s}Q(){const s=this.dict.lookup(PDFName.of("Q"));if(s instanceof PDFNumber)return s}setMaxLength(s){this.dict.set(PDFName.of("MaxLen"),PDFNumber.of(s))}removeMaxLength(){this.dict.delete(PDFName.of("MaxLen"))}getMaxLength(){var s;return(s=this.MaxLen())===null||s===void 0?void 0:s.asNumber()}setQuadding(s){this.dict.set(PDFName.of("Q"),PDFNumber.of(s))}getQuadding(){var s;return(s=this.Q())===null||s===void 0?void 0:s.asNumber()}setValue(s){this.dict.set(PDFName.of("V"),s)}removeValue(){this.dict.delete(PDFName.of("V"))}getValue(){const s=this.V();if(s instanceof PDFString||s instanceof PDFHexString)return s}}PDFAcroText.fromDict=(a,s)=>new PDFAcroText(a,s),PDFAcroText.create=a=>{const s=a.obj({FT:"Tx",Kids:[]}),$=a.register(s);return new PDFAcroText(s,$)};class PDFAcroPushButton extends PDFAcroButton{}PDFAcroPushButton.fromDict=(a,s)=>new PDFAcroPushButton(a,s),PDFAcroPushButton.create=a=>{const s=a.obj({FT:"Btn",Ff:AcroButtonFlags.PushButton,Kids:[]}),$=a.register(s);return new PDFAcroPushButton(s,$)};class PDFAcroRadioButton extends PDFAcroButton{setValue(s){if(!this.getOnValues().includes(s)&&s!==PDFName.of("Off"))throw new InvalidAcroFieldValueError;this.dict.set(PDFName.of("V"),s);const _=this.getWidgets();for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e],at=nt.getOnValue()===s?s:PDFName.of("Off");nt.setAppearanceState(at)}}getValue(){const s=this.V();return s instanceof PDFName?s:PDFName.of("Off")}getOnValues(){const s=this.getWidgets(),$=[];for(let _=0,_e=s.length;_<_e;_++){const tt=s[_].getOnValue();tt&&$.push(tt)}return $}}PDFAcroRadioButton.fromDict=(a,s)=>new PDFAcroRadioButton(a,s),PDFAcroRadioButton.create=a=>{const s=a.obj({FT:"Btn",Ff:AcroButtonFlags.Radio,Kids:[]}),$=a.register(s);return new PDFAcroRadioButton(s,$)};class PDFAcroListBox extends PDFAcroChoice{}PDFAcroListBox.fromDict=(a,s)=>new PDFAcroListBox(a,s),PDFAcroListBox.create=a=>{const s=a.obj({FT:"Ch",Kids:[]}),$=a.register(s);return new PDFAcroListBox(s,$)};const createPDFAcroFields=a=>{if(!a)return[];const s=[];for(let $=0,_=a.size();$<_;$++){const _e=a.get($),tt=a.lookup($);_e instanceof PDFRef&&tt instanceof PDFDict&&s.push([createPDFAcroField(tt,_e),_e])}return s},createPDFAcroField=(a,s)=>isNonTerminalAcroField(a)?PDFAcroNonTerminal.fromDict(a,s):createPDFAcroTerminal(a,s),isNonTerminalAcroField=a=>{const s=a.lookup(PDFName.of("Kids"));if(s instanceof PDFArray)for(let $=0,_=s.size();$<_;$++){const _e=s.lookup($);if(_e instanceof PDFDict&&_e.has(PDFName.of("T")))return!0}return!1},createPDFAcroTerminal=(a,s)=>{const $=getInheritableAttribute(a,PDFName.of("FT")),_=a.context.lookup($,PDFName);return _===PDFName.of("Btn")?createPDFAcroButton(a,s):_===PDFName.of("Ch")?createPDFAcroChoice(a,s):_===PDFName.of("Tx")?PDFAcroText.fromDict(a,s):_===PDFName.of("Sig")?PDFAcroSignature.fromDict(a,s):PDFAcroTerminal.fromDict(a,s)},createPDFAcroButton=(a,s)=>{var $;const _=getInheritableAttribute(a,PDFName.of("Ff")),_e=a.context.lookupMaybe(_,PDFNumber),tt=($=_e==null?void 0:_e.asNumber())!==null&&$!==void 0?$:0;return flagIsSet(tt,AcroButtonFlags.PushButton)?PDFAcroPushButton.fromDict(a,s):flagIsSet(tt,AcroButtonFlags.Radio)?PDFAcroRadioButton.fromDict(a,s):PDFAcroCheckBox.fromDict(a,s)},createPDFAcroChoice=(a,s)=>{var $;const _=getInheritableAttribute(a,PDFName.of("Ff")),_e=a.context.lookupMaybe(_,PDFNumber),tt=($=_e==null?void 0:_e.asNumber())!==null&&$!==void 0?$:0;return flagIsSet(tt,AcroChoiceFlags.Combo)?PDFAcroComboBox.fromDict(a,s):PDFAcroListBox.fromDict(a,s)},flagIsSet=(a,s)=>(a&s)!==0,getInheritableAttribute=(a,s)=>{let $;return ascend(a,_=>{$||($=_.get(s))}),$},ascend=(a,s)=>{s(a);const $=a.lookupMaybe(PDFName.of("Parent"),PDFDict);$&&ascend($,s)};class PDFAcroForm{constructor(s){this.dict=s}Fields(){const s=this.dict.lookup(PDFName.of("Fields"));if(s instanceof PDFArray)return s}getFields(){const{Fields:s}=this.normalizedEntries(),$=new Array(s.size());for(let _=0,_e=s.size();_<_e;_++){const tt=s.get(_),nt=s.lookup(_,PDFDict);$[_]=[createPDFAcroField(nt,tt),tt]}return $}getAllFields(){const s=[],$=_=>{if(_)for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e];s.push(nt);const[at]=nt;at instanceof PDFAcroNonTerminal&&$(createPDFAcroFields(at.Kids()))}};return $(this.getFields()),s}addField(s){const{Fields:$}=this.normalizedEntries();$==null||$.push(s)}removeField(s){const $=s.getParent(),_=$===void 0?this.normalizedEntries().Fields:$.Kids(),_e=_==null?void 0:_.indexOf(s.ref);if(_===void 0||_e===void 0)throw new Error(`Tried to remove inexistent field ${s.getFullyQualifiedName()}`);_.remove(_e),$!==void 0&&_.size()===0&&this.removeField($)}normalizedEntries(){let s=this.Fields();return s||(s=this.dict.context.obj([]),this.dict.set(PDFName.of("Fields"),s)),{Fields:s}}}PDFAcroForm.fromDict=a=>new PDFAcroForm(a),PDFAcroForm.create=a=>{const s=a.obj({Fields:[]});return new PDFAcroForm(s)};class PDFCatalog extends PDFDict{Pages(){return this.lookup(PDFName.of("Pages"),PDFDict)}AcroForm(){return this.lookupMaybe(PDFName.of("AcroForm"),PDFDict)}getAcroForm(){const s=this.AcroForm();if(s)return PDFAcroForm.fromDict(s)}getOrCreateAcroForm(){let s=this.getAcroForm();if(!s){s=PDFAcroForm.create(this.context);const $=this.context.register(s.dict);this.set(PDFName.of("AcroForm"),$)}return s}ViewerPreferences(){return this.lookupMaybe(PDFName.of("ViewerPreferences"),PDFDict)}getViewerPreferences(){const s=this.ViewerPreferences();if(s)return ViewerPreferences.fromDict(s)}getOrCreateViewerPreferences(){let s=this.getViewerPreferences();if(!s){s=ViewerPreferences.create(this.context);const $=this.context.register(s.dict);this.set(PDFName.of("ViewerPreferences"),$)}return s}insertLeafNode(s,$){const _=this.get(PDFName.of("Pages"));return this.Pages().insertLeafNode(s,$)||_}removeLeafNode(s){this.Pages().removeLeafNode(s)}}PDFCatalog.withContextAndPages=(a,s)=>{const $=new Map;return $.set(PDFName.of("Type"),PDFName.of("Catalog")),$.set(PDFName.of("Pages"),s),new PDFCatalog($,a)},PDFCatalog.fromMapWithContext=(a,s)=>new PDFCatalog(a,s);class PDFPageTree extends PDFDict{Parent(){return this.lookup(PDFName.of("Parent"))}Kids(){return this.lookup(PDFName.of("Kids"),PDFArray)}Count(){return this.lookup(PDFName.of("Count"),PDFNumber)}pushTreeNode(s){this.Kids().push(s)}pushLeafNode(s){const $=this.Kids();this.insertLeafKid($.size(),s)}insertLeafNode(s,$){const _=this.Kids(),_e=this.Count().asNumber();if($>_e)throw new InvalidTargetIndexError($,_e);let tt=$;for(let nt=0,at=_.size();nt<at;nt++){if(tt===0){this.insertLeafKid(nt,s);return}const ot=_.get(nt),rt=this.context.lookup(ot);if(rt instanceof PDFPageTree){if(rt.Count().asNumber()>tt)return rt.insertLeafNode(s,tt)||ot;tt-=rt.Count().asNumber()}rt instanceof PDFPageLeaf&&(tt-=1)}if(tt===0){this.insertLeafKid(_.size(),s);return}throw new CorruptPageTreeError($,"insertLeafNode")}removeLeafNode(s,$=!0){const _=this.Kids(),_e=this.Count().asNumber();if(s>=_e)throw new InvalidTargetIndexError(s,_e);let tt=s;for(let nt=0,at=_.size();nt<at;nt++){const ot=_.get(nt),rt=this.context.lookup(ot);if(rt instanceof PDFPageTree)if(rt.Count().asNumber()>tt){rt.removeLeafNode(tt,$),$&&rt.Kids().size()===0&&_.remove(nt);return}else tt-=rt.Count().asNumber();if(rt instanceof PDFPageLeaf)if(tt===0){this.removeKid(nt);return}else tt-=1}throw new CorruptPageTreeError(s,"removeLeafNode")}ascend(s){s(this);const $=this.Parent();$&&$.ascend(s)}traverse(s){const $=this.Kids();for(let _=0,_e=$.size();_<_e;_++){const tt=$.get(_),nt=this.context.lookup(tt);nt instanceof PDFPageTree&&nt.traverse(s),s(nt,tt)}}insertLeafKid(s,$){const _=this.Kids();this.ascend(_e=>{const tt=_e.Count().asNumber()+1;_e.set(PDFName.of("Count"),PDFNumber.of(tt))}),_.insert(s,$)}removeKid(s){const $=this.Kids();$.lookup(s)instanceof PDFPageLeaf&&this.ascend(_e=>{const tt=_e.Count().asNumber()-1;_e.set(PDFName.of("Count"),PDFNumber.of(tt))}),$.remove(s)}}PDFPageTree.withContext=(a,s)=>{const $=new Map;return $.set(PDFName.of("Type"),PDFName.of("Pages")),$.set(PDFName.of("Kids"),a.obj([])),$.set(PDFName.of("Count"),a.obj(0)),s&&$.set(PDFName.of("Parent"),s),new PDFPageTree($,a)},PDFPageTree.fromMapWithContext=(a,s)=>new PDFPageTree(a,s);const IsDigit=new Uint8Array(256);IsDigit[CharCodes$1.Zero]=1,IsDigit[CharCodes$1.One]=1,IsDigit[CharCodes$1.Two]=1,IsDigit[CharCodes$1.Three]=1,IsDigit[CharCodes$1.Four]=1,IsDigit[CharCodes$1.Five]=1,IsDigit[CharCodes$1.Six]=1,IsDigit[CharCodes$1.Seven]=1,IsDigit[CharCodes$1.Eight]=1,IsDigit[CharCodes$1.Nine]=1;const IsNumericPrefix=new Uint8Array(256);IsNumericPrefix[CharCodes$1.Period]=1,IsNumericPrefix[CharCodes$1.Plus]=1,IsNumericPrefix[CharCodes$1.Minus]=1;const IsNumeric=new Uint8Array(256);for(let a=0,s=256;a<s;a++)IsNumeric[a]=IsDigit[a]||IsNumericPrefix[a]?1:0;const{Space:Space$1,CarriageReturn,Newline}=CharCodes$1,stream=[CharCodes$1.s,CharCodes$1.t,CharCodes$1.r,CharCodes$1.e,CharCodes$1.a,CharCodes$1.m],endstream=[CharCodes$1.e,CharCodes$1.n,CharCodes$1.d,CharCodes$1.s,CharCodes$1.t,CharCodes$1.r,CharCodes$1.e,CharCodes$1.a,CharCodes$1.m];CharCodes$1.Percent,CharCodes$1.P,CharCodes$1.D,CharCodes$1.F,CharCodes$1.Dash,CharCodes$1.Percent,CharCodes$1.Percent,CharCodes$1.E,CharCodes$1.O,CharCodes$1.F,CharCodes$1.o,CharCodes$1.b,CharCodes$1.j,CharCodes$1.e,CharCodes$1.n,CharCodes$1.d,CharCodes$1.o,CharCodes$1.b,CharCodes$1.j,CharCodes$1.x,CharCodes$1.r,CharCodes$1.e,CharCodes$1.f,CharCodes$1.t,CharCodes$1.r,CharCodes$1.a,CharCodes$1.i,CharCodes$1.l,CharCodes$1.e,CharCodes$1.r,CharCodes$1.s,CharCodes$1.t,CharCodes$1.a,CharCodes$1.r,CharCodes$1.t,CharCodes$1.x,CharCodes$1.r,CharCodes$1.e,CharCodes$1.f,CharCodes$1.t,CharCodes$1.r,CharCodes$1.u,CharCodes$1.e,CharCodes$1.f,CharCodes$1.a,CharCodes$1.l,CharCodes$1.s,CharCodes$1.e,CharCodes$1.n,CharCodes$1.u,CharCodes$1.l,CharCodes$1.l,[...stream],[...stream],[...stream],[...stream],[...endstream],[...endstream],[...endstream];const flag=a=>1<<a;var AnnotationFlags;(function(a){a[a.Invisible=flag(0)]="Invisible",a[a.Hidden=flag(1)]="Hidden",a[a.Print=flag(2)]="Print",a[a.NoZoom=flag(3)]="NoZoom",a[a.NoRotate=flag(4)]="NoRotate",a[a.NoView=flag(5)]="NoView",a[a.ReadOnly=flag(6)]="ReadOnly",a[a.Locked=flag(7)]="Locked",a[a.ToggleNoView=flag(8)]="ToggleNoView",a[a.LockedContents=flag(9)]="LockedContents"})(AnnotationFlags||(AnnotationFlags={}));var RotationTypes;(function(a){a.Degrees="degrees",a.Radians="radians"})(RotationTypes||(RotationTypes={}));const degrees=a=>(assertIs(a,"degreeAngle",["number"]),{type:RotationTypes.Degrees,angle:a}),degreesToRadians=a=>a*Math.PI/180;var LineCapStyle;(function(a){a[a.Butt=0]="Butt",a[a.Round=1]="Round",a[a.Projecting=2]="Projecting"})(LineCapStyle||(LineCapStyle={}));var LineJoinStyle;(function(a){a[a.Miter=0]="Miter",a[a.Round=1]="Round",a[a.Bevel=2]="Bevel"})(LineJoinStyle||(LineJoinStyle={}));var FillRule;(function(a){a.NonZero="f",a.EvenOdd="f*"})(FillRule||(FillRule={}));var TextRenderingMode;(function(a){a[a.Fill=0]="Fill",a[a.Outline=1]="Outline",a[a.FillAndOutline=2]="FillAndOutline",a[a.Invisible=3]="Invisible",a[a.FillAndClip=4]="FillAndClip",a[a.OutlineAndClip=5]="OutlineAndClip",a[a.FillAndOutlineAndClip=6]="FillAndOutlineAndClip",a[a.Clip=7]="Clip"})(TextRenderingMode||(TextRenderingMode={}));var colorString$1={exports:{}},colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},simpleSwizzle={exports:{}},isArrayish$1=function a(s){return!s||typeof s=="string"?!1:s instanceof Array||Array.isArray(s)||s.length>=0&&(s.splice instanceof Function||Object.getOwnPropertyDescriptor(s,s.length-1)&&s.constructor.name!=="String")},isArrayish=isArrayish$1,concat=Array.prototype.concat,slice$1=Array.prototype.slice,swizzle$1=simpleSwizzle.exports=function a(s){for(var $=[],_=0,_e=s.length;_<_e;_++){var tt=s[_];isArrayish(tt)?$=concat.call($,slice$1.call(tt)):$.push(tt)}return $};swizzle$1.wrap=function(a){return function(){return a(swizzle$1(arguments))}};var simpleSwizzleExports=simpleSwizzle.exports,colorNames=colorName,swizzle=simpleSwizzleExports,hasOwnProperty$f=Object.hasOwnProperty,reverseNames=Object.create(null);for(var name in colorNames)hasOwnProperty$f.call(colorNames,name)&&(reverseNames[colorNames[name]]=name);var cs=colorString$1.exports={to:{},get:{}};cs.get=function(a){var s=a.substring(0,3).toLowerCase(),$,_;switch(s){case"hsl":$=cs.get.hsl(a),_="hsl";break;case"hwb":$=cs.get.hwb(a),_="hwb";break;default:$=cs.get.rgb(a),_="rgb";break}return $?{model:_,value:$}:null},cs.get.rgb=function(a){if(!a)return null;var s=/^#([a-f0-9]{3,4})$/i,$=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,_=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,_e=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,tt=/^(\w+)$/,nt=[0,0,0,1],at,ot,rt;if(at=a.match($)){for(rt=at[2],at=at[1],ot=0;ot<3;ot++){var st=ot*2;nt[ot]=parseInt(at.slice(st,st+2),16)}rt&&(nt[3]=parseInt(rt,16)/255)}else if(at=a.match(s)){for(at=at[1],rt=at[3],ot=0;ot<3;ot++)nt[ot]=parseInt(at[ot]+at[ot],16);rt&&(nt[3]=parseInt(rt+rt,16)/255)}else if(at=a.match(_)){for(ot=0;ot<3;ot++)nt[ot]=parseInt(at[ot+1],0);at[4]&&(at[5]?nt[3]=parseFloat(at[4])*.01:nt[3]=parseFloat(at[4]))}else if(at=a.match(_e)){for(ot=0;ot<3;ot++)nt[ot]=Math.round(parseFloat(at[ot+1])*2.55);at[4]&&(at[5]?nt[3]=parseFloat(at[4])*.01:nt[3]=parseFloat(at[4]))}else return(at=a.match(tt))?at[1]==="transparent"?[0,0,0,0]:hasOwnProperty$f.call(colorNames,at[1])?(nt=colorNames[at[1]],nt[3]=1,nt):null:null;for(ot=0;ot<3;ot++)nt[ot]=clamp(nt[ot],0,255);return nt[3]=clamp(nt[3],0,1),nt},cs.get.hsl=function(a){if(!a)return null;var s=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,$=a.match(s);if($){var _=parseFloat($[4]),_e=(parseFloat($[1])%360+360)%360,tt=clamp(parseFloat($[2]),0,100),nt=clamp(parseFloat($[3]),0,100),at=clamp(isNaN(_)?1:_,0,1);return[_e,tt,nt,at]}return null},cs.get.hwb=function(a){if(!a)return null;var s=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,$=a.match(s);if($){var _=parseFloat($[4]),_e=(parseFloat($[1])%360+360)%360,tt=clamp(parseFloat($[2]),0,100),nt=clamp(parseFloat($[3]),0,100),at=clamp(isNaN(_)?1:_,0,1);return[_e,tt,nt,at]}return null},cs.to.hex=function(){var a=swizzle(arguments);return"#"+hexDouble(a[0])+hexDouble(a[1])+hexDouble(a[2])+(a[3]<1?hexDouble(Math.round(a[3]*255)):"")},cs.to.rgb=function(){var a=swizzle(arguments);return a.length<4||a[3]===1?"rgb("+Math.round(a[0])+", "+Math.round(a[1])+", "+Math.round(a[2])+")":"rgba("+Math.round(a[0])+", "+Math.round(a[1])+", "+Math.round(a[2])+", "+a[3]+")"},cs.to.rgb.percent=function(){var a=swizzle(arguments),s=Math.round(a[0]/255*100),$=Math.round(a[1]/255*100),_=Math.round(a[2]/255*100);return a.length<4||a[3]===1?"rgb("+s+"%, "+$+"%, "+_+"%)":"rgba("+s+"%, "+$+"%, "+_+"%, "+a[3]+")"},cs.to.hsl=function(){var a=swizzle(arguments);return a.length<4||a[3]===1?"hsl("+a[0]+", "+a[1]+"%, "+a[2]+"%)":"hsla("+a[0]+", "+a[1]+"%, "+a[2]+"%, "+a[3]+")"},cs.to.hwb=function(){var a=swizzle(arguments),s="";return a.length>=4&&a[3]!==1&&(s=", "+a[3]),"hwb("+a[0]+", "+a[1]+"%, "+a[2]+"%"+s+")"},cs.to.keyword=function(a){return reverseNames[a.slice(0,3)]};function clamp(a,s,$){return Math.min(Math.max(s,a),$)}function hexDouble(a){var s=Math.round(a).toString(16).toUpperCase();return s.length<2?"0"+s:s}var colorStringExports=colorString$1.exports,ColorTypes;(function(a){a.Grayscale="Grayscale",a.RGB="RGB",a.CMYK="CMYK"})(ColorTypes||(ColorTypes={}));const rgb=(a,s,$)=>(assertRange(a,"red",0,1),assertRange(s,"green",0,1),assertRange($,"blue",0,1),{type:ColorTypes.RGB,red:a,green:s,blue:$});var TextAlignment;(function(a){a[a.Left=0]="Left",a[a.Center=1]="Center",a[a.Right=2]="Right"})(TextAlignment||(TextAlignment={}));var ImageAlignment;(function(a){a[a.Left=0]="Left",a[a.Center=1]="Center",a[a.Right=2]="Right"})(ImageAlignment||(ImageAlignment={}));var StandardFonts;(function(a){a.Courier="Courier",a.CourierBold="Courier-Bold",a.CourierOblique="Courier-Oblique",a.CourierBoldOblique="Courier-BoldOblique",a.Helvetica="Helvetica",a.HelveticaBold="Helvetica-Bold",a.HelveticaOblique="Helvetica-Oblique",a.HelveticaBoldOblique="Helvetica-BoldOblique",a.TimesRoman="Times-Roman",a.TimesRomanBold="Times-Bold",a.TimesRomanItalic="Times-Italic",a.TimesRomanBoldItalic="Times-BoldItalic",a.Symbol="Symbol",a.ZapfDingbats="ZapfDingbats"})(StandardFonts||(StandardFonts={}));var ParseSpeeds;(function(a){a[a.Fastest=1/0]="Fastest",a[a.Fast=1500]="Fast",a[a.Medium=500]="Medium",a[a.Slow=100]="Slow"})(ParseSpeeds||(ParseSpeeds={}));var BlendMode;(function(a){a.Normal="Normal",a.Multiply="Multiply",a.Screen="Screen",a.Overlay="Overlay",a.Darken="Darken",a.Lighten="Lighten",a.ColorDodge="ColorDodge",a.ColorBurn="ColorBurn",a.HardLight="HardLight",a.SoftLight="SoftLight",a.Difference="Difference",a.Exclusion="Exclusion"})(BlendMode||(BlendMode={}));var dist={},lib$2={},namedReferences={};Object.defineProperty(namedReferences,"__esModule",{value:!0}),namedReferences.bodyRegExps={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},namedReferences.namedReferences={xml:{entities:{"<":"<",">":">",""":'"',"'":"'","&":"&"},characters:{"<":"<",">":">",'"':""","'":"'","&":"&"}},html4:{entities:{"'":"'"," ":" "," ":" ","¡":"¡","¡":"¡","¢":"¢","¢":"¢","£":"£","£":"£","¤":"¤","¤":"¤","¥":"¥","¥":"¥","¦":"¦","¦":"¦","§":"§","§":"§","¨":"¨","¨":"¨","©":"©","©":"©","ª":"ª","ª":"ª","«":"«","«":"«","¬":"¬","¬":"¬","­":"","­":"","®":"®","®":"®","¯":"¯","¯":"¯","°":"°","°":"°","±":"±","±":"±","²":"²","²":"²","³":"³","³":"³","´":"´","´":"´","µ":"µ","µ":"µ","¶":"¶","¶":"¶","·":"·","·":"·","¸":"¸","¸":"¸","¹":"¹","¹":"¹","º":"º","º":"º","»":"»","»":"»","¼":"¼","¼":"¼","½":"½","½":"½","¾":"¾","¾":"¾","¿":"¿","¿":"¿","À":"À","À":"À","Á":"Á","Á":"Á","Â":"Â","Â":"Â","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","Å":"Å","Å":"Å","Æ":"Æ","Æ":"Æ","Ç":"Ç","Ç":"Ç","È":"È","È":"È","É":"É","É":"É","Ê":"Ê","Ê":"Ê","Ë":"Ë","Ë":"Ë","Ì":"Ì","Ì":"Ì","Í":"Í","Í":"Í","Î":"Î","Î":"Î","Ï":"Ï","Ï":"Ï","Ð":"Ð","Ð":"Ð","Ñ":"Ñ","Ñ":"Ñ","Ò":"Ò","Ò":"Ò","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","Õ":"Õ","Õ":"Õ","Ö":"Ö","Ö":"Ö","×":"×","×":"×","Ø":"Ø","Ø":"Ø","Ù":"Ù","Ù":"Ù","Ú":"Ú","Ú":"Ú","Û":"Û","Û":"Û","Ü":"Ü","Ü":"Ü","Ý":"Ý","Ý":"Ý","Þ":"Þ","Þ":"Þ","ß":"ß","ß":"ß","à":"à","à":"à","á":"á","á":"á","â":"â","â":"â","ã":"ã","ã":"ã","ä":"ä","ä":"ä","å":"å","å":"å","æ":"æ","æ":"æ","ç":"ç","ç":"ç","è":"è","è":"è","é":"é","é":"é","ê":"ê","ê":"ê","ë":"ë","ë":"ë","ì":"ì","ì":"ì","í":"í","í":"í","î":"î","î":"î","ï":"ï","ï":"ï","ð":"ð","ð":"ð","ñ":"ñ","ñ":"ñ","ò":"ò","ò":"ò","ó":"ó","ó":"ó","ô":"ô","ô":"ô","õ":"õ","õ":"õ","ö":"ö","ö":"ö","÷":"÷","÷":"÷","ø":"ø","ø":"ø","ù":"ù","ù":"ù","ú":"ú","ú":"ú","û":"û","û":"û","ü":"ü","ü":"ü","ý":"ý","ý":"ý","þ":"þ","þ":"þ","ÿ":"ÿ","ÿ":"ÿ",""":'"',""":'"',"&":"&","&":"&","<":"<","<":"<",">":">",">":">","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"","‍":"","‎":"","‏":"","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€","ƒ":"ƒ","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},characters:{"'":"'"," ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©",ª:"ª","«":"«","¬":"¬","":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´",µ:"µ","¶":"¶","·":"·","¸":"¸","¹":"¹",º:"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿",À:"À",Á:"Á",Â:"Â",Ã:"Ã",Ä:"Ä",Å:"Å",Æ:"Æ",Ç:"Ç",È:"È",É:"É",Ê:"Ê",Ë:"Ë",Ì:"Ì",Í:"Í",Î:"Î",Ï:"Ï",Ð:"Ð",Ñ:"Ñ",Ò:"Ò",Ó:"Ó",Ô:"Ô",Õ:"Õ",Ö:"Ö","×":"×",Ø:"Ø",Ù:"Ù",Ú:"Ú",Û:"Û",Ü:"Ü",Ý:"Ý",Þ:"Þ",ß:"ß",à:"à",á:"á",â:"â",ã:"ã",ä:"ä",å:"å",æ:"æ",ç:"ç",è:"è",é:"é",ê:"ê",ë:"ë",ì:"ì",í:"í",î:"î",ï:"ï",ð:"ð",ñ:"ñ",ò:"ò",ó:"ó",ô:"ô",õ:"õ",ö:"ö","÷":"÷",ø:"ø",ù:"ù",ú:"ú",û:"û",ü:"ü",ý:"ý",þ:"þ",ÿ:"ÿ",'"':""","&":"&","<":"<",">":">",Œ:"Œ",œ:"œ",Š:"Š",š:"š",Ÿ:"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","":"‌","":"‍","":"‎","":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€",ƒ:"ƒ",Α:"Α",Β:"Β",Γ:"Γ",Δ:"Δ",Ε:"Ε",Ζ:"Ζ",Η:"Η",Θ:"Θ",Ι:"Ι",Κ:"Κ",Λ:"Λ",Μ:"Μ",Ν:"Ν",Ξ:"Ξ",Ο:"Ο",Π:"Π",Ρ:"Ρ",Σ:"Σ",Τ:"Τ",Υ:"Υ",Φ:"Φ",Χ:"Χ",Ψ:"Ψ",Ω:"Ω",α:"α",β:"β",γ:"γ",δ:"δ",ε:"ε",ζ:"ζ",η:"η",θ:"θ",ι:"ι",κ:"κ",λ:"λ",μ:"μ",ν:"ν",ξ:"ξ",ο:"ο",π:"π",ρ:"ρ",ς:"ς",σ:"σ",τ:"τ",υ:"υ",φ:"φ",χ:"χ",ψ:"ψ",ω:"ω",ϑ:"ϑ",ϒ:"ϒ",ϖ:"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘",ℑ:"ℑ",ℜ:"ℜ","™":"™",ℵ:"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","〈":"⟨","〉":"⟩","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"}},html5:{entities:{"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"","⁢":"","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"","​":"","​":"","​":"","≫":"≫","≪":"≪","
":`
|
125
|
+
`}return s}getUnencodedContents(){const s=new Uint8Array(this.getUnencodedContentsSize());let $=copyStringIntoBuffer(this.offsetsString,s,0);for(let _=0,_e=this.objects.length;_<_e;_++){const[,tt]=this.objects[_];$+=tt.copyBytesInto(s,$),s[$++]=CharCodes$1.Newline}return s}getUnencodedContentsSize(){return this.offsetsString.length+last$1(this.offsets)[1]+last$1(this.objects)[1].sizeInBytes()+1}computeOffsetsString(){let s="";for(let $=0,_=this.offsets.length;$<_;$++){const[_e,tt]=this.offsets[$];s+=`${_e} ${tt} `}return s}computeObjectOffsets(){let s=0;const $=new Array(this.objects.length);for(let _=0,_e=this.objects.length;_<_e;_++){const[tt,nt]=this.objects[_];$[_]=[tt.objectNumber,s],s+=nt.sizeInBytes()+1}return $}}PDFObjectStream.withContextAndObjects=(a,s,$=!0)=>new PDFObjectStream(a,s,$);class PDFInvalidObject extends PDFObject{constructor(s){super(),this.data=s}clone(){return PDFInvalidObject.of(this.data.slice())}toString(){return`PDFInvalidObject(${this.data.length} bytes)`}sizeInBytes(){return this.data.length}copyBytesInto(s,$){const _=this.data.length;for(let _e=0;_e<_;_e++)s[$++]=this.data[_e];return _}}PDFInvalidObject.of=a=>new PDFInvalidObject(a);var EntryType;(function(a){a[a.Deleted=0]="Deleted",a[a.Uncompressed=1]="Uncompressed",a[a.Compressed=2]="Compressed"})(EntryType||(EntryType={}));class PDFCrossRefStream extends PDFFlateStream{constructor(s,$,_=!0){super(s,_),this.computeIndex=()=>{const _e=[];let tt=0;for(let nt=0,at=this.entries.length;nt<at;nt++){const ot=this.entries[nt],rt=this.entries[nt-1];nt===0?_e.push(ot.ref.objectNumber):ot.ref.objectNumber-rt.ref.objectNumber>1&&(_e.push(tt),_e.push(ot.ref.objectNumber),tt=0),tt+=1}return _e.push(tt),_e},this.computeEntryTuples=()=>{const _e=new Array(this.entries.length);for(let tt=0,nt=this.entries.length;tt<nt;tt++){const at=this.entries[tt];if(at.type===EntryType.Deleted){const{type:ot,nextFreeObjectNumber:rt,ref:st}=at;_e[tt]=[ot,rt,st.generationNumber]}if(at.type===EntryType.Uncompressed){const{type:ot,offset:rt,ref:st}=at;_e[tt]=[ot,rt,st.generationNumber]}if(at.type===EntryType.Compressed){const{type:ot,objectStreamRef:rt,index:st}=at;_e[tt]=[ot,rt.objectNumber,st]}}return _e},this.computeMaxEntryByteWidths=()=>{const _e=this.entryTuplesCache.access(),tt=[0,0,0];for(let nt=0,at=_e.length;nt<at;nt++){const[ot,rt,st]=_e[nt],lt=sizeInBytes(ot),et=sizeInBytes(rt),it=sizeInBytes(st);lt>tt[0]&&(tt[0]=lt),et>tt[1]&&(tt[1]=et),it>tt[2]&&(tt[2]=it)}return tt},this.entries=$||[],this.entryTuplesCache=Cache.populatedBy(this.computeEntryTuples),this.maxByteWidthsCache=Cache.populatedBy(this.computeMaxEntryByteWidths),this.indexCache=Cache.populatedBy(this.computeIndex),s.set(PDFName.of("Type"),PDFName.of("XRef"))}addDeletedEntry(s,$){const _=EntryType.Deleted;this.entries.push({type:_,ref:s,nextFreeObjectNumber:$}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}addUncompressedEntry(s,$){const _=EntryType.Uncompressed;this.entries.push({type:_,ref:s,offset:$}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}addCompressedEntry(s,$,_){const _e=EntryType.Compressed;this.entries.push({type:_e,ref:s,objectStreamRef:$,index:_}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()}clone(s){const{dict:$,entries:_,encode:_e}=this;return PDFCrossRefStream.of($.clone(s),_.slice(),_e)}getContentsString(){const s=this.entryTuplesCache.access(),$=this.maxByteWidthsCache.access();let _="";for(let _e=0,tt=s.length;_e<tt;_e++){const[nt,at,ot]=s[_e],rt=reverseArray(bytesFor(nt)),st=reverseArray(bytesFor(at)),lt=reverseArray(bytesFor(ot));for(let et=$[0]-1;et>=0;et--)_+=(rt[et]||0).toString(2);for(let et=$[1]-1;et>=0;et--)_+=(st[et]||0).toString(2);for(let et=$[2]-1;et>=0;et--)_+=(lt[et]||0).toString(2)}return _}getUnencodedContents(){const s=this.entryTuplesCache.access(),$=this.maxByteWidthsCache.access(),_=new Uint8Array(this.getUnencodedContentsSize());let _e=0;for(let tt=0,nt=s.length;tt<nt;tt++){const[at,ot,rt]=s[tt],st=reverseArray(bytesFor(at)),lt=reverseArray(bytesFor(ot)),et=reverseArray(bytesFor(rt));for(let it=$[0]-1;it>=0;it--)_[_e++]=st[it]||0;for(let it=$[1]-1;it>=0;it--)_[_e++]=lt[it]||0;for(let it=$[2]-1;it>=0;it--)_[_e++]=et[it]||0}return _}getUnencodedContentsSize(){const s=this.maxByteWidthsCache.access();return sum$1(s)*this.entries.length}updateDict(){super.updateDict();const s=this.maxByteWidthsCache.access(),$=this.indexCache.access(),{context:_}=this.dict;this.dict.set(PDFName.of("W"),_.obj(s)),this.dict.set(PDFName.of("Index"),_.obj($))}}PDFCrossRefStream.create=(a,s=!0)=>{const $=new PDFCrossRefStream(a,[],s);return $.addDeletedEntry(PDFRef.of(0,65535),0),$},PDFCrossRefStream.of=(a,s,$=!0)=>new PDFCrossRefStream(a,s,$);class PDFHexString extends PDFObject{constructor(s){super(),this.value=s}asBytes(){const s=this.value+(this.value.length%2===1?"0":""),$=s.length,_=new Uint8Array(s.length/2);let _e=0,tt=0;for(;_e<$;){const nt=parseInt(s.substring(_e,_e+2),16);_[tt]=nt,_e+=2,tt+=1}return _}decodeText(){const s=this.asBytes();return hasUtf16BOM(s)?utf16Decode(s):pdfDocEncodingDecode(s)}decodeDate(){const s=this.decodeText(),$=parseDate(s);if(!$)throw new InvalidPDFDateStringError(s);return $}asString(){return this.value}clone(){return PDFHexString.of(this.value)}toString(){return`<${this.value}>`}sizeInBytes(){return this.value.length+2}copyBytesInto(s,$){return s[$++]=CharCodes$1.LessThan,$+=copyStringIntoBuffer(this.value,s,$),s[$++]=CharCodes$1.GreaterThan,this.value.length+2}}PDFHexString.of=a=>new PDFHexString(a),PDFHexString.fromText=a=>{const s=utf16Encode(a);let $="";for(let _=0,_e=s.length;_<_e;_++)$+=toHexStringOfMinLength(s[_],4);return new PDFHexString($)};class PDFString extends PDFObject{constructor(s){super(),this.value=s}asBytes(){const s=[];let $="",_=!1;const _e=tt=>{tt!==void 0&&s.push(tt),_=!1};for(let tt=0,nt=this.value.length;tt<nt;tt++){const at=this.value[tt],ot=toCharCode(at),rt=this.value[tt+1];_?ot===CharCodes$1.Newline||ot===CharCodes$1.CarriageReturn?_e():ot===CharCodes$1.n?_e(CharCodes$1.Newline):ot===CharCodes$1.r?_e(CharCodes$1.CarriageReturn):ot===CharCodes$1.t?_e(CharCodes$1.Tab):ot===CharCodes$1.b?_e(CharCodes$1.Backspace):ot===CharCodes$1.f?_e(CharCodes$1.FormFeed):ot===CharCodes$1.LeftParen?_e(CharCodes$1.LeftParen):ot===CharCodes$1.RightParen?_e(CharCodes$1.RightParen):ot===CharCodes$1.Backspace?_e(CharCodes$1.BackSlash):ot>=CharCodes$1.Zero&&ot<=CharCodes$1.Seven?($+=at,($.length===3||!(rt>="0"&&rt<="7"))&&(_e(parseInt($,8)),$="")):_e(ot):ot===CharCodes$1.BackSlash?_=!0:_e(ot)}return new Uint8Array(s)}decodeText(){const s=this.asBytes();return hasUtf16BOM(s)?utf16Decode(s):pdfDocEncodingDecode(s)}decodeDate(){const s=this.decodeText(),$=parseDate(s);if(!$)throw new InvalidPDFDateStringError(s);return $}asString(){return this.value}clone(){return PDFString.of(this.value)}toString(){return`(${this.value})`}sizeInBytes(){return this.value.length+2}copyBytesInto(s,$){return s[$++]=CharCodes$1.LeftParen,$+=copyStringIntoBuffer(this.value,s,$),s[$++]=CharCodes$1.RightParen,this.value.length+2}}PDFString.of=a=>new PDFString(a),PDFString.fromDate=a=>{const s=padStart$1(String(a.getUTCFullYear()),4,"0"),$=padStart$1(String(a.getUTCMonth()+1),2,"0"),_=padStart$1(String(a.getUTCDate()),2,"0"),_e=padStart$1(String(a.getUTCHours()),2,"0"),tt=padStart$1(String(a.getUTCMinutes()),2,"0"),nt=padStart$1(String(a.getUTCSeconds()),2,"0");return new PDFString(`D:${s}${$}${_}${_e}${tt}${nt}Z`)};var AFRelationship;(function(a){a.Source="Source",a.Data="Data",a.Alternative="Alternative",a.Supplement="Supplement",a.EncryptedPayload="EncryptedPayload",a.FormData="EncryptedPayload",a.Schema="Schema",a.Unspecified="Unspecified"})(AFRelationship||(AFRelationship={}));var ColorSpace;(function(a){a.DeviceGray="DeviceGray",a.DeviceRGB="DeviceRGB",a.DeviceCMYK="DeviceCMYK"})(ColorSpace||(ColorSpace={})),ColorSpace.DeviceGray,ColorSpace.DeviceRGB,ColorSpace.DeviceCMYK;var UPNG={};UPNG.toRGBA8=function(a){var s=a.width,$=a.height;if(a.tabs.acTL==null)return[UPNG.toRGBA8.decodeImage(a.data,s,$,a).buffer];var _=[];a.frames[0].data==null&&(a.frames[0].data=a.data);for(var _e=s*$*4,tt=new Uint8Array(_e),nt=new Uint8Array(_e),at=new Uint8Array(_e),ot=0;ot<a.frames.length;ot++){var rt=a.frames[ot],st=rt.rect.x,lt=rt.rect.y,et=rt.rect.width,it=rt.rect.height,ut=UPNG.toRGBA8.decodeImage(rt.data,et,it,a);if(ot!=0)for(var ft=0;ft<_e;ft++)at[ft]=tt[ft];if(rt.blend==0?UPNG._copyTile(ut,et,it,tt,s,$,st,lt,0):rt.blend==1&&UPNG._copyTile(ut,et,it,tt,s,$,st,lt,1),_.push(tt.buffer.slice(0)),rt.dispose!=0){if(rt.dispose==1)UPNG._copyTile(nt,et,it,tt,s,$,st,lt,0);else if(rt.dispose==2)for(var ft=0;ft<_e;ft++)tt[ft]=at[ft]}}return _},UPNG.toRGBA8.decodeImage=function(a,s,$,_){var _e=s*$,tt=UPNG.decode._getBPP(_),nt=Math.ceil(s*tt/8),at=new Uint8Array(_e*4),ot=new Uint32Array(at.buffer),rt=_.ctype,st=_.depth,lt=UPNG._bin.readUshort;if(rt==6){var et=_e<<2;if(st==8)for(var it=0;it<et;it+=4)at[it]=a[it],at[it+1]=a[it+1],at[it+2]=a[it+2],at[it+3]=a[it+3];if(st==16)for(var it=0;it<et;it++)at[it]=a[it<<1]}else if(rt==2){var ut=_.tabs.tRNS;if(ut==null){if(st==8)for(var it=0;it<_e;it++){var ft=it*3;ot[it]=255<<24|a[ft+2]<<16|a[ft+1]<<8|a[ft]}if(st==16)for(var it=0;it<_e;it++){var ft=it*6;ot[it]=255<<24|a[ft+4]<<16|a[ft+2]<<8|a[ft]}}else{var ht=ut[0],dt=ut[1],gt=ut[2];if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,ft=it*3;ot[it]=255<<24|a[ft+2]<<16|a[ft+1]<<8|a[ft],a[ft]==ht&&a[ft+1]==dt&&a[ft+2]==gt&&(at[pt+3]=0)}if(st==16)for(var it=0;it<_e;it++){var pt=it<<2,ft=it*6;ot[it]=255<<24|a[ft+4]<<16|a[ft+2]<<8|a[ft],lt(a,ft)==ht&<(a,ft+2)==dt&<(a,ft+4)==gt&&(at[pt+3]=0)}}}else if(rt==3){var mt=_.tabs.PLTE,ct=_.tabs.tRNS,vt=ct?ct.length:0;if(st==1)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>3)]>>7-((it&7)<<0)&1,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==2)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>2)]>>6-((it&3)<<1)&3,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==4)for(var At=0;At<$;At++)for(var xt=At*nt,bt=At*s,it=0;it<s;it++){var pt=bt+it<<2,Et=a[xt+(it>>1)]>>4-((it&1)<<2)&15,St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,Et=a[it],St=3*Et;at[pt]=mt[St],at[pt+1]=mt[St+1],at[pt+2]=mt[St+2],at[pt+3]=Et<vt?ct[Et]:255}}else if(rt==4){if(st==8)for(var it=0;it<_e;it++){var pt=it<<2,Dt=it<<1,Rt=a[Dt];at[pt]=Rt,at[pt+1]=Rt,at[pt+2]=Rt,at[pt+3]=a[Dt+1]}if(st==16)for(var it=0;it<_e;it++){var pt=it<<2,Dt=it<<2,Rt=a[Dt];at[pt]=Rt,at[pt+1]=Rt,at[pt+2]=Rt,at[pt+3]=a[Dt+2]}}else if(rt==0)for(var ht=_.tabs.tRNS?_.tabs.tRNS:-1,At=0;At<$;At++){var Tt=At*nt,wt=At*s;if(st==1)for(var Ct=0;Ct<s;Ct++){var Rt=255*(a[Tt+(Ct>>>3)]>>>7-(Ct&7)&1),It=Rt==ht*255?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==2)for(var Ct=0;Ct<s;Ct++){var Rt=85*(a[Tt+(Ct>>>2)]>>>6-((Ct&3)<<1)&3),It=Rt==ht*85?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==4)for(var Ct=0;Ct<s;Ct++){var Rt=17*(a[Tt+(Ct>>>1)]>>>4-((Ct&1)<<2)&15),It=Rt==ht*17?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==8)for(var Ct=0;Ct<s;Ct++){var Rt=a[Tt+Ct],It=Rt==ht?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}else if(st==16)for(var Ct=0;Ct<s;Ct++){var Rt=a[Tt+(Ct<<1)],It=lt(a,Tt+(Ct<<it))==ht?0:255;ot[wt+Ct]=It<<24|Rt<<16|Rt<<8|Rt}}return at},UPNG.decode=function(a){for(var s=new Uint8Array(a),$=8,_=UPNG._bin,_e=_.readUshort,tt=_.readUint,nt={tabs:{},frames:[]},at=new Uint8Array(s.length),ot=0,rt,st=0,lt=[137,80,78,71,13,10,26,10],et=0;et<8;et++)if(s[et]!=lt[et])throw"The input is not a PNG file!";for(;$<s.length;){var it=_.readUint(s,$);$+=4;var ut=_.readASCII(s,$,4);if($+=4,ut=="IHDR")UPNG.decode._IHDR(s,$,nt);else if(ut=="IDAT"){for(var et=0;et<it;et++)at[ot+et]=s[$+et];ot+=it}else if(ut=="acTL")nt.tabs[ut]={num_frames:tt(s,$),num_plays:tt(s,$+4)},rt=new Uint8Array(s.length);else if(ut=="fcTL"){if(st!=0){var ft=nt.frames[nt.frames.length-1];ft.data=UPNG.decode._decompress(nt,rt.slice(0,st),ft.rect.width,ft.rect.height),st=0}var ht={x:tt(s,$+12),y:tt(s,$+16),width:tt(s,$+4),height:tt(s,$+8)},dt=_e(s,$+22);dt=_e(s,$+20)/(dt==0?100:dt);var gt={rect:ht,delay:Math.round(dt*1e3),dispose:s[$+24],blend:s[$+25]};nt.frames.push(gt)}else if(ut=="fdAT"){for(var et=0;et<it-4;et++)rt[st+et]=s[$+et+4];st+=it-4}else if(ut=="pHYs")nt.tabs[ut]=[_.readUint(s,$),_.readUint(s,$+4),s[$+8]];else if(ut=="cHRM"){nt.tabs[ut]=[];for(var et=0;et<8;et++)nt.tabs[ut].push(_.readUint(s,$+et*4))}else if(ut=="tEXt"){nt.tabs[ut]==null&&(nt.tabs[ut]={});var pt=_.nextZero(s,$),mt=_.readASCII(s,$,pt-$),ct=_.readASCII(s,pt+1,$+it-pt-1);nt.tabs[ut][mt]=ct}else if(ut=="iTXt"){nt.tabs[ut]==null&&(nt.tabs[ut]={});var pt=0,vt=$;pt=_.nextZero(s,vt);var mt=_.readASCII(s,vt,pt-vt);vt=pt+1,s[vt],s[vt+1],vt+=2,pt=_.nextZero(s,vt),_.readASCII(s,vt,pt-vt),vt=pt+1,pt=_.nextZero(s,vt),_.readUTF8(s,vt,pt-vt),vt=pt+1;var ct=_.readUTF8(s,vt,it-(vt-$));nt.tabs[ut][mt]=ct}else if(ut=="PLTE")nt.tabs[ut]=_.readBytes(s,$,it);else if(ut=="hIST"){var At=nt.tabs.PLTE.length/3;nt.tabs[ut]=[];for(var et=0;et<At;et++)nt.tabs[ut].push(_e(s,$+et*2))}else if(ut=="tRNS")nt.ctype==3?nt.tabs[ut]=_.readBytes(s,$,it):nt.ctype==0?nt.tabs[ut]=_e(s,$):nt.ctype==2&&(nt.tabs[ut]=[_e(s,$),_e(s,$+2),_e(s,$+4)]);else if(ut=="gAMA")nt.tabs[ut]=_.readUint(s,$)/1e5;else if(ut=="sRGB")nt.tabs[ut]=s[$];else if(ut=="bKGD")nt.ctype==0||nt.ctype==4?nt.tabs[ut]=[_e(s,$)]:nt.ctype==2||nt.ctype==6?nt.tabs[ut]=[_e(s,$),_e(s,$+2),_e(s,$+4)]:nt.ctype==3&&(nt.tabs[ut]=s[$]);else if(ut=="IEND")break;$+=it,_.readUint(s,$),$+=4}if(st!=0){var ft=nt.frames[nt.frames.length-1];ft.data=UPNG.decode._decompress(nt,rt.slice(0,st),ft.rect.width,ft.rect.height),st=0}return nt.data=UPNG.decode._decompress(nt,at,nt.width,nt.height),delete nt.compress,delete nt.interlace,delete nt.filter,nt},UPNG.decode._decompress=function(a,s,$,_){var _e=UPNG.decode._getBPP(a),tt=Math.ceil($*_e/8),nt=new Uint8Array((tt+1+a.interlace)*_);return s=UPNG.decode._inflate(s,nt),a.interlace==0?s=UPNG.decode._filterZero(s,a,0,$,_):a.interlace==1&&(s=UPNG.decode._readInterlace(s,a)),s},UPNG.decode._inflate=function(a,s){var $=UPNG.inflateRaw(new Uint8Array(a.buffer,2,a.length-6),s);return $},UPNG.inflateRaw=function(){var a={};return a.H={},a.H.N=function(s,$){var _=Uint8Array,_e=0,tt=0,nt=0,at=0,ot=0,rt=0,st=0,lt=0,et=0,it,ut;if(s[0]==3&&s[1]==0)return $||new _(0);var ft=a.H,ht=ft.b,dt=ft.e,gt=ft.R,pt=ft.n,mt=ft.A,ct=ft.Z,vt=ft.m,At=$==null;for(At&&($=new _(s.length>>>2<<3));_e==0;){if(_e=ht(s,et,1),tt=ht(s,et+1,2),et+=3,tt==0){et&7&&(et+=8-(et&7));var xt=(et>>>3)+4,bt=s[xt-4]|s[xt-3]<<8;At&&($=a.H.W($,lt+bt)),$.set(new _(s.buffer,s.byteOffset+xt,bt),lt),et=xt+bt<<3,lt+=bt;continue}if(At&&($=a.H.W($,lt+(1<<17))),tt==1&&(it=vt.J,ut=vt.h,rt=511,st=31),tt==2){nt=dt(s,et,5)+257,at=dt(s,et+5,5)+1,ot=dt(s,et+10,4)+4,et+=14;for(var Et=1,St=0;St<38;St+=2)vt.Q[St]=0,vt.Q[St+1]=0;for(var St=0;St<ot;St++){var Dt=dt(s,et+St*3,3);vt.Q[(vt.X[St]<<1)+1]=Dt,Dt>Et&&(Et=Dt)}et+=3*ot,pt(vt.Q,Et),mt(vt.Q,Et,vt.u),it=vt.w,ut=vt.d,et=gt(vt.u,(1<<Et)-1,nt+at,s,et,vt.v);var Rt=ft.V(vt.v,0,nt,vt.C);rt=(1<<Rt)-1;var Tt=ft.V(vt.v,nt,at,vt.D);st=(1<<Tt)-1,pt(vt.C,Rt),mt(vt.C,Rt,it),pt(vt.D,Tt),mt(vt.D,Tt,ut)}for(;;){var wt=it[ct(s,et)&rt];et+=wt&15;var Ct=wt>>>4;if(!(Ct>>>8))$[lt++]=Ct;else{if(Ct==256)break;var It=lt+Ct-254;if(Ct>264){var yt=vt.q[Ct-257];It=lt+(yt>>>3)+dt(s,et,yt&7),et+=yt&7}var Pt=ut[ct(s,et)&st];et+=Pt&15;var kt=Pt>>>4,jt=vt.c[kt],Ht=(jt>>>4)+ht(s,et,jt&15);for(et+=jt&15;lt<It;)$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht],$[lt]=$[lt++-Ht];lt=It}}}return $.length==lt?$:$.slice(0,lt)},a.H.W=function(s,$){var _=s.length;if($<=_)return s;var _e=new Uint8Array(_<<1);return _e.set(s,0),_e},a.H.R=function(s,$,_,_e,tt,nt){for(var at=a.H.e,ot=a.H.Z,rt=0;rt<_;){var st=s[ot(_e,tt)&$];tt+=st&15;var lt=st>>>4;if(lt<=15)nt[rt]=lt,rt++;else{var et=0,it=0;lt==16?(it=3+at(_e,tt,2),tt+=2,et=nt[rt-1]):lt==17?(it=3+at(_e,tt,3),tt+=3):lt==18&&(it=11+at(_e,tt,7),tt+=7);for(var ut=rt+it;rt<ut;)nt[rt]=et,rt++}}return tt},a.H.V=function(s,$,_,_e){for(var tt=0,nt=0,at=_e.length>>>1;nt<_;){var ot=s[nt+$];_e[nt<<1]=0,_e[(nt<<1)+1]=ot,ot>tt&&(tt=ot),nt++}for(;nt<at;)_e[nt<<1]=0,_e[(nt<<1)+1]=0,nt++;return tt},a.H.n=function(s,$){for(var _=a.H.m,_e=s.length,tt,nt,at,ot,rt,st=_.j,ot=0;ot<=$;ot++)st[ot]=0;for(ot=1;ot<_e;ot+=2)st[s[ot]]++;var lt=_.K;for(tt=0,st[0]=0,nt=1;nt<=$;nt++)tt=tt+st[nt-1]<<1,lt[nt]=tt;for(at=0;at<_e;at+=2)rt=s[at+1],rt!=0&&(s[at]=lt[rt],lt[rt]++)},a.H.A=function(s,$,_){for(var _e=s.length,tt=a.H.m,nt=tt.r,at=0;at<_e;at+=2)if(s[at+1]!=0)for(var ot=at>>1,rt=s[at+1],st=ot<<4|rt,lt=$-rt,et=s[at]<<lt,it=et+(1<<lt);et!=it;){var ut=nt[et]>>>15-$;_[ut]=st,et++}},a.H.l=function(s,$){for(var _=a.H.m.r,_e=15-$,tt=0;tt<s.length;tt+=2){var nt=s[tt]<<$-s[tt+1];s[tt]=_[nt]>>>_e}},a.H.M=function(s,$,_){_=_<<($&7);var _e=$>>>3;s[_e]|=_,s[_e+1]|=_>>>8},a.H.I=function(s,$,_){_=_<<($&7);var _e=$>>>3;s[_e]|=_,s[_e+1]|=_>>>8,s[_e+2]|=_>>>16},a.H.e=function(s,$,_){return(s[$>>>3]|s[($>>>3)+1]<<8)>>>($&7)&(1<<_)-1},a.H.b=function(s,$,_){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16)>>>($&7)&(1<<_)-1},a.H.Z=function(s,$){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16)>>>($&7)},a.H.i=function(s,$){return(s[$>>>3]|s[($>>>3)+1]<<8|s[($>>>3)+2]<<16|s[($>>>3)+3]<<24)>>>($&7)},a.H.m=function(){var s=Uint16Array,$=Uint32Array;return{K:new s(16),j:new s(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 s(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 $(32),J:new s(512),_:[],h:new s(32),$:[],w:new s(32768),C:[],v:[],d:new s(32768),D:[],u:new s(512),Q:[],r:new s(32768),s:new $(286),Y:new $(30),a:new $(19),t:new $(15e3),k:new s(65536),g:new s(32768)}}(),function(){for(var s=a.H.m,$=32768,_=0;_<$;_++){var _e=_;_e=(_e&2863311530)>>>1|(_e&1431655765)<<1,_e=(_e&3435973836)>>>2|(_e&858993459)<<2,_e=(_e&4042322160)>>>4|(_e&252645135)<<4,_e=(_e&4278255360)>>>8|(_e&16711935)<<8,s.r[_]=(_e>>>16|_e<<16)>>>17}function tt(nt,at,ot){for(;at--!=0;)nt.push(0,ot)}for(var _=0;_<32;_++)s.q[_]=s.S[_]<<3|s.T[_],s.c[_]=s.p[_]<<4|s.z[_];tt(s._,144,8),tt(s._,112,9),tt(s._,24,7),tt(s._,8,8),a.H.n(s._,9),a.H.A(s._,9,s.J),a.H.l(s._,9),tt(s.$,32,5),a.H.n(s.$,5),a.H.A(s.$,5,s.h),a.H.l(s.$,5),tt(s.Q,19,0),tt(s.C,286,0),tt(s.D,30,0),tt(s.v,320,0)}(),a.H.N}(),UPNG.decode._readInterlace=function(a,s){for(var $=s.width,_=s.height,_e=UPNG.decode._getBPP(s),tt=_e>>3,nt=Math.ceil($*_e/8),at=new Uint8Array(_*nt),ot=0,rt=[0,0,4,0,2,0,1],st=[0,4,0,2,0,1,0],lt=[8,8,8,4,4,2,2],et=[8,8,4,4,2,2,1],it=0;it<7;){for(var ut=lt[it],ft=et[it],ht=0,dt=0,gt=rt[it];gt<_;)gt+=ut,dt++;for(var pt=st[it];pt<$;)pt+=ft,ht++;var mt=Math.ceil(ht*_e/8);UPNG.decode._filterZero(a,s,ot,ht,dt);for(var ct=0,vt=rt[it];vt<_;){for(var At=st[it],xt=ot+ct*mt<<3;At<$;){if(_e==1){var bt=a[xt>>3];bt=bt>>7-(xt&7)&1,at[vt*nt+(At>>3)]|=bt<<7-((At&7)<<0)}if(_e==2){var bt=a[xt>>3];bt=bt>>6-(xt&7)&3,at[vt*nt+(At>>2)]|=bt<<6-((At&3)<<1)}if(_e==4){var bt=a[xt>>3];bt=bt>>4-(xt&7)&15,at[vt*nt+(At>>1)]|=bt<<4-((At&1)<<2)}if(_e>=8)for(var Et=vt*nt+At*tt,St=0;St<tt;St++)at[Et+St]=a[(xt>>3)+St];xt+=_e,At+=ft}ct++,vt+=ut}ht*dt!=0&&(ot+=dt*(1+mt)),it=it+1}return at},UPNG.decode._getBPP=function(a){var s=[1,null,3,1,2,null,4][a.ctype];return s*a.depth},UPNG.decode._filterZero=function(a,s,$,_,_e){var tt=UPNG.decode._getBPP(s),nt=Math.ceil(_*tt/8),at=UPNG.decode._paeth;tt=Math.ceil(tt/8);var ot=0,rt=1,st=a[$],lt=0;if(st>1&&(a[$]=[0,0,1][st-2]),st==3)for(lt=tt;lt<nt;lt++)a[lt+1]=a[lt+1]+(a[lt+1-tt]>>>1)&255;for(var et=0;et<_e;et++)if(ot=$+et*nt,rt=ot+et+1,st=a[rt-1],lt=0,st==0)for(;lt<nt;lt++)a[ot+lt]=a[rt+lt];else if(st==1){for(;lt<tt;lt++)a[ot+lt]=a[rt+lt];for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+a[ot+lt-tt]}else if(st==2)for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+a[ot+lt-nt];else if(st==3){for(;lt<tt;lt++)a[ot+lt]=a[rt+lt]+(a[ot+lt-nt]>>>1);for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+(a[ot+lt-nt]+a[ot+lt-tt]>>>1)}else{for(;lt<tt;lt++)a[ot+lt]=a[rt+lt]+at(0,a[ot+lt-nt],0);for(;lt<nt;lt++)a[ot+lt]=a[rt+lt]+at(a[ot+lt-tt],a[ot+lt-nt],a[ot+lt-tt-nt])}return a},UPNG.decode._paeth=function(a,s,$){var _=a+s-$,_e=_-a,tt=_-s,nt=_-$;return _e*_e<=tt*tt&&_e*_e<=nt*nt?a:tt*tt<=nt*nt?s:$},UPNG.decode._IHDR=function(a,s,$){var _=UPNG._bin;$.width=_.readUint(a,s),s+=4,$.height=_.readUint(a,s),s+=4,$.depth=a[s],s++,$.ctype=a[s],s++,$.compress=a[s],s++,$.filter=a[s],s++,$.interlace=a[s],s++},UPNG._bin={nextZero:function(a,s){for(;a[s]!=0;)s++;return s},readUshort:function(a,s){return a[s]<<8|a[s+1]},writeUshort:function(a,s,$){a[s]=$>>8&255,a[s+1]=$&255},readUint:function(a,s){return a[s]*(256*256*256)+(a[s+1]<<16|a[s+2]<<8|a[s+3])},writeUint:function(a,s,$){a[s]=$>>24&255,a[s+1]=$>>16&255,a[s+2]=$>>8&255,a[s+3]=$&255},readASCII:function(a,s,$){for(var _="",_e=0;_e<$;_e++)_+=String.fromCharCode(a[s+_e]);return _},writeASCII:function(a,s,$){for(var _=0;_<$.length;_++)a[s+_]=$.charCodeAt(_)},readBytes:function(a,s,$){for(var _=[],_e=0;_e<$;_e++)_.push(a[s+_e]);return _},pad:function(a){return a.length<2?"0"+a:a},readUTF8:function(a,s,$){for(var _="",_e,tt=0;tt<$;tt++)_+="%"+UPNG._bin.pad(a[s+tt].toString(16));try{_e=decodeURIComponent(_)}catch{return UPNG._bin.readASCII(a,s,$)}return _e}},UPNG._copyTile=function(a,s,$,_,_e,tt,nt,at,ot){for(var rt=Math.min(s,_e),st=Math.min($,tt),lt=0,et=0,it=0;it<st;it++)for(var ut=0;ut<rt;ut++)if(nt>=0&&at>=0?(lt=it*s+ut<<2,et=(at+it)*_e+nt+ut<<2):(lt=(-at+it)*s-nt+ut<<2,et=it*_e+ut<<2),ot==0)_[et]=a[lt],_[et+1]=a[lt+1],_[et+2]=a[lt+2],_[et+3]=a[lt+3];else if(ot==1){var ft=a[lt+3]*.00392156862745098,ht=a[lt]*ft,dt=a[lt+1]*ft,gt=a[lt+2]*ft,pt=_[et+3]*(1/255),mt=_[et]*pt,ct=_[et+1]*pt,vt=_[et+2]*pt,At=1-ft,xt=ft+pt*At,bt=xt==0?0:1/xt;_[et+3]=255*xt,_[et+0]=(ht+mt*At)*bt,_[et+1]=(dt+ct*At)*bt,_[et+2]=(gt+vt*At)*bt}else if(ot==2){var ft=a[lt+3],ht=a[lt],dt=a[lt+1],gt=a[lt+2],pt=_[et+3],mt=_[et],ct=_[et+1],vt=_[et+2];ft==pt&&ht==mt&&dt==ct&>==vt?(_[et]=0,_[et+1]=0,_[et+2]=0,_[et+3]=0):(_[et]=ht,_[et+1]=dt,_[et+2]=gt,_[et+3]=ft)}else if(ot==3){var ft=a[lt+3],ht=a[lt],dt=a[lt+1],gt=a[lt+2],pt=_[et+3],mt=_[et],ct=_[et+1],vt=_[et+2];if(ft==pt&&ht==mt&&dt==ct&>==vt)continue;if(ft<220&&pt>20)return!1}return!0},UPNG.encode=function(a,s,$,_,_e,tt,nt){_==null&&(_=0),nt==null&&(nt=!1);var at=UPNG.encode.compress(a,s,$,_,[!1,!1,!1,0,nt]);return UPNG.encode.compressPNG(at,-1),UPNG.encode._main(at,s,$,_e,tt)},UPNG.encodeLL=function(a,s,$,_,_e,tt,nt,at){for(var ot={ctype:0+(_==1?0:2)+(_e==0?0:4),depth:tt,frames:[]},rt=(_+_e)*tt,st=rt*s,lt=0;lt<a.length;lt++)ot.frames.push({rect:{x:0,y:0,width:s,height:$},img:new Uint8Array(a[lt]),blend:0,dispose:1,bpp:Math.ceil(rt/8),bpl:Math.ceil(st/8)});UPNG.encode.compressPNG(ot,0,!0);var et=UPNG.encode._main(ot,s,$,nt,at);return et},UPNG.encode._main=function(a,s,$,_,_e){_e==null&&(_e={});var tt=UPNG.crc.crc,nt=UPNG._bin.writeUint,at=UPNG._bin.writeUshort,ot=UPNG._bin.writeASCII,rt=8,st=a.frames.length>1,lt=!1,et=33+(st?20:0);if(_e.sRGB!=null&&(et+=13),_e.pHYs!=null&&(et+=21),a.ctype==3){for(var it=a.plte.length,ut=0;ut<it;ut++)a.plte[ut]>>>24!=255&&(lt=!0);et+=8+it*3+4+(lt?8+it*1+4:0)}for(var ft=0;ft<a.frames.length;ft++){var ht=a.frames[ft];st&&(et+=38),et+=ht.cimg.length+12,ft!=0&&(et+=4)}et+=12;for(var dt=new Uint8Array(et),gt=[137,80,78,71,13,10,26,10],ut=0;ut<8;ut++)dt[ut]=gt[ut];if(nt(dt,rt,13),rt+=4,ot(dt,rt,"IHDR"),rt+=4,nt(dt,rt,s),rt+=4,nt(dt,rt,$),rt+=4,dt[rt]=a.depth,rt++,dt[rt]=a.ctype,rt++,dt[rt]=0,rt++,dt[rt]=0,rt++,dt[rt]=0,rt++,nt(dt,rt,tt(dt,rt-17,17)),rt+=4,_e.sRGB!=null&&(nt(dt,rt,1),rt+=4,ot(dt,rt,"sRGB"),rt+=4,dt[rt]=_e.sRGB,rt++,nt(dt,rt,tt(dt,rt-5,5)),rt+=4),_e.pHYs!=null&&(nt(dt,rt,9),rt+=4,ot(dt,rt,"pHYs"),rt+=4,nt(dt,rt,_e.pHYs[0]),rt+=4,nt(dt,rt,_e.pHYs[1]),rt+=4,dt[rt]=_e.pHYs[2],rt++,nt(dt,rt,tt(dt,rt-13,13)),rt+=4),st&&(nt(dt,rt,8),rt+=4,ot(dt,rt,"acTL"),rt+=4,nt(dt,rt,a.frames.length),rt+=4,nt(dt,rt,_e.loop!=null?_e.loop:0),rt+=4,nt(dt,rt,tt(dt,rt-12,12)),rt+=4),a.ctype==3){var it=a.plte.length;nt(dt,rt,it*3),rt+=4,ot(dt,rt,"PLTE"),rt+=4;for(var ut=0;ut<it;ut++){var pt=ut*3,mt=a.plte[ut],ct=mt&255,vt=mt>>>8&255,At=mt>>>16&255;dt[rt+pt+0]=ct,dt[rt+pt+1]=vt,dt[rt+pt+2]=At}if(rt+=it*3,nt(dt,rt,tt(dt,rt-it*3-4,it*3+4)),rt+=4,lt){nt(dt,rt,it),rt+=4,ot(dt,rt,"tRNS"),rt+=4;for(var ut=0;ut<it;ut++)dt[rt+ut]=a.plte[ut]>>>24&255;rt+=it,nt(dt,rt,tt(dt,rt-it-4,it+4)),rt+=4}}for(var xt=0,ft=0;ft<a.frames.length;ft++){var ht=a.frames[ft];st&&(nt(dt,rt,26),rt+=4,ot(dt,rt,"fcTL"),rt+=4,nt(dt,rt,xt++),rt+=4,nt(dt,rt,ht.rect.width),rt+=4,nt(dt,rt,ht.rect.height),rt+=4,nt(dt,rt,ht.rect.x),rt+=4,nt(dt,rt,ht.rect.y),rt+=4,at(dt,rt,_[ft]),rt+=2,at(dt,rt,1e3),rt+=2,dt[rt]=ht.dispose,rt++,dt[rt]=ht.blend,rt++,nt(dt,rt,tt(dt,rt-30,30)),rt+=4);var bt=ht.cimg,it=bt.length;nt(dt,rt,it+(ft==0?0:4)),rt+=4;var Et=rt;ot(dt,rt,ft==0?"IDAT":"fdAT"),rt+=4,ft!=0&&(nt(dt,rt,xt++),rt+=4),dt.set(bt,rt),rt+=it,nt(dt,rt,tt(dt,Et,rt-Et)),rt+=4}return nt(dt,rt,0),rt+=4,ot(dt,rt,"IEND"),rt+=4,nt(dt,rt,tt(dt,rt-4,4)),rt+=4,dt.buffer},UPNG.encode.compressPNG=function(a,s,$){for(var _=0;_<a.frames.length;_++){var _e=a.frames[_];_e.rect.width;var tt=_e.rect.height,nt=new Uint8Array(tt*_e.bpl+tt);_e.cimg=UPNG.encode._filterZero(_e.img,tt,_e.bpp,_e.bpl,nt,s,$)}},UPNG.encode.compress=function(a,s,$,_,_e){for(var tt=_e[0],nt=_e[1],at=_e[2],ot=_e[3],rt=_e[4],st=6,lt=8,et=255,it=0;it<a.length;it++)for(var ut=new Uint8Array(a[it]),ft=ut.length,ht=0;ht<ft;ht+=4)et&=ut[ht+3];var dt=et!=255,gt=UPNG.encode.framize(a,s,$,tt,nt,at),pt={},mt=[],ct=[];if(_!=0){for(var vt=[],ht=0;ht<gt.length;ht++)vt.push(gt[ht].img.buffer);for(var At=UPNG.encode.concatRGBA(vt),xt=UPNG.quantize(At,_),bt=0,Et=new Uint8Array(xt.abuf),ht=0;ht<gt.length;ht++){var St=gt[ht].img,Dt=St.length;ct.push(new Uint8Array(xt.inds.buffer,bt>>2,Dt>>2));for(var it=0;it<Dt;it+=4)St[it]=Et[bt+it],St[it+1]=Et[bt+it+1],St[it+2]=Et[bt+it+2],St[it+3]=Et[bt+it+3];bt+=Dt}for(var ht=0;ht<xt.plte.length;ht++)mt.push(xt.plte[ht].est.rgba)}else for(var it=0;it<gt.length;it++){var Rt=gt[it],Tt=new Uint32Array(Rt.img.buffer),wt=Rt.rect.width,ft=Tt.length,Ct=new Uint8Array(ft);ct.push(Ct);for(var ht=0;ht<ft;ht++){var It=Tt[ht];if(ht!=0&&It==Tt[ht-1])Ct[ht]=Ct[ht-1];else if(ht>wt&&It==Tt[ht-wt])Ct[ht]=Ct[ht-wt];else{var yt=pt[It];if(yt==null&&(pt[It]=yt=mt.length,mt.push(It),mt.length>=300))break;Ct[ht]=yt}}}var Pt=mt.length;Pt<=256&&rt==!1&&(Pt<=2?lt=1:Pt<=4?lt=2:Pt<=16?lt=4:lt=8,lt=Math.max(lt,ot));for(var it=0;it<gt.length;it++){var Rt=gt[it];Rt.rect.x,Rt.rect.y;var wt=Rt.rect.width,kt=Rt.rect.height,jt=Rt.img;new Uint32Array(jt.buffer);var Ht=4*wt,Ft=4;if(Pt<=256&&rt==!1){Ht=Math.ceil(lt*wt/8);for(var Lt=new Uint8Array(Ht*kt),Nt=ct[it],Bt=0;Bt<kt;Bt++){var ht=Bt*Ht,_t=Bt*wt;if(lt==8)for(var $t=0;$t<wt;$t++)Lt[ht+$t]=Nt[_t+$t];else if(lt==4)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>1)]|=Nt[_t+$t]<<4-($t&1)*4;else if(lt==2)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>2)]|=Nt[_t+$t]<<6-($t&3)*2;else if(lt==1)for(var $t=0;$t<wt;$t++)Lt[ht+($t>>3)]|=Nt[_t+$t]<<7-($t&7)*1}jt=Lt,st=3,Ft=1}else if(dt==!1&>.length==1){for(var Lt=new Uint8Array(wt*kt*3),Ot=wt*kt,ht=0;ht<Ot;ht++){var St=ht*3,Mt=ht*4;Lt[St]=jt[Mt],Lt[St+1]=jt[Mt+1],Lt[St+2]=jt[Mt+2]}jt=Lt,st=2,Ft=3,Ht=3*wt}Rt.img=jt,Rt.bpl=Ht,Rt.bpp=Ft}return{ctype:st,depth:lt,plte:mt,frames:gt}},UPNG.encode.framize=function(a,s,$,_,_e,tt){for(var nt=[],at=0;at<a.length;at++){var ot=new Uint8Array(a[at]),rt=new Uint32Array(ot.buffer),st,lt=0,et=0,it=s,ut=$,ft=_?1:0;if(at!=0){for(var ht=tt||_||at==1||nt[at-2].dispose!=0?1:2,dt=0,gt=1e9,pt=0;pt<ht;pt++){for(var Rt=new Uint8Array(a[at-1-pt]),mt=new Uint32Array(a[at-1-pt]),ct=s,vt=$,At=-1,xt=-1,bt=0;bt<$;bt++)for(var Et=0;Et<s;Et++){var St=bt*s+Et;rt[St]!=mt[St]&&(Et<ct&&(ct=Et),Et>At&&(At=Et),bt<vt&&(vt=bt),bt>xt&&(xt=bt))}At==-1&&(ct=vt=At=xt=0),_e&&((ct&1)==1&&ct--,(vt&1)==1&&vt--);var Dt=(At-ct+1)*(xt-vt+1);Dt<gt&&(gt=Dt,dt=pt,lt=ct,et=vt,it=At-ct+1,ut=xt-vt+1)}var Rt=new Uint8Array(a[at-1-dt]);dt==1&&(nt[at-1].dispose=2),st=new Uint8Array(it*ut*4),UPNG._copyTile(Rt,s,$,st,it,ut,-lt,-et,0),ft=UPNG._copyTile(ot,s,$,st,it,ut,-lt,-et,3)?1:0,ft==1?UPNG.encode._prepareDiff(ot,s,$,st,{x:lt,y:et,width:it,height:ut}):UPNG._copyTile(ot,s,$,st,it,ut,-lt,-et,0)}else st=ot.slice(0);nt.push({rect:{x:lt,y:et,width:it,height:ut},img:st,blend:ft,dispose:0})}if(_)for(var at=0;at<nt.length;at++){var Tt=nt[at];if(Tt.blend!=1){var wt=Tt.rect,Ct=nt[at-1].rect,It=Math.min(wt.x,Ct.x),yt=Math.min(wt.y,Ct.y),Pt=Math.max(wt.x+wt.width,Ct.x+Ct.width),kt=Math.max(wt.y+wt.height,Ct.y+Ct.height),jt={x:It,y:yt,width:Pt-It,height:kt-yt};nt[at-1].dispose=1,at-1!=0&&UPNG.encode._updateFrame(a,s,$,nt,at-1,jt,_e),UPNG.encode._updateFrame(a,s,$,nt,at,jt,_e)}}var Ht=0;if(a.length!=1)for(var St=0;St<nt.length;St++){var Tt=nt[St];Ht+=Tt.rect.width*Tt.rect.height}return nt},UPNG.encode._updateFrame=function(a,s,$,_,_e,tt,nt){for(var at=Uint8Array,ot=Uint32Array,rt=new at(a[_e-1]),st=new ot(a[_e-1]),lt=_e+1<a.length?new at(a[_e+1]):null,et=new at(a[_e]),it=new ot(et.buffer),ut=s,ft=$,ht=-1,dt=-1,gt=0;gt<tt.height;gt++)for(var pt=0;pt<tt.width;pt++){var mt=tt.x+pt,ct=tt.y+gt,vt=ct*s+mt,At=it[vt];At==0||_[_e-1].dispose==0&&st[vt]==At&&(lt==null||lt[vt*4+3]!=0)||(mt<ut&&(ut=mt),mt>ht&&(ht=mt),ct<ft&&(ft=ct),ct>dt&&(dt=ct))}ht==-1&&(ut=ft=ht=dt=0),nt&&((ut&1)==1&&ut--,(ft&1)==1&&ft--),tt={x:ut,y:ft,width:ht-ut+1,height:dt-ft+1};var xt=_[_e];xt.rect=tt,xt.blend=1,xt.img=new Uint8Array(tt.width*tt.height*4),_[_e-1].dispose==0?(UPNG._copyTile(rt,s,$,xt.img,tt.width,tt.height,-tt.x,-tt.y,0),UPNG.encode._prepareDiff(et,s,$,xt.img,tt)):UPNG._copyTile(et,s,$,xt.img,tt.width,tt.height,-tt.x,-tt.y,0)},UPNG.encode._prepareDiff=function(a,s,$,_,_e){UPNG._copyTile(a,s,$,_,_e.width,_e.height,-_e.x,-_e.y,2)},UPNG.encode._filterZero=function(a,s,$,_,_e,tt,nt){var at=[],ot=[0,1,2,3,4];tt!=-1?ot=[tt]:(s*_>5e5||$==1)&&(ot=[0]);var rt;nt&&(rt={level:0});for(var st=nt&&UZIP!=null?UZIP:pako$1,lt=0;lt<ot.length;lt++){for(var et=0;et<s;et++)UPNG.encode._filterLine(_e,a,et,_,$,ot[lt]);at.push(st.deflate(_e,rt))}for(var it,ut=1e9,lt=0;lt<at.length;lt++)at[lt].length<ut&&(it=lt,ut=at[lt].length);return at[it]},UPNG.encode._filterLine=function(a,s,$,_,_e,tt){var nt=$*_,at=nt+$,ot=UPNG.decode._paeth;if(a[at]=tt,at++,tt==0)if(_<500)for(var rt=0;rt<_;rt++)a[at+rt]=s[nt+rt];else a.set(new Uint8Array(s.buffer,nt,_),at);else if(tt==1){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt];for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-s[nt+rt-_e]+256&255}else if($==0){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt];if(tt==2)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt];if(tt==3)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-(s[nt+rt-_e]>>1)+256&255;if(tt==4)for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]-ot(s[nt+rt-_e],0,0)+256&255}else{if(tt==2)for(var rt=0;rt<_;rt++)a[at+rt]=s[nt+rt]+256-s[nt+rt-_]&255;if(tt==3){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt]+256-(s[nt+rt-_]>>1)&255;for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]+256-(s[nt+rt-_]+s[nt+rt-_e]>>1)&255}if(tt==4){for(var rt=0;rt<_e;rt++)a[at+rt]=s[nt+rt]+256-ot(0,s[nt+rt-_],0)&255;for(var rt=_e;rt<_;rt++)a[at+rt]=s[nt+rt]+256-ot(s[nt+rt-_e],s[nt+rt-_],s[nt+rt-_e-_])&255}}},UPNG.crc={table:function(){for(var a=new Uint32Array(256),s=0;s<256;s++){for(var $=s,_=0;_<8;_++)$&1?$=3988292384^$>>>1:$=$>>>1;a[s]=$}return a}(),update:function(a,s,$,_){for(var _e=0;_e<_;_e++)a=UPNG.crc.table[(a^s[$+_e])&255]^a>>>8;return a},crc:function(a,s,$){return UPNG.crc.update(4294967295,a,s,$)^4294967295}},UPNG.quantize=function(a,s){var $=new Uint8Array(a),_=$.slice(0),_e=new Uint32Array(_.buffer),tt=UPNG.quantize.getKDtree(_,s),nt=tt[0],at=tt[1];UPNG.quantize.planeDst;for(var ot=$,rt=_e,st=ot.length,lt=new Uint8Array($.length>>2),et=0;et<st;et+=4){var it=ot[et]*.00392156862745098,ut=ot[et+1]*(1/255),ft=ot[et+2]*(1/255),ht=ot[et+3]*(1/255),dt=UPNG.quantize.getNearest(nt,it,ut,ft,ht);lt[et>>2]=dt.ind,rt[et>>2]=dt.est.rgba}return{abuf:_.buffer,inds:lt,plte:at}},UPNG.quantize.getKDtree=function(a,s,$){$==null&&($=1e-4);var _=new Uint32Array(a.buffer),_e={i0:0,i1:a.length,bst:null,est:null,tdst:0,left:null,right:null};_e.bst=UPNG.quantize.stats(a,_e.i0,_e.i1),_e.est=UPNG.quantize.estats(_e.bst);for(var tt=[_e];tt.length<s;){for(var nt=0,at=0,ot=0;ot<tt.length;ot++)tt[ot].est.L>nt&&(nt=tt[ot].est.L,at=ot);if(nt<$)break;var rt=tt[at],st=UPNG.quantize.splitPixels(a,_,rt.i0,rt.i1,rt.est.e,rt.est.eMq255),lt=rt.i0>=st||rt.i1<=st;if(lt){rt.est.L=0;continue}var et={i0:rt.i0,i1:st,bst:null,est:null,tdst:0,left:null,right:null};et.bst=UPNG.quantize.stats(a,et.i0,et.i1),et.est=UPNG.quantize.estats(et.bst);var it={i0:st,i1:rt.i1,bst:null,est:null,tdst:0,left:null,right:null};it.bst={R:[],m:[],N:rt.bst.N-et.bst.N};for(var ot=0;ot<16;ot++)it.bst.R[ot]=rt.bst.R[ot]-et.bst.R[ot];for(var ot=0;ot<4;ot++)it.bst.m[ot]=rt.bst.m[ot]-et.bst.m[ot];it.est=UPNG.quantize.estats(it.bst),rt.left=et,rt.right=it,tt[at]=et,tt.push(it)}tt.sort(function(ut,ft){return ft.bst.N-ut.bst.N});for(var ot=0;ot<tt.length;ot++)tt[ot].ind=ot;return[_e,tt]},UPNG.quantize.getNearest=function(a,s,$,_,_e){if(a.left==null)return a.tdst=UPNG.quantize.dist(a.est.q,s,$,_,_e),a;var tt=UPNG.quantize.planeDst(a.est,s,$,_,_e),nt=a.left,at=a.right;tt>0&&(nt=a.right,at=a.left);var ot=UPNG.quantize.getNearest(nt,s,$,_,_e);if(ot.tdst<=tt*tt)return ot;var rt=UPNG.quantize.getNearest(at,s,$,_,_e);return rt.tdst<ot.tdst?rt:ot},UPNG.quantize.planeDst=function(a,s,$,_,_e){var tt=a.e;return tt[0]*s+tt[1]*$+tt[2]*_+tt[3]*_e-a.eMq},UPNG.quantize.dist=function(a,s,$,_,_e){var tt=s-a[0],nt=$-a[1],at=_-a[2],ot=_e-a[3];return tt*tt+nt*nt+at*at+ot*ot},UPNG.quantize.splitPixels=function(a,s,$,_,_e,tt){var nt=UPNG.quantize.vecDot;for(_-=4;$<_;){for(;nt(a,$,_e)<=tt;)$+=4;for(;nt(a,_,_e)>tt;)_-=4;if($>=_)break;var at=s[$>>2];s[$>>2]=s[_>>2],s[_>>2]=at,$+=4,_-=4}for(;nt(a,$,_e)>tt;)$-=4;return $+4},UPNG.quantize.vecDot=function(a,s,$){return a[s]*$[0]+a[s+1]*$[1]+a[s+2]*$[2]+a[s+3]*$[3]},UPNG.quantize.stats=function(a,s,$){for(var _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_e=[0,0,0,0],tt=$-s>>2,nt=s;nt<$;nt+=4){var at=a[nt]*.00392156862745098,ot=a[nt+1]*(1/255),rt=a[nt+2]*(1/255),st=a[nt+3]*(1/255);_e[0]+=at,_e[1]+=ot,_e[2]+=rt,_e[3]+=st,_[0]+=at*at,_[1]+=at*ot,_[2]+=at*rt,_[3]+=at*st,_[5]+=ot*ot,_[6]+=ot*rt,_[7]+=ot*st,_[10]+=rt*rt,_[11]+=rt*st,_[15]+=st*st}return _[4]=_[1],_[8]=_[2],_[9]=_[6],_[12]=_[3],_[13]=_[7],_[14]=_[11],{R:_,m:_e,N:tt}},UPNG.quantize.estats=function(a){var s=a.R,$=a.m,_=a.N,_e=$[0],tt=$[1],nt=$[2],at=$[3],ot=_==0?0:1/_,rt=[s[0]-_e*_e*ot,s[1]-_e*tt*ot,s[2]-_e*nt*ot,s[3]-_e*at*ot,s[4]-tt*_e*ot,s[5]-tt*tt*ot,s[6]-tt*nt*ot,s[7]-tt*at*ot,s[8]-nt*_e*ot,s[9]-nt*tt*ot,s[10]-nt*nt*ot,s[11]-nt*at*ot,s[12]-at*_e*ot,s[13]-at*tt*ot,s[14]-at*nt*ot,s[15]-at*at*ot],st=rt,lt=UPNG.M4,et=[.5,.5,.5,.5],it=0,ut=0;if(_!=0)for(var ft=0;ft<10&&(et=lt.multVec(st,et),ut=Math.sqrt(lt.dot(et,et)),et=lt.sml(1/ut,et),!(Math.abs(ut-it)<1e-9));ft++)it=ut;var ht=[_e*ot,tt*ot,nt*ot,at*ot],dt=lt.dot(lt.sml(255,ht),et);return{Cov:rt,q:ht,e:et,L:it,eMq255:dt,eMq:lt.dot(et,ht),rgba:(Math.round(255*ht[3])<<24|Math.round(255*ht[2])<<16|Math.round(255*ht[1])<<8|Math.round(255*ht[0])<<0)>>>0}},UPNG.M4={multVec:function(a,s){return[a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]*s[3],a[4]*s[0]+a[5]*s[1]+a[6]*s[2]+a[7]*s[3],a[8]*s[0]+a[9]*s[1]+a[10]*s[2]+a[11]*s[3],a[12]*s[0]+a[13]*s[1]+a[14]*s[2]+a[15]*s[3]]},dot:function(a,s){return a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]*s[3]},sml:function(a,s){return[a*s[0],a*s[1],a*s[2],a*s[3]]}},UPNG.encode.concatRGBA=function(a){for(var s=0,$=0;$<a.length;$++)s+=a[$].byteLength;for(var _=new Uint8Array(s),_e=0,$=0;$<a.length;$++){for(var tt=new Uint8Array(a[$]),nt=tt.length,at=0;at<nt;at+=4){var ot=tt[at],rt=tt[at+1],st=tt[at+2],lt=tt[at+3];lt==0&&(ot=rt=st=0),_[_e+at]=ot,_[_e+at+1]=rt,_[_e+at+2]=st,_[_e+at+3]=lt}_e+=nt}return _.buffer};var PngType;(function(a){a.Greyscale="Greyscale",a.Truecolour="Truecolour",a.IndexedColour="IndexedColour",a.GreyscaleWithAlpha="GreyscaleWithAlpha",a.TruecolourWithAlpha="TruecolourWithAlpha"})(PngType||(PngType={}));const asEnum=(a,s)=>{if(a!==void 0)return s[a]};var NonFullScreenPageMode;(function(a){a.UseNone="UseNone",a.UseOutlines="UseOutlines",a.UseThumbs="UseThumbs",a.UseOC="UseOC"})(NonFullScreenPageMode||(NonFullScreenPageMode={}));var ReadingDirection;(function(a){a.L2R="L2R",a.R2L="R2L"})(ReadingDirection||(ReadingDirection={}));var PrintScaling;(function(a){a.None="None",a.AppDefault="AppDefault"})(PrintScaling||(PrintScaling={}));var Duplex;(function(a){a.Simplex="Simplex",a.DuplexFlipShortEdge="DuplexFlipShortEdge",a.DuplexFlipLongEdge="DuplexFlipLongEdge"})(Duplex||(Duplex={}));class ViewerPreferences{constructor(s){this.dict=s}lookupBool(s){const $=this.dict.lookup(PDFName.of(s));if($ instanceof PDFBool)return $}lookupName(s){const $=this.dict.lookup(PDFName.of(s));if($ instanceof PDFName)return $}HideToolbar(){return this.lookupBool("HideToolbar")}HideMenubar(){return this.lookupBool("HideMenubar")}HideWindowUI(){return this.lookupBool("HideWindowUI")}FitWindow(){return this.lookupBool("FitWindow")}CenterWindow(){return this.lookupBool("CenterWindow")}DisplayDocTitle(){return this.lookupBool("DisplayDocTitle")}NonFullScreenPageMode(){return this.lookupName("NonFullScreenPageMode")}Direction(){return this.lookupName("Direction")}PrintScaling(){return this.lookupName("PrintScaling")}Duplex(){return this.lookupName("Duplex")}PickTrayByPDFSize(){return this.lookupBool("PickTrayByPDFSize")}PrintPageRange(){const s=this.dict.lookup(PDFName.of("PrintPageRange"));if(s instanceof PDFArray)return s}NumCopies(){const s=this.dict.lookup(PDFName.of("NumCopies"));if(s instanceof PDFNumber)return s}getHideToolbar(){var s,$;return($=(s=this.HideToolbar())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getHideMenubar(){var s,$;return($=(s=this.HideMenubar())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getHideWindowUI(){var s,$;return($=(s=this.HideWindowUI())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getFitWindow(){var s,$;return($=(s=this.FitWindow())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getCenterWindow(){var s,$;return($=(s=this.CenterWindow())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getDisplayDocTitle(){var s,$;return($=(s=this.DisplayDocTitle())===null||s===void 0?void 0:s.asBoolean())!==null&&$!==void 0?$:!1}getNonFullScreenPageMode(){var s,$;const _=(s=this.NonFullScreenPageMode())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,NonFullScreenPageMode))!==null&&$!==void 0?$:NonFullScreenPageMode.UseNone}getReadingDirection(){var s,$;const _=(s=this.Direction())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,ReadingDirection))!==null&&$!==void 0?$:ReadingDirection.L2R}getPrintScaling(){var s,$;const _=(s=this.PrintScaling())===null||s===void 0?void 0:s.decodeText();return($=asEnum(_,PrintScaling))!==null&&$!==void 0?$:PrintScaling.AppDefault}getDuplex(){var s;const $=(s=this.Duplex())===null||s===void 0?void 0:s.decodeText();return asEnum($,Duplex)}getPickTrayByPDFSize(){var s;return(s=this.PickTrayByPDFSize())===null||s===void 0?void 0:s.asBoolean()}getPrintPageRange(){const s=this.PrintPageRange();if(!s)return[];const $=[];for(let _=0;_<s.size();_+=2){const _e=s.lookup(_,PDFNumber).asNumber(),tt=s.lookup(_+1,PDFNumber).asNumber();$.push({start:_e,end:tt})}return $}getNumCopies(){var s,$;return($=(s=this.NumCopies())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:1}setHideToolbar(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideToolbar"),$)}setHideMenubar(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideMenubar"),$)}setHideWindowUI(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("HideWindowUI"),$)}setFitWindow(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("FitWindow"),$)}setCenterWindow(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("CenterWindow"),$)}setDisplayDocTitle(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("DisplayDocTitle"),$)}setNonFullScreenPageMode(s){assertIsOneOf(s,"nonFullScreenPageMode",NonFullScreenPageMode);const $=PDFName.of(s);this.dict.set(PDFName.of("NonFullScreenPageMode"),$)}setReadingDirection(s){assertIsOneOf(s,"readingDirection",ReadingDirection);const $=PDFName.of(s);this.dict.set(PDFName.of("Direction"),$)}setPrintScaling(s){assertIsOneOf(s,"printScaling",PrintScaling);const $=PDFName.of(s);this.dict.set(PDFName.of("PrintScaling"),$)}setDuplex(s){assertIsOneOf(s,"duplex",Duplex);const $=PDFName.of(s);this.dict.set(PDFName.of("Duplex"),$)}setPickTrayByPDFSize(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("PickTrayByPDFSize"),$)}setPrintPageRange(s){Array.isArray(s)||(s=[s]);const $=[];for(let _e=0,tt=s.length;_e<tt;_e++)$.push(s[_e].start),$.push(s[_e].end);assertEachIs($,"printPageRange",["number"]);const _=this.dict.context.obj($);this.dict.set(PDFName.of("PrintPageRange"),_)}setNumCopies(s){assertRange(s,"numCopies",1,Number.MAX_VALUE),assertInteger(s,"numCopies");const $=this.dict.context.obj(s);this.dict.set(PDFName.of("NumCopies"),$)}}ViewerPreferences.fromDict=a=>new ViewerPreferences(a),ViewerPreferences.create=a=>{const s=a.obj({});return new ViewerPreferences(s)};const tfRegex=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/;class PDFAcroField{constructor(s,$){this.dict=s,this.ref=$}T(){return this.dict.lookupMaybe(PDFName.of("T"),PDFString,PDFHexString)}Ff(){const s=this.getInheritableAttribute(PDFName.of("Ff"));return this.dict.context.lookupMaybe(s,PDFNumber)}V(){const s=this.getInheritableAttribute(PDFName.of("V"));return this.dict.context.lookup(s)}Kids(){return this.dict.lookupMaybe(PDFName.of("Kids"),PDFArray)}DA(){const s=this.dict.lookup(PDFName.of("DA"));if(s instanceof PDFString||s instanceof PDFHexString)return s}setKids(s){this.dict.set(PDFName.of("Kids"),this.dict.context.obj(s))}getParent(){const s=this.dict.get(PDFName.of("Parent"));if(s instanceof PDFRef){const $=this.dict.lookup(PDFName.of("Parent"),PDFDict);return new PDFAcroField($,s)}}setParent(s){s?this.dict.set(PDFName.of("Parent"),s):this.dict.delete(PDFName.of("Parent"))}getFullyQualifiedName(){const s=this.getParent();return s?`${s.getFullyQualifiedName()}.${this.getPartialName()}`:this.getPartialName()}getPartialName(){var s;return(s=this.T())===null||s===void 0?void 0:s.decodeText()}setPartialName(s){s?this.dict.set(PDFName.of("T"),PDFHexString.fromText(s)):this.dict.delete(PDFName.of("T"))}setDefaultAppearance(s){this.dict.set(PDFName.of("DA"),PDFString.of(s))}getDefaultAppearance(){const s=this.DA();return s instanceof PDFHexString?s.decodeText():s==null?void 0:s.asString()}setFontSize(s){var $;const _=($=this.getFullyQualifiedName())!==null&&$!==void 0?$:"",_e=this.getDefaultAppearance();if(!_e)throw new MissingDAEntryError(_);const tt=findLastMatch(_e,tfRegex);if(!tt.match)throw new MissingTfOperatorError(_);const nt=_e.slice(0,tt.pos-tt.match[0].length),at=tt.pos<=_e.length?_e.slice(tt.pos):"",ot=tt.match[1],rt=`${nt} /${ot} ${s} Tf ${at}`;this.setDefaultAppearance(rt)}getFlags(){var s,$;return($=(s=this.Ff())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:0}setFlags(s){this.dict.set(PDFName.of("Ff"),PDFNumber.of(s))}hasFlag(s){return(this.getFlags()&s)!==0}setFlag(s){const $=this.getFlags();this.setFlags($|s)}clearFlag(s){const $=this.getFlags();this.setFlags($&~s)}setFlagTo(s,$){$?this.setFlag(s):this.clearFlag(s)}getInheritableAttribute(s){let $;return this.ascend(_=>{$||($=_.dict.get(s))}),$}ascend(s){s(this);const $=this.getParent();$&&$.ascend(s)}}class BorderStyle{constructor(s){this.dict=s}W(){const s=this.dict.lookup(PDFName.of("W"));if(s instanceof PDFNumber)return s}getWidth(){var s,$;return($=(s=this.W())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:1}setWidth(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("W"),$)}}BorderStyle.fromDict=a=>new BorderStyle(a);class PDFAnnotation{constructor(s){this.dict=s}Rect(){return this.dict.lookup(PDFName.of("Rect"),PDFArray)}AP(){return this.dict.lookupMaybe(PDFName.of("AP"),PDFDict)}F(){const s=this.dict.lookup(PDFName.of("F"));return this.dict.context.lookupMaybe(s,PDFNumber)}getRectangle(){var s;const $=this.Rect();return(s=$==null?void 0:$.asRectangle())!==null&&s!==void 0?s:{x:0,y:0,width:0,height:0}}setRectangle(s){const{x:$,y:_,width:_e,height:tt}=s,nt=this.dict.context.obj([$,_,$+_e,_+tt]);this.dict.set(PDFName.of("Rect"),nt)}getAppearanceState(){const s=this.dict.lookup(PDFName.of("AS"));if(s instanceof PDFName)return s}setAppearanceState(s){this.dict.set(PDFName.of("AS"),s)}setAppearances(s){this.dict.set(PDFName.of("AP"),s)}ensureAP(){let s=this.AP();return s||(s=this.dict.context.obj({}),this.dict.set(PDFName.of("AP"),s)),s}getNormalAppearance(){const $=this.ensureAP().get(PDFName.of("N"));if($ instanceof PDFRef||$ instanceof PDFDict)return $;throw new Error(`Unexpected N type: ${$==null?void 0:$.constructor.name}`)}setNormalAppearance(s){this.ensureAP().set(PDFName.of("N"),s)}setRolloverAppearance(s){this.ensureAP().set(PDFName.of("R"),s)}setDownAppearance(s){this.ensureAP().set(PDFName.of("D"),s)}removeRolloverAppearance(){const s=this.AP();s==null||s.delete(PDFName.of("R"))}removeDownAppearance(){const s=this.AP();s==null||s.delete(PDFName.of("D"))}getAppearances(){const s=this.AP();if(!s)return;const $=s.lookup(PDFName.of("N"),PDFDict,PDFStream),_=s.lookupMaybe(PDFName.of("R"),PDFDict,PDFStream),_e=s.lookupMaybe(PDFName.of("D"),PDFDict,PDFStream);return{normal:$,rollover:_,down:_e}}getFlags(){var s,$;return($=(s=this.F())===null||s===void 0?void 0:s.asNumber())!==null&&$!==void 0?$:0}setFlags(s){this.dict.set(PDFName.of("F"),PDFNumber.of(s))}hasFlag(s){return(this.getFlags()&s)!==0}setFlag(s){const $=this.getFlags();this.setFlags($|s)}clearFlag(s){const $=this.getFlags();this.setFlags($&~s)}setFlagTo(s,$){$?this.setFlag(s):this.clearFlag(s)}}PDFAnnotation.fromDict=a=>new PDFAnnotation(a);class AppearanceCharacteristics{constructor(s){this.dict=s}R(){const s=this.dict.lookup(PDFName.of("R"));if(s instanceof PDFNumber)return s}BC(){const s=this.dict.lookup(PDFName.of("BC"));if(s instanceof PDFArray)return s}BG(){const s=this.dict.lookup(PDFName.of("BG"));if(s instanceof PDFArray)return s}CA(){const s=this.dict.lookup(PDFName.of("CA"));if(s instanceof PDFHexString||s instanceof PDFString)return s}RC(){const s=this.dict.lookup(PDFName.of("RC"));if(s instanceof PDFHexString||s instanceof PDFString)return s}AC(){const s=this.dict.lookup(PDFName.of("AC"));if(s instanceof PDFHexString||s instanceof PDFString)return s}getRotation(){var s;return(s=this.R())===null||s===void 0?void 0:s.asNumber()}getBorderColor(){const s=this.BC();if(!s)return;const $=[];for(let _=0,_e=s==null?void 0:s.size();_<_e;_++){const tt=s.get(_);tt instanceof PDFNumber&&$.push(tt.asNumber())}return $}getBackgroundColor(){const s=this.BG();if(!s)return;const $=[];for(let _=0,_e=s==null?void 0:s.size();_<_e;_++){const tt=s.get(_);tt instanceof PDFNumber&&$.push(tt.asNumber())}return $}getCaptions(){const s=this.CA(),$=this.RC(),_=this.AC();return{normal:s==null?void 0:s.decodeText(),rollover:$==null?void 0:$.decodeText(),down:_==null?void 0:_.decodeText()}}setRotation(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("R"),$)}setBorderColor(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("BC"),$)}setBackgroundColor(s){const $=this.dict.context.obj(s);this.dict.set(PDFName.of("BG"),$)}setCaptions(s){const $=PDFHexString.fromText(s.normal);if(this.dict.set(PDFName.of("CA"),$),s.rollover){const _=PDFHexString.fromText(s.rollover);this.dict.set(PDFName.of("RC"),_)}else this.dict.delete(PDFName.of("RC"));if(s.down){const _=PDFHexString.fromText(s.down);this.dict.set(PDFName.of("AC"),_)}else this.dict.delete(PDFName.of("AC"))}}AppearanceCharacteristics.fromDict=a=>new AppearanceCharacteristics(a);class PDFWidgetAnnotation extends PDFAnnotation{MK(){const s=this.dict.lookup(PDFName.of("MK"));if(s instanceof PDFDict)return s}BS(){const s=this.dict.lookup(PDFName.of("BS"));if(s instanceof PDFDict)return s}DA(){const s=this.dict.lookup(PDFName.of("DA"));if(s instanceof PDFString||s instanceof PDFHexString)return s}P(){const s=this.dict.get(PDFName.of("P"));if(s instanceof PDFRef)return s}setP(s){this.dict.set(PDFName.of("P"),s)}setDefaultAppearance(s){this.dict.set(PDFName.of("DA"),PDFString.of(s))}getDefaultAppearance(){const s=this.DA();return s instanceof PDFHexString?s.decodeText():s==null?void 0:s.asString()}getAppearanceCharacteristics(){const s=this.MK();if(s)return AppearanceCharacteristics.fromDict(s)}getOrCreateAppearanceCharacteristics(){const s=this.MK();if(s)return AppearanceCharacteristics.fromDict(s);const $=AppearanceCharacteristics.fromDict(this.dict.context.obj({}));return this.dict.set(PDFName.of("MK"),$.dict),$}getBorderStyle(){const s=this.BS();if(s)return BorderStyle.fromDict(s)}getOrCreateBorderStyle(){const s=this.BS();if(s)return BorderStyle.fromDict(s);const $=BorderStyle.fromDict(this.dict.context.obj({}));return this.dict.set(PDFName.of("BS"),$.dict),$}getOnValue(){var s;const $=(s=this.getAppearances())===null||s===void 0?void 0:s.normal;if($ instanceof PDFDict){const _=$.keys();for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e];if(nt!==PDFName.of("Off"))return nt}}}}PDFWidgetAnnotation.fromDict=a=>new PDFWidgetAnnotation(a),PDFWidgetAnnotation.create=(a,s)=>{const $=a.obj({Type:"Annot",Subtype:"Widget",Rect:[0,0,0,0],Parent:s});return new PDFWidgetAnnotation($)};class PDFAcroTerminal extends PDFAcroField{FT(){const s=this.getInheritableAttribute(PDFName.of("FT"));return this.dict.context.lookup(s,PDFName)}getWidgets(){const s=this.Kids();if(!s)return[PDFWidgetAnnotation.fromDict(this.dict)];const $=new Array(s.size());for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_,PDFDict);$[_]=PDFWidgetAnnotation.fromDict(tt)}return $}addWidget(s){const{Kids:$}=this.normalizedEntries();$.push(s)}removeWidget(s){const $=this.Kids();if($){if(s<0||s>$.size())throw new IndexOutOfBoundsError(s,0,$.size());$.remove(s)}else{if(s!==0)throw new IndexOutOfBoundsError(s,0,0);this.setKids([])}}normalizedEntries(){let s=this.Kids();return s||(s=this.dict.context.obj([this.ref]),this.dict.set(PDFName.of("Kids"),s)),{Kids:s}}}PDFAcroTerminal.fromDict=(a,s)=>new PDFAcroTerminal(a,s);class PDFAcroButton extends PDFAcroTerminal{Opt(){return this.dict.lookupMaybe(PDFName.of("Opt"),PDFString,PDFHexString,PDFArray)}setOpt(s){this.dict.set(PDFName.of("Opt"),this.dict.context.obj(s))}getExportValues(){const s=this.Opt();if(!s)return;if(s instanceof PDFString||s instanceof PDFHexString)return[s];const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);(tt instanceof PDFString||tt instanceof PDFHexString)&&$.push(tt)}return $}removeExportValue(s){const $=this.Opt();if($)if($ instanceof PDFString||$ instanceof PDFHexString){if(s!==0)throw new IndexOutOfBoundsError(s,0,0);this.setOpt([])}else{if(s<0||s>$.size())throw new IndexOutOfBoundsError(s,0,$.size());$.remove(s)}}normalizeExportValues(){var s,$,_,_e;const tt=(s=this.getExportValues())!==null&&s!==void 0?s:[],nt=[],at=this.getWidgets();for(let ot=0,rt=at.length;ot<rt;ot++){const st=at[ot],lt=($=tt[ot])!==null&&$!==void 0?$:PDFHexString.fromText((_e=(_=st.getOnValue())===null||_===void 0?void 0:_.decodeText())!==null&&_e!==void 0?_e:"");nt.push(lt)}this.setOpt(nt)}addOpt(s,$){var _;this.normalizeExportValues();const _e=s.decodeText();let tt;if($){const at=(_=this.getExportValues())!==null&&_!==void 0?_:[];for(let ot=0,rt=at.length;ot<rt;ot++)at[ot].decodeText()===_e&&(tt=ot)}const nt=this.Opt();return nt.push(s),tt??nt.size()-1}addWidgetWithOpt(s,$,_){const _e=this.addOpt($,_),tt=PDFName.of(String(_e));return this.addWidget(s),tt}}class PDFAcroCheckBox extends PDFAcroButton{setValue(s){var $;const _=($=this.getOnValue())!==null&&$!==void 0?$:PDFName.of("Yes");if(s!==_&&s!==PDFName.of("Off"))throw new InvalidAcroFieldValueError;this.dict.set(PDFName.of("V"),s);const _e=this.getWidgets();for(let tt=0,nt=_e.length;tt<nt;tt++){const at=_e[tt],ot=at.getOnValue()===s?s:PDFName.of("Off");at.setAppearanceState(ot)}}getValue(){const s=this.V();return s instanceof PDFName?s:PDFName.of("Off")}getOnValue(){const[s]=this.getWidgets();return s==null?void 0:s.getOnValue()}}PDFAcroCheckBox.fromDict=(a,s)=>new PDFAcroCheckBox(a,s),PDFAcroCheckBox.create=a=>{const s=a.obj({FT:"Btn",Kids:[]}),$=a.register(s);return new PDFAcroCheckBox(s,$)};const flag$1=a=>1<<a;var AcroFieldFlags;(function(a){a[a.ReadOnly=flag$1(0)]="ReadOnly",a[a.Required=flag$1(1)]="Required",a[a.NoExport=flag$1(2)]="NoExport"})(AcroFieldFlags||(AcroFieldFlags={}));var AcroButtonFlags;(function(a){a[a.NoToggleToOff=flag$1(14)]="NoToggleToOff",a[a.Radio=flag$1(15)]="Radio",a[a.PushButton=flag$1(16)]="PushButton",a[a.RadiosInUnison=flag$1(25)]="RadiosInUnison"})(AcroButtonFlags||(AcroButtonFlags={}));var AcroTextFlags;(function(a){a[a.Multiline=flag$1(12)]="Multiline",a[a.Password=flag$1(13)]="Password",a[a.FileSelect=flag$1(20)]="FileSelect",a[a.DoNotSpellCheck=flag$1(22)]="DoNotSpellCheck",a[a.DoNotScroll=flag$1(23)]="DoNotScroll",a[a.Comb=flag$1(24)]="Comb",a[a.RichText=flag$1(25)]="RichText"})(AcroTextFlags||(AcroTextFlags={}));var AcroChoiceFlags;(function(a){a[a.Combo=flag$1(17)]="Combo",a[a.Edit=flag$1(18)]="Edit",a[a.Sort=flag$1(19)]="Sort",a[a.MultiSelect=flag$1(21)]="MultiSelect",a[a.DoNotSpellCheck=flag$1(22)]="DoNotSpellCheck",a[a.CommitOnSelChange=flag$1(26)]="CommitOnSelChange"})(AcroChoiceFlags||(AcroChoiceFlags={}));class PDFAcroChoice extends PDFAcroTerminal{setValues(s){if(this.hasFlag(AcroChoiceFlags.Combo)&&!this.hasFlag(AcroChoiceFlags.Edit)&&!this.valuesAreValid(s))throw new InvalidAcroFieldValueError;if(s.length===0&&this.dict.delete(PDFName.of("V")),s.length===1&&this.dict.set(PDFName.of("V"),s[0]),s.length>1){if(!this.hasFlag(AcroChoiceFlags.MultiSelect))throw new MultiSelectValueError;this.dict.set(PDFName.of("V"),this.dict.context.obj(s))}this.updateSelectedIndices(s)}valuesAreValid(s){const $=this.getOptions();for(let _=0,_e=s.length;_<_e;_++){const tt=s[_].decodeText();if(!$.find(nt=>tt===(nt.display||nt.value).decodeText()))return!1}return!0}updateSelectedIndices(s){if(s.length>1){const $=new Array(s.length),_=this.getOptions();for(let _e=0,tt=s.length;_e<tt;_e++){const nt=s[_e].decodeText();$[_e]=_.findIndex(at=>nt===(at.display||at.value).decodeText())}this.dict.set(PDFName.of("I"),this.dict.context.obj($.sort()))}else this.dict.delete(PDFName.of("I"))}getValues(){const s=this.V();if(s instanceof PDFString||s instanceof PDFHexString)return[s];if(s instanceof PDFArray){const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);(tt instanceof PDFString||tt instanceof PDFHexString)&&$.push(tt)}return $}return[]}Opt(){return this.dict.lookupMaybe(PDFName.of("Opt"),PDFString,PDFHexString,PDFArray)}setOptions(s){const $=new Array(s.length);for(let _=0,_e=s.length;_<_e;_++){const{value:tt,display:nt}=s[_];$[_]=this.dict.context.obj([tt,nt||tt])}this.dict.set(PDFName.of("Opt"),this.dict.context.obj($))}getOptions(){const s=this.Opt();if(s instanceof PDFString||s instanceof PDFHexString)return[{value:s,display:s}];if(s instanceof PDFArray){const $=[];for(let _=0,_e=s.size();_<_e;_++){const tt=s.lookup(_);if((tt instanceof PDFString||tt instanceof PDFHexString)&&$.push({value:tt,display:tt}),tt instanceof PDFArray&&tt.size()>0){const nt=tt.lookup(0,PDFString,PDFHexString),at=tt.lookupMaybe(1,PDFString,PDFHexString);$.push({value:nt,display:at||nt})}}return $}return[]}}class PDFAcroComboBox extends PDFAcroChoice{}PDFAcroComboBox.fromDict=(a,s)=>new PDFAcroComboBox(a,s),PDFAcroComboBox.create=a=>{const s=a.obj({FT:"Ch",Ff:AcroChoiceFlags.Combo,Kids:[]}),$=a.register(s);return new PDFAcroComboBox(s,$)};class PDFAcroNonTerminal extends PDFAcroField{addField(s){const{Kids:$}=this.normalizedEntries();$==null||$.push(s)}normalizedEntries(){let s=this.Kids();return s||(s=this.dict.context.obj([]),this.dict.set(PDFName.of("Kids"),s)),{Kids:s}}}PDFAcroNonTerminal.fromDict=(a,s)=>new PDFAcroNonTerminal(a,s),PDFAcroNonTerminal.create=a=>{const s=a.obj({}),$=a.register(s);return new PDFAcroNonTerminal(s,$)};class PDFAcroSignature extends PDFAcroTerminal{}PDFAcroSignature.fromDict=(a,s)=>new PDFAcroSignature(a,s);class PDFAcroText extends PDFAcroTerminal{MaxLen(){const s=this.dict.lookup(PDFName.of("MaxLen"));if(s instanceof PDFNumber)return s}Q(){const s=this.dict.lookup(PDFName.of("Q"));if(s instanceof PDFNumber)return s}setMaxLength(s){this.dict.set(PDFName.of("MaxLen"),PDFNumber.of(s))}removeMaxLength(){this.dict.delete(PDFName.of("MaxLen"))}getMaxLength(){var s;return(s=this.MaxLen())===null||s===void 0?void 0:s.asNumber()}setQuadding(s){this.dict.set(PDFName.of("Q"),PDFNumber.of(s))}getQuadding(){var s;return(s=this.Q())===null||s===void 0?void 0:s.asNumber()}setValue(s){this.dict.set(PDFName.of("V"),s)}removeValue(){this.dict.delete(PDFName.of("V"))}getValue(){const s=this.V();if(s instanceof PDFString||s instanceof PDFHexString)return s}}PDFAcroText.fromDict=(a,s)=>new PDFAcroText(a,s),PDFAcroText.create=a=>{const s=a.obj({FT:"Tx",Kids:[]}),$=a.register(s);return new PDFAcroText(s,$)};class PDFAcroPushButton extends PDFAcroButton{}PDFAcroPushButton.fromDict=(a,s)=>new PDFAcroPushButton(a,s),PDFAcroPushButton.create=a=>{const s=a.obj({FT:"Btn",Ff:AcroButtonFlags.PushButton,Kids:[]}),$=a.register(s);return new PDFAcroPushButton(s,$)};class PDFAcroRadioButton extends PDFAcroButton{setValue(s){if(!this.getOnValues().includes(s)&&s!==PDFName.of("Off"))throw new InvalidAcroFieldValueError;this.dict.set(PDFName.of("V"),s);const _=this.getWidgets();for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e],at=nt.getOnValue()===s?s:PDFName.of("Off");nt.setAppearanceState(at)}}getValue(){const s=this.V();return s instanceof PDFName?s:PDFName.of("Off")}getOnValues(){const s=this.getWidgets(),$=[];for(let _=0,_e=s.length;_<_e;_++){const tt=s[_].getOnValue();tt&&$.push(tt)}return $}}PDFAcroRadioButton.fromDict=(a,s)=>new PDFAcroRadioButton(a,s),PDFAcroRadioButton.create=a=>{const s=a.obj({FT:"Btn",Ff:AcroButtonFlags.Radio,Kids:[]}),$=a.register(s);return new PDFAcroRadioButton(s,$)};class PDFAcroListBox extends PDFAcroChoice{}PDFAcroListBox.fromDict=(a,s)=>new PDFAcroListBox(a,s),PDFAcroListBox.create=a=>{const s=a.obj({FT:"Ch",Kids:[]}),$=a.register(s);return new PDFAcroListBox(s,$)};const createPDFAcroFields=a=>{if(!a)return[];const s=[];for(let $=0,_=a.size();$<_;$++){const _e=a.get($),tt=a.lookup($);_e instanceof PDFRef&&tt instanceof PDFDict&&s.push([createPDFAcroField(tt,_e),_e])}return s},createPDFAcroField=(a,s)=>isNonTerminalAcroField(a)?PDFAcroNonTerminal.fromDict(a,s):createPDFAcroTerminal(a,s),isNonTerminalAcroField=a=>{const s=a.lookup(PDFName.of("Kids"));if(s instanceof PDFArray)for(let $=0,_=s.size();$<_;$++){const _e=s.lookup($);if(_e instanceof PDFDict&&_e.has(PDFName.of("T")))return!0}return!1},createPDFAcroTerminal=(a,s)=>{const $=getInheritableAttribute(a,PDFName.of("FT")),_=a.context.lookup($,PDFName);return _===PDFName.of("Btn")?createPDFAcroButton(a,s):_===PDFName.of("Ch")?createPDFAcroChoice(a,s):_===PDFName.of("Tx")?PDFAcroText.fromDict(a,s):_===PDFName.of("Sig")?PDFAcroSignature.fromDict(a,s):PDFAcroTerminal.fromDict(a,s)},createPDFAcroButton=(a,s)=>{var $;const _=getInheritableAttribute(a,PDFName.of("Ff")),_e=a.context.lookupMaybe(_,PDFNumber),tt=($=_e==null?void 0:_e.asNumber())!==null&&$!==void 0?$:0;return flagIsSet(tt,AcroButtonFlags.PushButton)?PDFAcroPushButton.fromDict(a,s):flagIsSet(tt,AcroButtonFlags.Radio)?PDFAcroRadioButton.fromDict(a,s):PDFAcroCheckBox.fromDict(a,s)},createPDFAcroChoice=(a,s)=>{var $;const _=getInheritableAttribute(a,PDFName.of("Ff")),_e=a.context.lookupMaybe(_,PDFNumber),tt=($=_e==null?void 0:_e.asNumber())!==null&&$!==void 0?$:0;return flagIsSet(tt,AcroChoiceFlags.Combo)?PDFAcroComboBox.fromDict(a,s):PDFAcroListBox.fromDict(a,s)},flagIsSet=(a,s)=>(a&s)!==0,getInheritableAttribute=(a,s)=>{let $;return ascend(a,_=>{$||($=_.get(s))}),$},ascend=(a,s)=>{s(a);const $=a.lookupMaybe(PDFName.of("Parent"),PDFDict);$&&ascend($,s)};class PDFAcroForm{constructor(s){this.dict=s}Fields(){const s=this.dict.lookup(PDFName.of("Fields"));if(s instanceof PDFArray)return s}getFields(){const{Fields:s}=this.normalizedEntries(),$=new Array(s.size());for(let _=0,_e=s.size();_<_e;_++){const tt=s.get(_),nt=s.lookup(_,PDFDict);$[_]=[createPDFAcroField(nt,tt),tt]}return $}getAllFields(){const s=[],$=_=>{if(_)for(let _e=0,tt=_.length;_e<tt;_e++){const nt=_[_e];s.push(nt);const[at]=nt;at instanceof PDFAcroNonTerminal&&$(createPDFAcroFields(at.Kids()))}};return $(this.getFields()),s}addField(s){const{Fields:$}=this.normalizedEntries();$==null||$.push(s)}removeField(s){const $=s.getParent(),_=$===void 0?this.normalizedEntries().Fields:$.Kids(),_e=_==null?void 0:_.indexOf(s.ref);if(_===void 0||_e===void 0)throw new Error(`Tried to remove inexistent field ${s.getFullyQualifiedName()}`);_.remove(_e),$!==void 0&&_.size()===0&&this.removeField($)}normalizedEntries(){let s=this.Fields();return s||(s=this.dict.context.obj([]),this.dict.set(PDFName.of("Fields"),s)),{Fields:s}}}PDFAcroForm.fromDict=a=>new PDFAcroForm(a),PDFAcroForm.create=a=>{const s=a.obj({Fields:[]});return new PDFAcroForm(s)};class PDFCatalog extends PDFDict{Pages(){return this.lookup(PDFName.of("Pages"),PDFDict)}AcroForm(){return this.lookupMaybe(PDFName.of("AcroForm"),PDFDict)}getAcroForm(){const s=this.AcroForm();if(s)return PDFAcroForm.fromDict(s)}getOrCreateAcroForm(){let s=this.getAcroForm();if(!s){s=PDFAcroForm.create(this.context);const $=this.context.register(s.dict);this.set(PDFName.of("AcroForm"),$)}return s}ViewerPreferences(){return this.lookupMaybe(PDFName.of("ViewerPreferences"),PDFDict)}getViewerPreferences(){const s=this.ViewerPreferences();if(s)return ViewerPreferences.fromDict(s)}getOrCreateViewerPreferences(){let s=this.getViewerPreferences();if(!s){s=ViewerPreferences.create(this.context);const $=this.context.register(s.dict);this.set(PDFName.of("ViewerPreferences"),$)}return s}insertLeafNode(s,$){const _=this.get(PDFName.of("Pages"));return this.Pages().insertLeafNode(s,$)||_}removeLeafNode(s){this.Pages().removeLeafNode(s)}}PDFCatalog.withContextAndPages=(a,s)=>{const $=new Map;return $.set(PDFName.of("Type"),PDFName.of("Catalog")),$.set(PDFName.of("Pages"),s),new PDFCatalog($,a)},PDFCatalog.fromMapWithContext=(a,s)=>new PDFCatalog(a,s);class PDFPageTree extends PDFDict{Parent(){return this.lookup(PDFName.of("Parent"))}Kids(){return this.lookup(PDFName.of("Kids"),PDFArray)}Count(){return this.lookup(PDFName.of("Count"),PDFNumber)}pushTreeNode(s){this.Kids().push(s)}pushLeafNode(s){const $=this.Kids();this.insertLeafKid($.size(),s)}insertLeafNode(s,$){const _=this.Kids(),_e=this.Count().asNumber();if($>_e)throw new InvalidTargetIndexError($,_e);let tt=$;for(let nt=0,at=_.size();nt<at;nt++){if(tt===0){this.insertLeafKid(nt,s);return}const ot=_.get(nt),rt=this.context.lookup(ot);if(rt instanceof PDFPageTree){if(rt.Count().asNumber()>tt)return rt.insertLeafNode(s,tt)||ot;tt-=rt.Count().asNumber()}rt instanceof PDFPageLeaf&&(tt-=1)}if(tt===0){this.insertLeafKid(_.size(),s);return}throw new CorruptPageTreeError($,"insertLeafNode")}removeLeafNode(s,$=!0){const _=this.Kids(),_e=this.Count().asNumber();if(s>=_e)throw new InvalidTargetIndexError(s,_e);let tt=s;for(let nt=0,at=_.size();nt<at;nt++){const ot=_.get(nt),rt=this.context.lookup(ot);if(rt instanceof PDFPageTree)if(rt.Count().asNumber()>tt){rt.removeLeafNode(tt,$),$&&rt.Kids().size()===0&&_.remove(nt);return}else tt-=rt.Count().asNumber();if(rt instanceof PDFPageLeaf)if(tt===0){this.removeKid(nt);return}else tt-=1}throw new CorruptPageTreeError(s,"removeLeafNode")}ascend(s){s(this);const $=this.Parent();$&&$.ascend(s)}traverse(s){const $=this.Kids();for(let _=0,_e=$.size();_<_e;_++){const tt=$.get(_),nt=this.context.lookup(tt);nt instanceof PDFPageTree&&nt.traverse(s),s(nt,tt)}}insertLeafKid(s,$){const _=this.Kids();this.ascend(_e=>{const tt=_e.Count().asNumber()+1;_e.set(PDFName.of("Count"),PDFNumber.of(tt))}),_.insert(s,$)}removeKid(s){const $=this.Kids();$.lookup(s)instanceof PDFPageLeaf&&this.ascend(_e=>{const tt=_e.Count().asNumber()-1;_e.set(PDFName.of("Count"),PDFNumber.of(tt))}),$.remove(s)}}PDFPageTree.withContext=(a,s)=>{const $=new Map;return $.set(PDFName.of("Type"),PDFName.of("Pages")),$.set(PDFName.of("Kids"),a.obj([])),$.set(PDFName.of("Count"),a.obj(0)),s&&$.set(PDFName.of("Parent"),s),new PDFPageTree($,a)},PDFPageTree.fromMapWithContext=(a,s)=>new PDFPageTree(a,s);const IsDigit=new Uint8Array(256);IsDigit[CharCodes$1.Zero]=1,IsDigit[CharCodes$1.One]=1,IsDigit[CharCodes$1.Two]=1,IsDigit[CharCodes$1.Three]=1,IsDigit[CharCodes$1.Four]=1,IsDigit[CharCodes$1.Five]=1,IsDigit[CharCodes$1.Six]=1,IsDigit[CharCodes$1.Seven]=1,IsDigit[CharCodes$1.Eight]=1,IsDigit[CharCodes$1.Nine]=1;const IsNumericPrefix=new Uint8Array(256);IsNumericPrefix[CharCodes$1.Period]=1,IsNumericPrefix[CharCodes$1.Plus]=1,IsNumericPrefix[CharCodes$1.Minus]=1;const IsNumeric=new Uint8Array(256);for(let a=0,s=256;a<s;a++)IsNumeric[a]=IsDigit[a]||IsNumericPrefix[a]?1:0;const{Space:Space$1,CarriageReturn,Newline}=CharCodes$1,stream=[CharCodes$1.s,CharCodes$1.t,CharCodes$1.r,CharCodes$1.e,CharCodes$1.a,CharCodes$1.m],endstream=[CharCodes$1.e,CharCodes$1.n,CharCodes$1.d,CharCodes$1.s,CharCodes$1.t,CharCodes$1.r,CharCodes$1.e,CharCodes$1.a,CharCodes$1.m];CharCodes$1.Percent,CharCodes$1.P,CharCodes$1.D,CharCodes$1.F,CharCodes$1.Dash,CharCodes$1.Percent,CharCodes$1.Percent,CharCodes$1.E,CharCodes$1.O,CharCodes$1.F,CharCodes$1.o,CharCodes$1.b,CharCodes$1.j,CharCodes$1.e,CharCodes$1.n,CharCodes$1.d,CharCodes$1.o,CharCodes$1.b,CharCodes$1.j,CharCodes$1.x,CharCodes$1.r,CharCodes$1.e,CharCodes$1.f,CharCodes$1.t,CharCodes$1.r,CharCodes$1.a,CharCodes$1.i,CharCodes$1.l,CharCodes$1.e,CharCodes$1.r,CharCodes$1.s,CharCodes$1.t,CharCodes$1.a,CharCodes$1.r,CharCodes$1.t,CharCodes$1.x,CharCodes$1.r,CharCodes$1.e,CharCodes$1.f,CharCodes$1.t,CharCodes$1.r,CharCodes$1.u,CharCodes$1.e,CharCodes$1.f,CharCodes$1.a,CharCodes$1.l,CharCodes$1.s,CharCodes$1.e,CharCodes$1.n,CharCodes$1.u,CharCodes$1.l,CharCodes$1.l,[...stream],[...stream],[...stream],[...stream],[...endstream],[...endstream],[...endstream];const flag=a=>1<<a;var AnnotationFlags;(function(a){a[a.Invisible=flag(0)]="Invisible",a[a.Hidden=flag(1)]="Hidden",a[a.Print=flag(2)]="Print",a[a.NoZoom=flag(3)]="NoZoom",a[a.NoRotate=flag(4)]="NoRotate",a[a.NoView=flag(5)]="NoView",a[a.ReadOnly=flag(6)]="ReadOnly",a[a.Locked=flag(7)]="Locked",a[a.ToggleNoView=flag(8)]="ToggleNoView",a[a.LockedContents=flag(9)]="LockedContents"})(AnnotationFlags||(AnnotationFlags={}));var RotationTypes;(function(a){a.Degrees="degrees",a.Radians="radians"})(RotationTypes||(RotationTypes={}));const degrees=a=>(assertIs(a,"degreeAngle",["number"]),{type:RotationTypes.Degrees,angle:a}),degreesToRadians=a=>a*Math.PI/180;var LineCapStyle;(function(a){a[a.Butt=0]="Butt",a[a.Round=1]="Round",a[a.Projecting=2]="Projecting"})(LineCapStyle||(LineCapStyle={}));var LineJoinStyle;(function(a){a[a.Miter=0]="Miter",a[a.Round=1]="Round",a[a.Bevel=2]="Bevel"})(LineJoinStyle||(LineJoinStyle={}));var FillRule;(function(a){a.NonZero="f",a.EvenOdd="f*"})(FillRule||(FillRule={}));var TextRenderingMode;(function(a){a[a.Fill=0]="Fill",a[a.Outline=1]="Outline",a[a.FillAndOutline=2]="FillAndOutline",a[a.Invisible=3]="Invisible",a[a.FillAndClip=4]="FillAndClip",a[a.OutlineAndClip=5]="OutlineAndClip",a[a.FillAndOutlineAndClip=6]="FillAndOutlineAndClip",a[a.Clip=7]="Clip"})(TextRenderingMode||(TextRenderingMode={}));var colorString$1={exports:{}},colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},simpleSwizzle={exports:{}},isArrayish$1=function a(s){return!s||typeof s=="string"?!1:s instanceof Array||Array.isArray(s)||s.length>=0&&(s.splice instanceof Function||Object.getOwnPropertyDescriptor(s,s.length-1)&&s.constructor.name!=="String")},isArrayish=isArrayish$1,concat=Array.prototype.concat,slice$1=Array.prototype.slice,swizzle$1=simpleSwizzle.exports=function a(s){for(var $=[],_=0,_e=s.length;_<_e;_++){var tt=s[_];isArrayish(tt)?$=concat.call($,slice$1.call(tt)):$.push(tt)}return $};swizzle$1.wrap=function(a){return function(){return a(swizzle$1(arguments))}};var simpleSwizzleExports=simpleSwizzle.exports,colorNames=colorName,swizzle=simpleSwizzleExports,hasOwnProperty$f=Object.hasOwnProperty,reverseNames=Object.create(null);for(var name in colorNames)hasOwnProperty$f.call(colorNames,name)&&(reverseNames[colorNames[name]]=name);var cs=colorString$1.exports={to:{},get:{}};cs.get=function(a){var s=a.substring(0,3).toLowerCase(),$,_;switch(s){case"hsl":$=cs.get.hsl(a),_="hsl";break;case"hwb":$=cs.get.hwb(a),_="hwb";break;default:$=cs.get.rgb(a),_="rgb";break}return $?{model:_,value:$}:null},cs.get.rgb=function(a){if(!a)return null;var s=/^#([a-f0-9]{3,4})$/i,$=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,_=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,_e=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,tt=/^(\w+)$/,nt=[0,0,0,1],at,ot,rt;if(at=a.match($)){for(rt=at[2],at=at[1],ot=0;ot<3;ot++){var st=ot*2;nt[ot]=parseInt(at.slice(st,st+2),16)}rt&&(nt[3]=parseInt(rt,16)/255)}else if(at=a.match(s)){for(at=at[1],rt=at[3],ot=0;ot<3;ot++)nt[ot]=parseInt(at[ot]+at[ot],16);rt&&(nt[3]=parseInt(rt+rt,16)/255)}else if(at=a.match(_)){for(ot=0;ot<3;ot++)nt[ot]=parseInt(at[ot+1],0);at[4]&&(at[5]?nt[3]=parseFloat(at[4])*.01:nt[3]=parseFloat(at[4]))}else if(at=a.match(_e)){for(ot=0;ot<3;ot++)nt[ot]=Math.round(parseFloat(at[ot+1])*2.55);at[4]&&(at[5]?nt[3]=parseFloat(at[4])*.01:nt[3]=parseFloat(at[4]))}else return(at=a.match(tt))?at[1]==="transparent"?[0,0,0,0]:hasOwnProperty$f.call(colorNames,at[1])?(nt=colorNames[at[1]],nt[3]=1,nt):null:null;for(ot=0;ot<3;ot++)nt[ot]=clamp(nt[ot],0,255);return nt[3]=clamp(nt[3],0,1),nt},cs.get.hsl=function(a){if(!a)return null;var s=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,$=a.match(s);if($){var _=parseFloat($[4]),_e=(parseFloat($[1])%360+360)%360,tt=clamp(parseFloat($[2]),0,100),nt=clamp(parseFloat($[3]),0,100),at=clamp(isNaN(_)?1:_,0,1);return[_e,tt,nt,at]}return null},cs.get.hwb=function(a){if(!a)return null;var s=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,$=a.match(s);if($){var _=parseFloat($[4]),_e=(parseFloat($[1])%360+360)%360,tt=clamp(parseFloat($[2]),0,100),nt=clamp(parseFloat($[3]),0,100),at=clamp(isNaN(_)?1:_,0,1);return[_e,tt,nt,at]}return null},cs.to.hex=function(){var a=swizzle(arguments);return"#"+hexDouble(a[0])+hexDouble(a[1])+hexDouble(a[2])+(a[3]<1?hexDouble(Math.round(a[3]*255)):"")},cs.to.rgb=function(){var a=swizzle(arguments);return a.length<4||a[3]===1?"rgb("+Math.round(a[0])+", "+Math.round(a[1])+", "+Math.round(a[2])+")":"rgba("+Math.round(a[0])+", "+Math.round(a[1])+", "+Math.round(a[2])+", "+a[3]+")"},cs.to.rgb.percent=function(){var a=swizzle(arguments),s=Math.round(a[0]/255*100),$=Math.round(a[1]/255*100),_=Math.round(a[2]/255*100);return a.length<4||a[3]===1?"rgb("+s+"%, "+$+"%, "+_+"%)":"rgba("+s+"%, "+$+"%, "+_+"%, "+a[3]+")"},cs.to.hsl=function(){var a=swizzle(arguments);return a.length<4||a[3]===1?"hsl("+a[0]+", "+a[1]+"%, "+a[2]+"%)":"hsla("+a[0]+", "+a[1]+"%, "+a[2]+"%, "+a[3]+")"},cs.to.hwb=function(){var a=swizzle(arguments),s="";return a.length>=4&&a[3]!==1&&(s=", "+a[3]),"hwb("+a[0]+", "+a[1]+"%, "+a[2]+"%"+s+")"},cs.to.keyword=function(a){return reverseNames[a.slice(0,3)]};function clamp(a,s,$){return Math.min(Math.max(s,a),$)}function hexDouble(a){var s=Math.round(a).toString(16).toUpperCase();return s.length<2?"0"+s:s}var colorStringExports=colorString$1.exports,ColorTypes;(function(a){a.Grayscale="Grayscale",a.RGB="RGB",a.CMYK="CMYK"})(ColorTypes||(ColorTypes={}));const rgb=(a,s,$)=>(assertRange(a,"red",0,1),assertRange(s,"green",0,1),assertRange($,"blue",0,1),{type:ColorTypes.RGB,red:a,green:s,blue:$}),cmyk=(a,s,$,_)=>(assertRange(a,"cyan",0,1),assertRange(s,"magenta",0,1),assertRange($,"yellow",0,1),assertRange(_,"key",0,1),{type:ColorTypes.CMYK,cyan:a,magenta:s,yellow:$,key:_});var TextAlignment;(function(a){a[a.Left=0]="Left",a[a.Center=1]="Center",a[a.Right=2]="Right"})(TextAlignment||(TextAlignment={}));var ImageAlignment;(function(a){a[a.Left=0]="Left",a[a.Center=1]="Center",a[a.Right=2]="Right"})(ImageAlignment||(ImageAlignment={}));var StandardFonts;(function(a){a.Courier="Courier",a.CourierBold="Courier-Bold",a.CourierOblique="Courier-Oblique",a.CourierBoldOblique="Courier-BoldOblique",a.Helvetica="Helvetica",a.HelveticaBold="Helvetica-Bold",a.HelveticaOblique="Helvetica-Oblique",a.HelveticaBoldOblique="Helvetica-BoldOblique",a.TimesRoman="Times-Roman",a.TimesRomanBold="Times-Bold",a.TimesRomanItalic="Times-Italic",a.TimesRomanBoldItalic="Times-BoldItalic",a.Symbol="Symbol",a.ZapfDingbats="ZapfDingbats"})(StandardFonts||(StandardFonts={}));var ParseSpeeds;(function(a){a[a.Fastest=1/0]="Fastest",a[a.Fast=1500]="Fast",a[a.Medium=500]="Medium",a[a.Slow=100]="Slow"})(ParseSpeeds||(ParseSpeeds={}));var BlendMode;(function(a){a.Normal="Normal",a.Multiply="Multiply",a.Screen="Screen",a.Overlay="Overlay",a.Darken="Darken",a.Lighten="Lighten",a.ColorDodge="ColorDodge",a.ColorBurn="ColorBurn",a.HardLight="HardLight",a.SoftLight="SoftLight",a.Difference="Difference",a.Exclusion="Exclusion"})(BlendMode||(BlendMode={}));var dist={},lib$2={},namedReferences={};Object.defineProperty(namedReferences,"__esModule",{value:!0}),namedReferences.bodyRegExps={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},namedReferences.namedReferences={xml:{entities:{"<":"<",">":">",""":'"',"'":"'","&":"&"},characters:{"<":"<",">":">",'"':""","'":"'","&":"&"}},html4:{entities:{"'":"'"," ":" "," ":" ","¡":"¡","¡":"¡","¢":"¢","¢":"¢","£":"£","£":"£","¤":"¤","¤":"¤","¥":"¥","¥":"¥","¦":"¦","¦":"¦","§":"§","§":"§","¨":"¨","¨":"¨","©":"©","©":"©","ª":"ª","ª":"ª","«":"«","«":"«","¬":"¬","¬":"¬","­":"","­":"","®":"®","®":"®","¯":"¯","¯":"¯","°":"°","°":"°","±":"±","±":"±","²":"²","²":"²","³":"³","³":"³","´":"´","´":"´","µ":"µ","µ":"µ","¶":"¶","¶":"¶","·":"·","·":"·","¸":"¸","¸":"¸","¹":"¹","¹":"¹","º":"º","º":"º","»":"»","»":"»","¼":"¼","¼":"¼","½":"½","½":"½","¾":"¾","¾":"¾","¿":"¿","¿":"¿","À":"À","À":"À","Á":"Á","Á":"Á","Â":"Â","Â":"Â","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","Å":"Å","Å":"Å","Æ":"Æ","Æ":"Æ","Ç":"Ç","Ç":"Ç","È":"È","È":"È","É":"É","É":"É","Ê":"Ê","Ê":"Ê","Ë":"Ë","Ë":"Ë","Ì":"Ì","Ì":"Ì","Í":"Í","Í":"Í","Î":"Î","Î":"Î","Ï":"Ï","Ï":"Ï","Ð":"Ð","Ð":"Ð","Ñ":"Ñ","Ñ":"Ñ","Ò":"Ò","Ò":"Ò","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","Õ":"Õ","Õ":"Õ","Ö":"Ö","Ö":"Ö","×":"×","×":"×","Ø":"Ø","Ø":"Ø","Ù":"Ù","Ù":"Ù","Ú":"Ú","Ú":"Ú","Û":"Û","Û":"Û","Ü":"Ü","Ü":"Ü","Ý":"Ý","Ý":"Ý","Þ":"Þ","Þ":"Þ","ß":"ß","ß":"ß","à":"à","à":"à","á":"á","á":"á","â":"â","â":"â","ã":"ã","ã":"ã","ä":"ä","ä":"ä","å":"å","å":"å","æ":"æ","æ":"æ","ç":"ç","ç":"ç","è":"è","è":"è","é":"é","é":"é","ê":"ê","ê":"ê","ë":"ë","ë":"ë","ì":"ì","ì":"ì","í":"í","í":"í","î":"î","î":"î","ï":"ï","ï":"ï","ð":"ð","ð":"ð","ñ":"ñ","ñ":"ñ","ò":"ò","ò":"ò","ó":"ó","ó":"ó","ô":"ô","ô":"ô","õ":"õ","õ":"õ","ö":"ö","ö":"ö","÷":"÷","÷":"÷","ø":"ø","ø":"ø","ù":"ù","ù":"ù","ú":"ú","ú":"ú","û":"û","û":"û","ü":"ü","ü":"ü","ý":"ý","ý":"ý","þ":"þ","þ":"þ","ÿ":"ÿ","ÿ":"ÿ",""":'"',""":'"',"&":"&","&":"&","<":"<","<":"<",">":">",">":">","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"","‍":"","‎":"","‏":"","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€","ƒ":"ƒ","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},characters:{"'":"'"," ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©",ª:"ª","«":"«","¬":"¬","":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´",µ:"µ","¶":"¶","·":"·","¸":"¸","¹":"¹",º:"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿",À:"À",Á:"Á",Â:"Â",Ã:"Ã",Ä:"Ä",Å:"Å",Æ:"Æ",Ç:"Ç",È:"È",É:"É",Ê:"Ê",Ë:"Ë",Ì:"Ì",Í:"Í",Î:"Î",Ï:"Ï",Ð:"Ð",Ñ:"Ñ",Ò:"Ò",Ó:"Ó",Ô:"Ô",Õ:"Õ",Ö:"Ö","×":"×",Ø:"Ø",Ù:"Ù",Ú:"Ú",Û:"Û",Ü:"Ü",Ý:"Ý",Þ:"Þ",ß:"ß",à:"à",á:"á",â:"â",ã:"ã",ä:"ä",å:"å",æ:"æ",ç:"ç",è:"è",é:"é",ê:"ê",ë:"ë",ì:"ì",í:"í",î:"î",ï:"ï",ð:"ð",ñ:"ñ",ò:"ò",ó:"ó",ô:"ô",õ:"õ",ö:"ö","÷":"÷",ø:"ø",ù:"ù",ú:"ú",û:"û",ü:"ü",ý:"ý",þ:"þ",ÿ:"ÿ",'"':""","&":"&","<":"<",">":">",Œ:"Œ",œ:"œ",Š:"Š",š:"š",Ÿ:"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","":"‌","":"‍","":"‎","":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€",ƒ:"ƒ",Α:"Α",Β:"Β",Γ:"Γ",Δ:"Δ",Ε:"Ε",Ζ:"Ζ",Η:"Η",Θ:"Θ",Ι:"Ι",Κ:"Κ",Λ:"Λ",Μ:"Μ",Ν:"Ν",Ξ:"Ξ",Ο:"Ο",Π:"Π",Ρ:"Ρ",Σ:"Σ",Τ:"Τ",Υ:"Υ",Φ:"Φ",Χ:"Χ",Ψ:"Ψ",Ω:"Ω",α:"α",β:"β",γ:"γ",δ:"δ",ε:"ε",ζ:"ζ",η:"η",θ:"θ",ι:"ι",κ:"κ",λ:"λ",μ:"μ",ν:"ν",ξ:"ξ",ο:"ο",π:"π",ρ:"ρ",ς:"ς",σ:"σ",τ:"τ",υ:"υ",φ:"φ",χ:"χ",ψ:"ψ",ω:"ω",ϑ:"ϑ",ϒ:"ϒ",ϖ:"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘",ℑ:"ℑ",ℜ:"ℜ","™":"™",ℵ:"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","〈":"⟨","〉":"⟩","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"}},html5:{entities:{"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"","⁢":"","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"","​":"","​":"","​":"","≫":"≫","≪":"≪","
":`
|
126
126
|
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""},characters:{Æ:"Æ","&":"&",Á:"Á",Ă:"Ă",Â:"Â",А:"А","𝔄":"𝔄",À:"À",Α:"Α",Ā:"Ā","⩓":"⩓",Ą:"Ą","𝔸":"𝔸","":"⁡",Å:"Å","𝒜":"𝒜","≔":"≔",Ã:"Ã",Ä:"Ä","∖":"∖","⫧":"⫧","⌆":"⌆",Б:"Б","∵":"∵",ℬ:"ℬ",Β:"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","≎":"≎",Ч:"Ч","©":"©",Ć:"Ć","⋒":"⋒","ⅅ":"ⅅ",ℭ:"ℭ",Č:"Č",Ç:"Ç",Ĉ:"Ĉ","∰":"∰",Ċ:"Ċ","¸":"¸","·":"·",Χ:"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮",ℂ:"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","⤑":"⤑",Ђ:"Ђ",Ѕ:"Ѕ",Џ:"Џ","‡":"‡","↡":"↡","⫤":"⫤",Ď:"Ď",Д:"Д","∇":"∇",Δ:"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","⇓":"⇓","⇐":"⇐","⇔":"⇔","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","𝒟":"𝒟",Đ:"Đ",Ŋ:"Ŋ",Ð:"Ð",É:"É",Ě:"Ě",Ê:"Ê",Э:"Э",Ė:"Ė","𝔈":"𝔈",È:"È","∈":"∈",Ē:"Ē","◻":"◻","▫":"▫",Ę:"Ę","𝔼":"𝔼",Ε:"Ε","⩵":"⩵","≂":"≂","⇌":"⇌",ℰ:"ℰ","⩳":"⩳",Η:"Η",Ë:"Ë","∃":"∃","ⅇ":"ⅇ",Ф:"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀",ℱ:"ℱ",Ѓ:"Ѓ",">":">",Γ:"Γ",Ϝ:"Ϝ",Ğ:"Ğ",Ģ:"Ģ",Ĝ:"Ĝ",Г:"Г",Ġ:"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫",Ъ:"Ъ","ˇ":"ˇ","^":"^",Ĥ:"Ĥ",ℌ:"ℌ",ℋ:"ℋ",ℍ:"ℍ","─":"─",Ħ:"Ħ","≏":"≏",Е:"Е",IJ:"IJ",Ё:"Ё",Í:"Í",Î:"Î",И:"И",İ:"İ",ℑ:"ℑ",Ì:"Ì",Ī:"Ī","ⅈ":"ⅈ","∬":"∬","∫":"∫","⋂":"⋂","":"⁣","":"⁢",Į:"Į","𝕀":"𝕀",Ι:"Ι",ℐ:"ℐ",Ĩ:"Ĩ",І:"І",Ï:"Ï",Ĵ:"Ĵ",Й:"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥",Ј:"Ј",Є:"Є",Х:"Х",Ќ:"Ќ",Κ:"Κ",Ķ:"Ķ",К:"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦",Љ:"Љ","<":"<",Ĺ:"Ĺ",Λ:"Λ","⟪":"⟪",ℒ:"ℒ","↞":"↞",Ľ:"Ľ",Ļ:"Ļ",Л:"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚",Ŀ:"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","𝕃":"𝕃","↙":"↙","↘":"↘","↰":"↰",Ł:"Ł","≪":"≪","⤅":"⤅",М:"М"," ":" ",ℳ:"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄",Μ:"Μ",Њ:"Њ",Ń:"Ń",Ň:"Ň",Ņ:"Ņ",Н:"Н","":"​","\n":"
","𝔑":"𝔑","":"⁠"," ":" ",ℕ:"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩",Ñ:"Ñ",Ν:"Ν",Œ:"Œ",Ó:"Ó",Ô:"Ô",О:"О",Ő:"Ő","𝔒":"𝔒",Ò:"Ò",Ō:"Ō",Ω:"Ω",Ο:"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪",Ø:"Ø",Õ:"Õ","⨷":"⨷",Ö:"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂",П:"П","𝔓":"𝔓",Φ:"Φ",Π:"Π","±":"±",ℙ:"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∝":"∝","𝒫":"𝒫",Ψ:"Ψ",'"':""","𝔔":"𝔔",ℚ:"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®",Ŕ:"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖",Ř:"Ř",Ŗ:"Ŗ",Р:"Р",ℜ:"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯",Ρ:"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓",ℝ:"ℝ","⥰":"⥰","⇛":"⇛",ℛ:"ℛ","↱":"↱","⧴":"⧴",Щ:"Щ",Ш:"Ш",Ь:"Ь",Ś:"Ś","⪼":"⪼",Š:"Š",Ş:"Ş",Ŝ:"Ŝ",С:"С","𝔖":"𝔖","↑":"↑",Σ:"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇",Þ:"Þ","™":"™",Ћ:"Ћ",Ц:"Ц"," ":"	",Τ:"Τ",Ť:"Ť",Ţ:"Ţ",Т:"Т","𝔗":"𝔗","∴":"∴",Θ:"Θ"," ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯",Ŧ:"Ŧ",Ú:"Ú","↟":"↟","⥉":"⥉",Ў:"Ў",Ŭ:"Ŭ",Û:"Û",У:"У",Ű:"Ű","𝔘":"𝔘",Ù:"Ù",Ū:"Ū",_:"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎",Ų:"Ų","𝕌":"𝕌","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","↖":"↖","↗":"↗",ϒ:"ϒ",Υ:"Υ",Ů:"Ů","𝒰":"𝒰",Ũ:"Ũ",Ü:"Ü","⊫":"⊫","⫫":"⫫",В:"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪",Ŵ:"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛",Ξ:"Ξ","𝕏":"𝕏","𝒳":"𝒳",Я:"Я",Ї:"Ї",Ю:"Ю",Ý:"Ý",Ŷ:"Ŷ",Ы:"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴",Ÿ:"Ÿ",Ж:"Ж",Ź:"Ź",Ž:"Ž",З:"З",Ż:"Ż",Ζ:"Ζ",ℨ:"ℨ",ℤ:"ℤ","𝒵":"𝒵",á:"á",ă:"ă","∾":"∾","∾̳":"∾̳","∿":"∿",â:"â",а:"а",æ:"æ","𝔞":"𝔞",à:"à",ℵ:"ℵ",α:"α",ā:"ā","⨿":"⨿","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","⍼":"⍼",ą:"ą","𝕒":"𝕒","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'",å:"å","𝒶":"𝒶","*":"*",ã:"ã",ä:"ä","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⎶":"⎶",б:"б","„":"„","⦰":"⦰",β:"β",ℶ:"ℶ","≬":"≬","𝔟":"𝔟","◯":"◯","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⤍":"⤍","⧫":"⧫","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","¦":"¦","𝒷":"𝒷","⁏":"⁏","\\":"\","⧅":"⧅","⟈":"⟈","•":"•","⪮":"⪮",ć:"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","⩍":"⩍",č:"č",ç:"ç",ĉ:"ĉ","⩌":"⩌","⩐":"⩐",ċ:"ċ","⦲":"⦲","¢":"¢","𝔠":"𝔠",ч:"ч","✓":"✓",χ:"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣",":":":",",":",","@":"@","∁":"∁","⩭":"⩭","𝕔":"𝕔","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋎":"⋎","⋏":"⋏","¤":"¤","∱":"∱","⌭":"⌭","⥥":"⥥","†":"†",ℸ:"ℸ","‐":"‐","⤏":"⤏",ď:"ď",д:"д","⇊":"⇊","⩷":"⩷","°":"°",δ:"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","♦":"♦",ϝ:"ϝ","⋲":"⋲","÷":"÷","⋇":"⋇",ђ:"ђ","⌞":"⌞","⌍":"⌍",$:"$","𝕕":"𝕕","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌟":"⌟","⌌":"⌌","𝒹":"𝒹",ѕ:"ѕ","⧶":"⧶",đ:"đ","⋱":"⋱","▿":"▿","⦦":"⦦",џ:"џ","⟿":"⟿",é:"é","⩮":"⩮",ě:"ě","≖":"≖",ê:"ê","≕":"≕",э:"э",ė:"ė","≒":"≒","𝔢":"𝔢","⪚":"⪚",è:"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧",ℓ:"ℓ","⪕":"⪕","⪗":"⪗",ē:"ē","∅":"∅"," ":" "," ":" "," ":" ",ŋ:"ŋ"," ":" ",ę:"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱",ε:"ε","ϵ":"ϵ","=":"=","≟":"≟","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱",ℯ:"ℯ",η:"η",ð:"ð",ë:"ë","€":"€","!":"!",ф:"ф","♀":"♀",ffi:"ffi",ff:"ff",ffl:"ffl","𝔣":"𝔣",fi:"fi",fj:"fj","♭":"♭",fl:"fl","▱":"▱",ƒ:"ƒ","𝕗":"𝕗","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","⅓":"⅓","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","⪌":"⪌",ǵ:"ǵ",γ:"γ","⪆":"⪆",ğ:"ğ",ĝ:"ĝ",г:"г",ġ:"ġ","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤",ℷ:"ℷ",ѓ:"ѓ","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪈":"⪈","⋧":"⋧","𝕘":"𝕘",ℊ:"ℊ","⪎":"⪎","⪐":"⪐","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⥸":"⥸","≩︀":"≩︀",ъ:"ъ","⥈":"⥈","↭":"↭",ℏ:"ℏ",ĥ:"ĥ","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽",ħ:"ħ","⁃":"⁃",í:"í",î:"î",и:"и",е:"е","¡":"¡","𝔦":"𝔦",ì:"ì","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩",ij:"ij",ī:"ī",ı:"ı","⊷":"⊷",Ƶ:"Ƶ","℅":"℅","∞":"∞","⧝":"⧝","⊺":"⊺","⨗":"⨗","⨼":"⨼",ё:"ё",į:"į","𝕚":"𝕚",ι:"ι","¿":"¿","𝒾":"𝒾","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳",ĩ:"ĩ",і:"і",ï:"ï",ĵ:"ĵ",й:"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿",ј:"ј",є:"є",κ:"κ",ϰ:"ϰ",ķ:"ķ",к:"к","𝔨":"𝔨",ĸ:"ĸ",х:"х",ќ:"ќ","𝕜":"𝕜","𝓀":"𝓀","⤛":"⤛","⤎":"⤎","⪋":"⪋","⥢":"⥢",ĺ:"ĺ","⦴":"⦴",λ:"λ","⦑":"⦑","⪅":"⪅","«":"«","⤟":"⤟","⤝":"⤝","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍",ľ:"ľ",ļ:"ļ",л:"л","⤶":"⤶","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","⇇":"⇇","⋋":"⋋","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⋖":"⋖","⥼":"⥼","𝔩":"𝔩","⪑":"⪑","⥪":"⥪","▄":"▄",љ:"љ","⥫":"⥫","◺":"◺",ŀ:"ŀ","⎰":"⎰","≨":"≨","⪉":"⪉","⪇":"⪇","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟼":"⟼","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","◊":"◊","(":"(","⦓":"⦓","⥭":"⥭","":"‎","⊿":"⊿","‹":"‹","𝓁":"𝓁","⪍":"⪍","⪏":"⪏","‚":"‚",ł:"ł","⪦":"⪦","⩹":"⩹","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","∺":"∺","¯":"¯","♂":"♂","✠":"✠","▮":"▮","⨩":"⨩",м:"м","—":"—","𝔪":"𝔪","℧":"℧",µ:"µ","⫰":"⫰","−":"−","⨪":"⨪","⫛":"⫛","⊧":"⊧","𝕞":"𝕞","𝓂":"𝓂",μ:"μ","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","⇏":"⇏","⊯":"⊯","⊮":"⊮",ń:"ń","∠⃒":"∠⃒","⩰̸":"⩰̸","≋̸":"≋̸",ʼn:"ʼn","♮":"♮","⩃":"⩃",ň:"ň",ņ:"ņ","⩭̸":"⩭̸","⩂":"⩂",н:"н","–":"–","⇗":"⇗","⤤":"⤤","≐̸":"≐̸","⤨":"⤨","𝔫":"𝔫","↮":"↮","⫲":"⫲","⋼":"⋼","⋺":"⋺",њ:"њ","≦̸":"≦̸","↚":"↚","‥":"‥","𝕟":"𝕟","¬":"¬","⋹̸":"⋹̸","⋵̸":"⋵̸","⋷":"⋷","⋶":"⋶","⋾":"⋾","⋽":"⋽","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","𝓃":"𝓃","⊄":"⊄","⫅̸":"⫅̸","⊅":"⊅","⫆̸":"⫆̸",ñ:"ñ",ν:"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","⤧":"⤧",ó:"ó",ô:"ô",о:"о",ő:"ő","⨸":"⨸","⦼":"⦼",œ:"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛",ò:"ò","⧁":"⧁","⦵":"⦵","⦾":"⦾","⦻":"⦻","⧀":"⧀",ō:"ō",ω:"ω",ο:"ο","⦶":"⦶","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","∨":"∨","⩝":"⩝",ℴ:"ℴ",ª:"ª",º:"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛",ø:"ø","⊘":"⊘",õ:"õ","⨶":"⨶",ö:"ö","⌽":"⌽","¶":"¶","⫳":"⫳","⫽":"⫽",п:"п","%":"%",".":".","‰":"‰","‱":"‱","𝔭":"𝔭",φ:"φ",ϕ:"ϕ","☎":"☎",π:"π",ϖ:"ϖ",ℎ:"ℎ","+":"+","⨣":"⨣","⨢":"⨢","⨥":"⨥","⩲":"⩲","⨦":"⨦","⨧":"⨧","⨕":"⨕","𝕡":"𝕡","£":"£","⪳":"⪳","⪷":"⪷","⪹":"⪹","⪵":"⪵","⋨":"⋨","′":"′","⌮":"⌮","⌒":"⌒","⌓":"⌓","⊰":"⊰","𝓅":"𝓅",ψ:"ψ"," ":" ","𝔮":"𝔮","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","⨖":"⨖","?":"?","⤜":"⤜","⥤":"⥤","∽̱":"∽̱",ŕ:"ŕ","⦳":"⦳","⦒":"⦒","⦥":"⦥","»":"»","⥵":"⥵","⤠":"⤠","⤳":"⤳","⤞":"⤞","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐",ř:"ř",ŗ:"ŗ",р:"р","⤷":"⤷","⥩":"⥩","↳":"↳","▭":"▭","⥽":"⥽","𝔯":"𝔯","⥬":"⥬",ρ:"ρ",ϱ:"ϱ","⇉":"⇉","⋌":"⋌","˚":"˚","":"‏","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","›":"›","𝓇":"𝓇","⋊":"⋊","▹":"▹","⧎":"⧎","⥨":"⥨","℞":"℞",ś:"ś","⪴":"⪴","⪸":"⪸",š:"š",ş:"ş",ŝ:"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓",с:"с","⋅":"⋅","⩦":"⩦","⇘":"⇘","§":"§",";":";","⤩":"⤩","✶":"✶","𝔰":"𝔰","♯":"♯",щ:"щ",ш:"ш","":"­",σ:"σ",ς:"ς","⩪":"⩪","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","⨳":"⨳","⧤":"⧤","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀",ь:"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","⊓︀":"⊓︀","⊔︀":"⊔︀","𝓈":"𝓈","☆":"☆","⊂":"⊂","⫅":"⫅","⪽":"⪽","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⫇":"⫇","⫕":"⫕","⫓":"⫓","♪":"♪","¹":"¹","²":"²","³":"³","⫆":"⫆","⪾":"⪾","⫘":"⫘","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤪":"⤪",ß:"ß","⌖":"⌖",τ:"τ",ť:"ť",ţ:"ţ",т:"т","⌕":"⌕","𝔱":"𝔱",θ:"θ",ϑ:"ϑ",þ:"þ","×":"×","⨱":"⨱","⨰":"⨰","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","‴":"‴","▵":"▵","≜":"≜","◬":"◬","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉",ц:"ц",ћ:"ћ",ŧ:"ŧ","⥣":"⥣",ú:"ú",ў:"ў",ŭ:"ŭ",û:"û",у:"у",ű:"ű","⥾":"⥾","𝔲":"𝔲",ù:"ù","▀":"▀","⌜":"⌜","⌏":"⌏","◸":"◸",ū:"ū",ų:"ų","𝕦":"𝕦",υ:"υ","⇈":"⇈","⌝":"⌝","⌎":"⌎",ů:"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰",ũ:"ũ",ü:"ü","⦧":"⦧","⫨":"⫨","⫩":"⫩","⦜":"⦜","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀",в:"в","⊻":"⊻","≚":"≚","⋮":"⋮","𝔳":"𝔳","𝕧":"𝕧","𝓋":"𝓋","⦚":"⦚",ŵ:"ŵ","⩟":"⩟","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","𝓌":"𝓌","𝔵":"𝔵",ξ:"ξ","⋻":"⋻","𝕩":"𝕩","𝓍":"𝓍",ý:"ý",я:"я",ŷ:"ŷ",ы:"ы","¥":"¥","𝔶":"𝔶",ї:"ї","𝕪":"𝕪","𝓎":"𝓎",ю:"ю",ÿ:"ÿ",ź:"ź",ž:"ž",з:"з",ż:"ż",ζ:"ζ","𝔷":"𝔷",ж:"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","":"‍","":"‌"}}};var numericUnicodeMap={};Object.defineProperty(numericUnicodeMap,"__esModule",{value:!0}),numericUnicodeMap.numericUnicodeMap={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var surrogatePairs={};Object.defineProperty(surrogatePairs,"__esModule",{value:!0}),surrogatePairs.fromCodePoint=String.fromCodePoint||function(a){return String.fromCharCode(Math.floor((a-65536)/1024)+55296,(a-65536)%1024+56320)},surrogatePairs.getCodePoint=String.prototype.codePointAt?function(a,s){return a.codePointAt(s)}:function(a,s){return(a.charCodeAt(s)-55296)*1024+a.charCodeAt(s+1)-56320+65536},surrogatePairs.highSurrogateFrom=55296,surrogatePairs.highSurrogateTo=56319;var __assign$9=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign$9=Object.assign||function(a){for(var s,$=1,_=arguments.length;$<_;$++){s=arguments[$];for(var _e in s)Object.prototype.hasOwnProperty.call(s,_e)&&(a[_e]=s[_e])}return a},__assign$9.apply(this,arguments)};Object.defineProperty(lib$2,"__esModule",{value:!0});var named_references_1=namedReferences,numeric_unicode_map_1=numericUnicodeMap,surrogate_pairs_1=surrogatePairs,allNamedReferences=__assign$9(__assign$9({},named_references_1.namedReferences),{all:named_references_1.namedReferences.html5}),encodeRegExps={specialChars:/[<>'"&]/g,nonAscii:/[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintable:/[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintableOnly:/[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,extensive:/[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g},defaultEncodeOptions={mode:"specialChars",level:"all",numeric:"decimal"};function encode(a,s){var st=s===void 0?defaultEncodeOptions:s,lt=st.mode,$=lt===void 0?"specialChars":lt,_=st.numeric,_e=_===void 0?"decimal":_,tt=st.level,nt=tt===void 0?"all":tt;if(!a)return"";var at=encodeRegExps[$],ot=allNamedReferences[nt].characters,rt=_e==="hexadecimal";at.lastIndex=0;var st=at.exec(a),lt;if(st){lt="";var _=0;do{_!==st.index&&(lt+=a.substring(_,st.index));var tt=st[0],et=ot[tt];if(!et){var it=tt.length>1?surrogate_pairs_1.getCodePoint(tt,0):tt.charCodeAt(0);et=(rt?"&#x"+it.toString(16):"&#"+it)+";"}lt+=et,_=st.index+tt.length}while(st=at.exec(a));_!==a.length&&(lt+=a.substring(_))}else lt=a;return lt}lib$2.encode=encode;var defaultDecodeOptions={scope:"body",level:"all"},strict=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,attribute=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,baseDecodeRegExps={xml:{strict,attribute,body:named_references_1.bodyRegExps.xml},html4:{strict,attribute,body:named_references_1.bodyRegExps.html4},html5:{strict,attribute,body:named_references_1.bodyRegExps.html5}},decodeRegExps=__assign$9(__assign$9({},baseDecodeRegExps),{all:baseDecodeRegExps.html5}),fromCharCode=String.fromCharCode,outOfBoundsChar=fromCharCode(65533),defaultDecodeEntityOptions={level:"all"};function decodeEntity(a,s){var _=(s===void 0?defaultDecodeEntityOptions:s).level,$=_===void 0?"all":_;if(!a)return"";var _=a;a[a.length-1];{var _e=allNamedReferences[$].entities[a];if(_e)_=_e;else if(a[0]==="&"&&a[1]==="#"){var tt=a[2],nt=tt=="x"||tt=="X"?parseInt(a.substr(3),16):parseInt(a.substr(2));_=nt>=1114111?outOfBoundsChar:nt>65535?surrogate_pairs_1.fromCodePoint(nt):fromCharCode(numeric_unicode_map_1.numericUnicodeMap[nt]||nt)}}return _}lib$2.decodeEntity=decodeEntity;function decode(a,s){var $=s===void 0?defaultDecodeOptions:s,_=$.level,_e=_===void 0?"all":_,tt=$.scope,nt=tt===void 0?_e==="xml"?"strict":"body":tt;if(!a)return"";var at=decodeRegExps[_e][nt],ot=allNamedReferences[_e].entities,rt=nt==="attribute",st=nt==="strict";at.lastIndex=0;var lt=at.exec(a),et;if(lt){et="";var it=0;do{it!==lt.index&&(et+=a.substring(it,lt.index));var ut=lt[0],ft=ut,ht=ut[ut.length-1];if(rt&&ht==="=")ft=ut;else if(st&&ht!==";")ft=ut;else{var dt=ot[ut];if(dt)ft=dt;else if(ut[0]==="&"&&ut[1]==="#"){var gt=ut[2],pt=gt=="x"||gt=="X"?parseInt(ut.substr(3),16):parseInt(ut.substr(2));ft=pt>=1114111?outOfBoundsChar:pt>65535?surrogate_pairs_1.fromCodePoint(pt):fromCharCode(numeric_unicode_map_1.numericUnicodeMap[pt]||pt)}}et+=ft,it=lt.index+ut.length}while(lt=at.exec(a));it!==a.length&&(et+=a.substring(it))}else et=a;return et}lib$2.decode=decode,function(a){var s=commonjsGlobal&&commonjsGlobal.__extends||function(){var At=function(xt,bt){return At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Et,St){Et.__proto__=St}||function(Et,St){for(var Dt in St)Object.prototype.hasOwnProperty.call(St,Dt)&&(Et[Dt]=St[Dt])},At(xt,bt)};return function(xt,bt){if(typeof bt!="function"&&bt!==null)throw new TypeError("Class extends value "+String(bt)+" is not a constructor or null");At(xt,bt);function Et(){this.constructor=xt}xt.prototype=bt===null?Object.create(bt):(Et.prototype=bt.prototype,new Et)}}();Object.defineProperty(a,"__esModule",{value:!0}),a.isBlock=a.parse=a.Matcher=a.HTMLElement=a.CommentNode=a.TextNode=a.AbstractNode=a.NodeType=void 0;var $=lib$2,_;(function(At){At[At.ELEMENT_NODE=1]="ELEMENT_NODE",At[At.TEXT_NODE=3]="TEXT_NODE",At[At.COMMENT_NODE=8]="COMMENT_NODE"})(_=a.NodeType||(a.NodeType={}));var _e=function(){function At(){this.childNodes=[]}return Object.defineProperty(At.prototype,"text",{get:function(){return(0,$.decode)(this.rawText)},enumerable:!1,configurable:!0}),At.prototype.remove=function(){return this.parentNode&&this.parentNode.removeChild(this),this},At}();a.AbstractNode=_e;var tt=function(At){s(xt,At);function xt(bt){var Et=At.call(this)||this;return Et.nodeType=_.TEXT_NODE,Et.value=bt,Et}return Object.defineProperty(xt.prototype,"rawText",{get:function(){return this.value},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){return this.rawText},xt}(_e);a.TextNode=tt;var nt=function(At){s(xt,At);function xt(bt){var Et=At.call(this)||this;return Et.nodeType=_.COMMENT_NODE,Et.value=bt,Et}return Object.defineProperty(xt.prototype,"rawText",{get:function(){return this.value},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){return"<!--".concat(this.rawText,"-->")},xt}(_e);a.CommentNode=nt;var at={div:!0,p:!0,li:!0,td:!0,section:!0,br:!0};function ot(At){return At[At.length-1]}var rt=function(At){s(xt,At);function xt(bt,Et,St){Et===void 0&&(Et=""),St===void 0&&(St=null);var Dt=At.call(this)||this;Dt.tagName=bt,Dt.rawAttrs=Et,Dt.classNames=[],Dt.nodeType=_.ELEMENT_NODE,Dt.rawAttrs=Et,Dt.parentNode=St,Dt.childNodes=[];for(var Rt={},Tt=void 0;Tt=ut.exec(Et);)Rt[Tt[2]]=Tt[4]||Tt[5]||Tt[6];return Rt.id&&(Dt.id=Rt.id),Rt.class&&(Dt.classNames=Rt.class.split(/\s+/)),Dt}return xt.prototype.removeChild=function(bt){this.childNodes=this.childNodes.filter(function(Et){return Et!==bt}),bt instanceof xt&&(bt.parentNode=null)},xt.prototype.exchangeChild=function(bt,Et){var St=this.childNodes.findIndex(function(Dt){return Dt===bt});St>=0&&(this.childNodes[St]=Et,bt instanceof xt&&(bt.parentNode=null))},Object.defineProperty(xt.prototype,"rawText",{get:function(){for(var bt="",Et=0;Et<this.childNodes.length;Et++)bt+=this.childNodes[Et].rawText;return bt},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"structuredText",{get:function(){var bt=[],Et=[bt];function St(Dt){if(Dt.nodeType===_.ELEMENT_NODE)at[Dt.tagName]?(bt.length>0&&Et.push(bt=[]),Dt.childNodes.forEach(St),bt.length>0&&Et.push(bt=[])):Dt.childNodes.forEach(St);else if(Dt.nodeType===_.TEXT_NODE)if(Dt.isWhitespace)bt.prependWhitespace=!0;else{var Rt=Dt.text;bt.prependWhitespace&&(Rt=" "+Rt,bt.prependWhitespace=!1),bt.push(Rt)}}return St(this),Et.map(function(Dt){return Dt.join("").trim().replace(/\s{2,}/g," ")}).join(`
|
127
127
|
`).replace(/\s+$/,"")},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){var bt=this.tagName;if(bt){var Et=/^(img|br|hr|area|base|input|doctype|link|meta)$/i.test(bt),St=this.rawAttrs?" "+this.rawAttrs:"";return Et?"<".concat(bt).concat(St," />"):"<".concat(bt).concat(St,">").concat(this.innerHTML,"</").concat(bt,">")}else return this.innerHTML},Object.defineProperty(xt.prototype,"innerHTML",{get:function(){return this.childNodes.map(function(bt){return bt.toString()}).join("")},set:function(bt){var Et=this,St=mt(bt);this.childNodes.forEach(function(Dt){return Dt.remove()}),St.childNodes.forEach(function(Dt){return Et.appendChild(Dt)})},enumerable:!1,configurable:!0}),xt.prototype.set_content=function(bt){if(bt instanceof _e)bt=[bt];else if(typeof bt=="string"){var Et=mt(bt);bt=Et.childNodes.length?Et.childNodes:[new tt(bt)]}this.childNodes=bt},Object.defineProperty(xt.prototype,"outerHTML",{get:function(){return this.toString()},enumerable:!1,configurable:!0}),xt.prototype.trimRight=function(bt){for(var Et=0;Et<this.childNodes.length;Et++){var St=this.childNodes[Et];if(St.nodeType===_.ELEMENT_NODE)St.trimRight(bt);else{var Dt=St.rawText.search(bt);Dt>-1&&(St.value=St.rawText.substr(0,Dt),this.childNodes.length=Et+1)}}return this},Object.defineProperty(xt.prototype,"structure",{get:function(){var bt=[],Et=0;function St(Rt){bt.push(" ".repeat(Et)+Rt)}function Dt(Rt){var Tt=Rt.id?"#"+Rt.id:"",wt=Rt.classNames.length?"."+Rt.classNames.join("."):"";St(Rt.tagName+Tt+wt),Et++;for(var Ct=0;Ct<Rt.childNodes.length;Ct++){var It=Rt.childNodes[Ct];It.nodeType===_.ELEMENT_NODE?Dt(It):It.nodeType===_.TEXT_NODE&&(It.isWhitespace||St("#text"))}Et--}return Dt(this),bt.join(`
|
128
|
-
`)},enumerable:!1,configurable:!0}),xt.prototype.removeWhitespace=function(){for(var bt=0,Et=0;Et<this.childNodes.length;Et++){var St=this.childNodes[Et];if(St.nodeType===_.TEXT_NODE){if(St.isWhitespace)continue;St.value=St.rawText.trim()}else St.nodeType===_.ELEMENT_NODE&&St.removeWhitespace();this.childNodes[bt++]=St}return this.childNodes.length=bt,this},xt.prototype.querySelectorAll=function(bt){var Et=this,St;if(bt instanceof et)St=bt,St.reset();else{if(bt.includes(",")){var Dt=bt.split(",");return Array.from(Dt.reduce(function(yt,Pt){var kt=Et.querySelectorAll(Pt.trim());return kt.reduce(function(jt,Ht){return jt.add(Ht)},yt)},new Set))}St=new et(bt)}for(var Rt=[],Tt=[],wt=0;wt<this.childNodes.length;wt++)for(Tt.push([this.childNodes[wt],0,!1]);Tt.length;){var Ct=ot(Tt),It=Ct[0];if(Ct[1]===0){if(It.nodeType!==_.ELEMENT_NODE){Tt.pop();continue}if((Ct[2]=St.advance(It))&&St.matched){Rt.push(It),St.rewind(),Tt.pop();continue}}Ct[1]<It.childNodes.length?Tt.push([It.childNodes[Ct[1]++],0,!1]):(Ct[2]&&St.rewind(),Tt.pop())}return Rt},xt.prototype.querySelector=function(bt){var Et;bt instanceof et?(Et=bt,Et.reset()):Et=new et(bt);for(var St=[],Dt=0;Dt<this.childNodes.length;Dt++)for(St.push([this.childNodes[Dt],0,!1]);St.length;){var Rt=ot(St),Tt=Rt[0];if(Rt[1]===0){if(Tt.nodeType!==_.ELEMENT_NODE){St.pop();continue}if((Rt[2]=Et.advance(Tt))&&Et.matched)return Tt}Rt[1]<Tt.childNodes.length?St.push([Tt.childNodes[Rt[1]++],0,!1]):(Rt[2]&&Et.rewind(),St.pop())}return null},xt.prototype.appendChild=function(bt){return this.childNodes.push(bt),bt instanceof xt&&(bt.parentNode=this),bt},xt.prototype.prependChild=function(bt){return this.childNodes.unshift(bt),bt instanceof xt&&(bt.parentNode=this),bt},Object.defineProperty(xt.prototype,"firstChild",{get:function(){return this.childNodes[0]},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"lastChild",{get:function(){return ot(this.childNodes)},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"attributes",{get:function(){if(this._attrs)return this._attrs;this._attrs={};var bt=this.rawAttributes;for(var Et in bt)this._attrs[Et]=(0,$.decode)(bt[Et]);return this._attrs},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"rawAttributes",{get:function(){if(this._rawAttrs)return this._rawAttrs;var bt={};if(this.rawAttrs)for(var Et=void 0;Et=ft.exec(this.rawAttrs);)bt[Et[1]]=Et[4]||Et[5]||Et[6]||"";return this._rawAttrs=bt,bt},enumerable:!1,configurable:!0}),xt.prototype.setAttribute=function(bt,Et){bt==="id"?this.id=Et:bt==="class"&&(this.classNames=Et.split(/\s+/));var St=this.attributes;Et===void 0?delete St[bt]:St[bt]=Et+"",this._rawAttrs&&(Et===void 0?delete this._rawAttrs[bt]:this._rawAttrs[bt]=(0,$.encode)(Et+"")),this.rawAttrs=Object.keys(St).map(function(Dt){return Dt+(St[Dt]===""?"":'="'+(0,$.encode)(St[Dt])+'"')}).join(" ")},xt.prototype.removeAttribute=function(bt){this.setAttribute(bt,void 0)},xt.prototype.setAttributes=function(bt){var Et=this;bt.id?this.id=bt.id:bt.class&&(this.classNames=bt.class.split(/\s+/)),this.attributes&&(Object.keys(this.attributes).forEach(function(St){return delete Et.attributes[St]}),Object.keys(bt).forEach(function(St){return Et.attributes[St]=bt[St]+""})),this.rawAttributes&&(Object.keys(this.rawAttributes).forEach(function(St){return delete Et.rawAttributes[St]}),Object.keys(bt).forEach(function(St){return Et.rawAttributes[St]=(0,$.encode)(bt[St]+"")})),this.rawAttrs=Object.keys(bt).map(function(St){return St+(bt[St]===""?"":'="'+(0,$.encode)(bt[St]+"")+'"')}).join(" ")},xt}(_e);a.HTMLElement=rt;var st={},lt={f145:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.id!=xt.substr(1))return!1;for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f45:function(At,xt,bt,Et,St){bt=bt||[];for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f15:function(At,xt,bt,Et,St){return xt=xt||"",At.id==xt.substr(1)},f1:function(At,xt,bt,Et,St){if(xt=xt||"",At.id!=xt.substr(1))return!1},f5:function(At,xt,bt,Et,St){return!0},f245:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f25:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f2:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f345:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.tagName!=xt)return!1;for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f35:function(At,xt,bt,Et,St){return xt=xt||"",At.tagName==xt},f3:function(At,xt,bt,Et,St){if(xt=xt||"",At.tagName!=xt)return!1}},et=function(){function At(xt){this.nextMatch=0,lt.f5=lt.f5,this.matchers=xt.split(" ").map(function(bt){if(st[bt])return st[bt];var Et=bt.split("."),St=Et[0],Dt=Et.slice(1).sort(),Rt='"use strict";',Tt="f",wt="",Ct="";if(St&&St!="*"){var It;if(St[0]=="#")Rt+="if (el.id != "+JSON.stringify(St.substr(1))+") return false;",Tt+="1";else if(It=St.match(/^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/)){wt=It[1];var yt=It[2];if(yt!=="="&&yt!=="!=")throw new Error("Selector not supported, Expect [key${op}value].op must be =,!=");yt==="="&&(yt="=="),Ct=It[7]||It[8],Rt+='let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "'.concat(wt,'" && val == "').concat(Ct,'"){return true;}} return false;'),Tt+="2"}else Rt+="if (el.tagName != "+JSON.stringify(St)+") return false;",Tt+="3"}Dt.length>0&&(Rt+="for (let cls = "+JSON.stringify(Dt)+", i = 0; i < cls.length; i++) if (el.classNames.indexOf(cls[i]) === -1) return false;",Tt+="4"),Rt+="return true;",Tt+="5";var Pt={func:lt[Tt],tagName:St||"",classes:Dt||"",attr_key:wt||"",value:Ct||""};return Rt=Rt||"",st[bt]=Pt})}return At.prototype.advance=function(xt){return this.nextMatch<this.matchers.length&&this.matchers[this.nextMatch].func(xt,this.matchers[this.nextMatch].tagName,this.matchers[this.nextMatch].classes,this.matchers[this.nextMatch].attr_key,this.matchers[this.nextMatch].value)?(this.nextMatch++,!0):!1},At.prototype.rewind=function(){this.nextMatch--},Object.defineProperty(At.prototype,"matched",{get:function(){return this.nextMatch==this.matchers.length},enumerable:!1,configurable:!0}),At.prototype.reset=function(){this.nextMatch=0},At.prototype.flushCache=function(){st={}},At}();a.Matcher=et;var it=/<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.:0-9_a-z]*)((\s+[a-z][-.:0-9_a-z]*(\s*=\s*("[^"]*"|'([^']*')|([^\s\/>]+)))?)*)\s*(\/?)>/ig,ut=/(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig,ft=/([a-z][-.:0-9_a-z]*)(\s*=\s*("([^"]*)"|'([^']*)'|(\S+)))?/ig,ht={area:!0,base:!0,br:!0,col:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,source:!0},dt={li:{li:!0},p:{p:!0,div:!0},b:{div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0},h1:{h1:!0},h2:{h2:!0},h3:{h3:!0},h4:{h4:!0},h5:{h5:!0},h6:{h6:!0}},gt={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},pt={script:!0,noscript:!0,style:!0,pre:!0};function mt(At,xt){var bt=new rt(null),Et=bt,St=[bt],Dt=0;xt=xt||{};for(var Rt;Rt=it.exec(At);){if(Dt+Rt[0].length<it.lastIndex){var Tt=At.substring(Dt,it.lastIndex-Rt[0].length);Et.appendChild(new tt(Tt))}if(Dt=it.lastIndex,Rt[0][1]=="!"){if(xt.comment){var Tt=At.substring(Dt-3,Dt-Rt[0].length+4);Et.appendChild(new nt(Tt))}continue}if(xt.lowerCaseTagName&&(Rt[2]=Rt[2].toLowerCase()),!Rt[1]&&(!Rt[9]&&dt[Et.tagName]&&dt[Et.tagName][Rt[2]]&&(St.pop(),Et=ot(St)),Et=Et.appendChild(new rt(Rt[2],Rt[3].trim())),St.push(Et),pt[Rt[2]])){var wt="</"+Rt[2]+">",Ct=At.indexOf(wt,it.lastIndex);if(xt[Rt[2]]){var Tt=void 0;Ct==-1?Tt=At.substr(it.lastIndex):Tt=At.substring(it.lastIndex,Ct),Tt.length>0&&Et.appendChild(new tt(Tt))}Ct==-1?Dt=it.lastIndex=At.length+1:(Dt=it.lastIndex=Ct+wt.length,Rt[1]="true")}if(Rt[1]||Rt[9]||ht[Rt[2]])for(;;)if(Et.tagName==Rt[2]){St.pop(),Et=ot(St);break}else{if(gt[Et.tagName]&>[Et.tagName][Rt[2]]){St.pop(),Et=ot(St);continue}break}}Dt<At.length&&bt.appendChild(new tt(At.substring(Dt))),bt.valid=St.length===1;for(var It=function(){var yt=St.pop(),Pt=ot(St);yt.parentNode&&yt.parentNode instanceof rt&&yt.parentNode.parentNode&&(yt.parentNode===Pt&&yt.tagName===Pt.tagName?(Pt.removeChild(yt),yt.childNodes.forEach(function(kt){Pt.parentNode.appendChild(kt)}),St.pop()):(Pt.removeChild(yt),yt.childNodes.forEach(function(kt){Pt.appendChild(kt)})))};St.length>1;)It();return bt}a.parse=mt;var ct=["html","body","address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","header","hr","li","main","nav","noscript","ol","p","pre","section","tfoot","table","tbody","ul","video","th","td","tr","h1","h2","h3","h4","h5","h6"];function vt(At){return At.nodeType===_.ELEMENT_NODE&&At.tagName&&ct.includes(At.tagName.toLowerCase())}a.isBlock=vt}(dist),LineCapStyle.Butt,LineCapStyle.Round,LineCapStyle.Projecting,FillRule.EvenOdd,FillRule.NonZero,LineJoinStyle.Bevel,LineJoinStyle.Miter,LineJoinStyle.Round;const convertForPdfLayoutProps=({schema:a,pageHeight:s,applyRotateTranslate:$=!0})=>{const{width:_,height:_e,position:tt,rotate:nt,opacity:at}=a,{x:ot,y:rt}=tt,st=nt?-nt:0,lt=mm2pt(_),et=mm2pt(_e);let it=mm2pt(ot),ut=s-mm2pt(rt)-et;if(st&&$){const ft={x:it+lt/2,y:s-mm2pt(rt)-et/2},ht=rotatePoint({x:it,y:ut},ft,st);it=ht.x,ut=ht.y}return{position:{x:it,y:ut},height:et,width:lt,rotate:degrees(st),opacity:at}},rotatePoint=(a,s,$)=>{const _=degreesToRadians($),_e=Math.cos(_)*(a.x-s.x)-Math.sin(_)*(a.y-s.y)+s.x,tt=Math.sin(_)*(a.x-s.x)+Math.cos(_)*(a.y-s.y)+s.y;return{x:_e,y:tt}},addAlphaToHex=(a,s)=>{if(!/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i.test(a))throw new Error("Invalid HEX color code");let _=Math.round(s/100*255).toString(16);return _.length===1&&(_="0"+_),a+_},isEditable=(a,s)=>a==="designer"||a==="form"&&s.readOnly!==!0,hex2rgb=a=>(a.slice(0,1)==="#"&&(a=a.slice(1)),a.length===3&&(a=a.slice(0,1)+a.slice(0,1)+a.slice(1,2)+a.slice(1,2)+a.slice(2,3)+a.slice(2,3)),[a.slice(0,2),a.slice(2,4),a.slice(4,6)].map(s=>parseInt(s,16))),hex2RgbColor=a=>{if(a){if(!isHexValid(a))throw new Error(`Invalid hex color value ${a}`);const[$,_,_e]=hex2rgb(a);return rgb($/255,_/255,_e/255)}},embedAndGetFontObj=async a=>{const{pdfDoc:s,font:$,_cache:_}=a;if(_.has(s))return _.get(s);const _e=await Promise.all(Object.values($).map(async nt=>{let at=nt.data;return typeof at=="string"&&at.startsWith("http")&&(at=await fetch(at).then(ot=>ot.arrayBuffer())),s.embedFont(at,{subset:typeof nt.subset>"u"?!0:nt.subset})})),tt=Object.keys($).reduce((nt,at,ot)=>Object.assign(nt,{[at]:_e[ot]}),{});return _.set(s,tt),tt},getFontProp=async({value:a,font:s,schema:$,_cache:_})=>{const _e=$.dynamicFontSize?await calculateDynamicFontSize({textSchema:$,font:s,value:a,_cache:_}):$.fontSize??DEFAULT_FONT_SIZE,tt=hex2RgbColor($.fontColor||DEFAULT_FONT_COLOR);return{alignment:$.alignment??DEFAULT_ALIGNMENT,verticalAlignment:$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT,lineHeight:$.lineHeight??DEFAULT_LINE_HEIGHT,characterSpacing:$.characterSpacing??DEFAULT_CHARACTER_SPACING,fontSize:_e,color:tt}},pdfRender=async a=>{const{value:s,pdfDoc:$,pdfLib:_,page:_e,options:tt,schema:nt,_cache:at}=a;if(!s)return;const{font:ot=getDefaultFont()}=tt,[rt,st,lt]=await Promise.all([embedAndGetFontObj({pdfDoc:$,font:ot,_cache:at}),getFontKitFont(nt,ot,at),getFontProp({value:s,font:ot,schema:nt,_cache:at})]),{fontSize:et,color:it,alignment:ut,verticalAlignment:ft,lineHeight:ht,characterSpacing:dt}=lt,gt=nt.fontName?nt.fontName:getFallbackFontName(ot),pt=rt&&rt[gt],mt=_e.getHeight(),{width:ct,height:vt,rotate:At,position:{x:xt,y:bt},opacity:Et}=convertForPdfLayoutProps({schema:nt,pageHeight:mt,applyRotateTranslate:!1});if(nt.backgroundColor){const yt=hex2RgbColor(nt.backgroundColor);_e.drawRectangle({x:xt,y:bt,width:ct,height:vt,rotate:At,color:yt})}_e.pushOperators(_.setCharacterSpacing(dt??DEFAULT_CHARACTER_SPACING));const St=heightOfFontAtSize(st,et),Dt=getFontDescentInPt(st,et),Rt=ht===0?0:(ht-1)*et/2,Tt={font:st,fontSize:et,characterSpacing:dt,boxWidthInPt:ct};let wt=[];s.split(/\r\n|\r|\n|\f|\u000B/g).forEach(yt=>{wt=wt.concat(getSplittedLines(yt,Tt))});let Ct=0;if(ft===VERTICAL_ALIGN_TOP)Ct=St+Rt;else{const yt=ht*et*(wt.length-1);ft===VERTICAL_ALIGN_BOTTOM?Ct=vt-yt+Dt-Rt:ft===VERTICAL_ALIGN_MIDDLE&&(Ct=(vt-yt-St+Dt)/2+St)}const It={x:xt+ct/2,y:mt-mm2pt(nt.position.y)-vt/2};wt.forEach((yt,Pt)=>{const kt=widthOfTextAtSize(yt,st,et,dt),jt=ht*et*Pt;let Ht=xt;ut==="center"?Ht+=(ct-kt)/2:ut==="right"&&(Ht+=ct-kt);let Ft=mt-mm2pt(nt.position.y)-Ct-jt;if(At.angle!==0){const Lt=rotatePoint({x:Ht,y:Ft},It,At.angle);Ht=Lt.x,Ft=Lt.y}_e.drawText(yt,{x:Ht,y:Ft,rotate:At,size:et,color:it,lineHeight:ht*et,font:pt,opacity:Et})})},DEFAULT_OPACITY=1,HEX_COLOR_PATTERN="^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$",UseDynamicFontSize=a=>{const{rootElement:s,changeSchemas:$,activeSchema:_,i18n:_e}=a,tt=document.createElement("input");tt.type="checkbox",tt.checked=!!(_!=null&&_.dynamicFontSize),tt.onchange=at=>{const ot=at.target.checked?{min:DEFAULT_DYNAMIC_MIN_FONT_SIZE,max:DEFAULT_DYNAMIC_MAX_FONT_SIZE,fit:DEFAULT_DYNAMIC_FIT}:void 0;$([{key:"dynamicFontSize",value:ot,schemaId:_.id}])};const nt=document.createElement("label");nt.innerText=_e("schemas.text.dynamicFontSize")||"",nt.style.cssText="display: flex; width: 100%;",nt.appendChild(tt),s.appendChild(nt)},propPanel={schema:({options:a,activeSchema:s,i18n:$})=>{const _=a.font||{[DEFAULT_FONT_NAME]:{data:"",fallback:!0}},_e=Object.keys(_),tt=getFallbackFontName(_),nt=!!(s!=null&&s.dynamicFontSize);return{fontName:{title:$("schemas.text.fontName"),type:"string",widget:"select",default:tt,props:{options:_e.map(ot=>({label:ot,value:ot}))},span:12},fontSize:{title:$("schemas.text.size"),type:"number",widget:"inputNumber",span:6,disabled:nt},characterSpacing:{title:$("schemas.text.spacing"),type:"number",widget:"inputNumber",span:6},alignment:{title:$("schemas.text.textAlign"),type:"string",widget:"select",props:{options:[{label:$("schemas.left"),value:DEFAULT_ALIGNMENT},{label:$("schemas.center"),value:ALIGN_CENTER},{label:$("schemas.right"),value:ALIGN_RIGHT}]},span:8},verticalAlignment:{title:$("schemas.text.verticalAlign"),type:"string",widget:"select",props:{options:[{label:$("schemas.top"),value:VERTICAL_ALIGN_TOP},{label:$("schemas.middle"),value:VERTICAL_ALIGN_MIDDLE},{label:$("schemas.bottom"),value:VERTICAL_ALIGN_BOTTOM}]},span:8},lineHeight:{title:$("schemas.text.lineHeight"),type:"number",widget:"inputNumber",props:{step:.1},span:8},useDynamicFontSize:{type:"boolean",widget:"UseDynamicFontSize",bind:!1,span:16},dynamicFontSize:{type:"object",widget:"card",column:3,properties:{min:{title:$("schemas.text.min"),type:"number",widget:"inputNumber",hidden:!nt},max:{title:$("schemas.text.max"),type:"number",widget:"inputNumber",hidden:!nt},fit:{title:$("schemas.text.fit"),type:"string",widget:"select",hidden:!nt,props:{options:[{label:$("schemas.horizontal"),value:DYNAMIC_FIT_HORIZONTAL},{label:$("schemas.vertical"),value:DYNAMIC_FIT_VERTICAL}]}}}},fontColor:{title:$("schemas.textColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("hexColorPrompt")}]},backgroundColor:{title:$("schemas.bgColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("hexColorPrompt")}]}}},widgets:{UseDynamicFontSize},defaultValue:"Type Something...",defaultSchema:{type:"text",position:{x:0,y:0},width:45,height:10,rotate:0,alignment:DEFAULT_ALIGNMENT,verticalAlignment:DEFAULT_VERTICAL_ALIGNMENT,fontSize:DEFAULT_FONT_SIZE,lineHeight:DEFAULT_LINE_HEIGHT,characterSpacing:DEFAULT_CHARACTER_SPACING,dynamicFontSize:void 0,fontColor:DEFAULT_FONT_COLOR,fontName:void 0,backgroundColor:"",opacity:DEFAULT_OPACITY}},mapVerticalAlignToFlex=a=>{switch(a){case VERTICAL_ALIGN_TOP:return"flex-start";case VERTICAL_ALIGN_MIDDLE:return"center";case VERTICAL_ALIGN_BOTTOM:return"flex-end"}return"flex-start"},getBackgroundColor=(a,s,$)=>a?s.backgroundColor?s.backgroundColor:$:"transparent",uiRender=async a=>{const{value:s,schema:$,rootElement:_,mode:_e,onChange:tt,stopEditing:nt,tabIndex:at,placeholder:ot,options:rt,theme:st,_cache:lt}=a,et=(rt==null?void 0:rt.font)||getDefaultFont();let it;const ut=xt=>({textSchema:$,font:et,value:xt,startingFontSize:it,_cache:lt});$.dynamicFontSize&&s&&(it=await calculateDynamicFontSize(ut(s)));const ft=await getFontKitFont($,et,lt),{topAdj:ht,bottomAdj:dt}=getBrowserVerticalFontAdjustments(ft,it??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT),gt=ht.toString(),pt=dt.toString(),mt=document.createElement("div"),ct={padding:0,resize:"none",backgroundColor:getBackgroundColor(s,$,addAlphaToHex(st.colorPrimaryBg,30)),border:"none",display:"flex",flexDirection:"column",justifyContent:mapVerticalAlignToFlex($.verticalAlignment),width:"100%",height:"100%"};Object.assign(mt.style,ct),_.innerHTML="",_.appendChild(mt);const vt={fontFamily:$.fontName?`'${$.fontName}'`:"inherit",color:$.fontColor?$.fontColor:DEFAULT_FONT_COLOR,fontSize:`${it??$.fontSize??DEFAULT_FONT_SIZE}pt`,letterSpacing:`${$.characterSpacing??DEFAULT_CHARACTER_SPACING}pt`,lineHeight:`${$.lineHeight??DEFAULT_LINE_HEIGHT}em`,textAlign:$.alignment??DEFAULT_ALIGNMENT,whiteSpace:"pre-wrap",wordBreak:"break-word",resize:"none",border:"none",outline:"none",marginBottom:`${pt}px`,paddingTop:`${gt}px`,backgroundColor:"transparent"},At=document.createElement("div");if(Object.assign(At.style,vt),isEditable(_e,$)){if(At.contentEditable="plaintext-only",At.tabIndex=at||0,At.innerText=s,At.addEventListener("blur",xt=>{tt&&tt(xt.target.innerText),nt&&nt()}),$.dynamicFontSize&&At.addEventListener("keyup",()=>{setTimeout(()=>{(async()=>{if(!At.textContent)return;it=await calculateDynamicFontSize(ut(At.textContent)),At.style.fontSize=`${it}pt`;const{topAdj:xt,bottomAdj:bt}=getBrowserVerticalFontAdjustments(ft,it??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT);At.style.paddingTop=`${xt}px`,At.style.marginBottom=`${bt}px`})()},0)}),ot&&!s){if(At.innerText=ot,At.style.color=PLACEHOLDER_FONT_COLOR,$.dynamicFontSize){const xt=await calculateDynamicFontSize(ut(ot));At.style.fontSize=`${xt}pt`}At.addEventListener("focus",()=>{At.innerText===ot&&(At.innerText="",At.style.color=$.fontColor??DEFAULT_FONT_COLOR)})}if(mt.appendChild(At),_e==="designer"){At.focus();const xt=window.getSelection(),bt=document.createRange();bt.selectNodeContents(At),bt.collapse(!1),xt==null||xt.removeAllRanges(),xt==null||xt.addRange(bt)}}else At.innerHTML=s.split("").map((xt,bt)=>`<span style="letter-spacing:${String(s).length===bt+1?0:"inherit"};">${xt}</span>`).join(""),mt.appendChild(At)},textSchema={pdf:pdfRender,ui:uiRender,propPanel},text=textSchema;textSchema.pdf,textSchema.ui,{...textSchema.propPanel,defaultSchema:{...textSchema.propPanel.defaultSchema,readOnlyValue:textSchema.propPanel.defaultValue}};const builtInPlugins={Text:text};class BaseUIClass{constructor(s){this.lang=DEFAULT_LANG,this.font=getDefaultFont(),this.pluginsRegistry=builtInPlugins,this.options={},this.setSize=debounce$1(()=>{if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.render()},100),this.resizeObserver=new ResizeObserver(this.setSize),checkUIProps(s);const{domContainer:$,template:_,options:_e={},plugins:tt={}}=s;this.domContainer=$,this.template=generateColumnsAndSampledataIfNeeded(cloneDeep$1(_)),this.options=_e,this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.resizeObserver.observe(this.domContainer);const{lang:nt,font:at}=_e;nt&&(this.lang=nt),at&&(this.font=at),Object.values(tt).length>0&&(this.pluginsRegistry=tt)}getLang(){return this.lang}getFont(){return this.font}getPluginsRegistry(){return this.pluginsRegistry}getOptions(){return this.options}getTemplate(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.template}updateTemplate(s){if(checkTemplate(s),!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.template=cloneDeep$1(s),this.render()}updateOptions(s){checkUIOptions(s);const{lang:$,font:_}=s||{};$&&(this.lang=$),_&&(this.font=_),this.options=Object.assign(this.options,s),this.render()}destroy(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);ReactDOM.unmountComponentAtNode(this.domContainer),this.resizeObserver.unobserve(this.domContainer),this.domContainer=null}}class PreviewUI extends BaseUIClass{constructor(s){super(s),checkPreviewProps(s),this.inputs=cloneDeep$1(s.inputs)}getInputs(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.inputs}setInputs(s){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);checkInputs(s),this.inputs=cloneDeep$1(s),this.render()}}var classnames$1={exports:{}};/*!
|
128
|
+
`)},enumerable:!1,configurable:!0}),xt.prototype.removeWhitespace=function(){for(var bt=0,Et=0;Et<this.childNodes.length;Et++){var St=this.childNodes[Et];if(St.nodeType===_.TEXT_NODE){if(St.isWhitespace)continue;St.value=St.rawText.trim()}else St.nodeType===_.ELEMENT_NODE&&St.removeWhitespace();this.childNodes[bt++]=St}return this.childNodes.length=bt,this},xt.prototype.querySelectorAll=function(bt){var Et=this,St;if(bt instanceof et)St=bt,St.reset();else{if(bt.includes(",")){var Dt=bt.split(",");return Array.from(Dt.reduce(function(yt,Pt){var kt=Et.querySelectorAll(Pt.trim());return kt.reduce(function(jt,Ht){return jt.add(Ht)},yt)},new Set))}St=new et(bt)}for(var Rt=[],Tt=[],wt=0;wt<this.childNodes.length;wt++)for(Tt.push([this.childNodes[wt],0,!1]);Tt.length;){var Ct=ot(Tt),It=Ct[0];if(Ct[1]===0){if(It.nodeType!==_.ELEMENT_NODE){Tt.pop();continue}if((Ct[2]=St.advance(It))&&St.matched){Rt.push(It),St.rewind(),Tt.pop();continue}}Ct[1]<It.childNodes.length?Tt.push([It.childNodes[Ct[1]++],0,!1]):(Ct[2]&&St.rewind(),Tt.pop())}return Rt},xt.prototype.querySelector=function(bt){var Et;bt instanceof et?(Et=bt,Et.reset()):Et=new et(bt);for(var St=[],Dt=0;Dt<this.childNodes.length;Dt++)for(St.push([this.childNodes[Dt],0,!1]);St.length;){var Rt=ot(St),Tt=Rt[0];if(Rt[1]===0){if(Tt.nodeType!==_.ELEMENT_NODE){St.pop();continue}if((Rt[2]=Et.advance(Tt))&&Et.matched)return Tt}Rt[1]<Tt.childNodes.length?St.push([Tt.childNodes[Rt[1]++],0,!1]):(Rt[2]&&Et.rewind(),St.pop())}return null},xt.prototype.appendChild=function(bt){return this.childNodes.push(bt),bt instanceof xt&&(bt.parentNode=this),bt},xt.prototype.prependChild=function(bt){return this.childNodes.unshift(bt),bt instanceof xt&&(bt.parentNode=this),bt},Object.defineProperty(xt.prototype,"firstChild",{get:function(){return this.childNodes[0]},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"lastChild",{get:function(){return ot(this.childNodes)},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"attributes",{get:function(){if(this._attrs)return this._attrs;this._attrs={};var bt=this.rawAttributes;for(var Et in bt)this._attrs[Et]=(0,$.decode)(bt[Et]);return this._attrs},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"rawAttributes",{get:function(){if(this._rawAttrs)return this._rawAttrs;var bt={};if(this.rawAttrs)for(var Et=void 0;Et=ft.exec(this.rawAttrs);)bt[Et[1]]=Et[4]||Et[5]||Et[6]||"";return this._rawAttrs=bt,bt},enumerable:!1,configurable:!0}),xt.prototype.setAttribute=function(bt,Et){bt==="id"?this.id=Et:bt==="class"&&(this.classNames=Et.split(/\s+/));var St=this.attributes;Et===void 0?delete St[bt]:St[bt]=Et+"",this._rawAttrs&&(Et===void 0?delete this._rawAttrs[bt]:this._rawAttrs[bt]=(0,$.encode)(Et+"")),this.rawAttrs=Object.keys(St).map(function(Dt){return Dt+(St[Dt]===""?"":'="'+(0,$.encode)(St[Dt])+'"')}).join(" ")},xt.prototype.removeAttribute=function(bt){this.setAttribute(bt,void 0)},xt.prototype.setAttributes=function(bt){var Et=this;bt.id?this.id=bt.id:bt.class&&(this.classNames=bt.class.split(/\s+/)),this.attributes&&(Object.keys(this.attributes).forEach(function(St){return delete Et.attributes[St]}),Object.keys(bt).forEach(function(St){return Et.attributes[St]=bt[St]+""})),this.rawAttributes&&(Object.keys(this.rawAttributes).forEach(function(St){return delete Et.rawAttributes[St]}),Object.keys(bt).forEach(function(St){return Et.rawAttributes[St]=(0,$.encode)(bt[St]+"")})),this.rawAttrs=Object.keys(bt).map(function(St){return St+(bt[St]===""?"":'="'+(0,$.encode)(bt[St]+"")+'"')}).join(" ")},xt}(_e);a.HTMLElement=rt;var st={},lt={f145:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.id!=xt.substr(1))return!1;for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f45:function(At,xt,bt,Et,St){bt=bt||[];for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f15:function(At,xt,bt,Et,St){return xt=xt||"",At.id==xt.substr(1)},f1:function(At,xt,bt,Et,St){if(xt=xt||"",At.id!=xt.substr(1))return!1},f5:function(At,xt,bt,Et,St){return!0},f245:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f25:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f2:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Dt=At.attributes;for(var Rt in Dt){var Tt=Dt[Rt];if(Rt==Et&&Tt==St)return!0}return!1},f345:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.tagName!=xt)return!1;for(var Dt=bt,Rt=0;Rt<Dt.length;Rt++)if(At.classNames.indexOf(Dt[Rt])===-1)return!1;return!0},f35:function(At,xt,bt,Et,St){return xt=xt||"",At.tagName==xt},f3:function(At,xt,bt,Et,St){if(xt=xt||"",At.tagName!=xt)return!1}},et=function(){function At(xt){this.nextMatch=0,lt.f5=lt.f5,this.matchers=xt.split(" ").map(function(bt){if(st[bt])return st[bt];var Et=bt.split("."),St=Et[0],Dt=Et.slice(1).sort(),Rt='"use strict";',Tt="f",wt="",Ct="";if(St&&St!="*"){var It;if(St[0]=="#")Rt+="if (el.id != "+JSON.stringify(St.substr(1))+") return false;",Tt+="1";else if(It=St.match(/^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/)){wt=It[1];var yt=It[2];if(yt!=="="&&yt!=="!=")throw new Error("Selector not supported, Expect [key${op}value].op must be =,!=");yt==="="&&(yt="=="),Ct=It[7]||It[8],Rt+='let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "'.concat(wt,'" && val == "').concat(Ct,'"){return true;}} return false;'),Tt+="2"}else Rt+="if (el.tagName != "+JSON.stringify(St)+") return false;",Tt+="3"}Dt.length>0&&(Rt+="for (let cls = "+JSON.stringify(Dt)+", i = 0; i < cls.length; i++) if (el.classNames.indexOf(cls[i]) === -1) return false;",Tt+="4"),Rt+="return true;",Tt+="5";var Pt={func:lt[Tt],tagName:St||"",classes:Dt||"",attr_key:wt||"",value:Ct||""};return Rt=Rt||"",st[bt]=Pt})}return At.prototype.advance=function(xt){return this.nextMatch<this.matchers.length&&this.matchers[this.nextMatch].func(xt,this.matchers[this.nextMatch].tagName,this.matchers[this.nextMatch].classes,this.matchers[this.nextMatch].attr_key,this.matchers[this.nextMatch].value)?(this.nextMatch++,!0):!1},At.prototype.rewind=function(){this.nextMatch--},Object.defineProperty(At.prototype,"matched",{get:function(){return this.nextMatch==this.matchers.length},enumerable:!1,configurable:!0}),At.prototype.reset=function(){this.nextMatch=0},At.prototype.flushCache=function(){st={}},At}();a.Matcher=et;var it=/<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.:0-9_a-z]*)((\s+[a-z][-.:0-9_a-z]*(\s*=\s*("[^"]*"|'([^']*')|([^\s\/>]+)))?)*)\s*(\/?)>/ig,ut=/(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig,ft=/([a-z][-.:0-9_a-z]*)(\s*=\s*("([^"]*)"|'([^']*)'|(\S+)))?/ig,ht={area:!0,base:!0,br:!0,col:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,source:!0},dt={li:{li:!0},p:{p:!0,div:!0},b:{div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0},h1:{h1:!0},h2:{h2:!0},h3:{h3:!0},h4:{h4:!0},h5:{h5:!0},h6:{h6:!0}},gt={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},pt={script:!0,noscript:!0,style:!0,pre:!0};function mt(At,xt){var bt=new rt(null),Et=bt,St=[bt],Dt=0;xt=xt||{};for(var Rt;Rt=it.exec(At);){if(Dt+Rt[0].length<it.lastIndex){var Tt=At.substring(Dt,it.lastIndex-Rt[0].length);Et.appendChild(new tt(Tt))}if(Dt=it.lastIndex,Rt[0][1]=="!"){if(xt.comment){var Tt=At.substring(Dt-3,Dt-Rt[0].length+4);Et.appendChild(new nt(Tt))}continue}if(xt.lowerCaseTagName&&(Rt[2]=Rt[2].toLowerCase()),!Rt[1]&&(!Rt[9]&&dt[Et.tagName]&&dt[Et.tagName][Rt[2]]&&(St.pop(),Et=ot(St)),Et=Et.appendChild(new rt(Rt[2],Rt[3].trim())),St.push(Et),pt[Rt[2]])){var wt="</"+Rt[2]+">",Ct=At.indexOf(wt,it.lastIndex);if(xt[Rt[2]]){var Tt=void 0;Ct==-1?Tt=At.substr(it.lastIndex):Tt=At.substring(it.lastIndex,Ct),Tt.length>0&&Et.appendChild(new tt(Tt))}Ct==-1?Dt=it.lastIndex=At.length+1:(Dt=it.lastIndex=Ct+wt.length,Rt[1]="true")}if(Rt[1]||Rt[9]||ht[Rt[2]])for(;;)if(Et.tagName==Rt[2]){St.pop(),Et=ot(St);break}else{if(gt[Et.tagName]&>[Et.tagName][Rt[2]]){St.pop(),Et=ot(St);continue}break}}Dt<At.length&&bt.appendChild(new tt(At.substring(Dt))),bt.valid=St.length===1;for(var It=function(){var yt=St.pop(),Pt=ot(St);yt.parentNode&&yt.parentNode instanceof rt&&yt.parentNode.parentNode&&(yt.parentNode===Pt&&yt.tagName===Pt.tagName?(Pt.removeChild(yt),yt.childNodes.forEach(function(kt){Pt.parentNode.appendChild(kt)}),St.pop()):(Pt.removeChild(yt),yt.childNodes.forEach(function(kt){Pt.appendChild(kt)})))};St.length>1;)It();return bt}a.parse=mt;var ct=["html","body","address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","header","hr","li","main","nav","noscript","ol","p","pre","section","tfoot","table","tbody","ul","video","th","td","tr","h1","h2","h3","h4","h5","h6"];function vt(At){return At.nodeType===_.ELEMENT_NODE&&At.tagName&&ct.includes(At.tagName.toLowerCase())}a.isBlock=vt}(dist),LineCapStyle.Butt,LineCapStyle.Round,LineCapStyle.Projecting,FillRule.EvenOdd,FillRule.NonZero,LineJoinStyle.Bevel,LineJoinStyle.Miter,LineJoinStyle.Round;const convertForPdfLayoutProps=({schema:a,pageHeight:s,applyRotateTranslate:$=!0})=>{const{width:_,height:_e,position:tt,rotate:nt,opacity:at}=a,{x:ot,y:rt}=tt,st=nt?-nt:0,lt=mm2pt(_),et=mm2pt(_e);let it=mm2pt(ot),ut=s-mm2pt(rt)-et;if(st&&$){const ft={x:it+lt/2,y:s-mm2pt(rt)-et/2},ht=rotatePoint({x:it,y:ut},ft,st);it=ht.x,ut=ht.y}return{position:{x:it,y:ut},height:et,width:lt,rotate:degrees(st),opacity:at}},rotatePoint=(a,s,$)=>{const _=degreesToRadians($),_e=Math.cos(_)*(a.x-s.x)-Math.sin(_)*(a.y-s.y)+s.x,tt=Math.sin(_)*(a.x-s.x)+Math.cos(_)*(a.y-s.y)+s.y;return{x:_e,y:tt}},addAlphaToHex=(a,s)=>{if(!/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i.test(a))throw new Error("Invalid HEX color code");let _=Math.round(s/100*255).toString(16);return _.length===1&&(_="0"+_),a+_},isEditable=(a,s)=>a==="designer"||a==="form"&&s.readOnly!==!0,hex2rgb=a=>(a.slice(0,1)==="#"&&(a=a.slice(1)),a.length===3&&(a=a.slice(0,1)+a.slice(0,1)+a.slice(1,2)+a.slice(1,2)+a.slice(2,3)+a.slice(2,3)),[a.slice(0,2),a.slice(2,4),a.slice(4,6)].map(s=>parseInt(s,16))),hex2RgbColor=a=>{if(a){if(!isHexValid(a))throw new Error(`Invalid hex color value ${a}`);const[$,_,_e]=hex2rgb(a);return rgb($/255,_/255,_e/255)}},hex2CmykColor=a=>{if(a){if(!isHexValid(a))throw new Error(`Invalid hex color value ${a}`);a=a.replace("#","");const $=a.substring(0,6),_=a.substring(6,8),_e=_?parseInt(_,16)/255:1;let tt=parseInt($.substring(0,2),16)/255,nt=parseInt($.substring(2,4),16)/255,at=parseInt($.substring(4,6),16)/255;tt=tt*_e+(1-_e),nt=nt*_e+(1-_e),at=at*_e+(1-_e);const ot=1-Math.max(tt,nt,at),rt=tt===0?0:(1-tt-ot)/(1-ot),st=nt===0?0:(1-nt-ot)/(1-ot),lt=at===0?0:(1-at-ot)/(1-ot);return cmyk(rt,st,lt,ot)}},hex2PrintingColor=(a,s)=>(s==null?void 0:s.toLocaleLowerCase())=="cmyk"?hex2CmykColor(a):hex2RgbColor(a),embedAndGetFontObj=async a=>{const{pdfDoc:s,font:$,_cache:_}=a;if(_.has(s))return _.get(s);const _e=await Promise.all(Object.values($).map(async nt=>{let at=nt.data;return typeof at=="string"&&at.startsWith("http")&&(at=await fetch(at).then(ot=>ot.arrayBuffer())),s.embedFont(at,{subset:typeof nt.subset>"u"?!0:nt.subset})})),tt=Object.keys($).reduce((nt,at,ot)=>Object.assign(nt,{[at]:_e[ot]}),{});return _.set(s,tt),tt},getFontProp=async({value:a,font:s,schema:$,colorType:_,_cache:_e})=>{const tt=$.dynamicFontSize?await calculateDynamicFontSize({textSchema:$,font:s,value:a,_cache:_e}):$.fontSize??DEFAULT_FONT_SIZE,nt=hex2PrintingColor($.fontColor||DEFAULT_FONT_COLOR,_);return{alignment:$.alignment??DEFAULT_ALIGNMENT,verticalAlignment:$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT,lineHeight:$.lineHeight??DEFAULT_LINE_HEIGHT,characterSpacing:$.characterSpacing??DEFAULT_CHARACTER_SPACING,fontSize:tt,color:nt}},pdfRender=async a=>{const{value:s,pdfDoc:$,pdfLib:_,page:_e,options:tt,schema:nt,_cache:at}=a;if(!s)return;const{font:ot=getDefaultFont(),colorType:rt}=tt,[st,lt,et]=await Promise.all([embedAndGetFontObj({pdfDoc:$,font:ot,_cache:at}),getFontKitFont(nt,ot,at),getFontProp({value:s,font:ot,schema:nt,_cache:at,colorType:rt})]),{fontSize:it,color:ut,alignment:ft,verticalAlignment:ht,lineHeight:dt,characterSpacing:gt}=et,pt=nt.fontName?nt.fontName:getFallbackFontName(ot),mt=st&&st[pt],ct=_e.getHeight(),{width:vt,height:At,rotate:xt,position:{x:bt,y:Et},opacity:St}=convertForPdfLayoutProps({schema:nt,pageHeight:ct,applyRotateTranslate:!1});if(nt.backgroundColor){const Pt=hex2PrintingColor(nt.backgroundColor,rt);_e.drawRectangle({x:bt,y:Et,width:vt,height:At,rotate:xt,color:Pt})}_e.pushOperators(_.setCharacterSpacing(gt??DEFAULT_CHARACTER_SPACING));const Dt=heightOfFontAtSize(lt,it),Rt=getFontDescentInPt(lt,it),Tt=dt===0?0:(dt-1)*it/2,wt={font:lt,fontSize:it,characterSpacing:gt,boxWidthInPt:vt};let Ct=[];s.split(/\r\n|\r|\n|\f|\u000B/g).forEach(Pt=>{Ct=Ct.concat(getSplittedLines(Pt,wt))});let It=0;if(ht===VERTICAL_ALIGN_TOP)It=Dt+Tt;else{const Pt=dt*it*(Ct.length-1);ht===VERTICAL_ALIGN_BOTTOM?It=At-Pt+Rt-Tt:ht===VERTICAL_ALIGN_MIDDLE&&(It=(At-Pt-Dt+Rt)/2+Dt)}const yt={x:bt+vt/2,y:ct-mm2pt(nt.position.y)-At/2};Ct.forEach((Pt,kt)=>{const jt=widthOfTextAtSize(Pt,lt,it,gt),Ht=dt*it*kt;let Ft=bt;ft==="center"?Ft+=(vt-jt)/2:ft==="right"&&(Ft+=vt-jt);let Lt=ct-mm2pt(nt.position.y)-It-Ht;if(xt.angle!==0){const Nt=rotatePoint({x:Ft,y:Lt},yt,xt.angle);Ft=Nt.x,Lt=Nt.y}_e.drawText(Pt,{x:Ft,y:Lt,rotate:xt,size:it,color:ut,lineHeight:dt*it,font:mt,opacity:St})})},DEFAULT_OPACITY=1,HEX_COLOR_PATTERN="^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$",UseDynamicFontSize=a=>{const{rootElement:s,changeSchemas:$,activeSchema:_,i18n:_e}=a,tt=document.createElement("input");tt.type="checkbox",tt.checked=!!(_!=null&&_.dynamicFontSize),tt.onchange=at=>{const ot=at.target.checked?{min:DEFAULT_DYNAMIC_MIN_FONT_SIZE,max:DEFAULT_DYNAMIC_MAX_FONT_SIZE,fit:DEFAULT_DYNAMIC_FIT}:void 0;$([{key:"dynamicFontSize",value:ot,schemaId:_.id}])};const nt=document.createElement("label");nt.innerText=_e("schemas.text.dynamicFontSize")||"",nt.style.cssText="display: flex; width: 100%;",nt.appendChild(tt),s.appendChild(nt)},propPanel={schema:({options:a,activeSchema:s,i18n:$})=>{const _=a.font||{[DEFAULT_FONT_NAME]:{data:"",fallback:!0}},_e=Object.keys(_),tt=getFallbackFontName(_),nt=!!(s!=null&&s.dynamicFontSize);return{fontName:{title:$("schemas.text.fontName"),type:"string",widget:"select",default:tt,props:{options:_e.map(ot=>({label:ot,value:ot}))},span:12},fontSize:{title:$("schemas.text.size"),type:"number",widget:"inputNumber",span:6,disabled:nt},characterSpacing:{title:$("schemas.text.spacing"),type:"number",widget:"inputNumber",span:6},alignment:{title:$("schemas.text.textAlign"),type:"string",widget:"select",props:{options:[{label:$("schemas.left"),value:DEFAULT_ALIGNMENT},{label:$("schemas.center"),value:ALIGN_CENTER},{label:$("schemas.right"),value:ALIGN_RIGHT}]},span:8},verticalAlignment:{title:$("schemas.text.verticalAlign"),type:"string",widget:"select",props:{options:[{label:$("schemas.top"),value:VERTICAL_ALIGN_TOP},{label:$("schemas.middle"),value:VERTICAL_ALIGN_MIDDLE},{label:$("schemas.bottom"),value:VERTICAL_ALIGN_BOTTOM}]},span:8},lineHeight:{title:$("schemas.text.lineHeight"),type:"number",widget:"inputNumber",props:{step:.1},span:8},useDynamicFontSize:{type:"boolean",widget:"UseDynamicFontSize",bind:!1,span:16},dynamicFontSize:{type:"object",widget:"card",column:3,properties:{min:{title:$("schemas.text.min"),type:"number",widget:"inputNumber",hidden:!nt},max:{title:$("schemas.text.max"),type:"number",widget:"inputNumber",hidden:!nt},fit:{title:$("schemas.text.fit"),type:"string",widget:"select",hidden:!nt,props:{options:[{label:$("schemas.horizontal"),value:DYNAMIC_FIT_HORIZONTAL},{label:$("schemas.vertical"),value:DYNAMIC_FIT_VERTICAL}]}}}},fontColor:{title:$("schemas.textColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("hexColorPrompt")}]},backgroundColor:{title:$("schemas.bgColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("hexColorPrompt")}]}}},widgets:{UseDynamicFontSize},defaultValue:"Type Something...",defaultSchema:{type:"text",position:{x:0,y:0},width:45,height:10,rotate:0,alignment:DEFAULT_ALIGNMENT,verticalAlignment:DEFAULT_VERTICAL_ALIGNMENT,fontSize:DEFAULT_FONT_SIZE,lineHeight:DEFAULT_LINE_HEIGHT,characterSpacing:DEFAULT_CHARACTER_SPACING,dynamicFontSize:void 0,fontColor:DEFAULT_FONT_COLOR,fontName:void 0,backgroundColor:"",opacity:DEFAULT_OPACITY}},mapVerticalAlignToFlex=a=>{switch(a){case VERTICAL_ALIGN_TOP:return"flex-start";case VERTICAL_ALIGN_MIDDLE:return"center";case VERTICAL_ALIGN_BOTTOM:return"flex-end"}return"flex-start"},getBackgroundColor=(a,s,$)=>a?s.backgroundColor?s.backgroundColor:$:"transparent",uiRender=async a=>{const{value:s,schema:$,rootElement:_,mode:_e,onChange:tt,stopEditing:nt,tabIndex:at,placeholder:ot,options:rt,theme:st,_cache:lt}=a,et=(rt==null?void 0:rt.font)||getDefaultFont();let it;const ut=xt=>({textSchema:$,font:et,value:xt,startingFontSize:it,_cache:lt});$.dynamicFontSize&&s&&(it=await calculateDynamicFontSize(ut(s)));const ft=await getFontKitFont($,et,lt),{topAdj:ht,bottomAdj:dt}=getBrowserVerticalFontAdjustments(ft,it??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT),gt=ht.toString(),pt=dt.toString(),mt=document.createElement("div"),ct={padding:0,resize:"none",backgroundColor:getBackgroundColor(s,$,addAlphaToHex(st.colorPrimaryBg,30)),border:"none",display:"flex",flexDirection:"column",justifyContent:mapVerticalAlignToFlex($.verticalAlignment),width:"100%",height:"100%"};Object.assign(mt.style,ct),_.innerHTML="",_.appendChild(mt);const vt={fontFamily:$.fontName?`'${$.fontName}'`:"inherit",color:$.fontColor?$.fontColor:DEFAULT_FONT_COLOR,fontSize:`${it??$.fontSize??DEFAULT_FONT_SIZE}pt`,letterSpacing:`${$.characterSpacing??DEFAULT_CHARACTER_SPACING}pt`,lineHeight:`${$.lineHeight??DEFAULT_LINE_HEIGHT}em`,textAlign:$.alignment??DEFAULT_ALIGNMENT,whiteSpace:"pre-wrap",wordBreak:"break-word",resize:"none",border:"none",outline:"none",marginBottom:`${pt}px`,paddingTop:`${gt}px`,backgroundColor:"transparent"},At=document.createElement("div");if(Object.assign(At.style,vt),isEditable(_e,$)){if(At.contentEditable="plaintext-only",At.tabIndex=at||0,At.innerText=s,At.addEventListener("blur",xt=>{tt&&tt(xt.target.innerText),nt&&nt()}),$.dynamicFontSize&&At.addEventListener("keyup",()=>{setTimeout(()=>{(async()=>{if(!At.textContent)return;it=await calculateDynamicFontSize(ut(At.textContent)),At.style.fontSize=`${it}pt`;const{topAdj:xt,bottomAdj:bt}=getBrowserVerticalFontAdjustments(ft,it??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT);At.style.paddingTop=`${xt}px`,At.style.marginBottom=`${bt}px`})()},0)}),ot&&!s){if(At.innerText=ot,At.style.color=PLACEHOLDER_FONT_COLOR,$.dynamicFontSize){const xt=await calculateDynamicFontSize(ut(ot));At.style.fontSize=`${xt}pt`}At.addEventListener("focus",()=>{At.innerText===ot&&(At.innerText="",At.style.color=$.fontColor??DEFAULT_FONT_COLOR)})}if(mt.appendChild(At),_e==="designer"){At.focus();const xt=window.getSelection(),bt=document.createRange();bt.selectNodeContents(At),bt.collapse(!1),xt==null||xt.removeAllRanges(),xt==null||xt.addRange(bt)}}else At.innerHTML=s.split("").map((xt,bt)=>`<span style="letter-spacing:${String(s).length===bt+1?0:"inherit"};">${xt}</span>`).join(""),mt.appendChild(At)},textSchema={pdf:pdfRender,ui:uiRender,propPanel},text=textSchema;textSchema.pdf,textSchema.ui,{...textSchema.propPanel,defaultSchema:{...textSchema.propPanel.defaultSchema,readOnlyValue:textSchema.propPanel.defaultValue}};const builtInPlugins={Text:text};class BaseUIClass{constructor(s){this.lang=DEFAULT_LANG,this.font=getDefaultFont(),this.pluginsRegistry=builtInPlugins,this.options={},this.setSize=debounce$1(()=>{if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.render()},100),this.resizeObserver=new ResizeObserver(this.setSize),checkUIProps(s);const{domContainer:$,template:_,options:_e={},plugins:tt={}}=s;this.domContainer=$,this.template=generateColumnsAndSampledataIfNeeded(cloneDeep$1(_)),this.options=_e,this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.resizeObserver.observe(this.domContainer);const{lang:nt,font:at}=_e;nt&&(this.lang=nt),at&&(this.font=at),Object.values(tt).length>0&&(this.pluginsRegistry=tt)}getLang(){return this.lang}getFont(){return this.font}getPluginsRegistry(){return this.pluginsRegistry}getOptions(){return this.options}getTemplate(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.template}updateTemplate(s){if(checkTemplate(s),!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.template=cloneDeep$1(s),this.render()}updateOptions(s){checkUIOptions(s);const{lang:$,font:_}=s||{};$&&(this.lang=$),_&&(this.font=_),this.options=Object.assign(this.options,s),this.render()}destroy(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);ReactDOM.unmountComponentAtNode(this.domContainer),this.resizeObserver.unobserve(this.domContainer),this.domContainer=null}}class PreviewUI extends BaseUIClass{constructor(s){super(s),checkPreviewProps(s),this.inputs=cloneDeep$1(s.inputs)}getInputs(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.inputs}setInputs(s){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);checkInputs(s),this.inputs=cloneDeep$1(s),this.render()}}var classnames$1={exports:{}};/*!
|
129
129
|
Copyright (c) 2018 Jed Watson.
|
130
130
|
Licensed under the MIT License (MIT), see
|
131
131
|
http://jedwatson.github.io/classnames
|