@feliperohdee/satori 0.0.8 → 0.0.9

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.

Potentially problematic release.


This version of @feliperohdee/satori might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- var Xo=Object.defineProperty;var Gt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yo=(e,t)=>{for(var n in t)Xo(e,n,{get:t[n],enumerable:!0})};function Nr(e){e=e||{};var t;t||(t=typeof e<"u"?e:{});var n,o;t.ready=new Promise(function(s,l){n=s,o=l});var i=Object.assign({},t),r="";typeof document<"u"&&document.currentScript&&(r=document.currentScript.src),Wr&&(r=Wr),r.indexOf("blob:")!==0?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="";var a=t.print||console.log.bind(console),f=t.printErr||console.warn.bind(console);Object.assign(t,i),i=null;var u;t.wasmBinary&&(u=t.wasmBinary);var d=t.noExitRuntime||!0;typeof WebAssembly!="object"&&ae("no native wasm support detected");var c,p=!1;function g(s,l,m){m=l+m;for(var h="";!(l>=m);){var y=s[l++];if(!y)break;if(y&128){var w=s[l++]&63;if((y&224)==192)h+=String.fromCharCode((y&31)<<6|w);else{var k=s[l++]&63;y=(y&240)==224?(y&15)<<12|w<<6|k:(y&7)<<18|w<<12|k<<6|s[l++]&63,65536>y?h+=String.fromCharCode(y):(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023))}}else h+=String.fromCharCode(y)}return h}var b,x,E,A,N,P,v,S,R;function M(){var s=c.buffer;b=s,t.HEAP8=x=new Int8Array(s),t.HEAP16=A=new Int16Array(s),t.HEAP32=P=new Int32Array(s),t.HEAPU8=E=new Uint8Array(s),t.HEAPU16=N=new Uint16Array(s),t.HEAPU32=v=new Uint32Array(s),t.HEAPF32=S=new Float32Array(s),t.HEAPF64=R=new Float64Array(s)}var B,H=[],X=[],he=[];function le(){var s=t.preRun.shift();H.unshift(s)}var be=0,ie=null,ce=null;function ae(s){throw t.onAbort&&t.onAbort(s),s="Aborted("+s+")",f(s),p=!0,s=new WebAssembly.RuntimeError(s+". Build with -sASSERTIONS for more info."),o(s),s}function ke(s){return s.startsWith("data:application/octet-stream;base64,")}var Y="";if(!ke(Y)){var j=Y;Y=t.locateFile?t.locateFile(j,r):r+j}function Ie(){var s=Y;try{if(s==Y&&u)return new Uint8Array(u);if(ke(s))try{var l=Vo(s.slice(37)),m=new Uint8Array(l.length);for(s=0;s<l.length;++s)m[s]=l.charCodeAt(s);var h=m}catch{throw Error("Converting base64 string to bytes failed.")}else h=void 0;var y=h;if(y)return y;throw"both async and sync fetching of the wasm failed"}catch(w){ae(w)}}function De(){return u||typeof fetch!="function"?Promise.resolve().then(function(){return Ie()}):fetch(Y,{credentials:"same-origin"}).then(function(s){if(!s.ok)throw"failed to load wasm binary file at '"+Y+"'";return s.arrayBuffer()}).catch(function(){return Ie()})}function se(s){for(;0<s.length;)s.shift()(t)}function Se(s){if(s===void 0)return"_unknown";s=s.replace(/[^a-zA-Z0-9_]/g,"$");var l=s.charCodeAt(0);return 48<=l&&57>=l?"_"+s:s}function We(s,l){return s=Se(s),function(){return l.apply(this,arguments)}}var W=[{},{value:void 0},{value:null},{value:!0},{value:!1}],ne=[];function U(s){var l=Error,m=We(s,function(h){this.name=s,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
2
- `+h.replace(/^Error(:[^\n]*)?\n/,""))});return m.prototype=Object.create(l.prototype),m.prototype.constructor=m,m.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},m}var re=void 0;function O(s){throw new re(s)}var oe=s=>(s||O("Cannot use deleted val. handle = "+s),W[s].value),fe=s=>{switch(s){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var l=ne.length?ne.pop():W.length;return W[l]={ga:1,value:s},l}},Ee=void 0,Te=void 0;function Z(s){for(var l="";E[s];)l+=Te[E[s++]];return l}var Re=[];function ye(){for(;Re.length;){var s=Re.pop();s.M.$=!1,s.delete()}}var Oe=void 0,we={};function Et(s,l){for(l===void 0&&O("ptr should not be undefined");s.R;)l=s.ba(l),s=s.R;return l}var nt={};function Nt(s){s=gr(s);var l=Z(s);return st(s),l}function gt(s,l){var m=nt[s];return m===void 0&&O(l+" has unknown type "+Nt(s)),m}function Tt(){}var Rt=!1;function bt(s){--s.count.value,s.count.value===0&&(s.T?s.U.W(s.T):s.P.N.W(s.O))}function rt(s,l,m){return l===m?s:m.R===void 0?null:(s=rt(s,l,m.R),s===null?null:m.na(s))}var Ye={};function Ue(s,l){return l=Et(s,l),we[l]}var yt=void 0;function Ne(s){throw new yt(s)}function qe(s,l){return l.P&&l.O||Ne("makeClassHandle requires ptr and ptrType"),!!l.U!=!!l.T&&Ne("Both smartPtrType and smartPtr must be specified"),l.count={value:1},Ke(Object.create(s,{M:{value:l}}))}function Ke(s){return typeof FinalizationRegistry>"u"?(Ke=l=>l,s):(Rt=new FinalizationRegistry(l=>{bt(l.M)}),Ke=l=>{var m=l.M;return m.T&&Rt.register(l,{M:m},l),l},Tt=l=>{Rt.unregister(l)},Ke(s))}var xt={};function dt(s){for(;s.length;){var l=s.pop();s.pop()(l)}}function Ce(s){return this.fromWireType(P[s>>2])}var ze={},Fe={};function Je(s,l,m){function h(I){I=m(I),I.length!==s.length&&Ne("Mismatched type converter count");for(var C=0;C<s.length;++C)$(s[C],I[C])}s.forEach(function(I){Fe[I]=l});var y=Array(l.length),w=[],k=0;l.forEach((I,C)=>{nt.hasOwnProperty(I)?y[C]=nt[I]:(w.push(I),ze.hasOwnProperty(I)||(ze[I]=[]),ze[I].push(()=>{y[C]=nt[I],++k,k===w.length&&h(y)}))}),w.length===0&&h(y)}function G(s){switch(s){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+s)}}function $(s,l,m={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");var h=l.name;if(s||O('type "'+h+'" must have a positive integer typeid pointer'),nt.hasOwnProperty(s)){if(m.ua)return;O("Cannot register type '"+h+"' twice")}nt[s]=l,delete Fe[s],ze.hasOwnProperty(s)&&(l=ze[s],delete ze[s],l.forEach(y=>y()))}function ee(s){O(s.M.P.N.name+" instance already deleted")}function V(){}function ue(s,l,m){if(s[l].S===void 0){var h=s[l];s[l]=function(){return s[l].S.hasOwnProperty(arguments.length)||O("Function '"+m+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+s[l].S+")!"),s[l].S[arguments.length].apply(this,arguments)},s[l].S=[],s[l].S[h.Z]=h}}function Q(s,l){t.hasOwnProperty(s)?(O("Cannot register public name '"+s+"' twice"),ue(t,s,s),t.hasOwnProperty(void 0)&&O("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),t[s].S[void 0]=l):t[s]=l}function de(s,l,m,h,y,w,k,I){this.name=s,this.constructor=l,this.X=m,this.W=h,this.R=y,this.pa=w,this.ba=k,this.na=I,this.ja=[]}function q(s,l,m){for(;l!==m;)l.ba||O("Expected null or instance of "+m.name+", got an instance of "+l.name),s=l.ba(s),l=l.R;return s}function K(s,l){return l===null?(this.ea&&O("null is not a valid "+this.name),0):(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),q(l.M.O,l.M.P.N,this.N))}function je(s,l){if(l===null){if(this.ea&&O("null is not a valid "+this.name),this.da){var m=this.fa();return s!==null&&s.push(this.W,m),m}return 0}if(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&l.M.P.ca&&O("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name),m=q(l.M.O,l.M.P.N,this.N),this.da)switch(l.M.T===void 0&&O("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:l.M.U===this?m=l.M.T:O("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name);break;case 1:m=l.M.T;break;case 2:if(l.M.U===this)m=l.M.T;else{var h=l.clone();m=this.xa(m,fe(function(){h.delete()})),s!==null&&s.push(this.W,m)}break;default:O("Unsupporting sharing policy")}return m}function z(s,l){return l===null?(this.ea&&O("null is not a valid "+this.name),0):(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),l.M.P.ca&&O("Cannot convert argument of type "+l.M.P.name+" to parameter type "+this.name),q(l.M.O,l.M.P.N,this.N))}function ve(s,l,m,h){this.name=s,this.N=l,this.ea=m,this.ca=h,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,l.R!==void 0?this.toWireType=je:(this.toWireType=h?K:z,this.V=null)}function Ae(s,l){t.hasOwnProperty(s)||Ne("Replacing nonexistant public symbol"),t[s]=l,t[s].Z=void 0}function Ot(s,l){var m=[];return function(){if(m.length=0,Object.assign(m,arguments),s.includes("j")){var h=t["dynCall_"+s];h=m&&m.length?h.apply(null,[l].concat(m)):h.call(null,l)}else h=B.get(l).apply(null,m);return h}}function ge(s,l){s=Z(s);var m=s.includes("j")?Ot(s,l):B.get(l);return typeof m!="function"&&O("unknown function pointer with signature "+s+": "+l),m}var St=void 0;function _e(s,l){function m(w){y[w]||nt[w]||(Fe[w]?Fe[w].forEach(m):(h.push(w),y[w]=!0))}var h=[],y={};throw l.forEach(m),new St(s+": "+h.map(Nt).join([", "]))}function at(s,l,m,h,y){var w=l.length;2>w&&O("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=l[1]!==null&&m!==null,I=!1;for(m=1;m<l.length;++m)if(l[m]!==null&&l[m].V===void 0){I=!0;break}var C=l[0].name!=="void",_=w-2,L=Array(_),F=[],J=[];return function(){if(arguments.length!==_&&O("function "+s+" called with "+arguments.length+" arguments, expected "+_+" args!"),J.length=0,F.length=k?2:1,F[0]=y,k){var xe=l[1].toWireType(J,this);F[1]=xe}for(var te=0;te<_;++te)L[te]=l[te+2].toWireType(J,arguments[te]),F.push(L[te]);if(te=h.apply(null,F),I)dt(J);else for(var Ge=k?1:2;Ge<l.length;Ge++){var et=Ge===1?xe:L[Ge-2];l[Ge].V!==null&&l[Ge].V(et)}return xe=C?l[0].fromWireType(te):void 0,xe}}function pe(s,l){for(var m=[],h=0;h<s;h++)m.push(v[l+4*h>>2]);return m}function me(s){4<s&&--W[s].ga===0&&(W[s]=void 0,ne.push(s))}function Be(s){if(s===null)return"null";var l=typeof s;return l==="object"||l==="array"||l==="function"?s.toString():""+s}function $e(s,l){switch(l){case 2:return function(m){return this.fromWireType(S[m>>2])};case 3:return function(m){return this.fromWireType(R[m>>3])};default:throw new TypeError("Unknown float type: "+s)}}function Ze(s,l,m){switch(l){case 0:return m?function(h){return x[h]}:function(h){return E[h]};case 1:return m?function(h){return A[h>>1]}:function(h){return N[h>>1]};case 2:return m?function(h){return P[h>>2]}:function(h){return v[h>>2]};default:throw new TypeError("Unknown integer type: "+s)}}function Qe(s,l){for(var m="",h=0;!(h>=l/2);++h){var y=A[s+2*h>>1];if(y==0)break;m+=String.fromCharCode(y)}return m}function Me(s,l,m){if(m===void 0&&(m=2147483647),2>m)return 0;m-=2;var h=l;m=m<2*s.length?m/2:s.length;for(var y=0;y<m;++y)A[l>>1]=s.charCodeAt(y),l+=2;return A[l>>1]=0,l-h}function Ve(s){return 2*s.length}function Ft(s,l){for(var m=0,h="";!(m>=l/4);){var y=P[s+4*m>>2];if(y==0)break;++m,65536<=y?(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023)):h+=String.fromCharCode(y)}return h}function kt(s,l,m){if(m===void 0&&(m=2147483647),4>m)return 0;var h=l;m=h+m-4;for(var y=0;y<s.length;++y){var w=s.charCodeAt(y);if(55296<=w&&57343>=w){var k=s.charCodeAt(++y);w=65536+((w&1023)<<10)|k&1023}if(P[l>>2]=w,l+=4,l+4>m)break}return P[l>>2]=0,l-h}function rn(s){for(var l=0,m=0;m<s.length;++m){var h=s.charCodeAt(m);55296<=h&&57343>=h&&++m,l+=4}return l}var on={};function Bt(s){var l=on[s];return l===void 0?Z(s):l}var an=[];function Uo(s){var l=an.length;return an.push(s),l}function zo(s,l){for(var m=Array(s),h=0;h<s;++h)m[h]=gt(v[l+4*h>>2],"parameter "+h);return m}var mr=[],jo=[null,[],[]];re=t.BindingError=U("BindingError"),t.count_emval_handles=function(){for(var s=0,l=5;l<W.length;++l)W[l]!==void 0&&++s;return s},t.get_first_emval=function(){for(var s=5;s<W.length;++s)if(W[s]!==void 0)return W[s];return null},Ee=t.PureVirtualError=U("PureVirtualError");for(var hr=Array(256),sn=0;256>sn;++sn)hr[sn]=String.fromCharCode(sn);Te=hr,t.getInheritedInstanceCount=function(){return Object.keys(we).length},t.getLiveInheritedInstances=function(){var s=[],l;for(l in we)we.hasOwnProperty(l)&&s.push(we[l]);return s},t.flushPendingDeletes=ye,t.setDelayFunction=function(s){Oe=s,Re.length&&Oe&&Oe(ye)},yt=t.InternalError=U("InternalError"),V.prototype.isAliasOf=function(s){if(!(this instanceof V&&s instanceof V))return!1;var l=this.M.P.N,m=this.M.O,h=s.M.P.N;for(s=s.M.O;l.R;)m=l.ba(m),l=l.R;for(;h.R;)s=h.ba(s),h=h.R;return l===h&&m===s},V.prototype.clone=function(){if(this.M.O||ee(this),this.M.aa)return this.M.count.value+=1,this;var s=Ke,l=Object,m=l.create,h=Object.getPrototypeOf(this),y=this.M;return s=s(m.call(l,h,{M:{value:{count:y.count,$:y.$,aa:y.aa,O:y.O,P:y.P,T:y.T,U:y.U}}})),s.M.count.value+=1,s.M.$=!1,s},V.prototype.delete=function(){this.M.O||ee(this),this.M.$&&!this.M.aa&&O("Object already scheduled for deletion"),Tt(this),bt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},V.prototype.isDeleted=function(){return!this.M.O},V.prototype.deleteLater=function(){return this.M.O||ee(this),this.M.$&&!this.M.aa&&O("Object already scheduled for deletion"),Re.push(this),Re.length===1&&Oe&&Oe(ye),this.M.$=!0,this},ve.prototype.qa=function(s){return this.ka&&(s=this.ka(s)),s},ve.prototype.ha=function(s){this.W&&this.W(s)},ve.prototype.argPackAdvance=8,ve.prototype.readValueFromPointer=Ce,ve.prototype.deleteObject=function(s){s!==null&&s.delete()},ve.prototype.fromWireType=function(s){function l(){return this.da?qe(this.N.X,{P:this.wa,O:m,U:this,T:s}):qe(this.N.X,{P:this,O:s})}var m=this.qa(s);if(!m)return this.ha(s),null;var h=Ue(this.N,m);if(h!==void 0)return h.M.count.value===0?(h.M.O=m,h.M.T=s,h.clone()):(h=h.clone(),this.ha(s),h);if(h=this.N.pa(m),h=Ye[h],!h)return l.call(this);h=this.ca?h.la:h.pointerType;var y=rt(m,this.N,h.N);return y===null?l.call(this):this.da?qe(h.N.X,{P:h,O:y,U:this,T:s}):qe(h.N.X,{P:h,O:y})},St=t.UnboundTypeError=U("UnboundTypeError");var Vo=typeof atob=="function"?atob:function(s){var l="",m=0;s=s.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s.charAt(m++)),y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s.charAt(m++)),w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s.charAt(m++)),k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s.charAt(m++));h=h<<2|y>>4,y=(y&15)<<4|w>>2;var I=(w&3)<<6|k;l+=String.fromCharCode(h),w!==64&&(l+=String.fromCharCode(y)),k!==64&&(l+=String.fromCharCode(I))}while(m<s.length);return l},Ho={l:function(s,l,m,h){ae("Assertion failed: "+(s?g(E,s):"")+", at: "+[l?l?g(E,l):"":"unknown filename",m,h?h?g(E,h):"":"unknown function"])},q:function(s,l,m){s=Z(s),l=gt(l,"wrapper"),m=oe(m);var h=[].slice,y=l.N,w=y.X,k=y.R.X,I=y.R.constructor;s=We(s,function(){y.R.ja.forEach(function(_){if(this[_]===k[_])throw new Ee("Pure virtual function "+_+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:w}),this.__construct.apply(this,h.call(arguments))}),w.__construct=function(){this===w&&O("Pass correct 'this' to __construct");var _=I.implement.apply(void 0,[this].concat(h.call(arguments)));Tt(_);var L=_.M;_.notifyOnDestruction(),L.aa=!0,Object.defineProperties(this,{M:{value:L}}),Ke(this),_=L.O,_=Et(y,_),we.hasOwnProperty(_)?O("Tried to register registered instance: "+_):we[_]=this},w.__destruct=function(){this===w&&O("Pass correct 'this' to __destruct"),Tt(this);var _=this.M.O;_=Et(y,_),we.hasOwnProperty(_)?delete we[_]:O("Tried to unregister unregistered instance: "+_)},s.prototype=Object.create(w);for(var C in m)s.prototype[C]=m[C];return fe(s)},j:function(s){var l=xt[s];delete xt[s];var m=l.fa,h=l.W,y=l.ia,w=y.map(k=>k.ta).concat(y.map(k=>k.za));Je([s],w,k=>{var I={};return y.forEach((C,_)=>{var L=k[_],F=C.ra,J=C.sa,xe=k[_+y.length],te=C.ya,Ge=C.Aa;I[C.oa]={read:et=>L.fromWireType(F(J,et)),write:(et,$t)=>{var ut=[];te(Ge,et,xe.toWireType(ut,$t)),dt(ut)}}}),[{name:l.name,fromWireType:function(C){var _={},L;for(L in I)_[L]=I[L].read(C);return h(C),_},toWireType:function(C,_){for(var L in I)if(!(L in _))throw new TypeError('Missing field: "'+L+'"');var F=m();for(L in I)I[L].write(F,_[L]);return C!==null&&C.push(h,F),F},argPackAdvance:8,readValueFromPointer:Ce,V:h}]})},v:function(){},B:function(s,l,m,h,y){var w=G(m);l=Z(l),$(s,{name:l,fromWireType:function(k){return!!k},toWireType:function(k,I){return I?h:y},argPackAdvance:8,readValueFromPointer:function(k){if(m===1)var I=x;else if(m===2)I=A;else if(m===4)I=P;else throw new TypeError("Unknown boolean type size: "+l);return this.fromWireType(I[k>>w])},V:null})},f:function(s,l,m,h,y,w,k,I,C,_,L,F,J){L=Z(L),w=ge(y,w),I&&(I=ge(k,I)),_&&(_=ge(C,_)),J=ge(F,J);var xe=Se(L);Q(xe,function(){_e("Cannot construct "+L+" due to unbound types",[h])}),Je([s,l,m],h?[h]:[],function(te){if(te=te[0],h)var Ge=te.N,et=Ge.X;else et=V.prototype;te=We(xe,function(){if(Object.getPrototypeOf(this)!==$t)throw new re("Use 'new' to construct "+L);if(ut.Y===void 0)throw new re(L+" has no accessible constructor");var xr=ut.Y[arguments.length];if(xr===void 0)throw new re("Tried to invoke ctor of "+L+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ut.Y).toString()+") parameters instead!");return xr.apply(this,arguments)});var $t=Object.create(et,{constructor:{value:te}});te.prototype=$t;var ut=new de(L,te,$t,J,Ge,w,I,_);Ge=new ve(L,ut,!0,!1),et=new ve(L+"*",ut,!1,!1);var yr=new ve(L+" const*",ut,!1,!0);return Ye[s]={pointerType:et,la:yr},Ae(xe,te),[Ge,et,yr]})},d:function(s,l,m,h,y,w,k){var I=pe(m,h);l=Z(l),w=ge(y,w),Je([],[s],function(C){function _(){_e("Cannot call "+L+" due to unbound types",I)}C=C[0];var L=C.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var F=C.N.constructor;return F[l]===void 0?(_.Z=m-1,F[l]=_):(ue(F,l,L),F[l].S[m-1]=_),Je([],I,function(J){return J=at(L,[J[0],null].concat(J.slice(1)),null,w,k),F[l].S===void 0?(J.Z=m-1,F[l]=J):F[l].S[m-1]=J,[]}),[]})},p:function(s,l,m,h,y,w){0<l||ae();var k=pe(l,m);y=ge(h,y),Je([],[s],function(I){I=I[0];var C="constructor "+I.name;if(I.N.Y===void 0&&(I.N.Y=[]),I.N.Y[l-1]!==void 0)throw new re("Cannot register multiple constructors with identical number of parameters ("+(l-1)+") for class '"+I.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return I.N.Y[l-1]=()=>{_e("Cannot construct "+I.name+" due to unbound types",k)},Je([],k,function(_){return _.splice(1,0,null),I.N.Y[l-1]=at(C,_,null,y,w),[]}),[]})},a:function(s,l,m,h,y,w,k,I){var C=pe(m,h);l=Z(l),w=ge(y,w),Je([],[s],function(_){function L(){_e("Cannot call "+F+" due to unbound types",C)}_=_[0];var F=_.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),I&&_.N.ja.push(l);var J=_.N.X,xe=J[l];return xe===void 0||xe.S===void 0&&xe.className!==_.name&&xe.Z===m-2?(L.Z=m-2,L.className=_.name,J[l]=L):(ue(J,l,F),J[l].S[m-2]=L),Je([],C,function(te){return te=at(F,te,_,w,k),J[l].S===void 0?(te.Z=m-2,J[l]=te):J[l].S[m-2]=te,[]}),[]})},A:function(s,l){l=Z(l),$(s,{name:l,fromWireType:function(m){var h=oe(m);return me(m),h},toWireType:function(m,h){return fe(h)},argPackAdvance:8,readValueFromPointer:Ce,V:null})},n:function(s,l,m){m=G(m),l=Z(l),$(s,{name:l,fromWireType:function(h){return h},toWireType:function(h,y){return y},argPackAdvance:8,readValueFromPointer:$e(l,m),V:null})},e:function(s,l,m,h,y){l=Z(l),y===-1&&(y=4294967295),y=G(m);var w=I=>I;if(h===0){var k=32-8*m;w=I=>I<<k>>>k}m=l.includes("unsigned")?function(I,C){return C>>>0}:function(I,C){return C},$(s,{name:l,fromWireType:w,toWireType:m,argPackAdvance:8,readValueFromPointer:Ze(l,y,h!==0),V:null})},b:function(s,l,m){function h(w){w>>=2;var k=v;return new y(b,k[w+1],k[w])}var y=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];m=Z(m),$(s,{name:m,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{ua:!0})},o:function(s,l){l=Z(l);var m=l==="std::string";$(s,{name:l,fromWireType:function(h){var y=v[h>>2],w=h+4;if(m)for(var k=w,I=0;I<=y;++I){var C=w+I;if(I==y||E[C]==0){if(k=k?g(E,k,C-k):"",_===void 0)var _=k;else _+="\0",_+=k;k=C+1}}else{for(_=Array(y),I=0;I<y;++I)_[I]=String.fromCharCode(E[w+I]);_=_.join("")}return st(h),_},toWireType:function(h,y){y instanceof ArrayBuffer&&(y=new Uint8Array(y));var w,k=typeof y=="string";if(k||y instanceof Uint8Array||y instanceof Uint8ClampedArray||y instanceof Int8Array||O("Cannot pass non-string to std::string"),m&&k){var I=0;for(w=0;w<y.length;++w){var C=y.charCodeAt(w);127>=C?I++:2047>=C?I+=2:55296<=C&&57343>=C?(I+=4,++w):I+=3}w=I}else w=y.length;if(I=Cn(4+w+1),C=I+4,v[I>>2]=w,m&&k){if(k=C,C=w+1,w=E,0<C){C=k+C-1;for(var _=0;_<y.length;++_){var L=y.charCodeAt(_);if(55296<=L&&57343>=L){var F=y.charCodeAt(++_);L=65536+((L&1023)<<10)|F&1023}if(127>=L){if(k>=C)break;w[k++]=L}else{if(2047>=L){if(k+1>=C)break;w[k++]=192|L>>6}else{if(65535>=L){if(k+2>=C)break;w[k++]=224|L>>12}else{if(k+3>=C)break;w[k++]=240|L>>18,w[k++]=128|L>>12&63}w[k++]=128|L>>6&63}w[k++]=128|L&63}}w[k]=0}}else if(k)for(k=0;k<w;++k)_=y.charCodeAt(k),255<_&&(st(C),O("String has UTF-16 code units that do not fit in 8 bits")),E[C+k]=_;else for(k=0;k<w;++k)E[C+k]=y[k];return h!==null&&h.push(st,I),I},argPackAdvance:8,readValueFromPointer:Ce,V:function(h){st(h)}})},i:function(s,l,m){if(m=Z(m),l===2)var h=Qe,y=Me,w=Ve,k=()=>N,I=1;else l===4&&(h=Ft,y=kt,w=rn,k=()=>v,I=2);$(s,{name:m,fromWireType:function(C){for(var _=v[C>>2],L=k(),F,J=C+4,xe=0;xe<=_;++xe){var te=C+4+xe*l;(xe==_||L[te>>I]==0)&&(J=h(J,te-J),F===void 0?F=J:(F+="\0",F+=J),J=te+l)}return st(C),F},toWireType:function(C,_){typeof _!="string"&&O("Cannot pass non-string to C++ string type "+m);var L=w(_),F=Cn(4+L+l);return v[F>>2]=L>>I,y(_,F+4,L+l),C!==null&&C.push(st,F),F},argPackAdvance:8,readValueFromPointer:Ce,V:function(C){st(C)}})},k:function(s,l,m,h,y,w){xt[s]={name:Z(l),fa:ge(m,h),W:ge(y,w),ia:[]}},h:function(s,l,m,h,y,w,k,I,C,_){xt[s].ia.push({oa:Z(l),ta:m,ra:ge(h,y),sa:w,za:k,ya:ge(I,C),Aa:_})},C:function(s,l){l=Z(l),$(s,{va:!0,name:l,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(s,l,m,h,y){s=an[s],l=oe(l),m=Bt(m);var w=[];return v[h>>2]=fe(w),s(l,m,w,y)},t:function(s,l,m,h){s=an[s],l=oe(l),m=Bt(m),s(l,m,null,h)},g:me,m:function(s,l){var m=zo(s,l),h=m[0];l=h.name+"_$"+m.slice(1).map(function(k){return k.name}).join("_")+"$";var y=mr[l];if(y!==void 0)return y;var w=Array(s-1);return y=Uo((k,I,C,_)=>{for(var L=0,F=0;F<s-1;++F)w[F]=m[F+1].readValueFromPointer(_+L),L+=m[F+1].argPackAdvance;for(k=k[I].apply(k,w),F=0;F<s-1;++F)m[F+1].ma&&m[F+1].ma(w[F]);if(!h.va)return h.toWireType(C,k)}),mr[l]=y},D:function(s){4<s&&(W[s].ga+=1)},r:function(s){var l=oe(s);dt(l),me(s)},c:function(){ae("")},x:function(s,l,m){E.copyWithin(s,l,l+m)},w:function(s){var l=E.length;if(s>>>=0,2147483648<s)return!1;for(var m=1;4>=m;m*=2){var h=l*(1+.2/m);h=Math.min(h,s+100663296);var y=Math;h=Math.max(s,h),y=y.min.call(y,2147483648,h+(65536-h%65536)%65536);e:{try{c.grow(y-b.byteLength+65535>>>16),M();var w=1;break e}catch{}w=void 0}if(w)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(s,l,m,h){for(var y=0,w=0;w<m;w++){var k=v[l>>2],I=v[l+4>>2];l+=8;for(var C=0;C<I;C++){var _=E[k+C],L=jo[s];_===0||_===10?((s===1?a:f)(g(L,0)),L.length=0):L.push(_)}y+=I}return v[h>>2]=y,0}};(function(){function s(y){t.asm=y.exports,c=t.asm.E,M(),B=t.asm.J,X.unshift(t.asm.F),be--,t.monitorRunDependencies&&t.monitorRunDependencies(be),be==0&&(ie!==null&&(clearInterval(ie),ie=null),ce&&(y=ce,ce=null,y()))}function l(y){s(y.instance)}function m(y){return De().then(function(w){return w instanceof WebAssembly.Instance?w:WebAssembly.instantiate(w,h)}).then(function(w){return w}).then(y,function(w){f("failed to asynchronously prepare wasm: "+w),ae(w)})}var h={a:Ho};if(be++,t.monitorRunDependencies&&t.monitorRunDependencies(be),t.instantiateWasm)try{return t.instantiateWasm(h,s)}catch(y){f("Module.instantiateWasm callback failed with error: "+y),o(y)}return function(){return u||typeof WebAssembly.instantiateStreaming!="function"||ke(Y)||typeof fetch!="function"?m(l):fetch(Y,{credentials:"same-origin"}).then(function(y){return WebAssembly.instantiateStreaming(y,h).then(l,function(w){return f("wasm streaming compile failed: "+w),f("falling back to ArrayBuffer instantiation"),m(l)})})}().catch(o),{}})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.F).apply(null,arguments)};var gr=t.___getTypeName=function(){return(gr=t.___getTypeName=t.asm.G).apply(null,arguments)};t.__embind_initialize_bindings=function(){return(t.__embind_initialize_bindings=t.asm.H).apply(null,arguments)};var Cn=t._malloc=function(){return(Cn=t._malloc=t.asm.I).apply(null,arguments)},st=t._free=function(){return(st=t._free=t.asm.K).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.L).apply(null,arguments)};var un;ce=function s(){un||br(),un||(ce=s)};function br(){function s(){if(!un&&(un=!0,t.calledRun=!0,!p)){if(se(X),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var l=t.postRun.shift();he.unshift(l)}se(he)}}if(!(0<be)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)le();se(H),0<be||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),s()},1)):s())}}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return br(),e.ready}var Wr,Or=Gt(()=>{Wr=""});var ct,Fr,Br,zt,On,ft,At,ui,dn,Fn,Mt,Pt,Bn,$r,$n,Gn,tt,Dn,li,Gr,pn=Gt(()=>{ct=function(e){return e[e.Auto=0]="Auto",e[e.FlexStart=1]="FlexStart",e[e.Center=2]="Center",e[e.FlexEnd=3]="FlexEnd",e[e.Stretch=4]="Stretch",e[e.Baseline=5]="Baseline",e[e.SpaceBetween=6]="SpaceBetween",e[e.SpaceAround=7]="SpaceAround",e[e.SpaceEvenly=8]="SpaceEvenly",e}({}),Fr=function(e){return e[e.BorderBox=0]="BorderBox",e[e.ContentBox=1]="ContentBox",e}({}),Br=function(e){return e[e.Width=0]="Width",e[e.Height=1]="Height",e}({}),zt=function(e){return e[e.Inherit=0]="Inherit",e[e.LTR=1]="LTR",e[e.RTL=2]="RTL",e}({}),On=function(e){return e[e.Flex=0]="Flex",e[e.None=1]="None",e[e.Contents=2]="Contents",e}({}),ft=function(e){return e[e.Left=0]="Left",e[e.Top=1]="Top",e[e.Right=2]="Right",e[e.Bottom=3]="Bottom",e[e.Start=4]="Start",e[e.End=5]="End",e[e.Horizontal=6]="Horizontal",e[e.Vertical=7]="Vertical",e[e.All=8]="All",e}({}),At=function(e){return e[e.None=0]="None",e[e.StretchFlexBasis=1]="StretchFlexBasis",e[e.AbsolutePositionWithoutInsetsExcludesPadding=2]="AbsolutePositionWithoutInsetsExcludesPadding",e[e.AbsolutePercentAgainstInnerSize=4]="AbsolutePercentAgainstInnerSize",e[e.All=2147483647]="All",e[e.Classic=2147483646]="Classic",e}({}),ui=function(e){return e[e.WebFlexBasis=0]="WebFlexBasis",e}({}),dn=function(e){return e[e.Column=0]="Column",e[e.ColumnReverse=1]="ColumnReverse",e[e.Row=2]="Row",e[e.RowReverse=3]="RowReverse",e}({}),Fn=function(e){return e[e.Column=0]="Column",e[e.Row=1]="Row",e[e.All=2]="All",e}({}),Mt=function(e){return e[e.FlexStart=0]="FlexStart",e[e.Center=1]="Center",e[e.FlexEnd=2]="FlexEnd",e[e.SpaceBetween=3]="SpaceBetween",e[e.SpaceAround=4]="SpaceAround",e[e.SpaceEvenly=5]="SpaceEvenly",e}({}),Pt=function(e){return e[e.Error=0]="Error",e[e.Warn=1]="Warn",e[e.Info=2]="Info",e[e.Debug=3]="Debug",e[e.Verbose=4]="Verbose",e[e.Fatal=5]="Fatal",e}({}),Bn=function(e){return e[e.Undefined=0]="Undefined",e[e.Exactly=1]="Exactly",e[e.AtMost=2]="AtMost",e}({}),$r=function(e){return e[e.Default=0]="Default",e[e.Text=1]="Text",e}({}),$n=function(e){return e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.Scroll=2]="Scroll",e}({}),Gn=function(e){return e[e.Static=0]="Static",e[e.Relative=1]="Relative",e[e.Absolute=2]="Absolute",e}({}),tt=function(e){return e[e.Undefined=0]="Undefined",e[e.Point=1]="Point",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto",e}({}),Dn=function(e){return e[e.NoWrap=0]="NoWrap",e[e.Wrap=1]="Wrap",e[e.WrapReverse=2]="WrapReverse",e}({}),li={ALIGN_AUTO:ct.Auto,ALIGN_FLEX_START:ct.FlexStart,ALIGN_CENTER:ct.Center,ALIGN_FLEX_END:ct.FlexEnd,ALIGN_STRETCH:ct.Stretch,ALIGN_BASELINE:ct.Baseline,ALIGN_SPACE_BETWEEN:ct.SpaceBetween,ALIGN_SPACE_AROUND:ct.SpaceAround,ALIGN_SPACE_EVENLY:ct.SpaceEvenly,BOX_SIZING_BORDER_BOX:Fr.BorderBox,BOX_SIZING_CONTENT_BOX:Fr.ContentBox,DIMENSION_WIDTH:Br.Width,DIMENSION_HEIGHT:Br.Height,DIRECTION_INHERIT:zt.Inherit,DIRECTION_LTR:zt.LTR,DIRECTION_RTL:zt.RTL,DISPLAY_FLEX:On.Flex,DISPLAY_NONE:On.None,DISPLAY_CONTENTS:On.Contents,EDGE_LEFT:ft.Left,EDGE_TOP:ft.Top,EDGE_RIGHT:ft.Right,EDGE_BOTTOM:ft.Bottom,EDGE_START:ft.Start,EDGE_END:ft.End,EDGE_HORIZONTAL:ft.Horizontal,EDGE_VERTICAL:ft.Vertical,EDGE_ALL:ft.All,ERRATA_NONE:At.None,ERRATA_STRETCH_FLEX_BASIS:At.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:At.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:At.AbsolutePercentAgainstInnerSize,ERRATA_ALL:At.All,ERRATA_CLASSIC:At.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:ui.WebFlexBasis,FLEX_DIRECTION_COLUMN:dn.Column,FLEX_DIRECTION_COLUMN_REVERSE:dn.ColumnReverse,FLEX_DIRECTION_ROW:dn.Row,FLEX_DIRECTION_ROW_REVERSE:dn.RowReverse,GUTTER_COLUMN:Fn.Column,GUTTER_ROW:Fn.Row,GUTTER_ALL:Fn.All,JUSTIFY_FLEX_START:Mt.FlexStart,JUSTIFY_CENTER:Mt.Center,JUSTIFY_FLEX_END:Mt.FlexEnd,JUSTIFY_SPACE_BETWEEN:Mt.SpaceBetween,JUSTIFY_SPACE_AROUND:Mt.SpaceAround,JUSTIFY_SPACE_EVENLY:Mt.SpaceEvenly,LOG_LEVEL_ERROR:Pt.Error,LOG_LEVEL_WARN:Pt.Warn,LOG_LEVEL_INFO:Pt.Info,LOG_LEVEL_DEBUG:Pt.Debug,LOG_LEVEL_VERBOSE:Pt.Verbose,LOG_LEVEL_FATAL:Pt.Fatal,MEASURE_MODE_UNDEFINED:Bn.Undefined,MEASURE_MODE_EXACTLY:Bn.Exactly,MEASURE_MODE_AT_MOST:Bn.AtMost,NODE_TYPE_DEFAULT:$r.Default,NODE_TYPE_TEXT:$r.Text,OVERFLOW_VISIBLE:$n.Visible,OVERFLOW_HIDDEN:$n.Hidden,OVERFLOW_SCROLL:$n.Scroll,POSITION_TYPE_STATIC:Gn.Static,POSITION_TYPE_RELATIVE:Gn.Relative,POSITION_TYPE_ABSOLUTE:Gn.Absolute,UNIT_UNDEFINED:tt.Undefined,UNIT_POINT:tt.Point,UNIT_PERCENT:tt.Percent,UNIT_AUTO:tt.Auto,WRAP_NO_WRAP:Dn.NoWrap,WRAP_WRAP:Dn.Wrap,WRAP_WRAP_REVERSE:Dn.WrapReverse},Gr=li});function Un(e){function t(i,r,a){let f=i[r];i[r]=function(){for(var u=arguments.length,d=new Array(u),c=0;c<u;c++)d[c]=arguments[c];return a.call(this,f,...d)}}for(let i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding","setGap"]){let r={[tt.Point]:e.Node.prototype[i],[tt.Percent]:e.Node.prototype[`${i}Percent`],[tt.Auto]:e.Node.prototype[`${i}Auto`]};t(e.Node.prototype,i,function(a){for(var f=arguments.length,u=new Array(f>1?f-1:0),d=1;d<f;d++)u[d-1]=arguments[d];let c=u.pop(),p,g;if(c==="auto")p=tt.Auto,g=void 0;else if(typeof c=="object")p=c.unit,g=c.valueOf();else if(p=typeof c=="string"&&c.endsWith("%")?tt.Percent:tt.Point,g=parseFloat(c),c!==void 0&&!Number.isNaN(c)&&Number.isNaN(g))throw new Error(`Invalid value ${c} for ${i}`);if(!r[p])throw new Error(`Failed to execute "${i}": Unsupported unit '${c}'`);return g!==void 0?r[p].call(this,...u,g):r[p].call(this,...u)})}function n(i){return e.MeasureCallback.implement({measure:function(){let{width:r,height:a}=i(...arguments);return{width:r??NaN,height:a??NaN}}})}t(e.Node.prototype,"setMeasureFunc",function(i,r){return r?i.call(this,n(r)):this.unsetMeasureFunc()});function o(i){return e.DirtiedCallback.implement({dirtied:i})}return t(e.Node.prototype,"setDirtiedFunc",function(i,r){i.call(this,o(r))}),t(e.Config.prototype,"free",function(){e.Config.destroy(this)}),t(e.Node,"create",(i,r)=>r?e.Node.createWithConfig(r):e.Node.createDefault()),t(e.Node.prototype,"free",function(){e.Node.destroy(this)}),t(e.Node.prototype,"freeRecursive",function(){for(let i=0,r=this.getChildCount();i<r;++i)this.getChild(0).freeRecursive();this.free()}),t(e.Node.prototype,"calculateLayout",function(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:zt.LTR;return i.call(this,r,a,f)}),{Config:e.Config,Node:e.Node,...Gr}}var Dr=Gt(()=>{pn();pn()});async function Ur(e){return Un(await Nr(e))}var zr=Gt(()=>{Or();Dr();pn()});var jn={};Yo(jn,{getYoga:()=>mi,init:()=>pi});async function di(e,t){let n;if(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL?n=await fetch(e):n=await e,typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){n.headers.get("Content-Type")!=="application/wasm"&&console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}let i=await n.arrayBuffer();return await WebAssembly.instantiate(i,t)}let o=await WebAssembly.instantiate("buffer"in n?n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength):n,t);return o instanceof WebAssembly.Instance?{instance:o,module:n}:o}function pi(e){ci({instantiateWasm(t,n){return di(e,t).then(({instance:o})=>{n(o)}).catch(zn),{}}}).then(jr).catch(zn)}function mi(){return fi}var ci,jr,zn,fi,Vn=Gt(()=>{zr();ci=Ur,fi=new Promise((e,t)=>{jr=e,zn=t})});import ai from"linebreak";var Dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qo=Dt((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Ko=Dt((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Jo=Dt((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Zo=Dt((e,t)=>{t.exports=["Hz","kHz"]}),Qo=Dt((e,t)=>{t.exports=["s","ms"]}),ei=qo(),Sr=Ko(),wr=Jo(),vr=Zo(),Er=Qo();function Mn(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(ti(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=An(e),this.unit="%";return}var t=ri(e);if(!t){this.type="number",this.value=An(e);return}this.type=ii(t),this.value=An(e.substr(0,e.length-t.length)),this.unit=t}Mn.prototype.valueOf=function(){return this.value};Mn.prototype.toString=function(){return this.value+(this.unit||"")};function He(e){return new Mn(e)}function ti(e){var t=e.match(/\./g);return t?t.length:0}function An(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var ni=[].concat(Sr,vr,ei,wr,Er);function ri(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&ni.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var oi=Object.assign(ln(Sr,"angle"),ln(vr,"frequency"),ln(wr,"resolution"),ln(Er,"time"));function ln(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function ii(e){return oi[e]||"length"}function _t(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function Tr(e){return/^class\s/.test(e.toString())}function Wn(e){return e&&e.$$typeof===Symbol.for("react.forward_ref")}function Rr(e){return typeof e=="function"||Wn(e)}function kr(e){return"dangerouslySetInnerHTML"in e}function Ir(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let o=0;o<t.length;o++){let i=t[o];typeof i>"u"||typeof i=="boolean"||i===null||(typeof i=="number"&&(i=String(i)),typeof i=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=i:n.push(i))}return n}function D(e,t,n,o,i=!1){if(typeof e=="number")return e;try{if(e=e.trim(),/[ /\(,]/.test(e))return;if(e===String(+e))return+e;let r=new He(e);if(r.type==="length")switch(r.unit){case"em":return r.value*t;case"rem":return r.value*16;case"vw":return~~(r.value*o._viewportWidth/100);case"vh":return~~(r.value*o._viewportHeight/100);default:return r.value}else{if(r.type==="angle")return Nn(e);if(r.type==="percentage"&&i)return r.value/100*n}}catch{}}function Nn(e){let t=new He(e);switch(t.unit){case"deg":return t.value;case"rad":return t.value*180/Math.PI;case"turn":return t.value*360;case"grad":return .9*t.value}}function Ut(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function Le(e,t,n,o){let i=t[e];if(typeof i>"u"){if(o&&typeof e<"u")throw new Error(`Invalid value for CSS property "${o}". Allowed values: ${Object.keys(t).map(r=>`"${r}"`).join(" | ")}. Received: "${e}".`);i=n}return i}var Pn,Ln,_r=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e)),It=new Map,si=500;function Pe(e,t,n){let o=`${t}:${n||""}:${e}`;if(It.has(o))return It.get(o);if(!Pn||!Ln){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Pn=new Intl.Segmenter(n,{granularity:"word"}),Ln=new Intl.Segmenter(n,{granularity:"grapheme"})}let i;if(t==="grapheme")i=[...Ln.segment(e)].map(r=>r.segment);else{let r=[...Pn.segment(e)].map(u=>u.segment),a=[],f=0;for(;f<r.length;){let u=r[f];if(u=="\xA0"){let d=f===0?"":a.pop(),c=f===r.length-1?"":r[f+1];a.push(d+"\xA0"+c),f+=2}else a.push(u),f++}i=a}if(It.size>=si){let r=It.keys().next().value;It.delete(r)}return It.set(o,i),i}function T(e,t,n){let o="";for(let[i,r]of Object.entries(t))typeof r<"u"&&(o+=` ${i}="${r}"`);return n?`<${e}${o}>${n}</${e}>`:`<${e}${o}/>`}function Cr(e=20){let t=new Map;function n(r){let a=t.get(r);if(a!==void 0)return t.delete(r),t.set(r,a),a}function o(r,a){if(t.has(r))t.delete(r);else if(t.size>=e){let f=t.keys().next().value;t.delete(f)}t.set(r,a)}function i(){t.clear()}return{set:o,get:n,clear:i}}function Ct(e){return e?e.split(/[, ]/).filter(Boolean).map(Number):null}function cn(e){return typeof e=="string"}function Ar(e){return typeof e=="number"}function Mr(e){return typeof e>"u"}function lt(e,t){if(typeof e=="number")return e;if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number or a percentage value (e.g., "50%").`)}function pt(e,t){if(typeof e=="number")return e;if(e==="auto")return"auto";if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number, "auto", or a percentage value (e.g., "50%").`)}function Pr(e,t){if(t==="break-all")return{words:Pe(e,"grapheme"),requiredBreaks:[]};if(t==="keep-all")return{words:Pe(e,"word"),requiredBreaks:[]};let n=new ai(e),o=0,i=n.nextBreak(),r=[],a=[!1];for(;i;){let f=e.slice(o,i.position);r.push(f),i.required?a.push(!0):a.push(!1),o=i.position,i=n.nextBreak()}return{words:r,requiredBreaks:a}}var Lr=e=>e.replaceAll(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`);function fn(e,t=","){let n=[],o=0,i=0;t=new RegExp(t);for(let r=0;r<e.length;r++)e[r]==="("?i++:e[r]===")"&&i--,i===0&&t.test(e[r])&&(n.push(e.slice(o,r).trim()),o=r+1);return n.push(e.slice(o).trim()),n}function hi(e){return Promise.resolve().then(()=>(Vn(),jn)).then(t=>t.init(e))}function mt(){return Promise.resolve().then(()=>(Vn(),jn)).then(e=>e.getYoga())}var gi="image/avif",bi="image/webp",mn="image/apng",hn="image/png",gn="image/jpeg",bn="image/gif",Hn="image/svg+xml";function Xr(e){let t=new DataView(e),n=4,o=t.byteLength;for(;n<o;){let i=t.getUint16(n,!1);if(i>o)throw new TypeError("Invalid JPEG");let r=t.getUint8(i+1+n);if(r===192||r===193||r===194)return[t.getUint16(i+7+n,!1),t.getUint16(i+5+n,!1)];n+=i+2}throw new TypeError("Invalid JPEG")}function Yr(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function qr(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var ot=Cr(500),jt=new Map,yi=[hn,mn,gn,bn,Hn],xi=/<svg[^>]*>/i,Si=/viewBox=['"]([^'"]+)['"]/,wi=/width=['"](\d*\.?\d+)['"]/,vi=/height=['"](\d*\.?\d+)['"]/;function Ei(e){let t=new Uint8Array(e),n=32768,o="";for(let i=0;i<t.length;i+=n){let r=t.subarray(i,Math.min(i+n,t.length));o+=String.fromCharCode(...r)}return btoa(o)}function Ti(e){let t=atob(e),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.charCodeAt(i);return o.buffer}function Vr(e,t){let n=t.match(xi);if(!n)throw new Error(`Failed to parse SVG from ${e}`);let o=n[0],i=Si.exec(o),r=wi.exec(o),a=vi.exec(o),f=i?Ct(i[1]):null;if(!f&&(!r||!a))throw new Error(`Failed to parse SVG from ${e}: missing "viewBox"`);let u=f?[f[2],f[3]]:[+r[1],+a[1]],d=u[0]/u[1];return r&&a?[+r[1],+a[1]]:r?[+r[1],+r[1]/d]:a?[+a[1]*d,+a[1]]:[u[0],u[1]]}function Hr(e){let t,n=Ri(new Uint8Array(e));switch(n){case hn:case mn:t=qr(e);break;case bn:t=Yr(e);break;case gn:t=Xr(e);break}if(!yi.includes(n))throw new Error(`Unsupported image type: ${n||"unknown"}`);return[`data:${n};base64,${Ei(e)}`,t]}async function Lt(e){if(!e)throw new Error("Image source is not provided.");if(typeof e=="object"){let[i,r]=Hr(e);return[i,...r]}if((e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),typeof window>"u"&&!e.startsWith("http")&&!e.startsWith("data:"))throw new Error(`Image source must be an absolute URL: ${e}`);if(e.startsWith("data:")){let i;try{i=/data:(?<imageType>[a-z/+]+)(;[^;=]+=[^;=]+)*?(;(?<encodingType>[^;,]+))?,(?<dataString>.*)/g.exec(e).groups}catch{return console.warn("Image data URI resolved without size:"+e),[e]}let{imageType:r,encodingType:a,dataString:f}=i;if(r===Hn){let u=a==="base64"?atob(f):decodeURIComponent(f.replace(/ /g,"%20")),d=a==="base64"?e:`data:image/svg+xml;base64,${btoa(u)}`,c=Vr(e,u);return ot.set(e,[d,...c]),[d,...c]}else if(a==="base64"){let u,d=Ti(f);switch(r){case hn:case mn:u=qr(d);break;case bn:u=Yr(d);break;case gn:u=Xr(d);break}return ot.set(e,[e,...u]),[e,...u]}else return console.warn("Image data URI resolved without size:"+e),ot.set(e,[e]),[e]}if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(jt.has(e))return jt.get(e);let t=ot.get(e);if(t)return t;let n=e,o=fetch(n).then(i=>{let r=i.headers.get("content-type");return r==="image/svg+xml"||r==="application/svg+xml"?i.text():i.arrayBuffer()}).then(i=>{if(typeof i=="string")try{let f=`data:image/svg+xml;base64,${btoa(i)}`,u=Vr(n,i);return[f,...u]}catch(f){throw new Error(`Failed to parse SVG image: ${f.message}`)}let[r,a]=Hr(i);return[r,...a]}).then(i=>(ot.set(n,i),i)).catch(i=>(console.error(`Can't load image ${n}: `+i.message),ot.set(n,[]),[]));return jt.set(n,o),o}function Ri(e){return[255,216,255].every((t,n)=>e[n]===t)?gn:[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)?ki(e)?mn:hn:[71,73,70,56].every((t,n)=>e[n]===t)?bn:[82,73,70,70,0,0,0,0,87,69,66,80].every((t,n)=>!t||e[n]===t)?bi:[60,63,120,109,108].every((t,n)=>e[n]===t)?Hn:[0,0,0,0,102,116,121,112,97,118,105,102].every((t,n)=>!t||e[n]===t)?gi:null}function ki(e){let t=new DataView(e.buffer),n,o,i=8,r=!1;for(;!r&&n!=="IEND"&&i<e.length;){o=t.getUint32(i);let a=e.subarray(i+4,i+8);n=String.fromCharCode(...a),r=n==="acTL",i+=12+o}return r}var Xn={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",href:"href",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space",xmlnsXlink:"xmlns:xlink"},Ii=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Yn(e,t){if(!e)return"";if(Array.isArray(e))return e.map(d=>Yn(d,t)).join("");if(typeof e!="object")return String(e);let n=e.type;if(n==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:o,style:i,...r}=e.props||{},a=(i==null?void 0:i.color)||t,f=`${Object.entries(r).map(([d,c])=>(typeof c=="string"&&c.toLowerCase()==="currentcolor"&&(c=a),(d==="href"||d==="xlinkHref")&&n==="image"?` ${Xn[d]||d}="${ot.get(c)[0]}"`:` ${Xn[d]||d}="${c}"`)).join("")}`,u=i?` style="${Object.entries(i).map(([d,c])=>`${Lr(d)}:${c}`).join(";")}"`:"";return`<${n}${f}${u}>${Yn(o,a)}</${n}>`}async function Kr(e){let t=new Set,n=o=>{if(o&&_t(o)){if(Array.isArray(o)){o.forEach(i=>n(i));return}else if(typeof o=="object")if(o.type==="image"){let i=o.props.href||o.props.xlinkHref;i&&(t.has(i)||t.add(i))}else o.type==="img"&&(t.has(o.props.src)||t.add(o.props.src));Array.isArray(o.props.children)?o.props.children.map(i=>n(i)):n(o.props.children)}};return n(e),Promise.all(Array.from(t).map(o=>Lt(o)))}async function Jr(e,t){let{viewBox:n,viewbox:o,width:i,height:r,className:a,style:f,children:u,...d}=e.props||{};n||=o,d.xmlns="http://www.w3.org/2000/svg";let c=(f==null?void 0:f.color)||t,p=Ct(n),g=p?p[3]/p[2]:null;return i=i||g&&r?r/g:null,r=r||g&&i?i*g:null,d.width=i,d.height=r,n&&(d.viewBox=n),`data:image/svg+xml;utf8,${`<svg ${Object.entries(d).map(([b,x])=>(typeof x=="string"&&x.toLowerCase()==="currentcolor"&&(x=c),` ${Xn[b]||b}="${x}"`)).join("")}>${Yn(u,c)}</svg>`.replace(Ii,encodeURIComponent)}`}var Xe="flex",Zr={p:{display:Xe,marginTop:"1em",marginBottom:"1em"},div:{display:Xe},blockquote:{display:Xe,marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:Xe,textAlign:"center"},hr:{display:Xe,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"solid"},h1:{display:Xe,fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:Xe,fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:Xe,fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:Xe,marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:Xe,fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:Xe,fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:Xe,fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var _i=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textIndent","textTransform","textShadowOffset","textShadowColor","textShadowRadius","WebkitTextStrokeWidth","WebkitTextStrokeColor","textDecorationLine","textDecorationStyle","textDecorationColor","textDecorationSkipInk","whiteSpace","transform","wordBreak","tabSize","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedMaskId","_inheritedBackgroundClipTextPath","_inheritedBackgroundClipTextHasBackground"]);function qn(e){let t={};for(let n in e)(_i.has(n)||n.startsWith("--"))&&(t[n]=e[n]);return t}import{getPropertyName as Li,getStylesForProperty as ht}from"css-to-react-native";import{parseElementStyle as Wi}from"css-background-parser";import{parse as Ni}from"css-box-shadow";import Oi from"parse-css-color";import Ci from"postcss-value-parser";function Ai(e,t){try{let n=new He(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function Kn(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:{let o=Ai(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}}function Jn(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Ci(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?Kn(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Kn(n[0],t,!0),...Kn(n[1],t,!1)}):{}}import{getPropertyName as Mi}from"css-to-react-native";function Vt(e,t){let n=Mi(`mask-${t}`);return e[n]||e[`WebkitM${n.substring(1)}`]}function Qr(e){let t=e.maskImage||e.WebkitMaskImage,n={position:Vt(e,"position")||"0% 0%",size:Vt(e,"size")||"100% 100%",repeat:Vt(e,"repeat")||"repeat",origin:Vt(e,"origin")||"border-box",clip:Vt(e,"origin")||"border-box"};return fn(t).filter(i=>i&&i!=="none").reverse().map(i=>({image:i,...n}))}import eo from"postcss-value-parser";function to(e){let t={},n={};for(let o in e)o.startsWith("--")?t[o]=String(e[o]):n[o]=e[o];return{variables:t,remainingStyle:n}}function no(e,t){return{...e,...t}}function Xt(e,t,n=new Set){if(typeof e!="string"||!e.includes("var("))return e;try{let o=eo(e),i=!1;if(o.walk(r=>{if(r.type==="function"&&r.value==="var"){i=!0;let a=Pi(r);if(!a)return;let{varName:f,fallback:u}=a;if(n.has(f)){console.warn(`Circular reference detected for CSS variable: ${f}`),u!==void 0?Ht(r,u):Ht(r,"initial");return}let d=t[f];if(d!==void 0){let c=new Set(n);c.add(f);let p=Xt(d,t,c);Ht(r,String(p))}else if(u!==void 0){let c=Xt(u,t,n);Ht(r,String(c))}else Ht(r,"initial")}}),i)return o.toString()}catch{console.warn(`Failed to parse CSS value for variable resolution: ${e}`)}return e}function Pi(e){if(!e.nodes||e.nodes.length===0)return null;let t,n=-1;for(let i=0;i<e.nodes.length;i++){let r=e.nodes[i];if(r.type==="word"&&!t)t=r;else if(r.type==="div"&&r.value===","){n=i;break}}if(!t||t.type!=="word")return null;let o=t.value.trim();if(n!==-1&&n<e.nodes.length-1){let i=e.nodes.slice(n+1),r=eo.stringify(i).trim();return{varName:o,fallback:r}}return{varName:o}}function Ht(e,t){e.type="word",e.value=t,delete e.nodes}var Fi=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),Bi=new Set(["lineHeight"]);function $i(e,t,n,o){return e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=o),t}function wt(e,t){let n=Number(t);return isNaN(n)?t:Fi.has(e)?Bi.has(e)?n:String(t):n+"px"}function Gi(e,t,n){if(e==="zIndex")return console.warn("`z-index` is currently not supported."),{[e]:t};if(e==="lineHeight")return{lineHeight:wt(e,t)};if(e==="fontFamily")return{fontFamily:t.split(",").map(o=>o.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())};if(e==="borderRadius"){if(typeof t!="string"||!t.includes("/"))return;let[o,i]=t.split("/"),r=ht(e,o,!0),a=ht(e,i,!0);for(let f in r)a[f]=wt(e,r[f])+" "+wt(e,a[f]);return a}if(/^border(Top|Right|Bottom|Left)?$/.test(e)){let o=ht("border",t,!0);o.borderWidth===1&&!String(t).includes("1px")&&(o.borderWidth=3),o.borderColor==="black"&&!String(t).includes("black")&&(o.borderColor=n);let i={Width:wt(e+"Width",o.borderWidth),Style:Le(o.borderStyle,{solid:"solid",dashed:"dashed"},"solid",e+"Style"),Color:o.borderColor},r={};for(let a of e==="border"?["Top","Right","Bottom","Left"]:[e.slice(6)])for(let f in i)r["border"+a+f]=i[f];return r}if(e==="boxShadow"){if(!t)throw new Error('Invalid `boxShadow` value: "'+t+'".');return{[e]:typeof t=="string"?Ni(t):t}}if(e==="transform"){if(typeof t!="string")throw new Error("Invalid `transform` value.");let o={},i=t.replace(/(-?[\d.]+%)/g,(a,f)=>{let u=~~(Math.random()*1e9);return o[u]=f,u+"px"}),r=ht("transform",i,!0);for(let a of r.transform)for(let f in a)o[a[f]]&&(a[f]=o[a[f]]);return r}if(e==="background")return t=t.toString().trim(),/^(linear-gradient|radial-gradient|url|repeating-linear-gradient|repeating-radial-gradient)\(/.test(t)?ht("backgroundImage",t,!0):ht("background",t,!0);if(e==="textShadow"){t=t.toString().trim();let o={},i=fn(t);for(let r of i){let a=ht("textShadow",r,!0);for(let f in a)o[f]?o[f].push(a[f]):o[f]=[a[f]]}return o}if(e==="WebkitTextStroke"){t=t.toString().trim();let o=t.split(" ");if(o.length!==2)throw new Error("Invalid `WebkitTextStroke` value.");return{WebkitTextStrokeWidth:wt(e,o[0]),WebkitTextStrokeColor:wt(e,o[1])}}if(e==="backdropFilter"||e==="WebkitBackdropFilter")return{backdropFilter:t};if(e==="textDecorationSkipInk"){let o=t.toString().trim().toLowerCase();if(!["auto","none","all"].includes(o))throw new Error("Invalid `textDecorationSkipInk` value.");return{textDecorationSkipInk:o}}}function ro(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}var oo=/rgb\((\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\.\d]+)\)/;function ao(e){if(typeof e=="string"&&oo.test(e.trim()))return e.trim().replace(oo,(t,n,o,i,r)=>`rgba(${n}, ${o}, ${i}, ${r})`);if(typeof e=="object"&&e!==null){for(let t in e)e[t]=ao(e[t]);return e}return e}function yn(e,t){let n={},o={};for(let u in t)u.startsWith("--")&&(o[u]=String(t[u]));let i={},r=e;if(e){let{variables:u,remainingStyle:d}=to(e);i=u,r=d}let a=no(o,i);for(let u in a)n[u]=a[u];if(r){let u=r.color?Xt(r.color,a):void 0,d=Ui(u,t.color);n.color=d;for(let c in r){if(c.startsWith("_")){n[c]=r[c];continue}if(c==="color")continue;let p=Li(c),g=Xt(r[c],a),b=ji(g,d);try{let x=Gi(p,b,d)||$i(p,ht(p,wt(p,b),!0),b,d);Object.assign(n,x)}catch(x){throw new Error(x.message+(x.message.includes(b)?`
1
+ var Xo=Object.defineProperty;var Gt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yo=(e,t)=>{for(var n in t)Xo(e,n,{get:t[n],enumerable:!0})};function Nr(e){e=e||{};var t;t||(t=typeof e<"u"?e:{});var n,o;t.ready=new Promise(function(u,l){n=u,o=l});var i=Object.assign({},t),r="";typeof document<"u"&&document.currentScript&&(r=document.currentScript.src),Wr&&(r=Wr),r.indexOf("blob:")!==0?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="";var a=t.print||console.log.bind(console),f=t.printErr||console.warn.bind(console);Object.assign(t,i),i=null;var s;t.wasmBinary&&(s=t.wasmBinary);var d=t.noExitRuntime||!0;typeof WebAssembly!="object"&&se("no native wasm support detected");var c,p=!1;function g(u,l,m){m=l+m;for(var h="";!(l>=m);){var y=u[l++];if(!y)break;if(y&128){var w=u[l++]&63;if((y&224)==192)h+=String.fromCharCode((y&31)<<6|w);else{var k=u[l++]&63;y=(y&240)==224?(y&15)<<12|w<<6|k:(y&7)<<18|w<<12|k<<6|u[l++]&63,65536>y?h+=String.fromCharCode(y):(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023))}}else h+=String.fromCharCode(y)}return h}var b,x,E,C,N,P,v,S,T;function M(){var u=c.buffer;b=u,t.HEAP8=x=new Int8Array(u),t.HEAP16=C=new Int16Array(u),t.HEAP32=P=new Int32Array(u),t.HEAPU8=E=new Uint8Array(u),t.HEAPU16=N=new Uint16Array(u),t.HEAPU32=v=new Uint32Array(u),t.HEAPF32=S=new Float32Array(u),t.HEAPF64=T=new Float64Array(u)}var B,U=[],j=[],ie=[];function ce(){var u=t.preRun.shift();U.unshift(u)}var be=0,ae=null,fe=null;function se(u){throw t.onAbort&&t.onAbort(u),u="Aborted("+u+")",f(u),p=!0,u=new WebAssembly.RuntimeError(u+". Build with -sASSERTIONS for more info."),o(u),u}function ke(u){return u.startsWith("data:application/octet-stream;base64,")}var Y="";if(!ke(Y)){var H=Y;Y=t.locateFile?t.locateFile(H,r):r+H}function Ie(){var u=Y;try{if(u==Y&&s)return new Uint8Array(s);if(ke(u))try{var l=Vo(u.slice(37)),m=new Uint8Array(l.length);for(u=0;u<l.length;++u)m[u]=l.charCodeAt(u);var h=m}catch{throw Error("Converting base64 string to bytes failed.")}else h=void 0;var y=h;if(y)return y;throw"both async and sync fetching of the wasm failed"}catch(w){se(w)}}function De(){return s||typeof fetch!="function"?Promise.resolve().then(function(){return Ie()}):fetch(Y,{credentials:"same-origin"}).then(function(u){if(!u.ok)throw"failed to load wasm binary file at '"+Y+"'";return u.arrayBuffer()}).catch(function(){return Ie()})}function ue(u){for(;0<u.length;)u.shift()(t)}function Se(u){if(u===void 0)return"_unknown";u=u.replace(/[^a-zA-Z0-9_]/g,"$");var l=u.charCodeAt(0);return 48<=l&&57>=l?"_"+u:u}function We(u,l){return u=Se(u),function(){return l.apply(this,arguments)}}var W=[{},{value:void 0},{value:null},{value:!0},{value:!1}],ne=[];function z(u){var l=Error,m=We(u,function(h){this.name=u,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
2
+ `+h.replace(/^Error(:[^\n]*)?\n/,""))});return m.prototype=Object.create(l.prototype),m.prototype.constructor=m,m.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},m}var re=void 0;function O(u){throw new re(u)}var oe=u=>(u||O("Cannot use deleted val. handle = "+u),W[u].value),de=u=>{switch(u){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var l=ne.length?ne.pop():W.length;return W[l]={ga:1,value:u},l}},Ee=void 0,Te=void 0;function Z(u){for(var l="";E[u];)l+=Te[E[u++]];return l}var Re=[];function ye(){for(;Re.length;){var u=Re.pop();u.M.$=!1,u.delete()}}var Oe=void 0,we={};function Et(u,l){for(l===void 0&&O("ptr should not be undefined");u.R;)l=u.ba(l),u=u.R;return l}var nt={};function Nt(u){u=gr(u);var l=Z(u);return st(u),l}function gt(u,l){var m=nt[u];return m===void 0&&O(l+" has unknown type "+Nt(u)),m}function Tt(){}var Rt=!1;function bt(u){--u.count.value,u.count.value===0&&(u.T?u.U.W(u.T):u.P.N.W(u.O))}function rt(u,l,m){return l===m?u:m.R===void 0?null:(u=rt(u,l,m.R),u===null?null:m.na(u))}var Ye={};function Ue(u,l){return l=Et(u,l),we[l]}var yt=void 0;function Ne(u){throw new yt(u)}function qe(u,l){return l.P&&l.O||Ne("makeClassHandle requires ptr and ptrType"),!!l.U!=!!l.T&&Ne("Both smartPtrType and smartPtr must be specified"),l.count={value:1},Ke(Object.create(u,{M:{value:l}}))}function Ke(u){return typeof FinalizationRegistry>"u"?(Ke=l=>l,u):(Rt=new FinalizationRegistry(l=>{bt(l.M)}),Ke=l=>{var m=l.M;return m.T&&Rt.register(l,{M:m},l),l},Tt=l=>{Rt.unregister(l)},Ke(u))}var xt={};function dt(u){for(;u.length;){var l=u.pop();u.pop()(l)}}function Ae(u){return this.fromWireType(P[u>>2])}var ze={},Fe={};function Je(u,l,m){function h(I){I=m(I),I.length!==u.length&&Ne("Mismatched type converter count");for(var A=0;A<u.length;++A)$(u[A],I[A])}u.forEach(function(I){Fe[I]=l});var y=Array(l.length),w=[],k=0;l.forEach((I,A)=>{nt.hasOwnProperty(I)?y[A]=nt[I]:(w.push(I),ze.hasOwnProperty(I)||(ze[I]=[]),ze[I].push(()=>{y[A]=nt[I],++k,k===w.length&&h(y)}))}),w.length===0&&h(y)}function G(u){switch(u){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+u)}}function $(u,l,m={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");var h=l.name;if(u||O('type "'+h+'" must have a positive integer typeid pointer'),nt.hasOwnProperty(u)){if(m.ua)return;O("Cannot register type '"+h+"' twice")}nt[u]=l,delete Fe[u],ze.hasOwnProperty(u)&&(l=ze[u],delete ze[u],l.forEach(y=>y()))}function ee(u){O(u.M.P.N.name+" instance already deleted")}function X(){}function le(u,l,m){if(u[l].S===void 0){var h=u[l];u[l]=function(){return u[l].S.hasOwnProperty(arguments.length)||O("Function '"+m+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+u[l].S+")!"),u[l].S[arguments.length].apply(this,arguments)},u[l].S=[],u[l].S[h.Z]=h}}function Q(u,l){t.hasOwnProperty(u)?(O("Cannot register public name '"+u+"' twice"),le(t,u,u),t.hasOwnProperty(void 0)&&O("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),t[u].S[void 0]=l):t[u]=l}function pe(u,l,m,h,y,w,k,I){this.name=u,this.constructor=l,this.X=m,this.W=h,this.R=y,this.pa=w,this.ba=k,this.na=I,this.ja=[]}function q(u,l,m){for(;l!==m;)l.ba||O("Expected null or instance of "+m.name+", got an instance of "+l.name),u=l.ba(u),l=l.R;return u}function K(u,l){return l===null?(this.ea&&O("null is not a valid "+this.name),0):(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),q(l.M.O,l.M.P.N,this.N))}function je(u,l){if(l===null){if(this.ea&&O("null is not a valid "+this.name),this.da){var m=this.fa();return u!==null&&u.push(this.W,m),m}return 0}if(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&l.M.P.ca&&O("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name),m=q(l.M.O,l.M.P.N,this.N),this.da)switch(l.M.T===void 0&&O("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:l.M.U===this?m=l.M.T:O("Cannot convert argument of type "+(l.M.U?l.M.U.name:l.M.P.name)+" to parameter type "+this.name);break;case 1:m=l.M.T;break;case 2:if(l.M.U===this)m=l.M.T;else{var h=l.clone();m=this.xa(m,de(function(){h.delete()})),u!==null&&u.push(this.W,m)}break;default:O("Unsupporting sharing policy")}return m}function V(u,l){return l===null?(this.ea&&O("null is not a valid "+this.name),0):(l.M||O('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||O("Cannot pass deleted object as a pointer of type "+this.name),l.M.P.ca&&O("Cannot convert argument of type "+l.M.P.name+" to parameter type "+this.name),q(l.M.O,l.M.P.N,this.N))}function ve(u,l,m,h){this.name=u,this.N=l,this.ea=m,this.ca=h,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,l.R!==void 0?this.toWireType=je:(this.toWireType=h?K:V,this.V=null)}function Ce(u,l){t.hasOwnProperty(u)||Ne("Replacing nonexistant public symbol"),t[u]=l,t[u].Z=void 0}function Ot(u,l){var m=[];return function(){if(m.length=0,Object.assign(m,arguments),u.includes("j")){var h=t["dynCall_"+u];h=m&&m.length?h.apply(null,[l].concat(m)):h.call(null,l)}else h=B.get(l).apply(null,m);return h}}function ge(u,l){u=Z(u);var m=u.includes("j")?Ot(u,l):B.get(l);return typeof m!="function"&&O("unknown function pointer with signature "+u+": "+l),m}var St=void 0;function _e(u,l){function m(w){y[w]||nt[w]||(Fe[w]?Fe[w].forEach(m):(h.push(w),y[w]=!0))}var h=[],y={};throw l.forEach(m),new St(u+": "+h.map(Nt).join([", "]))}function at(u,l,m,h,y){var w=l.length;2>w&&O("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=l[1]!==null&&m!==null,I=!1;for(m=1;m<l.length;++m)if(l[m]!==null&&l[m].V===void 0){I=!0;break}var A=l[0].name!=="void",_=w-2,L=Array(_),F=[],J=[];return function(){if(arguments.length!==_&&O("function "+u+" called with "+arguments.length+" arguments, expected "+_+" args!"),J.length=0,F.length=k?2:1,F[0]=y,k){var xe=l[1].toWireType(J,this);F[1]=xe}for(var te=0;te<_;++te)L[te]=l[te+2].toWireType(J,arguments[te]),F.push(L[te]);if(te=h.apply(null,F),I)dt(J);else for(var Ge=k?1:2;Ge<l.length;Ge++){var et=Ge===1?xe:L[Ge-2];l[Ge].V!==null&&l[Ge].V(et)}return xe=A?l[0].fromWireType(te):void 0,xe}}function me(u,l){for(var m=[],h=0;h<u;h++)m.push(v[l+4*h>>2]);return m}function he(u){4<u&&--W[u].ga===0&&(W[u]=void 0,ne.push(u))}function Be(u){if(u===null)return"null";var l=typeof u;return l==="object"||l==="array"||l==="function"?u.toString():""+u}function $e(u,l){switch(l){case 2:return function(m){return this.fromWireType(S[m>>2])};case 3:return function(m){return this.fromWireType(T[m>>3])};default:throw new TypeError("Unknown float type: "+u)}}function Ze(u,l,m){switch(l){case 0:return m?function(h){return x[h]}:function(h){return E[h]};case 1:return m?function(h){return C[h>>1]}:function(h){return N[h>>1]};case 2:return m?function(h){return P[h>>2]}:function(h){return v[h>>2]};default:throw new TypeError("Unknown integer type: "+u)}}function Qe(u,l){for(var m="",h=0;!(h>=l/2);++h){var y=C[u+2*h>>1];if(y==0)break;m+=String.fromCharCode(y)}return m}function Me(u,l,m){if(m===void 0&&(m=2147483647),2>m)return 0;m-=2;var h=l;m=m<2*u.length?m/2:u.length;for(var y=0;y<m;++y)C[l>>1]=u.charCodeAt(y),l+=2;return C[l>>1]=0,l-h}function Ve(u){return 2*u.length}function Ft(u,l){for(var m=0,h="";!(m>=l/4);){var y=P[u+4*m>>2];if(y==0)break;++m,65536<=y?(y-=65536,h+=String.fromCharCode(55296|y>>10,56320|y&1023)):h+=String.fromCharCode(y)}return h}function kt(u,l,m){if(m===void 0&&(m=2147483647),4>m)return 0;var h=l;m=h+m-4;for(var y=0;y<u.length;++y){var w=u.charCodeAt(y);if(55296<=w&&57343>=w){var k=u.charCodeAt(++y);w=65536+((w&1023)<<10)|k&1023}if(P[l>>2]=w,l+=4,l+4>m)break}return P[l>>2]=0,l-h}function rn(u){for(var l=0,m=0;m<u.length;++m){var h=u.charCodeAt(m);55296<=h&&57343>=h&&++m,l+=4}return l}var on={};function Bt(u){var l=on[u];return l===void 0?Z(u):l}var an=[];function Uo(u){var l=an.length;return an.push(u),l}function zo(u,l){for(var m=Array(u),h=0;h<u;++h)m[h]=gt(v[l+4*h>>2],"parameter "+h);return m}var mr=[],jo=[null,[],[]];re=t.BindingError=z("BindingError"),t.count_emval_handles=function(){for(var u=0,l=5;l<W.length;++l)W[l]!==void 0&&++u;return u},t.get_first_emval=function(){for(var u=5;u<W.length;++u)if(W[u]!==void 0)return W[u];return null},Ee=t.PureVirtualError=z("PureVirtualError");for(var hr=Array(256),sn=0;256>sn;++sn)hr[sn]=String.fromCharCode(sn);Te=hr,t.getInheritedInstanceCount=function(){return Object.keys(we).length},t.getLiveInheritedInstances=function(){var u=[],l;for(l in we)we.hasOwnProperty(l)&&u.push(we[l]);return u},t.flushPendingDeletes=ye,t.setDelayFunction=function(u){Oe=u,Re.length&&Oe&&Oe(ye)},yt=t.InternalError=z("InternalError"),X.prototype.isAliasOf=function(u){if(!(this instanceof X&&u instanceof X))return!1;var l=this.M.P.N,m=this.M.O,h=u.M.P.N;for(u=u.M.O;l.R;)m=l.ba(m),l=l.R;for(;h.R;)u=h.ba(u),h=h.R;return l===h&&m===u},X.prototype.clone=function(){if(this.M.O||ee(this),this.M.aa)return this.M.count.value+=1,this;var u=Ke,l=Object,m=l.create,h=Object.getPrototypeOf(this),y=this.M;return u=u(m.call(l,h,{M:{value:{count:y.count,$:y.$,aa:y.aa,O:y.O,P:y.P,T:y.T,U:y.U}}})),u.M.count.value+=1,u.M.$=!1,u},X.prototype.delete=function(){this.M.O||ee(this),this.M.$&&!this.M.aa&&O("Object already scheduled for deletion"),Tt(this),bt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},X.prototype.isDeleted=function(){return!this.M.O},X.prototype.deleteLater=function(){return this.M.O||ee(this),this.M.$&&!this.M.aa&&O("Object already scheduled for deletion"),Re.push(this),Re.length===1&&Oe&&Oe(ye),this.M.$=!0,this},ve.prototype.qa=function(u){return this.ka&&(u=this.ka(u)),u},ve.prototype.ha=function(u){this.W&&this.W(u)},ve.prototype.argPackAdvance=8,ve.prototype.readValueFromPointer=Ae,ve.prototype.deleteObject=function(u){u!==null&&u.delete()},ve.prototype.fromWireType=function(u){function l(){return this.da?qe(this.N.X,{P:this.wa,O:m,U:this,T:u}):qe(this.N.X,{P:this,O:u})}var m=this.qa(u);if(!m)return this.ha(u),null;var h=Ue(this.N,m);if(h!==void 0)return h.M.count.value===0?(h.M.O=m,h.M.T=u,h.clone()):(h=h.clone(),this.ha(u),h);if(h=this.N.pa(m),h=Ye[h],!h)return l.call(this);h=this.ca?h.la:h.pointerType;var y=rt(m,this.N,h.N);return y===null?l.call(this):this.da?qe(h.N.X,{P:h,O:y,U:this,T:u}):qe(h.N.X,{P:h,O:y})},St=t.UnboundTypeError=z("UnboundTypeError");var Vo=typeof atob=="function"?atob:function(u){var l="",m=0;u=u.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++)),k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u.charAt(m++));h=h<<2|y>>4,y=(y&15)<<4|w>>2;var I=(w&3)<<6|k;l+=String.fromCharCode(h),w!==64&&(l+=String.fromCharCode(y)),k!==64&&(l+=String.fromCharCode(I))}while(m<u.length);return l},Ho={l:function(u,l,m,h){se("Assertion failed: "+(u?g(E,u):"")+", at: "+[l?l?g(E,l):"":"unknown filename",m,h?h?g(E,h):"":"unknown function"])},q:function(u,l,m){u=Z(u),l=gt(l,"wrapper"),m=oe(m);var h=[].slice,y=l.N,w=y.X,k=y.R.X,I=y.R.constructor;u=We(u,function(){y.R.ja.forEach(function(_){if(this[_]===k[_])throw new Ee("Pure virtual function "+_+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:w}),this.__construct.apply(this,h.call(arguments))}),w.__construct=function(){this===w&&O("Pass correct 'this' to __construct");var _=I.implement.apply(void 0,[this].concat(h.call(arguments)));Tt(_);var L=_.M;_.notifyOnDestruction(),L.aa=!0,Object.defineProperties(this,{M:{value:L}}),Ke(this),_=L.O,_=Et(y,_),we.hasOwnProperty(_)?O("Tried to register registered instance: "+_):we[_]=this},w.__destruct=function(){this===w&&O("Pass correct 'this' to __destruct"),Tt(this);var _=this.M.O;_=Et(y,_),we.hasOwnProperty(_)?delete we[_]:O("Tried to unregister unregistered instance: "+_)},u.prototype=Object.create(w);for(var A in m)u.prototype[A]=m[A];return de(u)},j:function(u){var l=xt[u];delete xt[u];var m=l.fa,h=l.W,y=l.ia,w=y.map(k=>k.ta).concat(y.map(k=>k.za));Je([u],w,k=>{var I={};return y.forEach((A,_)=>{var L=k[_],F=A.ra,J=A.sa,xe=k[_+y.length],te=A.ya,Ge=A.Aa;I[A.oa]={read:et=>L.fromWireType(F(J,et)),write:(et,$t)=>{var ut=[];te(Ge,et,xe.toWireType(ut,$t)),dt(ut)}}}),[{name:l.name,fromWireType:function(A){var _={},L;for(L in I)_[L]=I[L].read(A);return h(A),_},toWireType:function(A,_){for(var L in I)if(!(L in _))throw new TypeError('Missing field: "'+L+'"');var F=m();for(L in I)I[L].write(F,_[L]);return A!==null&&A.push(h,F),F},argPackAdvance:8,readValueFromPointer:Ae,V:h}]})},v:function(){},B:function(u,l,m,h,y){var w=G(m);l=Z(l),$(u,{name:l,fromWireType:function(k){return!!k},toWireType:function(k,I){return I?h:y},argPackAdvance:8,readValueFromPointer:function(k){if(m===1)var I=x;else if(m===2)I=C;else if(m===4)I=P;else throw new TypeError("Unknown boolean type size: "+l);return this.fromWireType(I[k>>w])},V:null})},f:function(u,l,m,h,y,w,k,I,A,_,L,F,J){L=Z(L),w=ge(y,w),I&&(I=ge(k,I)),_&&(_=ge(A,_)),J=ge(F,J);var xe=Se(L);Q(xe,function(){_e("Cannot construct "+L+" due to unbound types",[h])}),Je([u,l,m],h?[h]:[],function(te){if(te=te[0],h)var Ge=te.N,et=Ge.X;else et=X.prototype;te=We(xe,function(){if(Object.getPrototypeOf(this)!==$t)throw new re("Use 'new' to construct "+L);if(ut.Y===void 0)throw new re(L+" has no accessible constructor");var xr=ut.Y[arguments.length];if(xr===void 0)throw new re("Tried to invoke ctor of "+L+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ut.Y).toString()+") parameters instead!");return xr.apply(this,arguments)});var $t=Object.create(et,{constructor:{value:te}});te.prototype=$t;var ut=new pe(L,te,$t,J,Ge,w,I,_);Ge=new ve(L,ut,!0,!1),et=new ve(L+"*",ut,!1,!1);var yr=new ve(L+" const*",ut,!1,!0);return Ye[u]={pointerType:et,la:yr},Ce(xe,te),[Ge,et,yr]})},d:function(u,l,m,h,y,w,k){var I=me(m,h);l=Z(l),w=ge(y,w),Je([],[u],function(A){function _(){_e("Cannot call "+L+" due to unbound types",I)}A=A[0];var L=A.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var F=A.N.constructor;return F[l]===void 0?(_.Z=m-1,F[l]=_):(le(F,l,L),F[l].S[m-1]=_),Je([],I,function(J){return J=at(L,[J[0],null].concat(J.slice(1)),null,w,k),F[l].S===void 0?(J.Z=m-1,F[l]=J):F[l].S[m-1]=J,[]}),[]})},p:function(u,l,m,h,y,w){0<l||se();var k=me(l,m);y=ge(h,y),Je([],[u],function(I){I=I[0];var A="constructor "+I.name;if(I.N.Y===void 0&&(I.N.Y=[]),I.N.Y[l-1]!==void 0)throw new re("Cannot register multiple constructors with identical number of parameters ("+(l-1)+") for class '"+I.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return I.N.Y[l-1]=()=>{_e("Cannot construct "+I.name+" due to unbound types",k)},Je([],k,function(_){return _.splice(1,0,null),I.N.Y[l-1]=at(A,_,null,y,w),[]}),[]})},a:function(u,l,m,h,y,w,k,I){var A=me(m,h);l=Z(l),w=ge(y,w),Je([],[u],function(_){function L(){_e("Cannot call "+F+" due to unbound types",A)}_=_[0];var F=_.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),I&&_.N.ja.push(l);var J=_.N.X,xe=J[l];return xe===void 0||xe.S===void 0&&xe.className!==_.name&&xe.Z===m-2?(L.Z=m-2,L.className=_.name,J[l]=L):(le(J,l,F),J[l].S[m-2]=L),Je([],A,function(te){return te=at(F,te,_,w,k),J[l].S===void 0?(te.Z=m-2,J[l]=te):J[l].S[m-2]=te,[]}),[]})},A:function(u,l){l=Z(l),$(u,{name:l,fromWireType:function(m){var h=oe(m);return he(m),h},toWireType:function(m,h){return de(h)},argPackAdvance:8,readValueFromPointer:Ae,V:null})},n:function(u,l,m){m=G(m),l=Z(l),$(u,{name:l,fromWireType:function(h){return h},toWireType:function(h,y){return y},argPackAdvance:8,readValueFromPointer:$e(l,m),V:null})},e:function(u,l,m,h,y){l=Z(l),y===-1&&(y=4294967295),y=G(m);var w=I=>I;if(h===0){var k=32-8*m;w=I=>I<<k>>>k}m=l.includes("unsigned")?function(I,A){return A>>>0}:function(I,A){return A},$(u,{name:l,fromWireType:w,toWireType:m,argPackAdvance:8,readValueFromPointer:Ze(l,y,h!==0),V:null})},b:function(u,l,m){function h(w){w>>=2;var k=v;return new y(b,k[w+1],k[w])}var y=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];m=Z(m),$(u,{name:m,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{ua:!0})},o:function(u,l){l=Z(l);var m=l==="std::string";$(u,{name:l,fromWireType:function(h){var y=v[h>>2],w=h+4;if(m)for(var k=w,I=0;I<=y;++I){var A=w+I;if(I==y||E[A]==0){if(k=k?g(E,k,A-k):"",_===void 0)var _=k;else _+="\0",_+=k;k=A+1}}else{for(_=Array(y),I=0;I<y;++I)_[I]=String.fromCharCode(E[w+I]);_=_.join("")}return st(h),_},toWireType:function(h,y){y instanceof ArrayBuffer&&(y=new Uint8Array(y));var w,k=typeof y=="string";if(k||y instanceof Uint8Array||y instanceof Uint8ClampedArray||y instanceof Int8Array||O("Cannot pass non-string to std::string"),m&&k){var I=0;for(w=0;w<y.length;++w){var A=y.charCodeAt(w);127>=A?I++:2047>=A?I+=2:55296<=A&&57343>=A?(I+=4,++w):I+=3}w=I}else w=y.length;if(I=An(4+w+1),A=I+4,v[I>>2]=w,m&&k){if(k=A,A=w+1,w=E,0<A){A=k+A-1;for(var _=0;_<y.length;++_){var L=y.charCodeAt(_);if(55296<=L&&57343>=L){var F=y.charCodeAt(++_);L=65536+((L&1023)<<10)|F&1023}if(127>=L){if(k>=A)break;w[k++]=L}else{if(2047>=L){if(k+1>=A)break;w[k++]=192|L>>6}else{if(65535>=L){if(k+2>=A)break;w[k++]=224|L>>12}else{if(k+3>=A)break;w[k++]=240|L>>18,w[k++]=128|L>>12&63}w[k++]=128|L>>6&63}w[k++]=128|L&63}}w[k]=0}}else if(k)for(k=0;k<w;++k)_=y.charCodeAt(k),255<_&&(st(A),O("String has UTF-16 code units that do not fit in 8 bits")),E[A+k]=_;else for(k=0;k<w;++k)E[A+k]=y[k];return h!==null&&h.push(st,I),I},argPackAdvance:8,readValueFromPointer:Ae,V:function(h){st(h)}})},i:function(u,l,m){if(m=Z(m),l===2)var h=Qe,y=Me,w=Ve,k=()=>N,I=1;else l===4&&(h=Ft,y=kt,w=rn,k=()=>v,I=2);$(u,{name:m,fromWireType:function(A){for(var _=v[A>>2],L=k(),F,J=A+4,xe=0;xe<=_;++xe){var te=A+4+xe*l;(xe==_||L[te>>I]==0)&&(J=h(J,te-J),F===void 0?F=J:(F+="\0",F+=J),J=te+l)}return st(A),F},toWireType:function(A,_){typeof _!="string"&&O("Cannot pass non-string to C++ string type "+m);var L=w(_),F=An(4+L+l);return v[F>>2]=L>>I,y(_,F+4,L+l),A!==null&&A.push(st,F),F},argPackAdvance:8,readValueFromPointer:Ae,V:function(A){st(A)}})},k:function(u,l,m,h,y,w){xt[u]={name:Z(l),fa:ge(m,h),W:ge(y,w),ia:[]}},h:function(u,l,m,h,y,w,k,I,A,_){xt[u].ia.push({oa:Z(l),ta:m,ra:ge(h,y),sa:w,za:k,ya:ge(I,A),Aa:_})},C:function(u,l){l=Z(l),$(u,{va:!0,name:l,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(u,l,m,h,y){u=an[u],l=oe(l),m=Bt(m);var w=[];return v[h>>2]=de(w),u(l,m,w,y)},t:function(u,l,m,h){u=an[u],l=oe(l),m=Bt(m),u(l,m,null,h)},g:he,m:function(u,l){var m=zo(u,l),h=m[0];l=h.name+"_$"+m.slice(1).map(function(k){return k.name}).join("_")+"$";var y=mr[l];if(y!==void 0)return y;var w=Array(u-1);return y=Uo((k,I,A,_)=>{for(var L=0,F=0;F<u-1;++F)w[F]=m[F+1].readValueFromPointer(_+L),L+=m[F+1].argPackAdvance;for(k=k[I].apply(k,w),F=0;F<u-1;++F)m[F+1].ma&&m[F+1].ma(w[F]);if(!h.va)return h.toWireType(A,k)}),mr[l]=y},D:function(u){4<u&&(W[u].ga+=1)},r:function(u){var l=oe(u);dt(l),he(u)},c:function(){se("")},x:function(u,l,m){E.copyWithin(u,l,l+m)},w:function(u){var l=E.length;if(u>>>=0,2147483648<u)return!1;for(var m=1;4>=m;m*=2){var h=l*(1+.2/m);h=Math.min(h,u+100663296);var y=Math;h=Math.max(u,h),y=y.min.call(y,2147483648,h+(65536-h%65536)%65536);e:{try{c.grow(y-b.byteLength+65535>>>16),M();var w=1;break e}catch{}w=void 0}if(w)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(u,l,m,h){for(var y=0,w=0;w<m;w++){var k=v[l>>2],I=v[l+4>>2];l+=8;for(var A=0;A<I;A++){var _=E[k+A],L=jo[u];_===0||_===10?((u===1?a:f)(g(L,0)),L.length=0):L.push(_)}y+=I}return v[h>>2]=y,0}};(function(){function u(y){t.asm=y.exports,c=t.asm.E,M(),B=t.asm.J,j.unshift(t.asm.F),be--,t.monitorRunDependencies&&t.monitorRunDependencies(be),be==0&&(ae!==null&&(clearInterval(ae),ae=null),fe&&(y=fe,fe=null,y()))}function l(y){u(y.instance)}function m(y){return De().then(function(w){return w instanceof WebAssembly.Instance?w:WebAssembly.instantiate(w,h)}).then(function(w){return w}).then(y,function(w){f("failed to asynchronously prepare wasm: "+w),se(w)})}var h={a:Ho};if(be++,t.monitorRunDependencies&&t.monitorRunDependencies(be),t.instantiateWasm)try{return t.instantiateWasm(h,u)}catch(y){f("Module.instantiateWasm callback failed with error: "+y),o(y)}return function(){return s||typeof WebAssembly.instantiateStreaming!="function"||ke(Y)||typeof fetch!="function"?m(l):fetch(Y,{credentials:"same-origin"}).then(function(y){return WebAssembly.instantiateStreaming(y,h).then(l,function(w){return f("wasm streaming compile failed: "+w),f("falling back to ArrayBuffer instantiation"),m(l)})})}().catch(o),{}})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.F).apply(null,arguments)};var gr=t.___getTypeName=function(){return(gr=t.___getTypeName=t.asm.G).apply(null,arguments)};t.__embind_initialize_bindings=function(){return(t.__embind_initialize_bindings=t.asm.H).apply(null,arguments)};var An=t._malloc=function(){return(An=t._malloc=t.asm.I).apply(null,arguments)},st=t._free=function(){return(st=t._free=t.asm.K).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.L).apply(null,arguments)};var un;fe=function u(){un||br(),un||(fe=u)};function br(){function u(){if(!un&&(un=!0,t.calledRun=!0,!p)){if(ue(j),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var l=t.postRun.shift();ie.unshift(l)}ue(ie)}}if(!(0<be)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)ce();ue(U),0<be||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),u()},1)):u())}}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return br(),e.ready}var Wr,Or=Gt(()=>{Wr=""});var ct,Fr,Br,zt,On,ft,Ct,ui,dn,Fn,Mt,Pt,Bn,$r,$n,Gn,tt,Dn,li,Gr,pn=Gt(()=>{ct=function(e){return e[e.Auto=0]="Auto",e[e.FlexStart=1]="FlexStart",e[e.Center=2]="Center",e[e.FlexEnd=3]="FlexEnd",e[e.Stretch=4]="Stretch",e[e.Baseline=5]="Baseline",e[e.SpaceBetween=6]="SpaceBetween",e[e.SpaceAround=7]="SpaceAround",e[e.SpaceEvenly=8]="SpaceEvenly",e}({}),Fr=function(e){return e[e.BorderBox=0]="BorderBox",e[e.ContentBox=1]="ContentBox",e}({}),Br=function(e){return e[e.Width=0]="Width",e[e.Height=1]="Height",e}({}),zt=function(e){return e[e.Inherit=0]="Inherit",e[e.LTR=1]="LTR",e[e.RTL=2]="RTL",e}({}),On=function(e){return e[e.Flex=0]="Flex",e[e.None=1]="None",e[e.Contents=2]="Contents",e}({}),ft=function(e){return e[e.Left=0]="Left",e[e.Top=1]="Top",e[e.Right=2]="Right",e[e.Bottom=3]="Bottom",e[e.Start=4]="Start",e[e.End=5]="End",e[e.Horizontal=6]="Horizontal",e[e.Vertical=7]="Vertical",e[e.All=8]="All",e}({}),Ct=function(e){return e[e.None=0]="None",e[e.StretchFlexBasis=1]="StretchFlexBasis",e[e.AbsolutePositionWithoutInsetsExcludesPadding=2]="AbsolutePositionWithoutInsetsExcludesPadding",e[e.AbsolutePercentAgainstInnerSize=4]="AbsolutePercentAgainstInnerSize",e[e.All=2147483647]="All",e[e.Classic=2147483646]="Classic",e}({}),ui=function(e){return e[e.WebFlexBasis=0]="WebFlexBasis",e}({}),dn=function(e){return e[e.Column=0]="Column",e[e.ColumnReverse=1]="ColumnReverse",e[e.Row=2]="Row",e[e.RowReverse=3]="RowReverse",e}({}),Fn=function(e){return e[e.Column=0]="Column",e[e.Row=1]="Row",e[e.All=2]="All",e}({}),Mt=function(e){return e[e.FlexStart=0]="FlexStart",e[e.Center=1]="Center",e[e.FlexEnd=2]="FlexEnd",e[e.SpaceBetween=3]="SpaceBetween",e[e.SpaceAround=4]="SpaceAround",e[e.SpaceEvenly=5]="SpaceEvenly",e}({}),Pt=function(e){return e[e.Error=0]="Error",e[e.Warn=1]="Warn",e[e.Info=2]="Info",e[e.Debug=3]="Debug",e[e.Verbose=4]="Verbose",e[e.Fatal=5]="Fatal",e}({}),Bn=function(e){return e[e.Undefined=0]="Undefined",e[e.Exactly=1]="Exactly",e[e.AtMost=2]="AtMost",e}({}),$r=function(e){return e[e.Default=0]="Default",e[e.Text=1]="Text",e}({}),$n=function(e){return e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.Scroll=2]="Scroll",e}({}),Gn=function(e){return e[e.Static=0]="Static",e[e.Relative=1]="Relative",e[e.Absolute=2]="Absolute",e}({}),tt=function(e){return e[e.Undefined=0]="Undefined",e[e.Point=1]="Point",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto",e}({}),Dn=function(e){return e[e.NoWrap=0]="NoWrap",e[e.Wrap=1]="Wrap",e[e.WrapReverse=2]="WrapReverse",e}({}),li={ALIGN_AUTO:ct.Auto,ALIGN_FLEX_START:ct.FlexStart,ALIGN_CENTER:ct.Center,ALIGN_FLEX_END:ct.FlexEnd,ALIGN_STRETCH:ct.Stretch,ALIGN_BASELINE:ct.Baseline,ALIGN_SPACE_BETWEEN:ct.SpaceBetween,ALIGN_SPACE_AROUND:ct.SpaceAround,ALIGN_SPACE_EVENLY:ct.SpaceEvenly,BOX_SIZING_BORDER_BOX:Fr.BorderBox,BOX_SIZING_CONTENT_BOX:Fr.ContentBox,DIMENSION_WIDTH:Br.Width,DIMENSION_HEIGHT:Br.Height,DIRECTION_INHERIT:zt.Inherit,DIRECTION_LTR:zt.LTR,DIRECTION_RTL:zt.RTL,DISPLAY_FLEX:On.Flex,DISPLAY_NONE:On.None,DISPLAY_CONTENTS:On.Contents,EDGE_LEFT:ft.Left,EDGE_TOP:ft.Top,EDGE_RIGHT:ft.Right,EDGE_BOTTOM:ft.Bottom,EDGE_START:ft.Start,EDGE_END:ft.End,EDGE_HORIZONTAL:ft.Horizontal,EDGE_VERTICAL:ft.Vertical,EDGE_ALL:ft.All,ERRATA_NONE:Ct.None,ERRATA_STRETCH_FLEX_BASIS:Ct.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:Ct.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:Ct.AbsolutePercentAgainstInnerSize,ERRATA_ALL:Ct.All,ERRATA_CLASSIC:Ct.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:ui.WebFlexBasis,FLEX_DIRECTION_COLUMN:dn.Column,FLEX_DIRECTION_COLUMN_REVERSE:dn.ColumnReverse,FLEX_DIRECTION_ROW:dn.Row,FLEX_DIRECTION_ROW_REVERSE:dn.RowReverse,GUTTER_COLUMN:Fn.Column,GUTTER_ROW:Fn.Row,GUTTER_ALL:Fn.All,JUSTIFY_FLEX_START:Mt.FlexStart,JUSTIFY_CENTER:Mt.Center,JUSTIFY_FLEX_END:Mt.FlexEnd,JUSTIFY_SPACE_BETWEEN:Mt.SpaceBetween,JUSTIFY_SPACE_AROUND:Mt.SpaceAround,JUSTIFY_SPACE_EVENLY:Mt.SpaceEvenly,LOG_LEVEL_ERROR:Pt.Error,LOG_LEVEL_WARN:Pt.Warn,LOG_LEVEL_INFO:Pt.Info,LOG_LEVEL_DEBUG:Pt.Debug,LOG_LEVEL_VERBOSE:Pt.Verbose,LOG_LEVEL_FATAL:Pt.Fatal,MEASURE_MODE_UNDEFINED:Bn.Undefined,MEASURE_MODE_EXACTLY:Bn.Exactly,MEASURE_MODE_AT_MOST:Bn.AtMost,NODE_TYPE_DEFAULT:$r.Default,NODE_TYPE_TEXT:$r.Text,OVERFLOW_VISIBLE:$n.Visible,OVERFLOW_HIDDEN:$n.Hidden,OVERFLOW_SCROLL:$n.Scroll,POSITION_TYPE_STATIC:Gn.Static,POSITION_TYPE_RELATIVE:Gn.Relative,POSITION_TYPE_ABSOLUTE:Gn.Absolute,UNIT_UNDEFINED:tt.Undefined,UNIT_POINT:tt.Point,UNIT_PERCENT:tt.Percent,UNIT_AUTO:tt.Auto,WRAP_NO_WRAP:Dn.NoWrap,WRAP_WRAP:Dn.Wrap,WRAP_WRAP_REVERSE:Dn.WrapReverse},Gr=li});function Un(e){function t(i,r,a){let f=i[r];i[r]=function(){for(var s=arguments.length,d=new Array(s),c=0;c<s;c++)d[c]=arguments[c];return a.call(this,f,...d)}}for(let i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding","setGap"]){let r={[tt.Point]:e.Node.prototype[i],[tt.Percent]:e.Node.prototype[`${i}Percent`],[tt.Auto]:e.Node.prototype[`${i}Auto`]};t(e.Node.prototype,i,function(a){for(var f=arguments.length,s=new Array(f>1?f-1:0),d=1;d<f;d++)s[d-1]=arguments[d];let c=s.pop(),p,g;if(c==="auto")p=tt.Auto,g=void 0;else if(typeof c=="object")p=c.unit,g=c.valueOf();else if(p=typeof c=="string"&&c.endsWith("%")?tt.Percent:tt.Point,g=parseFloat(c),c!==void 0&&!Number.isNaN(c)&&Number.isNaN(g))throw new Error(`Invalid value ${c} for ${i}`);if(!r[p])throw new Error(`Failed to execute "${i}": Unsupported unit '${c}'`);return g!==void 0?r[p].call(this,...s,g):r[p].call(this,...s)})}function n(i){return e.MeasureCallback.implement({measure:function(){let{width:r,height:a}=i(...arguments);return{width:r??NaN,height:a??NaN}}})}t(e.Node.prototype,"setMeasureFunc",function(i,r){return r?i.call(this,n(r)):this.unsetMeasureFunc()});function o(i){return e.DirtiedCallback.implement({dirtied:i})}return t(e.Node.prototype,"setDirtiedFunc",function(i,r){i.call(this,o(r))}),t(e.Config.prototype,"free",function(){e.Config.destroy(this)}),t(e.Node,"create",(i,r)=>r?e.Node.createWithConfig(r):e.Node.createDefault()),t(e.Node.prototype,"free",function(){e.Node.destroy(this)}),t(e.Node.prototype,"freeRecursive",function(){for(let i=0,r=this.getChildCount();i<r;++i)this.getChild(0).freeRecursive();this.free()}),t(e.Node.prototype,"calculateLayout",function(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:zt.LTR;return i.call(this,r,a,f)}),{Config:e.Config,Node:e.Node,...Gr}}var Dr=Gt(()=>{pn();pn()});async function Ur(e){return Un(await Nr(e))}var zr=Gt(()=>{Or();Dr();pn()});var jn={};Yo(jn,{getYoga:()=>mi,init:()=>pi});async function di(e,t){let n;if(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL?n=await fetch(e):n=await e,typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){n.headers.get("Content-Type")!=="application/wasm"&&console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}let i=await n.arrayBuffer();return await WebAssembly.instantiate(i,t)}let o=await WebAssembly.instantiate("buffer"in n?n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength):n,t);return o instanceof WebAssembly.Instance?{instance:o,module:n}:o}function pi(e){ci({instantiateWasm(t,n){return di(e,t).then(({instance:o})=>{n(o)}).catch(zn),{}}}).then(jr).catch(zn)}function mi(){return fi}var ci,jr,zn,fi,Vn=Gt(()=>{zr();ci=Ur,fi=new Promise((e,t)=>{jr=e,zn=t})});import ai from"linebreak";var Dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qo=Dt((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Ko=Dt((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Jo=Dt((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),Zo=Dt((e,t)=>{t.exports=["Hz","kHz"]}),Qo=Dt((e,t)=>{t.exports=["s","ms"]}),ei=qo(),Sr=Ko(),wr=Jo(),vr=Zo(),Er=Qo();function Mn(e){if(/\.\D?$/.test(e))throw new Error("The dot should be followed by a number");if(/^[+-]{2}/.test(e))throw new Error("Only one leading +/- is allowed");if(ti(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=Cn(e),this.unit="%";return}var t=ri(e);if(!t){this.type="number",this.value=Cn(e);return}this.type=ii(t),this.value=Cn(e.substr(0,e.length-t.length)),this.unit=t}Mn.prototype.valueOf=function(){return this.value};Mn.prototype.toString=function(){return this.value+(this.unit||"")};function He(e){return new Mn(e)}function ti(e){var t=e.match(/\./g);return t?t.length:0}function Cn(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var ni=[].concat(Sr,vr,ei,wr,Er);function ri(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&ni.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var oi=Object.assign(ln(Sr,"angle"),ln(vr,"frequency"),ln(wr,"resolution"),ln(Er,"time"));function ln(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function ii(e){return oi[e]||"length"}function _t(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function Tr(e){return/^class\s/.test(e.toString())}function Wn(e){return e&&e.$$typeof===Symbol.for("react.forward_ref")}function Rr(e){return typeof e=="function"||Wn(e)}function kr(e){return"dangerouslySetInnerHTML"in e}function Ir(e){let t=typeof e>"u"?[]:[].concat(e).flat(1/0),n=[];for(let o=0;o<t.length;o++){let i=t[o];typeof i>"u"||typeof i=="boolean"||i===null||(typeof i=="number"&&(i=String(i)),typeof i=="string"&&n.length&&typeof n[n.length-1]=="string"?n[n.length-1]+=i:n.push(i))}return n}function D(e,t,n,o,i=!1){if(typeof e=="number")return e;try{if(e=e.trim(),/[ /\(,]/.test(e))return;if(e===String(+e))return+e;let r=new He(e);if(r.type==="length")switch(r.unit){case"em":return r.value*t;case"rem":return r.value*16;case"vw":return~~(r.value*o._viewportWidth/100);case"vh":return~~(r.value*o._viewportHeight/100);default:return r.value}else{if(r.type==="angle")return Nn(e);if(r.type==="percentage"&&i)return r.value/100*n}}catch{}}function Nn(e){let t=new He(e);switch(t.unit){case"deg":return t.value;case"rad":return t.value*180/Math.PI;case"turn":return t.value*360;case"grad":return .9*t.value}}function Ut(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function Le(e,t,n,o){let i=t[e];if(typeof i>"u"){if(o&&typeof e<"u")throw new Error(`Invalid value for CSS property "${o}". Allowed values: ${Object.keys(t).map(r=>`"${r}"`).join(" | ")}. Received: "${e}".`);i=n}return i}var Pn,Ln,_r=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e)),It=new Map,si=500;function Pe(e,t,n){let o=`${t}:${n||""}:${e}`;if(It.has(o))return It.get(o);if(!Pn||!Ln){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Pn=new Intl.Segmenter(n,{granularity:"word"}),Ln=new Intl.Segmenter(n,{granularity:"grapheme"})}let i;if(t==="grapheme")i=[...Ln.segment(e)].map(r=>r.segment);else{let r=[...Pn.segment(e)].map(s=>s.segment),a=[],f=0;for(;f<r.length;){let s=r[f];if(s=="\xA0"){let d=f===0?"":a.pop(),c=f===r.length-1?"":r[f+1];a.push(d+"\xA0"+c),f+=2}else a.push(s),f++}i=a}if(It.size>=si){let r=It.keys().next().value;It.delete(r)}return It.set(o,i),i}function R(e,t,n){let o="";for(let[i,r]of Object.entries(t))typeof r<"u"&&(o+=` ${i}="${r}"`);return n?`<${e}${o}>${n}</${e}>`:`<${e}${o}/>`}function Ar(e=20){let t=new Map;function n(r){let a=t.get(r);if(a!==void 0)return t.delete(r),t.set(r,a),a}function o(r,a){if(t.has(r))t.delete(r);else if(t.size>=e){let f=t.keys().next().value;t.delete(f)}t.set(r,a)}function i(){t.clear()}return{set:o,get:n,clear:i}}function At(e){return e?e.split(/[, ]/).filter(Boolean).map(Number):null}function cn(e){return typeof e=="string"}function Cr(e){return typeof e=="number"}function Mr(e){return typeof e>"u"}function lt(e,t){if(typeof e=="number")return e;if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number or a percentage value (e.g., "50%").`)}function pt(e,t){if(typeof e=="number")return e;if(e==="auto")return"auto";if(e.endsWith("%")){let n=parseFloat(e.slice(0,-1));if(isNaN(n)){console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a percentage value (e.g., "50%").`);return}return`${n}%`}console.warn(`Invalid value "${e}"${typeof t=="string"?` for "${t}"`:""}. Expected a number, "auto", or a percentage value (e.g., "50%").`)}function Pr(e,t){if(t==="break-all")return{words:Pe(e,"grapheme"),requiredBreaks:[]};if(t==="keep-all")return{words:Pe(e,"word"),requiredBreaks:[]};let n=new ai(e),o=0,i=n.nextBreak(),r=[],a=[!1];for(;i;){let f=e.slice(o,i.position);r.push(f),i.required?a.push(!0):a.push(!1),o=i.position,i=n.nextBreak()}return{words:r,requiredBreaks:a}}var Lr=e=>e.replaceAll(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`);function fn(e,t=","){let n=[],o=0,i=0;t=new RegExp(t);for(let r=0;r<e.length;r++)e[r]==="("?i++:e[r]===")"&&i--,i===0&&t.test(e[r])&&(n.push(e.slice(o,r).trim()),o=r+1);return n.push(e.slice(o).trim()),n}function hi(e){return Promise.resolve().then(()=>(Vn(),jn)).then(t=>t.init(e))}function mt(){return Promise.resolve().then(()=>(Vn(),jn)).then(e=>e.getYoga())}var gi="image/avif",bi="image/webp",mn="image/apng",hn="image/png",gn="image/jpeg",bn="image/gif",Hn="image/svg+xml";function Xr(e){let t=new DataView(e),n=4,o=t.byteLength;for(;n<o;){let i=t.getUint16(n,!1);if(i>o)throw new TypeError("Invalid JPEG");let r=t.getUint8(i+1+n);if(r===192||r===193||r===194)return[t.getUint16(i+7+n,!1),t.getUint16(i+5+n,!1)];n+=i+2}throw new TypeError("Invalid JPEG")}function Yr(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function qr(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var ot=Ar(500),jt=new Map,yi=[hn,mn,gn,bn,Hn],xi=/<svg[^>]*>/i,Si=/viewBox=['"]([^'"]+)['"]/,wi=/width=['"](\d*\.?\d+)['"]/,vi=/height=['"](\d*\.?\d+)['"]/;function Ei(e){let t=new Uint8Array(e),n=32768,o="";for(let i=0;i<t.length;i+=n){let r=t.subarray(i,Math.min(i+n,t.length));o+=String.fromCharCode(...r)}return btoa(o)}function Ti(e){let t=atob(e),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.charCodeAt(i);return o.buffer}function Vr(e,t){let n=t.match(xi);if(!n)throw new Error(`Failed to parse SVG from ${e}`);let o=n[0],i=Si.exec(o),r=wi.exec(o),a=vi.exec(o),f=i?At(i[1]):null;if(!f&&(!r||!a))throw new Error(`Failed to parse SVG from ${e}: missing "viewBox"`);let s=f?[f[2],f[3]]:[+r[1],+a[1]],d=s[0]/s[1];return r&&a?[+r[1],+a[1]]:r?[+r[1],+r[1]/d]:a?[+a[1]*d,+a[1]]:[s[0],s[1]]}function Hr(e){let t,n=Ri(new Uint8Array(e));switch(n){case hn:case mn:t=qr(e);break;case bn:t=Yr(e);break;case gn:t=Xr(e);break}if(!yi.includes(n))throw new Error(`Unsupported image type: ${n||"unknown"}`);return[`data:${n};base64,${Ei(e)}`,t]}async function Lt(e){if(!e)throw new Error("Image source is not provided.");if(typeof e=="object"){let[i,r]=Hr(e);return[i,...r]}if((e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),typeof window>"u"&&!e.startsWith("http")&&!e.startsWith("data:"))throw new Error(`Image source must be an absolute URL: ${e}`);if(e.startsWith("data:")){let i;try{i=/data:(?<imageType>[a-z/+]+)(;[^;=]+=[^;=]+)*?(;(?<encodingType>[^;,]+))?,(?<dataString>.*)/g.exec(e).groups}catch{return console.warn("Image data URI resolved without size:"+e),[e]}let{imageType:r,encodingType:a,dataString:f}=i;if(r===Hn){let s=a==="base64"?atob(f):decodeURIComponent(f.replace(/ /g,"%20")),d=a==="base64"?e:`data:image/svg+xml;base64,${btoa(s)}`,c=Vr(e,s);return ot.set(e,[d,...c]),[d,...c]}else if(a==="base64"){let s,d=Ti(f);switch(r){case hn:case mn:s=qr(d);break;case bn:s=Yr(d);break;case gn:s=Xr(d);break}return ot.set(e,[e,...s]),[e,...s]}else return console.warn("Image data URI resolved without size:"+e),ot.set(e,[e]),[e]}if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(jt.has(e))return jt.get(e);let t=ot.get(e);if(t)return t;let n=e,o=fetch(n).then(i=>{let r=i.headers.get("content-type");return r==="image/svg+xml"||r==="application/svg+xml"?i.text():i.arrayBuffer()}).then(i=>{if(typeof i=="string")try{let f=`data:image/svg+xml;base64,${btoa(i)}`,s=Vr(n,i);return[f,...s]}catch(f){throw new Error(`Failed to parse SVG image: ${f.message}`)}let[r,a]=Hr(i);return[r,...a]}).then(i=>(ot.set(n,i),i)).catch(i=>(console.error(`Can't load image ${n}: `+i.message),ot.set(n,[]),[]));return jt.set(n,o),o}function Ri(e){return[255,216,255].every((t,n)=>e[n]===t)?gn:[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)?ki(e)?mn:hn:[71,73,70,56].every((t,n)=>e[n]===t)?bn:[82,73,70,70,0,0,0,0,87,69,66,80].every((t,n)=>!t||e[n]===t)?bi:[60,63,120,109,108].every((t,n)=>e[n]===t)?Hn:[0,0,0,0,102,116,121,112,97,118,105,102].every((t,n)=>!t||e[n]===t)?gi:null}function ki(e){let t=new DataView(e.buffer),n,o,i=8,r=!1;for(;!r&&n!=="IEND"&&i<e.length;){o=t.getUint32(i);let a=e.subarray(i+4,i+8);n=String.fromCharCode(...a),r=n==="acTL",i+=12+o}return r}var Xn={accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",href:"href",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space",xmlnsXlink:"xmlns:xlink"},Ii=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Yn(e,t){if(!e)return"";if(Array.isArray(e))return e.map(d=>Yn(d,t)).join("");if(typeof e!="object")return String(e);let n=e.type;if(n==="text")throw new Error("<text> nodes are not currently supported, please convert them to <path>");let{children:o,style:i,...r}=e.props||{},a=(i==null?void 0:i.color)||t,f=`${Object.entries(r).map(([d,c])=>(typeof c=="string"&&c.toLowerCase()==="currentcolor"&&(c=a),(d==="href"||d==="xlinkHref")&&n==="image"?` ${Xn[d]||d}="${ot.get(c)[0]}"`:` ${Xn[d]||d}="${c}"`)).join("")}`,s=i?` style="${Object.entries(i).map(([d,c])=>`${Lr(d)}:${c}`).join(";")}"`:"";return`<${n}${f}${s}>${Yn(o,a)}</${n}>`}async function Kr(e){let t=new Set,n=o=>{if(o&&_t(o)){if(Array.isArray(o)){o.forEach(i=>n(i));return}else if(typeof o=="object")if(o.type==="image"){let i=o.props.href||o.props.xlinkHref;i&&(t.has(i)||t.add(i))}else o.type==="img"&&(t.has(o.props.src)||t.add(o.props.src));Array.isArray(o.props.children)?o.props.children.map(i=>n(i)):n(o.props.children)}};return n(e),Promise.all(Array.from(t).map(o=>Lt(o)))}async function Jr(e,t){let{viewBox:n,viewbox:o,width:i,height:r,className:a,style:f,children:s,...d}=e.props||{};n||=o,d.xmlns="http://www.w3.org/2000/svg";let c=(f==null?void 0:f.color)||t,p=At(n),g=p?p[3]/p[2]:null;return i=i||g&&r?r/g:null,r=r||g&&i?i*g:null,d.width=i,d.height=r,n&&(d.viewBox=n),`data:image/svg+xml;utf8,${`<svg ${Object.entries(d).map(([b,x])=>(typeof x=="string"&&x.toLowerCase()==="currentcolor"&&(x=c),` ${Xn[b]||b}="${x}"`)).join("")}>${Yn(s,c)}</svg>`.replace(Ii,encodeURIComponent)}`}var Xe="flex",Zr={p:{display:Xe,marginTop:"1em",marginBottom:"1em"},div:{display:Xe},blockquote:{display:Xe,marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:Xe,textAlign:"center"},hr:{display:Xe,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"solid"},h1:{display:Xe,fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:Xe,fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:Xe,fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:Xe,marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:Xe,fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:Xe,fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:Xe,fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var _i=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","textAlign","textIndent","textTransform","textShadowOffset","textShadowColor","textShadowRadius","WebkitTextStrokeWidth","WebkitTextStrokeColor","textDecorationLine","textDecorationStyle","textDecorationColor","textDecorationSkipInk","whiteSpace","transform","wordBreak","tabSize","opacity","filter","_viewportWidth","_viewportHeight","_inheritedClipPathId","_inheritedMaskId","_inheritedBackgroundClipTextPath","_inheritedBackgroundClipTextHasBackground"]);function qn(e){let t={};for(let n in e)(_i.has(n)||n.startsWith("--"))&&(t[n]=e[n]);return t}import{getPropertyName as Li,getStylesForProperty as ht}from"css-to-react-native";import{parseElementStyle as Wi}from"css-background-parser";import{parse as Ni}from"css-box-shadow";import Oi from"parse-css-color";import Ai from"postcss-value-parser";function Ci(e,t){try{let n=new He(e);switch(n.unit){case"px":return{absolute:n.value};case"em":return{absolute:n.value*t};case"rem":return{absolute:n.value*16};case"%":return{relative:n.value};default:return{}}}catch{return{}}}function Kn(e,t,n){switch(e){case"top":return{yRelative:0};case"left":return{xRelative:0};case"right":return{xRelative:100};case"bottom":return{yRelative:100};case"center":return{};default:{let o=Ci(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}}function Jn(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=Ai(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?Kn(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Kn(n[0],t,!0),...Kn(n[1],t,!1)}):{}}import{getPropertyName as Mi}from"css-to-react-native";function Vt(e,t){let n=Mi(`mask-${t}`);return e[n]||e[`WebkitM${n.substring(1)}`]}function Qr(e){let t=e.maskImage||e.WebkitMaskImage,n={position:Vt(e,"position")||"0% 0%",size:Vt(e,"size")||"100% 100%",repeat:Vt(e,"repeat")||"repeat",origin:Vt(e,"origin")||"border-box",clip:Vt(e,"origin")||"border-box"};return fn(t).filter(i=>i&&i!=="none").reverse().map(i=>({image:i,...n}))}import eo from"postcss-value-parser";function to(e){let t={},n={};for(let o in e)o.startsWith("--")?t[o]=String(e[o]):n[o]=e[o];return{variables:t,remainingStyle:n}}function no(e,t){return{...e,...t}}function Xt(e,t,n=new Set){if(typeof e!="string"||!e.includes("var("))return e;try{let o=eo(e),i=!1;if(o.walk(r=>{if(r.type==="function"&&r.value==="var"){i=!0;let a=Pi(r);if(!a)return;let{varName:f,fallback:s}=a;if(n.has(f)){console.warn(`Circular reference detected for CSS variable: ${f}`),s!==void 0?Ht(r,s):Ht(r,"initial");return}let d=t[f];if(d!==void 0){let c=new Set(n);c.add(f);let p=Xt(d,t,c);Ht(r,String(p))}else if(s!==void 0){let c=Xt(s,t,n);Ht(r,String(c))}else Ht(r,"initial")}}),i)return o.toString()}catch{console.warn(`Failed to parse CSS value for variable resolution: ${e}`)}return e}function Pi(e){if(!e.nodes||e.nodes.length===0)return null;let t,n=-1;for(let i=0;i<e.nodes.length;i++){let r=e.nodes[i];if(r.type==="word"&&!t)t=r;else if(r.type==="div"&&r.value===","){n=i;break}}if(!t||t.type!=="word")return null;let o=t.value.trim();if(n!==-1&&n<e.nodes.length-1){let i=e.nodes.slice(n+1),r=eo.stringify(i).trim();return{varName:o,fallback:r}}return{varName:o}}function Ht(e,t){e.type="word",e.value=t,delete e.nodes}var Fi=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),Bi=new Set(["lineHeight"]);function $i(e,t,n,o){return e==="textDecoration"&&!n.includes(t.textDecorationColor)&&(t.textDecorationColor=o),t}function wt(e,t){let n=Number(t);return isNaN(n)?t:Fi.has(e)?Bi.has(e)?n:String(t):n+"px"}function Gi(e,t,n){if(e==="zIndex")return console.warn("`z-index` is currently not supported."),{[e]:t};if(e==="lineHeight")return{lineHeight:wt(e,t)};if(e==="fontFamily")return{fontFamily:t.split(",").map(o=>o.trim().replace(/(^['"])|(['"]$)/g,"").toLocaleLowerCase())};if(e==="borderRadius"){if(typeof t!="string"||!t.includes("/"))return;let[o,i]=t.split("/"),r=ht(e,o,!0),a=ht(e,i,!0);for(let f in r)a[f]=wt(e,r[f])+" "+wt(e,a[f]);return a}if(/^border(Top|Right|Bottom|Left)?$/.test(e)){let o=ht("border",t,!0);o.borderWidth===1&&!String(t).includes("1px")&&(o.borderWidth=3),o.borderColor==="black"&&!String(t).includes("black")&&(o.borderColor=n);let i={Width:wt(e+"Width",o.borderWidth),Style:Le(o.borderStyle,{solid:"solid",dashed:"dashed"},"solid",e+"Style"),Color:o.borderColor},r={};for(let a of e==="border"?["Top","Right","Bottom","Left"]:[e.slice(6)])for(let f in i)r["border"+a+f]=i[f];return r}if(e==="boxShadow"){if(!t)throw new Error('Invalid `boxShadow` value: "'+t+'".');return{[e]:typeof t=="string"?Ni(t):t}}if(e==="transform"){if(typeof t!="string")throw new Error("Invalid `transform` value.");let o={},i=t.replace(/(-?[\d.]+%)/g,(a,f)=>{let s=~~(Math.random()*1e9);return o[s]=f,s+"px"}),r=ht("transform",i,!0);for(let a of r.transform)for(let f in a)o[a[f]]&&(a[f]=o[a[f]]);return r}if(e==="background")return t=t.toString().trim(),/^(linear-gradient|radial-gradient|url|repeating-linear-gradient|repeating-radial-gradient)\(/.test(t)?ht("backgroundImage",t,!0):ht("background",t,!0);if(e==="textShadow"){t=t.toString().trim();let o={},i=fn(t);for(let r of i){let a=ht("textShadow",r,!0);for(let f in a)o[f]?o[f].push(a[f]):o[f]=[a[f]]}return o}if(e==="WebkitTextStroke"){t=t.toString().trim();let o=t.split(" ");if(o.length!==2)throw new Error("Invalid `WebkitTextStroke` value.");return{WebkitTextStrokeWidth:wt(e,o[0]),WebkitTextStrokeColor:wt(e,o[1])}}if(e==="backdropFilter"||e==="WebkitBackdropFilter")return{backdropFilter:t};if(e==="textDecorationSkipInk"){let o=t.toString().trim().toLowerCase();if(!["auto","none","all"].includes(o))throw new Error("Invalid `textDecorationSkipInk` value.");return{textDecorationSkipInk:o}}}function ro(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}var oo=/rgb\((\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\.\d]+)\)/;function ao(e){if(typeof e=="string"&&oo.test(e.trim()))return e.trim().replace(oo,(t,n,o,i,r)=>`rgba(${n}, ${o}, ${i}, ${r})`);if(typeof e=="object"&&e!==null){for(let t in e)e[t]=ao(e[t]);return e}return e}function yn(e,t){let n={},o={};for(let s in t)s.startsWith("--")&&(o[s]=String(t[s]));let i={},r=e;if(e){let{variables:s,remainingStyle:d}=to(e);i=s,r=d}let a=no(o,i);for(let s in a)n[s]=a[s];if(r){let s=r.color?Xt(r.color,a):void 0,d=Ui(s,t.color);n.color=d;for(let c in r){if(c.startsWith("_")){n[c]=r[c];continue}if(c==="color")continue;let p=Li(c),g=Xt(r[c],a),b=ji(g,d);try{let x=Gi(p,b,d)||$i(p,ht(p,wt(p,b),!0),b,d);Object.assign(n,x)}catch(x){throw new Error(x.message+(x.message.includes(b)?`
3
3
  `+ro(p):`
4
- in CSS rule \`${p}: ${b}\`.${ro(p)}`))}}}if(n.backgroundImage){let{backgrounds:u}=Wi(n);n.backgroundImage=u}(n.maskImage||n.WebkitMaskImage)&&(n.maskImage=Qr(n));let f=Di(n.fontSize,t.fontSize);typeof n.fontSize<"u"&&(n.fontSize=f),n.transformOrigin&&(n.transformOrigin=Jn(n.transformOrigin,f));for(let u in n){let d=n[u];if(u==="lineHeight")typeof d=="string"&&d!=="normal"&&(d=n[u]=D(d,f,f,t,!0)/f);else{if(typeof d=="string"){let c=D(d,f,f,t);typeof c<"u"&&(n[u]=c),d=n[u]}if(typeof d=="string"||typeof d=="object"){let c=ao(d);c&&(n[u]=c),d=n[u]}}if(u==="opacity"&&typeof d=="number"&&(n.opacity=d*t.opacity),u==="transform"){let c=d;for(let p of c){let g=Object.keys(p)[0],b=p[g],x=typeof b=="string"?D(b,f,f,t)??b:b;p[g]=x}}if(u==="textShadowRadius"){let c=d;n.textShadowRadius=c.map(p=>D(p,f,0,t,!1))}if(u==="textShadowOffset"){let c=d;n.textShadowOffset=c.map(({height:p,width:g})=>({height:D(p,f,0,t,!1),width:D(g,f,0,t,!1)}))}}return n}function Di(e,t){if(typeof e=="number")return e;try{let n=new He(e);switch(n.unit){case"em":return n.value*t;case"rem":return n.value*16}}catch{return t}}function io(e){if(e.startsWith("hsl")){let t=Oi(e),[n,o,i]=t.values;return`hsl(${[n,`${o}%`,`${i}%`].concat(t.alpha===1?[]:[t.alpha]).join(",")})`}return e}function Ui(e,t){return e&&e.toLowerCase()!=="currentcolor"?io(e):io(t)}function zi(e,t){return e.replace(/currentcolor/gi,t)}function ji(e,t){return cn(e)&&(e=zi(e,t)),e}async function Zn(e,t,n,o,i){let r=await mt(),a=Object.assign({},n,yn(Zr[t],n),yn(o,n));if(t==="img"){let[f,u,d]=await Lt(i.src);if(u===void 0&&d===void 0){if(i.width===void 0||i.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");u=parseInt(i.width),d=parseInt(i.height)}let c=d/u,p=(a.borderLeftWidth||0)+(a.borderRightWidth||0)+(a.paddingLeft||0)+(a.paddingRight||0),g=(a.borderTopWidth||0)+(a.borderBottomWidth||0)+(a.paddingTop||0)+(a.paddingBottom||0),b=a.width||i.width,x=a.height||i.height,E=typeof b=="number"&&typeof x=="number";E&&(b-=p,x-=g),b===void 0&&x===void 0?(b="100%",e.setAspectRatio(1/c)):b===void 0?typeof x=="number"?b=x/c:e.setAspectRatio(1/c):x===void 0&&(typeof b=="number"?x=b*c:e.setAspectRatio(1/c)),a.width=E?b+p:b,a.height=E?x+g:x,a.__src=f,a.__naturalWidth=u,a.__naturalHeight=d}if(t==="svg"){let f=i.viewBox||i.viewbox,u=Ct(f),d=u?u[3]/u[2]:null,{width:c,height:p}=i;typeof c>"u"&&p?d==null?c=0:typeof p=="string"&&p.endsWith("%")?c=parseInt(p)/d+"%":(p=D(p,n.fontSize,1,n),c=p/d):typeof p>"u"&&c?d==null?c=0:typeof c=="string"&&c.endsWith("%")?p=parseInt(c)*d+"%":(c=D(c,n.fontSize,1,n),p=c*d):(typeof c<"u"&&(c=D(c,n.fontSize,1,n)||c),typeof p<"u"&&(p=D(p,n.fontSize,1,n)||p),c||=u==null?void 0:u[2],p||=u==null?void 0:u[3]),!a.width&&c&&(a.width=c),!a.height&&p&&(a.height=p)}return e.setDisplay(Le(a.display,{flex:r.DISPLAY_FLEX,block:r.DISPLAY_FLEX,contents:r.DISPLAY_CONTENTS,none:r.DISPLAY_NONE,"-webkit-box":r.DISPLAY_FLEX},r.DISPLAY_FLEX,"display")),e.setAlignContent(Le(a.alignContent,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,"space-between":r.ALIGN_SPACE_BETWEEN,"space-around":r.ALIGN_SPACE_AROUND,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignContent")),e.setAlignItems(Le(a.alignItems,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_STRETCH,"alignItems")),e.setAlignSelf(Le(a.alignSelf,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignSelf")),e.setJustifyContent(Le(a.justifyContent,{center:r.JUSTIFY_CENTER,"flex-start":r.JUSTIFY_FLEX_START,"flex-end":r.JUSTIFY_FLEX_END,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND},r.JUSTIFY_FLEX_START,"justifyContent")),e.setFlexDirection(Le(a.flexDirection,{row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE},r.FLEX_DIRECTION_ROW,"flexDirection")),e.setFlexWrap(Le(a.flexWrap,{wrap:r.WRAP_WRAP,nowrap:r.WRAP_NO_WRAP,"wrap-reverse":r.WRAP_WRAP_REVERSE},r.WRAP_NO_WRAP,"flexWrap")),typeof a.gap<"u"&&e.setGap(r.GUTTER_ALL,a.gap),typeof a.rowGap<"u"&&e.setGap(r.GUTTER_ROW,a.rowGap),typeof a.columnGap<"u"&&e.setGap(r.GUTTER_COLUMN,a.columnGap),typeof a.flexBasis<"u"&&e.setFlexBasis(pt(a.flexBasis,"flexBasis")),e.setFlexGrow(typeof a.flexGrow>"u"?0:a.flexGrow),e.setFlexShrink(typeof a.flexShrink>"u"?0:a.flexShrink),typeof a.maxHeight<"u"&&e.setMaxHeight(lt(a.maxHeight,"maxHeight")),typeof a.maxWidth<"u"&&e.setMaxWidth(lt(a.maxWidth,"maxWidth")),typeof a.minHeight<"u"&&e.setMinHeight(lt(a.minHeight,"minHeight")),typeof a.minWidth<"u"&&e.setMinWidth(lt(a.minWidth,"minWidth")),e.setOverflow(Le(a.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE,"overflow")),e.setMargin(r.EDGE_TOP,pt(a.marginTop||0)),e.setMargin(r.EDGE_BOTTOM,pt(a.marginBottom||0)),e.setMargin(r.EDGE_LEFT,pt(a.marginLeft||0)),e.setMargin(r.EDGE_RIGHT,pt(a.marginRight||0)),e.setBorder(r.EDGE_TOP,a.borderTopWidth||0),e.setBorder(r.EDGE_BOTTOM,a.borderBottomWidth||0),e.setBorder(r.EDGE_LEFT,a.borderLeftWidth||0),e.setBorder(r.EDGE_RIGHT,a.borderRightWidth||0),e.setPadding(r.EDGE_TOP,a.paddingTop||0),e.setPadding(r.EDGE_BOTTOM,a.paddingBottom||0),e.setPadding(r.EDGE_LEFT,a.paddingLeft||0),e.setPadding(r.EDGE_RIGHT,a.paddingRight||0),e.setBoxSizing(Le(a.boxSizing,{"border-box":r.BOX_SIZING_BORDER_BOX,"content-box":r.BOX_SIZING_CONTENT_BOX},r.BOX_SIZING_BORDER_BOX,"boxSizing")),e.setPositionType(Le(a.position,{absolute:r.POSITION_TYPE_ABSOLUTE,relative:r.POSITION_TYPE_RELATIVE,static:r.POSITION_TYPE_STATIC},r.POSITION_TYPE_RELATIVE,"position")),typeof a.top<"u"&&e.setPosition(r.EDGE_TOP,lt(a.top,"top")),typeof a.bottom<"u"&&e.setPosition(r.EDGE_BOTTOM,lt(a.bottom,"bottom")),typeof a.left<"u"&&e.setPosition(r.EDGE_LEFT,lt(a.left,"left")),typeof a.right<"u"&&e.setPosition(r.EDGE_RIGHT,lt(a.right,"right")),typeof a.height<"u"?e.setHeight(pt(a.height,"height")):e.setHeightAuto(),typeof a.width<"u"?e.setWidth(pt(a.width,"width")):e.setWidthAuto(),[a,qn(a)]}import uo from"escape-html";var so=[1,0,0,1,0,0];function Vi(e,t,n){let o=[...so];for(let i of e){let r=Object.keys(i)[0],a=i[r];if(typeof a=="string")if(r==="translateX")a=parseFloat(a)/100*t,i[r]=a;else if(r==="translateY")a=parseFloat(a)/100*n,i[r]=a;else throw new Error(`Invalid transform: "${r}: ${a}".`);let f=a,u=[...so];switch(r){case"translateX":u[4]=f;break;case"translateY":u[5]=f;break;case"scale":u[0]=f,u[3]=f;break;case"scaleX":u[0]=f;break;case"scaleY":u[3]=f;break;case"rotate":{let d=f*Math.PI/180,c=Math.cos(d),p=Math.sin(d);u[0]=c,u[1]=p,u[2]=-p,u[3]=c;break}case"skewX":u[2]=Math.tan(f*Math.PI/180);break;case"skewY":u[1]=Math.tan(f*Math.PI/180);break}o=Ut(u,o)}e.splice(0,e.length),e.push(...o),e.__resolved=!0}function Yt({left:e,top:t,width:n,height:o},i,r,a){let f;i.__resolved||Vi(i,n,o);let u=i;if(r)f=u;else{let d=(a==null?void 0:a.xAbsolute)??((a==null?void 0:a.xRelative)??50)*n/100,c=(a==null?void 0:a.yAbsolute)??((a==null?void 0:a.yRelative)??50)*o/100,p=e+d,g=t+c;f=Ut([1,0,0,1,p,g],Ut(u,[1,0,0,1,-p,-g])),u.__parent&&(f=Ut(u.__parent,f)),u.splice(0,6,...f)}return`matrix(${f.map(d=>d.toFixed(2)).join(",")})`}function lo({left:e,top:t,width:n,height:o,isInheritingTransform:i},r){let a="",f=1;return r.transform&&(a=Yt({left:e,top:t,width:n,height:o},r.transform,i,r.transformOrigin)),r.opacity!==void 0&&(f=+r.opacity),{matrix:a,opacity:f}}function Qn({id:e,content:t,filter:n,left:o,top:i,width:r,height:a,matrix:f,opacity:u,image:d,clipPathId:c,debug:p,shape:g,decorationShape:b},x){let E="";if(p&&(E=T("rect",{x:o,y:i-a,width:r,height:a,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0})),d){let N={href:d,x:o,y:i,width:r,height:a,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0,style:x.filter?`filter:${x.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+T("image",{...N,opacity:u!==1?u:void 0})+(b||"")+(n?"</g>":"")+E,""]}let A={x:o,y:i,width:r,height:a,"font-weight":x.fontWeight,"font-style":x.fontStyle,"font-size":x.fontSize,"font-family":x.fontFamily,"letter-spacing":x.letterSpacing||void 0,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0,style:x.filter?`filter:${x.filter}`:void 0,"stroke-width":x.WebkitTextStrokeWidth?`${x.WebkitTextStrokeWidth}px`:void 0,stroke:x.WebkitTextStrokeWidth?x.WebkitTextStrokeColor:void 0,"stroke-linejoin":x.WebkitTextStrokeWidth?"round":void 0,"paint-order":x.WebkitTextStrokeWidth?"stroke":void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+T("text",{...A,fill:x.color,opacity:u!==1?u:void 0},uo(t))+(b||"")+(n?"</g>":"")+E,g?T("text",A,uo(t)):""]}function Hi(e,t,n){return e.replace(/([MA])([0-9.-]+),([0-9.-]+)/g,function(o,i,r,a){return i+(parseFloat(r)+t)+","+(parseFloat(a)+n)})}var xn=1.1;function co({id:e,width:t,height:n},o,i=!1){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let r=o.shadowColor.length,a="",f="",u=0,d=t,c=0,p=n;for(let g=0;g<r;g++){let b=o.shadowRadius[g]*o.shadowRadius[g]/4;if(u=Math.min(o.shadowOffset[g].width-b,u),d=Math.max(o.shadowOffset[g].width+b+t,d),c=Math.min(o.shadowOffset[g].height-b,c),p=Math.max(o.shadowOffset[g].height+b+n,p),i){let x=`satori_s-${e}-result-${g}`;a+=T("feGaussianBlur",{in:"SourceAlpha",stdDeviation:o.shadowRadius[g]/2,result:`${x}-blur`})+T("feOffset",{in:`${x}-blur`,dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,result:`${x}-offset`})+T("feFlood",{"flood-color":o.shadowColor[g],"flood-opacity":1,result:`${x}-color`})+T("feComposite",{in:`${x}-color`,in2:`${x}-offset`,operator:"in",result:r>1?x:void 0})}else a+=T("feDropShadow",{dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,stdDeviation:o.shadowRadius[g]/2,"flood-color":o.shadowColor[g],"flood-opacity":1,...r>1?{in:"SourceGraphic",result:`satori_s-${e}-result-${g}`}:{}});r>1&&(f=T("feMergeNode",{in:`satori_s-${e}-result-${g}`})+f)}return T("filter",{id:`satori_s-${e}`,x:(u/t*100*xn).toFixed(2)+"%",y:(c/n*100*xn).toFixed(2)+"%",width:((d-u)/t*100*xn).toFixed(2)+"%",height:((p-c)/n*100*xn).toFixed(2)+"%"},a+(f?T("feMerge",{},f):""))}function fo({width:e,height:t,shape:n,opacity:o,id:i},r){if(!r.boxShadow)return null;let a="",f="";for(let u=r.boxShadow.length-1;u>=0;u--){let d="",c=r.boxShadow[u];c.spreadRadius&&c.inset&&(c.spreadRadius=-c.spreadRadius);let p=c.blurRadius*c.blurRadius/4+(c.spreadRadius||0),g=Math.min(-p-(c.inset?c.offsetX:0),0),b=Math.max(p+e-(c.inset?c.offsetX:0),e),x=Math.min(-p-(c.inset?c.offsetY:0),0),E=Math.max(p+t-(c.inset?c.offsetY:0),t),A=`satori_s-${i}-${u}`,N=`satori_ms-${i}-${u}`,P=c.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${c.spreadRadius*2}"`):n;d+=T("mask",{id:N,maskUnits:"userSpaceOnUse"},T("rect",{x:0,y:0,width:r._viewportWidth||"100%",height:r._viewportHeight||"100%",fill:c.inset?"#000":"#fff"})+P.replace('fill="#fff"',c.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let v=P.replace(/d="([^"]+)"/,(S,R)=>'d="'+Hi(R,c.offsetX,c.offsetY)+'"').replace(/x="([^"]+)"/,(S,R)=>'x="'+(parseFloat(R)+c.offsetX)+'"').replace(/y="([^"]+)"/,(S,R)=>'y="'+(parseFloat(R)+c.offsetY)+'"');c.spreadRadius&&c.spreadRadius<0&&(d+=T("mask",{id:N+"-neg",maskUnits:"userSpaceOnUse"},v.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-c.spreadRadius*2}"`))),c.spreadRadius&&c.spreadRadius<0&&(v=T("g",{mask:`url(#${N}-neg)`},v)),d+=T("defs",{},T("filter",{id:A,x:`${g/e*100}%`,y:`${x/t*100}%`,width:`${(b-g)/e*100}%`,height:`${(E-x)/t*100}%`},T("feGaussianBlur",{stdDeviation:c.blurRadius/2,result:"b"})+T("feFlood",{"flood-color":c.color,in:"SourceGraphic",result:"f"})+T("feComposite",{in:"f",in2:"b",operator:c.inset?"out":"in"})))+T("g",{mask:`url(#${N})`,filter:`url(#${A})`,opacity:o},v),c.inset?f+=d:a+=d}return[a,f]}function Xi(e,t,n,o,i,r){let a=i/2,f=Math.max(a,i*1.25),u=[];for(let p of n){if(p.y2<r+a||p.y1>o+a)continue;let g=Math.max(e,p.x1-f),b=Math.min(t,p.x2+f);if(g>=b)continue;if(u.length===0){u.push([g,b]);continue}let x=u[u.length-1];g<=x[1]?x[1]=Math.max(x[1],b):u.push([g,b])}if(!u.length)return[[e,t]];let d=[],c=e;for(let[p,g]of u)if(p>c&&d.push([c,p]),c=Math.max(c,g),c>=t)break;return c<t&&d.push([c,t]),d}function er({width:e,left:t,top:n,ascender:o,clipPathId:i,matrix:r,glyphBoxes:a},f){let{textDecorationColor:u,textDecorationStyle:d,textDecorationLine:c,textDecorationSkipInk:p,fontSize:g,color:b}=f;if(!c||c==="none")return"";let x=Math.max(1,g*.1),E=c==="line-through"?n+o*.7:c==="underline"?n+o*1.1:n,A=d==="dashed"?`${x*1.2} ${x*2}`:d==="dotted"?`0 ${x*2}`:void 0,N=c==="underline"&&(p||"auto")!=="none"&&(a==null?void 0:a.length),P=n+o,v=N?Xi(t,t+e,a,E,x,P):[[t,t+e]],S=d==="double"?v.map(([R,M])=>T("line",{x1:R,y1:E+x+1,x2:M,y2:E+x+1,stroke:u||b,"stroke-width":x,"stroke-dasharray":A,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join(""):"";return(i?`<g clip-path="url(#${i})">`:"")+v.map(([R,M])=>T("line",{x1:R,y1:E,x2:M,y2:E,stroke:u||b,"stroke-width":x,"stroke-dasharray":A,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join("")+S+(i?"</g>":"")}function tr(e){return e=e.replace("U+","0x"),String.fromCodePoint(Number(e))}var vt=tr("U+0020"),nr=tr("U+0009"),Wt=tr("U+2026");function po(e,t,n){let{fontSize:o,letterSpacing:i}=n,r=new Map;function a(d){let c=r.get(d);return c===void 0&&(c=e.measure(d,{fontSize:o,letterSpacing:i}),r.set(d,c)),c}function f(d){let c=0;for(let p of d)t(p)?c+=o:c+=a(p);return c}function u(d){return f(Pe(d,"grapheme"))}return{measureGrapheme:a,measureGraphemeArray:f,measureText:u}}function mo(e,t,n){let{textTransform:o,whiteSpace:i,wordBreak:r}=t;e=Yi(e,o,n);let{content:a,shouldCollapseTabsAndSpaces:f,allowSoftWrap:u}=Ji(e,i),{words:d,requiredBreaks:c,allowBreakWord:p}=Ki(a,r),[g,b]=qi(t,u);return{words:d,requiredBreaks:c,allowSoftWrap:u,allowBreakWord:p,processedContent:a,shouldCollapseTabsAndSpaces:f,lineLimit:g,blockEllipsis:b}}function Yi(e,t,n){return t==="uppercase"?e=e.toLocaleUpperCase(n):t==="lowercase"?e=e.toLocaleLowerCase(n):t==="capitalize"&&(e=Pe(e,"word",n).map(o=>Pe(o,"grapheme",n).map((i,r)=>r===0?i.toLocaleUpperCase(n):i).join("")).join("")),e}function qi(e,t){let{textOverflow:n,lineClamp:o,WebkitLineClamp:i,WebkitBoxOrient:r,overflow:a,display:f}=e;if(f==="block"&&o){let[u,d=Wt]=Zi(o);if(u)return[u,d]}return n==="ellipsis"&&f==="-webkit-box"&&r==="vertical"&&Ar(i)&&i>0?[i,Wt]:n==="ellipsis"&&a==="hidden"&&!t?[1,Wt]:[1/0]}function Ki(e,t){let n=["break-all","break-word"].includes(t),{words:o,requiredBreaks:i}=Pr(e,t);return{words:o,requiredBreaks:i,allowBreakWord:n}}function Ji(e,t){let n=["pre","pre-wrap","pre-line"].includes(t),o=["normal","nowrap","pre-line"].includes(t),i=!["pre","nowrap"].includes(t);return n||(e=e.replace(/\n/g,vt)),o&&(e=e.replace(/([ ]|\t)+/g,vt).replace(/^[ ]|[ ]$/g,"")),{content:e,shouldCollapseTabsAndSpaces:o,allowSoftWrap:i}}function Zi(e){if(typeof e=="number")return[e];let t=/^(\d+)\s*"(.*)"$/,n=/^(\d+)\s*'(.*)'$/,o=t.exec(e),i=n.exec(e);if(o){let r=+o[1],a=o[2];return[r,a]}else if(i){let r=+i[1],a=i[2];return[r,a]}return[]}import go from"parse-css-color";var Qi=new Set([nr]);function ea(e){return Qi.has(e)}function rr(e){if(e==="transparent")return!0;let t=go(e);return t?t.alpha===0:!1}function ho(e){if(!e)return!1;let t=go(e);if(!t)return!1;let[n,o,i,r]=t.values;return n===255&&o===255&&i===255&&(r===void 0||r===1)}async function*or(e,t){let n=await mt(),{parentStyle:o,inheritedStyle:i,parent:r,font:a,id:f,isInheritingTransform:u,debug:d,embedFont:c,graphemeImages:p,locale:g,canLoadAdditionalAssets:b}=t,{textAlign:x,textIndent:E=0,lineHeight:A,textWrap:N,fontSize:P,filter:v,tabSize:S=8,letterSpacing:R,_inheritedBackgroundClipTextPath:M,_inheritedBackgroundClipTextHasBackground:B,flexShrink:H}=o,{words:X,requiredBreaks:he,allowSoftWrap:le,allowBreakWord:be,processedContent:ie,shouldCollapseTabsAndSpaces:ce,lineLimit:ae,blockEllipsis:ke}=mo(e,o,g),Y=ta(n,x);r.insertChild(Y,r.getChildCount()),Mr(H)&&r.setFlexShrink(1);let j=a.getEngine(P,A,o,g),Ie=b?Pe(ie,"grapheme").filter(G=>!ea(G)&&!j.has(G)):[];yield Ie.map(G=>({word:G,locale:g})),Ie.length&&(j=a.getEngine(P,A,o,g));function De(G){return!!(p&&p[G])}let{measureGrapheme:se,measureGraphemeArray:Se,measureText:We}=po(j,De,{fontSize:P,letterSpacing:R}),W=cn(S)?D(S,P,1,o):se(vt)*S,ne=(G,$)=>{if(G.length===0)return{originWidth:0,endingSpacesWidth:0,text:G};let{index:ee,tabCount:V}=na(G),ue=0;if(V>0){let de=G.slice(0,ee),q=G.slice(ee+V),K=We(de),je=K+$;ue=(W===0?K:(Math.floor(je/W)+V)*W)+We(q)}else ue=We(G);let Q=G.trimEnd()===G?ue:We(G.trimEnd());return{originWidth:ue,endingSpacesWidth:ue-Q,text:G}},U=[],re=[],O=[],oe=[],fe=[];function Ee(G){let $=0,ee=0,V=-1,ue=0,Q=0,de=0,q=0;U=[],O=[0],oe=[],fe=[];let K=0,je=0;for(;K<X.length&&$<ae;){let z=X[K],ve=he[K],Ae=0,{originWidth:Ot,endingSpacesWidth:ge,text:St}=ne(z,Q);z=St,Ae=Ot;let _e=ge;ve&&de===0&&(de=j.height(z));let at=x==="justify",pe=K&&Q+Ae>G+_e&&le;if(be&&Ae>G&&(!Q||pe||ve)){let $e=Pe(z,"grapheme");X.splice(K,1,...$e),Q>0&&(U.push(Q-je),re.push(q),$++,ue+=de,Q=0,de=0,q=0,O.push(1),V=-1),je=_e;continue}if(ve||pe)ce&&z===vt&&(Ae=0),U.push(Q-je),re.push(q),$++,ue+=de,Q=Ae,de=Ae?Math.round(j.height(z)):0,q=Ae?Math.round(j.baseline(z)):0,O.push(1),V=-1,ve||(ee=Math.max(ee,G));else{Q+=Ae;let $e=Math.round(j.height(z));$e>de&&(de=$e,q=Math.round(j.baseline(z))),at&&O[O.length-1]++}at&&V++,ee=Math.max(ee,Q);let Be=Q-Ae;if(Ae===0)fe.push({y:ue,x:Be,width:0,line:$,lineIndex:V,isImage:!1});else{let $e=Pe(z,"word");for(let Ze=0;Ze<$e.length;Ze++){let Qe=$e[Ze],Me=0,Ve=!1;De(Qe)?(Me=P,Ve=!0):!c&&Qe.length>1?Me=We(Qe):Me=se(Qe),oe.push(Qe),fe.push({y:ue,x:Be,width:Me,line:$,lineIndex:V,isImage:Ve}),Be+=Me}}K++,je=_e}return Q&&($<ae&&(ue+=de),$++,U.push(Q),re.push(q)),{width:ee,height:ue}}let Te={width:0,height:0};Y.setMeasureFunc(G=>{let{width:$,height:ee}=Ee(G);if(N==="balance"){let ue=$/2,Q=$,de=$;for(;ue+1<Q;){de=(ue+Q)/2;let{height:K}=Ee(de);K>ee?ue=de:Q=de}Ee(Q);let q=Math.ceil(Q);return Te={width:q,height:ee},{width:q,height:ee}}if(N==="pretty"&&U[U.length-1]<$/3){let de=$*.9,q=Ee(de);if(q.height<=ee*1.3)return Te={width:$,height:q.height},{width:$,height:q.height}}let V=Math.ceil($);return Te={width:V,height:ee},{width:V,height:ee}});let[Z,Re]=yield,ye="",Oe="",we=i._inheritedClipPathId,Et=i._inheritedMaskId,{left:nt,top:Nt,width:gt,height:Tt}=Y.getComputedLayout(),Rt=typeof E=="string"?D(E,P,gt,o,!0)||0:E,bt=r.getComputedWidth()-r.getComputedPadding(n.EDGE_LEFT)-r.getComputedPadding(n.EDGE_RIGHT)-r.getComputedBorder(n.EDGE_LEFT)-r.getComputedBorder(n.EDGE_RIGHT),rt=Z+nt,Ye=Re+Nt,{matrix:Ue,opacity:yt}=lo({left:nt,top:Nt,width:gt,height:Tt,isInheritingTransform:u},o),Ne="";if(o.textShadowOffset){let{textShadowColor:G,textShadowOffset:$,textShadowRadius:ee}=o;Ne=co({width:Te.width,height:Te.height,id:f},{shadowColor:G,shadowOffset:$,shadowRadius:ee},rr(o.color)||B&&ho(o.color)),Ne=T("defs",{},Ne)}let qe="",Ke="",xt="",dt=-1,Ce={},ze={},Fe=null,Je=0;for(let G=0;G<oe.length;G++){let $=fe[G],ee=fe[G+1];if(!$)continue;let V=oe[G],ue=null,Q=!1,de=p?p[V]:null,q=$.y,K=$.x,je=$.width,z=$.line,ve=o.textDecorationLine==="underline"&&(o.textDecorationSkipInk||"auto")!=="none";if(z===dt)continue;let Ae=!1;if(z===0&&Rt!==0&&(K+=Rt),U.length>1){let pe=gt-U[z];if(x==="right"||x==="end")K+=pe;else if(x==="center")K+=pe/2;else if(x==="justify"&&z<U.length-1){let me=O[z],Be=me>1?pe/(me-1):0;K+=Be*$.lineIndex,Ae=!0}c&&(K=Math.round(K))}let Ot=re[z],ge=j.baseline(V),St=j.height(V),_e=Ot-ge,at=pe=>!ve||o.textDecorationLine!=="underline"?void 0:{underlineY:Ye+pe+_e+ge+ge*.1,strokeWidth:Math.max(1,P*.1)};if(Ce[z]||(Ce[z]={left:K,top:Ye+q+_e,ascender:ge,width:Ae?gt:U[z]}),ae!==1/0){let Qe=function(Me,Ve){let Ft=Pe(Ve,"grapheme",g),kt="",rn=0;for(let on of Ft){let Bt=Me+Se([kt+on]);if(kt&&Bt+me>bt)break;kt+=on,rn=Bt}return{subset:kt,resolvedWidth:rn}},pe=ke,me=se(ke);me>bt&&(pe=Wt,me=se(pe));let Be=se(vt),$e=z<U.length-1;if(z+1===ae&&($e||U[z]>bt)){if(K+je+me+Be>bt){let{subset:Me,resolvedWidth:Ve}=Qe(K,V);V=Me+pe,dt=z,Ce[z].width=Math.max(0,Ve-Ce[z].left),Q=!0}else if(ee&&ee.line!==z)if(x==="center"){let{subset:Me,resolvedWidth:Ve}=Qe(K,V);V=Me+pe,dt=z,Ce[z].width=Math.max(0,Ve-Ce[z].left),Q=!0}else{let Me=oe[G+1],{subset:Ve,resolvedWidth:Ft}=Qe(je+K,Me);V=V+Ve+pe,dt=z,Ce[z].width=Math.max(0,Ft-Ce[z].left),Q=!0}}}if(de)q+=0;else if(c){if(!V.includes(nr)&&!_r.includes(V)&&oe[G+1]&&ee&&!ee.isImage&&q===ee.y&&!Q){Fe===null&&(Je=K),Fe=Fe===null?V:Fe+V;continue}let pe=Fe===null?V:Fe+V,me=Fe===null?K:Je,Be=$.width+K-me,$e=at(q),Ze=j.getSVG(pe.replace(/(\t)+/g,""),{fontSize:P,left:rt+me,top:Ye+q+ge+_e,letterSpacing:R},$e);ue=Ze.path,ve&&Ze.boxes&&Ze.boxes.length&&(ze[z]||(ze[z]=[])).push(...Ze.boxes),Fe=null,d&&(xt+=T("rect",{x:rt+me,y:Ye+q+_e,width:Be,height:St,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0})+T("line",{x1:rt+K,x2:rt+K+$.width,y1:Ye+q+_e+ge,y2:Ye+q+_e+ge,stroke:"#14c000","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0}))}else if(q+=ge+_e,ve&&!de){let pe=at(q),me=j.getSVG(V.replace(/(\t)+/g,""),{fontSize:P,left:rt+K,top:Ye+q,letterSpacing:R},pe);me.boxes&&me.boxes.length&&(ze[z]||(ze[z]=[])).push(...me.boxes)}if(ue!==null)Ke+=ue+" ";else{let[pe,me]=Qn({content:V,filter:Ne,id:f,left:rt+K,top:Ye+q,width:je,height:St,matrix:Ue,opacity:yt,image:de,clipPathId:we,debug:d,shape:!!M},o);ye+=pe,Oe+=me}if(Q)break}if(o.textDecorationLine&&(qe=Object.entries(Ce).map(([G,$])=>{if(!$)return"";let ee=ze[G]||[];return er({left:rt+$.left,top:$.top,width:$.width,ascender:$.ascender,clipPathId:we,matrix:Ue,glyphBoxes:ee},o)}).join("")),Ke){let G=(!rr(o.color)||Ne)&&yt!==0?`<g ${Et?`mask="url(#${Et})"`:""} ${we?`clip-path="url(#${we})"`:""}>`+T("path",{fill:Ne&&(rr(o.color)||B&&ho(o.color))?"black":o.color,d:Ke,transform:Ue||void 0,opacity:yt!==1?yt:void 0,style:v?`filter:${v}`:void 0,"stroke-width":i.WebkitTextStrokeWidth?`${i.WebkitTextStrokeWidth}px`:void 0,stroke:i.WebkitTextStrokeWidth?i.WebkitTextStrokeColor:void 0,"stroke-linejoin":i.WebkitTextStrokeWidth?"round":void 0,"paint-order":i.WebkitTextStrokeWidth?"stroke":void 0})+"</g>":"";M&&(Oe=T("path",{d:Ke,transform:Ue||void 0})),ye+=(Ne?Ne+T("g",{filter:`url(#satori_s-${f})`},G+qe):G+qe)+xt}else qe&&(ye+=Ne?T("g",{filter:`url(#satori_s-${f})`},qe):qe);return Oe&&(o._inheritedBackgroundClipTextPath.value+=Oe),ye}function ta(e,t){let n=e.Node.create();return n.setAlignItems(e.ALIGN_BASELINE),n.setJustifyContent(Le(t,{left:e.JUSTIFY_FLEX_START,right:e.JUSTIFY_FLEX_END,center:e.JUSTIFY_CENTER,justify:e.JUSTIFY_SPACE_BETWEEN,start:e.JUSTIFY_FLEX_START,end:e.JUSTIFY_FLEX_END},e.JUSTIFY_FLEX_START,"textAlign")),n}function na(e){let t=/(\t)+/.exec(e);return t?{index:t.index,tabCount:t[0].length}:{index:null,tabCount:0}}import{parseLinearGradient as oa}from"css-gradient-parser";import ra from"parse-css-color";function Sn(e,t,n,o,i){let r=[],a=t.at(-1),f=a&&a.offset&&a.offset.unit==="%"&&o?+a.offset.value:100;for(let p of t){let{color:g}=p;if(!r.length&&(r.push({offset:0,color:g}),!p.offset||p.offset.value==="0"))continue;let b=typeof p.offset>"u"?void 0:p.offset.unit==="%"?+p.offset.value/f:Number(D(`${p.offset.value}${p.offset.unit}`,n.fontSize,e,n,!0))/e;r.push({offset:b,color:g})}r.length||r.push({offset:0,color:"transparent"});let u=r[r.length-1];u.offset!==1&&(typeof u.offset>"u"?u.offset=1:o?r[r.length-1]={offset:1,color:u.color}:r.push({offset:1,color:u.color}));let d=0,c=1;for(let p=0;p<r.length;p++)if(typeof r[p].offset>"u"){for(c<p&&(c=p);typeof r[c].offset>"u";)c++;r[p].offset=(r[c].offset-r[d].offset)/(c-d)*(p-d)+r[d].offset}else d=p;return i==="mask"?r.map(p=>{let g=ra(p.color);return g?g.alpha===0?{...p,color:"rgba(0, 0, 0, 1)"}:{...p,color:`rgba(255, 255, 255, ${g.alpha})`}:p}):r}function bo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,f,u,d){let c=oa(r),[p,g]=a,b=r.startsWith("repeating"),x,E,A;if(c.orientation.type==="directional")x=aa(c.orientation.value),E=Math.sqrt(Math.pow((x.x2-x.x1)*p,2)+Math.pow((x.y2-x.y1)*g,2));else if(c.orientation.type==="angular"){let{length:R,...M}=sa(Nn(`${c.orientation.value.value}${c.orientation.value.unit}`)/180*Math.PI,p,g);E=R,x=M}A=b?ua(c.stops,E,x,u):x;let N=Sn(b?ia(c.stops,E):E,c.stops,u,b,d),P=`satori_bi${e}`,v=`satori_pattern_${e}`,S=T("pattern",{id:v,x:f[0]/t,y:f[1]/n,width:o?p/t:"1",height:i?g/n:"1",patternUnits:"objectBoundingBox"},T("linearGradient",{id:P,...A,spreadMethod:b?"repeat":"pad"},N.map(R=>T("stop",{offset:(R.offset??0)*100+"%","stop-color":R.color})).join(""))+T("rect",{x:0,y:0,width:p,height:g,fill:`url(#${P})`}));return[v,S]}function ia(e,t){let n=e[e.length-1],{offset:o}=n;return o?o.unit==="%"?Number(o.value)/100*t:Number(o.value):t}function aa(e){let t=0,n=0,o=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(o=1),!t&&!o&&!n&&!i&&(n=1),{x1:t,y1:n,x2:o,y2:i}}function sa(e,t,n){let o=Math.pow(n/t,2);e=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2);let i,r,a,f,u,d,c,p,g=b=>{if(b===0){i=0,r=n,a=0,f=0,u=n;return}else if(b===Math.PI/2){i=0,r=0,a=t,f=0,u=t;return}if(b>0&&b<Math.PI/2){i=(o*t/2/Math.tan(b)-n/2)/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i+n,a=Math.abs(t/2-i)+t/2,f=n/2-Math.abs(r-n/2),u=Math.sqrt(Math.pow(a-i,2)+Math.pow(f-r,2)),c=(t/2/Math.tan(b)-n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*c+n,u=2*Math.sqrt(Math.pow(t/2-c,2)+Math.pow(n/2-p,2));return}else if(b>Math.PI/2&&b<Math.PI){i=(n/2+o*t/2/Math.tan(b))/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i,a=Math.abs(t/2-i)+t/2,f=n/2+Math.abs(r-n/2),c=(t/2/Math.tan(b)+n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*c,u=2*Math.sqrt(Math.pow(t/2-c,2)+Math.pow(n/2-p,2));return}else b>=Math.PI&&(g(b-Math.PI),d=i,i=a,a=d,d=r,r=f,f=d)};return g(e),{x1:i/t,y1:r/n,x2:a/t,y2:f/n,length:u}}function ua(e,t,n,o){let{x1:i,x2:r,y1:a,y2:f}=n,u=e[0].offset?e[0].offset.unit==="%"?Number(e[0].offset.value)/100:D(`${e[0].offset.value}${e[0].offset.unit}`,o.fontSize,t,o,!0)/t:0,d=e.at(-1).offset?e.at(-1).offset.unit==="%"?Number(e.at(-1).offset.value)/100:D(`${e.at(-1).offset.value}${e.at(-1).offset.unit}`,o.fontSize,t,o,!0)/t:1,c=(r-i)*u+i,p=(f-a)*u+a,g=(r-i)*d+i,b=(f-a)*d+a;return{x1:c,y1:p,x2:g,y2:b}}import{parseRadialGradient as la}from"css-gradient-parser";function xo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,f,u,d){var ie;let{shape:c,stops:p,position:g,size:b,repeating:x}=la(r),[E,A]=a,N=E/2,P=A/2,v=fa(g.x,g.y,E,A,u.fontSize,u);N=v.x,P=v.y;let S=ca(t,p,x,u),R=Sn(S,p,u,x,d),M=`satori_radial_${e}`,B=`satori_pattern_${e}`,H=`satori_mask_${e}`,X=pa(c,b,u.fontSize,{x:N,y:P},[E,A],u,x),he=da(c,u.fontSize,p,[E,A],u,x,X),le=T("pattern",{id:B,x:f[0]/t,y:f[1]/n,width:o?E/t:"1",height:i?A/n:"1",patternUnits:"objectBoundingBox"},T("radialGradient",{id:M,...he},R.map(ce=>T("stop",{offset:ce.offset||0,"stop-color":ce.color})).join(""))+T("mask",{id:H},T("rect",{x:0,y:0,width:E,height:A,fill:"#fff"}))+T("rect",{x:0,y:0,width:E,height:A,fill:((ie=R.at(-1))==null?void 0:ie.color)||"transparent"})+T(c,{cx:N,cy:P,width:E,height:A,...X,fill:`url(#${M})`,mask:`url(#${H})`}));return[B,le]}function ca(e,t,n,o){if(!n)return e;let i=t.at(-1);return!i||!i.offset||i.offset.unit==="%"?e:D(`${i.offset.value}${i.offset.unit}`,+o.fontSize,e,o,!0)}function fa(e,t,n,o,i,r){let a={x:n/2,y:o/2};return e.type==="keyword"?Object.assign(a,yo(e.value,n,o,"x")):a.x=D(`${e.value.value}${e.value.unit}`,i,n,r,!0)??n/2,t.type==="keyword"?Object.assign(a,yo(t.value,n,o,"y")):a.y=D(`${t.value.value}${t.value.unit}`,i,o,r,!0)??o/2,a}function yo(e,t,n,o){switch(e){case"center":return{[o]:o==="x"?t/2:n/2};case"left":return{x:0};case"top":return{y:0};case"right":return{x:t};case"bottom":return{y:n}}}function da(e,t,n,[o,i],r,a,f){let{r:u,rx:d,ratio:c=1}=f;if(!a)return{spreadMethod:"pad"};let p=n.at(-1),g=e==="circle"?u*2:d*2;return{spreadMethod:"repeat",cx:"50%",cy:"50%",r:p.offset.unit==="%"?`${Number(p.offset.value)*Math.min(i/o,1)/c}%`:Number(D(`${p.offset.value}${p.offset.unit}`,t,o,r,!0)/g)}}function pa(e,t,n,o,i,r,a){let[f,u]=i,{x:d,y:c}=o,p={},g=0,b=0;if(ma(t)){if(t.some(x=>x.value.value.startsWith("-")))throw new Error("disallow setting negative values to the size of the shape. Check https://w3c.github.io/csswg-drafts/css-images/#valdef-rg-size-length-0");return e==="circle"?Object.assign(p,{r:Number(D(`${t[0].value.value}${t[0].value.unit}`,n,f,r,!0))}):Object.assign(p,{rx:Number(D(`${t[0].value.value}${t[0].value.unit}`,n,f,r,!0)),ry:Number(D(`${t[1].value.value}${t[1].value.unit}`,n,u,r,!0))}),wn(p,f,u,d,c,a,e),p}switch(t[0].value){case"farthest-corner":g=Math.max(Math.abs(f-d),Math.abs(d)),b=Math.max(Math.abs(u-c),Math.abs(c));break;case"closest-corner":g=Math.min(Math.abs(f-d),Math.abs(d)),b=Math.min(Math.abs(u-c),Math.abs(c));break;case"farthest-side":return e==="circle"?p.r=Math.max(Math.abs(f-d),Math.abs(d),Math.abs(u-c),Math.abs(c)):(p.rx=Math.max(Math.abs(f-d),Math.abs(d)),p.ry=Math.max(Math.abs(u-c),Math.abs(c))),wn(p,f,u,d,c,a,e),p;case"closest-side":return e==="circle"?p.r=Math.min(Math.abs(f-d),Math.abs(d),Math.abs(u-c),Math.abs(c)):(p.rx=Math.min(Math.abs(f-d),Math.abs(d)),p.ry=Math.min(Math.abs(u-c),Math.abs(c))),wn(p,f,u,d,c,a,e),p}return e==="circle"?p.r=Math.sqrt(g*g+b*b):Object.assign(p,So(g,b)),wn(p,f,u,d,c,a,e),p}function wn(e,t,n,o,i,r,a){if(r)if(a==="ellipse"){let f=Math.max(Math.abs(t-o),Math.abs(o)),u=Math.max(Math.abs(n-i),Math.abs(i)),{rx:d,ry:c}=So(f,u);e.ratio=Math.max(d/e.rx,c/e.ry),e.ratio>1&&(e.rx*=e.ratio,e.ry*=e.ratio)}else{let f=Math.max(Math.abs(t-o),Math.abs(o)),u=Math.max(Math.abs(n-i),Math.abs(i)),d=Math.sqrt(f*f+u*u);e.ratio=d/e.r,e.ratio>1&&(e.r=d)}}function So(e,t){let n=t!==0?e/t:1;if(e===0)return{rx:0,ry:0};{let o=Math.sqrt(e*e+t*t*n*n)/n;return{ry:o,rx:o*n}}}function ma(e){return!e.some(t=>t.type==="keyword")}import wo from"parse-css-color";function vn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function ha(e,t,n,o,i){if(!o||!i)return[t,n];if(e==="cover"){let r=t/o,a=n/i,f=Math.max(r,a);return[o*f,i*f]}if(e==="contain"){let r=t/o,a=n/i,f=Math.min(r,a);return[o*f,i*f]}if(e==="auto"||e.includes("auto")){let r=e.split(" "),a=r[0]||"auto",f=r[1]||r[0]||"auto",u=o,d=i;if(a==="auto"&&f!=="auto"){let c=vn(f,n);d=c,u=o/i*c}else if(f==="auto"&&a!=="auto"){let c=vn(a,t);u=c,d=i/o*c}return[u,d]}return[t,n]}var qt={bottom:"100%",center:"50%",left:"0%",right:"100%",top:"0%"};function ga(e){if(!e)return{x:"0%",y:"0%"};let t=e.split(" ").filter(Boolean);if(t.length===1){let n=t[0];return n in qt?n==="top"||n==="bottom"?{x:"50%",y:qt[n]}:{x:qt[n],y:"50%"}:{x:n,y:"50%"}}return{x:qt[t[0]]||t[0],y:qt[t[1]]||t[1]}}function vo(e,t,n){if(e.endsWith("%")){let o=parseFloat(e)/100;return(t-n)*o}try{let o=new He(e);return o.type==="length"||o.type==="number"?o.value:vn(o.value+o.unit,t)}catch{return 0}}function ir(e,{x:t,y:n,defaultX:o,defaultY:i}){return(e?e.split(" ").map(r=>{try{let a=new He(r);return a.type==="length"||a.type==="number"?a.value:a.value+a.unit}catch{return null}}).filter(r=>r!==null):[o,i]).map((r,a)=>vn(r,[t,n][a]))}async function Kt({id:e,width:t,height:n,left:o,top:i},{image:r,size:a,position:f,repeat:u},d,c){u=u||"repeat",c=c||"background";let p=u==="repeat-x"||u==="repeat",g=u==="repeat-y"||u==="repeat",b=a&&(a==="cover"||a==="contain"||a==="auto"||a.includes("auto")),x=r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")||r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("),E=b&&x?[t,n]:b?[0,0]:ir(a,{x:t,y:n,defaultX:t,defaultY:n}),A=ir(f,{x:t,y:n,defaultX:0,defaultY:0});if(r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient("))return bo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,A,d,c);if(r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("))return xo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,A,d,c);if(r.startsWith("url(")){let[N,P,v]=await Lt(r.slice(4,-1)),S,R;if(b){let[M,B]=ha(a,t,n,P,v);S=M,R=B}else{let M=ir(a,{x:t,y:n,defaultX:0,defaultY:0});S=c==="mask"?P||M[0]:M[0]||P,R=c==="mask"?v||M[1]:M[1]||v}if(b){let M=ga(f),B=vo(M.x,t,S),H=vo(M.y,n,R);return[`satori_bi${e}`,T("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?B:0)+o,y:(g?H:0)+i,width:p?S:"100%",height:g?R:"100%"},T("image",{x:p?0:B,y:g?0:H,width:S,height:R,preserveAspectRatio:"none",href:N}))]}return[`satori_bi${e}`,T("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:A[0]+o,y:A[1]+i,width:p?S:"100%",height:g?R:"100%"},T("image",{x:0,y:0,width:S,height:R,preserveAspectRatio:"none",href:N}))]}if(wo(r)){let N=wo(r),[P,v,S,R]=N.values,B=`rgba(${P},${v},${S},${R!==void 0?R:1})`;return[`satori_bi${e}`,T("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:o,y:i,width:t,height:n},T("rect",{x:0,y:0,width:t,height:n,fill:B}))]}throw new Error(`Invalid background image: "${r}"`)}function ba([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function En(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function Tn(e){e[0]=e[1]=Math.min(e[0],e[1])}function Rn(e,t,n,o,i){if(typeof e=="string"){let r=e.split(" ").map(f=>f.trim()),a=!r[1]&&!r[0].endsWith("%");return r[1]=r[1]||r[0],[a,[Math.min(D(r[0],o,t,i,!0),t),Math.min(D(r[1],o,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}var kn=e=>e&&e[0]!==0&&e[1]!==0;function Eo({id:e,borderRadiusPath:t,borderType:n,left:o,top:i,width:r,height:a},f){let u=`satori_brc-${e}`;return[T("clipPath",{id:u},T(n,{x:o,y:i,width:r,height:a,d:t||void 0})),u]}function it({left:e,top:t,width:n,height:o},i,r){let{borderTopLeftRadius:a,borderTopRightRadius:f,borderBottomLeftRadius:u,borderBottomRightRadius:d,fontSize:c}=i,p,g,b,x;if([p,a]=Rn(a,n,o,c,i),[g,f]=Rn(f,n,o,c,i),[b,u]=Rn(u,n,o,c,i),[x,d]=Rn(d,n,o,c,i),!r&&!kn(a)&&!kn(f)&&!kn(u)&&!kn(d))return"";a||=[0,0],f||=[0,0],u||=[0,0],d||=[0,0],[a[0],f[0]]=En(a[0],f[0],n),[u[0],d[0]]=En(u[0],d[0],n),[a[1],u[1]]=En(a[1],u[1],o),[f[1],d[1]]=En(f[1],d[1],o),p&&Tn(a),g&&Tn(f),b&&Tn(u),x&&Tn(d);let E=[];E[0]=[f,f],E[1]=[d,[-d[0],d[1]]],E[2]=[u,[-u[0],-u[1]]],E[3]=[a,[a[0],-a[1]]];let A=`h${n-a[0]-f[0]} a${E[0][0]} 0 0 1 ${E[0][1]}`,N=`v${o-f[1]-d[1]} a${E[1][0]} 0 0 1 ${E[1][1]}`,P=`h${d[0]+u[0]-n} a${E[2][0]} 0 0 1 ${E[2][1]}`,v=`v${u[1]+a[1]-o} a${E[3][0]} 0 0 1 ${E[3][1]}`;if(r){let R=function(be){let ie=ba([a,f,d,u][be]);return be===0?[[e+a[0]-ie,t+a[1]-ie],[e+a[0],t]]:be===1?[[e+n-f[0]+ie,t+f[1]-ie],[e+n,t+f[1]]]:be===2?[[e+n-d[0]+ie,t+o-d[1]+ie],[e+n-d[0],t+o]]:[[e+u[0]-ie,t+o-u[1]+ie],[e,t+o-u[1]]]},S=r.indexOf(!1);if(!r.includes(!0))throw new Error("Invalid `partialSides`.");if(S===-1)S=0;else for(;!r[S];)S=(S+1)%4;let M="",B=R(S),H=`M${B[0]} A${E[(S+3)%4][0]} 0 0 1 ${B[1]}`,X=0;for(;X<4&&r[(S+X)%4];X++)M+=H+" ",H=[A,N,P,v][(S+X)%4];let he=(S+X)%4;M+=H.split(" ")[0];let le=R(he);return M+=` A${E[(he+3)%4][0]} 0 0 1 ${le[0]}`,M}return`M${e+a[0]},${t} ${A} ${N} ${P} ${v}`}function To(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function Ro({id:e,currentClipPathId:t,borderPath:n,borderType:o,left:i,top:r,width:a,height:f},u){if(!(u.borderTopWidth||u.borderRightWidth||u.borderBottomWidth||u.borderLeftWidth))return null;let c=`satori_bc-${e}`;return[T("clipPath",{id:c,"clip-path":t?`url(#${t})`:void 0},T(o,{x:i,y:r,width:a,height:f,d:n||void 0})),c]}function Jt({left:e,top:t,width:n,height:o,props:i,asContentMask:r,maskBorderOnly:a},f){let u=["borderTop","borderRight","borderBottom","borderLeft"];if(!r&&!u.some(b=>f[b+"Width"]))return"";let d="",c=0;for(;c>0&&To(u[c],u[(c+3)%4],f);)c=(c+3)%4;let p=[!1,!1,!1,!1],g=[];for(let b=0;b<4;b++){let x=(c+b)%4,E=(c+b+1)%4,A=u[x],N=u[E];if(p[x]=!0,g=[f[A+"Width"],f[A+"Style"],f[A+"Color"],A],!To(A,N,f)){let P=(g[0]||0)+(r&&!a&&f[A.replace("border","padding")]||0);P&&(d+=T("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":P*2,"stroke-dasharray":!r&&g[1]==="dashed"?P*2+" "+P:void 0,d:it({left:e,top:t,width:n,height:o},f,p)})),p=[!1,!1,!1,!1]}}if(p.some(Boolean)){let b=(g[0]||0)+(r&&!a&&f[g[3].replace("border","padding")]||0);b&&(d+=T("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":b*2,"stroke-dasharray":!r&&g[1]==="dashed"?b*2+" "+b:void 0,d:it({left:e,top:t,width:n,height:o},f,p)}))}return d}function ar({id:e,left:t,top:n,width:o,height:i,matrix:r,borderOnly:a},f){let u=(f.borderLeftWidth||0)+(a?0:f.paddingLeft||0),d=(f.borderTopWidth||0)+(a?0:f.paddingTop||0),c=(f.borderRightWidth||0)+(a?0:f.paddingRight||0),p=(f.borderBottomWidth||0)+(a?0:f.paddingBottom||0),g={x:t+u,y:n+d,width:o-u-c,height:i-d-p};return T("mask",{id:e},T("rect",{...g,fill:"#fff",transform:f.overflow==="hidden"&&f.transform&&r?r:void 0,mask:f._inheritedMaskId?`url(#${f._inheritedMaskId})`:void 0})+Jt({left:t,top:n,width:o,height:i,props:{transform:r||void 0},asContentMask:!0,maskBorderOnly:a},f))}import{getStylesForProperty as ko}from"css-to-react-native";var Zt={circle:/circle\((.+)\)/,ellipse:/ellipse\((.+)\)/,path:/path\((.+)\)/,polygon:/polygon\((.+)\)/,inset:/inset\((.+)\)/};function Co({width:e,height:t},n,o){function i(d){let c=d.match(Zt.circle);if(!c)return null;let[,p]=c,[g,b=""]=p.split("at").map(A=>A.trim()),{x,y:E}=_o(b,e,t);return{type:"circle",r:D(g,o.fontSize,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/Math.sqrt(2),o,!0),cx:D(x,o.fontSize,e,o,!0),cy:D(E,o.fontSize,t,o,!0)}}function r(d){let c=d.match(Zt.ellipse);if(!c)return null;let[,p]=c,[g,b=""]=p.split("at").map(P=>P.trim()),[x,E]=g.split(" "),{x:A,y:N}=_o(b,e,t);return{type:"ellipse",rx:D(x||"50%",o.fontSize,e,o,!0),ry:D(E||"50%",o.fontSize,t,o,!0),cx:D(A,o.fontSize,e,o,!0),cy:D(N,o.fontSize,t,o,!0)}}function a(d){let c=d.match(Zt.path);if(!c)return null;let[p,g]=Io(c[1]);return{type:"path",d:g,"fill-rule":p}}function f(d){let c=d.match(Zt.polygon);if(!c)return null;let[p,g]=Io(c[1]);return{type:"polygon","fill-rule":p,points:g.split(",").map(b=>b.split(" ").map((x,E)=>D(x,o.fontSize,E===0?e:t,o,!0)).join(" ")).join(",")}}function u(d){let c=d.match(Zt.inset);if(!c)return null;let[p,g]=(c[1].includes("round")?c[1]:`${c[1].trim()} round 0`).split("round"),b=ko("borderRadius",g,!0),x=Object.values(b).map(S=>String(S)).map((S,R)=>D(S,o.fontSize,R===0||R===2?t:e,o,!0)||0),E=Object.values(ko("margin",p,!0)).map(S=>String(S)).map((S,R)=>D(S,o.fontSize,R===0||R===2?t:e,o,!0)||0),A=E[3],N=E[0],P=e-(E[1]+E[3]),v=t-(E[0]+E[2]);return x.some(S=>S>0)?{type:"path",d:it({left:A,top:N,width:P,height:v},{...n,...b})}:{type:"rect",x:A,y:N,width:P,height:v}}return{parseCircle:i,parseEllipse:r,parsePath:a,parsePolygon:f,parseInset:u}}function Io(e){let[,t="nonzero",n]=e.replace(/('|")/g,"").match(/^(nonzero|evenodd)?,?(.+)/)||[];return[t,n]}function _o(e,t,n){let o=e.split(" "),i={x:o[0]||"50%",y:o[1]||"50%"};return o.forEach(r=>{r==="top"?i.y=0:r==="bottom"?i.y=n:r==="left"?i.x=0:r==="right"?i.x=t:r==="center"&&(i.x=t/2,i.y=n/2)}),i}function In(e){return`satori_cp-${e}`}function Ao(e){return`url(#${In(e)})`}function Mo(e,t,n){if(t.clipPath==="none")return"";let o=Co(e,t,n),i=t.clipPath,r={type:""};for(let a of Object.keys(o))if(r=o[a](i),r)break;if(r){let{type:a,...f}=r;return T("clipPath",{id:In(e.id),"clip-path":e.currentClipPath,transform:`translate(${e.left}, ${e.top})`},T(a,f))}return""}function sr({left:e,top:t,width:n,height:o,path:i,matrix:r,id:a,currentClipPath:f,src:u},d,c){let p="",g=d.clipPath&&d.clipPath!=="none"?Mo({left:e,top:t,width:n,height:o,path:i,id:a,matrix:r,currentClipPath:f,src:u},d,c):"";if(d.overflow!=="hidden"&&!u)p="";else{let x=g?`satori_ocp-${a}`:In(a);p=T("clipPath",{id:x,"clip-path":f},T(i?"path":"rect",{x:e,y:t,width:n,height:o,d:i||void 0,transform:d.overflow==="hidden"&&d.transform&&r?r:void 0}))}let b=ar({id:`satori_om-${a}`,left:e,top:t,width:n,height:o,matrix:r,borderOnly:!u},d);return g+p+b}var ya=e=>`satori_mi-${e}`;async function ur(e,t,n){if(!t.maskImage)return["",""];let{left:o,top:i,width:r,height:a,id:f}=e,u=t.maskImage,d=u.length;if(!d)return["",""];let c=ya(f),p="";for(let g=0;g<d;g++){let b=u[g],[x,E]=await Kt({id:`${c}-${g}`,left:o,top:i,width:r,height:a},b,n,"mask");p+=E+T("rect",{x:o,y:i,width:r,height:a,fill:`url(#${x})`})}return p=T("mask",{id:c},p),[c,p]}function xa(e,t,n){let o=e.toLowerCase().trim().split(/\s+/),i=(u,d)=>({left:"0%",center:"50%",right:"100%",top:"0%",bottom:"100%"})[u]||u,r,a;if(o.length===1){let u=o[0];u==="left"||u==="center"||u==="right"?(r=i(u,"x"),a="50%"):u==="top"||u==="bottom"?(r="50%",a=i(u,"y")):(r=u,a="50%")}else{let u=o[0],d=o[1];u==="top"||u==="bottom"?(a=i(u,"y"),d==="left"||d==="right"||d==="center"?r=i(d,"x"):(r="50%",a=u==="top"||u==="bottom"?i(u,"y"):d)):(r=i(u,"x"),a=i(d,"y"))}let f=(u,d)=>{try{if(u.endsWith("%"))return d*parseFloat(u)/100;let c=new He(u);return c.type==="length"||c.type==="number"?c.value:0}catch{return 0}};return[f(r,t),f(a,n)]}async function Qt({id:e,left:t,top:n,width:o,height:i,isInheritingTransform:r,src:a,debug:f},u,d){if(u.display==="none")return"";let c=!!a,p="rect",g="",b="",x=[],E=1,A="";u.backgroundColor&&x.push(u.backgroundColor),u.opacity!==void 0&&(E=+u.opacity),u.transform&&(g=Yt({left:t,top:n,width:o,height:i},u.transform,r,u.transformOrigin));let N="";if(u.backgroundImage){let Y=[];for(let j=0;j<u.backgroundImage.length;j++){let Ie=u.backgroundImage[j],De=await Kt({id:e+"_"+j,width:o,height:i,left:t,top:n},Ie,d);De&&Y.unshift(De)}for(let j of Y)x.push(`url(#${j[0]})`),b+=j[1],j[2]&&(N+=j[2])}let[P,v]=await ur({id:e,left:t,top:n,width:o,height:i},u,d);b+=v;let S=P?`url(#${P})`:u._inheritedMaskId?`url(#${u._inheritedMaskId})`:void 0,R=it({left:t,top:n,width:o,height:i},u);R&&(p="path");let M=u._inheritedClipPathId;f&&(A=T("rect",{x:t,y:n,width:o,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:g||void 0,"clip-path":M?`url(#${M})`:void 0}));let{backgroundClip:B,filter:H,mixBlendMode:X}=u,he=[H?`filter:${H}`:void 0,X?`mix-blend-mode:${X}`:void 0].filter(Y=>Y).join(";")||void 0,le=B==="text"?`url(#satori_bct-${e})`:M?`url(#${M})`:u.clipPath?Ao(e):void 0,be=sr({left:t,top:n,width:o,height:i,path:R,id:e,matrix:g,currentClipPath:le,src:a},u,d),ie=x.map(Y=>T(p,{x:t,y:n,width:o,height:i,fill:Y,d:R||void 0,transform:g||void 0,"clip-path":u.transform?void 0:le,style:he,mask:u.transform?void 0:S})).join(""),ce=Ro({id:e,left:t,top:n,width:o,height:i,currentClipPathId:M,borderPath:R,borderType:p},u),ae;if(c){let Y=(u.borderLeftWidth||0)+(u.paddingLeft||0),j=(u.borderTopWidth||0)+(u.paddingTop||0),Ie=(u.borderRightWidth||0)+(u.paddingRight||0),De=(u.borderBottomWidth||0)+(u.paddingBottom||0),se=o-Y-Ie,Se=i-j-De,We=(u.objectPosition||"center").toString(),[W,ne]=xa(We,se,Se),U=u.__naturalWidth||se,re=u.__naturalHeight||Se,O,oe=se,fe=Se,Ee=t+Y,Te=n+j;if(u.objectFit==="contain"){let Z=se/U,Re=Se/re,ye=Math.min(Z,Re);oe=U*ye,fe=re*ye,Ee=t+Y+W-oe*W/se,Te=n+j+ne-fe*ne/Se,O="none"}else if(u.objectFit==="cover"){let Z=se/U,Re=Se/re,ye=Math.max(Z,Re);oe=U*ye,fe=re*ye,Ee=t+Y+W-oe*W/se,Te=n+j+ne-fe*ne/Se,O="none"}else if(u.objectFit==="fill")O="none";else if(u.objectFit==="scale-down")if(U&&re){let Z=se/U,Re=Se/re,ye=Math.min(Z,Re);if(ye>=1)oe=U,fe=re,O="none",Ee=t+Y+W-oe*W/se,Te=n+j+ne-fe*ne/Se;else{let Oe=ye;oe=U*Oe,fe=re*Oe,Ee=t+Y+W-oe*W/se,Te=n+j+ne-fe*ne/Se,O="none"}}else{let Z=se/U,Re=Se/re,ye=Math.min(Z,Re);oe=U*ye,fe=re*ye,Ee=t+Y+W-oe*W/se,Te=n+j+ne-fe*ne/Se,O="none"}else O="none";u.transform&&(ae=Eo({id:e,borderRadiusPath:R,borderType:p,left:t,top:n,width:o,height:i},u)),ie+=T("image",{x:Ee,y:Te,width:oe,height:fe,href:a,preserveAspectRatio:O,transform:g||void 0,style:he,"clip-path":u.transform?ae?`url(#${ae[1]})`:void 0:`url(#satori_cp-${e})`,mask:u.transform?void 0:P?`url(#${P})`:`url(#satori_om-${e})`})}if(ce){b+=ce[0];let Y=ce[1];ie+=Jt({left:t,top:n,width:o,height:i,props:{transform:g||void 0,"clip-path":`url(#${Y})`}},u)}let ke=fo({width:o,height:i,id:e,opacity:E,shape:T(p,{x:t,y:n,width:o,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:R||void 0,transform:g||void 0,"clip-path":le,mask:S})},u);return(b?T("defs",{},b):"")+(ke?ke[0]:"")+(ae?ae[0]:"")+be+(E!==1?`<g opacity="${E}">`:"")+(u.transform&&(le||S)?`<g${le?` clip-path="${le}"`:""}${S?` mask="${S}"`:""}>`:"")+(N||ie)+(u.transform&&(le||S)?"</g>":"")+(E!==1?"</g>":"")+(ke?ke[1]:"")+A}var Sa=e=>{let t="",n="SourceGraphic",o=!1,i=e.match(/blur\(([\d.]+)(?:px)?\)/);if(i){o=!0;let d="satori_bfblur";t+=T("feGaussianBlur",{edgeMode:"duplicate",in:n,result:d,stdDeviation:parseFloat(i[1])}),n=d}let r=e.match(/saturate\(([\d.]+)(%?)\)/);if(r){let d=r[2]==="%"?parseFloat(r[1])/100:parseFloat(r[1]),c="satori_bfsat";t+=T("feColorMatrix",{in:n,result:c,type:"saturate",values:d}),n=c}let a=e.match(/brightness\(([\d.]+)\)/);if(a){let d=parseFloat(a[1]),c="satori_bfbri";t+=T("feComponentTransfer",{in:n,result:c},T("feFuncR",{slope:d,type:"linear"})+T("feFuncG",{slope:d,type:"linear"})+T("feFuncB",{slope:d,type:"linear"})),n=c}let f=e.match(/contrast\(([\d.]+)\)/);if(f){let d=parseFloat(f[1]),c=-(.5*d)+.5,p="satori_bfcon";t+=T("feComponentTransfer",{in:n,result:p},T("feFuncR",{intercept:c,slope:d,type:"linear"})+T("feFuncG",{intercept:c,slope:d,type:"linear"})+T("feFuncB",{intercept:c,slope:d,type:"linear"})),n=p}let u=e.match(/grayscale\(([\d.]+)(%?)\)/);if(u){let d=u[2]==="%"?parseFloat(u[1])/100:parseFloat(u[1]),c="satori_bfgray";t+=T("feColorMatrix",{in:n,result:c,type:"saturate",values:1-Math.min(d,1)}),n=c}return o&&(t+=T("feComposite",{in:n,in2:"SourceGraphic",operator:"atop"})),t},Po=e=>{let{bgGroupId:t,filterValue:n,height:o,id:i,left:r,maskId:a,style:f,top:u,width:d}=e,c=Sa(n);if(!c)return"";let p=`satori_bf-${i}`,g=`satori_bfc-${i}`,b=T("filter",{height:"200%",id:p,width:"200%",x:"-50%",y:"-50%"},c),x=it({height:o,left:r,top:u,width:d},f),E=x?T("path",{d:x}):T("rect",{height:o,width:d,x:r,y:u}),A=T("clipPath",{id:g},E),N=T("defs",{},b+A),P={"clip-path":`url(#${g})`,filter:`url(#${p})`,href:`#${t}`};a&&(P.mask=`url(#${a})`);let v=T("use",P);return N+v};var Wo=String.raw,Lo=Wo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,No=()=>new RegExp(Wo`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Lo}(?:\u200D${Lo})*`,"gu");var wa=new RegExp(No(),"u"),lr={emoji:wa,symbol:new RegExp("\\p{Symbol}","u"),math:new RegExp("\\p{Math}","u")},cr={"ja-JP":new RegExp("\\p{scx=Hira}|\\p{scx=Kana}|\\p{scx=Han}|[\\u3000]|[\\uFF00-\\uFFEF]","u"),"ko-KR":new RegExp("\\p{scx=Hangul}","u"),"zh-CN":new RegExp("\\p{scx=Han}","u"),"zh-TW":new RegExp("\\p{scx=Han}","u"),"zh-HK":new RegExp("\\p{scx=Han}","u"),"th-TH":new RegExp("\\p{scx=Thai}","u"),"bn-IN":new RegExp("\\p{scx=Bengali}","u"),"ar-AR":new RegExp("\\p{scx=Arabic}","u"),"ta-IN":new RegExp("\\p{scx=Tamil}","u"),"ml-IN":new RegExp("\\p{scx=Malayalam}","u"),"he-IL":new RegExp("\\p{scx=Hebrew}","u"),"te-IN":new RegExp("\\p{scx=Telugu}","u"),devanagari:new RegExp("\\p{scx=Devanagari}","u"),kannada:new RegExp("\\p{scx=Kannada}","u")},_n=Object.keys({...cr,...lr});function Oo(e){return _n.includes(e)}function Fo(e,t){for(let o of Object.keys(lr))if(lr[o].test(e))return[o];let n=Object.keys(cr).filter(o=>cr[o].test(e));if(n.length===0)return["unknown"];if(t){let o=n.findIndex(i=>i===t);o!==-1&&(n.splice(o,1),n.unshift(t))}return n}function Bo(e){if(e)return _n.find(t=>t.toLowerCase().startsWith(e.toLowerCase()))}async function*en(e,t){var We;let n=await mt(),{id:o,inheritedStyle:i,parent:r,font:a,debug:f,locale:u,embedFont:d=!0,graphemeImages:c,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!_t(e)||Rr(e.type)){let W;if(!_t(e))W=or(String(e),t),yield(await W.next()).value;else{if(Tr(e.type))throw new Error("Class component is not supported.");let U;Wn(e.type)?U=e.type.render:U=e.type,W=en(await U(e.props),t),yield(await W.next()).value}await W.next();let ne=yield;return(await W.next(ne)).value}let{type:g,props:b}=e,x=g;if(b&&kr(b))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:E,children:A,lang:N=u}=b||{},P=Bo(N),v=n.Node.create();r.insertChild(v,r.getChildCount());let[S,R]=await Zn(v,x,i,E,b),M=S.transform===i.transform;if(M||(S.transform.__parent=i.transform),(S.overflow==="hidden"||S.clipPath&&S.clipPath!=="none")&&(R._inheritedClipPathId=`satori_cp-${o}`,R._inheritedMaskId=`satori_om-${o}`),S.maskImage&&(R._inheritedMaskId=`satori_mi-${o}`),S.backdropFilter&&t._registerBackdropFilter&&t._registerBackdropFilter({filter:S.backdropFilter,inheritedStyle:R,node:v,style:S}),S.backgroundClip==="text"){let W={value:""};R._inheritedBackgroundClipTextPath=W,S._inheritedBackgroundClipTextPath=W,S.backgroundImage&&(R._inheritedBackgroundClipTextHasBackground="true",S._inheritedBackgroundClipTextHasBackground="true")}let B=Ir(A),H=[],X={},he=0,le=[];for(let W of B){let ne=he,U=en(W,{id:o+"-"+he++,parentStyle:S,inheritedStyle:R,isInheritingTransform:!0,parent:v,font:a,embedFont:d,debug:f,graphemeImages:c,canLoadAdditionalAssets:p,locale:P,onNodeDetected:t.onNodeDetected,_registerBackdropFilter:re=>{X[ne]=re}});p?le.push(...(await U.next()).value||[]):await U.next(),H.push(U)}yield le;for(let W of H)await W.next();let[be,ie]=yield,{left:ce,top:ae,width:ke,height:Y}=v.getComputedLayout();ce+=be,ae+=ie;let j="",Ie="",De="",{children:se,...Se}=b;if((We=t.onNodeDetected)==null||We.call(t,{left:ce,top:ae,width:ke,height:Y,type:x,props:Se,key:e.key,textContent:_t(se)?void 0:se}),x==="img"){let W=S.__src;Ie=await Qt({id:o,left:ce,top:ae,width:ke,height:Y,src:W,isInheritingTransform:M,debug:f},S,R)}else if(x==="svg"){let W=S.color,ne=await Jr(e,W);Ie=await Qt({id:o,left:ce,top:ae,width:ke,height:Y,src:ne,isInheritingTransform:M,debug:f},S,R)}else{let W=E==null?void 0:E.display;if(x==="div"&&A&&typeof A!="string"&&W!=="flex"&&W!=="none"&&W!=="contents")throw new Error('Expected <div> to have explicit "display: flex", "display: contents", or "display: none" if it has more than one child node.');Ie=await Qt({id:o,left:ce,top:ae,width:ke,height:Y,isInheritingTransform:M,debug:f},S,R)}for(let W=0;W<H.length;W++){if(X[W]){let ne=X[W],U=ne.node.getComputedLayout(),re=ce+U.left,O=ae+U.top,oe=U.width,fe=U.height,Ee=`satori_bfbg-${o}-${W}`,Te=Ie+j;Ie=`<g id="${Ee}">${Te}</g>`,j="";let Z=o+"-"+W,Re=ne.style.maskImage?`satori_mi-${Z}`:void 0;j+=Po({bgGroupId:Ee,filterValue:ne.filter,height:fe,id:Z,left:re,maskId:Re,style:ne.style,top:O,width:oe})}j+=(await H[W].next([ce,ae])).value}return S._inheritedBackgroundClipTextPath&&(De+=T("clipPath",{id:`satori_bct-${o}`,"clip-path":S._inheritedClipPathId?`url(#${S._inheritedClipPathId})`:void 0},S._inheritedBackgroundClipTextPath.value)),De+Ie+j}import tn from"@shuding/opentype.js";var $o="unknown";function va(e){let t=[],n=[0,0],o=[0,0],i=(r,a)=>{let f=r[0];for(let u=1;u<=a;u++){let d=u/a,c=Ea(r,d);t.push({from:f,to:c}),f=c}o=r[r.length-1]};for(let r of e){if(r.type==="M"){n=o=[r.x,r.y];continue}if(r.type==="L"){let a=[r.x,r.y];t.push({from:o,to:a}),o=a;continue}if(r.type==="Q"){i([o,[r.x1,r.y1],[r.x,r.y]],12);continue}if(r.type==="C"){i([o,[r.x1,r.y1],[r.x2,r.y2],[r.x,r.y]],16);continue}r.type==="Z"&&(t.push({from:o,to:n}),o=n)}return t}function Ea(e,t){let n=e;for(;n.length>1;){let o=[];for(let i=0;i<n.length-1;i++)o.push([n[i][0]+(n[i+1][0]-n[i][0])*t,n[i][1]+(n[i+1][1]-n[i][1])*t]);n=o}return n[0]}function Ta(e,t){if(!t)return[];let n=t.strokeWidth,o=t.underlineY-n*.25,i=t.underlineY+n*2.5,r=va(e);if(!r.length)return[];let a=i-o,f=Math.max(12,Math.ceil(a/.25)),u=a/f,d=o+u/2,c=new Set;for(let v=0;v<f;v++){let S=d+u*v,R=[];for(let M of r){let[B,H]=M.from,[X,he]=M.to;if(H===he)continue;let le=Math.min(H,he),be=Math.max(H,he);if(S<le||S>=be)continue;let ie=(S-H)/(he-H),ce=B+(X-B)*ie;R.push(ce)}if(R.length){R.sort((M,B)=>M-B);for(let M=0;M<R.length-1;M+=2){let B=Math.min(R[M],R[M+1]),H=Math.max(R[M],R[M+1]),X=Math.floor(B),he=Math.ceil(H);for(let le=X;le<he;le++)c.add(le)}}}if(!c.size)return[];let p=Array.from(c.values()).sort((v,S)=>v-S),g=[],b=p[0],x=p[0];for(let v=1;v<p.length;v++){let S=p[v];S>x+1&&(g.push([b,x+1]),b=S),x=S}g.push([b,x+1]);let E=[],A=n*.6,N=g[0][0],P=g[g.length-1][1];for(let[v,S]of g){let R=Math.min(v,N)-A,M=Math.max(S,P)+A;E.push({x1:R,x2:M,y1:o,y2:i})}return E}function Ra(e,t,[n,o],[i,r]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(o!==r){if(o===t)return-1;if(r===t)return 1}return-1}var fr=new WeakMap,nn=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:o}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],r=i[0];for(let a=1;a<i.length;a++){let[,f,u]=r,[,d,c]=i[a];Ra(n,o,[f,u],[d,c])>0&&(r=i[a])}return r[0]}addFonts(t){for(let n of t){let{name:o,data:i,lang:r}=n;if(r&&!Oo(r))throw new Error(`Invalid value for props \`lang\`: "${r}". The value must be one of the following: ${_n.join(", ")}.`);let a=r??$o,f;if(fr.has(i))f=fr.get(i);else{f=tn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0});let d=f.charToGlyphIndex;f.charToGlyphIndex=c=>{let p=d.call(f,c);return p===0&&f._trackBrokenChars&&f._trackBrokenChars.push(c),p},fr.set(i,f)}this.defaultFont||(this.defaultFont=f);let u=`${o.toLowerCase()}_${a}`;this.fonts.has(u)||this.fonts.set(u,[]),this.fonts.get(u).push([f,n.weight,n.style])}}getEngine(t=16,n="normal",{fontFamily:o="sans-serif",fontWeight:i=400,fontStyle:r="normal"},a){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");o=(Array.isArray(o)?o:[o]).map(v=>v.toLowerCase());let f=[];o.forEach(v=>{let S=this.get({name:v,weight:i,style:r});if(S){f.push(S);return}let R=this.get({name:v+"_unknown",weight:i,style:r});if(R){f.push(R);return}});let u=Array.from(this.fonts.keys()),d=[],c=[],p=[];for(let v of u)if(!o.includes(v))if(a){let S=ka(v);S?S===a?d.push(this.get({name:v,weight:i,style:r})):c.push(this.get({name:v,weight:i,style:r})):p.push(this.get({name:v,weight:i,style:r}))}else p.push(this.get({name:v,weight:i,style:r}));let g=new Map,b=(v,S=!0)=>{let R=[...f,...p,...d,...S?c:[]];if(typeof v>"u")return S?R[R.length-1]:void 0;let M=v.charCodeAt(0);if(g.has(M))return g.get(M);let B=R.find((H,X)=>!!H.charToGlyphIndex(v)||S&&X===R.length-1);return B&&g.set(M,B),B},x=(v,S=!1)=>{var M,B;return((S?(B=(M=v.tables)==null?void 0:M.os2)==null?void 0:B.sTypoAscender:0)||v.ascender)/v.unitsPerEm*t},E=(v,S=!1)=>{var M,B;return((S?(B=(M=v.tables)==null?void 0:M.os2)==null?void 0:B.sTypoDescender:0)||v.descender)/v.unitsPerEm*t},A=(v,S=!1)=>{var R,M;if(typeof n=="string"&&n==="normal"){let B=(S?(M=(R=v.tables)==null?void 0:R.os2)==null?void 0:M.sTypoLineGap:0)||0;return x(v,S)-E(v,S)+B/v.unitsPerEm*t}else if(typeof n=="number")return t*n},N=v=>b(v,!1);return{has:v=>{if(v===`
5
- `)return!0;let S=N(v);return S?(S._trackBrokenChars=[],S.stringToGlyphs(v),S._trackBrokenChars.length?(S._trackBrokenChars=void 0,!1):!0):!1},baseline:(v,S=typeof v>"u"?f[0]:b(v))=>{let R=x(S),M=E(S),B=R-M;return R+(A(S)-B)/2},height:(v,S=typeof v>"u"?f[0]:b(v))=>A(S),measure:(v,S)=>this.measure(b,v,S),getSVG:(v,S,R)=>this.getSVG(b,v,S,R)}}patchFontFallbackResolver(t,n){let o=[];t._trackBrokenChars=o;let i=t.stringToGlyphs;return t.stringToGlyphs=(r,...a)=>{let f=i.call(t,r,...a);for(let u=0;u<f.length;u++)if(f[u].unicode===void 0){let d=o.shift(),c=n(d);if(c!==t){let p=c.charToGlyph(d),g=t.unitsPerEm/c.unitsPerEm,b=new tn.Path;b.unitsPerEm=t.unitsPerEm,b.commands=p.path.commands.map(E=>{let A={...E};for(let N in A)typeof A[N]=="number"&&(A[N]*=g);return A});let x=new tn.Glyph({...p,advanceWidth:p.advanceWidth*g,xMin:p.xMin*g,xMax:p.xMax*g,yMin:p.yMin*g,yMax:p.yMax*g,path:b});f[u]=x}}return f},()=>{t.stringToGlyphs=i,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:o,letterSpacing:i=0}){let r=t(n),a=this.patchFontFallbackResolver(r,t);try{return r.getAdvanceWidth(n,o,{letterSpacing:i/o})}finally{a()}}getSVG(t,n,{fontSize:o,top:i,left:r,letterSpacing:a=0},f){let u=t(n),d=this.patchFontFallbackResolver(u,t);try{if(o===0)return{path:"",boxes:[]};let c=new tn.Path,p=[],g={letterSpacing:a/o},b=new WeakMap;return u.forEachGlyph(n.replace(/\n/g,""),r,i,o,g,function(x,E,A,N){let P;if(!b.has(x))P=x.getPath(E,A,N,g),b.set(x,[E,A,P]);else{let[S,R,M]=b.get(x);P=new tn.Path,P.commands=M.commands.map(B=>{let H={...B};for(let X in H)typeof H[X]=="number"&&((X==="x"||X==="x1"||X==="x2")&&(H[X]+=E-S),(X==="y"||X==="y1"||X==="y2")&&(H[X]+=A-R));return H})}let v=f?Ta(P.commands,f):[];v.length&&p.push(...v),c.extend(P)}),{path:c.toPathData(1),boxes:p}}finally{d()}}};function ka(e){let t=e.split("_"),n=t[t.length-1];return n===$o?void 0:n}function dr({width:e,height:t,content:n}){return T("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var pr=new WeakMap;async function Do(e,t){let n=await mt();if(!n||!n.Node)throw new Error("Satori is not initialized: expect `yoga` to be loaded, got "+n);t.fonts=t.fonts||[];let o;pr.has(t.fonts)?o=pr.get(t.fonts):pr.set(t.fonts,o=new nn(t.fonts));let i="width"in t?t.width:void 0,r="height"in t?t.height:void 0,a=Ia(n,t.pointScaleFactor);i&&a.setWidth(i),r&&a.setHeight(r),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let f={...t.graphemeImages},u=new Set;ot.clear(),jt.clear(),await Kr(e);let d=en(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:"normal",color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:i,_viewportHeight:r},parent:a,font:o,embedFont:t.embedFont,debug:t.debug,graphemeImages:f,canLoadAdditionalAssets:!!t.loadAdditionalAsset,onNodeDetected:t.onNodeDetected}),c=(await d.next()).value;if(t.loadAdditionalAsset&&c.length){let x=_a(c),E=[],A={};await Promise.all(Object.entries(x).flatMap(([N,P])=>P.map(v=>{let S=`${N}_${v}`;return u.has(S)?null:(u.add(S),t.loadAdditionalAsset(N,v).then(R=>{typeof R=="string"?A[v]=R:R&&(Array.isArray(R)?E.push(...R):E.push(R))}))}))),o.addFonts(E),Object.assign(f,A)}await d.next(),a.calculateLayout(i,r,n.DIRECTION_LTR);let p=(await d.next([0,0])).value,g=a.getComputedWidth(),b=a.getComputedHeight();return a.freeRecursive(),dr({width:g,height:b,content:p})}function Ia(e,t){if(t){let n=e.Config.create();return n.setPointScaleFactor(t),e.Node.createWithConfig(n)}else return e.Node.create()}function _a(e){let t={},n={};for(let{word:o,locale:i}of e){let r=Fo(o,i).join("|");n[r]=n[r]||"",n[r]+=o}return Object.keys(n).forEach(o=>{t[o]=t[o]||[],o==="emoji"?t[o].push(...Go(Pe(n[o],"grapheme"))):(t[o][0]=t[o][0]||"",t[o][0]+=Go(Pe(n[o],"grapheme",o==="unknown"?void 0:o)).join(""))}),t}function Go(e){return Array.from(new Set(e))}export{Do as default,hi as init};
4
+ in CSS rule \`${p}: ${b}\`.${ro(p)}`))}}}if(n.backgroundImage){let{backgrounds:s}=Wi(n);n.backgroundImage=s}(n.maskImage||n.WebkitMaskImage)&&(n.maskImage=Qr(n));let f=Di(n.fontSize,t.fontSize);typeof n.fontSize<"u"&&(n.fontSize=f),n.transformOrigin&&(n.transformOrigin=Jn(n.transformOrigin,f));for(let s in n){let d=n[s];if(s==="lineHeight")typeof d=="string"&&d!=="normal"&&(d=n[s]=D(d,f,f,t,!0)/f);else{if(typeof d=="string"){let c=D(d,f,f,t);typeof c<"u"&&(n[s]=c),d=n[s]}if(typeof d=="string"||typeof d=="object"){let c=ao(d);c&&(n[s]=c),d=n[s]}}if(s==="opacity"&&typeof d=="number"&&(n.opacity=d*t.opacity),s==="transform"){let c=d;for(let p of c){let g=Object.keys(p)[0],b=p[g],x=typeof b=="string"?D(b,f,f,t)??b:b;p[g]=x}}if(s==="textShadowRadius"){let c=d;n.textShadowRadius=c.map(p=>D(p,f,0,t,!1))}if(s==="textShadowOffset"){let c=d;n.textShadowOffset=c.map(({height:p,width:g})=>({height:D(p,f,0,t,!1),width:D(g,f,0,t,!1)}))}}return n}function Di(e,t){if(typeof e=="number")return e;try{let n=new He(e);switch(n.unit){case"em":return n.value*t;case"rem":return n.value*16}}catch{return t}}function io(e){if(e.startsWith("hsl")){let t=Oi(e),[n,o,i]=t.values;return`hsl(${[n,`${o}%`,`${i}%`].concat(t.alpha===1?[]:[t.alpha]).join(",")})`}return e}function Ui(e,t){return e&&e.toLowerCase()!=="currentcolor"?io(e):io(t)}function zi(e,t){return e.replace(/currentcolor/gi,t)}function ji(e,t){return cn(e)&&(e=zi(e,t)),e}async function Zn(e,t,n,o,i){let r=await mt(),a=Object.assign({},n,yn(Zr[t],n),yn(o,n));if(t==="img"){let[f,s,d]=await Lt(i.src);if(s===void 0&&d===void 0){if(i.width===void 0||i.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");s=parseInt(i.width),d=parseInt(i.height)}let c=d/s,p=(a.borderLeftWidth||0)+(a.borderRightWidth||0)+(a.paddingLeft||0)+(a.paddingRight||0),g=(a.borderTopWidth||0)+(a.borderBottomWidth||0)+(a.paddingTop||0)+(a.paddingBottom||0),b=a.width||i.width,x=a.height||i.height,E=typeof b=="number"&&typeof x=="number";E&&(b-=p,x-=g),b===void 0&&x===void 0?(b="100%",e.setAspectRatio(1/c)):b===void 0?typeof x=="number"?b=x/c:e.setAspectRatio(1/c):x===void 0&&(typeof b=="number"?x=b*c:e.setAspectRatio(1/c)),a.width=E?b+p:b,a.height=E?x+g:x,a.__src=f,a.__naturalWidth=s,a.__naturalHeight=d}if(t==="svg"){let f=i.viewBox||i.viewbox,s=At(f),d=s?s[3]/s[2]:null,{width:c,height:p}=i;typeof c>"u"&&p?d==null?c=0:typeof p=="string"&&p.endsWith("%")?c=parseInt(p)/d+"%":(p=D(p,n.fontSize,1,n),c=p/d):typeof p>"u"&&c?d==null?c=0:typeof c=="string"&&c.endsWith("%")?p=parseInt(c)*d+"%":(c=D(c,n.fontSize,1,n),p=c*d):(typeof c<"u"&&(c=D(c,n.fontSize,1,n)||c),typeof p<"u"&&(p=D(p,n.fontSize,1,n)||p),c||=s==null?void 0:s[2],p||=s==null?void 0:s[3]),!a.width&&c&&(a.width=c),!a.height&&p&&(a.height=p)}return e.setDisplay(Le(a.display,{flex:r.DISPLAY_FLEX,block:r.DISPLAY_FLEX,contents:r.DISPLAY_CONTENTS,none:r.DISPLAY_NONE,"-webkit-box":r.DISPLAY_FLEX},r.DISPLAY_FLEX,"display")),e.setAlignContent(Le(a.alignContent,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,"space-between":r.ALIGN_SPACE_BETWEEN,"space-around":r.ALIGN_SPACE_AROUND,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignContent")),e.setAlignItems(Le(a.alignItems,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_STRETCH,"alignItems")),e.setAlignSelf(Le(a.alignSelf,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO,"alignSelf")),e.setJustifyContent(Le(a.justifyContent,{center:r.JUSTIFY_CENTER,"flex-start":r.JUSTIFY_FLEX_START,"flex-end":r.JUSTIFY_FLEX_END,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND},r.JUSTIFY_FLEX_START,"justifyContent")),e.setFlexDirection(Le(a.flexDirection,{row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE},r.FLEX_DIRECTION_ROW,"flexDirection")),e.setFlexWrap(Le(a.flexWrap,{wrap:r.WRAP_WRAP,nowrap:r.WRAP_NO_WRAP,"wrap-reverse":r.WRAP_WRAP_REVERSE},r.WRAP_NO_WRAP,"flexWrap")),typeof a.gap<"u"&&e.setGap(r.GUTTER_ALL,a.gap),typeof a.rowGap<"u"&&e.setGap(r.GUTTER_ROW,a.rowGap),typeof a.columnGap<"u"&&e.setGap(r.GUTTER_COLUMN,a.columnGap),typeof a.flexBasis<"u"&&e.setFlexBasis(pt(a.flexBasis,"flexBasis")),e.setFlexGrow(typeof a.flexGrow>"u"?0:a.flexGrow),e.setFlexShrink(typeof a.flexShrink>"u"?0:a.flexShrink),typeof a.maxHeight<"u"&&e.setMaxHeight(lt(a.maxHeight,"maxHeight")),typeof a.maxWidth<"u"&&e.setMaxWidth(lt(a.maxWidth,"maxWidth")),typeof a.minHeight<"u"&&e.setMinHeight(lt(a.minHeight,"minHeight")),typeof a.minWidth<"u"&&e.setMinWidth(lt(a.minWidth,"minWidth")),e.setOverflow(Le(a.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE,"overflow")),e.setMargin(r.EDGE_TOP,pt(a.marginTop||0)),e.setMargin(r.EDGE_BOTTOM,pt(a.marginBottom||0)),e.setMargin(r.EDGE_LEFT,pt(a.marginLeft||0)),e.setMargin(r.EDGE_RIGHT,pt(a.marginRight||0)),e.setBorder(r.EDGE_TOP,a.borderTopWidth||0),e.setBorder(r.EDGE_BOTTOM,a.borderBottomWidth||0),e.setBorder(r.EDGE_LEFT,a.borderLeftWidth||0),e.setBorder(r.EDGE_RIGHT,a.borderRightWidth||0),e.setPadding(r.EDGE_TOP,a.paddingTop||0),e.setPadding(r.EDGE_BOTTOM,a.paddingBottom||0),e.setPadding(r.EDGE_LEFT,a.paddingLeft||0),e.setPadding(r.EDGE_RIGHT,a.paddingRight||0),e.setBoxSizing(Le(a.boxSizing,{"border-box":r.BOX_SIZING_BORDER_BOX,"content-box":r.BOX_SIZING_CONTENT_BOX},r.BOX_SIZING_BORDER_BOX,"boxSizing")),e.setPositionType(Le(a.position,{absolute:r.POSITION_TYPE_ABSOLUTE,relative:r.POSITION_TYPE_RELATIVE,static:r.POSITION_TYPE_STATIC},r.POSITION_TYPE_RELATIVE,"position")),typeof a.top<"u"&&e.setPosition(r.EDGE_TOP,lt(a.top,"top")),typeof a.bottom<"u"&&e.setPosition(r.EDGE_BOTTOM,lt(a.bottom,"bottom")),typeof a.left<"u"&&e.setPosition(r.EDGE_LEFT,lt(a.left,"left")),typeof a.right<"u"&&e.setPosition(r.EDGE_RIGHT,lt(a.right,"right")),typeof a.height<"u"?e.setHeight(pt(a.height,"height")):e.setHeightAuto(),typeof a.width<"u"?e.setWidth(pt(a.width,"width")):e.setWidthAuto(),[a,qn(a)]}import uo from"escape-html";var so=[1,0,0,1,0,0];function Vi(e,t,n){let o=[...so];for(let i of e){let r=Object.keys(i)[0],a=i[r];if(typeof a=="string")if(r==="translateX")a=parseFloat(a)/100*t,i[r]=a;else if(r==="translateY")a=parseFloat(a)/100*n,i[r]=a;else throw new Error(`Invalid transform: "${r}: ${a}".`);let f=a,s=[...so];switch(r){case"translateX":s[4]=f;break;case"translateY":s[5]=f;break;case"scale":s[0]=f,s[3]=f;break;case"scaleX":s[0]=f;break;case"scaleY":s[3]=f;break;case"rotate":{let d=f*Math.PI/180,c=Math.cos(d),p=Math.sin(d);s[0]=c,s[1]=p,s[2]=-p,s[3]=c;break}case"skewX":s[2]=Math.tan(f*Math.PI/180);break;case"skewY":s[1]=Math.tan(f*Math.PI/180);break}o=Ut(s,o)}e.splice(0,e.length),e.push(...o),e.__resolved=!0}function Yt({left:e,top:t,width:n,height:o},i,r,a){let f;i.__resolved||Vi(i,n,o);let s=i;if(r)f=s;else{let d=(a==null?void 0:a.xAbsolute)??((a==null?void 0:a.xRelative)??50)*n/100,c=(a==null?void 0:a.yAbsolute)??((a==null?void 0:a.yRelative)??50)*o/100,p=e+d,g=t+c;f=Ut([1,0,0,1,p,g],Ut(s,[1,0,0,1,-p,-g])),s.__parent&&(f=Ut(s.__parent,f)),s.splice(0,6,...f)}return`matrix(${f.map(d=>d.toFixed(2)).join(",")})`}function lo({left:e,top:t,width:n,height:o,isInheritingTransform:i},r){let a="",f=1;return r.transform&&(a=Yt({left:e,top:t,width:n,height:o},r.transform,i,r.transformOrigin)),r.opacity!==void 0&&(f=+r.opacity),{matrix:a,opacity:f}}function Qn({id:e,content:t,filter:n,left:o,top:i,width:r,height:a,matrix:f,opacity:s,image:d,clipPathId:c,debug:p,shape:g,decorationShape:b},x){let E="";if(p&&(E=R("rect",{x:o,y:i-a,width:r,height:a,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0})),d){let N={href:d,x:o,y:i,width:r,height:a,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0,style:x.filter?`filter:${x.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+R("image",{...N,opacity:s!==1?s:void 0})+(b||"")+(n?"</g>":"")+E,""]}let C={x:o,y:i,width:r,height:a,"font-weight":x.fontWeight,"font-style":x.fontStyle,"font-size":x.fontSize,"font-family":x.fontFamily,"letter-spacing":x.letterSpacing||void 0,transform:f||void 0,"clip-path":c?`url(#${c})`:void 0,style:x.filter?`filter:${x.filter}`:void 0,"stroke-width":x.WebkitTextStrokeWidth?`${x.WebkitTextStrokeWidth}px`:void 0,stroke:x.WebkitTextStrokeWidth?x.WebkitTextStrokeColor:void 0,"stroke-linejoin":x.WebkitTextStrokeWidth?"round":void 0,"paint-order":x.WebkitTextStrokeWidth?"stroke":void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+R("text",{...C,fill:x.color,opacity:s!==1?s:void 0},uo(t))+(b||"")+(n?"</g>":"")+E,g?R("text",C,uo(t)):""]}function Hi(e,t,n){return e.replace(/([MA])([0-9.-]+),([0-9.-]+)/g,function(o,i,r,a){return i+(parseFloat(r)+t)+","+(parseFloat(a)+n)})}var xn=1.1;function co({id:e,width:t,height:n},o,i=!1){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius>"u")return"";let r=o.shadowColor.length,a="",f="",s=0,d=t,c=0,p=n;for(let g=0;g<r;g++){let b=o.shadowRadius[g]*o.shadowRadius[g]/4;if(s=Math.min(o.shadowOffset[g].width-b,s),d=Math.max(o.shadowOffset[g].width+b+t,d),c=Math.min(o.shadowOffset[g].height-b,c),p=Math.max(o.shadowOffset[g].height+b+n,p),i){let x=`satori_s-${e}-result-${g}`;a+=R("feGaussianBlur",{in:"SourceAlpha",stdDeviation:o.shadowRadius[g]/2,result:`${x}-blur`})+R("feOffset",{in:`${x}-blur`,dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,result:`${x}-offset`})+R("feFlood",{"flood-color":o.shadowColor[g],"flood-opacity":1,result:`${x}-color`})+R("feComposite",{in:`${x}-color`,in2:`${x}-offset`,operator:"in",result:r>1?x:void 0})}else a+=R("feDropShadow",{dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,stdDeviation:o.shadowRadius[g]/2,"flood-color":o.shadowColor[g],"flood-opacity":1,...r>1?{in:"SourceGraphic",result:`satori_s-${e}-result-${g}`}:{}});r>1&&(f=R("feMergeNode",{in:`satori_s-${e}-result-${g}`})+f)}return R("filter",{id:`satori_s-${e}`,x:(s/t*100*xn).toFixed(2)+"%",y:(c/n*100*xn).toFixed(2)+"%",width:((d-s)/t*100*xn).toFixed(2)+"%",height:((p-c)/n*100*xn).toFixed(2)+"%"},a+(f?R("feMerge",{},f):""))}function fo({width:e,height:t,shape:n,opacity:o,id:i},r){if(!r.boxShadow)return null;let a="",f="";for(let s=r.boxShadow.length-1;s>=0;s--){let d="",c=r.boxShadow[s];c.spreadRadius&&c.inset&&(c.spreadRadius=-c.spreadRadius);let p=c.blurRadius*c.blurRadius/4+(c.spreadRadius||0),g=Math.min(-p-(c.inset?c.offsetX:0),0),b=Math.max(p+e-(c.inset?c.offsetX:0),e),x=Math.min(-p-(c.inset?c.offsetY:0),0),E=Math.max(p+t-(c.inset?c.offsetY:0),t),C=`satori_s-${i}-${s}`,N=`satori_ms-${i}-${s}`,P=c.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${c.spreadRadius*2}"`):n;d+=R("mask",{id:N,maskUnits:"userSpaceOnUse"},R("rect",{x:0,y:0,width:r._viewportWidth||"100%",height:r._viewportHeight||"100%",fill:c.inset?"#000":"#fff"})+P.replace('fill="#fff"',c.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let v=P.replace(/d="([^"]+)"/,(S,T)=>'d="'+Hi(T,c.offsetX,c.offsetY)+'"').replace(/x="([^"]+)"/,(S,T)=>'x="'+(parseFloat(T)+c.offsetX)+'"').replace(/y="([^"]+)"/,(S,T)=>'y="'+(parseFloat(T)+c.offsetY)+'"');c.spreadRadius&&c.spreadRadius<0&&(d+=R("mask",{id:N+"-neg",maskUnits:"userSpaceOnUse"},v.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-c.spreadRadius*2}"`))),c.spreadRadius&&c.spreadRadius<0&&(v=R("g",{mask:`url(#${N}-neg)`},v)),d+=R("defs",{},R("filter",{id:C,x:`${g/e*100}%`,y:`${x/t*100}%`,width:`${(b-g)/e*100}%`,height:`${(E-x)/t*100}%`},R("feGaussianBlur",{stdDeviation:c.blurRadius/2,result:"b"})+R("feFlood",{"flood-color":c.color,in:"SourceGraphic",result:"f"})+R("feComposite",{in:"f",in2:"b",operator:c.inset?"out":"in"})))+R("g",{mask:`url(#${N})`,filter:`url(#${C})`,opacity:o},v),c.inset?f+=d:a+=d}return[a,f]}function Xi(e,t,n,o,i,r){let a=i/2,f=Math.max(a,i*1.25),s=[];for(let p of n){if(p.y2<r+a||p.y1>o+a)continue;let g=Math.max(e,p.x1-f),b=Math.min(t,p.x2+f);if(g>=b)continue;if(s.length===0){s.push([g,b]);continue}let x=s[s.length-1];g<=x[1]?x[1]=Math.max(x[1],b):s.push([g,b])}if(!s.length)return[[e,t]];let d=[],c=e;for(let[p,g]of s)if(p>c&&d.push([c,p]),c=Math.max(c,g),c>=t)break;return c<t&&d.push([c,t]),d}function er({width:e,left:t,top:n,ascender:o,clipPathId:i,matrix:r,glyphBoxes:a},f){let{textDecorationColor:s,textDecorationStyle:d,textDecorationLine:c,textDecorationSkipInk:p,fontSize:g,color:b}=f;if(!c||c==="none")return"";let x=Math.max(1,g*.1),E=c==="line-through"?n+o*.7:c==="underline"?n+o*1.1:n,C=d==="dashed"?`${x*1.2} ${x*2}`:d==="dotted"?`0 ${x*2}`:void 0,N=c==="underline"&&(p||"auto")!=="none"&&(a==null?void 0:a.length),P=n+o,v=N?Xi(t,t+e,a,E,x,P):[[t,t+e]],S=d==="double"?v.map(([T,M])=>R("line",{x1:T,y1:E+x+1,x2:M,y2:E+x+1,stroke:s||b,"stroke-width":x,"stroke-dasharray":C,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join(""):"";return(i?`<g clip-path="url(#${i})">`:"")+v.map(([T,M])=>R("line",{x1:T,y1:E,x2:M,y2:E,stroke:s||b,"stroke-width":x,"stroke-dasharray":C,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join("")+S+(i?"</g>":"")}function tr(e){return e=e.replace("U+","0x"),String.fromCodePoint(Number(e))}var vt=tr("U+0020"),nr=tr("U+0009"),Wt=tr("U+2026");function po(e,t,n){let{fontSize:o,letterSpacing:i}=n,r=new Map;function a(d){let c=r.get(d);return c===void 0&&(c=e.measure(d,{fontSize:o,letterSpacing:i}),r.set(d,c)),c}function f(d){let c=0;for(let p of d)t(p)?c+=o:c+=a(p);return c}function s(d){return f(Pe(d,"grapheme"))}return{measureGrapheme:a,measureGraphemeArray:f,measureText:s}}function mo(e,t,n){let{textTransform:o,whiteSpace:i,wordBreak:r}=t;e=Yi(e,o,n);let{content:a,shouldCollapseTabsAndSpaces:f,allowSoftWrap:s}=Ji(e,i),{words:d,requiredBreaks:c,allowBreakWord:p}=Ki(a,r),[g,b]=qi(t,s);return{words:d,requiredBreaks:c,allowSoftWrap:s,allowBreakWord:p,processedContent:a,shouldCollapseTabsAndSpaces:f,lineLimit:g,blockEllipsis:b}}function Yi(e,t,n){return t==="uppercase"?e=e.toLocaleUpperCase(n):t==="lowercase"?e=e.toLocaleLowerCase(n):t==="capitalize"&&(e=Pe(e,"word",n).map(o=>Pe(o,"grapheme",n).map((i,r)=>r===0?i.toLocaleUpperCase(n):i).join("")).join("")),e}function qi(e,t){let{textOverflow:n,lineClamp:o,WebkitLineClamp:i,WebkitBoxOrient:r,overflow:a,display:f}=e;if(f==="block"&&o){let[s,d=Wt]=Zi(o);if(s)return[s,d]}return n==="ellipsis"&&f==="-webkit-box"&&r==="vertical"&&Cr(i)&&i>0?[i,Wt]:n==="ellipsis"&&a==="hidden"&&!t?[1,Wt]:[1/0]}function Ki(e,t){let n=["break-all","break-word"].includes(t),{words:o,requiredBreaks:i}=Pr(e,t);return{words:o,requiredBreaks:i,allowBreakWord:n}}function Ji(e,t){let n=["pre","pre-wrap","pre-line"].includes(t),o=["normal","nowrap","pre-line"].includes(t),i=!["pre","nowrap"].includes(t);return n||(e=e.replace(/\n/g,vt)),o&&(e=e.replace(/([ ]|\t)+/g,vt).replace(/^[ ]|[ ]$/g,"")),{content:e,shouldCollapseTabsAndSpaces:o,allowSoftWrap:i}}function Zi(e){if(typeof e=="number")return[e];let t=/^(\d+)\s*"(.*)"$/,n=/^(\d+)\s*'(.*)'$/,o=t.exec(e),i=n.exec(e);if(o){let r=+o[1],a=o[2];return[r,a]}else if(i){let r=+i[1],a=i[2];return[r,a]}return[]}import go from"parse-css-color";var Qi=new Set([nr]);function ea(e){return Qi.has(e)}function rr(e){if(e==="transparent")return!0;let t=go(e);return t?t.alpha===0:!1}function ho(e){if(!e)return!1;let t=go(e);if(!t)return!1;let[n,o,i,r]=t.values;return n===255&&o===255&&i===255&&(r===void 0||r===1)}async function*or(e,t){let n=await mt(),{parentStyle:o,inheritedStyle:i,parent:r,font:a,id:f,isInheritingTransform:s,debug:d,embedFont:c,graphemeImages:p,locale:g,canLoadAdditionalAssets:b}=t,{textAlign:x,textIndent:E=0,lineHeight:C,textWrap:N,fontSize:P,filter:v,tabSize:S=8,letterSpacing:T,_inheritedBackgroundClipTextPath:M,_inheritedBackgroundClipTextHasBackground:B,flexShrink:U}=o,{words:j,requiredBreaks:ie,allowSoftWrap:ce,allowBreakWord:be,processedContent:ae,shouldCollapseTabsAndSpaces:fe,lineLimit:se,blockEllipsis:ke}=mo(e,o,g),Y=ta(n,x);r.insertChild(Y,r.getChildCount()),Mr(U)&&r.setFlexShrink(1);let H=a.getEngine(P,C,o,g),Ie=b?Pe(ae,"grapheme").filter(G=>!ea(G)&&!H.has(G)):[];yield Ie.map(G=>({word:G,locale:g})),Ie.length&&(H=a.getEngine(P,C,o,g));function De(G){return!!(p&&p[G])}let{measureGrapheme:ue,measureGraphemeArray:Se,measureText:We}=po(H,De,{fontSize:P,letterSpacing:T}),W=cn(S)?D(S,P,1,o):ue(vt)*S,ne=(G,$)=>{if(G.length===0)return{originWidth:0,endingSpacesWidth:0,text:G};let{index:ee,tabCount:X}=na(G),le=0;if(X>0){let pe=G.slice(0,ee),q=G.slice(ee+X),K=We(pe),je=K+$;le=(W===0?K:(Math.floor(je/W)+X)*W)+We(q)}else le=We(G);let Q=G.trimEnd()===G?le:We(G.trimEnd());return{originWidth:le,endingSpacesWidth:le-Q,text:G}},z=[],re=[],O=[],oe=[],de=[];function Ee(G){let $=0,ee=0,X=-1,le=0,Q=0,pe=0,q=0;z=[],O=[0],oe=[],de=[];let K=0,je=0;for(;K<j.length&&$<se;){let V=j[K],ve=ie[K],Ce=0,{originWidth:Ot,endingSpacesWidth:ge,text:St}=ne(V,Q);V=St,Ce=Ot;let _e=ge;ve&&pe===0&&(pe=H.height(V));let at=x==="justify",me=K&&Q+Ce>G+_e&&ce;if(be&&Ce>G&&(!Q||me||ve)){let $e=Pe(V,"grapheme");j.splice(K,1,...$e),Q>0&&(z.push(Q-je),re.push(q),$++,le+=pe,Q=0,pe=0,q=0,O.push(1),X=-1),je=_e;continue}if(ve||me)fe&&V===vt&&(Ce=0),z.push(Q-je),re.push(q),$++,le+=pe,Q=Ce,pe=Ce?Math.round(H.height(V)):0,q=Ce?Math.round(H.baseline(V)):0,O.push(1),X=-1,ve||(ee=Math.max(ee,G));else{Q+=Ce;let $e=Math.round(H.height(V));$e>pe&&(pe=$e,q=Math.round(H.baseline(V))),at&&O[O.length-1]++}at&&X++,ee=Math.max(ee,Q);let Be=Q-Ce;if(Ce===0)de.push({y:le,x:Be,width:0,line:$,lineIndex:X,isImage:!1});else{let $e=Pe(V,"word");for(let Ze=0;Ze<$e.length;Ze++){let Qe=$e[Ze],Me=0,Ve=!1;De(Qe)?(Me=P,Ve=!0):!c&&Qe.length>1?Me=We(Qe):Me=ue(Qe),oe.push(Qe),de.push({y:le,x:Be,width:Me,line:$,lineIndex:X,isImage:Ve}),Be+=Me}}K++,je=_e}return Q&&($<se&&(le+=pe),$++,z.push(Q),re.push(q)),{width:ee,height:le}}let Te={width:0,height:0};Y.setMeasureFunc(G=>{let{width:$,height:ee}=Ee(G);if(N==="balance"){let le=$/2,Q=$,pe=$;for(;le+1<Q;){pe=(le+Q)/2;let{height:K}=Ee(pe);K>ee?le=pe:Q=pe}Ee(Q);let q=Math.ceil(Q);return Te={width:q,height:ee},{width:q,height:ee}}if(N==="pretty"&&z[z.length-1]<$/3){let pe=$*.9,q=Ee(pe);if(q.height<=ee*1.3)return Te={width:$,height:q.height},{width:$,height:q.height}}let X=Math.ceil($);return Te={width:X,height:ee},{width:X,height:ee}});let[Z,Re]=yield,ye="",Oe="",we=i._inheritedClipPathId,Et=i._inheritedMaskId,{left:nt,top:Nt,width:gt,height:Tt}=Y.getComputedLayout(),Rt=typeof E=="string"?D(E,P,gt,o,!0)||0:E,bt=r.getComputedWidth()-r.getComputedPadding(n.EDGE_LEFT)-r.getComputedPadding(n.EDGE_RIGHT)-r.getComputedBorder(n.EDGE_LEFT)-r.getComputedBorder(n.EDGE_RIGHT),rt=Z+nt,Ye=Re+Nt,{matrix:Ue,opacity:yt}=lo({left:nt,top:Nt,width:gt,height:Tt,isInheritingTransform:s},o),Ne="";if(o.textShadowOffset){let{textShadowColor:G,textShadowOffset:$,textShadowRadius:ee}=o;Ne=co({width:Te.width,height:Te.height,id:f},{shadowColor:G,shadowOffset:$,shadowRadius:ee},rr(o.color)||B&&ho(o.color)),Ne=R("defs",{},Ne)}let qe="",Ke="",xt="",dt=-1,Ae={},ze={},Fe=null,Je=0;for(let G=0;G<oe.length;G++){let $=de[G],ee=de[G+1];if(!$)continue;let X=oe[G],le=null,Q=!1,pe=p?p[X]:null,q=$.y,K=$.x,je=$.width,V=$.line,ve=o.textDecorationLine==="underline"&&(o.textDecorationSkipInk||"auto")!=="none";if(V===dt)continue;let Ce=!1;if(V===0&&Rt!==0&&(K+=Rt),z.length>1){let me=gt-z[V];if(x==="right"||x==="end")K+=me;else if(x==="center")K+=me/2;else if(x==="justify"&&V<z.length-1){let he=O[V],Be=he>1?me/(he-1):0;K+=Be*$.lineIndex,Ce=!0}c&&(K=Math.round(K))}let Ot=re[V],ge=H.baseline(X),St=H.height(X),_e=Ot-ge,at=me=>!ve||o.textDecorationLine!=="underline"?void 0:{underlineY:Ye+me+_e+ge+ge*.1,strokeWidth:Math.max(1,P*.1)};if(Ae[V]||(Ae[V]={left:K,top:Ye+q+_e,ascender:ge,width:Ce?gt:z[V]}),se!==1/0){let Qe=function(Me,Ve){let Ft=Pe(Ve,"grapheme",g),kt="",rn=0;for(let on of Ft){let Bt=Me+Se([kt+on]);if(kt&&Bt+he>bt)break;kt+=on,rn=Bt}return{subset:kt,resolvedWidth:rn}},me=ke,he=ue(ke);he>bt&&(me=Wt,he=ue(me));let Be=ue(vt),$e=V<z.length-1;if(V+1===se&&($e||z[V]>bt)){if(K+je+he+Be>bt){let{subset:Me,resolvedWidth:Ve}=Qe(K,X);X=Me+me,dt=V,Ae[V].width=Math.max(0,Ve-Ae[V].left),Q=!0}else if(ee&&ee.line!==V)if(x==="center"){let{subset:Me,resolvedWidth:Ve}=Qe(K,X);X=Me+me,dt=V,Ae[V].width=Math.max(0,Ve-Ae[V].left),Q=!0}else{let Me=oe[G+1],{subset:Ve,resolvedWidth:Ft}=Qe(je+K,Me);X=X+Ve+me,dt=V,Ae[V].width=Math.max(0,Ft-Ae[V].left),Q=!0}}}if(pe)q+=0;else if(c){if(!X.includes(nr)&&!_r.includes(X)&&oe[G+1]&&ee&&!ee.isImage&&q===ee.y&&!Q){Fe===null&&(Je=K),Fe=Fe===null?X:Fe+X;continue}let me=Fe===null?X:Fe+X,he=Fe===null?K:Je,Be=$.width+K-he,$e=at(q),Ze=H.getSVG(me.replace(/(\t)+/g,""),{fontSize:P,left:rt+he,top:Ye+q+ge+_e,letterSpacing:T},$e);le=Ze.path,ve&&Ze.boxes&&Ze.boxes.length&&(ze[V]||(ze[V]=[])).push(...Ze.boxes),Fe=null,d&&(xt+=R("rect",{x:rt+he,y:Ye+q+_e,width:Be,height:St,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0})+R("line",{x1:rt+K,x2:rt+K+$.width,y1:Ye+q+_e+ge,y2:Ye+q+_e+ge,stroke:"#14c000","stroke-width":1,transform:Ue||void 0,"clip-path":we?`url(#${we})`:void 0}))}else if(q+=ge+_e,ve&&!pe){let me=at(q),he=H.getSVG(X.replace(/(\t)+/g,""),{fontSize:P,left:rt+K,top:Ye+q,letterSpacing:T},me);he.boxes&&he.boxes.length&&(ze[V]||(ze[V]=[])).push(...he.boxes)}if(le!==null)Ke+=le+" ";else{let[me,he]=Qn({content:X,filter:Ne,id:f,left:rt+K,top:Ye+q,width:je,height:St,matrix:Ue,opacity:yt,image:pe,clipPathId:we,debug:d,shape:!!M},o);ye+=me,Oe+=he}if(Q)break}if(o.textDecorationLine&&(qe=Object.entries(Ae).map(([G,$])=>{if(!$)return"";let ee=ze[G]||[];return er({left:rt+$.left,top:$.top,width:$.width,ascender:$.ascender,clipPathId:we,matrix:Ue,glyphBoxes:ee},o)}).join("")),Ke){let G=(!rr(o.color)||Ne)&&yt!==0?`<g ${Et?`mask="url(#${Et})"`:""} ${we?`clip-path="url(#${we})"`:""}>`+R("path",{fill:Ne&&(rr(o.color)||B&&ho(o.color))?"black":o.color,d:Ke,transform:Ue||void 0,opacity:yt!==1?yt:void 0,style:v?`filter:${v}`:void 0,"stroke-width":i.WebkitTextStrokeWidth?`${i.WebkitTextStrokeWidth}px`:void 0,stroke:i.WebkitTextStrokeWidth?i.WebkitTextStrokeColor:void 0,"stroke-linejoin":i.WebkitTextStrokeWidth?"round":void 0,"paint-order":i.WebkitTextStrokeWidth?"stroke":void 0})+"</g>":"";M&&(Oe=R("path",{d:Ke,transform:Ue||void 0})),ye+=(Ne?Ne+R("g",{filter:`url(#satori_s-${f})`},G+qe):G+qe)+xt}else qe&&(ye+=Ne?R("g",{filter:`url(#satori_s-${f})`},qe):qe);return Oe&&(o._inheritedBackgroundClipTextPath.value+=Oe),ye}function ta(e,t){let n=e.Node.create();return n.setAlignItems(e.ALIGN_BASELINE),n.setJustifyContent(Le(t,{left:e.JUSTIFY_FLEX_START,right:e.JUSTIFY_FLEX_END,center:e.JUSTIFY_CENTER,justify:e.JUSTIFY_SPACE_BETWEEN,start:e.JUSTIFY_FLEX_START,end:e.JUSTIFY_FLEX_END},e.JUSTIFY_FLEX_START,"textAlign")),n}function na(e){let t=/(\t)+/.exec(e);return t?{index:t.index,tabCount:t[0].length}:{index:null,tabCount:0}}import{parseLinearGradient as oa}from"css-gradient-parser";import ra from"parse-css-color";function Sn(e,t,n,o,i){let r=[],a=t.at(-1),f=a&&a.offset&&a.offset.unit==="%"&&o?+a.offset.value:100;for(let p of t){let{color:g}=p;if(!r.length&&(r.push({offset:0,color:g}),!p.offset||p.offset.value==="0"))continue;let b=typeof p.offset>"u"?void 0:p.offset.unit==="%"?+p.offset.value/f:Number(D(`${p.offset.value}${p.offset.unit}`,n.fontSize,e,n,!0))/e;r.push({offset:b,color:g})}r.length||r.push({offset:0,color:"transparent"});let s=r[r.length-1];s.offset!==1&&(typeof s.offset>"u"?s.offset=1:o?r[r.length-1]={offset:1,color:s.color}:r.push({offset:1,color:s.color}));let d=0,c=1;for(let p=0;p<r.length;p++)if(typeof r[p].offset>"u"){for(c<p&&(c=p);typeof r[c].offset>"u";)c++;r[p].offset=(r[c].offset-r[d].offset)/(c-d)*(p-d)+r[d].offset}else d=p;return i==="mask"?r.map(p=>{let g=ra(p.color);return g?g.alpha===0?{...p,color:"rgba(0, 0, 0, 1)"}:{...p,color:`rgba(255, 255, 255, ${g.alpha})`}:p}):r}function bo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,f,s,d){let c=oa(r),[p,g]=a,b=r.startsWith("repeating"),x,E,C;if(c.orientation.type==="directional")x=aa(c.orientation.value),E=Math.sqrt(Math.pow((x.x2-x.x1)*p,2)+Math.pow((x.y2-x.y1)*g,2));else if(c.orientation.type==="angular"){let{length:T,...M}=sa(Nn(`${c.orientation.value.value}${c.orientation.value.unit}`)/180*Math.PI,p,g);E=T,x=M}C=b?ua(c.stops,E,x,s):x;let N=Sn(b?ia(c.stops,E):E,c.stops,s,b,d),P=`satori_bi${e}`,v=`satori_pattern_${e}`,S=R("pattern",{id:v,x:f[0]/t,y:f[1]/n,width:o?p/t:"1",height:i?g/n:"1",patternUnits:"objectBoundingBox"},R("linearGradient",{id:P,...C,spreadMethod:b?"repeat":"pad"},N.map(T=>R("stop",{offset:(T.offset??0)*100+"%","stop-color":T.color})).join(""))+R("rect",{x:0,y:0,width:p,height:g,fill:`url(#${P})`}));return[v,S]}function ia(e,t){let n=e[e.length-1],{offset:o}=n;return o?o.unit==="%"?Number(o.value)/100*t:Number(o.value):t}function aa(e){let t=0,n=0,o=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(o=1),!t&&!o&&!n&&!i&&(n=1),{x1:t,y1:n,x2:o,y2:i}}function sa(e,t,n){let o=Math.pow(n/t,2);e=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2);let i,r,a,f,s,d,c,p,g=b=>{if(b===0){i=0,r=n,a=0,f=0,s=n;return}else if(b===Math.PI/2){i=0,r=0,a=t,f=0,s=t;return}if(b>0&&b<Math.PI/2){i=(o*t/2/Math.tan(b)-n/2)/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i+n,a=Math.abs(t/2-i)+t/2,f=n/2-Math.abs(r-n/2),s=Math.sqrt(Math.pow(a-i,2)+Math.pow(f-r,2)),c=(t/2/Math.tan(b)-n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*c+n,s=2*Math.sqrt(Math.pow(t/2-c,2)+Math.pow(n/2-p,2));return}else if(b>Math.PI/2&&b<Math.PI){i=(n/2+o*t/2/Math.tan(b))/(Math.tan(b)+o/Math.tan(b)),r=Math.tan(b)*i,a=Math.abs(t/2-i)+t/2,f=n/2+Math.abs(r-n/2),c=(t/2/Math.tan(b)+n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*c,s=2*Math.sqrt(Math.pow(t/2-c,2)+Math.pow(n/2-p,2));return}else b>=Math.PI&&(g(b-Math.PI),d=i,i=a,a=d,d=r,r=f,f=d)};return g(e),{x1:i/t,y1:r/n,x2:a/t,y2:f/n,length:s}}function ua(e,t,n,o){let{x1:i,x2:r,y1:a,y2:f}=n,s=e[0].offset?e[0].offset.unit==="%"?Number(e[0].offset.value)/100:D(`${e[0].offset.value}${e[0].offset.unit}`,o.fontSize,t,o,!0)/t:0,d=e.at(-1).offset?e.at(-1).offset.unit==="%"?Number(e.at(-1).offset.value)/100:D(`${e.at(-1).offset.value}${e.at(-1).offset.unit}`,o.fontSize,t,o,!0)/t:1,c=(r-i)*s+i,p=(f-a)*s+a,g=(r-i)*d+i,b=(f-a)*d+a;return{x1:c,y1:p,x2:g,y2:b}}import{parseRadialGradient as la}from"css-gradient-parser";function xo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,f,s,d){var ae;let{shape:c,stops:p,position:g,size:b,repeating:x}=la(r),[E,C]=a,N=E/2,P=C/2,v=fa(g.x,g.y,E,C,s.fontSize,s);N=v.x,P=v.y;let S=ca(t,p,x,s),T=Sn(S,p,s,x,d),M=`satori_radial_${e}`,B=`satori_pattern_${e}`,U=`satori_mask_${e}`,j=pa(c,b,s.fontSize,{x:N,y:P},[E,C],s,x),ie=da(c,s.fontSize,p,[E,C],s,x,j),ce=R("pattern",{id:B,x:f[0]/t,y:f[1]/n,width:o?E/t:"1",height:i?C/n:"1",patternUnits:"objectBoundingBox"},R("radialGradient",{id:M,...ie},T.map(fe=>R("stop",{offset:fe.offset||0,"stop-color":fe.color})).join(""))+R("mask",{id:U},R("rect",{x:0,y:0,width:E,height:C,fill:"#fff"}))+R("rect",{x:0,y:0,width:E,height:C,fill:((ae=T.at(-1))==null?void 0:ae.color)||"transparent"})+R(c,{cx:N,cy:P,width:E,height:C,...j,fill:`url(#${M})`,mask:`url(#${U})`}));return[B,ce]}function ca(e,t,n,o){if(!n)return e;let i=t.at(-1);return!i||!i.offset||i.offset.unit==="%"?e:D(`${i.offset.value}${i.offset.unit}`,+o.fontSize,e,o,!0)}function fa(e,t,n,o,i,r){let a={x:n/2,y:o/2};return e.type==="keyword"?Object.assign(a,yo(e.value,n,o,"x")):a.x=D(`${e.value.value}${e.value.unit}`,i,n,r,!0)??n/2,t.type==="keyword"?Object.assign(a,yo(t.value,n,o,"y")):a.y=D(`${t.value.value}${t.value.unit}`,i,o,r,!0)??o/2,a}function yo(e,t,n,o){switch(e){case"center":return{[o]:o==="x"?t/2:n/2};case"left":return{x:0};case"top":return{y:0};case"right":return{x:t};case"bottom":return{y:n}}}function da(e,t,n,[o,i],r,a,f){let{r:s,rx:d,ratio:c=1}=f;if(!a)return{spreadMethod:"pad"};let p=n.at(-1),g=e==="circle"?s*2:d*2;return{spreadMethod:"repeat",cx:"50%",cy:"50%",r:p.offset.unit==="%"?`${Number(p.offset.value)*Math.min(i/o,1)/c}%`:Number(D(`${p.offset.value}${p.offset.unit}`,t,o,r,!0)/g)}}function pa(e,t,n,o,i,r,a){let[f,s]=i,{x:d,y:c}=o,p={},g=0,b=0;if(ma(t)){if(t.some(x=>x.value.value.startsWith("-")))throw new Error("disallow setting negative values to the size of the shape. Check https://w3c.github.io/csswg-drafts/css-images/#valdef-rg-size-length-0");return e==="circle"?Object.assign(p,{r:Number(D(`${t[0].value.value}${t[0].value.unit}`,n,f,r,!0))}):Object.assign(p,{rx:Number(D(`${t[0].value.value}${t[0].value.unit}`,n,f,r,!0)),ry:Number(D(`${t[1].value.value}${t[1].value.unit}`,n,s,r,!0))}),wn(p,f,s,d,c,a,e),p}switch(t[0].value){case"farthest-corner":g=Math.max(Math.abs(f-d),Math.abs(d)),b=Math.max(Math.abs(s-c),Math.abs(c));break;case"closest-corner":g=Math.min(Math.abs(f-d),Math.abs(d)),b=Math.min(Math.abs(s-c),Math.abs(c));break;case"farthest-side":return e==="circle"?p.r=Math.max(Math.abs(f-d),Math.abs(d),Math.abs(s-c),Math.abs(c)):(p.rx=Math.max(Math.abs(f-d),Math.abs(d)),p.ry=Math.max(Math.abs(s-c),Math.abs(c))),wn(p,f,s,d,c,a,e),p;case"closest-side":return e==="circle"?p.r=Math.min(Math.abs(f-d),Math.abs(d),Math.abs(s-c),Math.abs(c)):(p.rx=Math.min(Math.abs(f-d),Math.abs(d)),p.ry=Math.min(Math.abs(s-c),Math.abs(c))),wn(p,f,s,d,c,a,e),p}return e==="circle"?p.r=Math.sqrt(g*g+b*b):Object.assign(p,So(g,b)),wn(p,f,s,d,c,a,e),p}function wn(e,t,n,o,i,r,a){if(r)if(a==="ellipse"){let f=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),{rx:d,ry:c}=So(f,s);e.ratio=Math.max(d/e.rx,c/e.ry),e.ratio>1&&(e.rx*=e.ratio,e.ry*=e.ratio)}else{let f=Math.max(Math.abs(t-o),Math.abs(o)),s=Math.max(Math.abs(n-i),Math.abs(i)),d=Math.sqrt(f*f+s*s);e.ratio=d/e.r,e.ratio>1&&(e.r=d)}}function So(e,t){let n=t!==0?e/t:1;if(e===0)return{rx:0,ry:0};{let o=Math.sqrt(e*e+t*t*n*n)/n;return{ry:o,rx:o*n}}}function ma(e){return!e.some(t=>t.type==="keyword")}import wo from"parse-css-color";function vn(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function ha(e,t,n,o,i){if(!o||!i)return[t,n];if(e==="cover"){let r=t/o,a=n/i,f=Math.max(r,a);return[o*f,i*f]}if(e==="contain"){let r=t/o,a=n/i,f=Math.min(r,a);return[o*f,i*f]}if(e==="auto"||e.includes("auto")){let r=e.split(" "),a=r[0]||"auto",f=r[1]||r[0]||"auto",s=o,d=i;if(a==="auto"&&f!=="auto"){let c=vn(f,n);d=c,s=o/i*c}else if(f==="auto"&&a!=="auto"){let c=vn(a,t);s=c,d=i/o*c}return[s,d]}return[t,n]}var qt={bottom:"100%",center:"50%",left:"0%",right:"100%",top:"0%"};function ga(e){if(!e)return{x:"0%",y:"0%"};let t=e.split(" ").filter(Boolean);if(t.length===1){let n=t[0];return n in qt?n==="top"||n==="bottom"?{x:"50%",y:qt[n]}:{x:qt[n],y:"50%"}:{x:n,y:"50%"}}return{x:qt[t[0]]||t[0],y:qt[t[1]]||t[1]}}function vo(e,t,n){if(e.endsWith("%")){let o=parseFloat(e)/100;return(t-n)*o}try{let o=new He(e);return o.type==="length"||o.type==="number"?o.value:vn(o.value+o.unit,t)}catch{return 0}}function ir(e,{x:t,y:n,defaultX:o,defaultY:i}){return(e?e.split(" ").map(r=>{try{let a=new He(r);return a.type==="length"||a.type==="number"?a.value:a.value+a.unit}catch{return null}}).filter(r=>r!==null):[o,i]).map((r,a)=>vn(r,[t,n][a]))}async function Kt({id:e,width:t,height:n,left:o,top:i},{image:r,size:a,position:f,repeat:s},d,c){s=s||"repeat",c=c||"background";let p=s==="repeat-x"||s==="repeat",g=s==="repeat-y"||s==="repeat",b=a&&(a==="cover"||a==="contain"||a==="auto"||a.includes("auto")),x=r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient(")||r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("),E=b&&x?[t,n]:b?[0,0]:ir(a,{x:t,y:n,defaultX:t,defaultY:n}),C=ir(f,{x:t,y:n,defaultX:0,defaultY:0});if(r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient("))return bo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,C,d,c);if(r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("))return xo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,C,d,c);if(r.startsWith("url(")){let[N,P,v]=await Lt(r.slice(4,-1)),S,T;if(b){let[M,B]=ha(a,t,n,P,v);S=M,T=B}else{let M=ir(a,{x:t,y:n,defaultX:0,defaultY:0});S=c==="mask"?P||M[0]:M[0]||P,T=c==="mask"?v||M[1]:M[1]||v}if(b){let M=ga(f),B=vo(M.x,t,S),U=vo(M.y,n,T);return[`satori_bi${e}`,R("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:(p?B:0)+o,y:(g?U:0)+i,width:p?S:"100%",height:g?T:"100%"},R("image",{x:p?0:B,y:g?0:U,width:S,height:T,preserveAspectRatio:"none",href:N}))]}return[`satori_bi${e}`,R("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:C[0]+o,y:C[1]+i,width:p?S:"100%",height:g?T:"100%"},R("image",{x:0,y:0,width:S,height:T,preserveAspectRatio:"none",href:N}))]}if(wo(r)){let N=wo(r),[P,v,S,T]=N.values,B=`rgba(${P},${v},${S},${T!==void 0?T:1})`;return[`satori_bi${e}`,R("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:o,y:i,width:t,height:n},R("rect",{x:0,y:0,width:t,height:n,fill:B}))]}throw new Error(`Invalid background image: "${r}"`)}function ba([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function En(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function Tn(e){e[0]=e[1]=Math.min(e[0],e[1])}function Rn(e,t,n,o,i){if(typeof e=="string"){let r=e.split(" ").map(f=>f.trim()),a=!r[1]&&!r[0].endsWith("%");return r[1]=r[1]||r[0],[a,[Math.min(D(r[0],o,t,i,!0),t),Math.min(D(r[1],o,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}var kn=e=>e&&e[0]!==0&&e[1]!==0;function Eo({id:e,borderRadiusPath:t,borderType:n,left:o,top:i,width:r,height:a},f){let s=`satori_brc-${e}`;return[R("clipPath",{id:s},R(n,{x:o,y:i,width:r,height:a,d:t||void 0})),s]}function it({left:e,top:t,width:n,height:o},i,r){let{borderTopLeftRadius:a,borderTopRightRadius:f,borderBottomLeftRadius:s,borderBottomRightRadius:d,fontSize:c}=i,p,g,b,x;if([p,a]=Rn(a,n,o,c,i),[g,f]=Rn(f,n,o,c,i),[b,s]=Rn(s,n,o,c,i),[x,d]=Rn(d,n,o,c,i),!r&&!kn(a)&&!kn(f)&&!kn(s)&&!kn(d))return"";a||=[0,0],f||=[0,0],s||=[0,0],d||=[0,0],[a[0],f[0]]=En(a[0],f[0],n),[s[0],d[0]]=En(s[0],d[0],n),[a[1],s[1]]=En(a[1],s[1],o),[f[1],d[1]]=En(f[1],d[1],o),p&&Tn(a),g&&Tn(f),b&&Tn(s),x&&Tn(d);let E=[];E[0]=[f,f],E[1]=[d,[-d[0],d[1]]],E[2]=[s,[-s[0],-s[1]]],E[3]=[a,[a[0],-a[1]]];let C=`h${n-a[0]-f[0]} a${E[0][0]} 0 0 1 ${E[0][1]}`,N=`v${o-f[1]-d[1]} a${E[1][0]} 0 0 1 ${E[1][1]}`,P=`h${d[0]+s[0]-n} a${E[2][0]} 0 0 1 ${E[2][1]}`,v=`v${s[1]+a[1]-o} a${E[3][0]} 0 0 1 ${E[3][1]}`;if(r){let T=function(be){let ae=ba([a,f,d,s][be]);return be===0?[[e+a[0]-ae,t+a[1]-ae],[e+a[0],t]]:be===1?[[e+n-f[0]+ae,t+f[1]-ae],[e+n,t+f[1]]]:be===2?[[e+n-d[0]+ae,t+o-d[1]+ae],[e+n-d[0],t+o]]:[[e+s[0]-ae,t+o-s[1]+ae],[e,t+o-s[1]]]},S=r.indexOf(!1);if(!r.includes(!0))throw new Error("Invalid `partialSides`.");if(S===-1)S=0;else for(;!r[S];)S=(S+1)%4;let M="",B=T(S),U=`M${B[0]} A${E[(S+3)%4][0]} 0 0 1 ${B[1]}`,j=0;for(;j<4&&r[(S+j)%4];j++)M+=U+" ",U=[C,N,P,v][(S+j)%4];let ie=(S+j)%4;M+=U.split(" ")[0];let ce=T(ie);return M+=` A${E[(ie+3)%4][0]} 0 0 1 ${ce[0]}`,M}return`M${e+a[0]},${t} ${C} ${N} ${P} ${v}`}function To(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function Ro({id:e,currentClipPathId:t,borderPath:n,borderType:o,left:i,top:r,width:a,height:f},s){if(!(s.borderTopWidth||s.borderRightWidth||s.borderBottomWidth||s.borderLeftWidth))return null;let c=`satori_bc-${e}`;return[R("clipPath",{id:c,"clip-path":t?`url(#${t})`:void 0},R(o,{x:i,y:r,width:a,height:f,d:n||void 0})),c]}function Jt({left:e,top:t,width:n,height:o,props:i,asContentMask:r,maskBorderOnly:a},f){let s=["borderTop","borderRight","borderBottom","borderLeft"];if(!r&&!s.some(b=>f[b+"Width"]))return"";let d="",c=0;for(;c>0&&To(s[c],s[(c+3)%4],f);)c=(c+3)%4;let p=[!1,!1,!1,!1],g=[];for(let b=0;b<4;b++){let x=(c+b)%4,E=(c+b+1)%4,C=s[x],N=s[E];if(p[x]=!0,g=[f[C+"Width"],f[C+"Style"],f[C+"Color"],C],!To(C,N,f)){let P=(g[0]||0)+(r&&!a&&f[C.replace("border","padding")]||0);P&&(d+=R("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":P*2,"stroke-dasharray":!r&&g[1]==="dashed"?P*2+" "+P:void 0,d:it({left:e,top:t,width:n,height:o},f,p)})),p=[!1,!1,!1,!1]}}if(p.some(Boolean)){let b=(g[0]||0)+(r&&!a&&f[g[3].replace("border","padding")]||0);b&&(d+=R("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":b*2,"stroke-dasharray":!r&&g[1]==="dashed"?b*2+" "+b:void 0,d:it({left:e,top:t,width:n,height:o},f,p)}))}return d}function ar({id:e,left:t,top:n,width:o,height:i,matrix:r,borderOnly:a},f){let s=(f.borderLeftWidth||0)+(a?0:f.paddingLeft||0),d=(f.borderTopWidth||0)+(a?0:f.paddingTop||0),c=(f.borderRightWidth||0)+(a?0:f.paddingRight||0),p=(f.borderBottomWidth||0)+(a?0:f.paddingBottom||0),g={x:t+s,y:n+d,width:o-s-c,height:i-d-p};return R("mask",{id:e},R("rect",{...g,fill:"#fff",transform:f.overflow==="hidden"&&f.transform&&r?r:void 0,mask:f._inheritedMaskId?`url(#${f._inheritedMaskId})`:void 0})+Jt({left:t,top:n,width:o,height:i,props:{transform:r||void 0},asContentMask:!0,maskBorderOnly:a},f))}import{getStylesForProperty as ko}from"css-to-react-native";var Zt={circle:/circle\((.+)\)/,ellipse:/ellipse\((.+)\)/,path:/path\((.+)\)/,polygon:/polygon\((.+)\)/,inset:/inset\((.+)\)/};function Ao({width:e,height:t},n,o){function i(d){let c=d.match(Zt.circle);if(!c)return null;let[,p]=c,[g,b=""]=p.split("at").map(C=>C.trim()),{x,y:E}=_o(b,e,t);return{type:"circle",r:D(g,o.fontSize,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/Math.sqrt(2),o,!0),cx:D(x,o.fontSize,e,o,!0),cy:D(E,o.fontSize,t,o,!0)}}function r(d){let c=d.match(Zt.ellipse);if(!c)return null;let[,p]=c,[g,b=""]=p.split("at").map(P=>P.trim()),[x,E]=g.split(" "),{x:C,y:N}=_o(b,e,t);return{type:"ellipse",rx:D(x||"50%",o.fontSize,e,o,!0),ry:D(E||"50%",o.fontSize,t,o,!0),cx:D(C,o.fontSize,e,o,!0),cy:D(N,o.fontSize,t,o,!0)}}function a(d){let c=d.match(Zt.path);if(!c)return null;let[p,g]=Io(c[1]);return{type:"path",d:g,"fill-rule":p}}function f(d){let c=d.match(Zt.polygon);if(!c)return null;let[p,g]=Io(c[1]);return{type:"polygon","fill-rule":p,points:g.split(",").map(b=>b.split(" ").map((x,E)=>D(x,o.fontSize,E===0?e:t,o,!0)).join(" ")).join(",")}}function s(d){let c=d.match(Zt.inset);if(!c)return null;let[p,g]=(c[1].includes("round")?c[1]:`${c[1].trim()} round 0`).split("round"),b=ko("borderRadius",g,!0),x=Object.values(b).map(S=>String(S)).map((S,T)=>D(S,o.fontSize,T===0||T===2?t:e,o,!0)||0),E=Object.values(ko("margin",p,!0)).map(S=>String(S)).map((S,T)=>D(S,o.fontSize,T===0||T===2?t:e,o,!0)||0),C=E[3],N=E[0],P=e-(E[1]+E[3]),v=t-(E[0]+E[2]);return x.some(S=>S>0)?{type:"path",d:it({left:C,top:N,width:P,height:v},{...n,...b})}:{type:"rect",x:C,y:N,width:P,height:v}}return{parseCircle:i,parseEllipse:r,parsePath:a,parsePolygon:f,parseInset:s}}function Io(e){let[,t="nonzero",n]=e.replace(/('|")/g,"").match(/^(nonzero|evenodd)?,?(.+)/)||[];return[t,n]}function _o(e,t,n){let o=e.split(" "),i={x:o[0]||"50%",y:o[1]||"50%"};return o.forEach(r=>{r==="top"?i.y=0:r==="bottom"?i.y=n:r==="left"?i.x=0:r==="right"?i.x=t:r==="center"&&(i.x=t/2,i.y=n/2)}),i}function In(e){return`satori_cp-${e}`}function Co(e){return`url(#${In(e)})`}function Mo(e,t,n){if(t.clipPath==="none")return"";let o=Ao(e,t,n),i=t.clipPath,r={type:""};for(let a of Object.keys(o))if(r=o[a](i),r)break;if(r){let{type:a,...f}=r;return R("clipPath",{id:In(e.id),"clip-path":e.currentClipPath,transform:`translate(${e.left}, ${e.top})`},R(a,f))}return""}function sr({left:e,top:t,width:n,height:o,path:i,matrix:r,id:a,currentClipPath:f,src:s},d,c){let p="",g=d.clipPath&&d.clipPath!=="none"?Mo({left:e,top:t,width:n,height:o,path:i,id:a,matrix:r,currentClipPath:f,src:s},d,c):"";if(d.overflow!=="hidden"&&!s)p="";else{let x=g?`satori_ocp-${a}`:In(a);p=R("clipPath",{id:x,"clip-path":f},R(i?"path":"rect",{x:e,y:t,width:n,height:o,d:i||void 0,transform:d.overflow==="hidden"&&d.transform&&r?r:void 0}))}let b=ar({id:`satori_om-${a}`,left:e,top:t,width:n,height:o,matrix:r,borderOnly:!s},d);return g+p+b}var ya=e=>`satori_mi-${e}`;async function ur(e,t,n){if(!t.maskImage)return["",""];let{left:o,top:i,width:r,height:a,id:f}=e,s=t.maskImage,d=s.length;if(!d)return["",""];let c=ya(f),p="";for(let g=0;g<d;g++){let b=s[g],[x,E]=await Kt({id:`${c}-${g}`,left:o,top:i,width:r,height:a},b,n,"mask");p+=E+R("rect",{x:o,y:i,width:r,height:a,fill:`url(#${x})`})}return p=R("mask",{id:c},p),[c,p]}function xa(e,t,n){let o=e.toLowerCase().trim().split(/\s+/),i=(s,d)=>({left:"0%",center:"50%",right:"100%",top:"0%",bottom:"100%"})[s]||s,r,a;if(o.length===1){let s=o[0];s==="left"||s==="center"||s==="right"?(r=i(s,"x"),a="50%"):s==="top"||s==="bottom"?(r="50%",a=i(s,"y")):(r=s,a="50%")}else{let s=o[0],d=o[1];s==="top"||s==="bottom"?(a=i(s,"y"),d==="left"||d==="right"||d==="center"?r=i(d,"x"):(r="50%",a=s==="top"||s==="bottom"?i(s,"y"):d)):(r=i(s,"x"),a=i(d,"y"))}let f=(s,d)=>{try{if(s.endsWith("%"))return d*parseFloat(s)/100;let c=new He(s);return c.type==="length"||c.type==="number"?c.value:0}catch{return 0}};return[f(r,t),f(a,n)]}async function Qt({id:e,left:t,top:n,width:o,height:i,isInheritingTransform:r,src:a,debug:f},s,d){if(s.display==="none")return"";let c=!!a,p="rect",g="",b="",x=[],E=1,C="";s.backgroundColor&&x.push(s.backgroundColor),s.opacity!==void 0&&(E=+s.opacity),s.transform&&(g=Yt({left:t,top:n,width:o,height:i},s.transform,r,s.transformOrigin));let N="";if(s.backgroundImage){let Y=[];for(let H=0;H<s.backgroundImage.length;H++){let Ie=s.backgroundImage[H],De=await Kt({id:e+"_"+H,width:o,height:i,left:t,top:n},Ie,d);De&&Y.unshift(De)}for(let H of Y)x.push(`url(#${H[0]})`),b+=H[1],H[2]&&(N+=H[2])}let[P,v]=await ur({id:e,left:t,top:n,width:o,height:i},s,d);b+=v;let S=P?`url(#${P})`:s._inheritedMaskId?`url(#${s._inheritedMaskId})`:void 0,T=it({left:t,top:n,width:o,height:i},s);T&&(p="path");let M=s._inheritedClipPathId;f&&(C=R("rect",{x:t,y:n,width:o,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:g||void 0,"clip-path":M?`url(#${M})`:void 0}));let{backgroundClip:B,filter:U,mixBlendMode:j}=s,ie=[U?`filter:${U}`:void 0,j?`mix-blend-mode:${j}`:void 0].filter(Y=>Y).join(";")||void 0,ce=B==="text"?`url(#satori_bct-${e})`:M?`url(#${M})`:s.clipPath?Co(e):void 0,be=sr({left:t,top:n,width:o,height:i,path:T,id:e,matrix:g,currentClipPath:ce,src:a},s,d),ae=x.map(Y=>R(p,{x:t,y:n,width:o,height:i,fill:Y,d:T||void 0,transform:g||void 0,"clip-path":s.transform?void 0:ce,style:ie,mask:s.transform?void 0:S})).join(""),fe=Ro({id:e,left:t,top:n,width:o,height:i,currentClipPathId:M,borderPath:T,borderType:p},s),se;if(c){let Y=(s.borderLeftWidth||0)+(s.paddingLeft||0),H=(s.borderTopWidth||0)+(s.paddingTop||0),Ie=(s.borderRightWidth||0)+(s.paddingRight||0),De=(s.borderBottomWidth||0)+(s.paddingBottom||0),ue=o-Y-Ie,Se=i-H-De,We=(s.objectPosition||"center").toString(),[W,ne]=xa(We,ue,Se),z=s.__naturalWidth||ue,re=s.__naturalHeight||Se,O,oe=ue,de=Se,Ee=t+Y,Te=n+H;if(s.objectFit==="contain"){let Z=ue/z,Re=Se/re,ye=Math.min(Z,Re);oe=z*ye,de=re*ye,Ee=t+Y+W-oe*W/ue,Te=n+H+ne-de*ne/Se,O="none"}else if(s.objectFit==="cover"){let Z=ue/z,Re=Se/re,ye=Math.max(Z,Re);oe=z*ye,de=re*ye,Ee=t+Y+W-oe*W/ue,Te=n+H+ne-de*ne/Se,O="none"}else if(s.objectFit==="fill")O="none";else if(s.objectFit==="scale-down")if(z&&re){let Z=ue/z,Re=Se/re,ye=Math.min(Z,Re);if(ye>=1)oe=z,de=re,O="none",Ee=t+Y+W-oe*W/ue,Te=n+H+ne-de*ne/Se;else{let Oe=ye;oe=z*Oe,de=re*Oe,Ee=t+Y+W-oe*W/ue,Te=n+H+ne-de*ne/Se,O="none"}}else{let Z=ue/z,Re=Se/re,ye=Math.min(Z,Re);oe=z*ye,de=re*ye,Ee=t+Y+W-oe*W/ue,Te=n+H+ne-de*ne/Se,O="none"}else O="none";s.transform&&(se=Eo({id:e,borderRadiusPath:T,borderType:p,left:t,top:n,width:o,height:i},s)),ae+=R("image",{x:Ee,y:Te,width:oe,height:de,href:a,preserveAspectRatio:O,transform:g||void 0,style:ie,"clip-path":s.transform?se?`url(#${se[1]})`:void 0:`url(#satori_cp-${e})`,mask:s.transform?void 0:P?`url(#${P})`:`url(#satori_om-${e})`})}if(fe){b+=fe[0];let Y=fe[1];ae+=Jt({left:t,top:n,width:o,height:i,props:{transform:g||void 0,"clip-path":`url(#${Y})`}},s)}let ke=fo({width:o,height:i,id:e,opacity:E,shape:R(p,{x:t,y:n,width:o,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:T||void 0,transform:g||void 0,"clip-path":ce,mask:S})},s);return(b?R("defs",{},b):"")+(ke?ke[0]:"")+(se?se[0]:"")+be+(E!==1?`<g opacity="${E}">`:"")+(s.transform&&(ce||S)?`<g${ce?` clip-path="${ce}"`:""}${S?` mask="${S}"`:""}>`:"")+(N||ae)+(s.transform&&(ce||S)?"</g>":"")+(E!==1?"</g>":"")+(ke?ke[1]:"")+C}var Sa=e=>{let t="",n="SourceGraphic",o=!1,i=e.match(/blur\(([\d.]+)(?:px)?\)/);if(i){o=!0;let d="satori_bfblur";t+=R("feGaussianBlur",{edgeMode:"duplicate",in:n,result:d,stdDeviation:parseFloat(i[1])}),n=d}let r=e.match(/saturate\(([\d.]+)(%?)\)/);if(r){let d=r[2]==="%"?parseFloat(r[1])/100:parseFloat(r[1]),c="satori_bfsat";t+=R("feColorMatrix",{in:n,result:c,type:"saturate",values:d}),n=c}let a=e.match(/brightness\(([\d.]+)\)/);if(a){let d=parseFloat(a[1]),c="satori_bfbri";t+=R("feComponentTransfer",{in:n,result:c},R("feFuncR",{slope:d,type:"linear"})+R("feFuncG",{slope:d,type:"linear"})+R("feFuncB",{slope:d,type:"linear"})),n=c}let f=e.match(/contrast\(([\d.]+)\)/);if(f){let d=parseFloat(f[1]),c=-(.5*d)+.5,p="satori_bfcon";t+=R("feComponentTransfer",{in:n,result:p},R("feFuncR",{intercept:c,slope:d,type:"linear"})+R("feFuncG",{intercept:c,slope:d,type:"linear"})+R("feFuncB",{intercept:c,slope:d,type:"linear"})),n=p}let s=e.match(/grayscale\(([\d.]+)(%?)\)/);if(s){let d=s[2]==="%"?parseFloat(s[1])/100:parseFloat(s[1]),c="satori_bfgray";t+=R("feColorMatrix",{in:n,result:c,type:"saturate",values:1-Math.min(d,1)}),n=c}return o&&(t+=R("feComposite",{in:n,in2:"SourceGraphic",operator:"atop"})),t},Po=e=>{let{bgGroupId:t,filterValue:n,height:o,id:i,left:r,maskId:a,style:f,top:s,width:d}=e,c=Sa(n);if(!c)return"";let p=`satori_bf-${i}`,g=`satori_bfc-${i}`,b=R("filter",{height:"200%",id:p,width:"200%",x:"-50%",y:"-50%"},c),x=it({height:o,left:r,top:s,width:d},f),E=x?R("path",{d:x}):R("rect",{height:o,width:d,x:r,y:s}),C=R("clipPath",{id:g},E),N=R("defs",{},b+C),P=n.match(/blur\(([\d.]+)(?:px)?\)/),v=P?parseFloat(P[1])*3:0,S=Math.max(Math.min(d,o),1),T=v>0?1+v*2/S:1,M=r+d/2,B=s+o/2,U={filter:`url(#${p})`,href:`#${t}`};T>1&&(U.transform=`translate(${M}, ${B}) scale(${T}) translate(${-M}, ${-B})`);let j=R("use",U),ie={"clip-path":`url(#${g})`};return a&&(ie.mask=`url(#${a})`),N+R("g",ie,j)};var Wo=String.raw,Lo=Wo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,No=()=>new RegExp(Wo`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Lo}(?:\u200D${Lo})*`,"gu");var wa=new RegExp(No(),"u"),lr={emoji:wa,symbol:new RegExp("\\p{Symbol}","u"),math:new RegExp("\\p{Math}","u")},cr={"ja-JP":new RegExp("\\p{scx=Hira}|\\p{scx=Kana}|\\p{scx=Han}|[\\u3000]|[\\uFF00-\\uFFEF]","u"),"ko-KR":new RegExp("\\p{scx=Hangul}","u"),"zh-CN":new RegExp("\\p{scx=Han}","u"),"zh-TW":new RegExp("\\p{scx=Han}","u"),"zh-HK":new RegExp("\\p{scx=Han}","u"),"th-TH":new RegExp("\\p{scx=Thai}","u"),"bn-IN":new RegExp("\\p{scx=Bengali}","u"),"ar-AR":new RegExp("\\p{scx=Arabic}","u"),"ta-IN":new RegExp("\\p{scx=Tamil}","u"),"ml-IN":new RegExp("\\p{scx=Malayalam}","u"),"he-IL":new RegExp("\\p{scx=Hebrew}","u"),"te-IN":new RegExp("\\p{scx=Telugu}","u"),devanagari:new RegExp("\\p{scx=Devanagari}","u"),kannada:new RegExp("\\p{scx=Kannada}","u")},_n=Object.keys({...cr,...lr});function Oo(e){return _n.includes(e)}function Fo(e,t){for(let o of Object.keys(lr))if(lr[o].test(e))return[o];let n=Object.keys(cr).filter(o=>cr[o].test(e));if(n.length===0)return["unknown"];if(t){let o=n.findIndex(i=>i===t);o!==-1&&(n.splice(o,1),n.unshift(t))}return n}function Bo(e){if(e)return _n.find(t=>t.toLowerCase().startsWith(e.toLowerCase()))}async function*en(e,t){var We;let n=await mt(),{id:o,inheritedStyle:i,parent:r,font:a,debug:f,locale:s,embedFont:d=!0,graphemeImages:c,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!_t(e)||Rr(e.type)){let W;if(!_t(e))W=or(String(e),t),yield(await W.next()).value;else{if(Tr(e.type))throw new Error("Class component is not supported.");let z;Wn(e.type)?z=e.type.render:z=e.type,W=en(await z(e.props),t),yield(await W.next()).value}await W.next();let ne=yield;return(await W.next(ne)).value}let{type:g,props:b}=e,x=g;if(b&&kr(b))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:E,children:C,lang:N=s}=b||{},P=Bo(N),v=n.Node.create();r.insertChild(v,r.getChildCount());let[S,T]=await Zn(v,x,i,E,b),M=S.transform===i.transform;if(M||(S.transform.__parent=i.transform),(S.overflow==="hidden"||S.clipPath&&S.clipPath!=="none")&&(T._inheritedClipPathId=`satori_cp-${o}`,T._inheritedMaskId=`satori_om-${o}`),S.maskImage&&(T._inheritedMaskId=`satori_mi-${o}`),S.backdropFilter&&t._registerBackdropFilter&&t._registerBackdropFilter({filter:S.backdropFilter,inheritedStyle:T,node:v,style:S}),S.backgroundClip==="text"){let W={value:""};T._inheritedBackgroundClipTextPath=W,S._inheritedBackgroundClipTextPath=W,S.backgroundImage&&(T._inheritedBackgroundClipTextHasBackground="true",S._inheritedBackgroundClipTextHasBackground="true")}let B=Ir(C),U=[],j={},ie=0,ce=[];for(let W of B){let ne=ie,z=en(W,{id:o+"-"+ie++,parentStyle:S,inheritedStyle:T,isInheritingTransform:!0,parent:v,font:a,embedFont:d,debug:f,graphemeImages:c,canLoadAdditionalAssets:p,locale:P,onNodeDetected:t.onNodeDetected,_registerBackdropFilter:re=>{j[ne]=re}});p?ce.push(...(await z.next()).value||[]):await z.next(),U.push(z)}yield ce;for(let W of U)await W.next();let[be,ae]=yield,{left:fe,top:se,width:ke,height:Y}=v.getComputedLayout();fe+=be,se+=ae;let H="",Ie="",De="",{children:ue,...Se}=b;if((We=t.onNodeDetected)==null||We.call(t,{left:fe,top:se,width:ke,height:Y,type:x,props:Se,key:e.key,textContent:_t(ue)?void 0:ue}),x==="img"){let W=S.__src;Ie=await Qt({id:o,left:fe,top:se,width:ke,height:Y,src:W,isInheritingTransform:M,debug:f},S,T)}else if(x==="svg"){let W=S.color,ne=await Jr(e,W);Ie=await Qt({id:o,left:fe,top:se,width:ke,height:Y,src:ne,isInheritingTransform:M,debug:f},S,T)}else{let W=E==null?void 0:E.display;if(x==="div"&&C&&typeof C!="string"&&W!=="flex"&&W!=="none"&&W!=="contents")throw new Error('Expected <div> to have explicit "display: flex", "display: contents", or "display: none" if it has more than one child node.');Ie=await Qt({id:o,left:fe,top:se,width:ke,height:Y,isInheritingTransform:M,debug:f},S,T)}for(let W=0;W<U.length;W++){if(j[W]){let ne=j[W],z=ne.node.getComputedLayout(),re=fe+z.left,O=se+z.top,oe=z.width,de=z.height,Ee=`satori_bfbg-${o}-${W}`,Te=Ie+H;Ie=`<g id="${Ee}">${Te}</g>`,H="";let Z=o+"-"+W,Re=ne.style.maskImage?`satori_mi-${Z}`:void 0;H+=Po({bgGroupId:Ee,filterValue:ne.filter,height:de,id:Z,left:re,maskId:Re,style:ne.style,top:O,width:oe})}H+=(await U[W].next([fe,se])).value}return S._inheritedBackgroundClipTextPath&&(De+=R("clipPath",{id:`satori_bct-${o}`,"clip-path":S._inheritedClipPathId?`url(#${S._inheritedClipPathId})`:void 0},S._inheritedBackgroundClipTextPath.value)),De+Ie+H}import tn from"@shuding/opentype.js";var $o="unknown";function va(e){let t=[],n=[0,0],o=[0,0],i=(r,a)=>{let f=r[0];for(let s=1;s<=a;s++){let d=s/a,c=Ea(r,d);t.push({from:f,to:c}),f=c}o=r[r.length-1]};for(let r of e){if(r.type==="M"){n=o=[r.x,r.y];continue}if(r.type==="L"){let a=[r.x,r.y];t.push({from:o,to:a}),o=a;continue}if(r.type==="Q"){i([o,[r.x1,r.y1],[r.x,r.y]],12);continue}if(r.type==="C"){i([o,[r.x1,r.y1],[r.x2,r.y2],[r.x,r.y]],16);continue}r.type==="Z"&&(t.push({from:o,to:n}),o=n)}return t}function Ea(e,t){let n=e;for(;n.length>1;){let o=[];for(let i=0;i<n.length-1;i++)o.push([n[i][0]+(n[i+1][0]-n[i][0])*t,n[i][1]+(n[i+1][1]-n[i][1])*t]);n=o}return n[0]}function Ta(e,t){if(!t)return[];let n=t.strokeWidth,o=t.underlineY-n*.25,i=t.underlineY+n*2.5,r=va(e);if(!r.length)return[];let a=i-o,f=Math.max(12,Math.ceil(a/.25)),s=a/f,d=o+s/2,c=new Set;for(let v=0;v<f;v++){let S=d+s*v,T=[];for(let M of r){let[B,U]=M.from,[j,ie]=M.to;if(U===ie)continue;let ce=Math.min(U,ie),be=Math.max(U,ie);if(S<ce||S>=be)continue;let ae=(S-U)/(ie-U),fe=B+(j-B)*ae;T.push(fe)}if(T.length){T.sort((M,B)=>M-B);for(let M=0;M<T.length-1;M+=2){let B=Math.min(T[M],T[M+1]),U=Math.max(T[M],T[M+1]),j=Math.floor(B),ie=Math.ceil(U);for(let ce=j;ce<ie;ce++)c.add(ce)}}}if(!c.size)return[];let p=Array.from(c.values()).sort((v,S)=>v-S),g=[],b=p[0],x=p[0];for(let v=1;v<p.length;v++){let S=p[v];S>x+1&&(g.push([b,x+1]),b=S),x=S}g.push([b,x+1]);let E=[],C=n*.6,N=g[0][0],P=g[g.length-1][1];for(let[v,S]of g){let T=Math.min(v,N)-C,M=Math.max(S,P)+C;E.push({x1:T,x2:M,y1:o,y2:i})}return E}function Ra(e,t,[n,o],[i,r]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(o!==r){if(o===t)return-1;if(r===t)return 1}return-1}var fr=new WeakMap,nn=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:o}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],r=i[0];for(let a=1;a<i.length;a++){let[,f,s]=r,[,d,c]=i[a];Ra(n,o,[f,s],[d,c])>0&&(r=i[a])}return r[0]}addFonts(t){for(let n of t){let{name:o,data:i,lang:r}=n;if(r&&!Oo(r))throw new Error(`Invalid value for props \`lang\`: "${r}". The value must be one of the following: ${_n.join(", ")}.`);let a=r??$o,f;if(fr.has(i))f=fr.get(i);else{f=tn.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0});let d=f.charToGlyphIndex;f.charToGlyphIndex=c=>{let p=d.call(f,c);return p===0&&f._trackBrokenChars&&f._trackBrokenChars.push(c),p},fr.set(i,f)}this.defaultFont||(this.defaultFont=f);let s=`${o.toLowerCase()}_${a}`;this.fonts.has(s)||this.fonts.set(s,[]),this.fonts.get(s).push([f,n.weight,n.style])}}getEngine(t=16,n="normal",{fontFamily:o="sans-serif",fontWeight:i=400,fontStyle:r="normal"},a){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");o=(Array.isArray(o)?o:[o]).map(v=>v.toLowerCase());let f=[];o.forEach(v=>{let S=this.get({name:v,weight:i,style:r});if(S){f.push(S);return}let T=this.get({name:v+"_unknown",weight:i,style:r});if(T){f.push(T);return}});let s=Array.from(this.fonts.keys()),d=[],c=[],p=[];for(let v of s)if(!o.includes(v))if(a){let S=ka(v);S?S===a?d.push(this.get({name:v,weight:i,style:r})):c.push(this.get({name:v,weight:i,style:r})):p.push(this.get({name:v,weight:i,style:r}))}else p.push(this.get({name:v,weight:i,style:r}));let g=new Map,b=(v,S=!0)=>{let T=[...f,...p,...d,...S?c:[]];if(typeof v>"u")return S?T[T.length-1]:void 0;let M=v.charCodeAt(0);if(g.has(M))return g.get(M);let B=T.find((U,j)=>!!U.charToGlyphIndex(v)||S&&j===T.length-1);return B&&g.set(M,B),B},x=(v,S=!1)=>{var M,B;return((S?(B=(M=v.tables)==null?void 0:M.os2)==null?void 0:B.sTypoAscender:0)||v.ascender)/v.unitsPerEm*t},E=(v,S=!1)=>{var M,B;return((S?(B=(M=v.tables)==null?void 0:M.os2)==null?void 0:B.sTypoDescender:0)||v.descender)/v.unitsPerEm*t},C=(v,S=!1)=>{var T,M;if(typeof n=="string"&&n==="normal"){let B=(S?(M=(T=v.tables)==null?void 0:T.os2)==null?void 0:M.sTypoLineGap:0)||0;return x(v,S)-E(v,S)+B/v.unitsPerEm*t}else if(typeof n=="number")return t*n},N=v=>b(v,!1);return{has:v=>{if(v===`
5
+ `)return!0;let S=N(v);return S?(S._trackBrokenChars=[],S.stringToGlyphs(v),S._trackBrokenChars.length?(S._trackBrokenChars=void 0,!1):!0):!1},baseline:(v,S=typeof v>"u"?f[0]:b(v))=>{let T=x(S),M=E(S),B=T-M;return T+(C(S)-B)/2},height:(v,S=typeof v>"u"?f[0]:b(v))=>C(S),measure:(v,S)=>this.measure(b,v,S),getSVG:(v,S,T)=>this.getSVG(b,v,S,T)}}patchFontFallbackResolver(t,n){let o=[];t._trackBrokenChars=o;let i=t.stringToGlyphs;return t.stringToGlyphs=(r,...a)=>{let f=i.call(t,r,...a);for(let s=0;s<f.length;s++)if(f[s].unicode===void 0){let d=o.shift(),c=n(d);if(c!==t){let p=c.charToGlyph(d),g=t.unitsPerEm/c.unitsPerEm,b=new tn.Path;b.unitsPerEm=t.unitsPerEm,b.commands=p.path.commands.map(E=>{let C={...E};for(let N in C)typeof C[N]=="number"&&(C[N]*=g);return C});let x=new tn.Glyph({...p,advanceWidth:p.advanceWidth*g,xMin:p.xMin*g,xMax:p.xMax*g,yMin:p.yMin*g,yMax:p.yMax*g,path:b});f[s]=x}}return f},()=>{t.stringToGlyphs=i,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:o,letterSpacing:i=0}){let r=t(n),a=this.patchFontFallbackResolver(r,t);try{return r.getAdvanceWidth(n,o,{letterSpacing:i/o})}finally{a()}}getSVG(t,n,{fontSize:o,top:i,left:r,letterSpacing:a=0},f){let s=t(n),d=this.patchFontFallbackResolver(s,t);try{if(o===0)return{path:"",boxes:[]};let c=new tn.Path,p=[],g={letterSpacing:a/o},b=new WeakMap;return s.forEachGlyph(n.replace(/\n/g,""),r,i,o,g,function(x,E,C,N){let P;if(!b.has(x))P=x.getPath(E,C,N,g),b.set(x,[E,C,P]);else{let[S,T,M]=b.get(x);P=new tn.Path,P.commands=M.commands.map(B=>{let U={...B};for(let j in U)typeof U[j]=="number"&&((j==="x"||j==="x1"||j==="x2")&&(U[j]+=E-S),(j==="y"||j==="y1"||j==="y2")&&(U[j]+=C-T));return U})}let v=f?Ta(P.commands,f):[];v.length&&p.push(...v),c.extend(P)}),{path:c.toPathData(1),boxes:p}}finally{d()}}};function ka(e){let t=e.split("_"),n=t[t.length-1];return n===$o?void 0:n}function dr({width:e,height:t,content:n}){return R("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var pr=new WeakMap;async function Do(e,t){let n=await mt();if(!n||!n.Node)throw new Error("Satori is not initialized: expect `yoga` to be loaded, got "+n);t.fonts=t.fonts||[];let o;pr.has(t.fonts)?o=pr.get(t.fonts):pr.set(t.fonts,o=new nn(t.fonts));let i="width"in t?t.width:void 0,r="height"in t?t.height:void 0,a=Ia(n,t.pointScaleFactor);i&&a.setWidth(i),r&&a.setHeight(r),a.setFlexDirection(n.FLEX_DIRECTION_ROW),a.setFlexWrap(n.WRAP_WRAP),a.setAlignContent(n.ALIGN_AUTO),a.setAlignItems(n.ALIGN_FLEX_START),a.setJustifyContent(n.JUSTIFY_FLEX_START),a.setOverflow(n.OVERFLOW_HIDDEN);let f={...t.graphemeImages},s=new Set;ot.clear(),jt.clear(),await Kr(e);let d=en(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:"normal",color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:i,_viewportHeight:r},parent:a,font:o,embedFont:t.embedFont,debug:t.debug,graphemeImages:f,canLoadAdditionalAssets:!!t.loadAdditionalAsset,onNodeDetected:t.onNodeDetected}),c=(await d.next()).value;if(t.loadAdditionalAsset&&c.length){let x=_a(c),E=[],C={};await Promise.all(Object.entries(x).flatMap(([N,P])=>P.map(v=>{let S=`${N}_${v}`;return s.has(S)?null:(s.add(S),t.loadAdditionalAsset(N,v).then(T=>{typeof T=="string"?C[v]=T:T&&(Array.isArray(T)?E.push(...T):E.push(T))}))}))),o.addFonts(E),Object.assign(f,C)}await d.next(),a.calculateLayout(i,r,n.DIRECTION_LTR);let p=(await d.next([0,0])).value,g=a.getComputedWidth(),b=a.getComputedHeight();return a.freeRecursive(),dr({width:g,height:b,content:p})}function Ia(e,t){if(t){let n=e.Config.create();return n.setPointScaleFactor(t),e.Node.createWithConfig(n)}else return e.Node.create()}function _a(e){let t={},n={};for(let{word:o,locale:i}of e){let r=Fo(o,i).join("|");n[r]=n[r]||"",n[r]+=o}return Object.keys(n).forEach(o=>{t[o]=t[o]||[],o==="emoji"?t[o].push(...Go(Pe(n[o],"grapheme"))):(t[o][0]=t[o][0]||"",t[o][0]+=Go(Pe(n[o],"grapheme",o==="unknown"?void 0:o)).join(""))}),t}function Go(e){return Array.from(new Set(e))}export{Do as default,hi as init};
6
6
  //# sourceMappingURL=standalone.js.map