"use strict";var t,e,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={};function i(){if(e)return t;e=1;var r=function(t){return t&&t.Math===Math&&t};return t=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")()}var o,a,s,u,c,l,d,f,h={};function p(){return a?o:(a=1,o=function(t){try{return!!t()}catch(t){return!0}})}function v(){if(u)return s;u=1;var t=p();return s=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function y(){if(l)return c;l=1;var t=p();return c=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function m(){if(f)return d;f=1;var t=y(),e=Function.prototype.call;return d=t?e.bind(e):function(){return e.apply(e,arguments)},d}var g,w,b,x,S,O,P,E,T,k,C,A,j,_,R,L,D,I,B,H,N,U,M,F,W,z,G,q,V,X,Y,$,K,J,Z,Q,tt,et,nt,rt,it,ot={};function at(){return b?w:(b=1,w=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function st(){if(S)return x;S=1;var t=y(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return x=t?r:function(t){return function(){return n.apply(t,arguments)}},x}function ut(){if(P)return O;P=1;var t=st(),e=t({}.toString),n=t("".slice);return O=function(t){return n(e(t),8,-1)}}function ct(){return C?k:(C=1,k=function(t){return null==t})}function lt(){if(j)return A;j=1;var t=ct(),e=TypeError;return A=function(n){if(t(n))throw new e("Can't call method on "+n);return n}}function dt(){if(R)return _;R=1;var t=function(){if(T)return E;T=1;var t=st(),e=p(),n=ut(),r=Object,i=t("".split);return E=e(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?i(t,""):r(t)}:r}(),e=lt();return _=function(n){return t(e(n))}}function ft(){if(D)return L;D=1;var t="object"==typeof document&&document.all;return L=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}function ht(){if(B)return I;B=1;var t=ft();return I=function(e){return"object"==typeof e?null!==e:t(e)}}function pt(){if(N)return H;N=1;var t=i(),e=ft();return H=function(n,r){return arguments.length<2?(i=t[n],e(i)?i:void 0):t[n]&&t[n][r];var i},H}function vt(){if(M)return U;M=1;var t=st();return U=t({}.isPrototypeOf)}function yt(){if(W)return F;W=1;var t=i().navigator,e=t&&t.userAgent;return F=e?String(e):""}function mt(){if(G)return z;G=1;var t,e,n=i(),r=yt(),o=n.process,a=n.Deno,s=o&&o.versions||a&&a.version,u=s&&s.v8;return u&&(e=(t=u.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(e=+t[1]),z=e}function gt(){if(V)return q;V=1;var t=mt(),e=p(),n=i().String;return q=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function wt(){if(Y)return X;Y=1;var t=gt();return X=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function bt(){if(K)return $;K=1;var t=pt(),e=ft(),n=vt(),r=wt(),i=Object;return $=r?function(t){return"symbol"==typeof t}:function(r){var o=t("Symbol");return e(o)&&n(o.prototype,i(r))}}function xt(){if(Z)return J;Z=1;var t=String;return J=function(e){try{return t(e)}catch(t){return"Object"}}}function St(){if(tt)return Q;tt=1;var t=ft(),e=xt(),n=TypeError;return Q=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")}}function Ot(){if(nt)return et;nt=1;var t=St(),e=ct();return et=function(n,r){var i=n[r];return e(i)?void 0:t(i)}}function Pt(){if(it)return rt;it=1;var t=m(),e=ft(),n=ht(),r=TypeError;return rt=function(i,o){var a,s;if("string"===o&&e(a=i.toString)&&!n(s=t(a,i)))return s;if(e(a=i.valueOf)&&!n(s=t(a,i)))return s;if("string"!==o&&e(a=i.toString)&&!n(s=t(a,i)))return s;throw new r("Can't convert object to primitive value")}}var Et,Tt,kt,Ct,At,jt,_t,Rt,Lt,Dt,It,Bt,Ht,Nt,Ut,Mt,Ft,Wt,zt,Gt,qt,Vt,Xt,Yt,$t={exports:{}};function Kt(){return Tt?Et:(Tt=1,Et=!1)}function Jt(){if(Ct)return kt;Ct=1;var t=i(),e=Object.defineProperty;return kt=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch(e){t[n]=r}return r}}function Zt(){if(At)return $t.exports;At=1;var t=Kt(),e=i(),n=Jt(),r="__core-js_shared__",o=$t.exports=e[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.44.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$t.exports}function Qt(){if(_t)return jt;_t=1;var t=Zt();return jt=function(e,n){return t[e]||(t[e]=n||{})}}function te(){if(Lt)return Rt;Lt=1;var t=lt(),e=Object;return Rt=function(n){return e(t(n))}}function ee(){if(It)return Dt;It=1;var t=st(),e=te(),n=t({}.hasOwnProperty);return Dt=Object.hasOwn||function(t,r){return n(e(t),r)}}function ne(){if(Ht)return Bt;Ht=1;var t=st(),e=0,n=Math.random(),r=t(1.1.toString);return Bt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function re(){if(Ut)return Nt;Ut=1;var t=i(),e=Qt(),n=ee(),r=ne(),o=gt(),a=wt(),s=t.Symbol,u=e("wks"),c=a?s.for||s:s&&s.withoutSetter||r;return Nt=function(t){return n(u,t)||(u[t]=o&&n(s,t)?s[t]:c("Symbol."+t)),u[t]}}function ie(){if(Ft)return Mt;Ft=1;var t=m(),e=ht(),n=bt(),r=Ot(),i=Pt(),o=re(),a=TypeError,s=o("toPrimitive");return Mt=function(o,u){if(!e(o)||n(o))return o;var c,l=r(o,s);if(l){if(void 0===u&&(u="default"),c=t(l,o,u),!e(c)||n(c))return c;throw new a("Can't convert object to primitive value")}return void 0===u&&(u="number"),i(o,u)}}function oe(){if(zt)return Wt;zt=1;var t=ie(),e=bt();return Wt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function ae(){if(qt)return Gt;qt=1;var t=i(),e=ht(),n=t.document,r=e(n)&&e(n.createElement);return Gt=function(t){return r?n.createElement(t):{}}}function se(){if(Xt)return Vt;Xt=1;var t=v(),e=p(),n=ae();return Vt=!t&&!e(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function ue(){if(Yt)return h;Yt=1;var t=v(),e=m(),n=function(){if(g)return ot;g=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return ot.f=n?function(t){var n=e(this,t);return!!n&&n.enumerable}:t,ot}(),r=at(),i=dt(),o=oe(),a=ee(),s=se(),u=Object.getOwnPropertyDescriptor;return h.f=t?u:function(t,c){if(t=i(t),c=o(c),s)try{return u(t,c)}catch(t){}if(a(t,c))return r(!e(n.f,t,c),t[c])},h}var ce,le,de,fe,he,pe,ve,ye={};function me(){if(le)return ce;le=1;var t=v(),e=p();return ce=t&&e(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function ge(){if(fe)return de;fe=1;var t=ht(),e=String,n=TypeError;return de=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")}}function we(){if(he)return ye;he=1;var t=v(),e=se(),n=me(),r=ge(),i=oe(),o=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return ye.f=t?n?function(t,e,n){if(r(t),e=i(e),r(n),"function"==typeof t&&"prototype"===e&&"value"in n&&l in n&&!n[l]){var o=s(t,e);o&&o[l]&&(t[e]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:u in n?n[u]:o[u],writable:!1})}return a(t,e,n)}:a:function(t,n,s){if(r(t),n=i(n),r(s),e)try{return a(t,n,s)}catch(t){}if("get"in s||"set"in s)throw new o("Accessors not supported");return"value"in s&&(t[n]=s.value),t},ye}function be(){if(ve)return pe;ve=1;var t=v(),e=we(),n=at();return pe=t?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,e,n){return t[e]=n,t}}var xe,Se,Oe,Pe,Ee,Te,ke,Ce,Ae,je,_e,Re,Le,De,Ie,Be={exports:{}};function He(){if(Pe)return Oe;Pe=1;var t=st(),e=ft(),n=Zt(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(t){return r(t)}),Oe=n.inspectSource}function Ne(){if(Ce)return ke;Ce=1;var t=Qt(),e=ne(),n=t("keys");return ke=function(t){return n[t]||(n[t]=e(t))}}function Ue(){return je?Ae:(je=1,Ae={})}function Me(){if(Re)return _e;Re=1;var t,e,n,r=function(){if(Te)return Ee;Te=1;var t=i(),e=ft(),n=t.WeakMap;return Ee=e(n)&&/native code/.test(String(n))}(),o=i(),a=ht(),s=be(),u=ee(),c=Zt(),l=Ne(),d=Ue(),f="Object already initialized",h=o.TypeError,p=o.WeakMap;if(r||c.state){var v=c.state||(c.state=new p);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,e){if(v.has(t))throw new h(f);return e.facade=t,v.set(t,e),e},e=function(t){return v.get(t)||{}},n=function(t){return v.has(t)}}else{var y=l("state");d[y]=!0,t=function(t,e){if(u(t,y))throw new h(f);return e.facade=t,s(t,y,e),e},e=function(t){return u(t,y)?t[y]:{}},n=function(t){return u(t,y)}}return _e={set:t,get:e,has:n,enforce:function(r){return n(r)?e(r):t(r,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=e(n)).type!==t)throw new h("Incompatible receiver, "+t+" required");return r}}}}function Fe(){if(Le)return Be.exports;Le=1;var t=st(),e=p(),n=ft(),r=ee(),i=v(),o=function(){if(Se)return xe;Se=1;var t=v(),e=ee(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&"something"===function(){}.name,a=i&&(!t||t&&r(n,"name").configurable);return xe={EXISTS:i,PROPER:o,CONFIGURABLE:a}}().CONFIGURABLE,a=He(),s=Me(),u=s.enforce,c=s.get,l=String,d=Object.defineProperty,f=t("".slice),h=t("".replace),y=t([].join),m=i&&!e(function(){return 8!==d(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=Be.exports=function(t,e,n){"Symbol("===f(l(e),0,7)&&(e="["+h(l(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||o&&t.name!==e)&&(i?d(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&r(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var a=u(t);return r(a,"source")||(a.source=y(g,"string"==typeof e?e:"")),t};return Function.prototype.toString=w(function(){return n(this)&&c(this).source||a(this)},"toString"),Be.exports}function We(){if(Ie)return De;Ie=1;var t=ft(),e=we(),n=Fe(),r=Jt();return De=function(i,o,a,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:o;if(t(a)&&n(a,c,s),s.global)u?i[o]=a:r(o,a);else{try{s.unsafe?i[o]&&(u=!0):delete i[o]}catch(t){}u?i[o]=a:e.f(i,o,{value:a,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}var ze,Ge,qe,Ve,Xe,Ye,$e,Ke,Je,Ze,Qe,tn,en,nn,rn,on,an,sn={};function un(){if(Ve)return qe;Ve=1;var t=function(){if(Ge)return ze;Ge=1;var t=Math.ceil,e=Math.floor;return ze=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return qe=function(e){var n=+e;return n!=n||0===n?0:t(n)}}function cn(){if(Ye)return Xe;Ye=1;var t=un(),e=Math.max,n=Math.min;return Xe=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)}}function ln(){if(Ke)return $e;Ke=1;var t=un(),e=Math.min;return $e=function(n){var r=t(n);return r>0?e(r,9007199254740991):0}}function dn(){if(Ze)return Je;Ze=1;var t=ln();return Je=function(e){return t(e.length)}}function fn(){if(tn)return Qe;tn=1;var t=dt(),e=cn(),n=dn(),r=function(r){return function(i,o,a){var s=t(i),u=n(s);if(0===u)return!r&&-1;var c,l=e(a,u);if(r&&o!=o){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((r||l in s)&&s[l]===o)return r||l||0;return!r&&-1}};return Qe={includes:r(!0),indexOf:r(!1)}}function hn(){if(nn)return en;nn=1;var t=st(),e=ee(),n=dt(),r=fn().indexOf,i=Ue(),o=t([].push);return en=function(t,a){var s,u=n(t),c=0,l=[];for(s in u)!e(i,s)&&e(u,s)&&o(l,s);for(;a.length>c;)e(u,s=a[c++])&&(~r(l,s)||o(l,s));return l}}function pn(){return on?rn:(on=1,rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var vn,yn,mn,gn,wn,bn,xn,Sn,On,Pn,En,Tn,kn,Cn,An,jn,_n,Rn,Ln,Dn,In,Bn,Hn,Nn,Un,Mn,Fn,Wn,zn,Gn,qn,Vn,Xn,Yn,$n,Kn,Jn,Zn,Qn={};function tr(){if(mn)return yn;mn=1;var t=pt(),e=st(),n=function(){if(an)return sn;an=1;var t=hn(),e=pn().concat("length","prototype");return sn.f=Object.getOwnPropertyNames||function(n){return t(n,e)},sn}(),r=(vn||(vn=1,Qn.f=Object.getOwnPropertySymbols),Qn),i=ge(),o=e([].concat);return yn=t("Reflect","ownKeys")||function(t){var e=n.f(i(t)),a=r.f;return a?o(e,a(t)):e}}function er(){if(wn)return gn;wn=1;var t=ee(),e=tr(),n=ue(),r=we();return gn=function(i,o,a){for(var s=e(o),u=r.f,c=n.f,l=0;l1?arguments[1]:void 0,y=void 0!==v;y&&(v=t(v,p>2?arguments[2]:void 0));var m,g,w,b,x,S,O=c(f),P=0;if(!O||this===l&&i(O))for(m=a(f),g=h?new this(m):l(m);m>P;P++)S=y?v(f[P],P):f[P],s(g,P,S);else for(g=h?new this:[],x=(b=u(f,O)).next;!(w=e(x,b)).done;P++)S=y?r(b,v,[w.value,P],!0):w.value,s(g,P,S);return g.length=P,g},Yn}();t({target:"Array",stat:!0,forced:!pr()(function(t){Array.from(t)})},{from:e})}();var vr,yr,mr,gr,wr,br,xr,Sr,Or,Pr,Er,Tr,kr,Cr,Ar,jr,_r,Rr,Lr,Dr,Ir,Br,Hr,Nr,Ur,Mr,Fr,Wr,zr,Gr,qr,Vr,Xr,Yr,$r,Kr,Jr,Zr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,di,fi,hi,pi,vi,yi,mi={};function gi(){if(yr)return vr;yr=1;var t=i(),e=yt(),n=ut(),r=function(t){return e.slice(0,t.length)===t};return vr=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function wi(){if(gr)return mr;gr=1;var t=gi();return mr="NODE"===t}function bi(){if(br)return wr;br=1;var t=i();return wr=t}function xi(){if(Pr)return Or;Pr=1;var t=ht();return Or=function(e){return t(e)||null===e}}function Si(){if(Tr)return Er;Tr=1;var t=xi(),e=String,n=TypeError;return Er=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function Oi(){if(Cr)return kr;Cr=1;var t=function(){if(Sr)return xr;Sr=1;var t=st(),e=St();return xr=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(t){}}}(),e=ht(),n=lt(),r=Si();return kr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,a={};try{(i=t(Object.prototype,"__proto__","set"))(a,[]),o=a instanceof Array}catch(t){}return function(t,a){return n(t),r(a),e(t)?(o?i(t,a):t.__proto__=a,t):t}}():void 0)}function Pi(){if(jr)return Ar;jr=1;var t=we().f,e=ee(),n=re()("toStringTag");return Ar=function(r,i,o){r&&!o&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:i})}}function Ei(){if(Rr)return _r;Rr=1;var t=Fe(),e=we();return _r=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)}}function Ti(){if(Dr)return Lr;Dr=1;var t=pt(),e=Ei(),n=re(),r=v(),i=n("species");return Lr=function(n){var o=t(n);r&&o&&!o[i]&&e(o,i,{configurable:!0,get:function(){return this}})}}function ki(){if(Br)return Ir;Br=1;var t=vt(),e=TypeError;return Ir=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function Ci(){if(Nr)return Hr;Nr=1;var t=lr(),e=xt(),n=TypeError;return Hr=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Ai(){if(Mr)return Ur;Mr=1;var t=ge(),e=Ci(),n=ct(),r=re()("species");return Ur=function(i,o){var a,s=t(i).constructor;return void 0===s||n(a=t(s)[r])?o:e(a)}}function ji(){if(Wr)return Fr;Wr=1;var t=y(),e=Function.prototype,n=e.apply,r=e.call;return Fr="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Fr}function _i(){if(Gr)return zr;Gr=1;var t=pt();return zr=t("document","documentElement")}function Ri(){if(Vr)return qr;Vr=1;var t=st();return qr=t([].slice)}function Li(){if(Yr)return Xr;Yr=1;var t=TypeError;return Xr=function(e,n){if(eg;g++)if((b=j(h[g]))&&a(f,b))return b;return new d(!1)}y=s(h,m)}for(x=E?h.next:y.next;!(S=e(x,y)).done;){try{b=j(S.value)}catch(t){c(y,"throw",t)}if("object"==typeof b&&b&&a(f,b))return b}return new d(!1)}}function to(){if(Ki)return $i;Ki=1;var t=Fi(),e=pr(),n=Wi().CONSTRUCTOR;return $i=n||!e(function(e){t.all(e).then(void 0,function(){})})}var eo,no={};var ro,io={};var oo,ao={};var so,uo,co,lo,fo={};function ho(){if(uo)return so;uo=1;var t=ge(),e=ht(),n=Vi();return so=function(r,i){if(t(r),e(i)&&i.constructor===r)return i;var o=n.f(r);return(0,o.resolve)(i),o.promise}}lo||(lo=1,function(){if(Gi)return mi;Gi=1;var t,e,n,r,o=rr(),a=Kt(),s=wi(),u=i(),c=bi(),l=m(),d=We(),f=Oi(),h=Pi(),p=Ti(),v=St(),y=ft(),g=ht(),w=ki(),b=Ai(),x=Ii().set,S=Ni(),O=Ui(),P=Mi(),E=Hi(),T=Me(),k=Fi(),C=Wi(),A=Vi(),j="Promise",_=C.CONSTRUCTOR,R=C.REJECTION_EVENT,L=C.SUBCLASSING,D=T.getterFor(j),I=T.set,B=k&&k.prototype,H=k,N=B,U=u.TypeError,M=u.document,F=u.process,W=A.f,z=W,G=!!(M&&M.createEvent&&u.dispatchEvent),q="unhandledrejection",V=function(t){var e;return!(!g(t)||!y(e=t.then))&&e},X=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,d=t.domain;try{s?(a||(2===e.rejection&&Z(e),e.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===t.promise?c(new U("Promise-chain cycle")):(r=V(n))?l(r,n,u,c):u(n)):c(o)}catch(t){d&&!i&&d.exit(),c(t)}},Y=function(t,e){t.notified||(t.notified=!0,S(function(){for(var n,r=t.reactions;n=r.get();)X(n,t);t.notified=!1,e&&!t.rejection&&K(t)}))},$=function(t,e,n){var r,i;G?((r=M.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},!R&&(i=u["on"+t])?i(r):t===q&&O("Unhandled promise rejection",n)},K=function(t){l(x,u,function(){var e,n=t.facade,r=t.value;if(J(t)&&(e=P(function(){s?F.emit("unhandledRejection",r,n):$(q,n,r)}),t.rejection=s||J(t)?2:1,e.error))throw e.value})},J=function(t){return 1!==t.rejection&&!t.parent},Z=function(t){l(x,u,function(){var e=t.facade;s?F.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},Q=function(t,e,n){return function(r){t(e,r,n)}},tt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Y(t,!0))},et=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new U("Promise can't be resolved itself");var r=V(e);r?S(function(){var n={done:!1};try{l(r,e,Q(et,n,t),Q(tt,n,t))}catch(e){tt(n,e,t)}}):(t.value=e,t.state=1,Y(t,!1))}catch(e){tt({done:!1},e,t)}}};if(_&&(N=(H=function(e){w(this,N),v(e),l(t,this);var n=D(this);try{e(Q(et,n),Q(tt,n))}catch(t){tt(n,t)}}).prototype,(t=function(t){I(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=d(N,"then",function(t,e){var n=D(this),r=W(b(this,H));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=s?F.domain:void 0,0===n.state?n.reactions.add(r):S(function(){X(r,n)}),r.promise}),e=function(){var e=new t,n=D(e);this.promise=e,this.resolve=Q(et,n),this.reject=Q(tt,n)},A.f=W=function(t){return t===H||t===n?new e(t):z(t)},!a&&y(k)&&B!==Object.prototype)){r=B.then,L||d(B,"then",function(t,e){var n=this;return new H(function(t,e){l(r,n,t,e)}).then(t,e)},{unsafe:!0});try{delete B.constructor}catch(t){}f&&f(B,N)}o({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:H}),n=c.Promise,h(H,j,!1,!0),p(j)}(),function(){if(Ji)return Zi;Ji=1;var t=rr(),e=m(),n=St(),r=Vi(),i=Mi(),o=Qi();t({target:"Promise",stat:!0,forced:to()},{all:function(t){var a=this,s=r.f(a),u=s.resolve,c=s.reject,l=i(function(){var r=n(a.resolve),i=[],s=0,l=1;o(t,function(t){var n=s++,o=!1;l++,e(r,a,t).then(function(t){o||(o=!0,i[n]=t,--l||u(i))},c)}),--l||u(i)});return l.error&&c(l.value),s.promise}})}(),function(){if(eo)return no;eo=1;var t=rr(),e=Kt(),n=Wi().CONSTRUCTOR,r=Fi(),i=pt(),o=ft(),a=We(),s=r&&r.prototype;if(t({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(t){return this.then(void 0,t)}}),!e&&o(r)){var u=i("Promise").prototype.catch;s.catch!==u&&a(s,"catch",u,{unsafe:!0})}}(),function(){if(ro)return io;ro=1;var t=rr(),e=m(),n=St(),r=Vi(),i=Mi(),o=Qi();t({target:"Promise",stat:!0,forced:to()},{race:function(t){var a=this,s=r.f(a),u=s.reject,c=i(function(){var r=n(a.resolve);o(t,function(t){e(r,a,t).then(s.resolve,u)})});return c.error&&u(c.value),s.promise}})}(),function(){if(oo)return ao;oo=1;var t=rr(),e=Vi();t({target:"Promise",stat:!0,forced:Wi().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(co)return fo;co=1;var t=rr(),e=pt(),n=Kt(),r=Fi(),i=Wi().CONSTRUCTOR,o=ho(),a=e("Promise"),s=n&&!i;t({target:"Promise",stat:!0,forced:n||i},{resolve:function(t){return o(s&&this===a?r:this,t)}})}());var po,vo,yo,mo,go,wo,bo,xo,So={},Oo={};function Po(){if(vo)return po;vo=1;var t=hn(),e=pn();return po=Object.keys||function(n){return t(n,e)}}function Eo(){if(go)return mo;go=1;var t,e=ge(),n=function(){if(yo)return Oo;yo=1;var t=v(),e=me(),n=we(),r=ge(),i=dt(),o=Po();return Oo.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var a,s=i(e),u=o(e),c=u.length,l=0;c>l;)n.f(t,a=u[l++],s[a]);return t},Oo}(),r=pn(),i=Ue(),o=_i(),a=ae(),s=Ne(),u="prototype",c="script",l=s("IE_PROTO"),d=function(){},f=function(t){return"<"+c+">"+t+""},h=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;p="undefined"!=typeof document?document.domain&&t?h(t):(n=a("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(e=n.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):h(t);for(var s=r.length;s--;)delete p[u][r[s]];return p()};return i[l]=!0,mo=Object.create||function(t,r){var i;return null!==t?(d[u]=e(t),i=new d,d[u]=null,i[l]=t):i=p(),void 0===r?i:n.f(i,r)}}function To(){if(bo)return wo;bo=1;var t=re(),e=Eo(),n=we().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),wo=function(t){i[r][t]=!0}}!function(){if(xo)return So;xo=1;var t=rr(),e=fn().includes,n=p(),r=To();t({target:"Array",proto:!0,forced:n(function(){return!Array(1).includes()})},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")}();var ko,Co,Ao,jo={};!function(){if(Ao)return jo;Ao=1;var t=rr(),e=function(){if(Co)return ko;Co=1;var t=te(),e=cn(),n=dn();return ko=function(r){for(var i=t(this),o=n(i),a=arguments.length,s=e(a>1?arguments[1]:void 0,o),u=a>2?arguments[2]:void 0,c=void 0===u?o:e(u,o);c>s;)i[s++]=r;return i},ko}(),n=To();t({target:"Array",proto:!0},{fill:e}),n("fill")}();var _o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Ro="URLSearchParams"in _o,Lo="Symbol"in _o&&"iterator"in Symbol,Do="FileReader"in _o&&"Blob"in _o&&function(){try{return new Blob,!0}catch(t){return!1}}(),Io="FormData"in _o,Bo="ArrayBuffer"in _o;if(Bo)var Ho=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],No=ArrayBuffer.isView||function(t){return t&&Ho.indexOf(Object.prototype.toString.call(t))>-1};function Uo(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Mo(t){return"string"!=typeof t&&(t=String(t)),t}function Fo(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return Lo&&(e[Symbol.iterator]=function(){return e}),e}function Wo(t){this.map={},t instanceof Wo?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function zo(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function Go(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function qo(t){var e=new FileReader,n=Go(e);return e.readAsArrayBuffer(t),n}function Vo(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Xo(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Do&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Io&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Ro&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Bo&&Do&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Vo(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Bo&&(ArrayBuffer.prototype.isPrototypeOf(t)||No(t))?this._bodyArrayBuffer=Vo(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ro&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Do&&(this.blob=function(){var t=zo(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=zo(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Do)return this.blob().then(qo);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,o=zo(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=Go(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in _o)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Ko(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function Jo(t,e){if(!(this instanceof Jo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Wo(e.headers),this.url=e.url||"",this._initBody(t)}$o.prototype.clone=function(){return new $o(this,{body:this._bodyInit})},Xo.call($o.prototype),Xo.call(Jo.prototype),Jo.prototype.clone=function(){return new Jo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Wo(this.headers),url:this.url})},Jo.error=function(){var t=new Jo(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var Zo=[301,302,303,307,308];Jo.redirect=function(t,e){if(-1===Zo.indexOf(e))throw new RangeError("Invalid status code");return new Jo(null,{status:e,headers:{location:t}})};var Qo=_o.DOMException;try{new Qo}catch(t){(Qo=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),Qo.prototype.constructor=Qo}function ta(t,e){return new Promise(function(n,r){var i=new $o(t,e);if(i.signal&&i.signal.aborted)return r(new Qo("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var t,e,r={statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new Wo,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){}}}),e)};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout(function(){n(new Jo(a,r))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new Qo("Aborted","AbortError"))},0)},o.open(i.method,function(t){try{return""===t&&_o.location.href?_o.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Do?o.responseType="blob":Bo&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Wo||_o.Headers&&e.headers instanceof _o.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach(function(t){s.push(Uo(t)),o.setRequestHeader(t,Mo(e.headers[t]))}),i.headers.forEach(function(t,e){-1===s.indexOf(e)&&o.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){o.setRequestHeader(e,t)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})}ta.polyfill=!0,_o.fetch||(_o.fetch=ta,_o.Headers=Wo,_o.Request=$o,_o.Response=Jo),"undefined"==typeof CanvasRenderingContext2D||CanvasRenderingContext2D.prototype.resetTransform||(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)});!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("@keyframes watermark{0%{background-position:0 0}25%{background-position:100% 100%}50%{background-position:100% 0}75%{background-position:0 100%}to{background-position:0 0}}@keyframes watermark-horizontal{0%{background-position-x:0}to{background-position-x:100%}}@keyframes watermark-vertical{0%{background-position-y:0}to{background-position-y:100%}}");var ea=function(t,e){return ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ea(t,e)};var na=function(){return na=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]"),document.body.appendChild(r),[4,la(r)];case 1:return d.sent(),i=null===(l=r.querySelector(".rich-text-content"))||void 0===l?void 0:l.getBoundingClientRect(),o=null==i?void 0:i.width,a=null==i?void 0:i.height,document.body.removeChild(r),s=e.richTextWidth||o||e.width,u=e.richTextHeight||a||e.height,n.setAttribute("width",s.toString()),n.setAttribute("height",u.toString()),(c=ua("foreignObject",{width:s.toString(),height:u.toString()})).appendChild(r),n.appendChild(c),[2,{element:n,width:s,height:u}]}})})};function la(t){return ra(this,void 0,void 0,function(){var e,n,r,i,o;return ia(this,function(a){switch(a.label){case 0:e=t.querySelectorAll("img"),n=function(t){var e,n,r,i;return ia(this,function(o){switch(o.label){case 0:if(!(e=t.getAttribute("src")))return[3,6];o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(e)];case 2:return[4,o.sent().blob()];case 3:return n=o.sent(),[4,new Promise(function(t,e){var r=new FileReader;r.onloadend=function(){return t(r.result)},r.onerror=e,r.readAsDataURL(n)})];case 4:return r=o.sent(),"string"==typeof r&&t.setAttribute("src",r),[3,6];case 5:return i=o.sent(),console.error("Error converting ".concat(e," to base64:"),i),[3,6];case 6:return[2]}})},r=0,i=Array.from(e),a.label=1;case 1:return rn&&(r.push(i.substring(0,i.length-1)),i="",a--)):(r.push(i),i="");return r.push(i),r}(r,e.content,e.textRowMaxWidth)}var o=e.width/2,a=e.height/2,s="middle",u="center";switch(sa(null==n?void 0:n.translateX)||sa(null==n?void 0:n.translateY)?(i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.r0=0,i.advancedStyleParams.radial.r1=e.width/2):(o=null==n?void 0:n.translateX,a=null==n?void 0:n.translateY,s="top",u="left"),n.translatePlacement){case"top":o=e.width/2,a=0,s="top",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-start":o=0,a=0,s="top",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-end":o=e.width,a=0,s="top",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"bottom":o=e.width/2,a=e.height,s="bottom",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=0,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-start":o=0,a=e.height,s="bottom",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-end":o=e.width,a=e.height,s="bottom",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"left":o=0,a=e.height/2,u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=0;break;case"right":o=e.width,a=e.height/2,u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=0}if(e.translateX=o,e.translateY=a,sa(null==n?void 0:n.textBaseline)&&(e.textBaseline=s),sa(null==n?void 0:n.textAlign)&&(e.textAlign=u),["text","multi-line-text"].includes(e.contentType))switch(e.textBaseline){case"middle":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight/2;break;case"bottom":case"alphabetic":case"ideographic":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight+(e.lineHeight-parseInt(e.fontSize))/2;break;case"top":case"hanging":i.textLine.yOffsetValue=-e.lineHeight/2+parseInt(e.fontSize)/2}return i}(this.canvas,this.options,this.props)}return t.createCanvas=function(t,e){var n,r=window.devicePixelRatio||1,i=document.createElement("canvas");return i.width=t*r,i.height=e*r,i.style.width="".concat(t,"px"),i.style.height="".concat(e,"px"),null===(n=i.getContext("2d"))||void 0===n||n.setTransform(r,0,0,r,0,0),i},t.clearCanvas=function(t){var e=t.getContext("2d");if(null===e)throw new Error("get context error");e.restore(),e.resetTransform(),e.clearRect(0,0,t.width,t.height);var n=window.devicePixelRatio||1;e.setTransform(n,0,0,n,0,0)},t.prototype.getCanvas=function(){return this.canvas},t.prototype.clear=function(){t.clearCanvas(this.canvas)},t.prototype.draw=function(){var t=this,e=this.canvas.getContext("2d");if(null===e)throw new Error("get context error");return this.options.auxiliaryLine&&(e.beginPath(),e.rect(0,0,this.options.width,this.options.height),e.lineWidth=1,e.strokeStyle="#000",e.stroke(),e.closePath(),e.beginPath(),e.rect(this.options.translateX,this.options.translateY,1,1),e.lineWidth=1,e.strokeStyle="#f00",e.stroke(),e.closePath()),this.setStyle(e),e.save(),e.translate(this.options.translateX,this.options.translateY),e.rotate(this.options.rotate),new Promise(function(n){switch(t.options.contentType){case"text":t.drawText(e,n);break;case"image":t.drawImage(e,n);break;case"multi-line-text":t.drawMultiLineText(e,n);break;case"rich-text":t.drawRichText(e,n)}})},t.prototype.setStyle=function(t){var e,n="fillStyle";"stroke"===this.options.textType&&(n="strokeStyle");var r=this.options.fontColor;if(null===(e=this.options)||void 0===e?void 0:e.advancedStyle)switch(this.options.advancedStyle.type){case"linear":r=this.createLinearGradient(t);break;case"radial":r=this.createRadialGradient(t);break;case"conic":r=this.createConicGradient(t);break;case"pattern":r=this.createPattern(t)}t[n]&&r&&(t[n]=r),this.options.textAlign&&(t.textAlign=this.options.textAlign),this.options.textBaseline&&(t.textBaseline=this.options.textBaseline),t.globalAlpha=this.options.globalAlpha,this.options.shadowStyle&&(t.shadowBlur=da(this.options.shadowStyle.shadowBlur,0),t.shadowColor=da(this.options.shadowStyle.shadowColor,"#00000000"),t.shadowOffsetX=da(this.options.shadowStyle.shadowOffsetX,0),t.shadowOffsetY=da(this.options.shadowStyle.shadowOffsetY,0)),aa(this.options.extraDrawFunc)&&this.options.extraDrawFunc(t)},t.prototype.createLinearGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createLinearGradient(da(null===(r=null===(n=null===(e=this.options.advancedStyle)||void 0===e?void 0:e.params)||void 0===n?void 0:n.linear)||void 0===r?void 0:r.x0,this.recommendOptions.advancedStyleParams.linear.x0),da(null===(a=null===(o=null===(i=this.options.advancedStyle)||void 0===i?void 0:i.params)||void 0===o?void 0:o.linear)||void 0===a?void 0:a.y0,0),da(null===(c=null===(u=null===(s=this.options.advancedStyle)||void 0===s?void 0:s.params)||void 0===u?void 0:u.linear)||void 0===c?void 0:c.x1,this.recommendOptions.advancedStyleParams.linear.x1),da(null===(f=null===(d=null===(l=this.options.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.linear)||void 0===f?void 0:f.y1,0));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createConicGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createConicGradient(da(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.conic)||void 0===i?void 0:i.startAngle,0),da(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.conic)||void 0===u?void 0:u.x,this.recommendOptions.advancedStyleParams.conic.x),da(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.conic)||void 0===f?void 0:f.y,this.recommendOptions.advancedStyleParams.conic.y));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createRadialGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y,m,g,w,b,x,S,O,P,E,T,k,C=t.createRadialGradient(da(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.radial)||void 0===i?void 0:i.x0,this.recommendOptions.advancedStyleParams.radial.x0),da(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.radial)||void 0===u?void 0:u.y0,this.recommendOptions.advancedStyleParams.radial.y0),da(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.radial)||void 0===f?void 0:f.r0,this.recommendOptions.advancedStyleParams.radial.r0),da(null===(y=null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.params)||void 0===v?void 0:v.radial)||void 0===y?void 0:y.x1,this.recommendOptions.advancedStyleParams.radial.x1),da(null===(b=null===(w=null===(g=null===(m=this.options)||void 0===m?void 0:m.advancedStyle)||void 0===g?void 0:g.params)||void 0===w?void 0:w.radial)||void 0===b?void 0:b.y1,this.recommendOptions.advancedStyleParams.radial.y1),da(null===(P=null===(O=null===(S=null===(x=this.options)||void 0===x?void 0:x.advancedStyle)||void 0===S?void 0:S.params)||void 0===O?void 0:O.radial)||void 0===P?void 0:P.r1,this.recommendOptions.advancedStyleParams.radial.r1));return null===(k=null===(T=null===(E=this.options)||void 0===E?void 0:E.advancedStyle)||void 0===T?void 0:T.colorStops)||void 0===k||k.forEach(function(t){C.addColorStop(t.offset,t.color)}),C},t.prototype.createPattern=function(t){var e,n,r,i,o,a,s,u;return t.createPattern(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.pattern)||void 0===i?void 0:i.image,(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.pattern)||void 0===u?void 0:u.repetition)||"")},t.prototype.setText=function(t,e){var n="fillText";"stroke"===this.options.textType&&(n="strokeText"),t[n]&&t[n](e.text,e.x,e.y,e.maxWidth)},t.prototype.drawText=function(t,e){this.setText(t,{text:this.options.content,x:0,y:0-this.recommendOptions.textLine.yOffsetValue,maxWidth:this.options.textRowMaxWidth||this.options.width}),e(t.canvas)},t.prototype.drawImage=function(t,e){var n=this;fa(this.options.image).then(function(r){var i=n.getImageRect(r),o=i.width,a=i.height,s=n.getDrawImagePosition(o,a);t.drawImage(r,s.x,s.y,o,a),e(t.canvas)})},t.prototype.drawMultiLineText=function(t,e){var n=this,r=this.recommendOptions.textLine.data,i=this.recommendOptions.textLine.yOffsetValue;r.forEach(function(e,r){n.setText(t,{text:e,x:0,y:n.options.lineHeight*r-i,maxWidth:n.options.textRowMaxWidth||n.options.width})}),e(t.canvas)},t.prototype.drawRichText=function(t,e){return ra(this,void 0,void 0,function(){var n,r=this;return ia(this,function(i){switch(i.label){case 0:return[4,ca(t,this.options)];case 1:return n=i.sent(),fa((o=n.element,a=o.outerHTML.replace(/<(img|br|input|hr|embed)(.*?)>/g,"<$1$2/>").replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23"),"data:image/svg+xml;charset=utf-8,".concat(a)),n.width,n.height).then(function(n){var i=r.getDrawImagePosition(n.width,n.height);t.drawImage(n,i.x,i.y,n.width,n.height),e(t.canvas)}),[2]}var o,a})})},t.prototype.getImageRect=function(t){var e={width:this.options.imageWidth||0,height:this.options.imageHeight||0};switch(!0){case 0!==e.width&&0===e.height:e.height=e.width*t.height/t.width;break;case 0===e.width&&0!==e.height:e.width=e.height*t.width/t.height;break;case 0===e.width&&0===e.height:e.width=t.width,e.height=t.height}return e},t.prototype.getDrawImagePosition=function(t,e){var n,r,i={x:-t/2,y:-e/2};switch(this.options.translatePlacement){case"top":i.x=-t/2,i.y=0;break;case"top-start":i.x=0,i.y=0;break;case"top-end":i.x=-t,i.y=0;break;case"bottom":i.x=-t/2,i.y=-e;break;case"bottom-start":i.x=0,i.y=-e;break;case"bottom-end":i.x=-t,i.y=-e;break;case"left":i.x=0,i.y=-e/2;break;case"right":i.x=-t,i.y=-e/2}return!sa(null===(n=this.props)||void 0===n?void 0:n.translateX)&&(i.x=0),!sa(null===(r=this.props)||void 0===r?void 0:r.translateY)&&(i.y=0),i},t}(),ya=function(){function t(t,e){var n,r,i,o,a,s,u;this.options=t,this.partialWidth=this.options.width,this.partialHeight=this.options.height,this.rows=(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,this.cols=(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.cols)||1,this.matrix=(null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.matrix)||(a=this.rows,s=this.cols,u=1,Array.from({length:a},function(){return new Array(s).fill(u)})),this.gap=(null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.gap)||[0,0],this.partialCanvas=e}return t.prototype.draw=function(){var t,e,n,r,i,o,a,s,u=va.createCanvas((null===(t=this.options.gridLayoutOptions)||void 0===t?void 0:t.width)||this.partialWidth*this.cols+this.gap[0]*this.cols,(null===(e=this.options.gridLayoutOptions)||void 0===e?void 0:e.height)||this.partialHeight*this.rows+this.gap[1]*this.rows),c=u.getContext("2d");(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.backgroundImage)&&(null==c||c.drawImage(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.backgroundImage,0,0,null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.width,null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.height));for(var l=0;l0}},t.prototype.checkParentElementType=function(){return["html","body"].includes(this.parentElement.tagName.toLocaleLowerCase())?"root":"custom"},t.prototype.bindMutationObserve=function(){var t=this;this.watermarkDom&&(this.observer=new MutationObserver(function(e){return ra(t,void 0,void 0,function(){return ia(this,function(t){switch(t.label){case 0:return e.length>0?(this.remove(),[4,this.create()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.observer.observe(this.watermarkDom,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.parentObserve=new MutationObserver(function(e){return ra(t,void 0,void 0,function(){var t,n,r,i;return ia(this,function(o){switch(o.label){case 0:t=0,n=e,o.label=1;case 1:return t