watermark-js-plus 1.5.6 → 1.5.8

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.
@@ -1 +1 @@
1
- "use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),r={},i=function(t){try{return!!t()}catch(t){return!0}},o=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,c=Function.prototype.call,l=s?c.bind(c):function(){return c.apply(c,arguments)},u={},d={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,f=h&&!d.call({1:2},1);u.f=f?function(t){var e=h(this,t);return!!e&&e.enumerable}:d;var p,v,y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m=a,g=Function.prototype,w=g.call,b=m&&g.bind.bind(w,w),x=m?b:function(t){return function(){return w.apply(t,arguments)}},S=x,O=S({}.toString),P=S("".slice),E=function(t){return P(O(t),8,-1)},k=i,T=E,C=Object,A=x("".split),j=k((function(){return!C("z").propertyIsEnumerable(0)}))?function(t){return"String"===T(t)?A(t,""):C(t)}:C,_=function(t){return null==t},R=_,L=TypeError,D=function(t){if(R(t))throw new L("Can't call method on "+t);return t},I=j,B=D,H=function(t){return I(B(t))},N="object"==typeof document&&document.all,W=void 0===N&&void 0!==N?function(t){return"function"==typeof t||t===N}:function(t){return"function"==typeof t},U=W,F=function(t){return"object"==typeof t?null!==t:U(t)},M=n,G=W,q=function(t,e){return arguments.length<2?(n=M[t],G(n)?n:void 0):M[t]&&M[t][e];var n},z=x({}.isPrototypeOf),V=n.navigator,X=V&&V.userAgent,Y=X?String(X):"",$=n,K=Y,J=$.process,Z=$.Deno,Q=J&&J.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(v=(p=tt.split("."))[0]>0&&p[0]<4?1:+(p[0]+p[1])),!v&&K&&(!(p=K.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=K.match(/Chrome\/(\d+)/))&&(v=+p[1]);var et=v,nt=et,rt=i,it=n.String,ot=!!Object.getOwnPropertySymbols&&!rt((function(){var t=Symbol("symbol detection");return!it(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nt&&nt<41})),at=ot&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=q,ct=W,lt=z,ut=Object,dt=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ct(e)&&lt(e.prototype,ut(t))},ht=String,ft=function(t){try{return ht(t)}catch(t){return"Object"}},pt=W,vt=ft,yt=TypeError,mt=function(t){if(pt(t))return t;throw new yt(vt(t)+" is not a function")},gt=mt,wt=_,bt=function(t,e){var n=t[e];return wt(n)?void 0:gt(n)},xt=l,St=W,Ot=F,Pt=TypeError,Et={exports:{}},kt=n,Tt=Object.defineProperty,Ct=function(t,e){try{Tt(kt,t,{value:e,configurable:!0,writable:!0})}catch(n){kt[t]=e}return e},At=n,jt=Ct,_t="__core-js_shared__",Rt=Et.exports=At[_t]||jt(_t,{});(Rt.versions||(Rt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Lt=Et.exports,Dt=Lt,It=function(t,e){return Dt[t]||(Dt[t]=e||{})},Bt=D,Ht=Object,Nt=function(t){return Ht(Bt(t))},Wt=Nt,Ut=x({}.hasOwnProperty),Ft=Object.hasOwn||function(t,e){return Ut(Wt(t),e)},Mt=x,Gt=0,qt=Math.random(),zt=Mt(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+zt(++Gt+qt,36)},Xt=It,Yt=Ft,$t=Vt,Kt=ot,Jt=at,Zt=n.Symbol,Qt=Xt("wks"),te=Jt?Zt.for||Zt:Zt&&Zt.withoutSetter||$t,ee=function(t){return Yt(Qt,t)||(Qt[t]=Kt&&Yt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},ne=l,re=F,ie=dt,oe=bt,ae=function(t,e){var n,r;if("string"===e&&St(n=t.toString)&&!Ot(r=xt(n,t)))return r;if(St(n=t.valueOf)&&!Ot(r=xt(n,t)))return r;if("string"!==e&&St(n=t.toString)&&!Ot(r=xt(n,t)))return r;throw new Pt("Can't convert object to primitive value")},se=TypeError,ce=ee("toPrimitive"),le=function(t,e){if(!re(t)||ie(t))return t;var n,r=oe(t,ce);if(r){if(void 0===e&&(e="default"),n=ne(r,t,e),!re(n)||ie(n))return n;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},ue=dt,de=function(t){var e=le(t,"string");return ue(e)?e:e+""},he=F,fe=n.document,pe=he(fe)&&he(fe.createElement),ve=function(t){return pe?fe.createElement(t):{}},ye=ve,me=!o&&!i((function(){return 7!==Object.defineProperty(ye("div"),"a",{get:function(){return 7}}).a})),ge=o,we=l,be=u,xe=y,Se=H,Oe=de,Pe=Ft,Ee=me,ke=Object.getOwnPropertyDescriptor;r.f=ge?ke:function(t,e){if(t=Se(t),e=Oe(e),Ee)try{return ke(t,e)}catch(t){}if(Pe(t,e))return xe(!we(be.f,t,e),t[e])};var Te={},Ce=o&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ae=F,je=String,_e=TypeError,Re=function(t){if(Ae(t))return t;throw new _e(je(t)+" is not an object")},Le=o,De=me,Ie=Ce,Be=Re,He=de,Ne=TypeError,We=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,Fe="enumerable",Me="configurable",Ge="writable";Te.f=Le?Ie?function(t,e,n){if(Be(t),e=He(e),Be(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Ge in n&&!n[Ge]){var r=Ue(t,e);r&&r[Ge]&&(t[e]=n.value,n={configurable:Me in n?n[Me]:r[Me],enumerable:Fe in n?n[Fe]:r[Fe],writable:!1})}return We(t,e,n)}:We:function(t,e,n){if(Be(t),e=He(e),Be(n),De)try{return We(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new Ne("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var qe=Te,ze=y,Ve=o?function(t,e,n){return qe.f(t,e,ze(1,n))}:function(t,e,n){return t[e]=n,t},Xe={exports:{}},Ye=o,$e=Ft,Ke=Function.prototype,Je=Ye&&Object.getOwnPropertyDescriptor,Ze=$e(Ke,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Ye||Ye&&Je(Ke,"name").configurable)},tn=W,en=Lt,nn=x(Function.toString);tn(en.inspectSource)||(en.inspectSource=function(t){return nn(t)});var rn,on,an,sn=en.inspectSource,cn=W,ln=n.WeakMap,un=cn(ln)&&/native code/.test(String(ln)),dn=Vt,hn=It("keys"),fn=function(t){return hn[t]||(hn[t]=dn(t))},pn={},vn=un,yn=n,mn=F,gn=Ve,wn=Ft,bn=Lt,xn=fn,Sn=pn,On="Object already initialized",Pn=yn.TypeError,En=yn.WeakMap;if(vn||bn.state){var kn=bn.state||(bn.state=new En);kn.get=kn.get,kn.has=kn.has,kn.set=kn.set,rn=function(t,e){if(kn.has(t))throw new Pn(On);return e.facade=t,kn.set(t,e),e},on=function(t){return kn.get(t)||{}},an=function(t){return kn.has(t)}}else{var Tn=xn("state");Sn[Tn]=!0,rn=function(t,e){if(wn(t,Tn))throw new Pn(On);return e.facade=t,gn(t,Tn,e),e},on=function(t){return wn(t,Tn)?t[Tn]:{}},an=function(t){return wn(t,Tn)}}var Cn={set:rn,get:on,has:an,enforce:function(t){return an(t)?on(t):rn(t,{})},getterFor:function(t){return function(e){var n;if(!mn(e)||(n=on(e)).type!==t)throw new Pn("Incompatible receiver, "+t+" required");return n}}},An=x,jn=i,_n=W,Rn=Ft,Ln=o,Dn=Qe.CONFIGURABLE,In=sn,Bn=Cn.enforce,Hn=Cn.get,Nn=String,Wn=Object.defineProperty,Un=An("".slice),Fn=An("".replace),Mn=An([].join),Gn=Ln&&!jn((function(){return 8!==Wn((function(){}),"length",{value:8}).length})),qn=String(String).split("String"),zn=Xe.exports=function(t,e,n){"Symbol("===Un(Nn(e),0,7)&&(e="["+Fn(Nn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Rn(t,"name")||Dn&&t.name!==e)&&(Ln?Wn(t,"name",{value:e,configurable:!0}):t.name=e),Gn&&n&&Rn(n,"arity")&&t.length!==n.arity&&Wn(t,"length",{value:n.arity});try{n&&Rn(n,"constructor")&&n.constructor?Ln&&Wn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=Bn(t);return Rn(r,"source")||(r.source=Mn(qn,"string"==typeof e?e:"")),t};Function.prototype.toString=zn((function(){return _n(this)&&Hn(this).source||In(this)}),"toString");var Vn=Xe.exports,Xn=W,Yn=Te,$n=Vn,Kn=Ct,Jn=function(t,e,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:e;if(Xn(n)&&$n(n,o,r),r.global)i?t[e]=n:Kn(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:Yn.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Zn={},Qn=Math.ceil,tr=Math.floor,er=Math.trunc||function(t){var e=+t;return(e>0?tr:Qn)(e)},nr=function(t){var e=+t;return e!=e||0===e?0:er(e)},rr=nr,ir=Math.max,or=Math.min,ar=function(t,e){var n=rr(t);return n<0?ir(n+e,0):or(n,e)},sr=nr,cr=Math.min,lr=function(t){var e=sr(t);return e>0?cr(e,9007199254740991):0},ur=function(t){return lr(t.length)},dr=H,hr=ar,fr=ur,pr=function(t){return function(e,n,r){var i=dr(e),o=fr(i);if(0===o)return!t&&-1;var a,s=hr(r,o);if(t&&n!=n){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},vr={includes:pr(!0),indexOf:pr(!1)},yr=Ft,mr=H,gr=vr.indexOf,wr=pn,br=x([].push),xr=function(t,e){var n,r=mr(t),i=0,o=[];for(n in r)!yr(wr,n)&&yr(r,n)&&br(o,n);for(;e.length>i;)yr(r,n=e[i++])&&(~gr(o,n)||br(o,n));return o},Sr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Or=xr,Pr=Sr.concat("length","prototype");Zn.f=Object.getOwnPropertyNames||function(t){return Or(t,Pr)};var Er={};Er.f=Object.getOwnPropertySymbols;var kr=q,Tr=Zn,Cr=Er,Ar=Re,jr=x([].concat),_r=kr("Reflect","ownKeys")||function(t){var e=Tr.f(Ar(t)),n=Cr.f;return n?jr(e,n(t)):e},Rr=Ft,Lr=_r,Dr=r,Ir=Te,Br=i,Hr=W,Nr=/#|\.prototype\./,Wr=function(t,e){var n=Fr[Ur(t)];return n===Gr||n!==Mr&&(Hr(e)?Br(e):!!e)},Ur=Wr.normalize=function(t){return String(t).replace(Nr,".").toLowerCase()},Fr=Wr.data={},Mr=Wr.NATIVE="N",Gr=Wr.POLYFILL="P",qr=Wr,zr=n,Vr=r.f,Xr=Ve,Yr=Jn,$r=Ct,Kr=function(t,e,n){for(var r=Lr(e),i=Ir.f,o=Dr.f,a=0;a<r.length;a++){var s=r[a];Rr(t,s)||n&&Rr(n,s)||i(t,s,o(e,s))}},Jr=qr,Zr=function(t,e){var n,r,i,o,a,s=t.target,c=t.global,l=t.stat;if(n=c?zr:l?zr[s]||$r(s,{}):zr[s]&&zr[s].prototype)for(r in e){if(o=e[r],i=t.dontCallGetSet?(a=Vr(n,r))&&a.value:n[r],!Jr(c?r:s+(l?".":"#")+r,t.forced)&&void 0!==i){if(typeof o==typeof i)continue;Kr(o,i)}(t.sham||i&&i.sham)&&Xr(o,"sham",!0),Yr(n,r,o,t)}},Qr=E,ti=x,ei=function(t){if("Function"===Qr(t))return ti(t)},ni=mt,ri=a,ii=ei(ei.bind),oi=function(t,e){return ni(t),void 0===e?t:ri?ii(t,e):function(){return t.apply(e,arguments)}},ai=l,si=Re,ci=bt,li=function(t,e,n){var r,i;si(t);try{if(!(r=ci(t,"return"))){if("throw"===e)throw n;return n}r=ai(r,t)}catch(t){i=!0,r=t}if("throw"===e)throw n;if(i)throw r;return si(r),n},ui=Re,di=li,hi={},fi=hi,pi=ee("iterator"),vi=Array.prototype,yi=function(t){return void 0!==t&&(fi.Array===t||vi[pi]===t)},mi={};mi[ee("toStringTag")]="z";var gi="[object z]"===String(mi),wi=W,bi=E,xi=ee("toStringTag"),Si=Object,Oi="Arguments"===bi(function(){return arguments}()),Pi=gi?bi:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Si(t),xi))?n:Oi?bi(e):"Object"===(r=bi(e))&&wi(e.callee)?"Arguments":r},Ei=x,ki=i,Ti=W,Ci=Pi,Ai=sn,ji=function(){},_i=q("Reflect","construct"),Ri=/^\s*(?:class|function)\b/,Li=Ei(Ri.exec),Di=!Ri.test(ji),Ii=function(t){if(!Ti(t))return!1;try{return _i(ji,[],t),!0}catch(t){return!1}},Bi=function(t){if(!Ti(t))return!1;switch(Ci(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Di||!!Li(Ri,Ai(t))}catch(t){return!0}};Bi.sham=!0;var Hi=!_i||ki((function(){var t;return Ii(Ii.call)||!Ii(Object)||!Ii((function(){t=!0}))||t}))?Bi:Ii,Ni=o,Wi=Te,Ui=y,Fi=Pi,Mi=bt,Gi=_,qi=hi,zi=ee("iterator"),Vi=function(t){if(!Gi(t))return Mi(t,zi)||Mi(t,"@@iterator")||qi[Fi(t)]},Xi=l,Yi=mt,$i=Re,Ki=ft,Ji=Vi,Zi=TypeError,Qi=function(t,e){var n=arguments.length<2?Ji(t):e;if(Yi(n))return $i(Xi(n,t));throw new Zi(Ki(t)+" is not iterable")},to=oi,eo=l,no=Nt,ro=function(t,e,n,r){try{return r?e(ui(n)[0],n[1]):e(n)}catch(e){di(t,"throw",e)}},io=yi,oo=Hi,ao=ur,so=function(t,e,n){Ni?Wi.f(t,e,Ui(0,n)):t[e]=n},co=Qi,lo=Vi,uo=Array,ho=ee("iterator"),fo=!1;try{var po=0,vo={next:function(){return{done:!!po++}},return:function(){fo=!0}};vo[ho]=function(){return this},Array.from(vo,(function(){throw 2}))}catch(t){}var yo=function(t,e){try{if(!e&&!fo)return!1}catch(t){return!1}var n=!1;try{var r={};r[ho]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},mo=function(t){var e=no(t),n=oo(this),r=arguments.length,i=r>1?arguments[1]:void 0,o=void 0!==i;o&&(i=to(i,r>2?arguments[2]:void 0));var a,s,c,l,u,d,h=lo(e),f=0;if(!h||this===uo&&io(h))for(a=ao(e),s=n?new this(a):uo(a);a>f;f++)d=o?i(e[f],f):e[f],so(s,f,d);else for(s=n?new this:[],u=(l=co(e,h)).next;!(c=eo(u,l)).done;f++)d=o?ro(l,i,[c.value,f],!0):c.value,so(s,f,d);return s.length=f,s};Zr({target:"Array",stat:!0,forced:!yo((function(t){Array.from(t)}))},{from:mo});var go,wo,bo,xo,So=n,Oo=Y,Po=E,Eo=function(t){return Oo.slice(0,t.length)===t},ko=Eo("Bun/")?"BUN":Eo("Cloudflare-Workers")?"CLOUDFLARE":Eo("Deno/")?"DENO":Eo("Node.js/")?"NODE":So.Bun&&"string"==typeof Bun.version?"BUN":So.Deno&&"object"==typeof Deno.version?"DENO":"process"===Po(So.process)?"NODE":So.window&&So.document?"BROWSER":"REST",To="NODE"===ko,Co=x,Ao=mt,jo=F,_o=function(t){return jo(t)||null===t},Ro=String,Lo=TypeError,Do=function(t,e,n){try{return Co(Ao(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},Io=F,Bo=D,Ho=function(t){if(_o(t))return t;throw new Lo("Can't set "+Ro(t)+" as a prototype")},No=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Do(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Bo(n),Ho(r),Io(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0),Wo=Te.f,Uo=Ft,Fo=ee("toStringTag"),Mo=Vn,Go=Te,qo=q,zo=function(t,e,n){return n.get&&Mo(n.get,e,{getter:!0}),n.set&&Mo(n.set,e,{setter:!0}),Go.f(t,e,n)},Vo=o,Xo=ee("species"),Yo=z,$o=TypeError,Ko=Hi,Jo=ft,Zo=TypeError,Qo=Re,ta=function(t){if(Ko(t))return t;throw new Zo(Jo(t)+" is not a constructor")},ea=_,na=ee("species"),ra=a,ia=Function.prototype,oa=ia.apply,aa=ia.call,sa="object"==typeof Reflect&&Reflect.apply||(ra?aa.bind(oa):function(){return aa.apply(oa,arguments)}),ca=q("document","documentElement"),la=x([].slice),ua=TypeError,da=/(?:ipad|iphone|ipod).*applewebkit/i.test(Y),ha=n,fa=sa,pa=oi,va=W,ya=Ft,ma=i,ga=ca,wa=la,ba=ve,xa=function(t,e){if(t<e)throw new ua("Not enough arguments");return t},Sa=da,Oa=To,Pa=ha.setImmediate,Ea=ha.clearImmediate,ka=ha.process,Ta=ha.Dispatch,Ca=ha.Function,Aa=ha.MessageChannel,ja=ha.String,_a=0,Ra={},La="onreadystatechange";ma((function(){go=ha.location}));var Da=function(t){if(ya(Ra,t)){var e=Ra[t];delete Ra[t],e()}},Ia=function(t){return function(){Da(t)}},Ba=function(t){Da(t.data)},Ha=function(t){ha.postMessage(ja(t),go.protocol+"//"+go.host)};Pa&&Ea||(Pa=function(t){xa(arguments.length,1);var e=va(t)?t:Ca(t),n=wa(arguments,1);return Ra[++_a]=function(){fa(e,void 0,n)},wo(_a),_a},Ea=function(t){delete Ra[t]},Oa?wo=function(t){ka.nextTick(Ia(t))}:Ta&&Ta.now?wo=function(t){Ta.now(Ia(t))}:Aa&&!Sa?(xo=(bo=new Aa).port2,bo.port1.onmessage=Ba,wo=pa(xo.postMessage,xo)):ha.addEventListener&&va(ha.postMessage)&&!ha.importScripts&&go&&"file:"!==go.protocol&&!ma(Ha)?(wo=Ha,ha.addEventListener("message",Ba,!1)):wo=La in ba("script")?function(t){ga.appendChild(ba("script"))[La]=function(){ga.removeChild(this),Da(t)}}:function(t){setTimeout(Ia(t),0)});var Na={set:Pa,clear:Ea},Wa=n,Ua=o,Fa=Object.getOwnPropertyDescriptor,Ma=function(){this.head=null,this.tail=null};Ma.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Ga,qa,za,Va,Xa,Ya=Ma,$a=/ipad|iphone|ipod/i.test(Y)&&"undefined"!=typeof Pebble,Ka=/web0s(?!.*chrome)/i.test(Y),Ja=n,Za=function(t){if(!Ua)return Wa[t];var e=Fa(Wa,t);return e&&e.value},Qa=oi,ts=Na.set,es=Ya,ns=da,rs=$a,is=Ka,os=To,as=Ja.MutationObserver||Ja.WebKitMutationObserver,ss=Ja.document,cs=Ja.process,ls=Ja.Promise,us=Za("queueMicrotask");if(!us){var ds=new es,hs=function(){var t,e;for(os&&(t=cs.domain)&&t.exit();e=ds.get();)try{e()}catch(t){throw ds.head&&Ga(),t}t&&t.enter()};ns||os||is||!as||!ss?!rs&&ls&&ls.resolve?((Va=ls.resolve(void 0)).constructor=ls,Xa=Qa(Va.then,Va),Ga=function(){Xa(hs)}):os?Ga=function(){cs.nextTick(hs)}:(ts=Qa(ts,Ja),Ga=function(){ts(hs)}):(qa=!0,za=ss.createTextNode(""),new as(hs).observe(za,{characterData:!0}),Ga=function(){za.data=qa=!qa}),us=function(t){ds.head||Ga(),ds.add(t)}}var fs=us,ps=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},vs=n.Promise,ys=n,ms=vs,gs=W,ws=qr,bs=sn,xs=ee,Ss=ko,Os=et;ms&&ms.prototype;var Ps=xs("species"),Es=!1,ks=gs(ys.PromiseRejectionEvent),Ts=ws("Promise",(function(){var t=bs(ms),e=t!==String(ms);if(!e&&66===Os)return!0;if(!Os||Os<51||!/native code/.test(t)){var n=new ms((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};if((n.constructor={})[Ps]=r,!(Es=n.then((function(){}))instanceof r))return!0}return!(e||"BROWSER"!==Ss&&"DENO"!==Ss||ks)})),Cs={CONSTRUCTOR:Ts,REJECTION_EVENT:ks,SUBCLASSING:Es},As={},js=mt,_s=TypeError,Rs=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw new _s("Bad Promise constructor");e=t,n=r})),this.resolve=js(e),this.reject=js(n)};As.f=function(t){return new Rs(t)};var Ls,Ds,Is,Bs=Zr,Hs=To,Ns=n,Ws=l,Us=Jn,Fs=No,Ms=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Uo(t,Fo)&&Wo(t,Fo,{configurable:!0,value:e})},Gs=function(t){var e=qo(t);Vo&&e&&!e[Xo]&&zo(e,Xo,{configurable:!0,get:function(){return this}})},qs=mt,zs=W,Vs=F,Xs=function(t,e){if(Yo(e,t))return t;throw new $o("Incorrect invocation")},Ys=function(t,e){var n,r=Qo(t).constructor;return void 0===r||ea(n=Qo(r)[na])?e:ta(n)},$s=Na.set,Ks=fs,Js=function(t,e){},Zs=ps,Qs=Ya,tc=Cn,ec=vs,nc=As,rc="Promise",ic=Cs.CONSTRUCTOR,oc=Cs.REJECTION_EVENT,ac=Cs.SUBCLASSING,sc=tc.getterFor(rc),cc=tc.set,lc=ec&&ec.prototype,uc=ec,dc=lc,hc=Ns.TypeError,fc=Ns.document,pc=Ns.process,vc=nc.f,yc=vc,mc=!!(fc&&fc.createEvent&&Ns.dispatchEvent),gc="unhandledrejection",wc=function(t){var e;return!(!Vs(t)||!zs(e=t.then))&&e},bc=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,c=t.resolve,l=t.reject,u=t.domain;try{s?(a||(2===e.rejection&&Ec(e),e.rejection=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),i=!0)),n===t.promise?l(new hc("Promise-chain cycle")):(r=wc(n))?Ws(r,n,c,l):c(n)):l(o)}catch(t){u&&!i&&u.exit(),l(t)}},xc=function(t,e){t.notified||(t.notified=!0,Ks((function(){for(var n,r=t.reactions;n=r.get();)bc(n,t);t.notified=!1,e&&!t.rejection&&Oc(t)})))},Sc=function(t,e,n){var r,i;mc?((r=fc.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),Ns.dispatchEvent(r)):r={promise:e,reason:n},!oc&&(i=Ns["on"+t])?i(r):t===gc&&Js("Unhandled promise rejection",n)},Oc=function(t){Ws($s,Ns,(function(){var e,n=t.facade,r=t.value;if(Pc(t)&&(e=Zs((function(){Hs?pc.emit("unhandledRejection",r,n):Sc(gc,n,r)})),t.rejection=Hs||Pc(t)?2:1,e.error))throw e.value}))},Pc=function(t){return 1!==t.rejection&&!t.parent},Ec=function(t){Ws($s,Ns,(function(){var e=t.facade;Hs?pc.emit("rejectionHandled",e):Sc("rejectionhandled",e,t.value)}))},kc=function(t,e,n){return function(r){t(e,r,n)}},Tc=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,xc(t,!0))},Cc=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new hc("Promise can't be resolved itself");var r=wc(e);r?Ks((function(){var n={done:!1};try{Ws(r,e,kc(Cc,n,t),kc(Tc,n,t))}catch(e){Tc(n,e,t)}})):(t.value=e,t.state=1,xc(t,!1))}catch(e){Tc({done:!1},e,t)}}};if(ic&&(dc=(uc=function(t){Xs(this,dc),qs(t),Ws(Ls,this);var e=sc(this);try{t(kc(Cc,e),kc(Tc,e))}catch(t){Tc(e,t)}}).prototype,(Ls=function(t){cc(this,{type:rc,done:!1,notified:!1,parent:!1,reactions:new Qs,rejection:!1,state:0,value:null})}).prototype=Us(dc,"then",(function(t,e){var n=sc(this),r=vc(Ys(this,uc));return n.parent=!0,r.ok=!zs(t)||t,r.fail=zs(e)&&e,r.domain=Hs?pc.domain:void 0,0===n.state?n.reactions.add(r):Ks((function(){bc(r,n)})),r.promise})),Ds=function(){var t=new Ls,e=sc(t);this.promise=t,this.resolve=kc(Cc,e),this.reject=kc(Tc,e)},nc.f=vc=function(t){return t===uc||undefined===t?new Ds(t):yc(t)},zs(ec)&&lc!==Object.prototype)){Is=lc.then,ac||Us(lc,"then",(function(t,e){var n=this;return new uc((function(t,e){Ws(Is,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete lc.constructor}catch(t){}Fs&&Fs(lc,dc)}Bs({global:!0,constructor:!0,wrap:!0,forced:ic},{Promise:uc}),Ms(uc,rc,!1),Gs(rc);var Ac=oi,jc=l,_c=Re,Rc=ft,Lc=yi,Dc=ur,Ic=z,Bc=Qi,Hc=Vi,Nc=li,Wc=TypeError,Uc=function(t,e){this.stopped=t,this.result=e},Fc=Uc.prototype,Mc=function(t,e,n){var r,i,o,a,s,c,l,u=n&&n.that,d=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=Ac(e,u),y=function(t){return r&&Nc(r,"normal",t),new Uc(!0,t)},m=function(t){return d?(_c(t),p?v(t[0],t[1],y):v(t[0],t[1])):p?v(t,y):v(t)};if(h)r=t.iterator;else if(f)r=t;else{if(!(i=Hc(t)))throw new Wc(Rc(t)+" is not iterable");if(Lc(i)){for(o=0,a=Dc(t);a>o;o++)if((s=m(t[o]))&&Ic(Fc,s))return s;return new Uc(!1)}r=Bc(t,i)}for(c=h?t.next:r.next;!(l=jc(c,r)).done;){try{s=m(l.value)}catch(t){Nc(r,"throw",t)}if("object"==typeof s&&s&&Ic(Fc,s))return s}return new Uc(!1)},Gc=vs,qc=Cs.CONSTRUCTOR||!yo((function(t){Gc.all(t).then(void 0,(function(){}))})),zc=l,Vc=mt,Xc=As,Yc=ps,$c=Mc;Zr({target:"Promise",stat:!0,forced:qc},{all:function(t){var e=this,n=Xc.f(e),r=n.resolve,i=n.reject,o=Yc((function(){var n=Vc(e.resolve),o=[],a=0,s=1;$c(t,(function(t){var c=a++,l=!1;s++,zc(n,e,t).then((function(t){l||(l=!0,o[c]=t,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Kc=Zr,Jc=Cs.CONSTRUCTOR,Zc=vs,Qc=q,tl=W,el=Jn,nl=Zc&&Zc.prototype;if(Kc({target:"Promise",proto:!0,forced:Jc,real:!0},{catch:function(t){return this.then(void 0,t)}}),tl(Zc)){var rl=Qc("Promise").prototype.catch;nl.catch!==rl&&el(nl,"catch",rl,{unsafe:!0})}var il=l,ol=mt,al=As,sl=ps,cl=Mc;Zr({target:"Promise",stat:!0,forced:qc},{race:function(t){var e=this,n=al.f(e),r=n.reject,i=sl((function(){var i=ol(e.resolve);cl(t,(function(t){il(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var ll=As;Zr({target:"Promise",stat:!0,forced:Cs.CONSTRUCTOR},{reject:function(t){var e=ll.f(this);return(0,e.reject)(t),e.promise}});var ul=Re,dl=F,hl=As,fl=Zr,pl=Cs.CONSTRUCTOR,vl=function(t,e){if(ul(t),dl(e)&&e.constructor===t)return e;var n=hl.f(t);return(0,n.resolve)(e),n.promise};q("Promise"),fl({target:"Promise",stat:!0,forced:pl},{resolve:function(t){return vl(this,t)}});var yl={},ml=xr,gl=Sr,wl=Object.keys||function(t){return ml(t,gl)},bl=o,xl=Ce,Sl=Te,Ol=Re,Pl=H,El=wl;yl.f=bl&&!xl?Object.defineProperties:function(t,e){Ol(t);for(var n,r=Pl(e),i=El(e),o=i.length,a=0;o>a;)Sl.f(t,n=i[a++],r[n]);return t};var kl,Tl=Re,Cl=yl,Al=Sr,jl=pn,_l=ca,Rl=ve,Ll="prototype",Dl="script",Il=fn("IE_PROTO"),Bl=function(){},Hl=function(t){return"<"+Dl+">"+t+"</"+Dl+">"},Nl=function(t){t.write(Hl("")),t.close();var e=t.parentWindow.Object;return t=null,e},Wl=function(){try{kl=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Wl="undefined"!=typeof document?document.domain&&kl?Nl(kl):(e=Rl("iframe"),n="java"+Dl+":",e.style.display="none",_l.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Hl("document.F=Object")),t.close(),t.F):Nl(kl);for(var r=Al.length;r--;)delete Wl[Ll][Al[r]];return Wl()};jl[Il]=!0;var Ul=ee,Fl=Object.create||function(t,e){var n;return null!==t?(Bl[Ll]=Tl(t),n=new Bl,Bl[Ll]=null,n[Il]=t):n=Wl(),void 0===e?n:Cl.f(n,e)},Ml=Te.f,Gl=Ul("unscopables"),ql=Array.prototype;void 0===ql[Gl]&&Ml(ql,Gl,{configurable:!0,value:Fl(null)});var zl=function(t){ql[Gl][t]=!0},Vl=vr.includes,Xl=zl;Zr({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return Vl(this,t,arguments.length>1?arguments[1]:void 0)}}),Xl("includes");var Yl=Nt,$l=ar,Kl=ur,Jl=zl;Zr({target:"Array",proto:!0},{fill:function(t){for(var e=Yl(this),n=Kl(e),r=arguments.length,i=$l(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:$l(o,n);a>i;)e[i++]=t;return e}}),Jl("fill");var Zl="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Ql="URLSearchParams"in Zl,tu="Symbol"in Zl&&"iterator"in Symbol,eu="FileReader"in Zl&&"Blob"in Zl&&function(){try{return new Blob,!0}catch(t){return!1}}(),nu="FormData"in Zl,ru="ArrayBuffer"in Zl;if(ru)var iu=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ou=ArrayBuffer.isView||function(t){return t&&iu.indexOf(Object.prototype.toString.call(t))>-1};function au(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 su(t){return"string"!=typeof t&&(t=String(t)),t}function cu(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return tu&&(e[Symbol.iterator]=function(){return e}),e}function lu(t){this.map={},t instanceof lu?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 uu(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function du(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function hu(t){var e=new FileReader,n=du(e);return e.readAsArrayBuffer(t),n}function fu(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function pu(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:eu&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:nu&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Ql&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():ru&&eu&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=fu(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ru&&(ArrayBuffer.prototype.isPrototypeOf(t)||ou(t))?this._bodyArrayBuffer=fu(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):Ql&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},eu&&(this.blob=function(){var t=uu(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=uu(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(eu)return this.blob().then(hu);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=uu(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=du(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8";return e.readAsText(t,i),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},nu&&(this.formData=function(){return this.text().then(mu)}),this.json=function(){return this.text().then(JSON.parse)},this}lu.prototype.append=function(t,e){t=au(t),e=su(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},lu.prototype.delete=function(t){delete this.map[au(t)]},lu.prototype.get=function(t){return t=au(t),this.has(t)?this.map[t]:null},lu.prototype.has=function(t){return this.map.hasOwnProperty(au(t))},lu.prototype.set=function(t,e){this.map[au(t)]=su(e)},lu.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},lu.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),cu(t)},lu.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),cu(t)},lu.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),cu(t)},tu&&(lu.prototype[Symbol.iterator]=lu.prototype.entries);var vu=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function yu(t,e){if(!(this instanceof yu))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof yu){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new lu(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new lu(e.headers)),this.method=function(t){var e=t.toUpperCase();return vu.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Zl)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function mu(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 gu(t,e){if(!(this instanceof gu))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 lu(e.headers),this.url=e.url||"",this._initBody(t)}yu.prototype.clone=function(){return new yu(this,{body:this._bodyInit})},pu.call(yu.prototype),pu.call(gu.prototype),gu.prototype.clone=function(){return new gu(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new lu(this.headers),url:this.url})},gu.error=function(){var t=new gu(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var wu=[301,302,303,307,308];gu.redirect=function(t,e){if(-1===wu.indexOf(e))throw new RangeError("Invalid status code");return new gu(null,{status:e,headers:{location:t}})};var bu=Zl.DOMException;try{new bu}catch(t){(bu=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),bu.prototype.constructor=bu}function xu(t,e){return new Promise((function(n,r){var i=new yu(t,e);if(i.signal&&i.signal.aborted)return r(new bu("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 lu,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 gu(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 bu("Aborted","AbortError"))}),0)},o.open(i.method,function(t){try{return""===t&&Zl.location.href?Zl.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&&(eu?o.responseType="blob":ru&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof lu||Zl.Headers&&e.headers instanceof Zl.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(au(t)),o.setRequestHeader(t,su(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)}))}xu.polyfill=!0,Zl.fetch||(Zl.fetch=xu,Zl.Headers=lu,Zl.Request=yu,Zl.Response=gu);!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:0 0}75%{background-position:100% -100%}to{background-position:0 0}}");var Su=function(t,e){return Su=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])},Su(t,e)};var Ou=function(){return Ou=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ou.apply(this,arguments)};function Pu(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function Eu(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var ku=function(t){return t.toDataURL("image/png",1)},Tu=function(t){return"function"==typeof t},Cu=function(t){return void 0===t},Au=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n="http://www.w3.org/2000/svg");var r=document.createElementNS(n,t);for(var i in e)r.setAttribute(i,e[i]);return r},ju=function(t,e){return Pu(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u;return Eu(this,(function(d){switch(d.label){case 0:return n=Au("svg",{xmlns:"http://www.w3.org/2000/svg"}),(r=document.createElement("div")).setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.cssText="\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font: ".concat(t.font,";\n color: ").concat(e.fontColor,";\n"),r.innerHTML="<div class='rich-text-content'>".concat(e.content,"</div>"),document.body.appendChild(r),[4,_u(r)];case 1:return d.sent(),i=null===(u=r.querySelector(".rich-text-content"))||void 0===u?void 0:u.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,c=e.richTextHeight||a||e.height,n.setAttribute("width",s.toString()),n.setAttribute("height",c.toString()),(l=Au("foreignObject",{width:s.toString(),height:c.toString()})).appendChild(r),n.appendChild(l),[2,{element:n,width:s,height:c}]}}))}))};function _u(t){return Pu(this,void 0,void 0,(function(){var e,n,r,i,o;return Eu(this,(function(a){switch(a.label){case 0:e=t.querySelectorAll("img"),n=function(t){var e,n,r,i;return Eu(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 r<i.length?(o=i[r],[5,n(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))}var Ru=function(t,e){return Cu(t)?e:t},Lu=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=void 0);var r=new Image;return r.setAttribute("crossOrigin","Anonymous"),!Cu(e)&&(r.width=e),!Cu(n)&&(r.height=n),r.src=t,new Promise((function(t){r.onload=function(){t(r)}}))},Du={width:300,height:300,rotate:45,layout:"default",auxiliaryLine:!1,translatePlacement:"middle",contentType:"text",content:"hello watermark-js-plus",textType:"fill",imageWidth:0,imageHeight:0,lineHeight:30,zIndex:2147483647,backgroundPosition:"0 0",backgroundRepeat:"repeat",fontSize:"20px",fontFamily:"sans-serif",fontStyle:"",fontVariant:"",fontColor:"#000",fontWeight:"normal",filter:"none",letterSpacing:"0px",wordSpacing:"0px",globalAlpha:.5,mode:"default",mutationObserve:!0,monitorProtection:!1,movable:!1,parent:"body",onSuccess:function(){},onBeforeDestroy:function(){},onDestroyed:function(){},onObserveError:function(){}},Iu=function(t){"undefined"!=typeof window&&t&&(Object.defineProperty(window,"MutationObserver",{writable:!1,configurable:!1}),Object.defineProperty(window,"requestAnimationFrame",{writable:!1,configurable:!1}))},Bu=function(){function t(e,n){this.props=e,this.options=n,this.canvas=t.createCanvas(this.options.width,this.options.height),this.recommendOptions=function(t,e,n){var r=t.getContext("2d");if(null===r)throw new Error("get context error");r.font="".concat(e.fontStyle," ").concat(e.fontVariant," ").concat(e.fontWeight," ").concat(e.fontSize," ").concat(e.fontFamily),r.filter=e.filter,r.letterSpacing=e.letterSpacing,r.wordSpacing=e.wordSpacing,(null==e?void 0:e.rotate)&&(e.rotate=(360-e.rotate%360)*(Math.PI/180)),Cu(n.textRowMaxWidth)&&(e.textRowMaxWidth=e.width);var i={image:{rect:{width:e.imageWidth,height:e.imageHeight},position:{x:0,y:0}},textLine:{data:[],yOffsetValue:0},advancedStyleParams:{linear:{x0:0,x1:0},radial:{x0:0,y0:0,r0:0,x1:0,y1:0,r1:0},conic:{x:0,y:0,startAngle:0},pattern:{}}};switch(e.contentType){case"text":i.textLine.data=[e.content];break;case"multi-line-text":i.textLine.data=function(t,e,n){for(var r=[],i="",o="",a=0,s=e.length;a<s;a++)"\n"!==(o=e.charAt(a))?(i+=o,t.measureText(i).width>n&&(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",c="center";switch(Cu(null==n?void 0:n.translateX)||Cu(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",c="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",c="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",c="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",c="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",c="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,c="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,c="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,Cu(null==n?void 0:n.textBaseline)&&(e.textBaseline=s),Cu(null==n?void 0:n.textAlign)&&(e.textAlign=c),["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=Ru(this.options.shadowStyle.shadowBlur,0),t.shadowColor=Ru(this.options.shadowStyle.shadowColor,"#00000000"),t.shadowOffsetX=Ru(this.options.shadowStyle.shadowOffsetX,0),t.shadowOffsetY=Ru(this.options.shadowStyle.shadowOffsetY,0)),Tu(this.options.extraDrawFunc)&&this.options.extraDrawFunc(t)},t.prototype.createLinearGradient=function(t){var e,n,r,i,o,a,s,c,l,u,d,h,f,p,v,y=t.createLinearGradient(Ru(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),Ru(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),Ru(null===(l=null===(c=null===(s=this.options.advancedStyle)||void 0===s?void 0:s.params)||void 0===c?void 0:c.linear)||void 0===l?void 0:l.x1,this.recommendOptions.advancedStyleParams.linear.x1),Ru(null===(h=null===(d=null===(u=this.options.advancedStyle)||void 0===u?void 0:u.params)||void 0===d?void 0:d.linear)||void 0===h?void 0:h.y1,0));return null===(v=null===(p=null===(f=this.options)||void 0===f?void 0:f.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,c,l,u,d,h,f,p,v,y=t.createConicGradient(Ru(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),Ru(null===(c=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===c?void 0:c.x,this.recommendOptions.advancedStyleParams.conic.x),Ru(null===(h=null===(d=null===(u=null===(l=this.options)||void 0===l?void 0:l.advancedStyle)||void 0===u?void 0:u.params)||void 0===d?void 0:d.conic)||void 0===h?void 0:h.y,this.recommendOptions.advancedStyleParams.conic.y));return null===(v=null===(p=null===(f=this.options)||void 0===f?void 0:f.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,c,l,u,d,h,f,p,v,y,m,g,w,b,x,S,O,P,E,k,T,C=t.createRadialGradient(Ru(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),Ru(null===(c=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===c?void 0:c.y0,this.recommendOptions.advancedStyleParams.radial.y0),Ru(null===(h=null===(d=null===(u=null===(l=this.options)||void 0===l?void 0:l.advancedStyle)||void 0===u?void 0:u.params)||void 0===d?void 0:d.radial)||void 0===h?void 0:h.r0,this.recommendOptions.advancedStyleParams.radial.r0),Ru(null===(y=null===(v=null===(p=null===(f=this.options)||void 0===f?void 0:f.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),Ru(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),Ru(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===(T=null===(k=null===(E=this.options)||void 0===E?void 0:E.advancedStyle)||void 0===k?void 0:k.colorStops)||void 0===T||T.forEach((function(t){C.addColorStop(t.offset,t.color)})),C},t.prototype.createPattern=function(t){var e,n,r,i,o,a,s,c;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===(c=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===c?void 0:c.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;Lu(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 Pu(this,void 0,void 0,(function(){var n,r=this;return Eu(this,(function(i){switch(i.label){case 0:return[4,ju(t,this.options)];case 1:return n=i.sent(),Lu((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!Cu(null===(n=this.props)||void 0===n?void 0:n.translateX)&&(i.x=0),!Cu(null===(r=this.props)||void 0===r?void 0:r.translateY)&&(i.y=0),i},t}(),Hu=function(){function t(t,e){var n,r,i,o,a,s,c;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,c=1,Array.from({length:a},(function(){return new Array(s).fill(c)}))),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,c=Bu.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),l=c.getContext("2d");(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.backgroundImage)&&(null==l||l.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 u=0;u<this.rows;u++)for(var d=0;d<this.cols;d++)(null===(s=null===(a=this.matrix)||void 0===a?void 0:a[u])||void 0===s?void 0:s[d])&&(null==l||l.drawImage(this.partialCanvas,this.partialWidth*d+this.gap[0]*d,this.partialHeight*u+this.gap[1]*u,this.partialWidth,this.partialHeight));return c},t}(),Nu=function(t,e){return"grid"===t.layout?new Hu(t,e).draw():e},Wu=function(){function t(t){void 0===t&&(t={}),this.parentElement=document.body,this.isCreating=!1,this.props=t,this.options=Ou(Ou({},Du),t),this.changeParentElement(this.options.parent),this.watermarkCanvas=new Bu(this.props,this.options),Iu(this.options.monitorProtection)}return t.prototype.changeOptions=function(){return Pu(this,arguments,void 0,(function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),Eu(this,(function(r){switch(r.label){case 0:return this.initConfigData(t,e),Iu(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.create=function(){return Pu(this,void 0,void 0,(function(){var t,e,n,r,i,o,a,s,c,l,u,d;return Eu(this,(function(h){switch(h.label){case 0:return this.isCreating?[2]:(this.isCreating=!0,this.validateUnique()&&this.validateContent()?(t=Cu(this.watermarkDom),[4,null===(o=this.watermarkCanvas)||void 0===o?void 0:o.draw()]):(this.isCreating=!1,[2]));case 1:if(h.sent(),this.layoutCanvas=Nu(this.options,null===(a=this.watermarkCanvas)||void 0===a?void 0:a.getCanvas()),e=ku(this.layoutCanvas),null===(s=this.watermarkCanvas)||void 0===s||s.clear(),this.watermarkDom=document.createElement("div"),n=document.createElement("div"),this.watermarkDom.__WATERMARK__="watermark",this.watermarkDom.__WATERMARK__INSTANCE__=this,r=this.checkParentElementType(),this.watermarkDom.style.cssText="\n z-index:".concat(this.options.zIndex,"!important;display:block!important;visibility:visible!important;transform:none!important;scale:none!important;\n ").concat("custom"===r?"top:0!important;bottom:0!important;left:0!important;right:0!important;height:100%!important;pointer-events:none!important;position:absolute!important;":"position:relative!important;","\n "),i=function(t){var e,n,r;if("grid"===t.layout){var i=(null===(e=t.gridLayoutOptions)||void 0===e?void 0:e.cols)||1,o=(null===(n=t.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,a=(null===(r=t.gridLayoutOptions)||void 0===r?void 0:r.gap)||[0,0];return[t.width*i+a[0]*i,t.height*o+a[1]*o]}return[t.width,t.height]}(this.options),n.style.cssText="\n display:block!important;visibility:visible!important;pointer-events:none;top:0;bottom:0;left:0;right:0;transform:none!important;scale:none!important;\n position:".concat("root"===r?"fixed":"absolute","!important;-webkit-print-color-adjust:exact!important;width:100%!important;height:100%!important;\n z-index:").concat(this.options.zIndex,"!important;background-image:url(").concat(e,")!important;background-repeat:").concat(this.options.backgroundRepeat,"!important;\n background-size:").concat(i[0],"px ").concat(i[1],"px!important;background-position:").concat(this.options.backgroundPosition,";\n ").concat(this.options.movable?"animation: 200s ease 0s infinite normal none running watermark !important;":"","\n "),this.watermarkDom.appendChild(n),this.parentElement.appendChild(this.watermarkDom),this.options.mutationObserve)try{this.bindMutationObserve()}catch(t){null===(l=(c=this.options).onObserveError)||void 0===l||l.call(c)}return t&&(null===(d=(u=this.options).onSuccess)||void 0===d||d.call(u)),this.isCreating=!1,[2]}}))}))},t.prototype.destroy=function(){this.remove(),this.watermarkDom=void 0},t.prototype.check=function(){return Pu(this,void 0,void 0,(function(){return Eu(this,(function(t){return[2,this.parentElement.contains(this.watermarkDom)]}))}))},t.prototype.remove=function(){var t,e,n,r,i,o,a,s;null===(e=(t=this.options).onBeforeDestroy)||void 0===e||e.call(t),null===(n=this.observer)||void 0===n||n.disconnect(),null===(r=this.parentObserve)||void 0===r||r.disconnect(),this.unbindCheckWatermarkElementEvent(),null===(o=null===(i=this.watermarkDom)||void 0===i?void 0:i.parentNode)||void 0===o||o.removeChild(this.watermarkDom),null===(s=(a=this.options).onDestroyed)||void 0===s||s.call(a)},t.prototype.initConfigData=function(t,e){var n=this;void 0===e&&(e="overwrite"),"append"===e?Object.keys(t).forEach((function(e){n.props&&(n.props[e]=t[e])})):this.props=t,this.options=Ou(Ou({},Du),this.props),this.changeParentElement(this.options.parent),this.watermarkCanvas=new Bu(this.props,this.options)},t.prototype.changeParentElement=function(t){if("string"==typeof t){var e=document.querySelector(t);e&&(this.parentElement=e)}else this.parentElement=t;this.parentElement||console.error("[WatermarkJsPlus]: please pass a valid parent element.")},t.prototype.validateUnique=function(){var t=!0;return Array.from(this.parentElement.childNodes).forEach((function(e){t&&Object.hasOwnProperty.call(e,"__WATERMARK__")&&(t=!1)})),t},t.prototype.validateContent=function(){switch(this.options.contentType){case"image":return Object.hasOwnProperty.call(this.options,"image");case"multi-line-text":case"rich-text":case"text":return this.options.content.length>0}},t.prototype.checkParentElementType=function(){return["html","body"].includes(this.parentElement.tagName.toLocaleLowerCase())?"root":"custom"},t.prototype.checkWatermarkElement=function(){return Pu(this,void 0,void 0,(function(){return Eu(this,(function(t){switch(t.label){case 0:return this.parentElement.contains(this.watermarkDom)?[3,2]:(this.remove(),[4,this.create()]);case 1:t.sent(),t.label=2;case 2:return this.bindCheckWatermarkElementEvent(),[2]}}))}))},t.prototype.bindMutationObserve=function(){var t=this;this.watermarkDom&&(this.bindCheckWatermarkElementEvent(),this.observer=new MutationObserver((function(e){return Pu(t,void 0,void 0,(function(){return Eu(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 Pu(t,void 0,void 0,(function(){var t,n,r,i;return Eu(this,(function(o){switch(o.label){case 0:t=0,n=e,o.label=1;case 1:return t<n.length?(null==(r=n[t])?void 0:r.target)===this.watermarkDom||(null===(i=null==r?void 0:r.removedNodes)||void 0===i?void 0:i[0])===this.watermarkDom||"childList"===r.type&&r.target===this.parentElement&&r.target.lastChild!==this.watermarkDom?(this.remove(),[4,this.create()]):[3,3]:[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))})),this.parentObserve.observe(this.parentElement,{attributes:!0,childList:!0,subtree:!0,characterData:!0}))},t.prototype.bindCheckWatermarkElementEvent=function(){this.unbindCheckWatermarkElementEvent(),this.checkWatermarkElementRequestID=requestAnimationFrame(this.checkWatermarkElement.bind(this))},t.prototype.unbindCheckWatermarkElementEvent=function(){Cu(this.checkWatermarkElementRequestID)||cancelAnimationFrame(this.checkWatermarkElementRequestID)},t}(),Uu=function(t){function e(e){void 0===e&&(e={});return t.call(this,Ou(Ou({},e),{globalAlpha:.005,mode:"blind"}))||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Su(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.decode=function(t){var e=t.url,n=void 0===e?"":e,r=t.fillColor,i=void 0===r?"#000":r,o=t.compositeOperation,a=void 0===o?"color-burn":o,s=t.mode,c=void 0===s?"canvas":s,l=t.compositeTimes,u=void 0===l?3:l,d=t.onSuccess;if(n&&"canvas"===c){var h=new Image;h.src=n,h.addEventListener("load",(function(){var t=h.width,e=h.height,n=Bu.createCanvas(t,e),r=n.getContext("2d");if(!r)throw new Error("get context error");r.drawImage(h,0,0,t,e),r.globalCompositeOperation=a,r.fillStyle=i;for(var o=0;o<u;o++)r.fillRect(0,0,t,e);var s=ku(n);Tu(d)&&(null==d||d(s))}))}},e}(Wu),Fu=function(){function t(t){var e;void 0===t&&(t={}),this.drew=!1,this.props=t,this.options=Ou(Ou({},Du),t),this.watermarkCanvas=new Bu(this.props,this.options),this.originalSrc=null===(e=this.props.dom)||void 0===e?void 0:e.src,this.backgroundImage=this.getBackgroundImage()}return t.prototype.create=function(){return Pu(this,void 0,void 0,(function(){var t,e,n,r,i;return Eu(this,(function(o){switch(o.label){case 0:return this.drew?[2]:[4,null===(t=this.watermarkCanvas)||void 0===t?void 0:t.draw()];case 1:return o.sent(),this.options.layout="grid",this.options.gridLayoutOptions=Ou(Ou({},this.options.gridLayoutOptions),{width:null===(e=this.backgroundImage)||void 0===e?void 0:e.width,height:null===(n=this.backgroundImage)||void 0===n?void 0:n.height,backgroundImage:this.backgroundImage}),this.layoutCanvas=Nu(this.options,null===(r=this.watermarkCanvas)||void 0===r?void 0:r.getCanvas()),this.options.dom.src=ku(this.layoutCanvas),null===(i=this.watermarkCanvas)||void 0===i||i.clear(),this.drew=!0,[2]}}))}))},t.prototype.destroy=function(){this.options.dom.src=this.originalSrc,this.drew=!1},t.prototype.getBackgroundImage=function(){if(this.options.dom)return this.options.dom},t}();exports.BlindWatermark=Uu,exports.ImageWatermark=Fu,exports.Watermark=Wu;
1
+ "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 v(){return a?o:(a=1,o=function(t){try{return!!t()}catch(t){return!0}})}function p(){if(u)return s;u=1;var t=v();return s=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function y(){if(l)return c;l=1;var t=v();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,W,U,F,M,G,q,z,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(_)return R;_=1;var t=function(){if(T)return E;T=1;var t=st(),e=v(),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 R=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 vt(){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 pt(){if(U)return W;U=1;var t=st();return W=t({}.isPrototypeOf)}function yt(){if(M)return F;M=1;var t=i().navigator,e=t&&t.userAgent;return F=e?String(e):""}function mt(){if(q)return G;q=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]),G=e}function gt(){if(V)return z;V=1;var t=mt(),e=v(),n=i().String;return z=!!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=vt(),e=ft(),n=pt(),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,Rt,_t,Lt,Dt,It,Bt,Ht,Nt,Wt,Ut,Ft,Mt,Gt,qt,zt,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.40.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$t.exports}function Qt(){if(Rt)return jt;Rt=1;var t=Zt();return jt=function(e,n){return t[e]||(t[e]=n||{})}}function te(){if(Lt)return _t;Lt=1;var t=lt(),e=Object;return _t=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..toString);return Bt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function re(){if(Wt)return Nt;Wt=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 Ut;Ft=1;var t=m(),e=ht(),n=bt(),r=Ot(),i=Pt(),o=re(),a=TypeError,s=o("toPrimitive");return Ut=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(Gt)return Mt;Gt=1;var t=ie(),e=bt();return Mt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function ae(){if(zt)return qt;zt=1;var t=i(),e=ht(),n=t.document,r=e(n)&&e(n.createElement);return qt=function(t){return r?n.createElement(t):{}}}function se(){if(Xt)return Vt;Xt=1;var t=p(),e=v(),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=p(),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,ve,pe,ye={};function me(){if(le)return ce;le=1;var t=p(),e=v();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=p(),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(pe)return ve;pe=1;var t=p(),e=we(),n=at();return ve=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,Re,_e,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 We(){return je?Ae:(je=1,Ae={})}function Ue(){if(_e)return Re;_e=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=We(),f="Object already initialized",h=o.TypeError,v=o.WeakMap;if(r||c.state){var p=c.state||(c.state=new v);p.get=p.get,p.has=p.has,p.set=p.set,t=function(t,e){if(p.has(t))throw new h(f);return e.facade=t,p.set(t,e),e},e=function(t){return p.get(t)||{}},n=function(t){return p.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 Re={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=v(),n=ft(),r=ee(),i=p(),o=function(){if(Se)return xe;Se=1;var t=p(),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=Ue(),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 Me(){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 Ge,qe,ze,Ve,Xe,Ye,$e,Ke,Je,Ze,Qe,tn,en,nn,rn,on,an,sn={};function un(){if(Ve)return ze;Ve=1;var t=function(){if(qe)return Ge;qe=1;var t=Math.ceil,e=Math.floor;return Ge=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return ze=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=We(),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 vn(){return on?rn:(on=1,rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var pn,yn,mn,gn,wn,bn,xn,Sn,On,Pn,En,Tn,kn,Cn,An,jn,Rn,_n,Ln,Dn,In,Bn,Hn,Nn,Wn,Un,Fn,Mn,Gn,qn,zn,Vn,Xn,Yn,$n,Kn,Jn,Zn,Qn={};function tr(){if(mn)return yn;mn=1;var t=vt(),e=st(),n=function(){if(an)return sn;an=1;var t=hn(),e=vn().concat("length","prototype");return sn.f=Object.getOwnPropertyNames||function(n){return t(n,e)},sn}(),r=(pn||(pn=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;l<s.length;l++){var d=s[l];t(i,d)||a&&t(a,d)||u(i,d,c(o,d))}}}function nr(){if(xn)return bn;xn=1;var t=v(),e=ft(),n=/#|\.prototype\./,r=function(n,r){var u=o[i(n)];return u===s||u!==a&&(e(r)?t(r):!!r)},i=r.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return bn=r}function rr(){if(On)return Sn;On=1;var t=i(),e=ue().f,n=be(),r=Me(),o=Jt(),a=er(),s=nr();return Sn=function(i,u){var c,l,d,f,h,v=i.target,p=i.global,y=i.stat;if(c=p?t:y?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in u){if(f=u[l],d=i.dontCallGetSet?(h=e(c,l))&&h.value:c[l],!s(p?l:v+(y?".":"#")+l,i.forced)&&void 0!==d){if(typeof f==typeof d)continue;a(f,d)}(i.sham||d&&d.sham)&&n(f,"sham",!0),r(c,l,f,i)}}}function ir(){if(kn)return Tn;kn=1;var t=function(){if(En)return Pn;En=1;var t=ut(),e=st();return Pn=function(n){if("Function"===t(n))return e(n)}}(),e=St(),n=y(),r=t(t.bind);return Tn=function(t,i){return e(t),void 0===i?t:n?r(t,i):function(){return t.apply(i,arguments)}},Tn}function or(){if(An)return Cn;An=1;var t=m(),e=ge(),n=Ot();return Cn=function(r,i,o){var a,s;e(r);try{if(!(a=n(r,"return"))){if("throw"===i)throw o;return o}a=t(a,r)}catch(t){s=!0,a=t}if("throw"===i)throw o;if(s)throw a;return e(a),o}}function ar(){if(Rn)return jn;Rn=1;var t=ge(),e=or();return jn=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(t){e(n,"throw",t)}}}function sr(){return Ln?_n:(Ln=1,_n={})}function ur(){if(In)return Dn;In=1;var t=re(),e=sr(),n=t("iterator"),r=Array.prototype;return Dn=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}function cr(){if(Wn)return Nn;Wn=1;var t=function(){if(Hn)return Bn;Hn=1;var t={};return t[re()("toStringTag")]="z",Bn="[object z]"===String(t)}(),e=ft(),n=ut(),r=re()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Nn=t?n:function(t){var a,s,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(s=function(t,e){try{return t[e]}catch(t){}}(a=i(t),r))?s:o?n(a):"Object"===(u=n(a))&&e(a.callee)?"Arguments":u}}function lr(){if(Fn)return Un;Fn=1;var t=st(),e=v(),n=ft(),r=cr(),i=vt(),o=He(),a=function(){},s=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=t(u.exec),l=!u.test(a),d=function(t){if(!n(t))return!1;try{return s(a,[],t),!0}catch(t){return!1}},f=function(t){if(!n(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,o(t))}catch(t){return!0}};return f.sham=!0,Un=!s||e((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?f:d}function dr(){if(Gn)return Mn;Gn=1;var t=p(),e=we(),n=at();return Mn=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o}}function fr(){if(zn)return qn;zn=1;var t=cr(),e=Ot(),n=ct(),r=sr(),i=re()("iterator");return qn=function(o){if(!n(o))return e(o,i)||e(o,"@@iterator")||r[t(o)]}}function hr(){if(Xn)return Vn;Xn=1;var t=m(),e=St(),n=ge(),r=xt(),i=fr(),o=TypeError;return Vn=function(a,s){var u=arguments.length<2?i(a):s;if(e(u))return n(t(u,a));throw new o(r(a)+" is not iterable")},Vn}function vr(){if(Jn)return Kn;Jn=1;var t=re()("iterator"),e=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){e=!0}};r[t]=function(){return this},Array.from(r,(function(){throw 2}))}catch(t){}return Kn=function(n,r){try{if(!r&&!e)return!1}catch(t){return!1}var i=!1;try{var o={};o[t]=function(){return{next:function(){return{done:i=!0}}}},n(o)}catch(t){}return i}}!function(){if(Zn)return r;Zn=1;var t=rr(),e=function(){if($n)return Yn;$n=1;var t=ir(),e=m(),n=te(),r=ar(),i=ur(),o=lr(),a=dn(),s=dr(),u=hr(),c=fr(),l=Array;return Yn=function(d){var f=n(d),h=o(this),v=arguments.length,p=v>1?arguments[1]:void 0,y=void 0!==p;y&&(p=t(p,v>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?p(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,p,[w.value,P],!0):w.value,s(g,P,S);return g.length=P,g},Yn}();t({target:"Array",stat:!0,forced:!vr()((function(t){Array.from(t)}))},{from:e})}();var pr,yr,mr,gr,wr,br,xr,Sr,Or,Pr,Er,Tr,kr,Cr,Ar,jr,Rr,_r,Lr,Dr,Ir,Br,Hr,Nr,Wr,Ur,Fr,Mr,Gr,qr,zr,Vr,Xr,Yr,$r,Kr,Jr,Zr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,di,fi,hi,vi,pi={};function yi(){if(yr)return pr;yr=1;var t=i(),e=yt(),n=ut(),r=function(t){return e.slice(0,t.length)===t};return pr=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 mi(){if(gr)return mr;gr=1;var t=yi();return mr="NODE"===t}function gi(){if(Sr)return xr;Sr=1;var t=ht();return xr=function(e){return t(e)||null===e}}function wi(){if(Pr)return Or;Pr=1;var t=gi(),e=String,n=TypeError;return Or=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function bi(){if(Tr)return Er;Tr=1;var t=function(){if(br)return wr;br=1;var t=st(),e=St();return wr=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(t){}}}(),e=ht(),n=lt(),r=wi();return Er=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 xi(){if(Cr)return kr;Cr=1;var t=we().f,e=ee(),n=re()("toStringTag");return kr=function(r,i,o){r&&!o&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:i})}}function Si(){if(jr)return Ar;jr=1;var t=Fe(),e=we();return Ar=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 Oi(){if(_r)return Rr;_r=1;var t=vt(),e=Si(),n=re(),r=p(),i=n("species");return Rr=function(n){var o=t(n);r&&o&&!o[i]&&e(o,i,{configurable:!0,get:function(){return this}})}}function Pi(){if(Dr)return Lr;Dr=1;var t=pt(),e=TypeError;return Lr=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function Ei(){if(Br)return Ir;Br=1;var t=lr(),e=xt(),n=TypeError;return Ir=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Ti(){if(Nr)return Hr;Nr=1;var t=ge(),e=Ei(),n=ct(),r=re()("species");return Hr=function(i,o){var a,s=t(i).constructor;return void 0===s||n(a=t(s)[r])?o:e(a)}}function ki(){if(Ur)return Wr;Ur=1;var t=y(),e=Function.prototype,n=e.apply,r=e.call;return Wr="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Wr}function Ci(){if(Mr)return Fr;Mr=1;var t=vt();return Fr=t("document","documentElement")}function Ai(){if(qr)return Gr;qr=1;var t=st();return Gr=t([].slice)}function ji(){if(Vr)return zr;Vr=1;var t=TypeError;return zr=function(e,n){if(e<n)throw new t("Not enough arguments");return e}}function Ri(){if(Yr)return Xr;Yr=1;var t=yt();return Xr=/(?:ipad|iphone|ipod).*applewebkit/i.test(t)}function _i(){if(Kr)return $r;Kr=1;var t,e,n,r,o=i(),a=ki(),s=ir(),u=ft(),c=ee(),l=v(),d=Ci(),f=Ai(),h=ae(),p=ji(),y=Ri(),m=mi(),g=o.setImmediate,w=o.clearImmediate,b=o.process,x=o.Dispatch,S=o.Function,O=o.MessageChannel,P=o.String,E=0,T={},k="onreadystatechange";l((function(){t=o.location}));var C=function(t){if(c(T,t)){var e=T[t];delete T[t],e()}},A=function(t){return function(){C(t)}},j=function(t){C(t.data)},R=function(e){o.postMessage(P(e),t.protocol+"//"+t.host)};return g&&w||(g=function(t){p(arguments.length,1);var n=u(t)?t:S(t),r=f(arguments,1);return T[++E]=function(){a(n,void 0,r)},e(E),E},w=function(t){delete T[t]},m?e=function(t){b.nextTick(A(t))}:x&&x.now?e=function(t){x.now(A(t))}:O&&!y?(r=(n=new O).port2,n.port1.onmessage=j,e=s(r.postMessage,r)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&t&&"file:"!==t.protocol&&!l(R)?(e=R,o.addEventListener("message",j,!1)):e=k in h("script")?function(t){d.appendChild(h("script"))[k]=function(){d.removeChild(this),C(t)}}:function(t){setTimeout(A(t),0)}),$r={set:g,clear:w}}function Li(){if(Zr)return Jr;Zr=1;var t=i(),e=p(),n=Object.getOwnPropertyDescriptor;return Jr=function(r){if(!e)return t[r];var i=n(t,r);return i&&i.value}}function Di(){if(ti)return Qr;ti=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},Qr=t}function Ii(){if(ai)return oi;ai=1;var t,e,n,r,o,a=i(),s=Li(),u=ir(),c=_i().set,l=Di(),d=Ri(),f=function(){if(ni)return ei;ni=1;var t=yt();return ei=/ipad|iphone|ipod/i.test(t)&&"undefined"!=typeof Pebble}(),h=function(){if(ii)return ri;ii=1;var t=yt();return ri=/web0s(?!.*chrome)/i.test(t)}(),v=mi(),p=a.MutationObserver||a.WebKitMutationObserver,y=a.document,m=a.process,g=a.Promise,w=s("queueMicrotask");if(!w){var b=new l,x=function(){var e,n;for(v&&(e=m.domain)&&e.exit();n=b.get();)try{n()}catch(e){throw b.head&&t(),e}e&&e.enter()};d||v||h||!p||!y?!f&&g&&g.resolve?((r=g.resolve(void 0)).constructor=g,o=u(r.then,r),t=function(){o(x)}):v?t=function(){m.nextTick(x)}:(c=u(c,a),t=function(){c(x)}):(e=!0,n=y.createTextNode(""),new p(x).observe(n,{characterData:!0}),t=function(){n.data=e=!e}),w=function(e){b.head||t(),b.add(e)}}return oi=w}function Bi(){return ui?si:(ui=1,si=function(t,e){})}function Hi(){return li?ci:(li=1,ci=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}})}function Ni(){if(fi)return di;fi=1;var t=i();return di=t.Promise}function Wi(){if(vi)return hi;vi=1;var t=i(),e=Ni(),n=ft(),r=nr(),o=He(),a=re(),s=yi(),u=Kt(),c=mt(),l=e&&e.prototype,d=a("species"),f=!1,h=n(t.PromiseRejectionEvent),v=r("Promise",(function(){var t=o(e),n=t!==String(e);if(!n&&66===c)return!0;if(u&&(!l.catch||!l.finally))return!0;if(!c||c<51||!/native code/.test(t)){var r=new e((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[d]=i,!(f=r.then((function(){}))instanceof i))return!0}return!(n||"BROWSER"!==s&&"DENO"!==s||h)}));return hi={CONSTRUCTOR:v,REJECTION_EVENT:h,SUBCLASSING:f}}var Ui,Fi,Mi={};function Gi(){if(Ui)return Mi;Ui=1;var t=St(),e=TypeError,n=function(n){var r,i;this.promise=new n((function(t,n){if(void 0!==r||void 0!==i)throw new e("Bad Promise constructor");r=t,i=n})),this.resolve=t(r),this.reject=t(i)};return Mi.f=function(t){return new n(t)},Mi}var qi,zi,Vi,Xi,Yi,$i={};function Ki(){if(zi)return qi;zi=1;var t=ir(),e=m(),n=ge(),r=xt(),i=ur(),o=dn(),a=pt(),s=hr(),u=fr(),c=or(),l=TypeError,d=function(t,e){this.stopped=t,this.result=e},f=d.prototype;return qi=function(h,v,p){var y,m,g,w,b,x,S,O=p&&p.that,P=!(!p||!p.AS_ENTRIES),E=!(!p||!p.IS_RECORD),T=!(!p||!p.IS_ITERATOR),k=!(!p||!p.INTERRUPTED),C=t(v,O),A=function(t){return y&&c(y,"normal",t),new d(!0,t)},j=function(t){return P?(n(t),k?C(t[0],t[1],A):C(t[0],t[1])):k?C(t,A):C(t)};if(E)y=h.iterator;else if(T)y=h;else{if(!(m=u(h)))throw new l(r(h)+" is not iterable");if(i(m)){for(g=0,w=o(h);w>g;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 Ji(){if(Xi)return Vi;Xi=1;var t=Ni(),e=vr(),n=Wi().CONSTRUCTOR;return Vi=n||!e((function(e){t.all(e).then(void 0,(function(){}))}))}var Zi,Qi={};var to,eo={};var no,ro={};var io,oo,ao,so,uo={};function co(){if(oo)return io;oo=1;var t=ge(),e=ht(),n=Gi();return io=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}}so||(so=1,function(){if(Fi)return pi;Fi=1;var t,e,n,r=rr(),o=Kt(),a=mi(),s=i(),u=m(),c=Me(),l=bi(),d=xi(),f=Oi(),h=St(),v=ft(),p=ht(),y=Pi(),g=Ti(),w=_i().set,b=Ii(),x=Bi(),S=Hi(),O=Di(),P=Ue(),E=Ni(),T=Wi(),k=Gi(),C="Promise",A=T.CONSTRUCTOR,j=T.REJECTION_EVENT,R=T.SUBCLASSING,_=P.getterFor(C),L=P.set,D=E&&E.prototype,I=E,B=D,H=s.TypeError,N=s.document,W=s.process,U=k.f,F=U,M=!!(N&&N.createEvent&&s.dispatchEvent),G="unhandledrejection",q=function(t){var e;return!(!p(t)||!v(e=t.then))&&e},z=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,c=t.resolve,l=t.reject,d=t.domain;try{s?(a||(2===e.rejection&&K(e),e.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===t.promise?l(new H("Promise-chain cycle")):(r=q(n))?u(r,n,c,l):c(n)):l(o)}catch(t){d&&!i&&d.exit(),l(t)}},V=function(t,e){t.notified||(t.notified=!0,b((function(){for(var n,r=t.reactions;n=r.get();)z(n,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},X=function(t,e,n){var r,i;M?((r=N.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:e,reason:n},!j&&(i=s["on"+t])?i(r):t===G&&x("Unhandled promise rejection",n)},Y=function(t){u(w,s,(function(){var e,n=t.facade,r=t.value;if($(t)&&(e=S((function(){a?W.emit("unhandledRejection",r,n):X(G,n,r)})),t.rejection=a||$(t)?2:1,e.error))throw e.value}))},$=function(t){return 1!==t.rejection&&!t.parent},K=function(t){u(w,s,(function(){var e=t.facade;a?W.emit("rejectionHandled",e):X("rejectionhandled",e,t.value)}))},J=function(t,e,n){return function(r){t(e,r,n)}},Z=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,V(t,!0))},Q=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new H("Promise can't be resolved itself");var r=q(e);r?b((function(){var n={done:!1};try{u(r,e,J(Q,n,t),J(Z,n,t))}catch(e){Z(n,e,t)}})):(t.value=e,t.state=1,V(t,!1))}catch(e){Z({done:!1},e,t)}}};if(A&&(B=(I=function(e){y(this,B),h(e),u(t,this);var n=_(this);try{e(J(Q,n),J(Z,n))}catch(t){Z(n,t)}}).prototype,(t=function(t){L(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new O,rejection:!1,state:0,value:null})}).prototype=c(B,"then",(function(t,e){var n=_(this),r=U(g(this,I));return n.parent=!0,r.ok=!v(t)||t,r.fail=v(e)&&e,r.domain=a?W.domain:void 0,0===n.state?n.reactions.add(r):b((function(){z(r,n)})),r.promise})),e=function(){var e=new t,n=_(e);this.promise=e,this.resolve=J(Q,n),this.reject=J(Z,n)},k.f=U=function(t){return t===I||void 0===t?new e(t):F(t)},!o&&v(E)&&D!==Object.prototype)){n=D.then,R||c(D,"then",(function(t,e){var r=this;return new I((function(t,e){u(n,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete D.constructor}catch(t){}l&&l(D,B)}r({global:!0,constructor:!0,wrap:!0,forced:A},{Promise:I}),d(I,C,!1,!0),f(C)}(),function(){if(Yi)return $i;Yi=1;var t=rr(),e=m(),n=St(),r=Gi(),i=Hi(),o=Ki();t({target:"Promise",stat:!0,forced:Ji()},{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(Zi)return Qi;Zi=1;var t=rr(),e=Kt(),n=Wi().CONSTRUCTOR,r=Ni(),i=vt(),o=ft(),a=Me(),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(to)return eo;to=1;var t=rr(),e=m(),n=St(),r=Gi(),i=Hi(),o=Ki();t({target:"Promise",stat:!0,forced:Ji()},{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(no)return ro;no=1;var t=rr(),e=Gi();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(ao)return uo;ao=1;var t=rr(),e=vt(),n=Kt(),r=Ni(),i=Wi().CONSTRUCTOR,o=co(),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 lo,fo,ho,vo,po,yo,mo,go,wo={},bo={};function xo(){if(fo)return lo;fo=1;var t=hn(),e=vn();return lo=Object.keys||function(n){return t(n,e)}}function So(){if(po)return vo;po=1;var t,e=ge(),n=function(){if(ho)return bo;ho=1;var t=p(),e=me(),n=we(),r=ge(),i=dt(),o=xo();return bo.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},bo}(),r=vn(),i=We(),o=Ci(),a=ae(),s=Ne(),u="prototype",c="script",l=s("IE_PROTO"),d=function(){},f=function(t){return"<"+c+">"+t+"</"+c+">"},h=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;v="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 v[u][r[s]];return v()};return i[l]=!0,vo=Object.create||function(t,r){var i;return null!==t?(d[u]=e(t),i=new d,d[u]=null,i[l]=t):i=v(),void 0===r?i:n.f(i,r)}}function Oo(){if(mo)return yo;mo=1;var t=re(),e=So(),n=we().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),yo=function(t){i[r][t]=!0}}!function(){if(go)return wo;go=1;var t=rr(),e=fn().includes,n=v(),r=Oo();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 Po,Eo,To,ko={};!function(){if(To)return ko;To=1;var t=rr(),e=function(){if(Eo)return Po;Eo=1;var t=te(),e=cn(),n=dn();return Po=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},Po}(),n=Oo();t({target:"Array",proto:!0},{fill:e}),n("fill")}();var Co="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Ao="URLSearchParams"in Co,jo="Symbol"in Co&&"iterator"in Symbol,Ro="FileReader"in Co&&"Blob"in Co&&function(){try{return new Blob,!0}catch(t){return!1}}(),_o="FormData"in Co,Lo="ArrayBuffer"in Co;if(Lo)var Do=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Io=ArrayBuffer.isView||function(t){return t&&Do.indexOf(Object.prototype.toString.call(t))>-1};function Bo(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 Ho(t){return"string"!=typeof t&&(t=String(t)),t}function No(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return jo&&(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 Uo(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function Fo(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function Mo(t){var e=new FileReader,n=Fo(e);return e.readAsArrayBuffer(t),n}function Go(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function qo(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Ro&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:_o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Ao&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Lo&&Ro&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Go(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Lo&&(ArrayBuffer.prototype.isPrototypeOf(t)||Io(t))?this._bodyArrayBuffer=Go(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):Ao&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ro&&(this.blob=function(){var t=Uo(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=Uo(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(Ro)return this.blob().then(Mo);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,o=Uo(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=Fo(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<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},_o&&(this.formData=function(){return this.text().then(Xo)}),this.json=function(){return this.text().then(JSON.parse)},this}Wo.prototype.append=function(t,e){t=Bo(t),e=Ho(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},Wo.prototype.delete=function(t){delete this.map[Bo(t)]},Wo.prototype.get=function(t){return t=Bo(t),this.has(t)?this.map[t]:null},Wo.prototype.has=function(t){return this.map.hasOwnProperty(Bo(t))},Wo.prototype.set=function(t,e){this.map[Bo(t)]=Ho(e)},Wo.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},Wo.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),No(t)},Wo.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),No(t)},Wo.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),No(t)},jo&&(Wo.prototype[Symbol.iterator]=Wo.prototype.entries);var zo=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Vo(t,e){if(!(this instanceof Vo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(e=e||{}).body;if(t instanceof Vo){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Wo(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Wo(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),zo.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Co)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 Xo(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 Yo(t,e){if(!(this instanceof Yo))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)}Vo.prototype.clone=function(){return new Vo(this,{body:this._bodyInit})},qo.call(Vo.prototype),qo.call(Yo.prototype),Yo.prototype.clone=function(){return new Yo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Wo(this.headers),url:this.url})},Yo.error=function(){var t=new Yo(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var $o=[301,302,303,307,308];Yo.redirect=function(t,e){if(-1===$o.indexOf(e))throw new RangeError("Invalid status code");return new Yo(null,{status:e,headers:{location:t}})};var Ko=Co.DOMException;try{new Ko}catch(t){(Ko=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),Ko.prototype.constructor=Ko}function Jo(t,e){return new Promise((function(n,r){var i=new Vo(t,e);if(i.signal&&i.signal.aborted)return r(new Ko("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 Yo(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 Ko("Aborted","AbortError"))}),0)},o.open(i.method,function(t){try{return""===t&&Co.location.href?Co.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&&(Ro?o.responseType="blob":Lo&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Wo||Co.Headers&&e.headers instanceof Co.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(Bo(t)),o.setRequestHeader(t,Ho(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)}))}Jo.polyfill=!0,Co.fetch||(Co.fetch=Jo,Co.Headers=Wo,Co.Request=Vo,Co.Response=Yo),"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:0 0}75%{background-position:100% -100%}to{background-position:0 0}}");var Zo=function(t,e){return Zo=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])},Zo(t,e)};var Qo=function(){return Qo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Qo.apply(this,arguments)};function ta(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function ea(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var na=function(t){return t.toDataURL("image/png",1)},ra=function(t){return"function"==typeof t},ia=function(t){return void 0===t},oa=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n="http://www.w3.org/2000/svg");var r=document.createElementNS(n,t);for(var i in e)r.setAttribute(i,e[i]);return r},aa=function(t,e){return ta(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l;return ea(this,(function(d){switch(d.label){case 0:return n=oa("svg",{xmlns:"http://www.w3.org/2000/svg"}),(r=document.createElement("div")).setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.cssText="\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font: ".concat(t.font,";\n color: ").concat(e.fontColor,";\n"),r.innerHTML="<div class='rich-text-content'>".concat(e.content,"</div>"),document.body.appendChild(r),[4,sa(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=oa("foreignObject",{width:s.toString(),height:u.toString()})).appendChild(r),n.appendChild(c),[2,{element:n,width:s,height:u}]}}))}))};function sa(t){return ta(this,void 0,void 0,(function(){var e,n,r,i,o;return ea(this,(function(a){switch(a.label){case 0:e=t.querySelectorAll("img"),n=function(t){var e,n,r,i;return ea(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 r<i.length?(o=i[r],[5,n(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))}var ua=function(t,e){return ia(t)?e:t},ca=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=void 0);var r=new Image;return r.setAttribute("crossOrigin","Anonymous"),!ia(e)&&(r.width=e),!ia(n)&&(r.height=n),r.src=t,new Promise((function(t){r.onload=function(){t(r)}}))},la={width:300,height:300,rotate:45,layout:"default",auxiliaryLine:!1,translatePlacement:"middle",contentType:"text",content:"hello watermark-js-plus",textType:"fill",imageWidth:0,imageHeight:0,lineHeight:30,zIndex:2147483647,backgroundPosition:"0 0",backgroundRepeat:"repeat",fontSize:"20px",fontFamily:"sans-serif",fontStyle:"",fontVariant:"",fontColor:"#000",fontWeight:"normal",filter:"none",letterSpacing:"0px",wordSpacing:"0px",globalAlpha:.5,mode:"default",mutationObserve:!0,monitorProtection:!1,movable:!1,parent:"body",onSuccess:function(){},onBeforeDestroy:function(){},onDestroyed:function(){},onObserveError:function(){}},da=function(t){"undefined"!=typeof window&&t&&(Object.defineProperty(window,"MutationObserver",{writable:!1,configurable:!1}),Object.defineProperty(window,"requestAnimationFrame",{writable:!1,configurable:!1}))},fa=function(){function t(e,n){this.props=e,this.options=n,this.canvas=t.createCanvas(this.options.width,this.options.height),this.recommendOptions=function(t,e,n){var r=t.getContext("2d");if(null===r)throw new Error("get context error");r.font="".concat(e.fontStyle," ").concat(e.fontVariant," ").concat(e.fontWeight," ").concat(e.fontSize," ").concat(e.fontFamily),r.filter=e.filter,r.letterSpacing=e.letterSpacing,r.wordSpacing=e.wordSpacing,(null==e?void 0:e.rotate)&&(e.rotate=(360-e.rotate%360)*(Math.PI/180)),ia(n.textRowMaxWidth)&&(e.textRowMaxWidth=e.width);var i={image:{rect:{width:e.imageWidth,height:e.imageHeight},position:{x:0,y:0}},textLine:{data:[],yOffsetValue:0},advancedStyleParams:{linear:{x0:0,x1:0},radial:{x0:0,y0:0,r0:0,x1:0,y1:0,r1:0},conic:{x:0,y:0,startAngle:0},pattern:{}}};switch(e.contentType){case"text":i.textLine.data=[e.content];break;case"multi-line-text":i.textLine.data=function(t,e,n){for(var r=[],i="",o="",a=0,s=e.length;a<s;a++)"\n"!==(o=e.charAt(a))?(i+=o,t.measureText(i).width>n&&(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(ia(null==n?void 0:n.translateX)||ia(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,ia(null==n?void 0:n.textBaseline)&&(e.textBaseline=s),ia(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=ua(this.options.shadowStyle.shadowBlur,0),t.shadowColor=ua(this.options.shadowStyle.shadowColor,"#00000000"),t.shadowOffsetX=ua(this.options.shadowStyle.shadowOffsetX,0),t.shadowOffsetY=ua(this.options.shadowStyle.shadowOffsetY,0)),ra(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,v,p,y=t.createLinearGradient(ua(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),ua(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),ua(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),ua(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===(p=null===(v=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===v?void 0:v.colorStops)||void 0===p||p.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,v,p,y=t.createConicGradient(ua(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),ua(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),ua(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===(p=null===(v=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===v?void 0:v.colorStops)||void 0===p||p.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,v,p,y,m,g,w,b,x,S,O,P,E,T,k,C=t.createRadialGradient(ua(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),ua(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),ua(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),ua(null===(y=null===(p=null===(v=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===v?void 0:v.params)||void 0===p?void 0:p.radial)||void 0===y?void 0:y.x1,this.recommendOptions.advancedStyleParams.radial.x1),ua(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),ua(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;ca(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 ta(this,void 0,void 0,(function(){var n,r=this;return ea(this,(function(i){switch(i.label){case 0:return[4,aa(t,this.options)];case 1:return n=i.sent(),ca((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!ia(null===(n=this.props)||void 0===n?void 0:n.translateX)&&(i.x=0),!ia(null===(r=this.props)||void 0===r?void 0:r.translateY)&&(i.y=0),i},t}(),ha=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=fa.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;l<this.rows;l++)for(var d=0;d<this.cols;d++)(null===(s=null===(a=this.matrix)||void 0===a?void 0:a[l])||void 0===s?void 0:s[d])&&(null==c||c.drawImage(this.partialCanvas,this.partialWidth*d+this.gap[0]*d,this.partialHeight*l+this.gap[1]*l,this.partialWidth,this.partialHeight));return u},t}(),va=function(t,e){return"grid"===t.layout?new ha(t,e).draw():e},pa=function(){function t(t){void 0===t&&(t={}),this.parentElement=document.body,this.isCreating=!1,this.props=t,this.options=Qo(Qo({},la),t),this.changeParentElement(this.options.parent),this.watermarkCanvas=new fa(this.props,this.options),da(this.options.monitorProtection)}return t.prototype.changeOptions=function(){return ta(this,arguments,void 0,(function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),ea(this,(function(r){switch(r.label){case 0:return this.initConfigData(t,e),da(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.create=function(){return ta(this,void 0,void 0,(function(){var t,e,n,r,i,o,a,s,u,c,l,d;return ea(this,(function(f){switch(f.label){case 0:return this.isCreating?[2]:(this.isCreating=!0,this.validateUnique()&&this.validateContent()?(t=ia(this.watermarkDom),[4,null===(o=this.watermarkCanvas)||void 0===o?void 0:o.draw()]):(this.isCreating=!1,[2]));case 1:if(f.sent(),this.layoutCanvas=va(this.options,null===(a=this.watermarkCanvas)||void 0===a?void 0:a.getCanvas()),e=na(this.layoutCanvas),null===(s=this.watermarkCanvas)||void 0===s||s.clear(),this.watermarkDom=document.createElement("div"),n=document.createElement("div"),this.watermarkDom.__WATERMARK__="watermark",this.watermarkDom.__WATERMARK__INSTANCE__=this,r=this.checkParentElementType(),this.watermarkDom.style.cssText="\n z-index:".concat(this.options.zIndex,"!important;display:block!important;visibility:visible!important;transform:none!important;scale:none!important;\n ").concat("custom"===r?"top:0!important;bottom:0!important;left:0!important;right:0!important;height:100%!important;pointer-events:none!important;position:absolute!important;":"position:relative!important;","\n "),i=function(t){var e,n,r;if("grid"===t.layout){var i=(null===(e=t.gridLayoutOptions)||void 0===e?void 0:e.cols)||1,o=(null===(n=t.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,a=(null===(r=t.gridLayoutOptions)||void 0===r?void 0:r.gap)||[0,0];return[t.width*i+a[0]*i,t.height*o+a[1]*o]}return[t.width,t.height]}(this.options),n.style.cssText="\n display:block!important;visibility:visible!important;pointer-events:none;top:0;bottom:0;left:0;right:0;transform:none!important;scale:none!important;\n position:".concat("root"===r?"fixed":"absolute","!important;-webkit-print-color-adjust:exact!important;width:100%!important;height:100%!important;\n z-index:").concat(this.options.zIndex,"!important;background-image:url(").concat(e,")!important;background-repeat:").concat(this.options.backgroundRepeat,"!important;\n background-size:").concat(i[0],"px ").concat(i[1],"px!important;background-position:").concat(this.options.backgroundPosition,";\n ").concat(this.options.movable?"animation: 200s ease 0s infinite normal none running watermark !important;":"","\n "),this.watermarkDom.appendChild(n),this.parentElement.appendChild(this.watermarkDom),this.options.mutationObserve)try{this.bindMutationObserve()}catch(t){null===(c=(u=this.options).onObserveError)||void 0===c||c.call(u)}return t&&(null===(d=(l=this.options).onSuccess)||void 0===d||d.call(l)),this.isCreating=!1,[2]}}))}))},t.prototype.destroy=function(){this.remove(),this.watermarkDom=void 0},t.prototype.check=function(){return ta(this,void 0,void 0,(function(){return ea(this,(function(t){return[2,this.parentElement.contains(this.watermarkDom)]}))}))},t.prototype.remove=function(){var t,e,n,r,i,o,a,s;null===(e=(t=this.options).onBeforeDestroy)||void 0===e||e.call(t),null===(n=this.observer)||void 0===n||n.disconnect(),null===(r=this.parentObserve)||void 0===r||r.disconnect(),this.unbindCheckWatermarkElementEvent(),null===(o=null===(i=this.watermarkDom)||void 0===i?void 0:i.parentNode)||void 0===o||o.removeChild(this.watermarkDom),null===(s=(a=this.options).onDestroyed)||void 0===s||s.call(a)},t.prototype.initConfigData=function(t,e){var n=this;void 0===e&&(e="overwrite"),"append"===e?Object.keys(t).forEach((function(e){n.props&&(n.props[e]=t[e])})):this.props=t,this.options=Qo(Qo({},la),this.props),this.changeParentElement(this.options.parent),this.watermarkCanvas=new fa(this.props,this.options)},t.prototype.changeParentElement=function(t){if("string"==typeof t){var e=document.querySelector(t);e&&(this.parentElement=e)}else this.parentElement=t;this.parentElement||console.error("[WatermarkJsPlus]: please pass a valid parent element.")},t.prototype.validateUnique=function(){var t=!0;return Array.from(this.parentElement.childNodes).forEach((function(e){t&&Object.hasOwnProperty.call(e,"__WATERMARK__")&&(t=!1)})),t},t.prototype.validateContent=function(){switch(this.options.contentType){case"image":return Object.hasOwnProperty.call(this.options,"image");case"multi-line-text":case"rich-text":case"text":return this.options.content.length>0}},t.prototype.checkParentElementType=function(){return["html","body"].includes(this.parentElement.tagName.toLocaleLowerCase())?"root":"custom"},t.prototype.checkWatermarkElement=function(){return ta(this,void 0,void 0,(function(){return ea(this,(function(t){switch(t.label){case 0:return this.parentElement.contains(this.watermarkDom)?[3,2]:(this.remove(),[4,this.create()]);case 1:t.sent(),t.label=2;case 2:return this.bindCheckWatermarkElementEvent(),[2]}}))}))},t.prototype.bindMutationObserve=function(){var t=this;this.watermarkDom&&(this.bindCheckWatermarkElementEvent(),this.observer=new MutationObserver((function(e){return ta(t,void 0,void 0,(function(){return ea(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 ta(t,void 0,void 0,(function(){var t,n,r,i;return ea(this,(function(o){switch(o.label){case 0:t=0,n=e,o.label=1;case 1:return t<n.length?(null==(r=n[t])?void 0:r.target)===this.watermarkDom||(null===(i=null==r?void 0:r.removedNodes)||void 0===i?void 0:i[0])===this.watermarkDom||"childList"===r.type&&r.target===this.parentElement&&r.target.lastChild!==this.watermarkDom?(this.remove(),[4,this.create()]):[3,3]:[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))})),this.parentObserve.observe(this.parentElement,{attributes:!0,childList:!0,subtree:!0,characterData:!0}))},t.prototype.bindCheckWatermarkElementEvent=function(){this.unbindCheckWatermarkElementEvent(),this.checkWatermarkElementRequestID=requestAnimationFrame(this.checkWatermarkElement.bind(this))},t.prototype.unbindCheckWatermarkElementEvent=function(){ia(this.checkWatermarkElementRequestID)||cancelAnimationFrame(this.checkWatermarkElementRequestID)},t}(),ya=function(t){function e(e){void 0===e&&(e={});return t.call(this,Qo(Qo({},e),{globalAlpha:.005,mode:"blind"}))||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Zo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.changeOptions=function(){return ta(this,arguments,void 0,(function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),ea(this,(function(r){switch(r.label){case 0:return t.globalAlpha=.005,t.mode="blind",this.initConfigData(t,e),da(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.decode=function(t){var e=t.url,n=void 0===e?"":e,r=t.fillColor,i=void 0===r?"#000":r,o=t.compositeOperation,a=void 0===o?"color-burn":o,s=t.mode,u=void 0===s?"canvas":s,c=t.compositeTimes,l=void 0===c?3:c,d=t.onSuccess;if(n&&"canvas"===u){var f=new Image;f.src=n,f.addEventListener("load",(function(){var t=f.width,e=f.height,n=fa.createCanvas(t,e),r=n.getContext("2d");if(!r)throw new Error("get context error");r.drawImage(f,0,0,t,e),r.globalCompositeOperation=a,r.fillStyle=i;for(var o=0;o<l;o++)r.fillRect(0,0,t,e);var s=na(n);ra(d)&&(null==d||d(s))}))}},e}(pa),ma=function(){function t(t){var e;void 0===t&&(t={}),this.drew=!1,this.props=t,this.options=Qo(Qo({},la),t),this.watermarkCanvas=new fa(this.props,this.options),this.originalSrc=null===(e=this.props.dom)||void 0===e?void 0:e.src,this.backgroundImage=this.getBackgroundImage()}return t.prototype.create=function(){return ta(this,void 0,void 0,(function(){var t,e,n,r,i;return ea(this,(function(o){switch(o.label){case 0:return this.drew?[2]:[4,null===(t=this.watermarkCanvas)||void 0===t?void 0:t.draw()];case 1:return o.sent(),this.options.layout="grid",this.options.gridLayoutOptions=Qo(Qo({},this.options.gridLayoutOptions),{width:null===(e=this.backgroundImage)||void 0===e?void 0:e.width,height:null===(n=this.backgroundImage)||void 0===n?void 0:n.height,backgroundImage:this.backgroundImage}),this.layoutCanvas=va(this.options,null===(r=this.watermarkCanvas)||void 0===r?void 0:r.getCanvas()),this.options.dom.src=na(this.layoutCanvas),null===(i=this.watermarkCanvas)||void 0===i||i.clear(),this.drew=!0,[2]}}))}))},t.prototype.destroy=function(){this.options.dom.src=this.originalSrc,this.drew=!1},t.prototype.getBackgroundImage=function(){if(this.options.dom)return this.options.dom},t}();exports.BlindWatermark=ya,exports.ImageWatermark=ma,exports.Watermark=pa;