altio-chat 1.0.84 → 1.0.85

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.
Files changed (2) hide show
  1. package/dist/widget.js +1 -1
  2. package/package.json +1 -1
package/dist/widget.js CHANGED
@@ -223,7 +223,7 @@ Error generating stack: `+p.message+`
223
223
  $$
224
224
  ${t.trim()}
225
225
  $$
226
- `)}async function rX(n){const e=window.open("about:blank","_blank");e&&(e.opener=null);const t=await Ea.previewUrl({documentId:n});return t?(e?e.location.href=t:window.open(t,"_blank","noopener,noreferrer"),!0):(e==null||e.close(),!1)}const KO="text-[14px] leading-[24px] text-[#070C2F]";function ZO({label:n,onClick:e}){return ue.jsx("button",{type:"button",title:n,onClick:e,className:qn(KO,"cursor-pointer text-left underline decoration-from-font [text-underline-position:from-font]"),children:n})}function QO({label:n}){return ue.jsx("span",{title:n,className:KO,children:n})}function aX({source:n,label:e}){const t=aW(n.noteId),r=lW(n.openable,t);return ue.jsx("li",{className:"flex min-w-0 flex-col",children:r?ue.jsx(ZO,{label:e,onClick:()=>iW(n.noteId,n.owned)}):ue.jsx(QO,{label:e})})}function iX({source:n,label:e,failed:t,onOpen:r}){const{t:a}=lh();return ue.jsxs("li",{className:"flex min-w-0 flex-col",children:[n.documentId?ue.jsx(ZO,{label:e,onClick:()=>r(n.documentId)}):ue.jsx(QO,{label:e}),t&&ue.jsx("span",{className:"text-[11px] leading-[18px] text-[#FF3D3D]",children:a("chat.sources.unavailable","이 문서는 지금 열 수 없습니다.")})]})}function sX({references:n,attachedIds:e}){const{t}=lh(),[r,a]=M.useState(null),i=oW(n,e);if(i.length===0)return null;const s=t("chat.sources.myDrive","내 드라이브"),l=d=>d.kind==="file"?uW(d):d.owned?`${d.name} — ${cW(s,d.path,d.pathTruncated)}`:d.name,u=d=>{a(null),rX(d).then(f=>{f||a(d)})};return ue.jsxs("div",{className:"mt-[14px] flex flex-col gap-[8px]",children:[ue.jsx("span",{className:"text-[14px] leading-[24px] font-semibold text-[#070C2F]",children:t("chat.sources.title","출처")}),ue.jsx("ul",{className:"m-0 flex list-none flex-col p-0",children:i.map(d=>d.kind==="note"?ue.jsx(aX,{source:d,label:l(d)},`note:${d.noteId}`):ue.jsx(iX,{source:d,label:l(d),failed:!!d.documentId&&r===d.documentId,onOpen:u},`file:${d.documentId||d.filename}`))})]})}var oX={9306(n,e,t){var r=t(4901),a=t(6823),i=TypeError;n.exports=function(s){if(r(s))return s;throw new i(a(s)+" is not a function")}},3506(n,e,t){var r=t(3925),a=String,i=TypeError;n.exports=function(s){if(r(s))return s;throw new i("Can't set "+a(s)+" as a prototype")}},7080(n,e,t){var r=t(4402).has;n.exports=function(a){return r(a),a}},3463(n){var e=TypeError;n.exports=function(t){if(typeof t=="string")return t;throw new e("Argument is not a string")}},4328(n,e,t){var r=t(4995),a=new r.WeakMap,i=r.set,s=r.remove;n.exports=function(l){return i(a,l,1),s(a,l),l}},6557(n,e,t){var r=t(4995).has;n.exports=function(a){return r(a),a}},6469(n,e,t){var r=t(608),a=t(2360),i=t(4913).f,s=r("unscopables"),l=Array.prototype;l[s]===void 0&&i(l,s,{configurable:!0,value:a(null)}),n.exports=function(u){l[s][u]=!0}},679(n,e,t){var r=t(1625),a=TypeError;n.exports=function(i,s){if(r(s,i))return i;throw new a("Incorrect invocation")}},3972(n,e,t){var r=t(34),a=String,i=TypeError;n.exports=function(s){if(s===void 0||r(s))return s;throw new i(a(s)+" is not an object or undefined")}},8551(n,e,t){var r=t(34),a=String,i=TypeError;n.exports=function(s){if(r(s))return s;throw new i(a(s)+" is not an object")}},4154(n,e,t){var r=t(6955),a=TypeError;n.exports=function(i){if(r(i)==="Uint8Array")return i;throw new a("Argument is not an Uint8Array")}},7811(n){n.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},7394(n,e,t){var r=t(4576),a=t(6706),i=t(2195),s=r.ArrayBuffer,l=r.TypeError;n.exports=s&&a(s.prototype,"byteLength","get")||function(u){if(i(u)!=="ArrayBuffer")throw new l("ArrayBuffer expected");return u.byteLength}},3238(n,e,t){var r=t(4576),a=t(7811),i=t(7394),s=r.DataView;n.exports=function(l){if(!a||i(l)!==0)return!1;try{return new s(l),!1}catch{return!0}}},5169(n,e,t){var r=t(3238),a=TypeError;n.exports=function(i){if(r(i))throw new a("ArrayBuffer is detached");return i}},5636(n,e,t){var r=t(4576),a=t(9504),i=t(6706),s=t(7696),l=t(5169),u=t(7394),d=t(4483),f=t(1548),m=r.structuredClone,b=r.ArrayBuffer,y=r.DataView,E=Math.max,T=Math.min,w=b.prototype,S=y.prototype,x=a(w.slice),C=i(w,"resizable","get"),I=i(w,"maxByteLength","get"),N=a(S.getInt8),O=a(S.setInt8);n.exports=(f||d)&&function(z,G,$){var H=u(z),X=G===void 0?H:s(G),te=!C||!C(z),ie;if(l(z),f&&(z=m(z,{transfer:[z]}),H===X&&($||te)))return z;if(H>=X&&(!$||te))ie=x(z,0,X);else{var Q=$&&!te&&I?{maxByteLength:E(X,I(z))}:void 0;ie=new b(X,Q);for(var oe=new y(z),W=new y(ie),J=T(X,H),fe=0;fe<J;fe++)O(W,fe,N(oe,fe))}return f||d(z),ie}},4644(n,e,t){var r=t(7811),a=t(3724),i=t(4576),s=t(4901),l=t(34),u=t(9297),d=t(6955),f=t(6823),m=t(6699),b=t(6840),y=t(2106),E=t(1625),T=t(2787),w=t(2967),S=t(608),x=t(3392),C=t(1181),I=C.enforce,N=C.get,O=i.Int8Array,z=O&&O.prototype,G=i.Uint8ClampedArray,$=G&&G.prototype,H=O&&T(O),X=z&&T(z),te=Object.prototype,ie=i.TypeError,Q=S("toStringTag"),oe=x("TYPED_ARRAY_TAG"),W="TypedArrayConstructor",J=r&&!!w&&d(i.opera)!=="Opera",fe=!1,xe,L,le,Ee={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},Ce=function(qe){if(!l(qe))return!1;var dt=d(qe);return dt==="DataView"||u(Ee,dt)||u(j,dt)},De=function(Fe){var qe=T(Fe);if(l(qe)){var dt=N(qe);return dt&&u(dt,W)?dt[W]:De(qe)}},se=function(Fe){if(!l(Fe))return!1;var qe=d(Fe);return u(Ee,qe)||u(j,qe)},me=function(Fe){if(se(Fe))return Fe;throw new ie("Target is not a typed array")},ye=function(Fe){if(s(Fe)&&(!w||E(H,Fe)))return Fe;throw new ie(f(Fe)+" is not a typed array constructor")},Re=function(Fe,qe,dt,bt){if(a){if(dt)for(var Nt in Ee){var Ze=i[Nt];if(Ze&&u(Ze.prototype,Fe))try{delete Ze.prototype[Fe]}catch{try{Ze.prototype[Fe]=qe}catch{}}}(!X[Fe]||dt)&&b(X,Fe,dt?qe:J&&z[Fe]||qe,bt)}},Qe=function(Fe,qe,dt){var bt,Nt;if(a){if(w){if(dt){for(bt in Ee)if(Nt=i[bt],Nt&&u(Nt,Fe))try{delete Nt[Fe]}catch{}}if(!H[Fe]||dt)try{return b(H,Fe,dt?qe:J&&H[Fe]||qe)}catch{}else return}for(bt in Ee)Nt=i[bt],Nt&&(!Nt[Fe]||dt)&&b(Nt,Fe,qe)}};for(xe in Ee)L=i[xe],le=L&&L.prototype,le?I(le)[W]=L:J=!1;for(xe in j)L=i[xe],le=L&&L.prototype,le&&(I(le)[W]=L);if((!J||!s(H)||H===Function.prototype)&&(H=function(){throw new ie("Incorrect invocation")},J))for(xe in Ee)i[xe]&&w(i[xe],H);if((!J||!X||X===te)&&(X=H.prototype,J))for(xe in Ee)i[xe]&&w(i[xe].prototype,X);if(J&&T($)!==X&&w($,X),a&&!u(X,Q)){fe=!0,y(X,Q,{configurable:!0,get:function(){return l(this)?this[oe]:void 0}});for(xe in Ee)i[xe]&&m(i[xe].prototype,oe,xe)}n.exports={NATIVE_ARRAY_BUFFER_VIEWS:J,TYPED_ARRAY_TAG:fe&&oe,aTypedArray:me,aTypedArrayConstructor:ye,exportTypedArrayMethod:Re,exportTypedArrayStaticMethod:Qe,getTypedArrayConstructor:De,isView:Ce,isTypedArray:se,TypedArray:H,TypedArrayPrototype:X}},5370(n,e,t){var r=t(6198);n.exports=function(a,i,s){for(var l=0,u=arguments.length>2?s:r(i),d=new a(u);u>l;)d[l]=i[l++];return d}},9617(n,e,t){var r=t(5397),a=t(5610),i=t(6198),s=function(l){return function(u,d,f){var m=r(u),b=i(m);if(b===0)return!l&&-1;var y=a(f,b),E;if(l&&d!==d){for(;b>y;)if(E=m[y++],E!==E)return!0}else for(;b>y;y++)if((l||y in m)&&m[y]===d)return l||y||0;return!l&&-1}};n.exports={includes:s(!0),indexOf:s(!1)}},4527(n,e,t){var r=t(3724),a=t(4376),i=TypeError,s=Object.getOwnPropertyDescriptor,l=r&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(u){return u instanceof TypeError}})();n.exports=l?function(u,d){if(a(u)&&!s(u,"length").writable)throw new i("Cannot set read only .length");return u.length=d}:function(u,d){return u.length=d}},7680(n,e,t){var r=t(9504);n.exports=r([].slice)},2804(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=e+"+/",r=e+"-_",a=function(i){for(var s={},l=0;l<64;l++)s[i.charAt(l)]=l;return s};n.exports={i2c:t,c2i:a(t),i2cUrl:r,c2iUrl:a(r)}},6319(n,e,t){var r=t(8551),a=t(9539);n.exports=function(i,s,l,u){try{return u?s(r(l)[0],l[1]):s(l)}catch(d){a(i,"throw",d)}}},2195(n,e,t){var r=t(9504),a=r({}.toString),i=r("".slice);n.exports=function(s){return i(a(s),8,-1)}},6955(n,e,t){var r=t(2140),a=t(4901),i=t(2195),s=t(608),l=s("toStringTag"),u=Object,d=i((function(){return arguments})())==="Arguments",f=function(m,b){try{return m[b]}catch{}};n.exports=r?i:function(m){var b,y,E;return m===void 0?"Undefined":m===null?"Null":typeof(y=f(b=u(m),l))=="string"?y:d?i(b):(E=i(b))==="Object"&&a(b.callee)?"Arguments":E}},7740(n,e,t){var r=t(9297),a=t(5031),i=t(7347),s=t(4913);n.exports=function(l,u,d){for(var f=a(u),m=s.f,b=i.f,y=0;y<f.length;y++){var E=f[y];!r(l,E)&&!(d&&r(d,E))&&m(l,E,b(u,E))}}},2211(n,e,t){var r=t(9039);n.exports=!r(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype})},2529(n){n.exports=function(e,t){return{value:e,done:t}}},6699(n,e,t){var r=t(3724),a=t(4913),i=t(6980);n.exports=r?function(s,l,u){return a.f(s,l,i(1,u))}:function(s,l,u){return s[l]=u,s}},6980(n){n.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},4659(n,e,t){var r=t(3724),a=t(4913),i=t(6980);n.exports=function(s,l,u){r?a.f(s,l,i(0,u)):s[l]=u}},2106(n,e,t){var r=t(283),a=t(4913);n.exports=function(i,s,l){return l.get&&r(l.get,s,{getter:!0}),l.set&&r(l.set,s,{setter:!0}),a.f(i,s,l)}},6840(n,e,t){var r=t(4901),a=t(4913),i=t(283),s=t(9433);n.exports=function(l,u,d,f){f||(f={});var m=f.enumerable,b=f.name!==void 0?f.name:u;if(r(d)&&i(d,b,f),f.global)m?l[u]=d:s(u,d);else{try{f.unsafe?l[u]&&(m=!0):delete l[u]}catch{}m?l[u]=d:a.f(l,u,{value:d,enumerable:!1,configurable:!f.nonConfigurable,writable:!f.nonWritable})}return l}},6279(n,e,t){var r=t(6840);n.exports=function(a,i,s){for(var l in i)r(a,l,i[l],s);return a}},9433(n,e,t){var r=t(4576),a=Object.defineProperty;n.exports=function(i,s){try{a(r,i,{value:s,configurable:!0,writable:!0})}catch{r[i]=s}return s}},3724(n,e,t){var r=t(9039);n.exports=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483(n,e,t){var r=t(4576),a=t(9429),i=t(1548),s=r.structuredClone,l=r.ArrayBuffer,u=r.MessageChannel,d=!1,f,m,b,y;if(i)d=function(E){s(E,{transfer:[E]})};else if(l)try{u||(f=a("worker_threads"),f&&(u=f.MessageChannel)),u&&(m=new u,b=new l(2),y=function(E){m.port1.postMessage(null,[E])},b.byteLength===2&&(y(b),b.byteLength===0&&(d=y)))}catch{}n.exports=d},4055(n,e,t){var r=t(4576),a=t(34),i=r.document,s=a(i)&&a(i.createElement);n.exports=function(l){return s?i.createElement(l):{}}},6837(n){var e=TypeError,t=9007199254740991;n.exports=function(r){if(r>t)throw new e("Maximum allowed index exceeded");return r}},5002(n){n.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727(n){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(n,e,t){var r=t(4215);n.exports=r==="NODE"},2839(n,e,t){var r=t(4576),a=r.navigator,i=a&&a.userAgent;n.exports=i?String(i):""},9519(n,e,t){var r=t(4576),a=t(2839),i=r.process,s=r.Deno,l=i&&i.versions||s&&s.version,u=l&&l.v8,d,f;u&&(d=u.split("."),f=d[0]>0&&d[0]<4?1:+(d[0]+d[1])),!f&&a&&(d=a.match(/Edge\/(\d+)/),(!d||d[1]>=74)&&(d=a.match(/Chrome\/(\d+)/),d&&(f=+d[1]))),n.exports=f},4215(n,e,t){var r=t(4576),a=t(2839),i=t(2195),s=function(l){return a.slice(0,l.length)===l};n.exports=(function(){return s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":r.Bun&&typeof Bun.version=="string"?"BUN":r.Deno&&typeof Deno.version=="object"?"DENO":i(r.process)==="process"?"NODE":r.window&&r.document?"BROWSER":"REST"})()},8574(n,e,t){var r=t(9504),a=Error,i=r("".replace),s=(function(d){return String(new a(d).stack)})("zxcasd"),l=/\n\s*at [^:]*:[^\n]*/,u=l.test(s);n.exports=function(d,f){if(u&&typeof d=="string"&&!a.prepareStackTrace)for(;f--;)d=i(d,l,"");return d}},6518(n,e,t){var r=t(4576),a=t(7347).f,i=t(6699),s=t(6840),l=t(9433),u=t(7740),d=t(2796);n.exports=function(f,m){var b=f.target,y=f.global,E=f.stat,T,w,S,x,C,I;if(y?w=r:E?w=r[b]||l(b,{}):w=r[b]&&r[b].prototype,w)for(S in m){if(C=m[S],f.dontCallGetSet?(I=a(w,S),x=I&&I.value):x=w[S],T=d(y?S:b+(E?".":"#")+S,f.forced),!T&&x!==void 0){if(typeof C==typeof x)continue;u(C,x)}(f.sham||x&&x.sham)&&i(C,"sham",!0),s(w,S,C,f)}}},9039(n){n.exports=function(e){try{return!!e()}catch{return!0}}},8745(n,e,t){var r=t(616),a=Function.prototype,i=a.apply,s=a.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},6080(n,e,t){var r=t(7476),a=t(9306),i=t(616),s=r(r.bind);n.exports=function(l,u){return a(l),u===void 0?l:i?s(l,u):function(){return l.apply(u,arguments)}}},616(n,e,t){var r=t(9039);n.exports=!r(function(){var a=function(){}.bind();return typeof a!="function"||a.hasOwnProperty("prototype")})},9565(n,e,t){var r=t(616),a=Function.prototype.call;n.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},350(n,e,t){var r=t(3724),a=t(9297),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,l=a(i,"name"),u=l&&function(){}.name==="something",d=l&&(!r||r&&s(i,"name").configurable);n.exports={EXISTS:l,PROPER:u,CONFIGURABLE:d}},6706(n,e,t){var r=t(9504),a=t(9306);n.exports=function(i,s,l){try{return r(a(Object.getOwnPropertyDescriptor(i,s)[l]))}catch{}}},7476(n,e,t){var r=t(2195),a=t(9504);n.exports=function(i){if(r(i)==="Function")return a(i)}},9504(n,e,t){var r=t(616),a=Function.prototype,i=a.call,s=r&&a.bind.bind(i,i);n.exports=r?s:function(l){return function(){return i.apply(l,arguments)}}},944(n){var e=TypeError;n.exports=function(t){var r=t&&t.alphabet;if(r===void 0||r==="base64"||r==="base64url")return r||"base64";throw new e("Incorrect `alphabet` option")}},9429(n,e,t){var r=t(4576),a=t(6193);n.exports=function(i){if(a){try{return r.process.getBuiltinModule(i)}catch{}try{return Function('return require("'+i+'")')()}catch{}}}},7751(n,e,t){var r=t(4576),a=t(4901),i=function(s){return a(s)?s:void 0};n.exports=function(s,l){return arguments.length<2?i(r[s]):r[s]&&r[s][l]}},1767(n){n.exports=function(e){return{iterator:e,next:e.next,done:!1}}},8646(n,e,t){var r=t(9565),a=t(8551),i=t(1767),s=t(851);n.exports=function(l,u){(!u||typeof l!="string")&&a(l);var d=s(l);return i(a(d!==void 0?r(d,l):l))}},851(n,e,t){var r=t(6955),a=t(5966),i=t(4117),s=t(6269),l=t(608),u=l("iterator");n.exports=function(d){if(!i(d))return a(d,u)||a(d,"@@iterator")||s[r(d)]}},81(n,e,t){var r=t(9565),a=t(9306),i=t(8551),s=t(6823),l=t(851),u=TypeError;n.exports=function(d,f){var m=arguments.length<2?l(d):f;if(a(m))return i(r(m,d));throw new u(s(d)+" is not iterable")}},5966(n,e,t){var r=t(9306),a=t(4117);n.exports=function(i,s){var l=i[s];return a(l)?void 0:r(l)}},3789(n,e,t){var r=t(9306),a=t(8551),i=t(9565),s=t(1291),l=t(1767),u="Invalid size",d=RangeError,f=TypeError,m=Math.max,b=function(y,E){this.set=y,this.size=m(E,0),this.has=r(y.has),this.keys=r(y.keys)};b.prototype={getIterator:function(){return l(a(i(this.keys,this.set)))},includes:function(y){return i(this.has,this.set,y)}},n.exports=function(y){a(y);var E=+y.size;if(E!==E)throw new f(u);var T=s(E);if(T<0)throw new d(u);return new b(y,T)}},4576(n){var e=function(t){return t&&t.Math===Math&&t};n.exports=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof global=="object"&&global)||e(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()},9297(n,e,t){var r=t(9504),a=t(8981),i=r({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,u){return i(a(l),u)}},421(n){n.exports={}},397(n,e,t){var r=t(7751);n.exports=r("document","documentElement")},5917(n,e,t){var r=t(3724),a=t(9039),i=t(4055);n.exports=!r&&!a(function(){return Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a!==7})},7055(n,e,t){var r=t(9504),a=t(9039),i=t(2195),s=Object,l=r("".split);n.exports=a(function(){return!s("z").propertyIsEnumerable(0)})?function(u){return i(u)==="String"?l(u,""):s(u)}:s},3167(n,e,t){var r=t(4901),a=t(34),i=t(2967);n.exports=function(s,l,u){var d,f;return i&&r(d=l.constructor)&&d!==u&&a(f=d.prototype)&&f!==u.prototype&&i(s,f),s}},3706(n,e,t){var r=t(9504),a=t(4901),i=t(7629),s=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(l){return s(l)}),n.exports=i.inspectSource},1181(n,e,t){var r=t(8622),a=t(4576),i=t(34),s=t(6699),l=t(9297),u=t(7629),d=t(6119),f=t(421),m="Object already initialized",b=a.TypeError,y=a.WeakMap,E,T,w,S=function(N){return w(N)?T(N):E(N,{})},x=function(N){return function(O){var z;if(!i(O)||(z=T(O)).type!==N)throw new b("Incompatible receiver, "+N+" required");return z}};if(r||u.state){var C=u.state||(u.state=new y);C.get=C.get,C.has=C.has,C.set=C.set,E=function(N,O){if(C.has(N))throw new b(m);return O.facade=N,C.set(N,O),O},T=function(N){return C.get(N)||{}},w=function(N){return C.has(N)}}else{var I=d("state");f[I]=!0,E=function(N,O){if(l(N,I))throw new b(m);return O.facade=N,s(N,I,O),O},T=function(N){return l(N,I)?N[I]:{}},w=function(N){return l(N,I)}}n.exports={set:E,get:T,has:w,enforce:S,getterFor:x}},4209(n,e,t){var r=t(608),a=t(6269),i=r("iterator"),s=Array.prototype;n.exports=function(l){return l!==void 0&&(a.Array===l||s[i]===l)}},4376(n,e,t){var r=t(2195);n.exports=Array.isArray||function(i){return r(i)==="Array"}},1108(n,e,t){var r=t(6955);n.exports=function(a){var i=r(a);return i==="BigInt64Array"||i==="BigUint64Array"}},4901(n){var e=typeof document=="object"&&document.all;n.exports=typeof e=="undefined"&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"}},2796(n,e,t){var r=t(9039),a=t(4901),i=/#|\.prototype\./,s=function(m,b){var y=u[l(m)];return y===f?!0:y===d?!1:a(b)?r(b):!!b},l=s.normalize=function(m){return String(m).replace(i,".").toLowerCase()},u=s.data={},d=s.NATIVE="N",f=s.POLYFILL="P";n.exports=s},4117(n){n.exports=function(e){return e==null}},34(n,e,t){var r=t(4901);n.exports=function(a){return typeof a=="object"?a!==null:r(a)}},3925(n,e,t){var r=t(34);n.exports=function(a){return r(a)||a===null}},6395(n){n.exports=!1},5810(n,e,t){var r=t(34),a=t(1181).get;n.exports=function(s){if(!r(s))return!1;var l=a(s);return!!l&&l.type==="RawJSON"}},757(n,e,t){var r=t(7751),a=t(4901),i=t(1625),s=t(7040),l=Object;n.exports=s?function(u){return typeof u=="symbol"}:function(u){var d=r("Symbol");return a(d)&&i(d.prototype,l(u))}},507(n,e,t){var r=t(9565);n.exports=function(a,i,s){for(var l=s?a:a.iterator,u=a.next,d,f;!(d=r(u,l)).done;)if(f=i(d.value),f!==void 0)return f}},2652(n,e,t){var r=t(6080),a=t(9565),i=t(8551),s=t(6823),l=t(4209),u=t(6198),d=t(1625),f=t(81),m=t(851),b=t(9539),y=TypeError,E=function(w,S){this.stopped=w,this.result=S},T=E.prototype;n.exports=function(w,S,x){var C=x&&x.that,I=!!(x&&x.AS_ENTRIES),N=!!(x&&x.IS_RECORD),O=!!(x&&x.IS_ITERATOR),z=!!(x&&x.INTERRUPTED),G=r(S,C),$,H,X,te,ie,Q,oe,W=function(xe){var L=$;return $=void 0,L&&b(L,"normal"),new E(!0,xe)},J=function(xe){return I?(i(xe),z?G(xe[0],xe[1],W):G(xe[0],xe[1])):z?G(xe,W):G(xe)};if(N)$=w.iterator;else if(O)$=w;else{if(H=m(w),!H)throw new y(s(w)+" is not iterable");if(l(H)){for(X=0,te=u(w);te>X;X++)if(ie=J(w[X]),ie&&d(T,ie))return ie;return new E(!1)}$=f(w,H)}for(Q=N?w.next:$.next;!(oe=a(Q,$)).done;){var fe=oe.value;try{ie=J(fe)}catch(xe){if($)b($,"throw",xe);else throw xe}if(typeof ie=="object"&&ie&&d(T,ie))return ie}return new E(!1)}},1385(n,e,t){var r=t(9539);n.exports=function(a,i,s){for(var l=a.length-1;l>=0;l--)if(a[l]!==void 0)try{s=r(a[l].iterator,i,s)}catch(u){i="throw",s=u}if(i==="throw")throw s;return s}},9539(n,e,t){var r=t(9565),a=t(8551),i=t(5966);n.exports=function(s,l,u){var d,f;a(s);try{if(d=i(s,"return"),!d){if(l==="throw")throw u;return u}d=r(d,s)}catch(m){f=!0,d=m}if(l==="throw")throw u;if(f)throw d;return a(d),u}},9462(n,e,t){var r=t(9565),a=t(2360),i=t(6699),s=t(6279),l=t(608),u=t(1181),d=t(5966),f=t(7657).IteratorPrototype,m=t(2529),b=t(9539),y=t(1385),E=l("toStringTag"),T="IteratorHelper",w="WrapForValidIterator",S="normal",x="throw",C=u.set,I=function(z){var G=u.getterFor(z?w:T);return s(a(f),{next:function(){var H=G(this);if(z)return H.nextHandler();if(H.done)return m(void 0,!0);try{var X=H.nextHandler();return H.returnHandlerResult?X:m(X,H.done)}catch(te){throw H.done=!0,te}},return:function(){var $=G(this),H=$.iterator,X=$.done;if($.done=!0,z){var te=d(H,"return");return te?r(te,H):m(void 0,!0)}if(X)return m(void 0,!0);if($.inner)try{b($.inner.iterator,S)}catch(ie){return b(H,x,ie)}if($.openIters)try{y($.openIters,S)}catch(ie){if(H)return b(H,x,ie);throw ie}return H&&b(H,S),m(void 0,!0)}})},N=I(!0),O=I(!1);i(O,E,"Iterator Helper"),n.exports=function(z,G,$){var H=function(te,ie){ie?(ie.iterator=te.iterator,ie.next=te.next):ie=te,ie.type=G?w:T,ie.returnHandlerResult=!!$,ie.nextHandler=z,ie.counter=0,ie.done=!1,C(this,ie)};return H.prototype=G?N:O,H}},684(n){n.exports=function(e,t){var r=typeof Iterator=="function"&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch{return!0}}},4549(n,e,t){var r=t(4576);n.exports=function(a,i){var s=r.Iterator,l=s&&s.prototype,u=l&&l[a],d=!1;if(u)try{u.call({next:function(){return{done:!0}},return:function(){d=!0}},-1)}catch(f){f instanceof i||(d=!1)}if(!d)return u}},7657(n,e,t){var r=t(9039),a=t(4901),i=t(34),s=t(2360),l=t(2787),u=t(6840),d=t(608),f=t(6395),m=d("iterator"),b=!1,y,E,T;[].keys&&(T=[].keys(),"next"in T?(E=l(l(T)),E!==Object.prototype&&(y=E)):b=!0);var w=!i(y)||r(function(){var S={};return y[m].call(S)!==S});w?y={}:f&&(y=s(y)),a(y[m])||u(y,m,function(){return this}),n.exports={IteratorPrototype:y,BUGGY_SAFARI_ITERATORS:b}},6269(n){n.exports={}},6198(n,e,t){var r=t(8014);n.exports=function(a){return r(a.length)}},283(n,e,t){var r=t(9504),a=t(9039),i=t(4901),s=t(9297),l=t(3724),u=t(350).CONFIGURABLE,d=t(3706),f=t(1181),m=f.enforce,b=f.get,y=String,E=Object.defineProperty,T=r("".slice),w=r("".replace),S=r([].join),x=l&&!a(function(){return E(function(){},"length",{value:8}).length!==8}),C=String(String).split("String"),I=n.exports=function(N,O,z){T(y(O),0,7)==="Symbol("&&(O="["+w(y(O),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),z&&z.getter&&(O="get "+O),z&&z.setter&&(O="set "+O),(!s(N,"name")||u&&N.name!==O)&&(l?E(N,"name",{value:O,configurable:!0}):N.name=O),x&&z&&s(z,"arity")&&N.length!==z.arity&&E(N,"length",{value:z.arity});try{z&&s(z,"constructor")&&z.constructor?l&&E(N,"prototype",{writable:!1}):N.prototype&&(N.prototype=void 0)}catch{}var G=m(N);return s(G,"source")||(G.source=S(C,typeof O=="string"?O:"")),N};Function.prototype.toString=I(function(){return i(this)&&b(this).source||d(this)},"toString")},2248(n,e,t){var r=t(9504),a=Map.prototype;n.exports={Map,set:r(a.set),get:r(a.get),has:r(a.has),remove:r(a.delete),proto:a}},741(n){var e=Math.ceil,t=Math.floor;n.exports=Math.trunc||function(a){var i=+a;return(i>0?t:e)(i)}},7819(n,e,t){var r=t(9039);n.exports=!r(function(){var a="9007199254740993",i=JSON.rawJSON(a);return!JSON.isRawJSON(i)||JSON.stringify(i)!==a})},6043(n,e,t){var r=t(9306),a=TypeError,i=function(s){var l,u;this.promise=new s(function(d,f){if(l!==void 0||u!==void 0)throw new a("Bad Promise constructor");l=d,u=f}),this.resolve=r(l),this.reject=r(u)};n.exports.f=function(s){return new i(s)}},2603(n,e,t){var r=t(655);n.exports=function(a,i){return a===void 0?arguments.length<2?"":i:r(a)}},4149(n){var e=RangeError;n.exports=function(t){if(t===t)return t;throw new e("NaN is not allowed")}},2360(n,e,t){var r=t(8551),a=t(6801),i=t(8727),s=t(421),l=t(397),u=t(4055),d=t(6119),f=">",m="<",b="prototype",y="script",E=d("IE_PROTO"),T=function(){},w=function(N){return m+y+f+N+m+"/"+y+f},S=function(N){N.write(w("")),N.close();var O=N.parentWindow.Object;return N=null,O},x=function(){var N=u("iframe"),O="java"+y+":",z;return N.style.display="none",l.appendChild(N),N.src=String(O),z=N.contentWindow.document,z.open(),z.write(w("document.F=Object")),z.close(),z.F},C,I=function(){try{C=new ActiveXObject("htmlfile")}catch{}I=typeof document!="undefined"?document.domain&&C?S(C):x():S(C);for(var N=i.length;N--;)delete I[b][i[N]];return I()};s[E]=!0,n.exports=Object.create||function(O,z){var G;return O!==null?(T[b]=r(O),G=new T,T[b]=null,G[E]=O):G=I(),z===void 0?G:a.f(G,z)}},6801(n,e,t){var r=t(3724),a=t(8686),i=t(4913),s=t(8551),l=t(5397),u=t(1072);e.f=r&&!a?Object.defineProperties:function(f,m){s(f);for(var b=l(m),y=u(m),E=y.length,T=0,w;E>T;)i.f(f,w=y[T++],b[w]);return f}},4913(n,e,t){var r=t(3724),a=t(5917),i=t(8686),s=t(8551),l=t(6969),u=TypeError,d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m="enumerable",b="configurable",y="writable";e.f=r?i?function(T,w,S){if(s(T),w=l(w),s(S),typeof T=="function"&&w==="prototype"&&"value"in S&&y in S&&!S[y]){var x=f(T,w);x&&x[y]&&(T[w]=S.value,S={configurable:b in S?S[b]:x[b],enumerable:m in S?S[m]:x[m],writable:!1})}return d(T,w,S)}:d:function(T,w,S){if(s(T),w=l(w),s(S),a)try{return d(T,w,S)}catch{}if("get"in S||"set"in S)throw new u("Accessors not supported");return"value"in S&&(T[w]=S.value),T}},7347(n,e,t){var r=t(3724),a=t(9565),i=t(8773),s=t(6980),l=t(5397),u=t(6969),d=t(9297),f=t(5917),m=Object.getOwnPropertyDescriptor;e.f=r?m:function(y,E){if(y=l(y),E=u(E),f)try{return m(y,E)}catch{}if(d(y,E))return s(!a(i.f,y,E),y[E])}},8480(n,e,t){var r=t(1828),a=t(8727),i=a.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(l){return r(l,i)}},3717(n,e){e.f=Object.getOwnPropertySymbols},2787(n,e,t){var r=t(9297),a=t(4901),i=t(8981),s=t(6119),l=t(2211),u=s("IE_PROTO"),d=Object,f=d.prototype;n.exports=l?d.getPrototypeOf:function(m){var b=i(m);if(r(b,u))return b[u];var y=b.constructor;return a(y)&&b instanceof y?y.prototype:b instanceof d?f:null}},1625(n,e,t){var r=t(9504);n.exports=r({}.isPrototypeOf)},1828(n,e,t){var r=t(9504),a=t(9297),i=t(5397),s=t(9617).indexOf,l=t(421),u=r([].push);n.exports=function(d,f){var m=i(d),b=0,y=[],E;for(E in m)!a(l,E)&&a(m,E)&&u(y,E);for(;f.length>b;)a(m,E=f[b++])&&(~s(y,E)||u(y,E));return y}},1072(n,e,t){var r=t(1828),a=t(8727);n.exports=Object.keys||function(s){return r(s,a)}},8773(n,e){var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!t.call({1:2},1);e.f=a?function(s){var l=r(this,s);return!!l&&l.enumerable}:t},2967(n,e,t){var r=t(6706),a=t(34),i=t(7750),s=t(3506);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l=!1,u={},d;try{d=r(Object.prototype,"__proto__","set"),d(u,[]),l=u instanceof Array}catch{}return function(m,b){return i(m),s(b),a(m)&&(l?d(m,b):m.__proto__=b),m}})():void 0)},4270(n,e,t){var r=t(9565),a=t(4901),i=t(34),s=TypeError;n.exports=function(l,u){var d,f;if(u==="string"&&a(d=l.toString)&&!i(f=r(d,l))||a(d=l.valueOf)&&!i(f=r(d,l))||u!=="string"&&a(d=l.toString)&&!i(f=r(d,l)))return f;throw new s("Can't convert object to primitive value")}},5031(n,e,t){var r=t(7751),a=t(9504),i=t(8480),s=t(3717),l=t(8551),u=a([].concat);n.exports=r("Reflect","ownKeys")||function(f){var m=i.f(l(f)),b=s.f;return b?u(m,b(f)):m}},8235(n,e,t){var r=t(9504),a=t(9297),i=SyntaxError,s=parseInt,l=String.fromCharCode,u=r("".charAt),d=r("".slice),f=r(/./.exec),m={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
226
+ `)}async function rX(n){const e=window.open("about:blank","_blank");e&&(e.opener=null);const t=await Ea.previewUrl({documentId:n});return t?(e?e.location.href=t:window.open(t,"_blank","noopener,noreferrer"),!0):(e==null||e.close(),!1)}const KO="text-[14px] leading-[24px] tracking-[0.2px] text-[#070C2F]";function ZO({label:n,onClick:e}){return ue.jsx("button",{type:"button",title:n,onClick:e,className:qn(KO,"cursor-pointer text-left underline decoration-from-font [text-underline-position:from-font]"),children:n})}function QO({label:n}){return ue.jsx("span",{title:n,className:KO,children:n})}function aX({source:n,label:e}){const t=aW(n.noteId),r=lW(n.openable,t);return ue.jsx("li",{className:"flex min-w-0 flex-col",children:r?ue.jsx(ZO,{label:e,onClick:()=>iW(n.noteId,n.owned)}):ue.jsx(QO,{label:e})})}function iX({source:n,label:e,failed:t,onOpen:r}){const{t:a}=lh();return ue.jsxs("li",{className:"flex min-w-0 flex-col",children:[n.documentId?ue.jsx(ZO,{label:e,onClick:()=>r(n.documentId)}):ue.jsx(QO,{label:e}),t&&ue.jsx("span",{className:"text-[11px] leading-[18px] text-[#FF3D3D]",children:a("chat.sources.unavailable","이 문서는 지금 열 수 없습니다.")})]})}function sX({references:n,attachedIds:e}){const{t}=lh(),[r,a]=M.useState(null),i=oW(n,e);if(i.length===0)return null;const s=t("chat.sources.myDrive","내 드라이브"),l=d=>d.kind==="file"?uW(d):d.owned?`${d.name} — ${cW(s,d.path,d.pathTruncated)}`:d.name,u=d=>{a(null),rX(d).then(f=>{f||a(d)})};return ue.jsxs("div",{className:"mt-[14px] flex flex-col gap-[8px]",children:[ue.jsx("span",{className:"text-[14px] leading-[24px] font-semibold tracking-[0.2px] text-[#070C2F]",children:t("chat.sources.title","출처")}),ue.jsx("ul",{className:"m-0 flex list-none flex-col p-0",children:i.map(d=>d.kind==="note"?ue.jsx(aX,{source:d,label:l(d)},`note:${d.noteId}`):ue.jsx(iX,{source:d,label:l(d),failed:!!d.documentId&&r===d.documentId,onOpen:u},`file:${d.documentId||d.filename}`))})]})}var oX={9306(n,e,t){var r=t(4901),a=t(6823),i=TypeError;n.exports=function(s){if(r(s))return s;throw new i(a(s)+" is not a function")}},3506(n,e,t){var r=t(3925),a=String,i=TypeError;n.exports=function(s){if(r(s))return s;throw new i("Can't set "+a(s)+" as a prototype")}},7080(n,e,t){var r=t(4402).has;n.exports=function(a){return r(a),a}},3463(n){var e=TypeError;n.exports=function(t){if(typeof t=="string")return t;throw new e("Argument is not a string")}},4328(n,e,t){var r=t(4995),a=new r.WeakMap,i=r.set,s=r.remove;n.exports=function(l){return i(a,l,1),s(a,l),l}},6557(n,e,t){var r=t(4995).has;n.exports=function(a){return r(a),a}},6469(n,e,t){var r=t(608),a=t(2360),i=t(4913).f,s=r("unscopables"),l=Array.prototype;l[s]===void 0&&i(l,s,{configurable:!0,value:a(null)}),n.exports=function(u){l[s][u]=!0}},679(n,e,t){var r=t(1625),a=TypeError;n.exports=function(i,s){if(r(s,i))return i;throw new a("Incorrect invocation")}},3972(n,e,t){var r=t(34),a=String,i=TypeError;n.exports=function(s){if(s===void 0||r(s))return s;throw new i(a(s)+" is not an object or undefined")}},8551(n,e,t){var r=t(34),a=String,i=TypeError;n.exports=function(s){if(r(s))return s;throw new i(a(s)+" is not an object")}},4154(n,e,t){var r=t(6955),a=TypeError;n.exports=function(i){if(r(i)==="Uint8Array")return i;throw new a("Argument is not an Uint8Array")}},7811(n){n.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},7394(n,e,t){var r=t(4576),a=t(6706),i=t(2195),s=r.ArrayBuffer,l=r.TypeError;n.exports=s&&a(s.prototype,"byteLength","get")||function(u){if(i(u)!=="ArrayBuffer")throw new l("ArrayBuffer expected");return u.byteLength}},3238(n,e,t){var r=t(4576),a=t(7811),i=t(7394),s=r.DataView;n.exports=function(l){if(!a||i(l)!==0)return!1;try{return new s(l),!1}catch{return!0}}},5169(n,e,t){var r=t(3238),a=TypeError;n.exports=function(i){if(r(i))throw new a("ArrayBuffer is detached");return i}},5636(n,e,t){var r=t(4576),a=t(9504),i=t(6706),s=t(7696),l=t(5169),u=t(7394),d=t(4483),f=t(1548),m=r.structuredClone,b=r.ArrayBuffer,y=r.DataView,E=Math.max,T=Math.min,w=b.prototype,S=y.prototype,x=a(w.slice),C=i(w,"resizable","get"),I=i(w,"maxByteLength","get"),N=a(S.getInt8),O=a(S.setInt8);n.exports=(f||d)&&function(z,G,$){var H=u(z),X=G===void 0?H:s(G),te=!C||!C(z),ie;if(l(z),f&&(z=m(z,{transfer:[z]}),H===X&&($||te)))return z;if(H>=X&&(!$||te))ie=x(z,0,X);else{var Q=$&&!te&&I?{maxByteLength:E(X,I(z))}:void 0;ie=new b(X,Q);for(var oe=new y(z),W=new y(ie),J=T(X,H),fe=0;fe<J;fe++)O(W,fe,N(oe,fe))}return f||d(z),ie}},4644(n,e,t){var r=t(7811),a=t(3724),i=t(4576),s=t(4901),l=t(34),u=t(9297),d=t(6955),f=t(6823),m=t(6699),b=t(6840),y=t(2106),E=t(1625),T=t(2787),w=t(2967),S=t(608),x=t(3392),C=t(1181),I=C.enforce,N=C.get,O=i.Int8Array,z=O&&O.prototype,G=i.Uint8ClampedArray,$=G&&G.prototype,H=O&&T(O),X=z&&T(z),te=Object.prototype,ie=i.TypeError,Q=S("toStringTag"),oe=x("TYPED_ARRAY_TAG"),W="TypedArrayConstructor",J=r&&!!w&&d(i.opera)!=="Opera",fe=!1,xe,L,le,Ee={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},Ce=function(qe){if(!l(qe))return!1;var dt=d(qe);return dt==="DataView"||u(Ee,dt)||u(j,dt)},De=function(Fe){var qe=T(Fe);if(l(qe)){var dt=N(qe);return dt&&u(dt,W)?dt[W]:De(qe)}},se=function(Fe){if(!l(Fe))return!1;var qe=d(Fe);return u(Ee,qe)||u(j,qe)},me=function(Fe){if(se(Fe))return Fe;throw new ie("Target is not a typed array")},ye=function(Fe){if(s(Fe)&&(!w||E(H,Fe)))return Fe;throw new ie(f(Fe)+" is not a typed array constructor")},Re=function(Fe,qe,dt,bt){if(a){if(dt)for(var Nt in Ee){var Ze=i[Nt];if(Ze&&u(Ze.prototype,Fe))try{delete Ze.prototype[Fe]}catch{try{Ze.prototype[Fe]=qe}catch{}}}(!X[Fe]||dt)&&b(X,Fe,dt?qe:J&&z[Fe]||qe,bt)}},Qe=function(Fe,qe,dt){var bt,Nt;if(a){if(w){if(dt){for(bt in Ee)if(Nt=i[bt],Nt&&u(Nt,Fe))try{delete Nt[Fe]}catch{}}if(!H[Fe]||dt)try{return b(H,Fe,dt?qe:J&&H[Fe]||qe)}catch{}else return}for(bt in Ee)Nt=i[bt],Nt&&(!Nt[Fe]||dt)&&b(Nt,Fe,qe)}};for(xe in Ee)L=i[xe],le=L&&L.prototype,le?I(le)[W]=L:J=!1;for(xe in j)L=i[xe],le=L&&L.prototype,le&&(I(le)[W]=L);if((!J||!s(H)||H===Function.prototype)&&(H=function(){throw new ie("Incorrect invocation")},J))for(xe in Ee)i[xe]&&w(i[xe],H);if((!J||!X||X===te)&&(X=H.prototype,J))for(xe in Ee)i[xe]&&w(i[xe].prototype,X);if(J&&T($)!==X&&w($,X),a&&!u(X,Q)){fe=!0,y(X,Q,{configurable:!0,get:function(){return l(this)?this[oe]:void 0}});for(xe in Ee)i[xe]&&m(i[xe].prototype,oe,xe)}n.exports={NATIVE_ARRAY_BUFFER_VIEWS:J,TYPED_ARRAY_TAG:fe&&oe,aTypedArray:me,aTypedArrayConstructor:ye,exportTypedArrayMethod:Re,exportTypedArrayStaticMethod:Qe,getTypedArrayConstructor:De,isView:Ce,isTypedArray:se,TypedArray:H,TypedArrayPrototype:X}},5370(n,e,t){var r=t(6198);n.exports=function(a,i,s){for(var l=0,u=arguments.length>2?s:r(i),d=new a(u);u>l;)d[l]=i[l++];return d}},9617(n,e,t){var r=t(5397),a=t(5610),i=t(6198),s=function(l){return function(u,d,f){var m=r(u),b=i(m);if(b===0)return!l&&-1;var y=a(f,b),E;if(l&&d!==d){for(;b>y;)if(E=m[y++],E!==E)return!0}else for(;b>y;y++)if((l||y in m)&&m[y]===d)return l||y||0;return!l&&-1}};n.exports={includes:s(!0),indexOf:s(!1)}},4527(n,e,t){var r=t(3724),a=t(4376),i=TypeError,s=Object.getOwnPropertyDescriptor,l=r&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(u){return u instanceof TypeError}})();n.exports=l?function(u,d){if(a(u)&&!s(u,"length").writable)throw new i("Cannot set read only .length");return u.length=d}:function(u,d){return u.length=d}},7680(n,e,t){var r=t(9504);n.exports=r([].slice)},2804(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=e+"+/",r=e+"-_",a=function(i){for(var s={},l=0;l<64;l++)s[i.charAt(l)]=l;return s};n.exports={i2c:t,c2i:a(t),i2cUrl:r,c2iUrl:a(r)}},6319(n,e,t){var r=t(8551),a=t(9539);n.exports=function(i,s,l,u){try{return u?s(r(l)[0],l[1]):s(l)}catch(d){a(i,"throw",d)}}},2195(n,e,t){var r=t(9504),a=r({}.toString),i=r("".slice);n.exports=function(s){return i(a(s),8,-1)}},6955(n,e,t){var r=t(2140),a=t(4901),i=t(2195),s=t(608),l=s("toStringTag"),u=Object,d=i((function(){return arguments})())==="Arguments",f=function(m,b){try{return m[b]}catch{}};n.exports=r?i:function(m){var b,y,E;return m===void 0?"Undefined":m===null?"Null":typeof(y=f(b=u(m),l))=="string"?y:d?i(b):(E=i(b))==="Object"&&a(b.callee)?"Arguments":E}},7740(n,e,t){var r=t(9297),a=t(5031),i=t(7347),s=t(4913);n.exports=function(l,u,d){for(var f=a(u),m=s.f,b=i.f,y=0;y<f.length;y++){var E=f[y];!r(l,E)&&!(d&&r(d,E))&&m(l,E,b(u,E))}}},2211(n,e,t){var r=t(9039);n.exports=!r(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype})},2529(n){n.exports=function(e,t){return{value:e,done:t}}},6699(n,e,t){var r=t(3724),a=t(4913),i=t(6980);n.exports=r?function(s,l,u){return a.f(s,l,i(1,u))}:function(s,l,u){return s[l]=u,s}},6980(n){n.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},4659(n,e,t){var r=t(3724),a=t(4913),i=t(6980);n.exports=function(s,l,u){r?a.f(s,l,i(0,u)):s[l]=u}},2106(n,e,t){var r=t(283),a=t(4913);n.exports=function(i,s,l){return l.get&&r(l.get,s,{getter:!0}),l.set&&r(l.set,s,{setter:!0}),a.f(i,s,l)}},6840(n,e,t){var r=t(4901),a=t(4913),i=t(283),s=t(9433);n.exports=function(l,u,d,f){f||(f={});var m=f.enumerable,b=f.name!==void 0?f.name:u;if(r(d)&&i(d,b,f),f.global)m?l[u]=d:s(u,d);else{try{f.unsafe?l[u]&&(m=!0):delete l[u]}catch{}m?l[u]=d:a.f(l,u,{value:d,enumerable:!1,configurable:!f.nonConfigurable,writable:!f.nonWritable})}return l}},6279(n,e,t){var r=t(6840);n.exports=function(a,i,s){for(var l in i)r(a,l,i[l],s);return a}},9433(n,e,t){var r=t(4576),a=Object.defineProperty;n.exports=function(i,s){try{a(r,i,{value:s,configurable:!0,writable:!0})}catch{r[i]=s}return s}},3724(n,e,t){var r=t(9039);n.exports=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483(n,e,t){var r=t(4576),a=t(9429),i=t(1548),s=r.structuredClone,l=r.ArrayBuffer,u=r.MessageChannel,d=!1,f,m,b,y;if(i)d=function(E){s(E,{transfer:[E]})};else if(l)try{u||(f=a("worker_threads"),f&&(u=f.MessageChannel)),u&&(m=new u,b=new l(2),y=function(E){m.port1.postMessage(null,[E])},b.byteLength===2&&(y(b),b.byteLength===0&&(d=y)))}catch{}n.exports=d},4055(n,e,t){var r=t(4576),a=t(34),i=r.document,s=a(i)&&a(i.createElement);n.exports=function(l){return s?i.createElement(l):{}}},6837(n){var e=TypeError,t=9007199254740991;n.exports=function(r){if(r>t)throw new e("Maximum allowed index exceeded");return r}},5002(n){n.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727(n){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(n,e,t){var r=t(4215);n.exports=r==="NODE"},2839(n,e,t){var r=t(4576),a=r.navigator,i=a&&a.userAgent;n.exports=i?String(i):""},9519(n,e,t){var r=t(4576),a=t(2839),i=r.process,s=r.Deno,l=i&&i.versions||s&&s.version,u=l&&l.v8,d,f;u&&(d=u.split("."),f=d[0]>0&&d[0]<4?1:+(d[0]+d[1])),!f&&a&&(d=a.match(/Edge\/(\d+)/),(!d||d[1]>=74)&&(d=a.match(/Chrome\/(\d+)/),d&&(f=+d[1]))),n.exports=f},4215(n,e,t){var r=t(4576),a=t(2839),i=t(2195),s=function(l){return a.slice(0,l.length)===l};n.exports=(function(){return s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":r.Bun&&typeof Bun.version=="string"?"BUN":r.Deno&&typeof Deno.version=="object"?"DENO":i(r.process)==="process"?"NODE":r.window&&r.document?"BROWSER":"REST"})()},8574(n,e,t){var r=t(9504),a=Error,i=r("".replace),s=(function(d){return String(new a(d).stack)})("zxcasd"),l=/\n\s*at [^:]*:[^\n]*/,u=l.test(s);n.exports=function(d,f){if(u&&typeof d=="string"&&!a.prepareStackTrace)for(;f--;)d=i(d,l,"");return d}},6518(n,e,t){var r=t(4576),a=t(7347).f,i=t(6699),s=t(6840),l=t(9433),u=t(7740),d=t(2796);n.exports=function(f,m){var b=f.target,y=f.global,E=f.stat,T,w,S,x,C,I;if(y?w=r:E?w=r[b]||l(b,{}):w=r[b]&&r[b].prototype,w)for(S in m){if(C=m[S],f.dontCallGetSet?(I=a(w,S),x=I&&I.value):x=w[S],T=d(y?S:b+(E?".":"#")+S,f.forced),!T&&x!==void 0){if(typeof C==typeof x)continue;u(C,x)}(f.sham||x&&x.sham)&&i(C,"sham",!0),s(w,S,C,f)}}},9039(n){n.exports=function(e){try{return!!e()}catch{return!0}}},8745(n,e,t){var r=t(616),a=Function.prototype,i=a.apply,s=a.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},6080(n,e,t){var r=t(7476),a=t(9306),i=t(616),s=r(r.bind);n.exports=function(l,u){return a(l),u===void 0?l:i?s(l,u):function(){return l.apply(u,arguments)}}},616(n,e,t){var r=t(9039);n.exports=!r(function(){var a=function(){}.bind();return typeof a!="function"||a.hasOwnProperty("prototype")})},9565(n,e,t){var r=t(616),a=Function.prototype.call;n.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},350(n,e,t){var r=t(3724),a=t(9297),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,l=a(i,"name"),u=l&&function(){}.name==="something",d=l&&(!r||r&&s(i,"name").configurable);n.exports={EXISTS:l,PROPER:u,CONFIGURABLE:d}},6706(n,e,t){var r=t(9504),a=t(9306);n.exports=function(i,s,l){try{return r(a(Object.getOwnPropertyDescriptor(i,s)[l]))}catch{}}},7476(n,e,t){var r=t(2195),a=t(9504);n.exports=function(i){if(r(i)==="Function")return a(i)}},9504(n,e,t){var r=t(616),a=Function.prototype,i=a.call,s=r&&a.bind.bind(i,i);n.exports=r?s:function(l){return function(){return i.apply(l,arguments)}}},944(n){var e=TypeError;n.exports=function(t){var r=t&&t.alphabet;if(r===void 0||r==="base64"||r==="base64url")return r||"base64";throw new e("Incorrect `alphabet` option")}},9429(n,e,t){var r=t(4576),a=t(6193);n.exports=function(i){if(a){try{return r.process.getBuiltinModule(i)}catch{}try{return Function('return require("'+i+'")')()}catch{}}}},7751(n,e,t){var r=t(4576),a=t(4901),i=function(s){return a(s)?s:void 0};n.exports=function(s,l){return arguments.length<2?i(r[s]):r[s]&&r[s][l]}},1767(n){n.exports=function(e){return{iterator:e,next:e.next,done:!1}}},8646(n,e,t){var r=t(9565),a=t(8551),i=t(1767),s=t(851);n.exports=function(l,u){(!u||typeof l!="string")&&a(l);var d=s(l);return i(a(d!==void 0?r(d,l):l))}},851(n,e,t){var r=t(6955),a=t(5966),i=t(4117),s=t(6269),l=t(608),u=l("iterator");n.exports=function(d){if(!i(d))return a(d,u)||a(d,"@@iterator")||s[r(d)]}},81(n,e,t){var r=t(9565),a=t(9306),i=t(8551),s=t(6823),l=t(851),u=TypeError;n.exports=function(d,f){var m=arguments.length<2?l(d):f;if(a(m))return i(r(m,d));throw new u(s(d)+" is not iterable")}},5966(n,e,t){var r=t(9306),a=t(4117);n.exports=function(i,s){var l=i[s];return a(l)?void 0:r(l)}},3789(n,e,t){var r=t(9306),a=t(8551),i=t(9565),s=t(1291),l=t(1767),u="Invalid size",d=RangeError,f=TypeError,m=Math.max,b=function(y,E){this.set=y,this.size=m(E,0),this.has=r(y.has),this.keys=r(y.keys)};b.prototype={getIterator:function(){return l(a(i(this.keys,this.set)))},includes:function(y){return i(this.has,this.set,y)}},n.exports=function(y){a(y);var E=+y.size;if(E!==E)throw new f(u);var T=s(E);if(T<0)throw new d(u);return new b(y,T)}},4576(n){var e=function(t){return t&&t.Math===Math&&t};n.exports=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof global=="object"&&global)||e(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()},9297(n,e,t){var r=t(9504),a=t(8981),i=r({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,u){return i(a(l),u)}},421(n){n.exports={}},397(n,e,t){var r=t(7751);n.exports=r("document","documentElement")},5917(n,e,t){var r=t(3724),a=t(9039),i=t(4055);n.exports=!r&&!a(function(){return Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a!==7})},7055(n,e,t){var r=t(9504),a=t(9039),i=t(2195),s=Object,l=r("".split);n.exports=a(function(){return!s("z").propertyIsEnumerable(0)})?function(u){return i(u)==="String"?l(u,""):s(u)}:s},3167(n,e,t){var r=t(4901),a=t(34),i=t(2967);n.exports=function(s,l,u){var d,f;return i&&r(d=l.constructor)&&d!==u&&a(f=d.prototype)&&f!==u.prototype&&i(s,f),s}},3706(n,e,t){var r=t(9504),a=t(4901),i=t(7629),s=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(l){return s(l)}),n.exports=i.inspectSource},1181(n,e,t){var r=t(8622),a=t(4576),i=t(34),s=t(6699),l=t(9297),u=t(7629),d=t(6119),f=t(421),m="Object already initialized",b=a.TypeError,y=a.WeakMap,E,T,w,S=function(N){return w(N)?T(N):E(N,{})},x=function(N){return function(O){var z;if(!i(O)||(z=T(O)).type!==N)throw new b("Incompatible receiver, "+N+" required");return z}};if(r||u.state){var C=u.state||(u.state=new y);C.get=C.get,C.has=C.has,C.set=C.set,E=function(N,O){if(C.has(N))throw new b(m);return O.facade=N,C.set(N,O),O},T=function(N){return C.get(N)||{}},w=function(N){return C.has(N)}}else{var I=d("state");f[I]=!0,E=function(N,O){if(l(N,I))throw new b(m);return O.facade=N,s(N,I,O),O},T=function(N){return l(N,I)?N[I]:{}},w=function(N){return l(N,I)}}n.exports={set:E,get:T,has:w,enforce:S,getterFor:x}},4209(n,e,t){var r=t(608),a=t(6269),i=r("iterator"),s=Array.prototype;n.exports=function(l){return l!==void 0&&(a.Array===l||s[i]===l)}},4376(n,e,t){var r=t(2195);n.exports=Array.isArray||function(i){return r(i)==="Array"}},1108(n,e,t){var r=t(6955);n.exports=function(a){var i=r(a);return i==="BigInt64Array"||i==="BigUint64Array"}},4901(n){var e=typeof document=="object"&&document.all;n.exports=typeof e=="undefined"&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"}},2796(n,e,t){var r=t(9039),a=t(4901),i=/#|\.prototype\./,s=function(m,b){var y=u[l(m)];return y===f?!0:y===d?!1:a(b)?r(b):!!b},l=s.normalize=function(m){return String(m).replace(i,".").toLowerCase()},u=s.data={},d=s.NATIVE="N",f=s.POLYFILL="P";n.exports=s},4117(n){n.exports=function(e){return e==null}},34(n,e,t){var r=t(4901);n.exports=function(a){return typeof a=="object"?a!==null:r(a)}},3925(n,e,t){var r=t(34);n.exports=function(a){return r(a)||a===null}},6395(n){n.exports=!1},5810(n,e,t){var r=t(34),a=t(1181).get;n.exports=function(s){if(!r(s))return!1;var l=a(s);return!!l&&l.type==="RawJSON"}},757(n,e,t){var r=t(7751),a=t(4901),i=t(1625),s=t(7040),l=Object;n.exports=s?function(u){return typeof u=="symbol"}:function(u){var d=r("Symbol");return a(d)&&i(d.prototype,l(u))}},507(n,e,t){var r=t(9565);n.exports=function(a,i,s){for(var l=s?a:a.iterator,u=a.next,d,f;!(d=r(u,l)).done;)if(f=i(d.value),f!==void 0)return f}},2652(n,e,t){var r=t(6080),a=t(9565),i=t(8551),s=t(6823),l=t(4209),u=t(6198),d=t(1625),f=t(81),m=t(851),b=t(9539),y=TypeError,E=function(w,S){this.stopped=w,this.result=S},T=E.prototype;n.exports=function(w,S,x){var C=x&&x.that,I=!!(x&&x.AS_ENTRIES),N=!!(x&&x.IS_RECORD),O=!!(x&&x.IS_ITERATOR),z=!!(x&&x.INTERRUPTED),G=r(S,C),$,H,X,te,ie,Q,oe,W=function(xe){var L=$;return $=void 0,L&&b(L,"normal"),new E(!0,xe)},J=function(xe){return I?(i(xe),z?G(xe[0],xe[1],W):G(xe[0],xe[1])):z?G(xe,W):G(xe)};if(N)$=w.iterator;else if(O)$=w;else{if(H=m(w),!H)throw new y(s(w)+" is not iterable");if(l(H)){for(X=0,te=u(w);te>X;X++)if(ie=J(w[X]),ie&&d(T,ie))return ie;return new E(!1)}$=f(w,H)}for(Q=N?w.next:$.next;!(oe=a(Q,$)).done;){var fe=oe.value;try{ie=J(fe)}catch(xe){if($)b($,"throw",xe);else throw xe}if(typeof ie=="object"&&ie&&d(T,ie))return ie}return new E(!1)}},1385(n,e,t){var r=t(9539);n.exports=function(a,i,s){for(var l=a.length-1;l>=0;l--)if(a[l]!==void 0)try{s=r(a[l].iterator,i,s)}catch(u){i="throw",s=u}if(i==="throw")throw s;return s}},9539(n,e,t){var r=t(9565),a=t(8551),i=t(5966);n.exports=function(s,l,u){var d,f;a(s);try{if(d=i(s,"return"),!d){if(l==="throw")throw u;return u}d=r(d,s)}catch(m){f=!0,d=m}if(l==="throw")throw u;if(f)throw d;return a(d),u}},9462(n,e,t){var r=t(9565),a=t(2360),i=t(6699),s=t(6279),l=t(608),u=t(1181),d=t(5966),f=t(7657).IteratorPrototype,m=t(2529),b=t(9539),y=t(1385),E=l("toStringTag"),T="IteratorHelper",w="WrapForValidIterator",S="normal",x="throw",C=u.set,I=function(z){var G=u.getterFor(z?w:T);return s(a(f),{next:function(){var H=G(this);if(z)return H.nextHandler();if(H.done)return m(void 0,!0);try{var X=H.nextHandler();return H.returnHandlerResult?X:m(X,H.done)}catch(te){throw H.done=!0,te}},return:function(){var $=G(this),H=$.iterator,X=$.done;if($.done=!0,z){var te=d(H,"return");return te?r(te,H):m(void 0,!0)}if(X)return m(void 0,!0);if($.inner)try{b($.inner.iterator,S)}catch(ie){return b(H,x,ie)}if($.openIters)try{y($.openIters,S)}catch(ie){if(H)return b(H,x,ie);throw ie}return H&&b(H,S),m(void 0,!0)}})},N=I(!0),O=I(!1);i(O,E,"Iterator Helper"),n.exports=function(z,G,$){var H=function(te,ie){ie?(ie.iterator=te.iterator,ie.next=te.next):ie=te,ie.type=G?w:T,ie.returnHandlerResult=!!$,ie.nextHandler=z,ie.counter=0,ie.done=!1,C(this,ie)};return H.prototype=G?N:O,H}},684(n){n.exports=function(e,t){var r=typeof Iterator=="function"&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch{return!0}}},4549(n,e,t){var r=t(4576);n.exports=function(a,i){var s=r.Iterator,l=s&&s.prototype,u=l&&l[a],d=!1;if(u)try{u.call({next:function(){return{done:!0}},return:function(){d=!0}},-1)}catch(f){f instanceof i||(d=!1)}if(!d)return u}},7657(n,e,t){var r=t(9039),a=t(4901),i=t(34),s=t(2360),l=t(2787),u=t(6840),d=t(608),f=t(6395),m=d("iterator"),b=!1,y,E,T;[].keys&&(T=[].keys(),"next"in T?(E=l(l(T)),E!==Object.prototype&&(y=E)):b=!0);var w=!i(y)||r(function(){var S={};return y[m].call(S)!==S});w?y={}:f&&(y=s(y)),a(y[m])||u(y,m,function(){return this}),n.exports={IteratorPrototype:y,BUGGY_SAFARI_ITERATORS:b}},6269(n){n.exports={}},6198(n,e,t){var r=t(8014);n.exports=function(a){return r(a.length)}},283(n,e,t){var r=t(9504),a=t(9039),i=t(4901),s=t(9297),l=t(3724),u=t(350).CONFIGURABLE,d=t(3706),f=t(1181),m=f.enforce,b=f.get,y=String,E=Object.defineProperty,T=r("".slice),w=r("".replace),S=r([].join),x=l&&!a(function(){return E(function(){},"length",{value:8}).length!==8}),C=String(String).split("String"),I=n.exports=function(N,O,z){T(y(O),0,7)==="Symbol("&&(O="["+w(y(O),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),z&&z.getter&&(O="get "+O),z&&z.setter&&(O="set "+O),(!s(N,"name")||u&&N.name!==O)&&(l?E(N,"name",{value:O,configurable:!0}):N.name=O),x&&z&&s(z,"arity")&&N.length!==z.arity&&E(N,"length",{value:z.arity});try{z&&s(z,"constructor")&&z.constructor?l&&E(N,"prototype",{writable:!1}):N.prototype&&(N.prototype=void 0)}catch{}var G=m(N);return s(G,"source")||(G.source=S(C,typeof O=="string"?O:"")),N};Function.prototype.toString=I(function(){return i(this)&&b(this).source||d(this)},"toString")},2248(n,e,t){var r=t(9504),a=Map.prototype;n.exports={Map,set:r(a.set),get:r(a.get),has:r(a.has),remove:r(a.delete),proto:a}},741(n){var e=Math.ceil,t=Math.floor;n.exports=Math.trunc||function(a){var i=+a;return(i>0?t:e)(i)}},7819(n,e,t){var r=t(9039);n.exports=!r(function(){var a="9007199254740993",i=JSON.rawJSON(a);return!JSON.isRawJSON(i)||JSON.stringify(i)!==a})},6043(n,e,t){var r=t(9306),a=TypeError,i=function(s){var l,u;this.promise=new s(function(d,f){if(l!==void 0||u!==void 0)throw new a("Bad Promise constructor");l=d,u=f}),this.resolve=r(l),this.reject=r(u)};n.exports.f=function(s){return new i(s)}},2603(n,e,t){var r=t(655);n.exports=function(a,i){return a===void 0?arguments.length<2?"":i:r(a)}},4149(n){var e=RangeError;n.exports=function(t){if(t===t)return t;throw new e("NaN is not allowed")}},2360(n,e,t){var r=t(8551),a=t(6801),i=t(8727),s=t(421),l=t(397),u=t(4055),d=t(6119),f=">",m="<",b="prototype",y="script",E=d("IE_PROTO"),T=function(){},w=function(N){return m+y+f+N+m+"/"+y+f},S=function(N){N.write(w("")),N.close();var O=N.parentWindow.Object;return N=null,O},x=function(){var N=u("iframe"),O="java"+y+":",z;return N.style.display="none",l.appendChild(N),N.src=String(O),z=N.contentWindow.document,z.open(),z.write(w("document.F=Object")),z.close(),z.F},C,I=function(){try{C=new ActiveXObject("htmlfile")}catch{}I=typeof document!="undefined"?document.domain&&C?S(C):x():S(C);for(var N=i.length;N--;)delete I[b][i[N]];return I()};s[E]=!0,n.exports=Object.create||function(O,z){var G;return O!==null?(T[b]=r(O),G=new T,T[b]=null,G[E]=O):G=I(),z===void 0?G:a.f(G,z)}},6801(n,e,t){var r=t(3724),a=t(8686),i=t(4913),s=t(8551),l=t(5397),u=t(1072);e.f=r&&!a?Object.defineProperties:function(f,m){s(f);for(var b=l(m),y=u(m),E=y.length,T=0,w;E>T;)i.f(f,w=y[T++],b[w]);return f}},4913(n,e,t){var r=t(3724),a=t(5917),i=t(8686),s=t(8551),l=t(6969),u=TypeError,d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m="enumerable",b="configurable",y="writable";e.f=r?i?function(T,w,S){if(s(T),w=l(w),s(S),typeof T=="function"&&w==="prototype"&&"value"in S&&y in S&&!S[y]){var x=f(T,w);x&&x[y]&&(T[w]=S.value,S={configurable:b in S?S[b]:x[b],enumerable:m in S?S[m]:x[m],writable:!1})}return d(T,w,S)}:d:function(T,w,S){if(s(T),w=l(w),s(S),a)try{return d(T,w,S)}catch{}if("get"in S||"set"in S)throw new u("Accessors not supported");return"value"in S&&(T[w]=S.value),T}},7347(n,e,t){var r=t(3724),a=t(9565),i=t(8773),s=t(6980),l=t(5397),u=t(6969),d=t(9297),f=t(5917),m=Object.getOwnPropertyDescriptor;e.f=r?m:function(y,E){if(y=l(y),E=u(E),f)try{return m(y,E)}catch{}if(d(y,E))return s(!a(i.f,y,E),y[E])}},8480(n,e,t){var r=t(1828),a=t(8727),i=a.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(l){return r(l,i)}},3717(n,e){e.f=Object.getOwnPropertySymbols},2787(n,e,t){var r=t(9297),a=t(4901),i=t(8981),s=t(6119),l=t(2211),u=s("IE_PROTO"),d=Object,f=d.prototype;n.exports=l?d.getPrototypeOf:function(m){var b=i(m);if(r(b,u))return b[u];var y=b.constructor;return a(y)&&b instanceof y?y.prototype:b instanceof d?f:null}},1625(n,e,t){var r=t(9504);n.exports=r({}.isPrototypeOf)},1828(n,e,t){var r=t(9504),a=t(9297),i=t(5397),s=t(9617).indexOf,l=t(421),u=r([].push);n.exports=function(d,f){var m=i(d),b=0,y=[],E;for(E in m)!a(l,E)&&a(m,E)&&u(y,E);for(;f.length>b;)a(m,E=f[b++])&&(~s(y,E)||u(y,E));return y}},1072(n,e,t){var r=t(1828),a=t(8727);n.exports=Object.keys||function(s){return r(s,a)}},8773(n,e){var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!t.call({1:2},1);e.f=a?function(s){var l=r(this,s);return!!l&&l.enumerable}:t},2967(n,e,t){var r=t(6706),a=t(34),i=t(7750),s=t(3506);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l=!1,u={},d;try{d=r(Object.prototype,"__proto__","set"),d(u,[]),l=u instanceof Array}catch{}return function(m,b){return i(m),s(b),a(m)&&(l?d(m,b):m.__proto__=b),m}})():void 0)},4270(n,e,t){var r=t(9565),a=t(4901),i=t(34),s=TypeError;n.exports=function(l,u){var d,f;if(u==="string"&&a(d=l.toString)&&!i(f=r(d,l))||a(d=l.valueOf)&&!i(f=r(d,l))||u!=="string"&&a(d=l.toString)&&!i(f=r(d,l)))return f;throw new s("Can't convert object to primitive value")}},5031(n,e,t){var r=t(7751),a=t(9504),i=t(8480),s=t(3717),l=t(8551),u=a([].concat);n.exports=r("Reflect","ownKeys")||function(f){var m=i.f(l(f)),b=s.f;return b?u(m,b(f)):m}},8235(n,e,t){var r=t(9504),a=t(9297),i=SyntaxError,s=parseInt,l=String.fromCharCode,u=r("".charAt),d=r("".slice),f=r(/./.exec),m={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
227
227
  `,"\\r":"\r","\\t":" "},b=/^[\da-f]{4}$/i,y=/^[\u0000-\u001F]$/;n.exports=function(E,T){for(var w=!0,S="";T<E.length;){var x=u(E,T);if(x==="\\"){var C=d(E,T,T+2);if(a(m,C))S+=m[C],T+=2;else if(C==="\\u"){T+=2;var I=d(E,T,T+4);if(!f(b,I))throw new i("Bad Unicode escape at: "+T);S+=l(s(I,16)),T+=4}else throw new i('Unknown escape sequence: "'+C+'"')}else if(x==='"'){w=!1,T++;break}else{if(f(y,x))throw new i("Bad control character in string literal at: "+T);S+=x,T++}}if(w)throw new i("Unterminated string at: "+T);return{value:S,end:T}}},1103(n){n.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},7750(n,e,t){var r=t(4117),a=TypeError;n.exports=function(i){if(r(i))throw new a("Can't call method on "+i);return i}},9286(n,e,t){var r=t(4402),a=t(8469),i=r.Set,s=r.add;n.exports=function(l){var u=new i;return a(l,function(d){s(u,d)}),u}},3440(n,e,t){var r=t(7080),a=t(4402),i=t(9286),s=t(5170),l=t(3789),u=t(8469),d=t(507),f=a.has,m=a.remove;n.exports=function(y){var E=r(this),T=l(y),w=i(E);return s(w)<=T.size?u(w,function(S){T.includes(S)&&m(w,S)}):d(T.getIterator(),function(S){f(w,S)&&m(w,S)}),w}},4402(n,e,t){var r=t(9504),a=Set.prototype;n.exports={Set,add:r(a.add),has:r(a.has),remove:r(a.delete),proto:a}},8750(n,e,t){var r=t(7080),a=t(4402),i=t(5170),s=t(3789),l=t(8469),u=t(507),d=a.Set,f=a.add,m=a.has;n.exports=function(y){var E=r(this),T=s(y),w=new d;return i(E)>T.size?u(T.getIterator(),function(S){m(E,S)&&f(w,S)}):l(E,function(S){T.includes(S)&&f(w,S)}),w}},4449(n,e,t){var r=t(7080),a=t(4402).has,i=t(5170),s=t(3789),l=t(8469),u=t(507),d=t(9539);n.exports=function(m){var b=r(this),y=s(m);if(i(b)<=y.size)return l(b,function(T){if(y.includes(T))return!1},!0)!==!1;var E=y.getIterator();return u(E,function(T){if(a(b,T))return d(E.iterator,"normal",!1)})!==!1}},3838(n,e,t){var r=t(7080),a=t(5170),i=t(8469),s=t(3789);n.exports=function(u){var d=r(this),f=s(u);return a(d)>f.size?!1:i(d,function(m){if(!f.includes(m))return!1},!0)!==!1}},8527(n,e,t){var r=t(7080),a=t(4402).has,i=t(5170),s=t(3789),l=t(507),u=t(9539);n.exports=function(f){var m=r(this),b=s(f);if(i(m)<b.size)return!1;var y=b.getIterator();return l(y,function(E){if(!a(m,E))return u(y.iterator,"normal",!1)})!==!1}},8469(n,e,t){var r=t(9504),a=t(507),i=t(4402),s=i.Set,l=i.proto,u=r(l.forEach),d=r(l.keys),f=d(new s).next;n.exports=function(m,b,y){return y?a({iterator:d(m),next:f},b):u(m,b)}},4916(n,e,t){var r=t(7751),a=function(s){return{size:s,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},i=function(s){return{size:s,has:function(){return!0},keys:function(){throw new Error("e")}}};n.exports=function(s,l){var u=r("Set");try{new u()[s](a(0));try{return new u()[s](a(-1)),!1}catch{if(!l)return!0;try{return new u()[s](i(-1/0)),!1}catch{var d=new u([1,2]);return l(d[s](i(1/0)))}}}catch{return!1}}},9835(n){n.exports=function(e){try{var t=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},a=t[e](r);return a.size===1&&a.values().next().value===4}catch{return!1}}},5170(n,e,t){var r=t(6706),a=t(4402);n.exports=r(a.proto,"size","get")||function(i){return i.size}},3650(n,e,t){var r=t(7080),a=t(4402),i=t(9286),s=t(3789),l=t(507),u=a.add,d=a.has,f=a.remove;n.exports=function(b){var y=r(this),E=s(b).getIterator(),T=i(y);return l(E,function(w){d(y,w)?f(T,w):u(T,w)}),T}},4204(n,e,t){var r=t(7080),a=t(4402).add,i=t(9286),s=t(3789),l=t(507);n.exports=function(d){var f=r(this),m=s(d).getIterator(),b=i(f);return l(m,function(y){a(b,y)}),b}},6119(n,e,t){var r=t(5745),a=t(3392),i=r("keys");n.exports=function(s){return i[s]||(i[s]=a(s))}},7629(n,e,t){var r=t(6395),a=t(4576),i=t(9433),s="__core-js_shared__",l=n.exports=a[s]||i(s,{});(l.versions||(l.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(n,e,t){var r=t(7629);n.exports=function(a,i){return r[a]||(r[a]=i||{})}},1548(n,e,t){var r=t(4576),a=t(9039),i=t(9519),s=t(4215),l=r.structuredClone;n.exports=!!l&&!a(function(){if(s==="DENO"&&i>92||s==="NODE"&&i>94||s==="BROWSER"&&i>97)return!1;var u=new ArrayBuffer(8),d=l(u,{transfer:[u]});return u.byteLength!==0||d.byteLength!==8})},4495(n,e,t){var r=t(9519),a=t(9039),i=t(4576),s=i.String;n.exports=!!Object.getOwnPropertySymbols&&!a(function(){var l=Symbol("symbol detection");return!s(l)||!(Object(l)instanceof Symbol)||!Symbol.sham&&r&&r<41})},5610(n,e,t){var r=t(1291),a=Math.max,i=Math.min;n.exports=function(s,l){var u=r(s);return u<0?a(u+l,0):i(u,l)}},5854(n,e,t){var r=t(2777),a=TypeError;n.exports=function(i){var s=r(i,"number");if(typeof s=="number")throw new a("Can't convert number to bigint");return BigInt(s)}},7696(n,e,t){var r=t(1291),a=t(8014),i=RangeError;n.exports=function(s){if(s===void 0)return 0;var l=r(s),u=a(l);if(l!==u)throw new i("Wrong length or index");return u}},5397(n,e,t){var r=t(7055),a=t(7750);n.exports=function(i){return r(a(i))}},1291(n,e,t){var r=t(741);n.exports=function(a){var i=+a;return i!==i||i===0?0:r(i)}},8014(n,e,t){var r=t(1291),a=Math.min;n.exports=function(i){var s=r(i);return s>0?a(s,9007199254740991):0}},8981(n,e,t){var r=t(7750),a=Object;n.exports=function(i){return a(r(i))}},9590(n,e,t){var r=t(1291),a=RangeError;n.exports=function(i){var s=r(i);if(s<0)throw new a("The argument can't be less than 0");return s}},2777(n,e,t){var r=t(9565),a=t(34),i=t(757),s=t(5966),l=t(4270),u=t(608),d=TypeError,f=u("toPrimitive");n.exports=function(m,b){if(!a(m)||i(m))return m;var y=s(m,f),E;if(y){if(b===void 0&&(b="default"),E=r(y,m,b),!a(E)||i(E))return E;throw new d("Can't convert object to primitive value")}return b===void 0&&(b="number"),l(m,b)}},6969(n,e,t){var r=t(2777),a=t(757);n.exports=function(i){var s=r(i,"string");return a(s)?s:s+""}},2140(n,e,t){var r=t(608),a=r("toStringTag"),i={};i[a]="z",n.exports=String(i)==="[object z]"},655(n,e,t){var r=t(6955),a=String;n.exports=function(i){if(r(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return a(i)}},6823(n){var e=String;n.exports=function(t){try{return e(t)}catch{return"Object"}}},3392(n,e,t){var r=t(9504),a=0,i=Math.random(),s=r(1.1.toString);n.exports=function(l){return"Symbol("+(l===void 0?"":l)+")_"+s(++a+i,36)}},9143(n,e,t){var r=t(4576),a=t(9504),i=t(3972),s=t(3463),l=t(9297),u=t(2804),d=t(944),f=t(5169),m=u.c2i,b=u.c2iUrl,y=r.SyntaxError,E=r.TypeError,T=a("".charAt),w=function(C,I){for(var N=C.length;I<N;I++){var O=T(C,I);if(O!==" "&&O!==" "&&O!==`
228
228
  `&&O!=="\f"&&O!=="\r")break}return I},S=function(C,I,N){var O=C.length;O<4&&(C+=O===2?"AA":"A");var z=(I[T(C,0)]<<18)+(I[T(C,1)]<<12)+(I[T(C,2)]<<6)+I[T(C,3)],G=[z>>16&255,z>>8&255,z&255];if(O===2){if(N&&G[1]!==0)throw new y("Extra bits");return[G[0]]}if(O===3){if(N&&G[2]!==0)throw new y("Extra bits");return[G[0],G[1]]}return G},x=function(C,I,N){for(var O=I.length,z=0;z<O;z++)C[N+z]=I[z];return N+O};n.exports=function(C,I,N,O){s(C),i(I);var z=d(I)==="base64"?m:b,G=I?I.lastChunkHandling:void 0;if(G===void 0&&(G="loose"),G!=="loose"&&G!=="strict"&&G!=="stop-before-partial")throw new E("Incorrect `lastChunkHandling` option");N&&f(N.buffer);var $=C.length,H=N||[],X=0,te=0,ie="",Q=0;if(O)for(;;){if(Q=w(C,Q),Q===$){if(ie.length>0){if(G==="stop-before-partial")break;if(G==="loose"){if(ie.length===1)throw new y("Malformed padding: exactly one additional character");X=x(H,S(ie,z,!1),X)}else throw new y("Missing padding")}te=$;break}var oe=T(C,Q);if(++Q,oe==="="){if(ie.length<2)throw new y("Padding is too early");if(Q=w(C,Q),ie.length===2){if(Q===$){if(G==="stop-before-partial")break;throw new y("Malformed padding: only one =")}T(C,Q)==="="&&(++Q,Q=w(C,Q))}if(Q<$)throw new y("Unexpected character after padding");X=x(H,S(ie,z,G==="strict"),X),te=$;break}if(!l(z,oe))throw new y("Unexpected character");var W=O-X;if(W===1&&ie.length===2||W===2&&ie.length===3||(ie+=oe,ie.length===4&&(X=x(H,S(ie,z,!1),X),ie="",te=Q,X===O)))break}return{bytes:H,read:te,written:X}}},2303(n,e,t){var r=t(4576),a=t(9504),i=r.Uint8Array,s=r.SyntaxError,l=Math.min,u=a("".match);n.exports=function(d,f){var m=d.length;if(m%2!==0)throw new s("String should be an even number of characters");for(var b=f?l(f.length,m/2):m/2,y=f||new i(b),E=u(d,/.{2}/g),T=0;T<b;T++){var w=+("0x"+E[T]+"0");if(w!==w)throw new s("String should only contain hex characters");y[T]=w>>4}return{bytes:y,read:T<<1}}},7416(n,e,t){var r=t(9039),a=t(608),i=t(3724),s=t(6395),l=a("iterator");n.exports=!r(function(){var u=new URL("b?a=1&b=2&c=3","https://a"),d=u.searchParams,f=new URLSearchParams("a=1&a=2&b=3"),m="";return u.pathname="c%20d",d.forEach(function(b,y){d.delete("b"),m+=y+b}),f.delete("a",2),f.delete("b",void 0),s&&(!u.toJSON||!f.has("a",1)||f.has("a",2)||!f.has("a",void 0)||f.has("b"))||!d.size&&(s||!i)||!d.sort||u.href!=="https://a/c%20d?a=1&c=3"||d.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!d[l]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||m!=="a1c3"||new URL("https://x",void 0).host!=="x"})},7040(n,e,t){var r=t(4495);n.exports=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686(n,e,t){var r=t(3724),a=t(9039);n.exports=r&&a(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812(n){var e=TypeError;n.exports=function(t,r){if(t<r)throw new e("Not enough arguments");return t}},8622(n,e,t){var r=t(4576),a=t(4901),i=r.WeakMap;n.exports=a(i)&&/native code/.test(String(i))},4995(n,e,t){var r=t(9504),a=WeakMap.prototype;n.exports={WeakMap,set:r(a.set),get:r(a.get),has:r(a.has),remove:r(a.delete)}},608(n,e,t){var r=t(4576),a=t(5745),i=t(9297),s=t(3392),l=t(4495),u=t(7040),d=r.Symbol,f=a("wks"),m=u?d.for||d:d&&d.withoutSetter||s;n.exports=function(b){return i(f,b)||(f[b]=l&&i(d,b)?d[b]:m("Symbol."+b)),f[b]}},6573(n,e,t){var r=t(3724),a=t(2106),i=t(3238),s=ArrayBuffer.prototype;r&&!("detached"in s)&&a(s,"detached",{configurable:!0,get:function(){return i(this)}})},7936(n,e,t){var r=t(6518),a=t(5636);a&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:void 0,!1)}})},8100(n,e,t){var r=t(6518),a=t(5636);a&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:void 0,!0)}})},4423(n,e,t){var r=t(6518),a=t(9617).includes,i=t(9039),s=t(6469),l=i(function(){return!Array(1).includes()}),u=i(function(){return[,1].includes(void 0,1)});r({target:"Array",proto:!0,forced:l||u},{includes:function(f){return a(this,f,arguments.length>1?arguments[1]:void 0)}}),s("includes")},4114(n,e,t){var r=t(6518),a=t(8981),i=t(6198),s=t(4527),l=t(6837),u=t(9039),d=u(function(){return[].push.call({length:4294967296},1)!==4294967297}),f=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(b){return b instanceof TypeError}},m=d||!f();r({target:"Array",proto:!0,arity:1,forced:m},{push:function(y){var E=a(this),T=i(E),w=arguments.length;l(T+w);for(var S=0;S<w;S++)E[T]=arguments[S],T++;return s(E,T),T}})},8111(n,e,t){var r=t(6518),a=t(4576),i=t(679),s=t(8551),l=t(4901),u=t(2787),d=t(2106),f=t(4659),m=t(9039),b=t(9297),y=t(608),E=t(7657).IteratorPrototype,T=t(3724),w=t(6395),S="constructor",x="Iterator",C=y("toStringTag"),I=TypeError,N=a[x],O=w||!l(N)||N.prototype!==E||!m(function(){N({})}),z=function(){if(i(this,E),u(this)===E)throw new I("Abstract class Iterator not directly constructable")},G=function($,H){T?d(E,$,{configurable:!0,get:function(){return H},set:function(X){if(s(this),this===E)throw new I("You can't redefine this property");b(this,$)?this[$]=X:f(this,$,X)}}):E[$]=H};b(E,C)||G(C,x),(O||!b(E,S)||E[S]===Object)&&G(S,z),z.prototype=E,r({global:!0,constructor:!0,forced:O},{Iterator:z})},9314(n,e,t){var r=t(6518),a=t(9565),i=t(8551),s=t(1767),l=t(4149),u=t(9590),d=t(9539),f=t(9462),m=t(684),b=t(4549),y=t(6395),E=!y&&!m("drop",0),T=!y&&!E&&b("drop",RangeError),w=y||E||T,S=f(function(){for(var x=this.iterator,C=this.next,I,N;this.remaining;)if(this.remaining--,I=i(a(C,x)),N=this.done=!!I.done,N)return;if(I=i(a(C,x)),N=this.done=!!I.done,!N)return I.value});r({target:"Iterator",proto:!0,real:!0,forced:w},{drop:function(C){i(this);var I;try{I=u(l(+C))}catch(N){d(this,"throw",N)}return T?a(T,this,I):new S(s(this),{remaining:I})}})},1148(n,e,t){var r=t(6518),a=t(9565),i=t(2652),s=t(9306),l=t(8551),u=t(1767),d=t(9539),f=t(4549),m=f("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:m},{every:function(y){l(this);try{s(y)}catch(w){d(this,"throw",w)}if(m)return a(m,this,y);var E=u(this),T=0;return!i(E,function(w,S){if(!y(w,T++))return S()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(n,e,t){var r=t(6518),a=t(9565),i=t(9306),s=t(8551),l=t(1767),u=t(9462),d=t(6319),f=t(6395),m=t(9539),b=t(684),y=t(4549),E=!f&&!b("filter",function(){}),T=!f&&!E&&y("filter",TypeError),w=f||E||T,S=u(function(){for(var x=this.iterator,C=this.predicate,I=this.next,N,O,z;;){if(N=s(a(I,x)),O=this.done=!!N.done,O)return;if(z=N.value,d(x,C,[z,this.counter++],!0))return z}});r({target:"Iterator",proto:!0,real:!0,forced:w},{filter:function(C){s(this);try{i(C)}catch(I){m(this,"throw",I)}return T?a(T,this,C):new S(l(this),{predicate:C})}})},116(n,e,t){var r=t(6518),a=t(9565),i=t(2652),s=t(9306),l=t(8551),u=t(1767),d=t(9539),f=t(4549),m=f("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:m},{find:function(y){l(this);try{s(y)}catch(w){d(this,"throw",w)}if(m)return a(m,this,y);var E=u(this),T=0;return i(E,function(w,S){if(y(w,T++))return S(w)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},531(n,e,t){var r=t(6518),a=t(9565),i=t(9306),s=t(8551),l=t(1767),u=t(8646),d=t(9462),f=t(9539),m=t(6395),b=t(684),y=t(4549);function E(){try{var C=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(I){return I});C.next(),C.return()}catch{return!0}}var T=!m&&!b("flatMap",function(){}),w=!m&&!T&&y("flatMap",TypeError),S=m||T||w||E(),x=d(function(){for(var C=this.iterator,I=this.mapper,N,O;;){if(O=this.inner)try{if(N=s(a(O.next,O.iterator)),!N.done)return N.value;this.inner=null}catch(z){f(C,"throw",z)}if(N=s(a(this.next,C)),this.done=!!N.done)return;try{this.inner=u(I(N.value,this.counter++),!1)}catch(z){f(C,"throw",z)}}});r({target:"Iterator",proto:!0,real:!0,forced:S},{flatMap:function(I){s(this);try{i(I)}catch(N){f(this,"throw",N)}return w?a(w,this,I):new x(l(this),{mapper:I,inner:null})}})},7588(n,e,t){var r=t(6518),a=t(9565),i=t(2652),s=t(9306),l=t(8551),u=t(1767),d=t(9539),f=t(4549),m=f("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:m},{forEach:function(y){l(this);try{s(y)}catch(w){d(this,"throw",w)}if(m)return a(m,this,y);var E=u(this),T=0;i(E,function(w){y(w,T++)},{IS_RECORD:!0})}})},1701(n,e,t){var r=t(6518),a=t(9565),i=t(9306),s=t(8551),l=t(1767),u=t(9462),d=t(6319),f=t(9539),m=t(684),b=t(4549),y=t(6395),E=!y&&!m("map",function(){}),T=!y&&!E&&b("map",TypeError),w=y||E||T,S=u(function(){var x=this.iterator,C=s(a(this.next,x)),I=this.done=!!C.done;if(!I)return d(x,this.mapper,[C.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:w},{map:function(C){s(this);try{i(C)}catch(I){f(this,"throw",I)}return T?a(T,this,C):new S(l(this),{mapper:C})}})},3579(n,e,t){var r=t(6518),a=t(9565),i=t(2652),s=t(9306),l=t(8551),u=t(1767),d=t(9539),f=t(4549),m=f("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:m},{some:function(y){l(this);try{s(y)}catch(w){d(this,"throw",w)}if(m)return a(m,this,y);var E=u(this),T=0;return i(E,function(w,S){if(y(w,T++))return S()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},4972(n,e,t){var r=t(6518),a=t(9565),i=t(8551),s=t(1767),l=t(4149),u=t(9590),d=t(9462),f=t(9539),m=t(684),b=t(4549),y=t(6395),E=!y&&!m("take",1),T=!y&&!E&&b("take",RangeError),w=y||E||T,S=d(function(){var x=this.iterator;if(!this.remaining--)return this.done=!0,f(x,"normal",void 0);var C=i(a(this.next,x)),I=this.done=!!C.done;if(!I)return C.value});r({target:"Iterator",proto:!0,real:!0,forced:w},{take:function(C){i(this);var I;try{I=u(l(+C))}catch(N){f(this,"throw",N)}return T?a(T,this,I):new S(s(this),{remaining:I})}})},9112(n,e,t){var r=t(6518),a=t(3724),i=t(4576),s=t(7751),l=t(9504),u=t(9565),d=t(4901),f=t(34),m=t(4376),b=t(9297),y=t(655),E=t(6198),T=t(4659),w=t(9039),S=t(8235),x=t(4495),C=i.JSON,I=i.Number,N=i.SyntaxError,O=C&&C.parse,z=s("Object","keys"),G=Object.getOwnPropertyDescriptor,$=l("".charAt),H=l("".slice),X=l(/./.exec),te=l([].push),ie=/^\d$/,Q=/^[1-9]$/,oe=/^[\d-]$/,W=/^[\t\n\r ]$/,J=0,fe=1,xe=function(se,me){se=y(se);var ye=new j(se,0),Re=ye.parse(),Qe=Re.value,Fe=ye.skip(W,Re.end);if(Fe<se.length)throw new N('Unexpected extra character: "'+$(se,Fe)+'" after the parsed data at: '+Fe);return d(me)?L({"":Qe},"",me,Re):Qe},L=function(se,me,ye,Re){var Qe=se[me],Fe=Re&&Qe===Re.value,qe=Fe&&typeof Re.source=="string"?{source:Re.source}:{},dt,bt,Nt,Ze,It;if(f(Qe)){var dn=m(Qe),Gn=Fe?Re.nodes:dn?[]:{};if(dn)for(dt=Gn.length,Nt=E(Qe),Ze=0;Ze<Nt;Ze++)le(Qe,Ze,L(Qe,""+Ze,ye,Ze<dt?Gn[Ze]:void 0));else for(bt=z(Qe),Nt=E(bt),Ze=0;Ze<Nt;Ze++)It=bt[Ze],le(Qe,It,L(Qe,It,ye,b(Gn,It)?Gn[It]:void 0))}return u(ye,se,me,Qe,qe)},le=function(se,me,ye){if(a){var Re=G(se,me);if(Re&&!Re.configurable)return}ye===void 0?delete se[me]:T(se,me,ye)},Ee=function(se,me,ye,Re){this.value=se,this.end=me,this.source=ye,this.nodes=Re},j=function(se,me){this.source=se,this.index=me};j.prototype={fork:function(se){return new j(this.source,se)},parse:function(){var se=this.source,me=this.skip(W,this.index),ye=this.fork(me),Re=$(se,me);if(X(oe,Re))return ye.number();switch(Re){case"{":return ye.object();case"[":return ye.array();case'"':return ye.string();case"t":return ye.keyword(!0);case"f":return ye.keyword(!1);case"n":return ye.keyword(null)}throw new N('Unexpected character: "'+Re+'" at: '+me)},node:function(se,me,ye,Re,Qe){return new Ee(me,Re,se?null:H(this.source,ye,Re),Qe)},object:function(){for(var se=this.source,me=this.index+1,ye=!1,Re={},Qe={},Fe=!1;me<se.length;){if(me=this.until(['"',"}"],me),$(se,me)==="}"&&!ye){me++,Fe=!0;break}var qe=this.fork(me).string(),dt=qe.value;me=qe.end,me=this.until([":"],me)+1,me=this.skip(W,me),qe=this.fork(me).parse(),T(Qe,dt,qe),T(Re,dt,qe.value),me=this.until([",","}"],qe.end);var bt=$(se,me);if(bt===",")ye=!0,me++;else if(bt==="}"){me++,Fe=!0;break}}if(!Fe)throw new N("Unterminated object at: "+me);return this.node(fe,Re,this.index,me,Qe)},array:function(){for(var se=this.source,me=this.index+1,ye=!1,Re=[],Qe=[],Fe=!1;me<se.length;){if(me=this.skip(W,me),$(se,me)==="]"&&!ye){me++,Fe=!0;break}var qe=this.fork(me).parse();if(te(Qe,qe),te(Re,qe.value),me=this.until([",","]"],qe.end),$(se,me)===",")ye=!0,me++;else if($(se,me)==="]"){me++,Fe=!0;break}}if(!Fe)throw new N("Unterminated array at: "+me);return this.node(fe,Re,this.index,me,Qe)},string:function(){var se=this.index,me=S(this.source,this.index+1);return this.node(J,me.value,se,me.end)},number:function(){var se=this.source,me=this.index,ye=me;if($(se,ye)==="-"&&ye++,$(se,ye)==="0")ye++;else if(X(Q,$(se,ye)))ye=this.skip(ie,ye+1);else throw new N("Failed to parse number at: "+ye);if($(se,ye)==="."){var Re=ye+1;if(ye=this.skip(ie,Re),Re===ye)throw new N("Failed to parse number's fraction at: "+ye)}if($(se,ye)==="e"||$(se,ye)==="E"){ye++,($(se,ye)==="+"||$(se,ye)==="-")&&ye++;var Qe=ye;if(ye=this.skip(ie,ye),Qe===ye)throw new N("Failed to parse number's exponent value at: "+ye)}return this.node(J,I(H(se,me,ye)),me,ye)},keyword:function(se){var me=""+se,ye=this.index,Re=ye+me.length;if(H(this.source,ye,Re)!==me)throw new N("Failed to parse value at: "+ye);return this.node(J,se,ye,Re)},skip:function(se,me){for(var ye=this.source;me<ye.length&&X(se,$(ye,me));me++);return me},until:function(se,me){me=this.skip(W,me);for(var ye=$(this.source,me),Re=0;Re<se.length;Re++)if(se[Re]===ye)return me;throw new N('Unexpected character: "'+ye+'" at: '+me)}};var Ce=w(function(){var se="9007199254740993",me;return O(se,function(ye,Re,Qe){me=Qe.source}),me!==se}),De=x&&!w(function(){return 1/O("-0 ")!==-1/0});r({target:"JSON",stat:!0,forced:Ce},{parse:function(me,ye){return De&&!d(ye)?O(me):xe(me,ye)}})},3110(n,e,t){var r=t(6518),a=t(7751),i=t(8745),s=t(9565),l=t(9504),u=t(9039),d=t(4376),f=t(4901),m=t(5810),b=t(757),y=t(2195),E=t(655),T=t(7680),w=t(8235),S=t(3392),x=t(4495),C=t(7819),I=String,N=a("JSON","stringify"),O=l(/./.exec),z=l("".charAt),G=l("".charCodeAt),$=l("".replace),H=l("".slice),X=l([].push),te=l(1.1.toString),ie=/[\uD800-\uDFFF]/g,Q=/^[\uD800-\uDBFF]$/,oe=/^[\uDC00-\uDFFF]$/,W=S(),J=W.length,fe=!x||u(function(){var j=a("Symbol")("stringify detection");return N([j])!=="[null]"||N({a:j})!=="{}"||N(Object(j))!=="{}"}),xe=u(function(){return N("\uDF06\uD834")!=='"\\udf06\\ud834"'||N("\uDEAD")!=='"\\udead"'}),L=fe?function(j,Ce){var De=T(arguments),se=Ee(Ce);if(!(!f(se)&&(j===void 0||b(j))))return De[1]=function(me,ye){if(f(se)&&(ye=s(se,this,I(me),ye)),!b(ye))return ye},i(N,null,De)}:N,le=function(j,Ce,De){var se=z(De,Ce-1),me=z(De,Ce+1);return O(Q,j)&&!O(oe,me)||O(oe,j)&&!O(Q,se)?"\\u"+te(G(j,0),16):j},Ee=function(j){if(f(j))return j;if(d(j)){for(var Ce=j.length,De=[],se=0;se<Ce;se++){var me=j[se];typeof me=="string"?X(De,me):(typeof me=="number"||y(me)==="Number"||y(me)==="String")&&X(De,E(me))}var ye=De.length,Re=!0;return function(Qe,Fe){if(Re)return Re=!1,Fe;if(d(this))return Fe;for(var qe=0;qe<ye;qe++)if(De[qe]===Qe)return Fe}}};N&&r({target:"JSON",stat:!0,arity:3,forced:fe||xe||!C},{stringify:function(Ce,De,se){var me=Ee(De),ye=[],Re=L(Ce,function(Ze,It){var dn=f(me)?s(me,this,I(Ze),It):It;return!C&&m(dn)?W+(X(ye,dn.rawJSON)-1):dn},se);if(typeof Re!="string"||(xe&&(Re=$(Re,ie,le)),C))return Re;for(var Qe="",Fe=Re.length,qe=0;qe<Fe;qe++){var dt=z(Re,qe);if(dt==='"'){var bt=w(Re,++qe).end-1,Nt=H(Re,qe,bt);Qe+=H(Nt,0,J)===W?ye[H(Nt,J)]:'"'+Nt+'"',qe=bt}else Qe+=dt}return Qe}})},2731(n,e,t){var r=t(6518),a=t(9306),i=t(2248),s=t(6395),l=i.get,u=i.has,d=i.set;r({target:"Map",proto:!0,real:!0,forced:s},{getOrInsertComputed:function(m,b){var y=u(this,m);if(a(b),y)return l(this,m);m===0&&1/m===-1/0&&(m=0);var E=b(m);return d(this,m,E),E}})},5367(n,e,t){var r=t(6518),a=t(2248),i=t(6395),s=a.get,l=a.has,u=a.set;r({target:"Map",proto:!0,real:!0,forced:i},{getOrInsert:function(f,m){return l(this,f)?s(this,f):(u(this,f,m),m)}})},3068(n,e,t){var r=t(6518),a=t(9504),i=t(2652),s=RangeError,l=TypeError,u=1/0,d=NaN,f=Math.abs,m=Math.pow,b=a([].push),y=m(2,1023),E=m(2,53)-1,T=Number.MAX_VALUE,w=m(2,971),S={},x={},C={},I={},N={},O=function(z,G){var $=z+G,H=G-($-z);return{hi:$,lo:H}};r({target:"Math",stat:!0},{sumPrecise:function(G){var $=[],H=0,X=I;switch(i(G,function(se){if(++H>E)throw new s("Maximum allowed index exceeded");if(typeof se!="number")throw new l("Value is not a number");X!==S&&(se!==se?X=S:se===u?X=X===x?S:C:se===-u?X=X===C?S:x:(se!==0||1/se===u)&&(X===I||X===N)&&(X=N,b($,se)))}),X){case S:return d;case x:return-u;case C:return u;case I:return-0}for(var te=[],ie=0,Q,oe,W,J,fe,xe,L=0;L<$.length;L++){Q=$[L];for(var le=0,Ee=0;Ee<te.length;Ee++){if(oe=te[Ee],f(Q)<f(oe)&&(xe=Q,Q=oe,oe=xe),W=O(Q,oe),J=W.hi,fe=W.lo,f(J)===u){var j=J===u?1:-1;ie+=j,Q=Q-j*y-j*y,f(Q)<f(oe)&&(xe=Q,Q=oe,oe=xe),W=O(Q,oe),J=W.hi,fe=W.lo}fe!==0&&(te[le++]=fe),Q=J}te.length=le,Q!==0&&b(te,Q)}var Ce=te.length-1;if(J=0,fe=0,ie!==0){var De=Ce>=0?te[Ce]:0;if(Ce--,f(ie)>1||ie>0&&De>0||ie<0&&De<0)return ie>0?u:-u;if(W=O(ie*y,De/2),J=W.hi,fe=W.lo,fe*=2,f(2*J)===u)return J>0?J===y&&fe===-(w/2)&&Ce>=0&&te[Ce]<0?T:u:J===-y&&fe===w/2&&Ce>=0&&te[Ce]>0?-T:-u;fe!==0&&(te[++Ce]=fe,fe=0),J*=2}for(;Ce>=0&&(W=O(J,te[Ce--]),J=W.hi,fe=W.lo,fe===0););return Ce>=0&&(fe<0&&te[Ce]<0||fe>0&&te[Ce]>0)&&(oe=fe*2,Q=J+oe,oe===Q-J&&(J=Q)),J}})},1689(n,e,t){var r=t(6518),a=t(4576),i=t(8745),s=t(7680),l=t(6043),u=t(9306),d=t(1103),f=a.Promise,m=!1,b=!f||!f.try||d(function(){f.try(function(y){m=y===8},8)}).error||!m;r({target:"Promise",stat:!0,forced:b},{try:function(y){var E=arguments.length>1?s(arguments,1):[],T=l.f(this),w=d(function(){return i(u(y),void 0,E)});return(w.error?T.reject:T.resolve)(w.value),T.promise}})},4628(n,e,t){var r=t(6518),a=t(6043);r({target:"Promise",stat:!0},{withResolvers:function(){var s=a.f(this);return{promise:s.promise,resolve:s.resolve,reject:s.reject}}})},7642(n,e,t){var r=t(6518),a=t(3440),i=t(9039),s=t(4916),l=!s("difference",function(d){return d.size===0}),u=l||i(function(){var d={size:1,has:function(){return!0},keys:function(){var m=0;return{next:function(){var b=m++>1;return f.has(1)&&f.clear(),{done:b,value:2}}}}},f=new Set([1,2,3,4]);return f.difference(d).size!==3});r({target:"Set",proto:!0,real:!0,forced:u},{difference:a})},8004(n,e,t){var r=t(6518),a=t(9039),i=t(8750),s=t(4916),l=!s("intersection",function(u){return u.size===2&&u.has(1)&&u.has(2)})||a(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});r({target:"Set",proto:!0,real:!0,forced:l},{intersection:i})},3853(n,e,t){var r=t(6518),a=t(4449),i=t(4916),s=!i("isDisjointFrom",function(l){return!l});r({target:"Set",proto:!0,real:!0,forced:s},{isDisjointFrom:a})},5876(n,e,t){var r=t(6518),a=t(3838),i=t(4916),s=!i("isSubsetOf",function(l){return l});r({target:"Set",proto:!0,real:!0,forced:s},{isSubsetOf:a})},2475(n,e,t){var r=t(6518),a=t(8527),i=t(4916),s=!i("isSupersetOf",function(l){return!l});r({target:"Set",proto:!0,real:!0,forced:s},{isSupersetOf:a})},5024(n,e,t){var r=t(6518),a=t(3650),i=t(9835),s=t(4916),l=!s("symmetricDifference")||!i("symmetricDifference");r({target:"Set",proto:!0,real:!0,forced:l},{symmetricDifference:a})},1698(n,e,t){var r=t(6518),a=t(4204),i=t(9835),s=t(4916),l=!s("union")||!i("union");r({target:"Set",proto:!0,real:!0,forced:l},{union:a})},9577(n,e,t){var r=t(4644),a=t(1108),i=t(6198),s=t(1291),l=t(5854),u=r.aTypedArray,d=r.getTypedArrayConstructor,f=r.exportTypedArrayMethod,m=RangeError,b=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(E){return E===8}})(),y=b&&(function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}})();f("with",function(E,T){var w=u(this),S=i(w),x=s(E),C=x<0?S+x:x,I=a(w)?l(T):+T;if(C>=S||C<0)throw new m("Incorrect index");for(var N=new(d(w))(S),O=0;O<S;O++)N[O]=O===C?I:w[O];return N},!b||y)},5213(n,e,t){var r=t(6518),a=t(4576),i=t(5370),s=t(9143),l=a.Uint8Array,u=!l||!l.fromBase64||!(function(){try{l.fromBase64("a");return}catch{}try{l.fromBase64("",null)}catch{return!0}})();l&&r({target:"Uint8Array",stat:!0,forced:u},{fromBase64:function(f){var m=s(f,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return i(l,m.bytes)}})},6632(n,e,t){var r=t(6518),a=t(4576),i=t(9143),s=t(4154),l=a.Uint8Array,u=!l||!l.prototype.setFromBase64||!(function(){var d=new l([255,255,255,255,255]);try{d.setFromBase64("",null);return}catch{}try{d.setFromBase64("a");return}catch{}try{d.setFromBase64("MjYyZg===")}catch{return d[0]===50&&d[1]===54&&d[2]===50&&d[3]===255&&d[4]===255}})();l&&r({target:"Uint8Array",proto:!0,forced:u},{setFromBase64:function(f){s(this);var m=i(f,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:m.read,written:m.written}}})},4226(n,e,t){var r=t(6518),a=t(4576),i=t(3463),s=t(4154),l=t(5169),u=t(2303);function d(){try{var f=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(f).setFromHex("cafed00d")}catch{return!0}}a.Uint8Array&&r({target:"Uint8Array",proto:!0,forced:d()},{setFromHex:function(m){s(this),i(m),l(this.buffer);var b=u(m,this).read;return{read:b,written:b/2}}})},9486(n,e,t){var r=t(6518),a=t(4576),i=t(9504),s=t(3972),l=t(4154),u=t(5169),d=t(2804),f=t(944),m=d.i2c,b=d.i2cUrl,y=i("".charAt),E=a.Uint8Array,T=!E||!E.prototype.toBase64||!(function(){try{var w=new E;w.toBase64(null)}catch{return!0}})();E&&r({target:"Uint8Array",proto:!0,forced:T},{toBase64:function(){var S=l(this),x=arguments.length?s(arguments[0]):void 0,C=f(x)==="base64"?m:b,I=!!x&&!!x.omitPadding;u(this.buffer);for(var N="",O=0,z=S.length,G,$=function(H){return y(C,G>>6*H&63)};O+2<z;O+=3)G=(S[O]<<16)+(S[O+1]<<8)+S[O+2],N+=$(3)+$(2)+$(1)+$(0);return O+2===z?(G=(S[O]<<16)+(S[O+1]<<8),N+=$(3)+$(2)+$(1)+(I?"":"=")):O+1===z&&(G=S[O]<<16,N+=$(3)+$(2)+(I?"":"==")),N}})},456(n,e,t){var r=t(6518),a=t(4576),i=t(9504),s=t(4154),l=t(5169),u=i(1.1.toString),d=i([].join),f=Array,m=a.Uint8Array,b=!m||!m.prototype.toHex||!(function(){try{var y=new m([255,255,255,255,255,255,255,255]);return y.toHex()==="ffffffffffffffff"}catch{return!1}})();m&&r({target:"Uint8Array",proto:!0,forced:b},{toHex:function(){s(this),l(this.buffer);for(var E=f(this.length),T=0,w=this.length;T<w;T++){var S=u(this[T],16);E[T]=S.length===1?"0"+S:S}return d(E,"")}})},9452(n,e,t){var r=t(6518),a=t(9306),i=t(6557),s=t(4328),l=t(4995),u=t(6395),d=l.get,f=l.has,m=l.set,b=u||!(function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(y){return y instanceof TypeError}})();r({target:"WeakMap",proto:!0,real:!0,forced:b},{getOrInsertComputed:function(E,T){if(u||i(this),s(E),a(T),f(this,E))return d(this,E);var w=T(E);return m(this,E,w),w}})},8454(n,e,t){var r=t(6518),a=t(4995),i=t(6395),s=a.get,l=a.has,u=a.set;r({target:"WeakMap",proto:!0,real:!0,forced:i},{getOrInsert:function(f,m){return l(this,f)?s(this,f):(u(this,f,m),m)}})},4979(n,e,t){var r=t(6518),a=t(4576),i=t(7751),s=t(6980),l=t(4913).f,u=t(9297),d=t(679),f=t(3167),m=t(2603),b=t(5002),y=t(8574),E=t(3724),T=t(6395),w="DOMException",S=i("Error"),x=i(w),C=function(){d(this,I);var W=arguments.length,J=m(W<1?void 0:arguments[0]),fe=m(W<2?void 0:arguments[1],"Error"),xe=new x(J,fe),L=new S(J);return L.name=w,l(xe,"stack",s(1,y(L.stack,1))),f(xe,this,C),xe},I=C.prototype=x.prototype,N="stack"in new S(w),O="stack"in new x(1,2),z=x&&E&&Object.getOwnPropertyDescriptor(a,w),G=!!z&&!(z.writable&&z.configurable),$=N&&!G&&!O;r({global:!0,constructor:!0,forced:T||$},{DOMException:$?C:x});var H=i(w),X=H.prototype;if(X.constructor!==H){T||l(X,"constructor",s(1,H));for(var te in b)if(u(b,te)){var ie=b[te],Q=ie.s;u(H,Q)||l(H,Q,s(6,ie.c))}}},4603(n,e,t){var r=t(6840),a=t(9504),i=t(655),s=t(2812),l=URLSearchParams,u=l.prototype,d=a(u.append),f=a(u.delete),m=a(u.forEach),b=a([].push),y=new l("a=1&a=2&b=3");y.delete("a",1),y.delete("b",void 0),y+""!="a=2"&&r(u,"delete",function(E){var T=arguments.length,w=T<2?void 0:arguments[1];if(T&&w===void 0)return f(this,E);var S=[];m(this,function(z,G){b(S,{key:G,value:z})}),s(T,1);for(var x=i(E),C=i(w),I=0,N=S.length,O;I<N;)O=S[I],f(this,O.key),I++;for(I=0;I<N;)O=S[I++],O.key===x&&O.value===C||d(this,O.key,O.value)},{enumerable:!0,unsafe:!0})},7566(n,e,t){var r=t(6840),a=t(9504),i=t(655),s=t(2812),l=URLSearchParams,u=l.prototype,d=a(u.getAll),f=a(u.has),m=new l("a=1");(m.has("a",2)||!m.has("a",void 0))&&r(u,"has",function(y){var E=arguments.length,T=E<2?void 0:arguments[1];if(E&&T===void 0)return f(this,y);var w=d(this,y);s(E,1);for(var S=i(T),x=0;x<w.length;)if(w[x++]===S)return!0;return!1},{enumerable:!0,unsafe:!0})},8721(n,e,t){var r=t(3724),a=t(9504),i=t(2106),s=URLSearchParams.prototype,l=a(s.forEach);r&&!("size"in s)&&i(s,"size",{get:function(){var d=0;return l(this,function(){d++}),d},configurable:!0,enumerable:!0})},5781(n,e,t){var r=t(6518),a=t(7751),i=t(2812),s=t(655),l=t(7416),u=a("URL");r({target:"URL",stat:!0,forced:!l},{parse:function(f){var m=i(arguments.length,1),b=s(f),y=m<2||arguments[1]===void 0?void 0:s(arguments[1]);try{return new u(b,y)}catch{return null}}})}},JO={};function At(n){var e=JO[n];if(e!==void 0)return e.exports;var t=JO[n]={exports:{}};return oX[n].call(t.exports,t,t.exports,At),t.exports}At.d=(n,e)=>{for(var t in e)At.o(e,t)&&!At.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},At.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),At(4423),At(4114),At(6573),At(8100),At(7936),At(5367),At(2731),At(9577),At(6632),At(4226),At(9486),At(456),At(5781);const Gi=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),zl=[1/0,1/0,-1/0,-1/0],mh=new Float32Array(zl),rA=[.001,0,0,.001,0,0],aA=1.35,ji={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},dc={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},h1="pdfjs_internal_editor_",kt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Dt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},lX={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Gr={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},K2={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ir={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},$f={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Z2={ERRORS:0,WARNINGS:1,INFOS:5},Ul={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},f1={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},uX={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Q2=Z2.WARNINGS;function cX(n){Number.isInteger(n)&&(Q2=n)}function dX(){return Q2}function J2(n){Q2>=Z2.INFOS&&console.info(`Info: ${n}`)}function xt(n){Q2>=Z2.WARNINGS&&console.warn(`Warning: ${n}`)}function pn(n){throw new Error(n)}function rr(n,e){n||pn(e)}function hX(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function e9(n,e=null,t=null){if(!n)return null;if(t&&typeof n=="string"){if(t.addDefaultProtocol&&n.startsWith("www.")){const a=n.match(/\./g);(a==null?void 0:a.length)>=2&&(n=`http://${n}`)}if(t.tryConvertEncoding)try{n=gX(n)}catch{}}const r=e?URL.parse(n,e):URL.parse(n);return hX(r)?r:null}function t9(n,e,t=!1){const r=URL.parse(n);return r?(r.hash=e,r.href):t&&e9(n,"http://example.com")?n.split("#",1)[0]+`${e?`#${e}`:""}`:""}function iA(n){return n.substring(n.lastIndexOf("/")+1)}function _t(n,e,t,r=!1){return Object.defineProperty(n,e,{value:t,enumerable:!r,configurable:!0,writable:!1}),t}const gh=(function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e})();class n9 extends gh{constructor(e,t){super(e,"PasswordException"),this.code=t}}class sA extends gh{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class oA extends gh{constructor(e){super(e,"InvalidPDFException")}}class ev extends gh{constructor(e,t,r){super(e,"ResponseException"),this.status=t,this.missing=r}}class fX extends gh{constructor(e){super(e,"FormatError")}}class hc extends gh{constructor(e){super(e,"AbortException")}}function pX(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&pn("Invalid argument for bytesToString");const e=n.length,t=8192;if(e<t)return String.fromCharCode.apply(null,n);const r=[];for(let a=0;a<e;a+=t){const i=Math.min(a+t,e),s=n.subarray(a,i);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function tv(n){typeof n!="string"&&pn("Invalid argument for stringToBytes");const e=n.length,t=new Uint8Array(e);for(let r=0;r<e;++r)t[r]=n.charCodeAt(r)&255;return t}function mX(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}class _r{static get isLittleEndian(){return _t(this,"isLittleEndian",mX())}static get isOffscreenCanvasSupported(){return _t(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas!="undefined")}static get isImageDecoderSupported(){return _t(this,"isImageDecoderSupported",typeof ImageDecoder!="undefined")}static get isFloat16ArraySupported(){return _t(this,"isFloat16ArraySupported",typeof Float16Array!="undefined")}static get isSanitizerSupported(){return _t(this,"isSanitizerSupported",typeof Sanitizer!="undefined")}static get platform(){const{platform:e,userAgent:t}=navigator;return _t(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){var e,t;return _t(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}static get isAlphaColorInputSupported(){return _t(this,"isAlphaColorInputSupported",(()=>{if(typeof document=="undefined")return!1;const e=document.createElement("input");return e.type="color",e.setAttribute("alpha",""),e.value="#ff000080",e.value!=="#ff0000"})())}}class We{static get hexNums(){return _t(this,"hexNums",Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0")))}static makeHexColor(e,t,r){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[r]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,r=0){const a=e[r],i=e[r+1];e[r]=a*t[0]+i*t[2]+t[4],e[r+1]=a*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,r=0){const a=t[0],i=t[1],s=t[2],l=t[3],u=t[4],d=t[5];for(let f=0;f<6;f+=2){const m=e[r+f],b=e[r+f+1];e[r+f]=m*a+b*s+u,e[r+f+1]=m*i+b*l+d}}static applyInverseTransform(e,t){const r=e[0],a=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(r*t[3]-a*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-r*t[1]+a*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,r){const a=t[0],i=t[1],s=t[2],l=t[3],u=t[4],d=t[5],f=e[0],m=e[1],b=e[2],y=e[3];let E=a*f+u,T=E,w=a*b+u,S=w,x=l*m+d,C=x,I=l*y+d,N=I;if(i!==0||s!==0){const O=i*f,z=i*b,G=s*m,$=s*y;E+=G,S+=G,w+=$,T+=$,x+=O,N+=O,I+=z,C+=z}r[0]=Math.min(r[0],E,w,T,S),r[1]=Math.min(r[1],x,I,C,N),r[2]=Math.max(r[2],E,w,T,S),r[3]=Math.max(r[3],x,I,C,N)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const r=e[0],a=e[1],i=e[2],s=e[3],l=r**2+a**2,u=r*i+a*s,d=i**2+s**2,f=(l+d)/2,m=Math.sqrt(f**2-(l*d-u**2));t[0]=Math.sqrt(f+m||1),t[1]=Math.sqrt(f-m||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),a=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>a)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>s?null:[r,i,a,s]}static pointBoundingBox(e,t,r){r[0]=Math.min(r[0],e),r[1]=Math.min(r[1],t),r[2]=Math.max(r[2],e),r[3]=Math.max(r[3],t)}static rectBoundingBox(e,t,r,a,i){i[0]=Math.min(i[0],e,r),i[1]=Math.min(i[1],t,a),i[2]=Math.max(i[2],e,r),i[3]=Math.max(i[3],t,a)}static bezierBoundingBox(e,t,r,a,i,s,l,u,d){d[0]=Math.min(d[0],e,l),d[1]=Math.min(d[1],t,u),d[2]=Math.max(d[2],e,l),d[3]=Math.max(d[3],t,u),P(this,eu,N_).call(this,e,r,i,l,t,a,s,u,3*(-e+3*(r-i)+l),6*(e-2*r+i),3*(r-e),d),P(this,eu,N_).call(this,e,r,i,l,t,a,s,u,3*(-t+3*(a-s)+u),6*(t-2*a+s),3*(a-t),d)}}eu=new WeakSet,CT=function(e,t,r,a,i,s,l,u,d,f){if(d<=0||d>=1)return;const m=1-d,b=d*d,y=b*d,E=m*(m*(m*e+3*d*t)+3*b*r)+y*a,T=m*(m*(m*i+3*d*s)+3*b*l)+y*u;f[0]=Math.min(f[0],E),f[1]=Math.min(f[1],T),f[2]=Math.max(f[2],E),f[3]=Math.max(f[3],T)},N_=function(e,t,r,a,i,s,l,u,d,f,m,b){if(Math.abs(d)<1e-12){Math.abs(f)>=1e-12&&P(this,eu,CT).call(this,e,t,r,a,i,s,l,u,-m/f,b);return}const y=f**2-4*m*d;if(y<0)return;const E=Math.sqrt(y),T=2*d;P(this,eu,CT).call(this,e,t,r,a,i,s,l,u,(-f+E)/T,b),P(this,eu,CT).call(this,e,t,r,a,i,s,l,u,(-f-E)/T,b)},D(We,eu);function gX(n){return decodeURIComponent(escape(n))}let lA=null,r9=null;function bX(n){return lA||(lA=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,r9=new Map([["ſt","ſt"]])),n.replaceAll(lA,(e,t,r)=>t?t.normalize("NFKC"):r9.get(r))}function a9(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),pX(n)}const Vf="pdfjs_internal_id_";function yX(n,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[r,a,...i]=t;if(!n(r)&&!Number.isInteger(r)||!e(a))return!1;const s=i.length;let l=!0;switch(a.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;l=!1;break;default:return!1}for(const u of i)if(!(typeof u=="number"||l&&u===null))return!1;return!0}const uA=()=>[],cA=()=>new Map,dA=()=>Object.create(null);typeof Blob.prototype.bytes!="function"&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),typeof Response.prototype.bytes!="function"&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),typeof AbortSignal.any!="function"&&(AbortSignal.any=function(n){const e=new AbortController,{signal:t}=e;for(const r of n)if(r.aborted)return e.abort(r.reason),t;for(const r of n)r.addEventListener("abort",()=>{e.abort(r.reason)},{signal:t});return t}),At(8111),At(1701),At(4603),At(7566),At(8721);function Wn(n,e,t){return Math.min(Math.max(n,e),t)}class p1{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};function a(i){var u;if(!i)return;let s=null;const l=i.name;if(l==="#text")s=i.value;else if(p1.shouldBuildText(l))(u=i==null?void 0:i.attributes)!=null&&u.textContent?s=i.attributes.textContent:i.value&&(s=i.value);else return;if(s!==null&&t.push({str:s}),!!i.children)for(const d of i.children)a(d)}return a(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class i9{static setupStorage(e,t,r,a,i){const s=a.getValue(t,{value:null});switch(r.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),i==="print")break;e.addEventListener("input",l=>{a.setValue(t,{value:l.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),i==="print")break;e.addEventListener("change",l=>{a.setValue(t,{value:l.target.checked?l.target.getAttribute("xfaOn"):l.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),i==="print")break;e.addEventListener("input",l=>{a.setValue(t,{value:l.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const l of r.children)l.attributes.value===s.value?l.attributes.selected=!0:Object.hasOwn(l.attributes,"selected")&&delete l.attributes.selected}e.addEventListener("input",l=>{const u=l.target.options,d=u.selectedIndex===-1?"":u[u.selectedIndex].value;a.setValue(t,{value:d})});break}}static setAttributes({html:e,element:t,storage:r=null,intent:a,linkService:i}){const{attributes:s}=t,l=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${a}`);for(const[u,d]of Object.entries(s))if(d!=null)switch(u){case"class":d.length&&e.setAttribute(u,d.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",d);break;case"style":Object.assign(e.style,d);break;case"textContent":e.textContent=d;break;default:(!l||u!=="href"&&u!=="newWindow")&&e.setAttribute(u,d)}l&&i.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,t,r)}static render(e){var m,b;const t=e.annotationStorage,r=e.linkService,a=e.xfaHtml,i=e.intent||"display",s=document.createElement(a.name);a.attributes&&this.setAttributes({html:s,element:a,intent:i,linkService:r});const l=i!=="richText",u=e.div;if(u.append(s),e.viewport){const y=`matrix(${e.viewport.transform.join(",")})`;u.style.transform=y}l&&u.setAttribute("class","xfaLayer xfaFont");const d=[];if(a.children.length===0){if(a.value){const y=document.createTextNode(a.value);s.append(y),l&&p1.shouldBuildText(a.name)&&d.push(y)}return{textDivs:d}}const f=[[a,-1,s]];for(;f.length>0;){const[y,E,T]=f.at(-1);if(E+1===y.children.length){f.pop();continue}const w=y.children[++f.at(-1)[1]];if(w===null)continue;const{name:S}=w;if(S==="#text"){const C=document.createTextNode(w.value);d.push(C),T.append(C);continue}const x=(m=w==null?void 0:w.attributes)!=null&&m.xmlns?document.createElementNS(w.attributes.xmlns,S):document.createElement(S);if(T.append(x),w.attributes&&this.setAttributes({html:x,element:w,storage:t,intent:i,linkService:r}),((b=w.children)==null?void 0:b.length)>0)f.push([w,-1,x]);else if(w.value){const C=document.createTextNode(w.value);l&&p1.shouldBuildText(S)&&d.push(C),x.append(C)}}for(const y of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))y.setAttribute("readOnly",!0);return{textDivs:d}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const Hl="http://www.w3.org/2000/svg",jh=class jh{};we(jh,"CSS",96),we(jh,"PDF",72),we(jh,"PDF_TO_CSS_UNITS",jh.CSS/jh.PDF);let fc=jh;async function hA(n,e="text"){if(g1(n,document.baseURI)){const t=await fetch(n);if(!t.ok)throw new Error(t.statusText);switch(e){case"blob":return t.blob();case"bytes":return t.bytes();case"json":return t.json()}return t.text()}return new Promise((t,r)=>{const a=new XMLHttpRequest;a.open("GET",n,!0),a.responseType=e==="bytes"?"arraybuffer":e,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===0){switch(e){case"bytes":t(new Uint8Array(a.response));return;case"blob":case"json":t(a.response);return}t(a.responseText);return}r(new Error(a.statusText))}},a.send(null)})}class m1{constructor({viewBox:e,userUnit:t,scale:r,rotation:a,offsetX:i=0,offsetY:s=0,dontFlip:l=!1}){this.viewBox=e,this.userUnit=t,this.scale=r,this.rotation=a,this.offsetX=i,this.offsetY=s,r*=t;const u=(e[2]+e[0])/2,d=(e[3]+e[1])/2;let f,m,b,y;switch(a%=360,a<0&&(a+=360),a){case 180:f=-1,m=0,b=0,y=1;break;case 90:f=0,m=1,b=1,y=0;break;case 270:f=0,m=-1,b=-1,y=0;break;case 0:f=1,m=0,b=0,y=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}l&&(b=-b,y=-y);let E,T,w,S;f===0?(E=Math.abs(d-e[1])*r+i,T=Math.abs(u-e[0])*r+s,w=(e[3]-e[1])*r,S=(e[2]-e[0])*r):(E=Math.abs(u-e[0])*r+i,T=Math.abs(d-e[1])*r+s,w=(e[2]-e[0])*r,S=(e[3]-e[1])*r),this.transform=[f*r,m*r,b*r,y*r,E-f*r*u-b*r*d,T-m*r*u-y*r*d],this.width=w,this.height=S}get rawDims(){const e=this.viewBox;return _t(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:a=this.offsetY,dontFlip:i=!1}={}){return new m1({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:r,offsetY:a,dontFlip:i})}convertToViewportPoint(e,t){const r=[e,t];return We.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const t=[e[0],e[1]];We.applyTransform(t,this.transform);const r=[e[2],e[3]];return We.applyTransform(r,this.transform),[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){const r=[e,t];return We.applyInverseTransform(r,this.transform),r}}class fA extends gh{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function nv(n){const e=n.length;let t=0;for(;t<e&&n[t].trim()==="";)t++;return n.substring(t,t+5).toLowerCase()==="data:"}function pA(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function EX(n){return[n]=n.split(/[#?]/,1),iA(n)}function vX(n,e="document.pdf"){var l;if(typeof n!="string")return e;if(nv(n))return xt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const r=(u=>{try{return new URL(u)}catch{try{return new URL(decodeURIComponent(u))}catch{try{return new URL(u,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(u),"https://foo.bar")}catch{return null}}}}})(n);if(!r)return e;const a=u=>{try{let d=decodeURIComponent(u);return d.includes("/")&&(d=iA(d),/^\.pdf$/i.test(d))?u:d}catch{return u}},i=/\.pdf$/i,s=iA(r.pathname);if(i.test(s))return a(s);if(r.searchParams.size>0){const u=f=>[...f].findLast(m=>i.test(m)),d=(l=u(r.searchParams.values()))!=null?l:u(r.searchParams.keys());if(d)return a(d)}if(r.hash){const d=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(d)return a(d[0])}return e}class s9{constructor(){D(this,Pc,new Map);we(this,"times",[])}time(e){h(this,Pc).has(e)&&xt(`Timer is already running for ${e}`),h(this,Pc).set(e,Date.now())}timeEnd(e){h(this,Pc).has(e)||xt(`Timer has not been started for ${e}`),this.times.push({name:e,start:h(this,Pc).get(e),end:Date.now()}),h(this,Pc).delete(e)}toString(){const e=Math.max(...this.times.map(t=>t.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms
229
229
  `).join("")}}Pc=new WeakMap;function g1(n,e){var r;const t=e?URL.parse(n,e):URL.parse(n);return/https?:/.test((r=t==null?void 0:t.protocol)!=null?r:"")}function ks(n){n.preventDefault()}function ar(n){n.preventDefault(),n.stopPropagation()}function wX(n){console.log("Deprecated API usage: "+n)}class rv{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;h(this,Tb)||R(this,Tb,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=h(this,Tb).exec(e);if(!t)return null;const r=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let l=parseInt(t[5],10);l=l>=0&&l<=59?l:0;let u=parseInt(t[6],10);u=u>=0&&u<=59?u:0;const d=t[7]||"Z";let f=parseInt(t[8],10);f=f>=0&&f<=23?f:0;let m=parseInt(t[9],10)||0;return m=m>=0&&m<=59?m:0,d==="-"?(s+=f,l+=m):d==="+"&&(s-=f,l-=m),new Date(Date.UTC(r,a,i,s,l,u))}}Tb=new WeakMap,D(rv,Tb);function TX(n,{scale:e=1,rotation:t=0}){const{width:r,height:a}=n.attributes.style,i=[0,0,parseInt(r,10),parseInt(a,10)];return new m1({viewBox:i,userUnit:1,scale:e,rotation:t})}function mA(n){if(n.startsWith("#")){const t=n.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(n.startsWith("rgb(")){const[t,r,a]=n.slice(4,-1).split(",").map(i=>parseInt(i,10));return[t,r,a,1]}if(n.startsWith("rgba(")){const t=n.slice(5,-1).split(",");return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}const e=n.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(parseFloat(e[1])*255),Math.round(parseFloat(e[2])*255),Math.round(parseFloat(e[3])*255),e[4]!==void 0&&e[4]!=="none"?parseFloat(e[4]):1]:null}function b1(n){const e=mA(n);return e?e.slice(0,3):(xt(`Not a valid color format: "${n}"`),[0,0,0])}function SX(n){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of n.keys()){e.style.color=t;const r=window.getComputedStyle(e).color;n.set(t,b1(r))}e.remove()}function $n(n){const{a:e,b:t,c:r,d:a,e:i,f:s}=n.getTransform();return[e,t,r,a,i,s]}function Uo(n){const{a:e,b:t,c:r,d:a,e:i,f:s}=n.getTransform().invertSelf();return[e,t,r,a,i,s]}function bh(n,e,t=!1,r=!0){if(e instanceof m1){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=n,l=_r.isCSSRoundSupported,u=`var(--total-scale-factor) * ${a}px`,d=`var(--total-scale-factor) * ${i}px`,f=l?`round(down, ${u}, var(--scale-round-x))`:`calc(${u})`,m=l?`round(down, ${d}, var(--scale-round-y))`:`calc(${d})`;!t||e.rotation%180===0?(s.width=f,s.height=m):(s.width=m,s.height=f)}r&&n.setAttribute("data-main-rotation",e.rotation)}class Ho{constructor(){const{pixelRatio:e}=Ho;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,r,a,i=-1){let s=1/0,l=1/0,u=1/0;r=Ho.capPixels(r,i),r>0&&(s=Math.sqrt(r/(e*t))),a!==-1&&(l=a/e,u=a/t);const d=Math.min(s,l,u);return this.sx>d||this.sy>d?(this.sx=d,this.sy=d,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,r):r}return e}}const gA=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class AX{static get isDarkMode(){var e;return _t(this,"isDarkMode",!!((e=window==null?void 0:window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches))}}class xX{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);const{color:r}=window.getComputedStyle(e);return e.remove(),_t(this,"commentForegroundColor",b1(r))}}function kX(n,e){e=Wn(e!=null?e:1,0,1);const t=255*(1-e);return n.map(r=>Math.round(r*e+t))}function o9(n,e){const t=n[0]/255,r=n[1]/255,a=n[2]/255,i=Math.max(t,r,a),s=Math.min(t,r,a),l=(i+s)/2;if(i===s)e[0]=e[1]=0;else{const u=i-s;switch(e[1]=l<.5?u/(i+s):u/(2-i-s),i){case t:e[0]=((r-a)/u+(r<a?6:0))*60;break;case r:e[0]=((a-t)/u+2)*60;break;case a:e[0]=((t-r)/u+4)*60;break}}e[2]=l}function bA(n,e){const t=n[0],r=n[1],a=n[2],i=(1-Math.abs(2*a-1))*r,s=i*(1-Math.abs(t/60%2-1)),l=a-i/2;switch(Math.floor(t/60)){case 0:e[0]=i+l,e[1]=s+l,e[2]=l;break;case 1:e[0]=s+l,e[1]=i+l,e[2]=l;break;case 2:e[0]=l,e[1]=i+l,e[2]=s+l;break;case 3:e[0]=l,e[1]=s+l,e[2]=i+l;break;case 4:e[0]=s+l,e[1]=l,e[2]=i+l;break;case 5:case 6:e[0]=i+l,e[1]=l,e[2]=s+l;break}}function l9(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function u9(n,e,t){bA(n,t),t.map(l9);const r=.2126*t[0]+.7152*t[1]+.0722*t[2];bA(e,t),t.map(l9);const a=.2126*t[0]+.7152*t[1]+.0722*t[2];return r>a?(r+.05)/(a+.05):(a+.05)/(r+.05)}const c9=new Map;function CX(n,e){const t=n[0]+n[1]*256+n[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let r=c9.get(t);if(r)return r;const a=new Float32Array(9),i=a.subarray(0,3),s=a.subarray(3,6);o9(n,s);const l=a.subarray(6,9);o9(e,l);const u=l[2]<.5,d=u?12:4.5;if(s[2]=u?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),u9(s,l,i)<d){let f,m;u?(f=s[2],m=1):(f=0,m=s[2]);const b=.005;for(;m-f>b;){const y=s[2]=(f+m)/2;u===u9(s,l,i)<d?f=y:m=y}s[2]=u?m:f}return bA(s,i),r=We.makeHexColor(Math.round(i[0]*255),Math.round(i[1]*255),Math.round(i[2]*255)),c9.set(t,r),r}function d9({html:n,dir:e,className:t},r){const a=document.createDocumentFragment();if(typeof n=="string"){const i=document.createElement("p");i.dir=e||"auto";const s=n.split(/(?:\r\n?|\n)/);for(let l=0,u=s.length;l<u;++l){const d=s[l];i.append(document.createTextNode(d)),l<u-1&&i.append(document.createElement("br"))}a.append(i)}else i9.render({xfaHtml:n,div:a,intent:"richText"});a.firstElementChild.classList.add("richText",t),r.append(a)}function h9(n){const e=new Path2D;if(!n)return e;for(let t=0,r=n.length;t<r;)switch(n[t++]){case f1.moveTo:e.moveTo(n[t++],n[t++]);break;case f1.lineTo:e.lineTo(n[t++],n[t++]);break;case f1.curveTo:e.bezierCurveTo(n[t++],n[t++],n[t++],n[t++],n[t++],n[t++]);break;case f1.quadraticCurveTo:e.quadraticCurveTo(n[t++],n[t++],n[t++],n[t++]);break;case f1.closePath:e.closePath();break;default:xt(`Unrecognized drawing path operator: ${n[t-1]}`);break}return e}At(4972),At(4628),At(7642),At(8004),At(3853),At(5876),At(2475),At(5024),At(1698),At(8454),At(9452),At(4979),At(3579),At(3110),At(9314),At(1148),At(9112);const tu=class tu{constructor(e){D(this,Ta);D(this,Bc,null);D(this,zc,null);D(this,Ls);D(this,Ms,null);D(this,Sb,null);D(this,Uc,null);D(this,Pp,null);D(this,Bp,null);R(this,Ls,e),h(tu,Ab)||R(tu,Ab,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const e=R(this,Bc,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=h(this,Ls)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",ks,{signal:t}),e.addEventListener("pointerdown",P(tu,$4,UG),{signal:t}));const r=R(this,Ms,document.createElement("div"));r.className="buttons",e.append(r);const a=h(this,Ls).toolbarPosition;if(a){const{style:i}=e,s=h(this,Ls)._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return h(this,Bc)}hide(){var e;h(this,Bc).classList.add("hidden"),(e=h(this,zc))==null||e.hideDropdown()}show(){var e,t;h(this,Bc).classList.remove("hidden"),(e=h(this,Sb))==null||e.shown(),(t=h(this,Uc))==null||t.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=h(this,Ls),r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",h(tu,Ab)[e]),P(this,Ta,Xg).call(this,r)&&r.addEventListener("click",a=>{t.delete()},{signal:t._signal}),h(this,Ms).append(r)}async addAltText(e){const t=await e.render();P(this,Ta,Xg).call(this,t),h(this,Ms).append(t,h(this,Ta,o2)),R(this,Sb,e)}addComment(e,t=null){if(h(this,Uc))return;const r=e.renderForToolbar();if(!r)return;P(this,Ta,Xg).call(this,r);const a=R(this,Pp,h(this,Ta,o2));t?(h(this,Ms).insertBefore(r,t),h(this,Ms).insertBefore(a,t)):h(this,Ms).append(r,a),R(this,Uc,e),e.toolbar=this}addColorPicker(e){if(h(this,zc))return;R(this,zc,e);const t=e.renderButton();P(this,Ta,Xg).call(this,t),h(this,Ms).append(t,h(this,Ta,o2))}async addEditSignatureButton(e){const t=R(this,Bp,await e.renderEditButton(h(this,Ls)));P(this,Ta,Xg).call(this,t),h(this,Ms).append(t,h(this,Ta,o2))}removeButton(e){var t,r;switch(e){case"comment":(t=h(this,Uc))==null||t.removeToolbarCommentButton(),R(this,Uc,null),(r=h(this,Pp))==null||r.remove(),R(this,Pp,null);break}}async addButton(e,t){switch(e){case"colorPicker":t&&this.addColorPicker(t);break;case"altText":t&&await this.addAltText(t);break;case"editSignature":t&&await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":t&&this.addComment(t);break}}async addButtonBefore(e,t,r){if(!t&&e==="comment")return;const a=h(this,Ms).querySelector(r);a&&e==="comment"&&this.addComment(t,a)}updateEditSignatureButton(e){h(this,Bp)&&(h(this,Bp).title=e)}remove(){var e;h(this,Bc).remove(),(e=h(this,zc))==null||e.destroy(),R(this,zc,null)}};Bc=new WeakMap,zc=new WeakMap,Ls=new WeakMap,Ms=new WeakMap,Sb=new WeakMap,Uc=new WeakMap,Pp=new WeakMap,Bp=new WeakMap,Ab=new WeakMap,$4=new WeakSet,UG=function(e){e.stopPropagation()},Ta=new WeakSet,HG=function(e){h(this,Ls)._focusEventsAllowed=!1,ar(e)},GG=function(e){h(this,Ls)._focusEventsAllowed=!0,ar(e)},Xg=function(e){const t=h(this,Ls)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",P(this,Ta,HG).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",P(this,Ta,GG).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ks,{signal:t}),!0)},o2=function(){const e=document.createElement("div");return e.className="divider",e},D(tu,$4),D(tu,Ab,null);let yA=tu;class RX{constructor(e){D(this,ru);D(this,xb,null);D(this,$h,null);D(this,nu);R(this,nu,e)}show(e,t,r){const[a,i]=P(this,ru,$G).call(this,t,r),{style:s}=h(this,$h)||R(this,$h,P(this,ru,jG).call(this));e.append(h(this,$h)),s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){h(this,$h).remove()}}xb=new WeakMap,$h=new WeakMap,nu=new WeakMap,ru=new WeakSet,jG=function(){const e=R(this,$h,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const t=h(this,nu)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",ks,{signal:t});const r=R(this,xb,document.createElement("div"));return r.className="buttons",e.append(r),h(this,nu).hasCommentManager()&&P(this,ru,O_).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{h(this,nu).commentSelection("floating_button")}),P(this,ru,O_).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{h(this,nu).highlightSelection("floating_button")}),e},$G=function(e,t){let r=0,a=0;for(const i of e){const s=i.y+i.height;if(s<r)continue;const l=i.x+(t?i.width:0);if(s>r){a=l,r=s;continue}t?l>a&&(a=l):l<a&&(a=l)}return[t?1-a:a,r]},O_=function(e,t,r,a){const i=document.createElement("button");i.classList.add("basic",e),i.tabIndex=0,i.setAttribute("data-l10n-id",t);const s=document.createElement("span");i.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",r);const l=h(this,nu)._signal;l instanceof AbortSignal&&!l.aborted&&(i.addEventListener("contextmenu",ks,{signal:l}),i.addEventListener("click",a,{signal:l})),h(this,xb).append(i)};function f9(n,e,t){for(const r of t)e.addEventListener(r,n[r].bind(n))}const An=class An{static initializeAndAddPointerId(e){(h(An,Yh)||R(An,Yh,new Set)).add(e)}static setPointer(e,t){var r;h(An,Vh)||R(An,Vh,t),(r=h(An,qh))!=null||R(An,qh,e)}static setTimeStamp(e){R(An,zp,e)}static isSamePointerId(e){return h(An,Vh)===e}static isSamePointerIdOrRemove(e){var t;return h(An,Vh)===e?!0:((t=h(An,Yh))==null||t.delete(e),!1)}static isSamePointerType(e){return h(An,qh)===e}static isInitializedAndDifferentPointerType(e){return h(An,qh)!==null&&!An.isSamePointerType(e)}static isSameTimeStamp(e){return h(An,zp)===e}static isUsingMultiplePointers(){var e;return((e=h(An,Yh))==null?void 0:e.size)>=1}static clearPointerType(){R(An,qh,null)}static clearPointerIds(){R(An,Vh,NaN),R(An,Yh,null)}static clearTimeStamp(){R(An,zp,NaN)}};Vh=new WeakMap,Yh=new WeakMap,zp=new WeakMap,qh=new WeakMap,D(An,Vh,NaN),D(An,Yh,null),D(An,zp,NaN),D(An,qh,null);let za=An;class IX{constructor(){D(this,V4,0)}get id(){return`${h1}${dr(this,V4)._++}`}}V4=new WeakMap;const dR=class dR{constructor(){D(this,Hp);D(this,Up,a9());D(this,kb,0);D(this,qa,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=e;const i=a.decode().then(()=>(r.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return _t(this,"_isSVGFittingCanvas",i)}async getFromFile(e){const{lastModified:t,name:r,size:a,type:i}=e;return P(this,Hp,RT).call(this,`${t}_${r}_${a}_${i}`,e)}async getFromUrl(e){return P(this,Hp,RT).call(this,e,e)}async getFromBlob(e,t){const r=await t;return P(this,Hp,RT).call(this,e,r)}async getFromId(e){h(this,qa)||R(this,qa,new Map);const t=h(this,qa).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:r}=t;return delete t.blobPromise,this.getFromBlob(t.id,r)}return this.getFromUrl(t.url)}getFromCanvas(e,t){h(this,qa)||R(this,qa,new Map);let r=h(this,qa).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const a=new OffscreenCanvas(t.width,t.height);return a.getContext("2d").drawImage(t,0,0),r={bitmap:a.transferToImageBitmap(),id:`image_${h(this,Up)}_${dr(this,kb)._++}`,refCounter:1,isSvg:!1},h(this,qa).set(e,r),h(this,qa).set(r.id,r),r}getSvgUrl(e){const t=h(this,qa).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){var a;h(this,qa)||R(this,qa,new Map);const t=h(this,qa).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:r}=t;if(!t.url&&!t.file){const i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),t.blobPromise=i.convertToBlob()}(a=r.close)==null||a.call(r),t.bitmap=null}isValidId(e){return e.startsWith(`image_${h(this,Up)}_`)}};Up=new WeakMap,kb=new WeakMap,qa=new WeakMap,Hp=new WeakSet,RT=async function(e,t){h(this,qa)||R(this,qa,new Map);let r=h(this,qa).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${h(this,Up)}_${dr(this,kb)._++}`,refCounter:0,isSvg:!1});let a;if(typeof t=="string"?(r.url=t,a=await hA(t,"blob")):t instanceof File?a=r.file=t:t instanceof Blob&&(a=t),a.type==="image/svg+xml"){const i=dR._isSVGFittingCanvas,s=new FileReader,l=new Image,u=new Promise((d,f)=>{l.onload=()=>{r.bitmap=l,r.isSvg=!0,d()},s.onload=async()=>{const m=r.svgUrl=s.result;l.src=await i?`${m}#svgView(preserveAspectRatio(none))`:m},l.onerror=s.onerror=f});s.readAsDataURL(a),await u}else r.bitmap=await createImageBitmap(a);r.refCounter=1}catch(a){xt(a),r=null}return h(this,qa).set(e,r),r&&h(this,qa).set(r.id,r),r};let EA=dR;class _X{constructor(e=128){D(this,Sr,[]);D(this,Hc,!1);D(this,Cb);D(this,lr,-1);R(this,Cb,e)}add({cmd:e,undo:t,post:r,mustExec:a,type:i=NaN,overwriteIfSameType:s=!1,keepUndo:l=!1}){if(a&&e(),h(this,Hc))return;const u={cmd:e,undo:t,post:r,type:i};if(h(this,lr)===-1){h(this,Sr).length>0&&(h(this,Sr).length=0),R(this,lr,0),h(this,Sr).push(u);return}if(s&&h(this,Sr)[h(this,lr)].type===i){l&&(u.undo=h(this,Sr)[h(this,lr)].undo),h(this,Sr)[h(this,lr)]=u;return}const d=h(this,lr)+1;d===h(this,Cb)?h(this,Sr).splice(0,1):(R(this,lr,d),d<h(this,Sr).length&&h(this,Sr).splice(d)),h(this,Sr).push(u)}undo(){if(h(this,lr)===-1)return;R(this,Hc,!0);const{undo:e,post:t}=h(this,Sr)[h(this,lr)];e(),t==null||t(),R(this,Hc,!1),R(this,lr,h(this,lr)-1)}redo(){if(h(this,lr)<h(this,Sr).length-1){R(this,lr,h(this,lr)+1),R(this,Hc,!0);const{cmd:e,post:t}=h(this,Sr)[h(this,lr)];e(),t==null||t(),R(this,Hc,!1)}}hasSomethingToUndo(){return h(this,lr)!==-1}hasSomethingToRedo(){return h(this,lr)<h(this,Sr).length-1}cleanType(e){if(h(this,lr)!==-1){for(let t=h(this,lr);t>=0;t--)if(h(this,Sr)[t].type!==e){h(this,Sr).splice(t+1,h(this,lr)-t),R(this,lr,t);return}h(this,Sr).length=0,R(this,lr,-1)}}destroy(){R(this,Sr,null)}}Sr=new WeakMap,Hc=new WeakMap,Cb=new WeakMap,lr=new WeakMap;class y1{constructor(e){D(this,Y4);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=_r.platform;for(const[r,a,i={}]of e)for(const s of r){const l=s.startsWith("mac+");t&&l?(this.callbacks.set(s.slice(4),{callback:a,options:i}),this.allKeys.add(s.split("+").at(-1))):!t&&!l&&(this.callbacks.set(s,{callback:a,options:i}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const r=this.callbacks.get(P(this,Y4,VG).call(this,t));if(!r)return;const{callback:a,options:{bubbles:i=!1,args:s=[],checker:l=null}}=r;l&&!l(e,t)||(a.bind(e,...s,t)(),i||ar(t))}}Y4=new WeakSet,VG=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t};const q4=class q4{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return SX(e),_t(this,"_colors",e)}convert(e){const t=b1(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[r,a]of this._colors)if(a.every((i,s)=>i===t[s]))return q4._colorsMapping.get(r);return t}getHexCode(e){const t=this._colors.get(e);return t?We.makeHexColor(...t):e}};we(q4,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let vA=q4;const Qp=class Qp{constructor(e,t,r,a,i,s,l,u,d,f,m,b,y,E,T,w){D(this,Je);D(this,Gp,new AbortController);D(this,Qi,null);D(this,jp,null);D(this,pr,new Map);D(this,ur,new Map);D(this,$p,null);D(this,Vp,null);D(this,ui,null);D(this,Yp,null);D(this,Fs,new _X);D(this,aa,null);D(this,Gc,null);D(this,jc,null);D(this,$c,0);D(this,Vc,new Set);D(this,al,null);D(this,Ps,null);D(this,Wh,new Set);we(this,"_editorUndoBar",null);D(this,Rb,!1);D(this,Ib,!1);D(this,qp,!1);D(this,_b,null);D(this,il,null);D(this,Yc,null);D(this,Wp,null);D(this,qc,!1);D(this,sl,null);D(this,W4,new IX);D(this,au,!1);D(this,Xp,!1);D(this,Nb,!1);D(this,Wc,null);D(this,Xh,null);D(this,Kp,null);D(this,Xc,null);D(this,Ob,null);D(this,Fr,kt.NONE);D(this,En,new Set);D(this,iu,null);D(this,Kc,null);D(this,Zc,null);D(this,Db,null);D(this,Zp,null);D(this,Lb,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});D(this,Qc,[0,0]);D(this,ol,null);D(this,su,null);D(this,Mb,null);D(this,Fb,null);D(this,Bs,null);const S=this._signal=h(this,Gp).signal;R(this,su,e),R(this,Mb,t),R(this,Fb,r),R(this,Vp,a),R(this,aa,i),R(this,Kc,s),R(this,Zp,u),this._eventBus=l,l._on("editingaction",this.onEditingAction.bind(this),{signal:S}),l._on("pagechanging",this.onPageChanging.bind(this),{signal:S}),l._on("scalechanging",this.onScaleChanging.bind(this),{signal:S}),l._on("rotationchanging",this.onRotationChanging.bind(this),{signal:S}),l._on("setpreference",this.onSetPreference.bind(this),{signal:S}),l._on("switchannotationeditorparams",x=>this.updateParams(x.type,x.value),{signal:S}),window.addEventListener("pointerdown",()=>{R(this,Xp,!0)},{capture:!0,signal:S}),window.addEventListener("pointerup",()=>{R(this,Xp,!1)},{capture:!0,signal:S}),window.addEventListener("beforeunload",P(this,Je,YG).bind(this),{capture:!0,signal:S}),P(this,Je,XG).call(this),P(this,Je,tj).call(this),P(this,Je,L_).call(this),R(this,ui,u.annotationStorage),R(this,_b,u.filterFactory),R(this,Zc,d),R(this,Wp,f||null),R(this,Rb,m),R(this,Ib,b),R(this,qp,y),R(this,Ob,E||null),this.viewParameters={realScale:fc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=T||null,this._supportsPinchToZoom=w!==!1,i==null||i.setSidebarUiManager(this)}static get _keyboardManager(){const e=Qp.prototype,t=s=>h(s,su).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),r=(s,{target:l})=>{if(l instanceof HTMLInputElement){const{type:u}=l;return u!=="text"&&u!=="number"}return!0},a=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return _t(this,"_keyboardManager",new y1([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:l})=>!(l instanceof HTMLButtonElement)&&h(s,su).contains(l)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:l})=>!(l instanceof HTMLButtonElement)&&h(s,su).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}]]))}destroy(){var e,t,r,a,i,s,l,u,d;(e=h(this,Bs))==null||e.resolve(),R(this,Bs,null),(t=h(this,Gp))==null||t.abort(),R(this,Gp,null),this._signal=null;for(const f of h(this,ur).values())f.destroy();h(this,ur).clear(),h(this,pr).clear(),h(this,Wh).clear(),(r=h(this,Xc))==null||r.clear(),R(this,Qi,null),h(this,En).clear(),h(this,Fs).destroy(),(a=h(this,Vp))==null||a.destroy(),(i=h(this,aa))==null||i.destroy(),(s=h(this,Kc))==null||s.destroy(),(l=h(this,sl))==null||l.hide(),R(this,sl,null),(u=h(this,Kp))==null||u.destroy(),R(this,Kp,null),R(this,jp,null),h(this,il)&&(clearTimeout(h(this,il)),R(this,il,null)),h(this,ol)&&(clearTimeout(h(this,ol)),R(this,ol,null)),(d=this._editorUndoBar)==null||d.destroy(),R(this,Zp,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return h(this,Ob)}get useNewAltTextFlow(){return h(this,Ib)}get useNewAltTextWhenAddingImage(){return h(this,qp)}get hcmFilter(){return _t(this,"hcmFilter",h(this,Zc)?h(this,_b).addHCMFilter(h(this,Zc).foreground,h(this,Zc).background):"none")}get direction(){return _t(this,"direction",getComputedStyle(h(this,su)).direction)}get _highlightColors(){return _t(this,"_highlightColors",h(this,Wp)?new Map(h(this,Wp).split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return _t(this,"highlightColors",null);const t=new Map,r=!!h(this,Zc);for(const[a,i]of e){const s=a.endsWith("_HCM");if(r&&s){t.set(a.replace("_HCM",""),i);continue}!r&&!s&&t.set(a,i)}return _t(this,"highlightColors",t)}get highlightColorNames(){return _t(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),R(this,jc,e)}setMainHighlightColorPicker(e){R(this,Kp,e)}editAltText(e,t=!1){var r;(r=h(this,Vp))==null||r.editAltText(this,e,t)}hasCommentManager(){return!!h(this,aa)}editComment(e,t,r,a){var i;(i=h(this,aa))==null||i.showDialog(this,e,t,r,a)}selectComment(e,t){const r=h(this,ur).get(e),a=r==null?void 0:r.getEditorByUID(t);a==null||a.toggleComment(!0,!0)}updateComment(e){var t;(t=h(this,aa))==null||t.updateComment(e.getData())}updatePopupColor(e){var t;(t=h(this,aa))==null||t.updatePopupColor(e)}removeComment(e){var t;(t=h(this,aa))==null||t.removeComments([e.uid])}deleteComment(e,t){const r=()=>{e.comment=t},a=()=>{var i;(i=this._editorUndoBar)==null||i.show(r,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:a,undo:r,mustExec:!0})}toggleComment(e,t,r=void 0){var a;(a=h(this,aa))==null||a.toggleCommentPopup(e,t,r)}makeCommentColor(e,t){var r;return e&&((r=h(this,aa))==null?void 0:r.makeCommentColor(e,t))||null}getCommentDialogElement(){var e;return((e=h(this,aa))==null?void 0:e.dialogElement)||null}async waitForEditorsRendered(e){if(h(this,ur).has(e-1))return;const{resolve:t,promise:r}=Promise.withResolvers(),a=i=>{i.pageNumber===e&&(this._eventBus._off("editorsrendered",a),t())};this._eventBus.on("editorsrendered",a),await r}getSignature(e){var t;(t=h(this,Kc))==null||t.getSignature({uiManager:this,editor:e})}get signatureManager(){return h(this,Kc)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":R(this,qp,t);break}}onPageChanging({pageNumber:e}){R(this,$c,e-1)}deletePage(e){for(const t of this.getEditors(e))t.remove();h(this,ur).delete(e),h(this,$c)===e&&R(this,$c,0)}focusMainContainer(){h(this,su).focus()}findParent(e,t){for(const r of h(this,ur).values()){const{x:a,y:i,width:s,height:l}=r.div.getBoundingClientRect();if(e>=a&&e<=a+s&&t>=i&&t<=i+l)return r}return null}disableUserSelect(e=!1){h(this,Mb).classList.toggle("noUserSelect",e)}addShouldRescale(e){h(this,Wh).add(e)}removeShouldRescale(e){h(this,Wh).delete(e)}onScaleChanging({scale:e}){var t;this.commitOrRemove(),this.viewParameters.realScale=e*fc.PDF_TO_CSS_UNITS;for(const r of h(this,Wh))r.onScaleChanging();(t=h(this,jc))==null||t.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",t=!1){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:a,anchorOffset:i,focusNode:s,focusOffset:l}=r,u=r.toString(),f=P(this,Je,IT).call(this,r).closest(".textLayer"),m=this.getSelectionBoxes(f);if(!m)return;r.empty();const b=P(this,Je,D_).call(this,f),y=h(this,Fr)===kt.NONE,E=()=>{const T=b==null?void 0:b.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:m,anchorNode:a,anchorOffset:i,focusNode:s,focusOffset:l,text:u});y&&this.showAllEditors("highlight",!0,!0),t&&(T==null||T.editComment())};if(y){this.switchToMode(kt.HIGHLIGHT,E);return}E()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!h(this,ui))return null;const t=`${h1}${e}`,r=h(this,ui).getRawValue(t);return r&&h(this,ui).remove(t),r}addToAnnotationStorage(e){!e.isEmpty()&&h(this,ui)&&!h(this,ui).has(e.id)&&h(this,ui).setValue(e.id,e)}a11yAlert(e,t=null){const r=h(this,Fb);r&&(r.setAttribute("data-l10n-id",e),t?r.setAttribute("data-l10n-args",JSON.stringify(t)):r.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,h(this,qc)&&(R(this,qc,!1),P(this,Je,l2).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of h(this,En))if(t.div.contains(e)){R(this,Xh,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!h(this,Xh))return;const[e,t]=h(this,Xh);R(this,Xh,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){P(this,Je,L_).call(this),this.setEditingState(!0)}removeEditListeners(){P(this,Je,QG).call(this),this.setEditingState(!1)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const r of h(this,Ps))if(r.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const r of h(this,Ps))if(r.isHandlingMimeForPasting(t.type)){r.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=h(this,Qi))==null||r.commitOrRemove(),!this.hasSelection)return;const t=[];for(const a of h(this,En)){const i=a.serialize(!0);i&&t.push(i)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const i of t.items)for(const s of h(this,Ps))if(s.isHandlingMimeForPasting(i.type)){s.paste(i,this.currentLayer);return}let r=t.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(i){xt(`paste: "${i.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const a=this.currentLayer;try{const i=[];for(const u of r){const d=await a.deserialize(u);if(!d)return;i.push(d)}const s=()=>{for(const u of i)P(this,Je,M_).call(this,u);P(this,Je,F_).call(this,i)},l=()=>{for(const u of i)u.remove()};this.addCommands({cmd:s,undo:l,mustExec:!0})}catch(i){xt(`paste: "${i.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),h(this,Fr)!==kt.NONE&&!this.isEditorHandlingKeyboard&&Qp._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,h(this,qc)&&(R(this,qc,!1),P(this,Je,l2).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}updatePageIndex(e,t){for(const a of this.getEditors(e))a.pageIndex=t;const r=h(this,$p).get(e);r&&(r.pageIndex=t,h(this,ur).set(t,r),h(this,au)?r.enable():r.disable())}startUpdatePages(){R(this,$p,new Map(h(this,ur))),h(this,ur).clear()}endUpdatePages(){R(this,$p,null)}clonePage(e,t){for(const r of this.getEditors(e)){const a=r.serialize(r.mode!==kt.HIGHLIGHT);a&&(a.pageIndex=t,a.id=this.getId(),a.isClone=!0,delete a.popupRef,h(this,ui).setValue(a.id,a))}}findClonesForPage(e){const t=[],{pageIndex:r}=e;for(const[a,i]of h(this,ui))i.pageIndex===r&&i.isClone&&(h(this,ui).remove(a),t.push(e.deserialize(i).then(s=>{s&&(s.isClone=!0,e.addOrRebuild(s))})));return Promise.all(t)}setEditingState(e){e?(P(this,Je,KG).call(this),P(this,Je,JG).call(this),P(this,Je,Ei).call(this,{isEditing:h(this,Fr)!==kt.NONE,isEmpty:P(this,Je,u2).call(this),hasSomethingToUndo:h(this,Fs).hasSomethingToUndo(),hasSomethingToRedo:h(this,Fs).hasSomethingToRedo(),hasSelectedEditor:!1})):(P(this,Je,ZG).call(this),P(this,Je,ej).call(this),P(this,Je,Ei).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!h(this,Ps)){R(this,Ps,e);for(const t of h(this,Ps))P(this,Je,sc).call(this,t.defaultPropertiesToUpdate)}}getId(){return h(this,W4).id}get currentLayer(){return h(this,ur).get(h(this,$c))}getLayer(e){return h(this,ur).get(e)}get currentPageIndex(){return h(this,$c)}addLayer(e){h(this,ur).set(e.pageIndex,e),h(this,au)?e.enable():e.disable()}removeLayer(e){h(this,ur).delete(e.pageIndex)}async updateMode(e,t=null,r=!1,a=!1,i=!1,s=!1){var l,u,d,f,m,b;if(h(this,Fr)!==e&&!(h(this,Bs)&&(await h(this,Bs).promise,!h(this,Bs)))){if(R(this,Bs,Promise.withResolvers()),(l=h(this,jc))==null||l.commitOrRemove(),h(this,Fr)===kt.POPUP&&((u=h(this,aa))==null||u.hideSidebar()),(d=h(this,aa))==null||d.destroyPopup(),R(this,Fr,e),e===kt.NONE){this.setEditingState(!1),P(this,Je,rj).call(this);for(const y of h(this,pr).values())y.hideStandaloneCommentButton();(f=this._editorUndoBar)==null||f.hide(),this.toggleComment(null),h(this,Bs).resolve();return}for(const y of h(this,pr).values())y.addStandaloneCommentButton();e===kt.SIGNATURE&&await((m=h(this,Kc))==null?void 0:m.loadSignatures()),r&&za.clearPointerType(),this.setEditingState(!0),await P(this,Je,nj).call(this),this.unselectAll();for(const y of h(this,ur).values())y.updateMode(e);if(e===kt.POPUP){h(this,jp)||R(this,jp,await h(this,Zp).getAnnotationsByType(new Set(h(this,Ps).map(T=>T._editorType))));const y=new Set,E=[];for(const T of h(this,pr).values()){const{annotationElementId:w,hasComment:S,deleted:x}=T;w&&y.add(w),S&&!x&&E.push(T.getData())}for(const T of h(this,jp)){const{id:w,popupRef:S,contentsObj:x}=T;S&&(x!=null&&x.str)&&!y.has(w)&&!h(this,Vc).has(w)&&E.push(T)}(b=h(this,aa))==null||b.showSidebar(E)}if(!t){a&&this.addNewEditorFromKeyboard(),h(this,Bs).resolve();return}for(const y of h(this,pr).values())y.uid===t?(this.setSelected(y),s?y.editComment():i?y.enterInEditMode():y.focus()):y.unselect();h(this,Bs).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==h(this,Fr)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(h(this,Ps)){switch(e){case Dt.CREATE:this.currentLayer.addNewEditor(t);return;case Dt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(h(this,Db)||R(this,Db,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(const r of h(this,En))r.updateParams(e,t);else for(const r of h(this,Ps))r.updateDefaultParams(e,t)}}showAllEditors(e,t,r=!1){var i,s;for(const l of h(this,pr).values())l.editorType===e&&l.show(t);((s=(i=h(this,Db))==null?void 0:i.get(Dt.HIGHLIGHT_SHOW_ALL))!=null?s:!0)!==t&&P(this,Je,sc).call(this,[[Dt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(h(this,Nb)!==e){R(this,Nb,e);for(const t of h(this,ur).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(const t of h(this,pr).values())t.pageIndex===e&&(yield t)}getEditor(e){return h(this,pr).get(e)}addEditor(e){h(this,pr).set(e.id,e)}removeEditor(e){var t,r;e.div.contains(document.activeElement)&&(h(this,il)&&clearTimeout(h(this,il)),R(this,il,setTimeout(()=>{this.focusMainContainer(),R(this,il,null)},0))),h(this,pr).delete(e.id),e.annotationElementId&&((t=h(this,Xc))==null||t.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!h(this,Vc).has(e.annotationElementId))&&((r=h(this,ui))==null||r.remove(e.id))}addDeletedAnnotationElement(e){h(this,Vc).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return h(this,Vc).has(e)}removeDeletedAnnotationElement(e){h(this,Vc).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){h(this,Qi)!==e&&(R(this,Qi,e),e&&P(this,Je,sc).call(this,e.propertiesToUpdate))}updateUI(e){h(this,Je,aj)===e&&P(this,Je,sc).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){P(this,Je,sc).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(h(this,En).has(e)){h(this,En).delete(e),e.unselect(),P(this,Je,Ei).call(this,{hasSelectedEditor:this.hasSelection});return}h(this,En).add(e),e.select(),P(this,Je,sc).call(this,e.propertiesToUpdate),P(this,Je,Ei).call(this,{hasSelectedEditor:!0})}setSelected(e){var t,r;this.updateToolbar({mode:e.mode,editId:e.uid}),(t=h(this,jc))==null||t.commitOrRemove();for(const a of h(this,En))a!==e&&a.unselect();(r=h(this,aa))==null||r.destroyPopup(),h(this,En).clear(),h(this,En).add(e),e.select(),P(this,Je,sc).call(this,e.propertiesToUpdate),P(this,Je,Ei).call(this,{hasSelectedEditor:!0})}isSelected(e){return h(this,En).has(e)}get firstSelectedEditor(){return h(this,En).values().next().value}unselect(e){e.unselect(),h(this,En).delete(e),P(this,Je,Ei).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return h(this,En).size!==0}get isEnterHandled(){return h(this,En).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;h(this,Fs).undo(),P(this,Je,Ei).call(this,{hasSomethingToUndo:h(this,Fs).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:P(this,Je,u2).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){h(this,Fs).redo(),P(this,Je,Ei).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:h(this,Fs).hasSomethingToRedo(),isEmpty:P(this,Je,u2).call(this)})}addCommands(e){h(this,Fs).add(e),P(this,Je,Ei).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:P(this,Je,u2).call(this)})}cleanUndoStack(e){h(this,Fs).cleanType(e)}delete(){var i;this.commitOrRemove();const e=(i=this.currentLayer)==null?void 0:i.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...h(this,En)],r=()=>{var s;(s=this._editorUndoBar)==null||s.show(a,t.length===1?t[0].editorType:t.length);for(const l of t)l.remove()},a=()=>{for(const s of t)P(this,Je,M_).call(this,s)};this.addCommands({cmd:r,undo:a,mustExec:!0})}commitOrRemove(){var e;(e=h(this,Qi))==null||e.commitOrRemove()}hasSomethingToControl(){return h(this,Qi)||this.hasSelection}selectAll(){for(const e of h(this,En))e.commit();P(this,Je,F_).call(this,h(this,pr).values())}unselectAll(){var e,t;if(!(h(this,Qi)&&(h(this,Qi).commitOrRemove(),h(this,Fr)!==kt.NONE))&&!((e=h(this,jc))!=null&&e.commitOrRemove())&&((t=h(this,aa))==null||t.destroyPopup(),!!this.hasSelection)){for(const r of h(this,En))r.unselect();h(this,En).clear(),P(this,Je,Ei).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;h(this,Qc)[0]+=e,h(this,Qc)[1]+=t;const[a,i]=h(this,Qc),s=[...h(this,En)],l=1e3;h(this,ol)&&clearTimeout(h(this,ol)),R(this,ol,setTimeout(()=>{R(this,ol,null),h(this,Qc)[0]=h(this,Qc)[1]=0,this.addCommands({cmd:()=>{for(const u of s)h(this,pr).has(u.id)&&(u.translateInPage(a,i),u.translationDone())},undo:()=>{for(const u of s)h(this,pr).has(u.id)&&(u.translateInPage(-a,-i),u.translationDone())},mustExec:!1})},l));for(const u of s)u.translateInPage(e,t),u.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),R(this,al,new Map);for(const e of h(this,En))h(this,al).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!h(this,al))return!1;this.disableUserSelect(!1);const e=h(this,al);R(this,al,null);let t=!1;for(const[{x:a,y:i,pageIndex:s},l]of e)l.newX=a,l.newY=i,l.newPageIndex=s,t||(t=a!==l.savedX||i!==l.savedY||s!==l.savedPageIndex);if(!t)return!1;const r=(a,i,s,l)=>{if(h(this,pr).has(a.id)){const u=h(this,ur).get(l);u?a._setParentAndPosition(u,i,s):(a.pageIndex=l,a.x=i,a.y=s)}};return this.addCommands({cmd:()=>{for(const[a,{newX:i,newY:s,newPageIndex:l}]of e)r(a,i,s,l)},undo:()=>{for(const[a,{savedX:i,savedY:s,savedPageIndex:l}]of e)r(a,i,s,l)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(h(this,al))for(const r of h(this,al).keys())r.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||h(this,En).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return h(this,Qi)===e}getActive(){return h(this,Qi)}getMode(){return h(this,Fr)}isEditingMode(){return h(this,Fr)!==kt.NONE}get imageManager(){return _t(this,"imageManager",new EA)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let d=0,f=t.rangeCount;d<f;d++)if(!e.contains(t.getRangeAt(d).commonAncestorContainer))return null;const{x:r,y:a,width:i,height:s}=e.getBoundingClientRect();let l;switch(e.getAttribute("data-main-rotation")){case"90":l=(d,f,m,b)=>({x:(f-a)/s,y:1-(d+m-r)/i,width:b/s,height:m/i});break;case"180":l=(d,f,m,b)=>({x:1-(d+m-r)/i,y:1-(f+b-a)/s,width:m/i,height:b/s});break;case"270":l=(d,f,m,b)=>({x:1-(f+b-a)/s,y:(d-r)/i,width:b/s,height:m/i});break;default:l=(d,f,m,b)=>({x:(d-r)/i,y:(f-a)/s,width:m/i,height:b/s});break}const u=[];for(let d=0,f=t.rangeCount;d<f;d++){const m=t.getRangeAt(d);if(!m.collapsed)for(const{x:b,y,width:E,height:T}of m.getClientRects())E===0||T===0||u.push(l(b,y,E,T))}return u.length===0?null:u}addChangedExistingAnnotation({annotationElementId:e,id:t}){(h(this,Yp)||R(this,Yp,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=h(this,Yp))==null||t.delete(e)}renderAnnotationElement(e){var a;const t=(a=h(this,Yp))==null?void 0:a.get(e.data.id);if(!t)return;const r=h(this,ui).getRawValue(t);r&&(h(this,Fr)===kt.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}setMissingCanvas(e,t,r){var i;const a=(i=h(this,Xc))==null?void 0:i.get(e);a&&(a.setCanvas(t,r),h(this,Xc).delete(e))}addMissingCanvas(e,t){(h(this,Xc)||R(this,Xc,new Map)).set(e,t)}};Gp=new WeakMap,Qi=new WeakMap,jp=new WeakMap,pr=new WeakMap,ur=new WeakMap,$p=new WeakMap,Vp=new WeakMap,ui=new WeakMap,Yp=new WeakMap,Fs=new WeakMap,aa=new WeakMap,Gc=new WeakMap,jc=new WeakMap,$c=new WeakMap,Vc=new WeakMap,al=new WeakMap,Ps=new WeakMap,Wh=new WeakMap,Rb=new WeakMap,Ib=new WeakMap,qp=new WeakMap,_b=new WeakMap,il=new WeakMap,Yc=new WeakMap,Wp=new WeakMap,qc=new WeakMap,sl=new WeakMap,W4=new WeakMap,au=new WeakMap,Xp=new WeakMap,Nb=new WeakMap,Wc=new WeakMap,Xh=new WeakMap,Kp=new WeakMap,Xc=new WeakMap,Ob=new WeakMap,Fr=new WeakMap,En=new WeakMap,iu=new WeakMap,Kc=new WeakMap,Zc=new WeakMap,Db=new WeakMap,Zp=new WeakMap,Lb=new WeakMap,Qc=new WeakMap,ol=new WeakMap,su=new WeakMap,Mb=new WeakMap,Fb=new WeakMap,Bs=new WeakMap,Je=new WeakSet,IT=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},D_=function(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const r of h(this,ur).values())if(r.hasTextLayer(e))return r;return null},YG=function(e){var t;this.commitOrRemove(),(t=this.currentLayer)==null||t.endDrawingSession(!1)},qG=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=P(this,Je,IT).call(this,e).closest(".textLayer"),a=this.getSelectionBoxes(r);a&&(h(this,sl)||R(this,sl,new RX(this)),h(this,sl).show(r,a,this.direction==="ltr"))},WG=function(){var i,s,l;const e=document.getSelection();if(!e||e.isCollapsed){h(this,iu)&&((i=h(this,sl))==null||i.hide(),R(this,iu,null),P(this,Je,Ei).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===h(this,iu))return;const a=P(this,Je,IT).call(this,e).closest(".textLayer");if(!a){h(this,iu)&&((s=h(this,sl))==null||s.hide(),R(this,iu,null),P(this,Je,Ei).call(this,{hasSelectedText:!1}));return}if((l=h(this,sl))==null||l.hide(),R(this,iu,t),P(this,Je,Ei).call(this,{hasSelectedText:!0}),!(h(this,Fr)!==kt.HIGHLIGHT&&h(this,Fr)!==kt.NONE)&&(h(this,Fr)===kt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),R(this,qc,this.isShiftKeyDown),!this.isShiftKeyDown)){const u=h(this,Fr)===kt.HIGHLIGHT?P(this,Je,D_).call(this,a):null;if(u==null||u.toggleDrawing(),h(this,Xp)){const d=new AbortController,f=this.combinedSignal(d),m=b=>{b.type==="pointerup"&&b.button!==0||(d.abort(),u==null||u.toggleDrawing(!0),b.type==="pointerup"&&P(this,Je,l2).call(this,"main_toolbar"))};window.addEventListener("pointerup",m,{signal:f}),window.addEventListener("blur",m,{signal:f})}else u==null||u.toggleDrawing(!0),P(this,Je,l2).call(this,"main_toolbar")}},l2=function(e=""){h(this,Fr)===kt.HIGHLIGHT?this.highlightSelection(e):h(this,Rb)&&P(this,Je,qG).call(this)},XG=function(){document.addEventListener("selectionchange",P(this,Je,WG).bind(this),{signal:this._signal})},KG=function(){if(h(this,Yc))return;R(this,Yc,new AbortController);const e=this.combinedSignal(h(this,Yc));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},ZG=function(){var e;(e=h(this,Yc))==null||e.abort(),R(this,Yc,null)},L_=function(){if(h(this,Wc))return;R(this,Wc,new AbortController);const e=this.combinedSignal(h(this,Wc));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},QG=function(){var e;(e=h(this,Wc))==null||e.abort(),R(this,Wc,null)},JG=function(){if(h(this,Gc))return;R(this,Gc,new AbortController);const e=this.combinedSignal(h(this,Gc));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},ej=function(){var e;(e=h(this,Gc))==null||e.abort(),R(this,Gc,null)},tj=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Ei=function(e){Object.entries(e).some(([r,a])=>h(this,Lb)[r]!==a)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(h(this,Lb),e)}),h(this,Fr)===kt.HIGHLIGHT&&e.hasSelectedEditor===!1&&P(this,Je,sc).call(this,[[Dt.HIGHLIGHT_FREE,!0]]))},sc=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},nj=async function(){if(!h(this,au)){R(this,au,!0);const e=[];for(const t of h(this,ur).values())e.push(t.enable());await Promise.all(e);for(const t of h(this,pr).values())t.enable()}},rj=function(){if(this.unselectAll(),h(this,au)){R(this,au,!1);for(const e of h(this,ur).values())e.disable();for(const e of h(this,pr).values())e.disable()}},M_=function(e){const t=h(this,ur).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},aj=function(){let e=null;for(e of h(this,En));return e},u2=function(){if(h(this,pr).size===0)return!0;if(h(this,pr).size===1)for(const e of h(this,pr).values())return e.isEmpty();return!1},F_=function(e){for(const t of h(this,En))t.unselect();h(this,En).clear();for(const t of e)t.isEmpty()||(h(this,En).add(t),t.select());P(this,Je,Ei).call(this,{hasSelectedEditor:this.hasSelection})},we(Qp,"TRANSLATE_SMALL",1),we(Qp,"TRANSLATE_BIG",10);let yh=Qp;const ci=class ci{constructor(e){D(this,po);D(this,ia,null);D(this,ll,!1);D(this,fo,null);D(this,Jp,null);D(this,ul,null);D(this,Ji,null);D(this,em,!1);D(this,cl,null);D(this,Ii,null);D(this,ou,null);D(this,Kh,null);D(this,dl,!1);R(this,Ii,e),R(this,dl,e._uiManager.useNewAltTextFlow),h(ci,Jc)||R(ci,Jc,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){var t;(t=ci._l10n)!=null||(ci._l10n=e)}async render(){const e=R(this,fo,document.createElement("button"));e.className="altText",e.tabIndex="0";const t=R(this,Jp,document.createElement("span"));e.append(t),h(this,dl)?(e.classList.add("new"),e.setAttribute("data-l10n-id",h(ci,Jc).missing),t.setAttribute("data-l10n-id",h(ci,Jc)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=h(this,Ii)._uiManager._signal;e.addEventListener("contextmenu",ks,{signal:r}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const a=i=>{i.preventDefault(),h(this,Ii)._uiManager.editAltText(h(this,Ii)),h(this,dl)&&h(this,Ii)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:h(this,po,c2)}})};return e.addEventListener("click",a,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(R(this,em,!0),a(i))},{signal:r}),await P(this,po,_T).call(this),e}finish(){h(this,fo)&&(h(this,fo).focus({focusVisible:h(this,em)}),R(this,em,!1))}isEmpty(){return h(this,dl)?h(this,ia)===null:!h(this,ia)&&!h(this,ll)}hasData(){return h(this,dl)?h(this,ia)!==null||!!h(this,ou):this.isEmpty()}get guessedText(){return h(this,ou)}async setGuessedText(e){h(this,ia)===null&&(R(this,ou,e),R(this,Kh,await ci._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),P(this,po,_T).call(this))}toggleAltTextBadge(e=!1){var t;if(!h(this,dl)||h(this,ia)){(t=h(this,cl))==null||t.remove(),R(this,cl,null);return}if(!h(this,cl)){const r=R(this,cl,document.createElement("div"));r.className="noAltTextBadge",h(this,Ii).div.append(r)}h(this,cl).classList.toggle("hidden",!e)}serialize(e){let t=h(this,ia);return!e&&h(this,ou)===t&&(t=h(this,Kh)),{altText:t,decorative:h(this,ll),guessedText:h(this,ou),textWithDisclaimer:h(this,Kh)}}get data(){return{altText:h(this,ia),decorative:h(this,ll)}}set data({altText:e,decorative:t,guessedText:r,textWithDisclaimer:a,cancel:i=!1}){r&&(R(this,ou,r),R(this,Kh,a)),!(h(this,ia)===e&&h(this,ll)===t)&&(i||(R(this,ia,e),R(this,ll,t)),P(this,po,_T).call(this))}toggle(e=!1){h(this,fo)&&(!e&&h(this,Ji)&&(clearTimeout(h(this,Ji)),R(this,Ji,null)),h(this,fo).disabled=!e)}shown(){h(this,Ii)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:h(this,po,c2)}})}destroy(){var e,t;(e=h(this,fo))==null||e.remove(),R(this,fo,null),R(this,Jp,null),R(this,ul,null),(t=h(this,cl))==null||t.remove(),R(this,cl,null)}};ia=new WeakMap,ll=new WeakMap,fo=new WeakMap,Jp=new WeakMap,ul=new WeakMap,Ji=new WeakMap,em=new WeakMap,cl=new WeakMap,Ii=new WeakMap,ou=new WeakMap,Kh=new WeakMap,dl=new WeakMap,Jc=new WeakMap,po=new WeakSet,c2=function(){return h(this,ia)&&"added"||h(this,ia)===null&&this.guessedText&&"review"||"missing"},_T=async function(){var a,i,s;const e=h(this,fo);if(!e)return;if(h(this,dl)){if(e.classList.toggle("done",!!h(this,ia)),e.setAttribute("data-l10n-id",h(ci,Jc)[h(this,po,c2)]),(a=h(this,Jp))==null||a.setAttribute("data-l10n-id",h(ci,Jc)[`${h(this,po,c2)}-label`]),!h(this,ia)){(i=h(this,ul))==null||i.remove();return}}else{if(!h(this,ia)&&!h(this,ll)){e.classList.remove("done"),(s=h(this,ul))==null||s.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=h(this,ul);if(!t){R(this,ul,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${h(this,Ii).id}`;const l=100,u=h(this,Ii)._uiManager._signal;u.addEventListener("abort",()=>{clearTimeout(h(this,Ji)),R(this,Ji,null)},{once:!0}),e.addEventListener("mouseenter",()=>{R(this,Ji,setTimeout(()=>{R(this,Ji,null),h(this,ul).classList.add("show"),h(this,Ii)._reportTelemetry({action:"alt_text_tooltip"})},l))},{signal:u}),e.addEventListener("mouseleave",()=>{var d;h(this,Ji)&&(clearTimeout(h(this,Ji)),R(this,Ji,null)),(d=h(this,ul))==null||d.classList.remove("show")},{signal:u})}h(this,ll)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=h(this,ia)),t.parentNode||e.append(t);const r=h(this,Ii).getElementForAltText();r==null||r.setAttribute("aria-describedby",t.id)},D(ci,Jc,null),we(ci,"_l10n",null);let av=ci;class iv{constructor(e){D(this,Bb);D(this,Sa,null);D(this,zs,null);D(this,Zh,!1);D(this,Hn,null);D(this,Pb,null);D(this,ed,null);D(this,Us,null);D(this,td,null);D(this,nd,!1);D(this,Qh,null);R(this,Hn,e)}renderForToolbar(){const e=R(this,zs,document.createElement("button"));return e.className="comment",P(this,Bb,P_).call(this,e,!1)}renderForStandalone(){const e=R(this,Sa,document.createElement("button"));e.className="annotationCommentButton";const t=h(this,Hn).commentButtonPosition;if(t){const{style:r}=e;r.insetInlineEnd=`calc(${100*(h(this,Hn)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const a=h(this,Hn).commentButtonColor;a&&(r.backgroundColor=a)}return P(this,Bb,P_).call(this,e,!0)}focusButton(){setTimeout(()=>{var e,t;(t=(e=h(this,Sa))!=null?e:h(this,zs))==null||t.focus()},0)}onUpdatedColor(){if(!h(this,Sa))return;const e=h(this,Hn).commentButtonColor;e&&(h(this,Sa).style.backgroundColor=e),h(this,Hn)._uiManager.updatePopupColor(h(this,Hn))}get commentButtonWidth(){var e,t;return((t=(e=h(this,Sa))==null?void 0:e.getBoundingClientRect().width)!=null?t:0)/h(this,Hn).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(h(this,Qh))return h(this,Qh);if(!h(this,Sa))return null;const{x:e,y:t,height:r}=h(this,Sa).getBoundingClientRect(),{x:a,y:i,width:s,height:l}=h(this,Hn).parent.boundingClientRect;return[(e-a)/s,(t+r-i)/l]}set commentPopupPositionInLayer(e){R(this,Qh,e)}hasDefaultPopupPosition(){return h(this,Qh)===null}removeStandaloneCommentButton(){var e;(e=h(this,Sa))==null||e.remove(),R(this,Sa,null)}removeToolbarCommentButton(){var e;(e=h(this,zs))==null||e.remove(),R(this,zs,null)}setCommentButtonStates({selected:e,hasPopup:t}){h(this,Sa)&&(h(this,Sa).classList.toggle("selected",e),h(this,Sa).ariaExpanded=t)}edit(e){const t=this.commentPopupPositionInLayer;let r,a;if(t)[r,a]=t;else{[r,a]=h(this,Hn).commentButtonPosition;const{width:f,height:m,x:b,y}=h(this,Hn);r=b+r*f,a=y+a*m}const i=h(this,Hn).parent.boundingClientRect,{x:s,y:l,width:u,height:d}=i;h(this,Hn)._uiManager.editComment(h(this,Hn),s+r*u,l+a*d,{...e,parentDimensions:i})}finish(){h(this,zs)&&(h(this,zs).focus({focusVisible:h(this,Zh)}),R(this,Zh,!1))}isDeleted(){return h(this,nd)||h(this,Us)===""}isEmpty(){return h(this,Us)===null}hasBeenEdited(){return this.isDeleted()||h(this,Us)!==h(this,Pb)}serialize(){return this.data}get data(){return{text:h(this,Us),richText:h(this,ed),date:h(this,td),deleted:this.isDeleted()}}set data(e){if(e!==h(this,Us)&&R(this,ed,null),e===null){R(this,Us,""),R(this,nd,!0);return}R(this,Us,e),R(this,td,new Date),R(this,nd,!1)}restoreData({text:e,richText:t,date:r}){R(this,Us,e),R(this,ed,t),R(this,td,r),R(this,nd,!1)}setInitialText(e,t=null){R(this,Pb,e),this.data=e,R(this,td,null),R(this,ed,t)}shown(){}destroy(){var e,t;(e=h(this,zs))==null||e.remove(),R(this,zs,null),(t=h(this,Sa))==null||t.remove(),R(this,Sa,null),R(this,Us,""),R(this,ed,null),R(this,td,null),R(this,Hn,null),R(this,Zh,!1),R(this,nd,!1)}}Sa=new WeakMap,zs=new WeakMap,Zh=new WeakMap,Hn=new WeakMap,Pb=new WeakMap,ed=new WeakMap,Us=new WeakMap,td=new WeakMap,nd=new WeakMap,Qh=new WeakMap,Bb=new WeakSet,P_=function(e,t){if(!h(this,Hn)._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[h(this,Hn)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const r=h(this,Hn)._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return e;e.addEventListener("contextmenu",ks,{signal:r}),t&&(e.addEventListener("focusin",i=>{h(this,Hn)._focusEventsAllowed=!1,ar(i)},{capture:!0,signal:r}),e.addEventListener("focusout",i=>{h(this,Hn)._focusEventsAllowed=!0,ar(i)},{capture:!0,signal:r})),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const a=i=>{i.preventDefault(),e===h(this,zs)?this.edit():h(this,Hn).toggleComment(!0)};return e.addEventListener("click",a,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(R(this,Zh,!0),a(i))},{signal:r}),e.addEventListener("pointerenter",()=>{h(this,Hn).toggleComment(!1,!0)},{signal:r}),e.addEventListener("pointerleave",()=>{h(this,Hn).toggleComment(!1,!1)},{signal:r}),e};const hR=class hR{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:r=null,onPinchStart:a=null,onPinching:i=null,onPinchEnd:s=null,signal:l}){D(this,rd);D(this,tm);D(this,Jh,!1);D(this,zb,null);D(this,Ub);D(this,Hb);D(this,Gb);D(this,jb);D(this,lu,null);D(this,e0);D(this,uu,null);D(this,t0);D(this,cu,null);R(this,tm,e),R(this,zb,r),R(this,Ub,t),R(this,Hb,a),R(this,Gb,i),R(this,jb,s),R(this,t0,new AbortController),R(this,e0,AbortSignal.any([l,h(this,t0).signal])),e.addEventListener("touchstart",P(this,rd,ij).bind(this),{passive:!1,signal:h(this,e0)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ho.pixelRatio}destroy(){var e,t;(e=h(this,t0))==null||e.abort(),R(this,t0,null),(t=h(this,lu))==null||t.abort(),R(this,lu,null)}};tm=new WeakMap,Jh=new WeakMap,zb=new WeakMap,Ub=new WeakMap,Hb=new WeakMap,Gb=new WeakMap,jb=new WeakMap,lu=new WeakMap,e0=new WeakMap,uu=new WeakMap,t0=new WeakMap,cu=new WeakMap,rd=new WeakSet,ij=function(e){var a,i,s;if((a=h(this,Ub))!=null&&a.call(this))return;if(e.touches.length===1){if(h(this,lu))return;const l=R(this,lu,new AbortController),u=AbortSignal.any([h(this,e0),l.signal]),d=h(this,tm),f={capture:!0,signal:u,passive:!1},m=b=>{var y;b.pointerType==="touch"&&((y=h(this,lu))==null||y.abort(),R(this,lu,null))};d.addEventListener("pointerdown",b=>{b.pointerType==="touch"&&(ar(b),m(b))},f),d.addEventListener("pointerup",m,f),d.addEventListener("pointercancel",m,f);return}if(!h(this,cu)){R(this,cu,new AbortController);const l=AbortSignal.any([h(this,e0),h(this,cu).signal]),u=h(this,tm),d={signal:l,capture:!1,passive:!1};u.addEventListener("touchmove",P(this,rd,sj).bind(this),d);const f=P(this,rd,oj).bind(this);u.addEventListener("touchend",f,d),u.addEventListener("touchcancel",f,d),d.capture=!0,u.addEventListener("pointerdown",ar,d),u.addEventListener("pointermove",ar,d),u.addEventListener("pointercancel",ar,d),u.addEventListener("pointerup",ar,d),(i=h(this,Hb))==null||i.call(this)}if(ar(e),e.touches.length!==2||(s=h(this,zb))!=null&&s.call(this)){R(this,uu,null);return}let[t,r]=e.touches;t.identifier>r.identifier&&([t,r]=[r,t]),R(this,uu,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:r.screenX,touch1Y:r.screenY})},sj=function(e){var I;if(!h(this,uu)||e.touches.length!==2)return;ar(e);let[t,r]=e.touches;t.identifier>r.identifier&&([t,r]=[r,t]);const{screenX:a,screenY:i}=t,{screenX:s,screenY:l}=r,u=h(this,uu),{touch0X:d,touch0Y:f,touch1X:m,touch1Y:b}=u,y=m-d,E=b-f,T=s-a,w=l-i,S=Math.hypot(T,w)||1,x=Math.hypot(y,E)||1;if(!h(this,Jh)&&Math.abs(x-S)<=hR.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(u.touch0X=a,u.touch0Y=i,u.touch1X=s,u.touch1Y=l,!h(this,Jh)){R(this,Jh,!0);return}const C=[(a+s)/2,(i+l)/2];(I=h(this,Gb))==null||I.call(this,C,x,S)},oj=function(e){var t;e.touches.length>=2||(h(this,cu)&&(h(this,cu).abort(),R(this,cu,null),(t=h(this,jb))==null||t.call(this)),h(this,uu)&&(ar(e),R(this,uu,null),R(this,Jh,!1)))};let sv=hR;const Ot=class Ot{constructor(e){D(this,yt);D(this,n0,null);D(this,mo,null);D(this,Qn,null);D(this,vn,null);D(this,du,null);D(this,nm,!1);D(this,ad,null);D(this,$b,"");D(this,Aa,null);D(this,r0,null);D(this,hu,null);D(this,Hs,null);D(this,id,null);D(this,Vb,"");D(this,a0,!1);D(this,es,null);D(this,Yb,!1);D(this,i0,!1);D(this,fu,!1);D(this,hl,null);D(this,rm,0);D(this,am,0);D(this,Gs,null);D(this,s0,null);we(this,"isSelected",!1);we(this,"_isCopy",!1);we(this,"_editToolbar",null);we(this,"_initialOptions",Object.create(null));we(this,"_initialData",null);we(this,"_isVisible",!0);we(this,"_uiManager",null);we(this,"_focusEventsAllowed",!0);D(this,qb,!1);D(this,X4,Ot._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:t,rawDims:{pageWidth:r,pageHeight:a,pageX:i,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,a],this.pageTranslation=[i,s];const[l,u]=this.parentDimensions;this.x=e.x/l,this.y=e.y/u,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=Ot.prototype._resizeWithKeyboard,t=yh.TRANSLATE_SMALL,r=yh.TRANSLATE_BIG;return _t(this,"_resizerKeyboardManager",new y1([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],Ot.prototype._stopResizingWithKeyboard]]))}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return _t(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new NX({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){var a;if((a=Ot._l10n)!=null||(Ot._l10n=e),Ot._l10nResizer||(Ot._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),Ot._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);Ot._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){pn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return h(this,qb)}set _isDraggable(e){var t;R(this,qb,e),(t=this.div)==null||t.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=h(this,X4)}setParent(e){var t;e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(P(this,yt,d2).call(this),(t=h(this,Hs))==null||t.remove(),R(this,Hs,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(h(this,a0)?R(this,a0,!1):this.parent.setSelected(this))}focusout(e){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(r=this.parent)!=null&&r.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,r,a){const[i,s]=this.parentDimensions;[r,a]=this.screenToPageTranslation(r,a),this.x=(e+r)/i,this.y=(t+a)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}const[r,a]=this.parentDimensions;this.setAt(e*r,t*a,this.width*r,this.height*a),this._onTranslated()}translate(e,t){P(this,yt,B_).call(this,this.parentDimensions,e,t)}translateInPage(e,t){h(this,es)||R(this,es,[this.x,this.y,this.width,this.height]),P(this,yt,B_).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){h(this,es)||R(this,es,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[a,i]}=this;if(this.x+=e/a,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:m,y:b}=this.div.getBoundingClientRect();this.parent.findNewParent(this,m,b)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:l}=this;const[u,d]=this.getBaseTranslation();s+=u,l+=d;const{style:f}=r;f.left=`${(100*s).toFixed(2)}%`,f.top=`${(100*l).toFixed(2)}%`,this._onTranslating(s,l),r.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!h(this,es)&&(h(this,es)[0]!==this.x||h(this,es)[1]!==this.y)}get _hasBeenResized(){return!!h(this,es)&&(h(this,es)[2]!==this.width||h(this,es)[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:r}=Ot,a=r/e,i=r/t;switch(this.rotation){case 90:return[-a,i];case 180:return[a,i];case 270:return[a,-i];default:return[-a,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[r,a]}=this;let{x:i,y:s,width:l,height:u}=this;if(l*=r,u*=a,i*=r,s*=a,this._mustFixPosition)switch(e){case 0:i=Wn(i,0,r-l),s=Wn(s,0,a-u);break;case 90:i=Wn(i,0,r-u),s=Wn(s,l,a);break;case 180:i=Wn(i,l,r),s=Wn(s,u,a);break;case 270:i=Wn(i,u,r),s=Wn(s,0,a-l);break}this.x=i/=r,this.y=s/=a;const[d,f]=this.getBaseTranslation();i+=d,s+=f,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var r;return P(r=Ot,Wb,z_).call(r,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var r;return P(r=Ot,Wb,z_).call(r,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,r]}=this;return[t*e,r*e]}setDims(){const{div:{style:e},width:t,height:r}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=h(this,Qn))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||h(this,i0))return this._editToolbar;this._editToolbar=new yA(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[t,r]of e)await this._editToolbar.addButton(t,r);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var e;(e=this._editToolbar)==null||e.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var e;(e=this._editToolbar)==null||e.removeButton("comment")}removeEditToolbar(){var e,t;(e=this._editToolbar)==null||e.remove(),this._editToolbar=null,(t=h(this,Qn))==null||t.destroy()}addContainer(e){var r;const t=(r=this._editToolbar)==null?void 0:r.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return h(this,Qn)||(av.initialize(Ot._l10n),R(this,Qn,new av(this)),h(this,n0)&&(h(this,Qn).data=h(this,n0),R(this,n0,null))),h(this,Qn)}get altTextData(){var e;return(e=h(this,Qn))==null?void 0:e.data}set altTextData(e){h(this,Qn)&&(h(this,Qn).data=e)}get guessedAltText(){var e;return(e=h(this,Qn))==null?void 0:e.guessedText}async setGuessedAltText(e){var t;await((t=h(this,Qn))==null?void 0:t.setGuessedText(e))}serializeAltText(e){var t;return(t=h(this,Qn))==null?void 0:t.serialize(e)}hasAltText(){return!!h(this,Qn)&&!h(this,Qn).isEmpty()}hasAltTextData(){var e,t;return(t=(e=h(this,Qn))==null?void 0:e.hasData())!=null?t:!1}focusCommentButton(){var e;(e=h(this,vn))==null||e.focusButton()}addCommentButton(){return this.canAddComment?h(this,vn)||R(this,vn,new iv(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(h(this,du)){this._uiManager.isEditingMode()&&h(this,du).classList.remove("hidden");return}this.hasComment&&(R(this,du,h(this,vn).renderForStandalone()),this.div.append(h(this,du)))}}removeStandaloneCommentButton(){h(this,vn).removeStandaloneCommentButton(),R(this,du,null)}hideStandaloneCommentButton(){var e;(e=h(this,du))==null||e.classList.add("hidden")}get comment(){var i;if(!h(this,vn))return null;const{data:{richText:e,text:t,date:r,deleted:a}}=h(this,vn);return{text:t,richText:e,date:r,deleted:a,color:this.getNonHCMColor(),opacity:(i=this.opacity)!=null?i:1}}set comment(e){h(this,vn)||R(this,vn,new iv(this)),typeof e=="object"&&e!==null?h(this,vn).restoreData(e):h(this,vn).data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:r}){if(!t||(h(this,vn)||R(this,vn,new iv(this)),h(this,vn).setInitialText(e,r),!this.annotationElementId))return;const a=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);a&&this.updateFromAnnotationLayer(a)}get hasEditedComment(){var e;return(e=h(this,vn))==null?void 0:e.hasBeenEdited()}get hasDeletedComment(){var e;return(e=h(this,vn))==null?void 0:e.isDeleted()}get hasComment(){return!!h(this,vn)&&!h(this,vn).isEmpty()&&!h(this,vn).isDeleted()}async editComment(e){h(this,vn)||R(this,vn,new iv(this)),h(this,vn).edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){h(this,vn).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,a]=e.rect,[i]=this.pageDimensions,[s]=this.pageTranslation,l=s+i+1,u=a-100,d=l+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[l,u,d,a]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){h(this,vn).data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var s;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=h(this,nm)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),P(this,yt,j_).call(this);const[t,r]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*r/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/r).toFixed(2)}%`);const[a,i]=this.getInitialTranslation();return this.translate(a,i),f9(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(h(this,s0)||R(this,s0,new sv({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:P(this,yt,cj).bind(this),onPinching:P(this,yt,dj).bind(this),onPinchEnd:P(this,yt,hj).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(s=this._uiManager._editorUndoBar)==null||s.hide(),e}pointerdown(e){const{isMac:t}=_r.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(R(this,a0,!0),this._isDraggable){P(this,yt,fj).call(this,e);return}P(this,yt,G_).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){h(this,hl)&&clearTimeout(h(this,hl)),R(this,hl,setTimeout(()=>{var e;R(this,hl,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,r){e.changeParent(this),this.x=t,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,r=this.rotation){const a=this.parentScale,[i,s]=this.pageDimensions,[l,u]=this.pageTranslation,d=e/a,f=t/a,m=this.x*i,b=this.y*s,y=this.width*i,E=this.height*s;switch(r){case 0:return[m+d+l,s-b-f-E+u,m+d+y+l,s-b-f+u];case 90:return[m+f+l,s-b+d+u,m+f+E+l,s-b+d+y+u];case 180:return[m-d-y+l,s-b+f+u,m-d+l,s-b+f+E+u];case 270:return[m-f-E+l,s-b-d-y+u,m-f+l,s-b-d+u];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[r,a,i,s]=e,l=i-r,u=s-a;switch(this.rotation){case 0:return[r,t-s,l,u];case 90:return[r,t-a,u,l];case 180:return[i,t-a,l,u];case 270:return[i,t-s,u,l];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Ot._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var e;(e=h(this,vn))==null||e.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:r,opacity:a,deleted:i,richText:s},uid:l,pageIndex:u,creationDate:d,modificationDate:f}=this;return{id:l,pageIndex:u,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:d,modificationDate:r||f,popupRef:!i,color:t,opacity:a}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),R(this,i0,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),R(this,i0,!1),!0):!1}isInEditMode(){return h(this,i0)}shouldGetKeyboardEvents(){return h(this,fu)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:r,right:a}=this.getClientDimensions(),{innerHeight:i,innerWidth:s}=window;return t<s&&a>0&&e<i&&r>0}rebuild(){P(this,yt,j_).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,t=null){var r;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((r=this._initialData)==null?void 0:r.popupRef)||""}}static async deserialize(e,t,r){const a=new this.prototype.constructor({parent:t,id:r.getId(),uiManager:r,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});a.rotation=e.rotation,R(a,n0,e.accessibilityData),a._isCopy=e.isCopy||!1;const[i,s]=a.pageDimensions,[l,u,d,f]=a.getRectInCurrentCoords(e.rect,s);return a.x=l/i,a.y=u/s,a.width=d/i,a.height=f/s,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,t,r;if((e=h(this,id))==null||e.abort(),R(this,id,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),h(this,hl)&&(clearTimeout(h(this,hl)),R(this,hl,null)),P(this,yt,d2).call(this),this.removeEditToolbar(),h(this,Gs)){for(const a of h(this,Gs).values())clearTimeout(a);R(this,Gs,null)}this.parent=null,(t=h(this,s0))==null||t.destroy(),R(this,s0,null),(r=h(this,Hs))==null||r.remove(),R(this,Hs,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(P(this,yt,lj).call(this),h(this,Aa).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,t]}=this,[r,a,i,s]=this.getPDFRect();return[Ot._round(r+(i-r)*e),Ot._round(a+(s-a)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return h(this,vn).commentPopupPositionInLayer}set commentPopupPosition(e){h(this,vn).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return h(this,vn).hasDefaultPopupPosition()}get commentButtonWidth(){return h(this,vn).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){var t;(t=h(this,vn))==null||t.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),R(this,hu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=h(this,Aa).children;if(!h(this,mo)){R(this,mo,Array.from(t));const s=P(this,yt,pj).bind(this),l=P(this,yt,mj).bind(this),u=this._uiManager._signal;for(const d of h(this,mo)){const f=d.getAttribute("data-resizer-name");d.setAttribute("role","spinbutton"),d.addEventListener("keydown",s,{signal:u}),d.addEventListener("blur",l,{signal:u}),d.addEventListener("focus",P(this,yt,gj).bind(this,f),{signal:u}),d.setAttribute("data-l10n-id",Ot._l10nResizer[f])}}const r=h(this,mo)[0];let a=0;for(const s of t){if(s===r)break;a++}const i=(360-this.rotation+this.parentRotation)%360/90*(h(this,mo).length/4);if(i!==a){if(i<a)for(let l=0;l<a-i;l++)h(this,Aa).append(h(this,Aa).firstElementChild);else if(i>a)for(let l=0;l<i-a;l++)h(this,Aa).firstElementChild.before(h(this,Aa).lastElementChild);let s=0;for(const l of t){const d=h(this,mo)[s++].getAttribute("data-resizer-name");l.setAttribute("data-l10n-id",Ot._l10nResizer[d])}}P(this,yt,$_).call(this,0),R(this,fu,!0),h(this,Aa).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){h(this,fu)&&P(this,yt,H_).call(this,h(this,Vb),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){P(this,yt,d2).call(this),this.div.focus()}select(){var e,t,r;if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var a,i;(a=this.div)!=null&&a.classList.contains("selectedEditor")&&((i=this._editToolbar)==null||i.show())});return}(t=this._editToolbar)==null||t.show(),(r=h(this,Qn))==null||r.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var e;return(e=this.div)==null?void 0:e.focus({preventScroll:!0})},0)}unselect(){var e,t,r,a,i;this.isSelected&&(this.isSelected=!1,(e=h(this,Aa))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(a=this._editToolbar)==null||a.hide(),(i=h(this,Qn))==null||i.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return h(this,Yb)}set isEditing(e){R(this,Yb,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){h(this,Gs)||R(this,Gs,new Map);const{action:r}=e;let a=h(this,Gs).get(r);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(e),h(this,Gs).delete(r),h(this,Gs).size===0&&R(this,Gs,null)},Ot._telemetryTimeout),h(this,Gs).set(r,a);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),R(this,nm,!1)}disable(){this.div&&(this.div.tabIndex=-1),R(this,nm,!0)}updateFakeAnnotationElement(e){if(!h(this,Hs)&&!this.deleted){R(this,Hs,e.addFakeAnnotation(this));return}if(this.deleted){h(this,Hs).remove(),R(this,Hs,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&h(this,Hs).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const r=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),r.before(t)}return t}resetAnnotationElement(e){const{firstElementChild:t}=e.container;(t==null?void 0:t.nodeName)==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};n0=new WeakMap,mo=new WeakMap,Qn=new WeakMap,vn=new WeakMap,du=new WeakMap,nm=new WeakMap,ad=new WeakMap,$b=new WeakMap,Aa=new WeakMap,r0=new WeakMap,hu=new WeakMap,Hs=new WeakMap,id=new WeakMap,Vb=new WeakMap,a0=new WeakMap,es=new WeakMap,Yb=new WeakMap,i0=new WeakMap,fu=new WeakMap,hl=new WeakMap,rm=new WeakMap,am=new WeakMap,Gs=new WeakMap,s0=new WeakMap,qb=new WeakMap,X4=new WeakMap,yt=new WeakSet,B_=function([e,t],r,a){[r,a]=this.screenToPageTranslation(r,a),this.x+=r/e,this.y+=a/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Wb=new WeakSet,z_=function(e,t,r){switch(r){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},NT=function(e){switch(e){case 90:{const[t,r]=this.pageDimensions;return[0,-t/r,r/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,r]=this.pageDimensions;return[0,t/r,-r/t,0]}default:return[1,0,0,1]}},lj=function(){if(h(this,Aa))return;R(this,Aa,document.createElement("div")),h(this,Aa).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const r of e){const a=document.createElement("div");h(this,Aa).append(a),a.classList.add("resizer",r),a.setAttribute("data-resizer-name",r),a.addEventListener("pointerdown",P(this,yt,uj).bind(this,r),{signal:t}),a.addEventListener("contextmenu",ks,{signal:t}),a.tabIndex=-1}this.div.prepend(h(this,Aa))},uj=function(e,t){var f;t.preventDefault();const{isMac:r}=_r.platform;if(t.button!==0||t.ctrlKey&&r)return;(f=h(this,Qn))==null||f.toggle(!1);const a=this._isDraggable;this._isDraggable=!1,R(this,r0,[t.screenX,t.screenY]);const i=new AbortController,s=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",P(this,yt,H_).bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",ar,{passive:!1,signal:s}),window.addEventListener("contextmenu",ks,{signal:s}),R(this,hu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const l=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const d=()=>{var m;i.abort(),this.parent.togglePointerEvents(!0),(m=h(this,Qn))==null||m.toggle(!0),this._isDraggable=a,this.parent.div.style.cursor=l,this.div.style.cursor=u,P(this,yt,OT).call(this)};window.addEventListener("pointerup",d,{signal:s}),window.addEventListener("blur",d,{signal:s})},U_=function(e,t,r,a){this.width=r,this.height=a,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},OT=function(){if(!h(this,hu))return;const{savedX:e,savedY:t,savedWidth:r,savedHeight:a}=h(this,hu);R(this,hu,null);const i=this.x,s=this.y,l=this.width,u=this.height;i===e&&s===t&&l===r&&u===a||this.addCommands({cmd:P(this,yt,U_).bind(this,i,s,l,u),undo:P(this,yt,U_).bind(this,e,t,r,a),mustExec:!0})},H_=function(e,t){const[r,a]=this.parentDimensions,i=this.x,s=this.y,l=this.width,u=this.height,d=Ot.MIN_SIZE/r,f=Ot.MIN_SIZE/a,m=P(this,yt,NT).call(this,this.rotation),b=(W,J)=>[m[0]*W+m[2]*J,m[1]*W+m[3]*J],y=P(this,yt,NT).call(this,360-this.rotation),E=(W,J)=>[y[0]*W+y[2]*J,y[1]*W+y[3]*J];let T,w,S=!1,x=!1;switch(e){case"topLeft":S=!0,T=(W,J)=>[0,0],w=(W,J)=>[W,J];break;case"topMiddle":T=(W,J)=>[W/2,0],w=(W,J)=>[W/2,J];break;case"topRight":S=!0,T=(W,J)=>[W,0],w=(W,J)=>[0,J];break;case"middleRight":x=!0,T=(W,J)=>[W,J/2],w=(W,J)=>[0,J/2];break;case"bottomRight":S=!0,T=(W,J)=>[W,J],w=(W,J)=>[0,0];break;case"bottomMiddle":T=(W,J)=>[W/2,J],w=(W,J)=>[W/2,0];break;case"bottomLeft":S=!0,T=(W,J)=>[0,J],w=(W,J)=>[W,0];break;case"middleLeft":x=!0,T=(W,J)=>[0,J/2],w=(W,J)=>[W,J/2];break}const C=T(l,u),I=w(l,u);let N=b(...I);const O=Ot._round(i+N[0]),z=Ot._round(s+N[1]);let G=1,$=1,H,X;if(t.fromKeyboard)({deltaX:H,deltaY:X}=t);else{const{screenX:W,screenY:J}=t,[fe,xe]=h(this,r0);[H,X]=this.screenToPageTranslation(W-fe,J-xe),h(this,r0)[0]=W,h(this,r0)[1]=J}if([H,X]=E(H/r,X/a),S){const W=Math.hypot(l,u);G=$=Math.max(Math.min(Math.hypot(I[0]-C[0]-H,I[1]-C[1]-X)/W,1/l,1/u),d/l,f/u)}else x?G=Wn(Math.abs(I[0]-C[0]-H),d,1)/l:$=Wn(Math.abs(I[1]-C[1]-X),f,1)/u;const te=Ot._round(l*G),ie=Ot._round(u*$);N=b(...w(te,ie));const Q=O-N[0],oe=z-N[1];h(this,es)||R(this,es,[this.x,this.y,this.width,this.height]),this.width=te,this.height=ie,this.x=Q,this.y=oe,this.setDims(),this.fixAndSetPosition(),this._onResizing()},cj=function(){var e;R(this,hu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=h(this,Qn))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},dj=function(e,t,r){let i=.7*(r/t)+1-.7;if(i===1)return;const s=P(this,yt,NT).call(this,this.rotation),l=(O,z)=>[s[0]*O+s[2]*z,s[1]*O+s[3]*z],[u,d]=this.parentDimensions,f=this.x,m=this.y,b=this.width,y=this.height,E=Ot.MIN_SIZE/u,T=Ot.MIN_SIZE/d;i=Math.max(Math.min(i,1/b,1/y),E/b,T/y);const w=Ot._round(b*i),S=Ot._round(y*i);if(w===b&&S===y)return;h(this,es)||R(this,es,[f,m,b,y]);const x=l(b/2,y/2),C=Ot._round(f+x[0]),I=Ot._round(m+x[1]),N=l(w/2,S/2);this.x=C-N[0],this.y=I-N[1],this.width=w,this.height=S,this.setDims(),this.fixAndSetPosition(),this._onResizing()},hj=function(){var e;(e=h(this,Qn))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),P(this,yt,OT).call(this)},G_=function(e){const{isMac:t}=_r.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},fj=function(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let r=!1;const a=new AbortController,i=this._uiManager.combinedSignal(a),s={capture:!0,passive:!1,signal:i},l=d=>{a.abort(),R(this,ad,null),R(this,a0,!1),this._uiManager.endDragSession()||P(this,yt,G_).call(this,d),r&&this._onStopDragging()};t&&(R(this,rm,e.clientX),R(this,am,e.clientY),R(this,ad,e.pointerId),R(this,$b,e.pointerType),window.addEventListener("pointermove",d=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:f,clientY:m,pointerId:b}=d;if(b!==h(this,ad)){ar(d);return}const[y,E]=this.screenToPageTranslation(f-h(this,rm),m-h(this,am));R(this,rm,f),R(this,am,m),this._uiManager.dragSelectedEditors(y,E)},s),window.addEventListener("touchmove",ar,s),window.addEventListener("pointerdown",d=>{d.pointerType===h(this,$b)&&(h(this,s0)||d.isPrimary)&&l(d),ar(d)},s));const u=d=>{if(!h(this,ad)||h(this,ad)===d.pointerId){l(d);return}ar(d)};window.addEventListener("pointerup",u,{signal:i}),window.addEventListener("blur",u,{signal:i})},j_=function(){if(h(this,id)||!this.div)return;R(this,id,new AbortController);const e=this._uiManager.combinedSignal(h(this,id));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},pj=function(e){Ot._resizerKeyboardManager.exec(this,e)},mj=function(e){var t;h(this,fu)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==h(this,Aa)&&P(this,yt,d2).call(this)},gj=function(e){R(this,Vb,h(this,fu)?e:"")},$_=function(e){if(h(this,mo))for(const t of h(this,mo))t.tabIndex=e},d2=function(){R(this,fu,!1),P(this,yt,$_).call(this,-1),P(this,yt,OT).call(this)},D(Ot,Wb),we(Ot,"_l10n",null),we(Ot,"_l10nResizer",null),we(Ot,"_borderLineWidth",-1),we(Ot,"_colorManager",new vA),we(Ot,"_zIndex",1),we(Ot,"_telemetryTimeout",1e3);let Un=Ot;class NX extends Un{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const p9=3285377520,Cs=4294901760,Go=65535;class wA{constructor(e){this.h1=e?e&4294967295:p9,this.h2=e?e&4294967295:p9}update(e){let t,r;if(typeof e=="string"){t=new Uint8Array(e.length*2),r=0;for(let T=0,w=e.length;T<w;T++){const S=e.charCodeAt(T);S<=255?t[r++]=S:(t[r++]=S>>>8,t[r++]=S&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),r=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=r>>2,i=r-a*4,s=new Uint32Array(t.buffer,0,a);let l=0,u=0,d=this.h1,f=this.h2;const m=3432918353,b=461845907,y=m&Go,E=b&Go;for(let T=0;T<a;T++)T&1?(l=s[T],l=l*m&Cs|l*y&Go,l=l<<15|l>>>17,l=l*b&Cs|l*E&Go,d^=l,d=d<<13|d>>>19,d=d*5+3864292196):(u=s[T],u=u*m&Cs|u*y&Go,u=u<<15|u>>>17,u=u*b&Cs|u*E&Go,f^=u,f=f<<13|f>>>19,f=f*5+3864292196);switch(l=0,i){case 3:l^=t[a*4+2]<<16;case 2:l^=t[a*4+1]<<8;case 1:l^=t[a*4],l=l*m&Cs|l*y&Go,l=l<<15|l>>>17,l=l*b&Cs|l*E&Go,a&1?d^=l:f^=l}this.h1=d,this.h2=f}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Cs|e*36045&Go,t=t*4283543511&Cs|((t<<16|e>>>16)*2950163797&Cs)>>>16,e^=t>>>1,e=e*444984403&Cs|e*60499&Go,t=t*3301882366&Cs|((t<<16|e>>>16)*3120437893&Cs)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const E1=Object.freeze({map:null,hash:"",transfer:void 0});class TA{constructor(){D(this,K4);D(this,o0,!1);D(this,l0,null);D(this,pu,null);D(this,xa,new Map);we(this,"onSetModified",null);we(this,"onResetModified",null);we(this,"onAnnotationEditor",null)}getValue(e,t){const r=h(this,xa).get(e);return r===void 0?t:Object.assign(t,r)}getRawValue(e){return h(this,xa).get(e)}remove(e){var r;const t=h(this,xa).get(e);t!==void 0&&(t instanceof Un&&h(this,pu).delete(t.annotationElementId),h(this,xa).delete(e),h(this,xa).size===0&&this.resetModified(),!h(this,xa).values().some(a=>a instanceof Un)&&((r=this.onAnnotationEditor)==null||r.call(this,null)))}setValue(e,t){var i;const r=h(this,xa).get(e);let a=!1;if(r!==void 0)for(const[s,l]of Object.entries(t))r[s]!==l&&(a=!0,r[s]=l);else a=!0,h(this,xa).set(e,t);a&&P(this,K4,bj).call(this),t instanceof Un&&((h(this,pu)||R(this,pu,new Map)).set(t.annotationElementId,t),(i=this.onAnnotationEditor)==null||i.call(this,t.constructor._type))}has(e){return h(this,xa).has(e)}get size(){return h(this,xa).size}resetModified(){var e;h(this,o0)&&(R(this,o0,!1),(e=this.onResetModified)==null||e.call(this))}get print(){return new m9(this)}get serializable(){if(h(this,xa).size===0)return E1;const e=new Map,t=new wA,r=[],a=Object.create(null);let i=!1;for(const[s,l]of h(this,xa)){const u=l instanceof Un?l.serialize(!1,a):l;l.page&&(l.pageIndex=l.page._pageIndex,delete l.page),u&&(e.set(s,u),t.update(`${s}:${JSON.stringify(u)}`),i||(i=!!u.bitmap))}if(i)for(const s of e.values())s.bitmap&&r.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:r}:E1}get editorStats(){var i;let e=null;const t=new Map;let r=0,a=0;for(const s of h(this,xa).values()){if(!(s instanceof Un)){s.popup&&(s.popup.deleted?a+=1:r+=1);continue}s.isCommentDeleted?a+=1:s.hasEditedComment&&(r+=1);const l=s.telemetryFinalData;if(!l)continue;const{type:u}=l;t.has(u)||t.set(u,Object.getPrototypeOf(s).constructor),e||(e=Object.create(null));const d=e[u]||(e[u]=new Map);for(const[f,m]of Object.entries(l)){if(f==="type")continue;const b=d.getOrInsertComputed(f,cA);b.set(m,((i=b.get(m))!=null?i:0)+1)}}if((a>0||r>0)&&(e||(e=Object.create(null)),e.comments={deleted:a,edited:r}),!e)return null;for(const[s,l]of t)e[s]=l.computeTelemetryFinalData(e[s]);return e}resetModifiedIds(){R(this,l0,null)}updateEditor(e,t){var a;const r=(a=h(this,pu))==null?void 0:a.get(e);return r?(r.updateFromAnnotationLayer(t),!0):!1}getEditor(e){var t;return((t=h(this,pu))==null?void 0:t.get(e))||null}get modifiedIds(){if(h(this,l0))return h(this,l0);const e=[];if(h(this,pu))for(const r of h(this,pu).values())r.serialize()&&e.push(r.annotationElementId);let t="";if(e.length){const r=new wA;r.update(e.join(",")),t=r.hexdigest()}return R(this,l0,{ids:new Set(e),hash:t})}[Symbol.iterator](){return h(this,xa).entries()}}o0=new WeakMap,l0=new WeakMap,pu=new WeakMap,xa=new WeakMap,K4=new WeakSet,bj=function(){var e;h(this,o0)||(R(this,o0,!0),(e=this.onSetModified)==null||e.call(this))};class m9 extends TA{constructor(t){super();D(this,Xb,E1);const{serializable:r}=t;if(r===E1)return;const{map:a,hash:i,transfer:s}=r,l=structuredClone(a,s?{transfer:s}:null);R(this,Xb,{map:l,hash:i,transfer:[]})}get print(){pn("Should not call PrintAnnotationStorage.print")}get serializable(){return h(this,Xb)}get modifiedIds(){return _t(this,"modifiedIds",{ids:new Set,hash:""})}}Xb=new WeakMap,At(7588);const Yf="__forcedDependency",{floor:g9,ceil:b9}=Math;function y9(n,e,t,r,a,i){n[e*4+0]=Math.min(n[e*4+0],t),n[e*4+1]=Math.min(n[e*4+1],r),n[e*4+2]=Math.max(n[e*4+2],a),n[e*4+3]=Math.max(n[e*4+3],i)}const SA=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class OX{constructor(e,t){D(this,im);D(this,sd);R(this,im,e),R(this,sd,t)}get length(){return h(this,im).length}isEmpty(e){return h(this,im)[e]===SA}minX(e){return h(this,sd)[e*4+0]/256}minY(e){return h(this,sd)[e*4+1]/256}maxX(e){return(h(this,sd)[e*4+2]+1)/256}maxY(e){return(h(this,sd)[e*4+3]+1)/256}}im=new WeakMap,sd=new WeakMap;const E9=(n,e)=>n==null?void 0:n.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class DX{constructor(e,t){D(this,Kb);D(this,mu,[[1,0,0,1,0,0]]);D(this,gn,[-1/0,-1/0,1/0,1/0]);D(this,Vn,new Float64Array(zl));we(this,"_pendingBBoxIdx",-1);D(this,u0);D(this,c0);D(this,d0);D(this,Wa);we(this,"_savesStack",[]);we(this,"_markedContentStack",[]);R(this,u0,e.width),R(this,c0,e.height),P(this,Kb,V_).call(this,t)}growOperationsCount(e){e>=h(this,Wa).length&&P(this,Kb,V_).call(this,e,h(this,Wa))}get clipBox(){return h(this,gn)}save(e){return R(this,gn,{__proto__:h(this,gn)}),this._savesStack.push(e),this}restore(e,t){const r=Object.getPrototypeOf(h(this,gn));if(r===null)return this;R(this,gn,r);const a=this._savesStack.pop();return a!==void 0&&(t==null||t(a,e),h(this,Wa)[e]=h(this,Wa)[a]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){const r=this._savesStack.pop();return r!==void 0&&(t==null||t(r,e),h(this,Wa)[e]=h(this,Wa)[r]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){const r=this._markedContentStack.pop();return r!==void 0&&(t==null||t(r,e),h(this,Wa)[e]=h(this,Wa)[r]),this}pushBaseTransform(e){return h(this,mu).push(We.multiplyByDOMMatrix(h(this,mu).at(-1),e.getTransform())),this}popBaseTransform(){return h(this,mu).length>1&&h(this,mu).pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,h(this,Vn).set(zl,0)),this}recordClipBox(e,t,r,a,i,s){const l=We.multiplyByDOMMatrix(h(this,mu).at(-1),t.getTransform()),u=zl.slice();We.axialAlignedBoundingBox([r,i,a,s],l,u);const d=We.intersect(h(this,gn),u);return d?(h(this,gn)[0]=d[0],h(this,gn)[1]=d[1],h(this,gn)[2]=d[2],h(this,gn)[3]=d[3]):(h(this,gn)[0]=h(this,gn)[1]=1/0,h(this,gn)[2]=h(this,gn)[3]=-1/0),this}recordBBox(e,t,r,a,i,s){const l=h(this,gn);if(l[0]===1/0)return this;const u=We.multiplyByDOMMatrix(h(this,mu).at(-1),t.getTransform());if(l[0]===-1/0)return We.axialAlignedBoundingBox([r,i,a,s],u,h(this,Vn)),this;const d=zl.slice();return We.axialAlignedBoundingBox([r,i,a,s],u,d),h(this,Vn)[0]=Wn(d[0],l[0],h(this,Vn)[0]),h(this,Vn)[1]=Wn(d[1],l[1],h(this,Vn)[1]),h(this,Vn)[2]=Wn(d[2],h(this,Vn)[2],l[2]),h(this,Vn)[3]=Wn(d[3],h(this,Vn)[3],l[3]),this}recordFullPageBBox(e){return h(this,Vn)[0]=Math.max(0,h(this,gn)[0]),h(this,Vn)[1]=Math.max(0,h(this,gn)[1]),h(this,Vn)[2]=Math.min(h(this,u0),h(this,gn)[2]),h(this,Vn)[3]=Math.min(h(this,c0),h(this,gn)[3]),this}recordOperation(e,t=!1,r){if(this._pendingBBoxIdx!==e)return this;const a=g9(h(this,Vn)[0]*256/h(this,u0)),i=g9(h(this,Vn)[1]*256/h(this,c0)),s=b9(h(this,Vn)[2]*256/h(this,u0)),l=b9(h(this,Vn)[3]*256/h(this,c0));if(y9(h(this,d0),e,a,i,s,l),r)for(const u of r)for(const d of u)d!==e&&y9(h(this,d0),d,a,i,s,l);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,h(this,gn)[0]=Math.max(h(this,gn)[0],h(this,Vn)[0]),h(this,gn)[1]=Math.max(h(this,gn)[1],h(this,Vn)[1]),h(this,gn)[2]=Math.min(h(this,gn)[2],h(this,Vn)[2]),h(this,gn)[3]=Math.min(h(this,gn)[3],h(this,Vn)[3])),this}take(){return new OX(h(this,Wa),h(this,d0))}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,r){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,r,a=1,i=0,s=0,l){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}}mu=new WeakMap,gn=new WeakMap,Vn=new WeakMap,u0=new WeakMap,c0=new WeakMap,d0=new WeakMap,Wa=new WeakMap,Kb=new WeakSet,V_=function(e,t){const r=new ArrayBuffer(e*4);R(this,d0,new Uint8ClampedArray(r)),R(this,Wa,new Uint32Array(r)),t&&t.length>0?(h(this,Wa).set(t),h(this,Wa).fill(SA,t.length)):h(this,Wa).fill(SA)};class LX{constructor(e,t=!1){D(this,_i,{__proto__:null});D(this,Ni,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Yf]:[]});D(this,h0,new Map);D(this,go,new Set);D(this,sm,new Map);D(this,od);D(this,ld);D(this,xn);R(this,xn,e),t&&(R(this,od,new Map),R(this,ld,(r,a)=>{E9(h(this,od),a).dependencies.add(r)}))}get clipBox(){return h(this,xn).clipBox}growOperationsCount(e){h(this,xn).growOperationsCount(e)}save(e){return R(this,_i,{__proto__:h(this,_i)}),R(this,Ni,{__proto__:h(this,Ni),transform:{__proto__:h(this,Ni).transform},moveText:{__proto__:h(this,Ni).moveText},sameLineText:{__proto__:h(this,Ni).sameLineText},[Yf]:{__proto__:h(this,Ni)[Yf]}}),h(this,xn).save(e),this}restore(e){h(this,xn).restore(e,h(this,ld));const t=Object.getPrototypeOf(h(this,_i));return t===null?this:(R(this,_i,t),R(this,Ni,Object.getPrototypeOf(h(this,Ni))),this)}recordOpenMarker(e){return h(this,xn).recordOpenMarker(e,h(this,ld)),this}getOpenMarker(){return h(this,xn).getOpenMarker()}recordCloseMarker(e){return h(this,xn).recordCloseMarker(e,h(this,ld)),this}beginMarkedContent(e){return h(this,xn).beginMarkedContent(e),this}endMarkedContent(e){return h(this,xn).endMarkedContent(e,h(this,ld)),this}pushBaseTransform(e){return h(this,xn).pushBaseTransform(e),this}popBaseTransform(){return h(this,xn).popBaseTransform(),this}recordSimpleData(e,t){return h(this,_i)[e]=t,this}recordIncrementalData(e,t){return h(this,Ni)[e].push(t),this}resetIncrementalData(e,t){return h(this,Ni)[e].length=0,this}recordNamedData(e,t){return h(this,h0).set(e,t),this}recordSimpleDataFromNamed(e,t,r){var a;h(this,_i)[e]=(a=h(this,h0).get(t))!=null?a:r}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Yf,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const t of e)t in h(this,_i)&&this.recordFutureForcedDependency(t,h(this,_i)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of h(this,go))this.recordFutureForcedDependency(Yf,e);return this}resetBBox(e){return h(this,xn).resetBBox(e),this}recordClipBox(e,t,r,a,i,s){return h(this,xn).recordClipBox(e,t,r,a,i,s),this}recordBBox(e,t,r,a,i,s){return h(this,xn).recordBBox(e,t,r,a,i,s),this}recordCharacterBBox(e,t,r,a=1,i=0,s=0,l){const u=r.bbox;let d,f;if(u&&(d=u[2]!==u[0]&&u[3]!==u[1]&&h(this,sm).get(r),d!==!1&&(f=[0,0,0,0],We.axialAlignedBoundingBox(u,r.fontMatrix,f),(a!==1||i!==0||s!==0)&&We.scaleMinMax([a,0,0,-a,i,s],f),d)))return this.recordBBox(e,t,f[0],f[2],f[1],f[3]);if(!l)return this.recordFullPageBBox(e);const m=l();return u&&f&&d===void 0&&(d=f[0]<=i-m.actualBoundingBoxLeft&&f[2]>=i+m.actualBoundingBoxRight&&f[1]<=s-m.actualBoundingBoxAscent&&f[3]>=s+m.actualBoundingBoxDescent,h(this,sm).set(r,d),d)?this.recordBBox(e,t,f[0],f[2],f[1],f[3]):this.recordBBox(e,t,i-m.actualBoundingBoxLeft,i+m.actualBoundingBoxRight,s-m.actualBoundingBoxAscent,s+m.actualBoundingBoxDescent)}recordFullPageBBox(e){return h(this,xn).recordFullPageBBox(e),this}getSimpleIndex(e){return h(this,_i)[e]}recordDependencies(e,t){const r=h(this,go),a=h(this,_i),i=h(this,Ni);for(const s of t)s in h(this,_i)?r.add(a[s]):s in i&&i[s].forEach(r.add,r);return this}recordNamedDependency(e,t){return h(this,h0).has(t)&&h(this,go).add(h(this,h0).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Yf]),h(this,od)){const a=E9(h(this,od),e),{dependencies:i}=a;h(this,go).forEach(i.add,i),h(this,xn)._savesStack.forEach(i.add,i),h(this,xn)._markedContentStack.forEach(i.add,i),i.delete(e),a.isRenderingOperation=!0}const r=!t&&e===h(this,xn)._pendingBBoxIdx;return h(this,xn).recordOperation(e,t,[h(this,go),h(this,xn)._savesStack,h(this,xn)._markedContentStack]),r&&h(this,go).clear(),this}recordShowTextOperation(e,t=!1){const r=Array.from(h(this,go));this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(const a of r)this.recordIncrementalData("sameLineText",a);return this}bboxToClipBoxDropOperation(e,t=!1){const r=!t&&e===h(this,xn)._pendingBBoxIdx;return h(this,xn).bboxToClipBoxDropOperation(e),r&&h(this,go).clear(),this}take(){return h(this,sm).clear(),h(this,xn).take()}takeDebugMetadata(){return h(this,od)}}_i=new WeakMap,Ni=new WeakMap,h0=new WeakMap,go=new WeakMap,sm=new WeakMap,od=new WeakMap,ld=new WeakMap,xn=new WeakMap;const fR=class fR{constructor(e,t,r){D(this,kn);D(this,mr);D(this,bo);D(this,om,0);D(this,lm,0);if(e instanceof fR&&h(e,bo)===!!r)return e;R(this,kn,e),R(this,mr,t),R(this,bo,!!r)}get clipBox(){return h(this,kn).clipBox}growOperationsCount(){throw new Error("Unreachable")}save(e){return dr(this,lm)._++,h(this,kn).save(h(this,mr)),this}restore(e){return h(this,lm)>0&&(h(this,kn).restore(h(this,mr)),dr(this,lm)._--),this}recordOpenMarker(e){return dr(this,om)._++,this}getOpenMarker(){return h(this,om)>0?h(this,mr):h(this,kn).getOpenMarker()}recordCloseMarker(e){return dr(this,om)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return h(this,kn).pushBaseTransform(e),this}popBaseTransform(){return h(this,kn).popBaseTransform(),this}recordSimpleData(e,t){return h(this,kn).recordSimpleData(e,h(this,mr)),this}recordIncrementalData(e,t){return h(this,kn).recordIncrementalData(e,h(this,mr)),this}resetIncrementalData(e,t){return h(this,kn).resetIncrementalData(e,h(this,mr)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,r){return h(this,kn).recordSimpleDataFromNamed(e,t,h(this,mr)),this}recordFutureForcedDependency(e,t){return h(this,kn).recordFutureForcedDependency(e,h(this,mr)),this}inheritSimpleDataAsFutureForcedDependencies(e){return h(this,kn).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return h(this,kn).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return h(this,bo)||h(this,kn).resetBBox(h(this,mr)),this}recordClipBox(e,t,r,a,i,s){return h(this,bo)||h(this,kn).recordClipBox(h(this,mr),t,r,a,i,s),this}recordBBox(e,t,r,a,i,s){return h(this,bo)||h(this,kn).recordBBox(h(this,mr),t,r,a,i,s),this}recordCharacterBBox(e,t,r,a,i,s,l){return h(this,bo)||h(this,kn).recordCharacterBBox(h(this,mr),t,r,a,i,s,l),this}recordFullPageBBox(e){return h(this,bo)||h(this,kn).recordFullPageBBox(h(this,mr)),this}getSimpleIndex(e){return h(this,kn).getSimpleIndex(e)}recordDependencies(e,t){return h(this,kn).recordDependencies(h(this,mr),t),this}recordNamedDependency(e,t){return h(this,kn).recordNamedDependency(h(this,mr),t),this}recordOperation(e){return h(this,kn).recordOperation(h(this,mr),!0),this}recordShowTextOperation(e){return h(this,kn).recordShowTextOperation(h(this,mr),!0),this}bboxToClipBoxDropOperation(e){return h(this,bo)||h(this,kn).bboxToClipBoxDropOperation(h(this,mr),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};kn=new WeakMap,mr=new WeakMap,bo=new WeakMap,om=new WeakMap,lm=new WeakMap;let v1=fR;const Rs={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Qb=class Qb{constructor(e){D(this,f0);D(this,p0);D(this,m0,4);D(this,g0,0);D(this,b0,new(h(Qb,Zb))(h(this,m0)*6));R(this,f0,e.width),R(this,p0,e.height)}record(e,t,r,a){if(h(this,g0)===h(this,m0)){R(this,m0,h(this,m0)*2);const l=new(h(Qb,Zb))(h(this,m0)*6);l.set(h(this,b0)),R(this,b0,l)}const i=We.domMatrixToTransform(e.getTransform());let s;if(a[0]!==1/0){const l=zl.slice();We.axialAlignedBoundingBox([0,-r,t,0],i,l);const u=We.intersect(a,l);if(!u)return;const[d,f,m,b]=u;if(d!==l[0]||f!==l[1]||m!==l[2]||b!==l[3]){const y=Math.atan2(i[1],i[0]),E=Math.abs(Math.sin(y)),T=Math.abs(Math.cos(y));if(E<1e-6||T<1e-6||Math.abs(E-T)<1e-6)s=[d,f,d,b,m,f];else{const w=m-d,S=b-f,x=E*E,C=T*T,I=T*E,N=C-x,O=(S*C-w*I)/N,z=(S*I-w*x)/N;s=[d+z,f,d,f+O,m,b-O]}}}s||(s=[0,-r,0,0,t,-r],We.applyTransform(s,i,0),We.applyTransform(s,i,2),We.applyTransform(s,i,4)),s[0]/=h(this,f0),s[1]/=h(this,p0),s[2]/=h(this,f0),s[3]/=h(this,p0),s[4]/=h(this,f0),s[5]/=h(this,p0),h(this,b0).set(s,h(this,g0)*6),dr(this,g0)._++}take(){return h(this,b0).subarray(0,h(this,g0)*6)}};f0=new WeakMap,p0=new WeakMap,m0=new WeakMap,g0=new WeakMap,b0=new WeakMap,Zb=new WeakMap,D(Qb,Zb,_r.isFloat16ArraySupported?Float16Array:Float32Array);let AA=Qb;class MX{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){D(this,um,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),h(this,um).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:r}){if(!(!e||h(this,um).has(e.loadedName))){if(rr(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:a,src:i,style:s}=e,l=new FontFace(a,i,s);this.addNativeFontFace(l);try{await l.load(),h(this,um).add(a),r==null||r(e)}catch{xt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(l)}return}pn("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(a){throw xt(`Failed to load font '${r.family}': '${a}'.`),e.disableFontFace=!0,a}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const a=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,a)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return _t(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return _t(this,"isSyncFontLoadingSupported",Gi||_r.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(rr(!a.done,"completeRequest() cannot be called twice."),a.done=!0;r.length>0&&r[0].done;){const i=r.shift();setTimeout(i.callback,0)}}const{loadingRequests:r}=this,a={done:!1,complete:t,callback:e};return r.push(a),a}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return _t(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function r(N,O){return N.charCodeAt(O)<<24|N.charCodeAt(O+1)<<16|N.charCodeAt(O+2)<<8|N.charCodeAt(O+3)&255}function a(N){return String.fromCharCode(N>>24&255,N>>16&255,N>>8&255,N&255)}function i(N,O,z,G){const $=N.substring(0,O),H=N.substring(O+z);return $+G+H}let s,l;const u=this._document.createElement("canvas");u.width=1,u.height=1;const d=u.getContext("2d");let f=0;function m(N,O){if(++f>30){xt("Load test font never loaded."),O();return}if(d.font="30px "+N,d.fillText(".",0,20),d.getImageData(0,0,1,1).data[3]>0){O();return}setTimeout(m.bind(null,N,O))}const b=`lt${Date.now()}${this.loadTestFontId++}`;let y=this._loadTestFont;y=i(y,976,b.length,b);const T=16,w=1482184792;let S=r(y,T);for(s=0,l=b.length-3;s<l;s+=4)S=S-w+r(b,s)|0;s<b.length&&(S=S-w+r(b+"XXX",s)|0),y=i(y,T,4,a(S));const x=`url(data:font/opentype;base64,${btoa(y)});`,C=`@font-face {font-family:"${b}";src:${x}}`;this.insertRule(C);const I=this._document.createElement("div");I.style.visibility="hidden",I.style.width=I.style.height="10px",I.style.position="absolute",I.style.top=I.style.left="0px";for(const N of[e.loadedName,b]){const O=this._document.createElement("span");O.textContent="Hi",O.style.fontFamily=N,I.append(O)}this._document.body.append(I),m(b,()=>{I.remove(),t.complete()})}}um=new WeakMap;class FX{constructor(e,t=null,r,a){we(this,"compiledGlyphs",Object.create(null));D(this,Cn);R(this,Cn,e),this._inspectFont=t,r&&(this.charProcOperatorList=r),a&&Object.assign(this,a)}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var r;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${e}}`}return(r=this._inspectFont)==null||r.call(this,this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const r=this.loadedName+"_path_"+t;let a;try{a=e.get(r)}catch(s){xt(`getPathGenerator - ignoring character: "${s}".`)}const i=h9(a==null?void 0:a.path);return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[t]=i}get black(){return h(this,Cn).black}get bold(){return h(this,Cn).bold}get disableFontFace(){return h(this,Cn).disableFontFace}set disableFontFace(e){_t(this,"disableFontFace",!!e)}get fontExtraProperties(){return h(this,Cn).fontExtraProperties}get isInvalidPDFjsFont(){return h(this,Cn).isInvalidPDFjsFont}get isType3Font(){return h(this,Cn).isType3Font}get italic(){return h(this,Cn).italic}get missingFile(){return h(this,Cn).missingFile}get remeasure(){return h(this,Cn).remeasure}get vertical(){return h(this,Cn).vertical}get ascent(){return h(this,Cn).ascent}get defaultWidth(){return h(this,Cn).defaultWidth}get descent(){return h(this,Cn).descent}get bbox(){return h(this,Cn).bbox}get fontMatrix(){return h(this,Cn).fontMatrix}get fallbackName(){return h(this,Cn).fallbackName}get loadedName(){return h(this,Cn).loadedName}get mimetype(){return h(this,Cn).mimetype}get name(){return h(this,Cn).name}get data(){return h(this,Cn).data}clearData(){h(this,Cn).clearData()}get cssFontInfo(){return h(this,Cn).cssFontInfo}get systemFontInfo(){return h(this,Cn).systemFontInfo}get defaultVMetrics(){return h(this,Cn).defaultVMetrics}}Cn=new WeakMap;class v9{}we(v9,"strings",["fontFamily","fontWeight","italicAngle"]);class w9{}we(w9,"strings",["css","loadedName","baseFontName","src"]);const Xa=class Xa{};we(Xa,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),we(Xa,"numbers",["ascent","defaultWidth","descent"]),we(Xa,"strings",["fallbackName","loadedName","mimetype","name"]),we(Xa,"OFFSET_NUMBERS",Math.ceil(Xa.bools.length*2/8)),we(Xa,"OFFSET_BBOX",Xa.OFFSET_NUMBERS+Xa.numbers.length*8),we(Xa,"OFFSET_FONT_MATRIX",Xa.OFFSET_BBOX+1+8),we(Xa,"OFFSET_DEFAULT_VMETRICS",Xa.OFFSET_FONT_MATRIX+1+48),we(Xa,"OFFSET_STRINGS",Xa.OFFSET_DEFAULT_VMETRICS+1+6);let $i=Xa;class ni{}we(ni,"KIND",0),we(ni,"HAS_BBOX",1),we(ni,"HAS_BACKGROUND",2),we(ni,"SHADING_TYPE",3),we(ni,"N_COORD",4),we(ni,"N_COLOR",8),we(ni,"N_STOP",12),we(ni,"N_FIGURES",16);class PX{constructor(e){D(this,dm);D(this,Jb);D(this,Z4,new TextDecoder);D(this,cm);R(this,Jb,e),R(this,cm,new DataView(e))}get fontFamily(){return P(this,dm,DT).call(this,0)}get fontWeight(){return P(this,dm,DT).call(this,1)}get italicAngle(){return P(this,dm,DT).call(this,2)}}Jb=new WeakMap,Z4=new WeakMap,cm=new WeakMap,dm=new WeakSet,DT=function(e){rr(e<v9.strings.length,"Invalid string index");let t=0;for(let a=0;a<e;a++)t+=h(this,cm).getUint32(t)+4;const r=h(this,cm).getUint32(t);return h(this,Z4).decode(new Uint8Array(h(this,Jb),t+4,r))};class BX{constructor(e){D(this,E0);D(this,y0);D(this,hm,new TextDecoder);D(this,fl);R(this,y0,e),R(this,fl,new DataView(e))}get guessFallback(){return h(this,fl).getUint8(0)!==0}get css(){return P(this,E0,h2).call(this,0)}get loadedName(){return P(this,E0,h2).call(this,1)}get baseFontName(){return P(this,E0,h2).call(this,2)}get src(){return P(this,E0,h2).call(this,3)}get style(){let e=1;e+=4+h(this,fl).getUint32(e);const t=h(this,fl).getUint32(e),r=h(this,hm).decode(new Uint8Array(h(this,y0),e+4,t));e+=4+t;const a=h(this,fl).getUint32(e),i=h(this,hm).decode(new Uint8Array(h(this,y0),e+4,a));return{style:r,weight:i}}}y0=new WeakMap,hm=new WeakMap,fl=new WeakMap,E0=new WeakSet,h2=function(e){rr(e<w9.strings.length,"Invalid string index");let t=5;for(let a=0;a<e;a++)t+=h(this,fl).getUint32(t)+4;const r=h(this,fl).getUint32(t);return h(this,hm).decode(new Uint8Array(h(this,y0),t+4,r))};class zX{constructor({buffer:e,extra:t}){D(this,wn);D(this,yo);D(this,Q4,new TextDecoder);D(this,Ar);R(this,yo,e),R(this,Ar,new DataView(e)),t&&Object.assign(this,t)}get black(){return P(this,wn,Po).call(this,0)}get bold(){return P(this,wn,Po).call(this,1)}get disableFontFace(){return P(this,wn,Po).call(this,2)}get fontExtraProperties(){return P(this,wn,Po).call(this,3)}get isInvalidPDFjsFont(){return P(this,wn,Po).call(this,4)}get isType3Font(){return P(this,wn,Po).call(this,5)}get italic(){return P(this,wn,Po).call(this,6)}get missingFile(){return P(this,wn,Po).call(this,7)}get remeasure(){return P(this,wn,Po).call(this,8)}get vertical(){return P(this,wn,Po).call(this,9)}get ascent(){return P(this,wn,LT).call(this,0)}get defaultWidth(){return P(this,wn,LT).call(this,1)}get descent(){return P(this,wn,LT).call(this,2)}get bbox(){return P(this,wn,MT).call(this,$i.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return P(this,wn,MT).call(this,$i.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return P(this,wn,MT).call(this,$i.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}get fallbackName(){return P(this,wn,f2).call(this,0)}get loadedName(){return P(this,wn,f2).call(this,1)}get mimetype(){return P(this,wn,f2).call(this,2)}get name(){return P(this,wn,f2).call(this,3)}get data(){const{offset:e,length:t}=P(this,wn,Y_).call(this);return t===0?void 0:new Uint8Array(h(this,yo),e+4,t)}clearData(){const{offset:e,length:t}=P(this,wn,Y_).call(this);t!==0&&(h(this,Ar).setUint32(e,0),R(this,yo,new Uint8Array(h(this,yo),0,e+4).slice().buffer),R(this,Ar,new DataView(h(this,yo))))}get cssFontInfo(){let e=$i.OFFSET_STRINGS;const t=h(this,Ar).getUint32(e);e+=4+t;const r=h(this,Ar).getUint32(e);e+=4+r;const a=h(this,Ar).getUint32(e);if(a===0)return null;const i=new Uint8Array(a);return i.set(new Uint8Array(h(this,yo),e+4,a)),new PX(i.buffer)}get systemFontInfo(){let e=$i.OFFSET_STRINGS;const t=h(this,Ar).getUint32(e);e+=4+t;const r=h(this,Ar).getUint32(e);if(r===0)return null;const a=new Uint8Array(r);return a.set(new Uint8Array(h(this,yo),e+4,r)),new BX(a.buffer)}}yo=new WeakMap,Q4=new WeakMap,Ar=new WeakMap,wn=new WeakSet,Po=function(e){rr(e<$i.bools.length,"Invalid boolean index");const t=Math.floor(e/4),r=e*2%8,a=h(this,Ar).getUint8(t)>>r&3;return a===0?void 0:a===2},LT=function(e){return rr(e<$i.numbers.length,"Invalid number index"),h(this,Ar).getFloat64($i.OFFSET_NUMBERS+e*8)},MT=function(e,t,r,a){const i=h(this,Ar).getUint8(e);if(i===0)return;rr(i===t,"Invalid array length."),e+=1;const s=new Array(i);for(let l=0;l<i;l++)s[l]=h(this,Ar)[r](e,!0),e+=a;return s},f2=function(e){rr(e<$i.strings.length,"Invalid string index");let t=$i.OFFSET_STRINGS+4;for(let a=0;a<e;a++)t+=h(this,Ar).getUint32(t)+4;const r=h(this,Ar).getUint32(t);return h(this,Q4).decode(new Uint8Array(h(this,yo),t+4,r))},Y_=function(){let e=$i.OFFSET_STRINGS;const t=h(this,Ar).getUint32(e);e+=4+t;const r=h(this,Ar).getUint32(e);e+=4+r;const a=h(this,Ar).getUint32(e);e+=4+a;const i=h(this,Ar).getUint32(e);return{offset:e,length:i}};class UX{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){const e=this.view,t=this.data[ni.KIND],r=!!this.data[ni.HAS_BBOX],a=!!this.data[ni.HAS_BACKGROUND],i=e.getUint32(ni.N_COORD,!0),s=e.getUint32(ni.N_COLOR,!0),l=e.getUint32(ni.N_STOP,!0);let u=20;const d=new Float32Array(this.buffer,u,i*2);u+=i*8;const f=new Uint8Array(this.buffer,u,s*4);u+=s*4;const m=[];for(let E=0;E<l;++E){const T=e.getFloat32(u,!0);u+=4;const w=e.getUint32(u,!0);u+=4,m.push([T,`#${w.toString(16).padStart(6,"0")}`])}let b=null;if(r){b=[];for(let E=0;E<4;++E)b.push(e.getFloat32(u,!0)),u+=4}let y=null;if(a&&(y=new Uint8Array(this.buffer,u,3),u+=3),t===1)return["RadialAxial","axial",b,m,Array.from(d.slice(0,2)),Array.from(d.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",b,m,[d[0],d[1]],[d[3],d[4]],d[2],d[5]];if(t===3){const E=this.data[ni.SHADING_TYPE];let T=null;if(d.length>0){T=zl.slice();for(let w=0,S=d.length;w<S;w+=2)We.pointBoundingBox(d[w],d[w+1],T)}return["Mesh",E,d,f,i,T,b,y]}throw new Error(`Unsupported pattern kind: ${t}`)}}class HX{constructor(e){D(this,fm);R(this,fm,e)}get path(){return _r.isFloat16ArraySupported?new Float16Array(h(this,fm)):new Float32Array(h(this,fm))}}fm=new WeakMap;function GX(n){if(n instanceof URL)return n;if(typeof n=="string"){if(Gi){if(/^[a-z][a-z0-9\-+.]+:/i.test(n))return new URL(n);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}const e=URL.parse(n,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function jX(n){if(Gi&&typeof Buffer!="undefined"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return tv(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function ov(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}const xA=n=>typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0,$X=n=>typeof n=="object"&&typeof(n==null?void 0:n.name)=="string",VX=yX.bind(null,xA,$X);class YX{constructor(){D(this,gu,new Map);D(this,J4,Promise.resolve())}postMessage(e,t){const r={data:structuredClone(e,t?{transfer:t}:null)};h(this,J4).then(()=>{for(const[a]of h(this,gu))a.call(this,r)})}addEventListener(e,t,r=null){let a=null;if((r==null?void 0:r.signal)instanceof AbortSignal){const{signal:i}=r;if(i.aborted){xt("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,t);a=()=>i.removeEventListener("abort",s),i.addEventListener("abort",s)}h(this,gu).set(t,a)}removeEventListener(e,t){const r=h(this,gu).get(t);r==null||r(),h(this,gu).delete(t)}terminate(){for(const[,e]of h(this,gu))e==null||e();h(this,gu).clear()}}gu=new WeakMap,J4=new WeakMap,At(1689);const lv={DATA:1,ERROR:2},Nr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function T9(){}function Ti(n){if(n instanceof hc||n instanceof oA||n instanceof n9||n instanceof ev||n instanceof sA)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||pn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new hc(n.message);case"InvalidPDFException":return new oA(n.message);case"PasswordException":return new n9(n.message,n.code);case"ResponseException":return new ev(n.message,n.status,n.missing);case"UnknownErrorException":return new sA(n.message,n.details)}return new sA(n.message,n.toString())}class w1{constructor(e,t,r){D(this,js);D(this,pm,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),r.addEventListener("message",P(this,js,yj).bind(this),{signal:h(this,pm).signal})}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const a=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[a]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},r)}catch(s){i.reject(s)}return i.promise}sendWithStream(e,t,r,a){const i=this.streamId++,s=this.sourceName,l=this.targetName,u=this.comObj;return new ReadableStream({start:d=>{const f=Promise.withResolvers();return this.streamControllers[i]={controller:d,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},u.postMessage({sourceName:s,targetName:l,action:e,streamId:i,data:t,desiredSize:d.desiredSize},a),f.promise},pull:d=>{const f=Promise.withResolvers();return this.streamControllers[i].pullCall=f,u.postMessage({sourceName:s,targetName:l,stream:Nr.PULL,streamId:i,desiredSize:d.desiredSize}),f.promise},cancel:d=>{rr(d instanceof Error,"cancel must have a valid reason");const f=Promise.withResolvers();return this.streamControllers[i].cancelCall=f,this.streamControllers[i].isClosed=!0,u.postMessage({sourceName:s,targetName:l,stream:Nr.CANCEL,streamId:i,reason:Ti(d)}),f.promise}},r)}destroy(){var e;(e=h(this,pm))==null||e.abort(),R(this,pm,null)}}pm=new WeakMap,js=new WeakSet,yj=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){P(this,js,vj).call(this,e);return}if(e.callback){const r=e.callbackId,a=this.callbackCapabilities[r];if(!a)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===lv.DATA)a.resolve(e.data);else if(e.callback===lv.ERROR)a.reject(Ti(e.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,a=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(s){i.postMessage({sourceName:r,targetName:a,callback:lv.DATA,callbackId:e.callbackId,data:s})},function(s){i.postMessage({sourceName:r,targetName:a,callback:lv.ERROR,callbackId:e.callbackId,reason:Ti(s)})});return}if(e.streamId){P(this,js,Ej).call(this,e);return}t(e.data)},Ej=function(e){const t=e.streamId,r=this.sourceName,a=e.sourceName,i=this.comObj,s=this,l=this.actionHandler[e.action],u={enqueue(d,f=1,m){if(this.isCancelled)return;const b=this.desiredSize;this.desiredSize-=f,b>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:r,targetName:a,stream:Nr.ENQUEUE,streamId:t,chunk:d},m)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:a,stream:Nr.CLOSE,streamId:t}),delete s.streamSinks[t])},error(d){rr(d instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:a,stream:Nr.ERROR,streamId:t,reason:Ti(d)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,Promise.try(l,e.data,u).then(function(){i.postMessage({sourceName:r,targetName:a,stream:Nr.START_COMPLETE,streamId:t,success:!0})},function(d){i.postMessage({sourceName:r,targetName:a,stream:Nr.START_COMPLETE,streamId:t,reason:Ti(d)})})},vj=function(e){const t=e.streamId,r=this.sourceName,a=e.sourceName,i=this.comObj,s=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case Nr.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(Ti(e.reason));break;case Nr.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(Ti(e.reason));break;case Nr.PULL:if(!l){i.postMessage({sourceName:r,targetName:a,stream:Nr.PULL_COMPLETE,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,Promise.try(l.onPull||T9).then(function(){i.postMessage({sourceName:r,targetName:a,stream:Nr.PULL_COMPLETE,streamId:t,success:!0})},function(d){i.postMessage({sourceName:r,targetName:a,stream:Nr.PULL_COMPLETE,streamId:t,reason:Ti(d)})});break;case Nr.ENQUEUE:if(rr(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Nr.CLOSE:if(rr(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),P(this,js,FT).call(this,s,t);break;case Nr.ERROR:rr(s,"error should have stream controller"),s.controller.error(Ti(e.reason)),P(this,js,FT).call(this,s,t);break;case Nr.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(Ti(e.reason)),P(this,js,FT).call(this,s,t);break;case Nr.CANCEL:if(!l)break;const u=Ti(e.reason);Promise.try(l.onCancel||T9,u).then(function(){i.postMessage({sourceName:r,targetName:a,stream:Nr.CANCEL_COMPLETE,streamId:t,success:!0})},function(d){i.postMessage({sourceName:r,targetName:a,stream:Nr.CANCEL_COMPLETE,streamId:t,reason:Ti(d)})}),l.sinkCapability.reject(u),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},FT=async function(e,t){var r,a,i;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(a=e.pullCall)==null?void 0:a.promise,(i=e.cancelCall)==null?void 0:i.promise]),delete this.streamControllers[t]};class S9{constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:r=null}){D(this,ew,Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"}));this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=r}async fetch({kind:e,filename:t}){switch(e){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:pn(`Not implemented: ${e}`)}const r=this[e];if(!r)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const a=`${r}${t}`;return this._fetch(a,e).catch(i=>{throw new Error(`Unable to load ${h(this,ew)[e]} data at: ${a}`)})}async _fetch(e,t){pn("Abstract method `_fetch` called.")}}ew=new WeakMap;class A9 extends S9{async _fetch(e,t){const r=t==="cMapUrl"&&!e.endsWith(".bcmap")?"text":"bytes",a=await hA(e,r);return a instanceof Uint8Array?a:tv(a)}}class x9{constructor({enableHWA:e=!1}){D(this,ey,!1);R(this,ey,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!h(this,ey)})}}reset({canvas:e},t,r){if(!e)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.width=t,e.height=r}destroy(e){const{canvas:t}=e;if(!t)throw new Error("Canvas is not specified");t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){pn("Abstract method `_createCanvas` called.")}}ey=new WeakMap;class qX extends x9{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const r=this._document.createElement("canvas");return r.width=e,r.height=t,r}}At(2489);class k9{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,r,a,i){return"none"}destroy(e=!1){}}class WX extends k9{constructor({docId:t,ownerDocument:r=globalThis.document}){super();D(this,at);D(this,v0);D(this,mm);D(this,bu);D(this,yu);D(this,Ka);D(this,w0);D(this,T0,0);R(this,yu,t),R(this,Ka,r)}addFilter(t){if(!t)return"none";let r=h(this,at,ti).get(t);if(r)return r;const[a,i,s]=P(this,at,PT).call(this,t),l=t.length===1?a:`${a}${i}${s}`;if(r=h(this,at,ti).get(l),r)return h(this,at,ti).set(t,r),r;const u=`g_${h(this,yu)}_transfer_map_${dr(this,T0)._++}`,d=P(this,at,Zg).call(this,u);h(this,at,ti).set(t,d),h(this,at,ti).set(l,d);const f=P(this,at,Qg).call(this,u);return P(this,at,g2).call(this,a,i,s,f),d}addHCMFilter(t,r){var E;const a=`${t}-${r}`,i="base";let s=h(this,at,p2).get(i);if((s==null?void 0:s.key)===a||(s?((E=s.filter)==null||E.remove(),s.key=a,s.url="none",s.filter=null):(s={key:a,url:"none",filter:null},h(this,at,p2).set(i,s)),!t||!r))return s.url;const l=P(this,at,b2).call(this,t);t=We.makeHexColor(...l);const u=P(this,at,b2).call(this,r);if(r=We.makeHexColor(...u),h(this,at,Kg).style.color="",t==="#000000"&&r==="#ffffff"||t===r)return s.url;const d=new Array(256);for(let T=0;T<=255;T++){const w=T/255;d[T]=w<=.03928?w/12.92:((w+.055)/1.055)**2.4}const f=d.join(","),m=`g_${h(this,yu)}_hcm_filter`,b=s.filter=P(this,at,Qg).call(this,m);P(this,at,g2).call(this,f,f,f,b),P(this,at,q_).call(this,b);const y=(T,w)=>{const S=l[T]/255,x=u[T]/255,C=new Array(w+1);for(let I=0;I<=w;I++)C[I]=S+I/w*(x-S);return C.join(",")};return P(this,at,g2).call(this,y(0,5),y(1,5),y(2,5),b),s.url=P(this,at,Zg).call(this,m),s.url}addAlphaFilter(t){let r=h(this,at,ti).get(t);if(r)return r;const[a]=P(this,at,PT).call(this,[t]),i=`alpha_${a}`;if(r=h(this,at,ti).get(i),r)return h(this,at,ti).set(t,r),r;const s=`g_${h(this,yu)}_alpha_map_${dr(this,T0)._++}`,l=P(this,at,Zg).call(this,s);h(this,at,ti).set(t,l),h(this,at,ti).set(i,l);const u=P(this,at,Qg).call(this,s);return P(this,at,W_).call(this,a,u),l}addLuminosityFilter(t){let r=h(this,at,ti).get(t||"luminosity");if(r)return r;let a,i;if(t?([a]=P(this,at,PT).call(this,[t]),i=`luminosity_${a}`):i="luminosity",r=h(this,at,ti).get(i),r)return h(this,at,ti).set(t,r),r;const s=`g_${h(this,yu)}_luminosity_map_${dr(this,T0)._++}`,l=P(this,at,Zg).call(this,s);h(this,at,ti).set(t,l),h(this,at,ti).set(i,l);const u=P(this,at,Qg).call(this,s);return P(this,at,wj).call(this,u),t&&P(this,at,W_).call(this,a,u),l}addHighlightHCMFilter(t,r,a,i,s){var x;const l=`${r}-${a}-${i}-${s}`;let u=h(this,at,p2).get(t);if((u==null?void 0:u.key)===l||(u?((x=u.filter)==null||x.remove(),u.key=l,u.url="none",u.filter=null):(u={key:l,url:"none",filter:null},h(this,at,p2).set(t,u)),!r||!a))return u.url;const[d,f]=[r,a].map(P(this,at,b2).bind(this));let m=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),b=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[y,E]=[i,s].map(P(this,at,b2).bind(this));b<m&&([m,b,y,E]=[b,m,E,y]),h(this,at,Kg).style.color="";const T=(C,I,N)=>{const O=new Array(256),z=(b-m)/N,G=C/255,$=(I-C)/(255*N);let H=0;for(let X=0;X<=N;X++){const te=Math.round(m+X*z),ie=G+X*$;for(let Q=H;Q<=te;Q++)O[Q]=ie;H=te+1}for(let X=H;X<256;X++)O[X]=O[H-1];return O.join(",")},w=`g_${h(this,yu)}_hcm_${t}_filter`,S=u.filter=P(this,at,Qg).call(this,w);return P(this,at,q_).call(this,S),P(this,at,g2).call(this,T(y[0],E[0],5),T(y[1],E[1],5),T(y[2],E[2],5),S),u.url=P(this,at,Zg).call(this,w),u.url}destroy(t=!1){var r,a,i,s;t&&((r=h(this,w0))!=null&&r.size)||((a=h(this,bu))==null||a.parentNode.parentNode.remove(),R(this,bu,null),(i=h(this,mm))==null||i.clear(),R(this,mm,null),(s=h(this,w0))==null||s.clear(),R(this,w0,null),R(this,T0,0))}}if(v0=new WeakMap,mm=new WeakMap,bu=new WeakMap,yu=new WeakMap,Ka=new WeakMap,w0=new WeakMap,T0=new WeakMap,at=new WeakSet,ti=function(){return h(this,mm)||R(this,mm,new Map)},p2=function(){return h(this,w0)||R(this,w0,new Map)},Kg=function(){if(!h(this,bu)){const t=h(this,Ka).createElement("div"),{style:r}=t;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const a=h(this,Ka).createElementNS(Hl,"svg");a.setAttribute("width",0),a.setAttribute("height",0),R(this,bu,h(this,Ka).createElementNS(Hl,"defs")),t.append(a),a.append(h(this,bu)),h(this,Ka).body.append(t)}return h(this,bu)},PT=function(t){if(t.length===1){const d=t[0],f=new Array(256);for(let b=0;b<256;b++)f[b]=d[b]/255;const m=f.join(",");return[m,m,m]}const[r,a,i]=t,s=new Array(256),l=new Array(256),u=new Array(256);for(let d=0;d<256;d++)s[d]=r[d]/255,l[d]=a[d]/255,u[d]=i[d]/255;return[s.join(","),l.join(","),u.join(",")]},Zg=function(t){if(h(this,v0)===void 0){R(this,v0,"");const r=h(this,Ka).URL;r!==h(this,Ka).baseURI&&(nv(r)?xt('#createUrl: ignore "data:"-URL for performance reasons.'):R(this,v0,t9(r,"")))}return`url(${h(this,v0)}#${t})`},wj=function(t){const r=h(this,Ka).createElementNS(Hl,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(r)},q_=function(t){const r=h(this,Ka).createElementNS(Hl,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(r)},Qg=function(t){const r=h(this,Ka).createElementNS(Hl,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),h(this,at,Kg).append(r),r},m2=function(t,r,a){const i=h(this,Ka).createElementNS(Hl,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",a),t.append(i)},g2=function(t,r,a,i){const s=h(this,Ka).createElementNS(Hl,"feComponentTransfer");i.append(s),P(this,at,m2).call(this,s,"feFuncR",t),P(this,at,m2).call(this,s,"feFuncG",r),P(this,at,m2).call(this,s,"feFuncB",a)},W_=function(t,r){const a=h(this,Ka).createElementNS(Hl,"feComponentTransfer");r.append(a),P(this,at,m2).call(this,a,"feFuncA",t)},b2=function(t){return h(this,at,Kg).style.color=t,b1(getComputedStyle(h(this,at,Kg)).getPropertyValue("color"))},Gi){let n;try{const e=process.getBuiltinModule("module").createRequire(tn&&tn.tagName.toUpperCase()==="SCRIPT"&&tn.src||new URL("widget.js",document.baseURI).href);try{n=e("@napi-rs/canvas")}catch(t){xt(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(e){xt(`Cannot access the \`require\` function: "${e}".`)}globalThis.DOMMatrix||(n!=null&&n.DOMMatrix?globalThis.DOMMatrix=n.DOMMatrix:xt("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(n!=null&&n.ImageData?globalThis.ImageData=n.ImageData:xt("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(n!=null&&n.Path2D?globalThis.Path2D=n.Path2D:xt("Cannot polyfill `Path2D`, rendering may be broken.")),(nz=globalThis.navigator)!=null&&nz.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function XX(n){const t=await process.getBuiltinModule("fs/promises").readFile(n);return new Uint8Array(t)}class KX extends k9{}class ZX extends x9{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(tn&&tn.tagName.toUpperCase()==="SCRIPT"&&tn.src||new URL("widget.js",document.baseURI).href)("@napi-rs/canvas").createCanvas(e,t)}}class QX extends S9{async _fetch(e,t){return XX(e)}}const JX=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "altio-chat",
3
- "version": "1.0.84",
3
+ "version": "1.0.85",
4
4
  "description": "Altio embeddable chat widget — single-file, Shadow-DOM isolated, loaded via <script> from a CDN.",
5
5
  "type": "module",
6
6
  "files": [