@feliperohdee/satori 0.0.1

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.
@@ -0,0 +1,73 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ declare const code: {
4
+ readonly 'ja-JP': RegExp;
5
+ readonly 'ko-KR': RegExp;
6
+ readonly 'zh-CN': RegExp;
7
+ readonly 'zh-TW': RegExp;
8
+ readonly 'zh-HK': RegExp;
9
+ readonly 'th-TH': RegExp;
10
+ readonly 'bn-IN': RegExp;
11
+ readonly 'ar-AR': RegExp;
12
+ readonly 'ta-IN': RegExp;
13
+ readonly 'ml-IN': RegExp;
14
+ readonly 'he-IL': RegExp;
15
+ readonly 'te-IN': RegExp;
16
+ readonly devanagari: RegExp;
17
+ readonly kannada: RegExp;
18
+ };
19
+ type Locale = keyof typeof code;
20
+
21
+ /**
22
+ * This class handles everything related to fonts.
23
+ */
24
+
25
+ type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
26
+ type FontStyle = 'normal' | 'italic';
27
+ interface FontOptions {
28
+ data: Buffer | ArrayBuffer;
29
+ name: string;
30
+ weight?: Weight;
31
+ style?: FontStyle;
32
+ lang?: string;
33
+ }
34
+
35
+ type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
36
+
37
+ declare function init(input: InitInput): Promise<void>;
38
+
39
+ /**
40
+ * This module is used to calculate the layout of the current sub-tree.
41
+ */
42
+
43
+ interface SatoriNode {
44
+ left: number;
45
+ top: number;
46
+ width: number;
47
+ height: number;
48
+ type: string;
49
+ key?: string | number;
50
+ props: Record<string, any>;
51
+ textContent?: string;
52
+ }
53
+
54
+ type SatoriOptions = ({
55
+ width: number;
56
+ height: number;
57
+ } | {
58
+ width: number;
59
+ } | {
60
+ height: number;
61
+ }) & {
62
+ fonts: FontOptions[];
63
+ embedFont?: boolean;
64
+ debug?: boolean;
65
+ graphemeImages?: Record<string, string>;
66
+ loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
67
+ onNodeDetected?: (node: SatoriNode) => void;
68
+ pointScaleFactor?: number;
69
+ };
70
+
71
+ declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
72
+
73
+ export { type FontOptions as Font, type FontStyle, type Weight as FontWeight, type Locale, type SatoriNode, type SatoriOptions, satori as default, init };
@@ -0,0 +1,73 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ declare const code: {
4
+ readonly 'ja-JP': RegExp;
5
+ readonly 'ko-KR': RegExp;
6
+ readonly 'zh-CN': RegExp;
7
+ readonly 'zh-TW': RegExp;
8
+ readonly 'zh-HK': RegExp;
9
+ readonly 'th-TH': RegExp;
10
+ readonly 'bn-IN': RegExp;
11
+ readonly 'ar-AR': RegExp;
12
+ readonly 'ta-IN': RegExp;
13
+ readonly 'ml-IN': RegExp;
14
+ readonly 'he-IL': RegExp;
15
+ readonly 'te-IN': RegExp;
16
+ readonly devanagari: RegExp;
17
+ readonly kannada: RegExp;
18
+ };
19
+ type Locale = keyof typeof code;
20
+
21
+ /**
22
+ * This class handles everything related to fonts.
23
+ */
24
+
25
+ type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
26
+ type FontStyle = 'normal' | 'italic';
27
+ interface FontOptions {
28
+ data: Buffer | ArrayBuffer;
29
+ name: string;
30
+ weight?: Weight;
31
+ style?: FontStyle;
32
+ lang?: string;
33
+ }
34
+
35
+ type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
36
+
37
+ declare function init(input: InitInput): Promise<void>;
38
+
39
+ /**
40
+ * This module is used to calculate the layout of the current sub-tree.
41
+ */
42
+
43
+ interface SatoriNode {
44
+ left: number;
45
+ top: number;
46
+ width: number;
47
+ height: number;
48
+ type: string;
49
+ key?: string | number;
50
+ props: Record<string, any>;
51
+ textContent?: string;
52
+ }
53
+
54
+ type SatoriOptions = ({
55
+ width: number;
56
+ height: number;
57
+ } | {
58
+ width: number;
59
+ } | {
60
+ height: number;
61
+ }) & {
62
+ fonts: FontOptions[];
63
+ embedFont?: boolean;
64
+ debug?: boolean;
65
+ graphemeImages?: Record<string, string>;
66
+ loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
67
+ onNodeDetected?: (node: SatoriNode) => void;
68
+ pointScaleFactor?: number;
69
+ };
70
+
71
+ declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
72
+
73
+ export { type FontOptions as Font, type FontStyle, type Weight as FontWeight, type Locale, type SatoriNode, type SatoriOptions, satori as default, init };
@@ -0,0 +1,6 @@
1
+ var jo=Object.defineProperty;var Gt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Vo=(e,t)=>{for(var n in t)jo(e,n,{get:t[n],enumerable:!0})};function Wr(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),Lr&&(r=Lr),r.indexOf("blob:")!==0?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="";var a=t.print||console.log.bind(console),c=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"&&pe("no native wasm support detected");var f,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 R=s[l++]&63;y=(y&240)==224?(y&15)<<12|w<<6|R:(y&7)<<18|w<<12|R<<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,C,W,L,v,S,T;function M(){var s=f.buffer;b=s,t.HEAP8=x=new Int8Array(s),t.HEAP16=C=new Int16Array(s),t.HEAP32=L=new Int32Array(s),t.HEAPU8=E=new Uint8Array(s),t.HEAPU16=W=new Uint16Array(s),t.HEAPU32=v=new Uint32Array(s),t.HEAPF32=S=new Float32Array(s),t.HEAPF64=T=new Float64Array(s)}var F,H=[],j=[],de=[];function le(){var s=t.preRun.shift();H.unshift(s)}var be=0,Z=null,fe=null;function pe(s){throw t.onAbort&&t.onAbort(s),s="Aborted("+s+")",c(s),p=!0,s=new WebAssembly.RuntimeError(s+". Build with -sASSERTIONS for more info."),o(s),s}function Te(s){return s.startsWith("data:application/octet-stream;base64,")}var Y="";if(!Te(Y)){var z=Y;Y=t.locateFile?t.locateFile(z,r):r+z}function Ge(){var s=Y;try{if(s==Y&&u)return new Uint8Array(u);if(Te(s))try{var l=Uo(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){pe(w)}}function De(){return u||typeof fetch!="function"?Promise.resolve().then(function(){return Ge()}):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 Ge()})}function ie(s){for(;0<s.length;)s.shift()(t)}function ye(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 V(s,l){return s=ye(s),function(){return l.apply(this,arguments)}}var X=[{},{value:void 0},{value:null},{value:!0},{value:!1}],xe=[];function ne(s){var l=Error,m=V(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 me=void 0;function N(s){throw new me(s)}var ae=s=>(s||N("Cannot use deleted val. handle = "+s),X[s].value),he=s=>{switch(s){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var l=xe.length?xe.pop():X.length;return X[l]={ga:1,value:s},l}},Le=void 0,ke=void 0;function re(s){for(var l="";E[s];)l+=ke[E[s++]];return l}var Ie=[];function Se(){for(;Ie.length;){var s=Ie.pop();s.M.$=!1,s.delete()}}var Ne=void 0,ve={};function Et(s,l){for(l===void 0&&N("ptr should not be undefined");s.R;)l=s.ba(l),s=s.R;return l}var nt={};function Nt(s){s=hr(s);var l=re(s);return at(s),l}function gt(s,l){var m=nt[s];return m===void 0&&N(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 Xe={};function Ue(s,l){return l=Et(s,l),ve[l]}var yt=void 0;function We(s){throw new yt(s)}function Ye(s,l){return l.P&&l.O||We("makeClassHandle requires ptr and ptrType"),!!l.U!=!!l.T&&We("Both smartPtrType and smartPtr must be specified"),l.count={value:1},qe(Object.create(s,{M:{value:l}}))}function qe(s){return typeof FinalizationRegistry>"u"?(qe=l=>l,s):(Rt=new FinalizationRegistry(l=>{bt(l.M)}),qe=l=>{var m=l.M;return m.T&&Rt.register(l,{M:m},l),l},Tt=l=>{Rt.unregister(l)},qe(s))}var xt={};function ct(s){for(;s.length;){var l=s.pop();s.pop()(l)}}function _e(s){return this.fromWireType(L[s>>2])}var ze={},Oe={};function Ke(s,l,m){function h(k){k=m(k),k.length!==s.length&&We("Mismatched type converter count");for(var A=0;A<s.length;++A)B(s[A],k[A])}s.forEach(function(k){Oe[k]=l});var y=Array(l.length),w=[],R=0;l.forEach((k,A)=>{nt.hasOwnProperty(k)?y[A]=nt[k]:(w.push(k),ze.hasOwnProperty(k)||(ze[k]=[]),ze[k].push(()=>{y[A]=nt[k],++R,R===w.length&&h(y)}))}),w.length===0&&h(y)}function $(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 B(s,l,m={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");var h=l.name;if(s||N('type "'+h+'" must have a positive integer typeid pointer'),nt.hasOwnProperty(s)){if(m.ua)return;N("Cannot register type '"+h+"' twice")}nt[s]=l,delete Oe[s],ze.hasOwnProperty(s)&&(l=ze[s],delete ze[s],l.forEach(y=>y()))}function ee(s){N(s.M.P.N.name+" instance already deleted")}function U(){}function oe(s,l,m){if(s[l].S===void 0){var h=s[l];s[l]=function(){return s[l].S.hasOwnProperty(arguments.length)||N("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)?(N("Cannot register public name '"+s+"' twice"),oe(t,s,s),t.hasOwnProperty(void 0)&&N("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),t[s].S[void 0]=l):t[s]=l}function se(s,l,m,h,y,w,R,k){this.name=s,this.constructor=l,this.X=m,this.W=h,this.R=y,this.pa=w,this.ba=R,this.na=k,this.ja=[]}function q(s,l,m){for(;l!==m;)l.ba||N("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&&N("null is not a valid "+this.name),0):(l.M||N('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||N("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&&N("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||N('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||N("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&l.M.P.ca&&N("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&&N("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:l.M.U===this?m=l.M.T:N("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,he(function(){h.delete()})),s!==null&&s.push(this.W,m)}break;default:N("Unsupporting sharing policy")}return m}function D(s,l){return l===null?(this.ea&&N("null is not a valid "+this.name),0):(l.M||N('Cannot pass "'+Be(l)+'" as a '+this.name),l.M.O||N("Cannot pass deleted object as a pointer of type "+this.name),l.M.P.ca&&N("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 Ee(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:D,this.V=null)}function Ae(s,l){t.hasOwnProperty(s)||We("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=F.get(l).apply(null,m);return h}}function ge(s,l){s=re(s);var m=s.includes("j")?Ot(s,l):F.get(l);return typeof m!="function"&&N("unknown function pointer with signature "+s+": "+l),m}var St=void 0;function Re(s,l){function m(w){y[w]||nt[w]||(Oe[w]?Oe[w].forEach(m):(h.push(w),y[w]=!0))}var h=[],y={};throw l.forEach(m),new St(s+": "+h.map(Nt).join([", "]))}function it(s,l,m,h,y){var w=l.length;2>w&&N("argTypes array size mismatch! Must at least get return value and 'this' types!");var R=l[1]!==null&&m!==null,k=!1;for(m=1;m<l.length;++m)if(l[m]!==null&&l[m].V===void 0){k=!0;break}var A=l[0].name!=="void",I=w-2,P=Array(I),O=[],J=[];return function(){if(arguments.length!==I&&N("function "+s+" called with "+arguments.length+" arguments, expected "+I+" args!"),J.length=0,O.length=R?2:1,O[0]=y,R){var we=l[1].toWireType(J,this);O[1]=we}for(var te=0;te<I;++te)P[te]=l[te+2].toWireType(J,arguments[te]),O.push(P[te]);if(te=h.apply(null,O),k)ct(J);else for(var $e=R?1:2;$e<l.length;$e++){var Qe=$e===1?we:P[$e-2];l[$e].V!==null&&l[$e].V(Qe)}return we=A?l[0].fromWireType(te):void 0,we}}function ue(s,l){for(var m=[],h=0;h<s;h++)m.push(v[l+4*h>>2]);return m}function ce(s){4<s&&--X[s].ga===0&&(X[s]=void 0,xe.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 Fe(s,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: "+s)}}function Je(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 C[h>>1]}:function(h){return W[h>>1]};case 2:return m?function(h){return L[h>>2]}:function(h){return v[h>>2]};default:throw new TypeError("Unknown integer type: "+s)}}function Ze(s,l){for(var m="",h=0;!(h>=l/2);++h){var y=C[s+2*h>>1];if(y==0)break;m+=String.fromCharCode(y)}return m}function Ce(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)C[l>>1]=s.charCodeAt(y),l+=2;return C[l>>1]=0,l-h}function Ve(s){return 2*s.length}function Bt(s,l){for(var m=0,h="";!(m>=l/4);){var y=L[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 R=s.charCodeAt(++y);w=65536+((w&1023)<<10)|R&1023}if(L[l>>2]=w,l+=4,l+4>m)break}return L[l>>2]=0,l-h}function nn(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 rn={};function Ft(s){var l=rn[s];return l===void 0?re(s):l}var on=[];function $o(s){var l=on.length;return on.push(s),l}function Go(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 pr=[],Do=[null,[],[]];me=t.BindingError=ne("BindingError"),t.count_emval_handles=function(){for(var s=0,l=5;l<X.length;++l)X[l]!==void 0&&++s;return s},t.get_first_emval=function(){for(var s=5;s<X.length;++s)if(X[s]!==void 0)return X[s];return null},Le=t.PureVirtualError=ne("PureVirtualError");for(var mr=Array(256),an=0;256>an;++an)mr[an]=String.fromCharCode(an);ke=mr,t.getInheritedInstanceCount=function(){return Object.keys(ve).length},t.getLiveInheritedInstances=function(){var s=[],l;for(l in ve)ve.hasOwnProperty(l)&&s.push(ve[l]);return s},t.flushPendingDeletes=Se,t.setDelayFunction=function(s){Ne=s,Ie.length&&Ne&&Ne(Se)},yt=t.InternalError=ne("InternalError"),U.prototype.isAliasOf=function(s){if(!(this instanceof U&&s instanceof U))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},U.prototype.clone=function(){if(this.M.O||ee(this),this.M.aa)return this.M.count.value+=1,this;var s=qe,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},U.prototype.delete=function(){this.M.O||ee(this),this.M.$&&!this.M.aa&&N("Object already scheduled for deletion"),Tt(this),bt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},U.prototype.isDeleted=function(){return!this.M.O},U.prototype.deleteLater=function(){return this.M.O||ee(this),this.M.$&&!this.M.aa&&N("Object already scheduled for deletion"),Ie.push(this),Ie.length===1&&Ne&&Ne(Se),this.M.$=!0,this},Ee.prototype.qa=function(s){return this.ka&&(s=this.ka(s)),s},Ee.prototype.ha=function(s){this.W&&this.W(s)},Ee.prototype.argPackAdvance=8,Ee.prototype.readValueFromPointer=_e,Ee.prototype.deleteObject=function(s){s!==null&&s.delete()},Ee.prototype.fromWireType=function(s){function l(){return this.da?Ye(this.N.X,{P:this.wa,O:m,U:this,T:s}):Ye(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=Xe[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?Ye(h.N.X,{P:h,O:y,U:this,T:s}):Ye(h.N.X,{P:h,O:y})},St=t.UnboundTypeError=ne("UnboundTypeError");var Uo=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++)),R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s.charAt(m++));h=h<<2|y>>4,y=(y&15)<<4|w>>2;var k=(w&3)<<6|R;l+=String.fromCharCode(h),w!==64&&(l+=String.fromCharCode(y)),R!==64&&(l+=String.fromCharCode(k))}while(m<s.length);return l},zo={l:function(s,l,m,h){pe("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=re(s),l=gt(l,"wrapper"),m=ae(m);var h=[].slice,y=l.N,w=y.X,R=y.R.X,k=y.R.constructor;s=V(s,function(){y.R.ja.forEach(function(I){if(this[I]===R[I])throw new Le("Pure virtual function "+I+" 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&&N("Pass correct 'this' to __construct");var I=k.implement.apply(void 0,[this].concat(h.call(arguments)));Tt(I);var P=I.M;I.notifyOnDestruction(),P.aa=!0,Object.defineProperties(this,{M:{value:P}}),qe(this),I=P.O,I=Et(y,I),ve.hasOwnProperty(I)?N("Tried to register registered instance: "+I):ve[I]=this},w.__destruct=function(){this===w&&N("Pass correct 'this' to __destruct"),Tt(this);var I=this.M.O;I=Et(y,I),ve.hasOwnProperty(I)?delete ve[I]:N("Tried to unregister unregistered instance: "+I)},s.prototype=Object.create(w);for(var A in m)s.prototype[A]=m[A];return he(s)},j:function(s){var l=xt[s];delete xt[s];var m=l.fa,h=l.W,y=l.ia,w=y.map(R=>R.ta).concat(y.map(R=>R.za));Ke([s],w,R=>{var k={};return y.forEach((A,I)=>{var P=R[I],O=A.ra,J=A.sa,we=R[I+y.length],te=A.ya,$e=A.Aa;k[A.oa]={read:Qe=>P.fromWireType(O(J,Qe)),write:(Qe,$t)=>{var st=[];te($e,Qe,we.toWireType(st,$t)),ct(st)}}}),[{name:l.name,fromWireType:function(A){var I={},P;for(P in k)I[P]=k[P].read(A);return h(A),I},toWireType:function(A,I){for(var P in k)if(!(P in I))throw new TypeError('Missing field: "'+P+'"');var O=m();for(P in k)k[P].write(O,I[P]);return A!==null&&A.push(h,O),O},argPackAdvance:8,readValueFromPointer:_e,V:h}]})},v:function(){},B:function(s,l,m,h,y){var w=$(m);l=re(l),B(s,{name:l,fromWireType:function(R){return!!R},toWireType:function(R,k){return k?h:y},argPackAdvance:8,readValueFromPointer:function(R){if(m===1)var k=x;else if(m===2)k=C;else if(m===4)k=L;else throw new TypeError("Unknown boolean type size: "+l);return this.fromWireType(k[R>>w])},V:null})},f:function(s,l,m,h,y,w,R,k,A,I,P,O,J){P=re(P),w=ge(y,w),k&&(k=ge(R,k)),I&&(I=ge(A,I)),J=ge(O,J);var we=ye(P);Q(we,function(){Re("Cannot construct "+P+" due to unbound types",[h])}),Ke([s,l,m],h?[h]:[],function(te){if(te=te[0],h)var $e=te.N,Qe=$e.X;else Qe=U.prototype;te=V(we,function(){if(Object.getPrototypeOf(this)!==$t)throw new me("Use 'new' to construct "+P);if(st.Y===void 0)throw new me(P+" has no accessible constructor");var yr=st.Y[arguments.length];if(yr===void 0)throw new me("Tried to invoke ctor of "+P+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(st.Y).toString()+") parameters instead!");return yr.apply(this,arguments)});var $t=Object.create(Qe,{constructor:{value:te}});te.prototype=$t;var st=new se(P,te,$t,J,$e,w,k,I);$e=new Ee(P,st,!0,!1),Qe=new Ee(P+"*",st,!1,!1);var br=new Ee(P+" const*",st,!1,!0);return Xe[s]={pointerType:Qe,la:br},Ae(we,te),[$e,Qe,br]})},d:function(s,l,m,h,y,w,R){var k=ue(m,h);l=re(l),w=ge(y,w),Ke([],[s],function(A){function I(){Re("Cannot call "+P+" due to unbound types",k)}A=A[0];var P=A.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var O=A.N.constructor;return O[l]===void 0?(I.Z=m-1,O[l]=I):(oe(O,l,P),O[l].S[m-1]=I),Ke([],k,function(J){return J=it(P,[J[0],null].concat(J.slice(1)),null,w,R),O[l].S===void 0?(J.Z=m-1,O[l]=J):O[l].S[m-1]=J,[]}),[]})},p:function(s,l,m,h,y,w){0<l||pe();var R=ue(l,m);y=ge(h,y),Ke([],[s],function(k){k=k[0];var A="constructor "+k.name;if(k.N.Y===void 0&&(k.N.Y=[]),k.N.Y[l-1]!==void 0)throw new me("Cannot register multiple constructors with identical number of parameters ("+(l-1)+") for class '"+k.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return k.N.Y[l-1]=()=>{Re("Cannot construct "+k.name+" due to unbound types",R)},Ke([],R,function(I){return I.splice(1,0,null),k.N.Y[l-1]=it(A,I,null,y,w),[]}),[]})},a:function(s,l,m,h,y,w,R,k){var A=ue(m,h);l=re(l),w=ge(y,w),Ke([],[s],function(I){function P(){Re("Cannot call "+O+" due to unbound types",A)}I=I[0];var O=I.name+"."+l;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),k&&I.N.ja.push(l);var J=I.N.X,we=J[l];return we===void 0||we.S===void 0&&we.className!==I.name&&we.Z===m-2?(P.Z=m-2,P.className=I.name,J[l]=P):(oe(J,l,O),J[l].S[m-2]=P),Ke([],A,function(te){return te=it(O,te,I,w,R),J[l].S===void 0?(te.Z=m-2,J[l]=te):J[l].S[m-2]=te,[]}),[]})},A:function(s,l){l=re(l),B(s,{name:l,fromWireType:function(m){var h=ae(m);return ce(m),h},toWireType:function(m,h){return he(h)},argPackAdvance:8,readValueFromPointer:_e,V:null})},n:function(s,l,m){m=$(m),l=re(l),B(s,{name:l,fromWireType:function(h){return h},toWireType:function(h,y){return y},argPackAdvance:8,readValueFromPointer:Fe(l,m),V:null})},e:function(s,l,m,h,y){l=re(l),y===-1&&(y=4294967295),y=$(m);var w=k=>k;if(h===0){var R=32-8*m;w=k=>k<<R>>>R}m=l.includes("unsigned")?function(k,A){return A>>>0}:function(k,A){return A},B(s,{name:l,fromWireType:w,toWireType:m,argPackAdvance:8,readValueFromPointer:Je(l,y,h!==0),V:null})},b:function(s,l,m){function h(w){w>>=2;var R=v;return new y(b,R[w+1],R[w])}var y=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];m=re(m),B(s,{name:m,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{ua:!0})},o:function(s,l){l=re(l);var m=l==="std::string";B(s,{name:l,fromWireType:function(h){var y=v[h>>2],w=h+4;if(m)for(var R=w,k=0;k<=y;++k){var A=w+k;if(k==y||E[A]==0){if(R=R?g(E,R,A-R):"",I===void 0)var I=R;else I+="\0",I+=R;R=A+1}}else{for(I=Array(y),k=0;k<y;++k)I[k]=String.fromCharCode(E[w+k]);I=I.join("")}return at(h),I},toWireType:function(h,y){y instanceof ArrayBuffer&&(y=new Uint8Array(y));var w,R=typeof y=="string";if(R||y instanceof Uint8Array||y instanceof Uint8ClampedArray||y instanceof Int8Array||N("Cannot pass non-string to std::string"),m&&R){var k=0;for(w=0;w<y.length;++w){var A=y.charCodeAt(w);127>=A?k++:2047>=A?k+=2:55296<=A&&57343>=A?(k+=4,++w):k+=3}w=k}else w=y.length;if(k=In(4+w+1),A=k+4,v[k>>2]=w,m&&R){if(R=A,A=w+1,w=E,0<A){A=R+A-1;for(var I=0;I<y.length;++I){var P=y.charCodeAt(I);if(55296<=P&&57343>=P){var O=y.charCodeAt(++I);P=65536+((P&1023)<<10)|O&1023}if(127>=P){if(R>=A)break;w[R++]=P}else{if(2047>=P){if(R+1>=A)break;w[R++]=192|P>>6}else{if(65535>=P){if(R+2>=A)break;w[R++]=224|P>>12}else{if(R+3>=A)break;w[R++]=240|P>>18,w[R++]=128|P>>12&63}w[R++]=128|P>>6&63}w[R++]=128|P&63}}w[R]=0}}else if(R)for(R=0;R<w;++R)I=y.charCodeAt(R),255<I&&(at(A),N("String has UTF-16 code units that do not fit in 8 bits")),E[A+R]=I;else for(R=0;R<w;++R)E[A+R]=y[R];return h!==null&&h.push(at,k),k},argPackAdvance:8,readValueFromPointer:_e,V:function(h){at(h)}})},i:function(s,l,m){if(m=re(m),l===2)var h=Ze,y=Ce,w=Ve,R=()=>W,k=1;else l===4&&(h=Bt,y=kt,w=nn,R=()=>v,k=2);B(s,{name:m,fromWireType:function(A){for(var I=v[A>>2],P=R(),O,J=A+4,we=0;we<=I;++we){var te=A+4+we*l;(we==I||P[te>>k]==0)&&(J=h(J,te-J),O===void 0?O=J:(O+="\0",O+=J),J=te+l)}return at(A),O},toWireType:function(A,I){typeof I!="string"&&N("Cannot pass non-string to C++ string type "+m);var P=w(I),O=In(4+P+l);return v[O>>2]=P>>k,y(I,O+4,P+l),A!==null&&A.push(at,O),O},argPackAdvance:8,readValueFromPointer:_e,V:function(A){at(A)}})},k:function(s,l,m,h,y,w){xt[s]={name:re(l),fa:ge(m,h),W:ge(y,w),ia:[]}},h:function(s,l,m,h,y,w,R,k,A,I){xt[s].ia.push({oa:re(l),ta:m,ra:ge(h,y),sa:w,za:R,ya:ge(k,A),Aa:I})},C:function(s,l){l=re(l),B(s,{va:!0,name:l,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(s,l,m,h,y){s=on[s],l=ae(l),m=Ft(m);var w=[];return v[h>>2]=he(w),s(l,m,w,y)},t:function(s,l,m,h){s=on[s],l=ae(l),m=Ft(m),s(l,m,null,h)},g:ce,m:function(s,l){var m=Go(s,l),h=m[0];l=h.name+"_$"+m.slice(1).map(function(R){return R.name}).join("_")+"$";var y=pr[l];if(y!==void 0)return y;var w=Array(s-1);return y=$o((R,k,A,I)=>{for(var P=0,O=0;O<s-1;++O)w[O]=m[O+1].readValueFromPointer(I+P),P+=m[O+1].argPackAdvance;for(R=R[k].apply(R,w),O=0;O<s-1;++O)m[O+1].ma&&m[O+1].ma(w[O]);if(!h.va)return h.toWireType(A,R)}),pr[l]=y},D:function(s){4<s&&(X[s].ga+=1)},r:function(s){var l=ae(s);ct(l),ce(s)},c:function(){pe("")},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{f.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 R=v[l>>2],k=v[l+4>>2];l+=8;for(var A=0;A<k;A++){var I=E[R+A],P=Do[s];I===0||I===10?((s===1?a:c)(g(P,0)),P.length=0):P.push(I)}y+=k}return v[h>>2]=y,0}};(function(){function s(y){t.asm=y.exports,f=t.asm.E,M(),F=t.asm.J,j.unshift(t.asm.F),be--,t.monitorRunDependencies&&t.monitorRunDependencies(be),be==0&&(Z!==null&&(clearInterval(Z),Z=null),fe&&(y=fe,fe=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){c("failed to asynchronously prepare wasm: "+w),pe(w)})}var h={a:zo};if(be++,t.monitorRunDependencies&&t.monitorRunDependencies(be),t.instantiateWasm)try{return t.instantiateWasm(h,s)}catch(y){c("Module.instantiateWasm callback failed with error: "+y),o(y)}return function(){return u||typeof WebAssembly.instantiateStreaming!="function"||Te(Y)||typeof fetch!="function"?m(l):fetch(Y,{credentials:"same-origin"}).then(function(y){return WebAssembly.instantiateStreaming(y,h).then(l,function(w){return c("wasm streaming compile failed: "+w),c("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 hr=t.___getTypeName=function(){return(hr=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 In=t._malloc=function(){return(In=t._malloc=t.asm.I).apply(null,arguments)},at=t._free=function(){return(at=t._free=t.asm.K).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.L).apply(null,arguments)};var sn;fe=function s(){sn||gr(),sn||(fe=s)};function gr(){function s(){if(!sn&&(sn=!0,t.calledRun=!0,!p)){if(ie(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();de.unshift(l)}ie(de)}}if(!(0<be)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)le();ie(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 gr(),e.ready}var Lr,Nr=Gt(()=>{Lr=""});var lt,Or,Br,zt,Wn,ft,Ct,ii,cn,Nn,Mt,Pt,On,Fr,Bn,Fn,tt,$n,ai,$r,dn=Gt(()=>{lt=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}({}),Or=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}({}),Wn=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}({}),ii=function(e){return e[e.WebFlexBasis=0]="WebFlexBasis",e}({}),cn=function(e){return e[e.Column=0]="Column",e[e.ColumnReverse=1]="ColumnReverse",e[e.Row=2]="Row",e[e.RowReverse=3]="RowReverse",e}({}),Nn=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}({}),On=function(e){return e[e.Undefined=0]="Undefined",e[e.Exactly=1]="Exactly",e[e.AtMost=2]="AtMost",e}({}),Fr=function(e){return e[e.Default=0]="Default",e[e.Text=1]="Text",e}({}),Bn=function(e){return e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.Scroll=2]="Scroll",e}({}),Fn=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}({}),$n=function(e){return e[e.NoWrap=0]="NoWrap",e[e.Wrap=1]="Wrap",e[e.WrapReverse=2]="WrapReverse",e}({}),ai={ALIGN_AUTO:lt.Auto,ALIGN_FLEX_START:lt.FlexStart,ALIGN_CENTER:lt.Center,ALIGN_FLEX_END:lt.FlexEnd,ALIGN_STRETCH:lt.Stretch,ALIGN_BASELINE:lt.Baseline,ALIGN_SPACE_BETWEEN:lt.SpaceBetween,ALIGN_SPACE_AROUND:lt.SpaceAround,ALIGN_SPACE_EVENLY:lt.SpaceEvenly,BOX_SIZING_BORDER_BOX:Or.BorderBox,BOX_SIZING_CONTENT_BOX:Or.ContentBox,DIMENSION_WIDTH:Br.Width,DIMENSION_HEIGHT:Br.Height,DIRECTION_INHERIT:zt.Inherit,DIRECTION_LTR:zt.LTR,DIRECTION_RTL:zt.RTL,DISPLAY_FLEX:Wn.Flex,DISPLAY_NONE:Wn.None,DISPLAY_CONTENTS:Wn.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:ii.WebFlexBasis,FLEX_DIRECTION_COLUMN:cn.Column,FLEX_DIRECTION_COLUMN_REVERSE:cn.ColumnReverse,FLEX_DIRECTION_ROW:cn.Row,FLEX_DIRECTION_ROW_REVERSE:cn.RowReverse,GUTTER_COLUMN:Nn.Column,GUTTER_ROW:Nn.Row,GUTTER_ALL:Nn.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:On.Undefined,MEASURE_MODE_EXACTLY:On.Exactly,MEASURE_MODE_AT_MOST:On.AtMost,NODE_TYPE_DEFAULT:Fr.Default,NODE_TYPE_TEXT:Fr.Text,OVERFLOW_VISIBLE:Bn.Visible,OVERFLOW_HIDDEN:Bn.Hidden,OVERFLOW_SCROLL:Bn.Scroll,POSITION_TYPE_STATIC:Fn.Static,POSITION_TYPE_RELATIVE:Fn.Relative,POSITION_TYPE_ABSOLUTE:Fn.Absolute,UNIT_UNDEFINED:tt.Undefined,UNIT_POINT:tt.Point,UNIT_PERCENT:tt.Percent,UNIT_AUTO:tt.Auto,WRAP_NO_WRAP:$n.NoWrap,WRAP_WRAP:$n.Wrap,WRAP_WRAP_REVERSE:$n.WrapReverse},$r=ai});function Gn(e){function t(i,r,a){let c=i[r];i[r]=function(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];return a.call(this,c,...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 c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];let f=u.pop(),p,g;if(f==="auto")p=tt.Auto,g=void 0;else if(typeof f=="object")p=f.unit,g=f.valueOf();else if(p=typeof f=="string"&&f.endsWith("%")?tt.Percent:tt.Point,g=parseFloat(f),f!==void 0&&!Number.isNaN(f)&&Number.isNaN(g))throw new Error(`Invalid value ${f} for ${i}`);if(!r[p])throw new Error(`Failed to execute "${i}": Unsupported unit '${f}'`);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,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:zt.LTR;return i.call(this,r,a,c)}),{Config:e.Config,Node:e.Node,...$r}}var Gr=Gt(()=>{dn();dn()});async function Dr(){return Gn(await Wr())}var Ur=Gt(()=>{Nr();Gr();dn()});var Un={};Vo(Un,{getYoga:()=>ci,init:()=>fi});async function li(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 fi(e){si({instantiateWasm(t,n){return li(e,t).then(({instance:o})=>{n(o)}).catch(Dn),{}}}).then(zr).catch(Dn)}function ci(){return ui}var si,zr,Dn,ui,zn=Gt(()=>{Ur();si=Dr,ui=new Promise((e,t)=>{zr=e,Dn=t})});import ri from"linebreak";var Dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ho=Dt((e,t)=>{t.exports=["em","ex","ch","rem","vh","vw","vmin","vmax","px","mm","cm","in","pt","pc","mozmm"]}),Xo=Dt((e,t)=>{t.exports=["deg","grad","rad","turn"]}),Yo=Dt((e,t)=>{t.exports=["dpi","dpcm","dppx"]}),qo=Dt((e,t)=>{t.exports=["Hz","kHz"]}),Ko=Dt((e,t)=>{t.exports=["s","ms"]}),Jo=Ho(),xr=Xo(),Sr=Yo(),wr=qo(),vr=Ko();function An(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(Zo(e)>1)throw new Error("Only one dot is allowed");if(/%$/.test(e)){this.type="percentage",this.value=_n(e),this.unit="%";return}var t=ei(e);if(!t){this.type="number",this.value=_n(e);return}this.type=ni(t),this.value=_n(e.substr(0,e.length-t.length)),this.unit=t}An.prototype.valueOf=function(){return this.value};An.prototype.toString=function(){return this.value+(this.unit||"")};function et(e){return new An(e)}function Zo(e){var t=e.match(/\./g);return t?t.length:0}function _n(e){var t=parseFloat(e);if(isNaN(t))throw new Error("Invalid number: "+e);return t}var Qo=[].concat(xr,wr,Jo,Sr,vr);function ei(e){var t=e.match(/\D+$/),n=t&&t[0];if(n&&Qo.indexOf(n)===-1)throw new Error("Invalid unit: "+n);return n}var ti=Object.assign(un(xr,"angle"),un(wr,"frequency"),un(Sr,"resolution"),un(vr,"time"));function un(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function ni(e){return ti[e]||"length"}function _t(e){let t=typeof e;return!(t==="number"||t==="bigint"||t==="string"||t==="boolean")}function Er(e){return/^class\s/.test(e.toString())}function Pn(e){return e&&e.$$typeof===Symbol.for("react.forward_ref")}function Tr(e){return typeof e=="function"||Pn(e)}function Rr(e){return"dangerouslySetInnerHTML"in e}function kr(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 G(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 et(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 Ln(e);if(r.type==="percentage"&&i)return r.value/100*n}}catch{}}function Ln(e){let t=new et(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 Pe(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 Cn,Mn,Ir=[32,160,4961,65792,65793,4153,4241,10].map(e=>String.fromCodePoint(e)),It=new Map,oi=500;function Me(e,t,n){let o=`${t}:${n||""}:${e}`;if(It.has(o))return It.get(o);if(!Cn||!Mn){if(!(typeof Intl<"u"&&"Segmenter"in Intl))throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");Cn=new Intl.Segmenter(n,{granularity:"word"}),Mn=new Intl.Segmenter(n,{granularity:"grapheme"})}let i;if(t==="grapheme")i=[...Mn.segment(e)].map(r=>r.segment);else{let r=[...Cn.segment(e)].map(u=>u.segment),a=[],c=0;for(;c<r.length;){let u=r[c];if(u=="\xA0"){let d=c===0?"":a.pop(),f=c===r.length-1?"":r[c+1];a.push(d+"\xA0"+f),c+=2}else a.push(u),c++}i=a}if(It.size>=oi){let r=It.keys().next().value;It.delete(r)}return It.set(o,i),i}function _(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 _r(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 c=t.keys().next().value;t.delete(c)}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 ln(e){return typeof e=="string"}function Ar(e){return typeof e=="number"}function Cr(e){return typeof e>"u"}function ut(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 dt(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 Mr(e,t){if(t==="break-all")return{words:Me(e,"grapheme"),requiredBreaks:[]};if(t==="keep-all")return{words:Me(e,"word"),requiredBreaks:[]};let n=new ri(e),o=0,i=n.nextBreak(),r=[],a=[!1];for(;i;){let c=e.slice(o,i.position);r.push(c),i.required?a.push(!0):a.push(!1),o=i.position,i=n.nextBreak()}return{words:r,requiredBreaks:a}}var Pr=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 di(e){return Promise.resolve().then(()=>(zn(),Un)).then(t=>t.init(e))}function pt(){return Promise.resolve().then(()=>(zn(),Un)).then(e=>e.getYoga())}var pi="image/avif",mi="image/webp",pn="image/apng",mn="image/png",hn="image/jpeg",gn="image/gif",jn="image/svg+xml";function Hr(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 Xr(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function Yr(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var ot=_r(500),jt=new Map,hi=[mn,pn,hn,gn,jn],gi=/<svg[^>]*>/i,bi=/viewBox=['"]([^'"]+)['"]/,yi=/width=['"](\d*\.?\d+)['"]/,xi=/height=['"](\d*\.?\d+)['"]/;function Si(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 wi(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 jr(e,t){let n=t.match(gi);if(!n)throw new Error(`Failed to parse SVG from ${e}`);let o=n[0],i=bi.exec(o),r=yi.exec(o),a=xi.exec(o),c=i?At(i[1]):null;if(!c&&(!r||!a))throw new Error(`Failed to parse SVG from ${e}: missing "viewBox"`);let u=c?[c[2],c[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 Vr(e){let t,n=vi(new Uint8Array(e));switch(n){case mn:case pn:t=Yr(e);break;case gn:t=Xr(e);break;case hn:t=Hr(e);break}if(!hi.includes(n))throw new Error(`Unsupported image type: ${n||"unknown"}`);return[`data:${n};base64,${Si(e)}`,t]}async function Lt(e){if(!e)throw new Error("Image source is not provided.");if(typeof e=="object"){let[i,r]=Vr(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:c}=i;if(r===jn){let u=a==="base64"?atob(c):decodeURIComponent(c.replace(/ /g,"%20")),d=a==="base64"?e:`data:image/svg+xml;base64,${btoa(u)}`,f=jr(e,u);return ot.set(e,[d,...f]),[d,...f]}else if(a==="base64"){let u,d=wi(c);switch(r){case mn:case pn:u=Yr(d);break;case gn:u=Xr(d);break;case hn:u=Hr(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 c=`data:image/svg+xml;base64,${btoa(i)}`,u=jr(n,i);return[c,...u]}catch(c){throw new Error(`Failed to parse SVG image: ${c.message}`)}let[r,a]=Vr(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 vi(e){return[255,216,255].every((t,n)=>e[n]===t)?hn:[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)?Ei(e)?pn:mn:[71,73,70,56].every((t,n)=>e[n]===t)?gn:[82,73,70,70,0,0,0,0,87,69,66,80].every((t,n)=>!t||e[n]===t)?mi:[60,63,120,109,108].every((t,n)=>e[n]===t)?jn:[0,0,0,0,102,116,121,112,97,118,105,102].every((t,n)=>!t||e[n]===t)?pi:null}function Ei(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 Vn={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"},Ti=/[\r\n%#()<>?[\\\]^`{|}"']/g;function Hn(e,t){if(!e)return"";if(Array.isArray(e))return e.map(d=>Hn(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,c=`${Object.entries(r).map(([d,f])=>(typeof f=="string"&&f.toLowerCase()==="currentcolor"&&(f=a),(d==="href"||d==="xlinkHref")&&n==="image"?` ${Vn[d]||d}="${ot.get(f)[0]}"`:` ${Vn[d]||d}="${f}"`)).join("")}`,u=i?` style="${Object.entries(i).map(([d,f])=>`${Pr(d)}:${f}`).join(";")}"`:"";return`<${n}${c}${u}>${Hn(o,a)}</${n}>`}async function qr(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 Kr(e,t){let{viewBox:n,viewbox:o,width:i,height:r,className:a,style:c,children:u,...d}=e.props||{};n||=o,d.xmlns="http://www.w3.org/2000/svg";let f=(c==null?void 0:c.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=f),` ${Vn[b]||b}="${x}"`)).join("")}>${Hn(u,f)}</svg>`.replace(Ti,encodeURIComponent)}`}var He="flex",Jr={p:{display:He,marginTop:"1em",marginBottom:"1em"},div:{display:He},blockquote:{display:He,marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:He,textAlign:"center"},hr:{display:He,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"solid"},h1:{display:He,fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:He,fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:He,fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:He,marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:He,fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:He,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:He,fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var Ri=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 Xn(e){let t={};for(let n in e)(Ri.has(n)||n.startsWith("--"))&&(t[n]=e[n]);return t}import{getPropertyName as Ci,getStylesForProperty as mt}from"css-to-react-native";import{parseElementStyle as Mi}from"css-background-parser";import{parse as Pi}from"css-box-shadow";import Li from"parse-css-color";import ki from"postcss-value-parser";function Ii(e,t){try{let n=new et(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 Yn(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=Ii(e,t);return o.absolute?{[n?"xAbsolute":"yAbsolute"]:o.absolute}:o.relative?{[n?"xRelative":"yRelative"]:o.relative}:{}}}}function qn(e,t){if(typeof e=="number")return{xAbsolute:e};let n;try{n=ki(e).nodes.filter(o=>o.type==="word").map(o=>o.value)}catch{return{}}return n.length===1?Yn(n[0],t,!0):n.length===2?((n[0]==="top"||n[0]==="bottom"||n[1]==="left"||n[1]==="right")&&n.reverse(),{...Yn(n[0],t,!0),...Yn(n[1],t,!1)}):{}}import{getPropertyName as _i}from"css-to-react-native";function Vt(e,t){let n=_i(`mask-${t}`);return e[n]||e[`WebkitM${n.substring(1)}`]}function Zr(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 Qr from"postcss-value-parser";function eo(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 to(e,t){return{...e,...t}}function Xt(e,t,n=new Set){if(typeof e!="string"||!e.includes("var("))return e;try{let o=Qr(e),i=!1;if(o.walk(r=>{if(r.type==="function"&&r.value==="var"){i=!0;let a=Ai(r);if(!a)return;let{varName:c,fallback:u}=a;if(n.has(c)){console.warn(`Circular reference detected for CSS variable: ${c}`),u!==void 0?Ht(r,u):Ht(r,"initial");return}let d=t[c];if(d!==void 0){let f=new Set(n);f.add(c);let p=Xt(d,t,f);Ht(r,String(p))}else if(u!==void 0){let f=Xt(u,t,n);Ht(r,String(f))}else Ht(r,"initial")}}),i)return o.toString()}catch{console.warn(`Failed to parse CSS value for variable resolution: ${e}`)}return e}function Ai(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=Qr.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 Wi=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),Ni=new Set(["lineHeight"]);function Oi(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:Wi.has(e)?Ni.has(e)?n:String(t):n+"px"}function Bi(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=mt(e,o,!0),a=mt(e,i,!0);for(let c in r)a[c]=wt(e,r[c])+" "+wt(e,a[c]);return a}if(/^border(Top|Right|Bottom|Left)?$/.test(e)){let o=mt("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:Pe(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 c in i)r["border"+a+c]=i[c];return r}if(e==="boxShadow"){if(!t)throw new Error('Invalid `boxShadow` value: "'+t+'".');return{[e]:typeof t=="string"?Pi(t):t}}if(e==="transform"){if(typeof t!="string")throw new Error("Invalid `transform` value.");let o={},i=t.replace(/(-?[\d.]+%)/g,(a,c)=>{let u=~~(Math.random()*1e9);return o[u]=c,u+"px"}),r=mt("transform",i,!0);for(let a of r.transform)for(let c in a)o[a[c]]&&(a[c]=o[a[c]]);return r}if(e==="background")return t=t.toString().trim(),/^(linear-gradient|radial-gradient|url|repeating-linear-gradient|repeating-radial-gradient)\(/.test(t)?mt("backgroundImage",t,!0):mt("background",t,!0);if(e==="textShadow"){t=t.toString().trim();let o={},i=fn(t);for(let r of i){let a=mt("textShadow",r,!0);for(let c in a)o[c]?o[c].push(a[c]):o[c]=[a[c]]}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==="textDecorationSkipInk"){let o=t.toString().trim().toLowerCase();if(!["auto","none","all"].includes(o))throw new Error("Invalid `textDecorationSkipInk` value.");return{textDecorationSkipInk:o}}}function no(e){return e==="transform"?" Only absolute lengths such as `10px` are supported.":""}var ro=/rgb\((\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\.\d]+)\)/;function io(e){if(typeof e=="string"&&ro.test(e.trim()))return e.trim().replace(ro,(t,n,o,i,r)=>`rgba(${n}, ${o}, ${i}, ${r})`);if(typeof e=="object"&&e!==null){for(let t in e)e[t]=io(e[t]);return e}return e}function bn(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}=eo(e);i=u,r=d}let a=to(o,i);for(let u in a)n[u]=a[u];if(r){let u=r.color?Xt(r.color,a):void 0,d=$i(u,t.color);n.color=d;for(let f in r){if(f.startsWith("_")){n[f]=r[f];continue}if(f==="color")continue;let p=Ci(f),g=Xt(r[f],a),b=Di(g,d);try{let x=Bi(p,b,d)||Oi(p,mt(p,wt(p,b),!0),b,d);Object.assign(n,x)}catch(x){throw new Error(x.message+(x.message.includes(b)?`
3
+ `+no(p):`
4
+ in CSS rule \`${p}: ${b}\`.${no(p)}`))}}}if(n.backgroundImage){let{backgrounds:u}=Mi(n);n.backgroundImage=u}(n.maskImage||n.WebkitMaskImage)&&(n.maskImage=Zr(n));let c=Fi(n.fontSize,t.fontSize);typeof n.fontSize<"u"&&(n.fontSize=c),n.transformOrigin&&(n.transformOrigin=qn(n.transformOrigin,c));for(let u in n){let d=n[u];if(u==="lineHeight")typeof d=="string"&&d!=="normal"&&(d=n[u]=G(d,c,c,t,!0)/c);else{if(typeof d=="string"){let f=G(d,c,c,t);typeof f<"u"&&(n[u]=f),d=n[u]}if(typeof d=="string"||typeof d=="object"){let f=io(d);f&&(n[u]=f),d=n[u]}}if(u==="opacity"&&typeof d=="number"&&(n.opacity=d*t.opacity),u==="transform"){let f=d;for(let p of f){let g=Object.keys(p)[0],b=p[g],x=typeof b=="string"?G(b,c,c,t)??b:b;p[g]=x}}if(u==="textShadowRadius"){let f=d;n.textShadowRadius=f.map(p=>G(p,c,0,t,!1))}if(u==="textShadowOffset"){let f=d;n.textShadowOffset=f.map(({height:p,width:g})=>({height:G(p,c,0,t,!1),width:G(g,c,0,t,!1)}))}}return n}function Fi(e,t){if(typeof e=="number")return e;try{let n=new et(e);switch(n.unit){case"em":return n.value*t;case"rem":return n.value*16}}catch{return t}}function oo(e){if(e.startsWith("hsl")){let t=Li(e),[n,o,i]=t.values;return`hsl(${[n,`${o}%`,`${i}%`].concat(t.alpha===1?[]:[t.alpha]).join(",")})`}return e}function $i(e,t){return e&&e.toLowerCase()!=="currentcolor"?oo(e):oo(t)}function Gi(e,t){return e.replace(/currentcolor/gi,t)}function Di(e,t){return ln(e)&&(e=Gi(e,t)),e}async function Kn(e,t,n,o,i){let r=await pt(),a=Object.assign({},n,bn(Jr[t],n),bn(o,n));if(t==="img"){let[c,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 f=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/f)):b===void 0?typeof x=="number"?b=x/f:e.setAspectRatio(1/f):x===void 0&&(typeof b=="number"?x=b*f:e.setAspectRatio(1/f)),a.width=E?b+p:b,a.height=E?x+g:x,a.__src=c,a.__naturalWidth=u,a.__naturalHeight=d}if(t==="svg"){let c=i.viewBox||i.viewbox,u=At(c),d=u?u[3]/u[2]:null,{width:f,height:p}=i;typeof f>"u"&&p?d==null?f=0:typeof p=="string"&&p.endsWith("%")?f=parseInt(p)/d+"%":(p=G(p,n.fontSize,1,n),f=p/d):typeof p>"u"&&f?d==null?f=0:typeof f=="string"&&f.endsWith("%")?p=parseInt(f)*d+"%":(f=G(f,n.fontSize,1,n),p=f*d):(typeof f<"u"&&(f=G(f,n.fontSize,1,n)||f),typeof p<"u"&&(p=G(p,n.fontSize,1,n)||p),f||=u==null?void 0:u[2],p||=u==null?void 0:u[3]),!a.width&&f&&(a.width=f),!a.height&&p&&(a.height=p)}return e.setDisplay(Pe(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(Pe(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(Pe(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(Pe(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(Pe(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(Pe(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(Pe(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(dt(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(ut(a.maxHeight,"maxHeight")),typeof a.maxWidth<"u"&&e.setMaxWidth(ut(a.maxWidth,"maxWidth")),typeof a.minHeight<"u"&&e.setMinHeight(ut(a.minHeight,"minHeight")),typeof a.minWidth<"u"&&e.setMinWidth(ut(a.minWidth,"minWidth")),e.setOverflow(Pe(a.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE,"overflow")),e.setMargin(r.EDGE_TOP,dt(a.marginTop||0)),e.setMargin(r.EDGE_BOTTOM,dt(a.marginBottom||0)),e.setMargin(r.EDGE_LEFT,dt(a.marginLeft||0)),e.setMargin(r.EDGE_RIGHT,dt(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(Pe(a.boxSizing,{"border-box":r.BOX_SIZING_BORDER_BOX,"content-box":r.BOX_SIZING_CONTENT_BOX},r.BOX_SIZING_BORDER_BOX,"boxSizing")),e.setPositionType(Pe(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,ut(a.top,"top")),typeof a.bottom<"u"&&e.setPosition(r.EDGE_BOTTOM,ut(a.bottom,"bottom")),typeof a.left<"u"&&e.setPosition(r.EDGE_LEFT,ut(a.left,"left")),typeof a.right<"u"&&e.setPosition(r.EDGE_RIGHT,ut(a.right,"right")),typeof a.height<"u"?e.setHeight(dt(a.height,"height")):e.setHeightAuto(),typeof a.width<"u"?e.setWidth(dt(a.width,"width")):e.setWidthAuto(),[a,Xn(a)]}import so from"escape-html";var ao=[1,0,0,1,0,0];function Ui(e,t,n){let o=[...ao];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 c=a,u=[...ao];switch(r){case"translateX":u[4]=c;break;case"translateY":u[5]=c;break;case"scale":u[0]=c,u[3]=c;break;case"scaleX":u[0]=c;break;case"scaleY":u[3]=c;break;case"rotate":{let d=c*Math.PI/180,f=Math.cos(d),p=Math.sin(d);u[0]=f,u[1]=p,u[2]=-p,u[3]=f;break}case"skewX":u[2]=Math.tan(c*Math.PI/180);break;case"skewY":u[1]=Math.tan(c*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 c;i.__resolved||Ui(i,n,o);let u=i;if(r)c=u;else{let d=(a==null?void 0:a.xAbsolute)??((a==null?void 0:a.xRelative)??50)*n/100,f=(a==null?void 0:a.yAbsolute)??((a==null?void 0:a.yRelative)??50)*o/100,p=e+d,g=t+f;c=Ut([1,0,0,1,p,g],Ut(u,[1,0,0,1,-p,-g])),u.__parent&&(c=Ut(u.__parent,c)),u.splice(0,6,...c)}return`matrix(${c.map(d=>d.toFixed(2)).join(",")})`}function uo({left:e,top:t,width:n,height:o,isInheritingTransform:i},r){let a="",c=1;return r.transform&&(a=Yt({left:e,top:t,width:n,height:o},r.transform,i,r.transformOrigin)),r.opacity!==void 0&&(c=+r.opacity),{matrix:a,opacity:c}}function Jn({id:e,content:t,filter:n,left:o,top:i,width:r,height:a,matrix:c,opacity:u,image:d,clipPathId:f,debug:p,shape:g,decorationShape:b},x){let E="";if(p&&(E=_("rect",{x:o,y:i-a,width:r,height:a,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0})),d){let W={href:d,x:o,y:i,width:r,height:a,transform:c||void 0,"clip-path":f?`url(#${f})`:void 0,style:x.filter?`filter:${x.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+_("image",{...W,opacity:u!==1?u: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:c||void 0,"clip-path":f?`url(#${f})`: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})">`:"")+_("text",{...C,fill:x.color,opacity:u!==1?u:void 0},so(t))+(b||"")+(n?"</g>":"")+E,g?_("text",C,so(t)):""]}function zi(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 yn=1.1;function lo({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="",c="",u=0,d=t,f=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),f=Math.min(o.shadowOffset[g].height-b,f),p=Math.max(o.shadowOffset[g].height+b+n,p),i){let x=`satori_s-${e}-result-${g}`;a+=_("feGaussianBlur",{in:"SourceAlpha",stdDeviation:o.shadowRadius[g]/2,result:`${x}-blur`})+_("feOffset",{in:`${x}-blur`,dx:o.shadowOffset[g].width,dy:o.shadowOffset[g].height,result:`${x}-offset`})+_("feFlood",{"flood-color":o.shadowColor[g],"flood-opacity":1,result:`${x}-color`})+_("feComposite",{in:`${x}-color`,in2:`${x}-offset`,operator:"in",result:r>1?x:void 0})}else a+=_("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&&(c=_("feMergeNode",{in:`satori_s-${e}-result-${g}`})+c)}return _("filter",{id:`satori_s-${e}`,x:(u/t*100*yn).toFixed(2)+"%",y:(f/n*100*yn).toFixed(2)+"%",width:((d-u)/t*100*yn).toFixed(2)+"%",height:((p-f)/n*100*yn).toFixed(2)+"%"},a+(c?_("feMerge",{},c):""))}function fo({width:e,height:t,shape:n,opacity:o,id:i},r){if(!r.boxShadow)return null;let a="",c="";for(let u=r.boxShadow.length-1;u>=0;u--){let d="",f=r.boxShadow[u];f.spreadRadius&&f.inset&&(f.spreadRadius=-f.spreadRadius);let p=f.blurRadius*f.blurRadius/4+(f.spreadRadius||0),g=Math.min(-p-(f.inset?f.offsetX:0),0),b=Math.max(p+e-(f.inset?f.offsetX:0),e),x=Math.min(-p-(f.inset?f.offsetY:0),0),E=Math.max(p+t-(f.inset?f.offsetY:0),t),C=`satori_s-${i}-${u}`,W=`satori_ms-${i}-${u}`,L=f.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${f.spreadRadius*2}"`):n;d+=_("mask",{id:W,maskUnits:"userSpaceOnUse"},_("rect",{x:0,y:0,width:r._viewportWidth||"100%",height:r._viewportHeight||"100%",fill:f.inset?"#000":"#fff"})+L.replace('fill="#fff"',f.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let v=L.replace(/d="([^"]+)"/,(S,T)=>'d="'+zi(T,f.offsetX,f.offsetY)+'"').replace(/x="([^"]+)"/,(S,T)=>'x="'+(parseFloat(T)+f.offsetX)+'"').replace(/y="([^"]+)"/,(S,T)=>'y="'+(parseFloat(T)+f.offsetY)+'"');f.spreadRadius&&f.spreadRadius<0&&(d+=_("mask",{id:W+"-neg",maskUnits:"userSpaceOnUse"},v.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-f.spreadRadius*2}"`))),f.spreadRadius&&f.spreadRadius<0&&(v=_("g",{mask:`url(#${W}-neg)`},v)),d+=_("defs",{},_("filter",{id:C,x:`${g/e*100}%`,y:`${x/t*100}%`,width:`${(b-g)/e*100}%`,height:`${(E-x)/t*100}%`},_("feGaussianBlur",{stdDeviation:f.blurRadius/2,result:"b"})+_("feFlood",{"flood-color":f.color,in:"SourceGraphic",result:"f"})+_("feComposite",{in:"f",in2:"b",operator:f.inset?"out":"in"})))+_("g",{mask:`url(#${W})`,filter:`url(#${C})`,opacity:o},v),f.inset?c+=d:a+=d}return[a,c]}function ji(e,t,n,o,i,r){let a=i/2,c=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-c),b=Math.min(t,p.x2+c);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=[],f=e;for(let[p,g]of u)if(p>f&&d.push([f,p]),f=Math.max(f,g),f>=t)break;return f<t&&d.push([f,t]),d}function Zn({width:e,left:t,top:n,ascender:o,clipPathId:i,matrix:r,glyphBoxes:a},c){let{textDecorationColor:u,textDecorationStyle:d,textDecorationLine:f,textDecorationSkipInk:p,fontSize:g,color:b}=c;if(!f||f==="none")return"";let x=Math.max(1,g*.1),E=f==="line-through"?n+o*.7:f==="underline"?n+o*1.1:n,C=d==="dashed"?`${x*1.2} ${x*2}`:d==="dotted"?`0 ${x*2}`:void 0,W=f==="underline"&&(p||"auto")!=="none"&&(a==null?void 0:a.length),L=n+o,v=W?ji(t,t+e,a,E,x,L):[[t,t+e]],S=d==="double"?v.map(([T,M])=>_("line",{x1:T,y1:E+x+1,x2:M,y2:E+x+1,stroke:u||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])=>_("line",{x1:T,y1:E,x2:M,y2:E,stroke:u||b,"stroke-width":x,"stroke-dasharray":C,"stroke-linecap":d==="dotted"?"round":"square",transform:r})).join("")+S+(i?"</g>":"")}function Qn(e){return e=e.replace("U+","0x"),String.fromCodePoint(Number(e))}var vt=Qn("U+0020"),er=Qn("U+0009"),Wt=Qn("U+2026");function co(e,t,n){let{fontSize:o,letterSpacing:i}=n,r=new Map;function a(d){let f=r.get(d);return f===void 0&&(f=e.measure(d,{fontSize:o,letterSpacing:i}),r.set(d,f)),f}function c(d){let f=0;for(let p of d)t(p)?f+=o:f+=a(p);return f}function u(d){return c(Me(d,"grapheme"))}return{measureGrapheme:a,measureGraphemeArray:c,measureText:u}}function po(e,t,n){let{textTransform:o,whiteSpace:i,wordBreak:r}=t;e=Vi(e,o,n);let{content:a,shouldCollapseTabsAndSpaces:c,allowSoftWrap:u}=Yi(e,i),{words:d,requiredBreaks:f,allowBreakWord:p}=Xi(a,r),[g,b]=Hi(t,u);return{words:d,requiredBreaks:f,allowSoftWrap:u,allowBreakWord:p,processedContent:a,shouldCollapseTabsAndSpaces:c,lineLimit:g,blockEllipsis:b}}function Vi(e,t,n){return t==="uppercase"?e=e.toLocaleUpperCase(n):t==="lowercase"?e=e.toLocaleLowerCase(n):t==="capitalize"&&(e=Me(e,"word",n).map(o=>Me(o,"grapheme",n).map((i,r)=>r===0?i.toLocaleUpperCase(n):i).join("")).join("")),e}function Hi(e,t){let{textOverflow:n,lineClamp:o,WebkitLineClamp:i,WebkitBoxOrient:r,overflow:a,display:c}=e;if(c==="block"&&o){let[u,d=Wt]=qi(o);if(u)return[u,d]}return n==="ellipsis"&&c==="-webkit-box"&&r==="vertical"&&Ar(i)&&i>0?[i,Wt]:n==="ellipsis"&&a==="hidden"&&!t?[1,Wt]:[1/0]}function Xi(e,t){let n=["break-all","break-word"].includes(t),{words:o,requiredBreaks:i}=Mr(e,t);return{words:o,requiredBreaks:i,allowBreakWord:n}}function Yi(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 qi(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 ho from"parse-css-color";var Ki=new Set([er]);function Ji(e){return Ki.has(e)}function tr(e){if(e==="transparent")return!0;let t=ho(e);return t?t.alpha===0:!1}function mo(e){if(!e)return!1;let t=ho(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*nr(e,t){let n=await pt(),{parentStyle:o,inheritedStyle:i,parent:r,font:a,id:c,isInheritingTransform:u,debug:d,embedFont:f,graphemeImages:p,locale:g,canLoadAdditionalAssets:b}=t,{textAlign:x,textIndent:E=0,lineHeight:C,textWrap:W,fontSize:L,filter:v,tabSize:S=8,letterSpacing:T,_inheritedBackgroundClipTextPath:M,_inheritedBackgroundClipTextHasBackground:F,flexShrink:H}=o,{words:j,requiredBreaks:de,allowSoftWrap:le,allowBreakWord:be,processedContent:Z,shouldCollapseTabsAndSpaces:fe,lineLimit:pe,blockEllipsis:Te}=po(e,o,g),Y=Zi(n,x);r.insertChild(Y,r.getChildCount()),Cr(H)&&r.setFlexShrink(1);let z=a.getEngine(L,C,o,g),Ge=b?Me(Z,"grapheme").filter($=>!Ji($)&&!z.has($)):[];yield Ge.map($=>({word:$,locale:g})),Ge.length&&(z=a.getEngine(L,C,o,g));function De($){return!!(p&&p[$])}let{measureGrapheme:ie,measureGraphemeArray:ye,measureText:V}=co(z,De,{fontSize:L,letterSpacing:T}),X=ln(S)?G(S,L,1,o):ie(vt)*S,xe=($,B)=>{if($.length===0)return{originWidth:0,endingSpacesWidth:0,text:$};let{index:ee,tabCount:U}=Qi($),oe=0;if(U>0){let se=$.slice(0,ee),q=$.slice(ee+U),K=V(se),je=K+B;oe=(X===0?K:(Math.floor(je/X)+U)*X)+V(q)}else oe=V($);let Q=$.trimEnd()===$?oe:V($.trimEnd());return{originWidth:oe,endingSpacesWidth:oe-Q,text:$}},ne=[],me=[],N=[],ae=[],he=[];function Le($){let B=0,ee=0,U=-1,oe=0,Q=0,se=0,q=0;ne=[],N=[0],ae=[],he=[];let K=0,je=0;for(;K<j.length&&B<pe;){let D=j[K],Ee=de[K],Ae=0,{originWidth:Ot,endingSpacesWidth:ge,text:St}=xe(D,Q);D=St,Ae=Ot;let Re=ge;Ee&&se===0&&(se=z.height(D));let it=x==="justify",ue=K&&Q+Ae>$+Re&&le;if(be&&Ae>$&&(!Q||ue||Ee)){let Fe=Me(D,"grapheme");j.splice(K,1,...Fe),Q>0&&(ne.push(Q-je),me.push(q),B++,oe+=se,Q=0,se=0,q=0,N.push(1),U=-1),je=Re;continue}if(Ee||ue)fe&&D===vt&&(Ae=0),ne.push(Q-je),me.push(q),B++,oe+=se,Q=Ae,se=Ae?Math.round(z.height(D)):0,q=Ae?Math.round(z.baseline(D)):0,N.push(1),U=-1,Ee||(ee=Math.max(ee,$));else{Q+=Ae;let Fe=Math.round(z.height(D));Fe>se&&(se=Fe,q=Math.round(z.baseline(D))),it&&N[N.length-1]++}it&&U++,ee=Math.max(ee,Q);let Be=Q-Ae;if(Ae===0)he.push({y:oe,x:Be,width:0,line:B,lineIndex:U,isImage:!1});else{let Fe=Me(D,"word");for(let Je=0;Je<Fe.length;Je++){let Ze=Fe[Je],Ce=0,Ve=!1;De(Ze)?(Ce=L,Ve=!0):!f&&Ze.length>1?Ce=V(Ze):Ce=ie(Ze),ae.push(Ze),he.push({y:oe,x:Be,width:Ce,line:B,lineIndex:U,isImage:Ve}),Be+=Ce}}K++,je=Re}return Q&&(B<pe&&(oe+=se),B++,ne.push(Q),me.push(q)),{width:ee,height:oe}}let ke={width:0,height:0};Y.setMeasureFunc($=>{let{width:B,height:ee}=Le($);if(W==="balance"){let oe=B/2,Q=B,se=B;for(;oe+1<Q;){se=(oe+Q)/2;let{height:K}=Le(se);K>ee?oe=se:Q=se}Le(Q);let q=Math.ceil(Q);return ke={width:q,height:ee},{width:q,height:ee}}if(W==="pretty"&&ne[ne.length-1]<B/3){let se=B*.9,q=Le(se);if(q.height<=ee*1.3)return ke={width:B,height:q.height},{width:B,height:q.height}}let U=Math.ceil(B);return ke={width:U,height:ee},{width:U,height:ee}});let[re,Ie]=yield,Se="",Ne="",ve=i._inheritedClipPathId,Et=i._inheritedMaskId,{left:nt,top:Nt,width:gt,height:Tt}=Y.getComputedLayout(),Rt=typeof E=="string"?G(E,L,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=re+nt,Xe=Ie+Nt,{matrix:Ue,opacity:yt}=uo({left:nt,top:Nt,width:gt,height:Tt,isInheritingTransform:u},o),We="";if(o.textShadowOffset){let{textShadowColor:$,textShadowOffset:B,textShadowRadius:ee}=o;We=lo({width:ke.width,height:ke.height,id:c},{shadowColor:$,shadowOffset:B,shadowRadius:ee},tr(o.color)||F&&mo(o.color)),We=_("defs",{},We)}let Ye="",qe="",xt="",ct=-1,_e={},ze={},Oe=null,Ke=0;for(let $=0;$<ae.length;$++){let B=he[$],ee=he[$+1];if(!B)continue;let U=ae[$],oe=null,Q=!1,se=p?p[U]:null,q=B.y,K=B.x,je=B.width,D=B.line,Ee=o.textDecorationLine==="underline"&&(o.textDecorationSkipInk||"auto")!=="none";if(D===ct)continue;let Ae=!1;if(D===0&&Rt!==0&&(K+=Rt),ne.length>1){let ue=gt-ne[D];if(x==="right"||x==="end")K+=ue;else if(x==="center")K+=ue/2;else if(x==="justify"&&D<ne.length-1){let ce=N[D],Be=ce>1?ue/(ce-1):0;K+=Be*B.lineIndex,Ae=!0}f&&(K=Math.round(K))}let Ot=me[D],ge=z.baseline(U),St=z.height(U),Re=Ot-ge,it=ue=>!Ee||o.textDecorationLine!=="underline"?void 0:{underlineY:Xe+ue+Re+ge+ge*.1,strokeWidth:Math.max(1,L*.1)};if(_e[D]||(_e[D]={left:K,top:Xe+q+Re,ascender:ge,width:Ae?gt:ne[D]}),pe!==1/0){let Ze=function(Ce,Ve){let Bt=Me(Ve,"grapheme",g),kt="",nn=0;for(let rn of Bt){let Ft=Ce+ye([kt+rn]);if(kt&&Ft+ce>bt)break;kt+=rn,nn=Ft}return{subset:kt,resolvedWidth:nn}},ue=Te,ce=ie(Te);ce>bt&&(ue=Wt,ce=ie(ue));let Be=ie(vt),Fe=D<ne.length-1;if(D+1===pe&&(Fe||ne[D]>bt)){if(K+je+ce+Be>bt){let{subset:Ce,resolvedWidth:Ve}=Ze(K,U);U=Ce+ue,ct=D,_e[D].width=Math.max(0,Ve-_e[D].left),Q=!0}else if(ee&&ee.line!==D)if(x==="center"){let{subset:Ce,resolvedWidth:Ve}=Ze(K,U);U=Ce+ue,ct=D,_e[D].width=Math.max(0,Ve-_e[D].left),Q=!0}else{let Ce=ae[$+1],{subset:Ve,resolvedWidth:Bt}=Ze(je+K,Ce);U=U+Ve+ue,ct=D,_e[D].width=Math.max(0,Bt-_e[D].left),Q=!0}}}if(se)q+=0;else if(f){if(!U.includes(er)&&!Ir.includes(U)&&ae[$+1]&&ee&&!ee.isImage&&q===ee.y&&!Q){Oe===null&&(Ke=K),Oe=Oe===null?U:Oe+U;continue}let ue=Oe===null?U:Oe+U,ce=Oe===null?K:Ke,Be=B.width+K-ce,Fe=it(q),Je=z.getSVG(ue.replace(/(\t)+/g,""),{fontSize:L,left:rt+ce,top:Xe+q+ge+Re,letterSpacing:T},Fe);oe=Je.path,Ee&&Je.boxes&&Je.boxes.length&&(ze[D]||(ze[D]=[])).push(...Je.boxes),Oe=null,d&&(xt+=_("rect",{x:rt+ce,y:Xe+q+Re,width:Be,height:St,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Ue||void 0,"clip-path":ve?`url(#${ve})`:void 0})+_("line",{x1:rt+K,x2:rt+K+B.width,y1:Xe+q+Re+ge,y2:Xe+q+Re+ge,stroke:"#14c000","stroke-width":1,transform:Ue||void 0,"clip-path":ve?`url(#${ve})`:void 0}))}else if(q+=ge+Re,Ee&&!se){let ue=it(q),ce=z.getSVG(U.replace(/(\t)+/g,""),{fontSize:L,left:rt+K,top:Xe+q,letterSpacing:T},ue);ce.boxes&&ce.boxes.length&&(ze[D]||(ze[D]=[])).push(...ce.boxes)}if(oe!==null)qe+=oe+" ";else{let[ue,ce]=Jn({content:U,filter:We,id:c,left:rt+K,top:Xe+q,width:je,height:St,matrix:Ue,opacity:yt,image:se,clipPathId:ve,debug:d,shape:!!M},o);Se+=ue,Ne+=ce}if(Q)break}if(o.textDecorationLine&&(Ye=Object.entries(_e).map(([$,B])=>{if(!B)return"";let ee=ze[$]||[];return Zn({left:rt+B.left,top:B.top,width:B.width,ascender:B.ascender,clipPathId:ve,matrix:Ue,glyphBoxes:ee},o)}).join("")),qe){let $=(!tr(o.color)||We)&&yt!==0?`<g ${Et?`mask="url(#${Et})"`:""} ${ve?`clip-path="url(#${ve})"`:""}>`+_("path",{fill:We&&(tr(o.color)||F&&mo(o.color))?"black":o.color,d:qe,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&&(Ne=_("path",{d:qe,transform:Ue||void 0})),Se+=(We?We+_("g",{filter:`url(#satori_s-${c})`},$+Ye):$+Ye)+xt}else Ye&&(Se+=We?_("g",{filter:`url(#satori_s-${c})`},Ye):Ye);return Ne&&(o._inheritedBackgroundClipTextPath.value+=Ne),Se}function Zi(e,t){let n=e.Node.create();return n.setAlignItems(e.ALIGN_BASELINE),n.setJustifyContent(Pe(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 Qi(e){let t=/(\t)+/.exec(e);return t?{index:t.index,tabCount:t[0].length}:{index:null,tabCount:0}}import{parseLinearGradient as ta}from"css-gradient-parser";import ea from"parse-css-color";function xn(e,t,n,o,i){let r=[],a=t.at(-1),c=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/c:Number(G(`${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,f=1;for(let p=0;p<r.length;p++)if(typeof r[p].offset>"u"){for(f<p&&(f=p);typeof r[f].offset>"u";)f++;r[p].offset=(r[f].offset-r[d].offset)/(f-d)*(p-d)+r[d].offset}else d=p;return i==="mask"?r.map(p=>{let g=ea(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 go({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,u,d){let f=ta(r),[p,g]=a,b=r.startsWith("repeating"),x,E,C;if(f.orientation.type==="directional")x=ra(f.orientation.value),E=Math.sqrt(Math.pow((x.x2-x.x1)*p,2)+Math.pow((x.y2-x.y1)*g,2));else if(f.orientation.type==="angular"){let{length:T,...M}=oa(Ln(`${f.orientation.value.value}${f.orientation.value.unit}`)/180*Math.PI,p,g);E=T,x=M}C=b?ia(f.stops,E,x,u):x;let W=xn(b?na(f.stops,E):E,f.stops,u,b,d),L=`satori_bi${e}`,v=`satori_pattern_${e}`,S=_("pattern",{id:v,x:c[0]/t,y:c[1]/n,width:o?p/t:"1",height:i?g/n:"1",patternUnits:"objectBoundingBox"},_("linearGradient",{id:L,...C,spreadMethod:b?"repeat":"pad"},W.map(T=>_("stop",{offset:(T.offset??0)*100+"%","stop-color":T.color})).join(""))+_("rect",{x:0,y:0,width:p,height:g,fill:`url(#${L})`}));return[v,S]}function na(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 ra(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 oa(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,c,u,d,f,p,g=b=>{if(b===0){i=0,r=n,a=0,c=0,u=n;return}else if(b===Math.PI/2){i=0,r=0,a=t,c=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,c=n/2-Math.abs(r-n/2),u=Math.sqrt(Math.pow(a-i,2)+Math.pow(c-r,2)),f=(t/2/Math.tan(b)-n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f+n,u=2*Math.sqrt(Math.pow(t/2-f,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,c=n/2+Math.abs(r-n/2),f=(t/2/Math.tan(b)+n/2)/(Math.tan(b)+1/Math.tan(b)),p=Math.tan(b)*f,u=2*Math.sqrt(Math.pow(t/2-f,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=c,c=d)};return g(e),{x1:i/t,y1:r/n,x2:a/t,y2:c/n,length:u}}function ia(e,t,n,o){let{x1:i,x2:r,y1:a,y2:c}=n,u=e[0].offset?e[0].offset.unit==="%"?Number(e[0].offset.value)/100:G(`${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:G(`${e.at(-1).offset.value}${e.at(-1).offset.unit}`,o.fontSize,t,o,!0)/t:1,f=(r-i)*u+i,p=(c-a)*u+a,g=(r-i)*d+i,b=(c-a)*d+a;return{x1:f,y1:p,x2:g,y2:b}}import{parseRadialGradient as aa}from"css-gradient-parser";function yo({id:e,width:t,height:n,repeatX:o,repeatY:i},r,a,c,u,d){var Z;let{shape:f,stops:p,position:g,size:b,repeating:x}=aa(r),[E,C]=a,W=E/2,L=C/2,v=ua(g.x,g.y,E,C,u.fontSize,u);W=v.x,L=v.y;let S=sa(t,p,x,u),T=xn(S,p,u,x,d),M=`satori_radial_${e}`,F=`satori_pattern_${e}`,H=`satori_mask_${e}`,j=fa(f,b,u.fontSize,{x:W,y:L},[E,C],u,x),de=la(f,u.fontSize,p,[E,C],u,x,j),le=_("pattern",{id:F,x:c[0]/t,y:c[1]/n,width:o?E/t:"1",height:i?C/n:"1",patternUnits:"objectBoundingBox"},_("radialGradient",{id:M,...de},T.map(fe=>_("stop",{offset:fe.offset||0,"stop-color":fe.color})).join(""))+_("mask",{id:H},_("rect",{x:0,y:0,width:E,height:C,fill:"#fff"}))+_("rect",{x:0,y:0,width:E,height:C,fill:((Z=T.at(-1))==null?void 0:Z.color)||"transparent"})+_(f,{cx:W,cy:L,width:E,height:C,...j,fill:`url(#${M})`,mask:`url(#${H})`}));return[F,le]}function sa(e,t,n,o){if(!n)return e;let i=t.at(-1);return!i||!i.offset||i.offset.unit==="%"?e:G(`${i.offset.value}${i.offset.unit}`,+o.fontSize,e,o,!0)}function ua(e,t,n,o,i,r){let a={x:n/2,y:o/2};return e.type==="keyword"?Object.assign(a,bo(e.value,n,o,"x")):a.x=G(`${e.value.value}${e.value.unit}`,i,n,r,!0)??n/2,t.type==="keyword"?Object.assign(a,bo(t.value,n,o,"y")):a.y=G(`${t.value.value}${t.value.unit}`,i,o,r,!0)??o/2,a}function bo(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 la(e,t,n,[o,i],r,a,c){let{r:u,rx:d,ratio:f=1}=c;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)/f}%`:Number(G(`${p.offset.value}${p.offset.unit}`,t,o,r,!0)/g)}}function fa(e,t,n,o,i,r,a){let[c,u]=i,{x:d,y:f}=o,p={},g=0,b=0;if(ca(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(G(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0))}):Object.assign(p,{rx:Number(G(`${t[0].value.value}${t[0].value.unit}`,n,c,r,!0)),ry:Number(G(`${t[1].value.value}${t[1].value.unit}`,n,u,r,!0))}),Sn(p,c,u,d,f,a,e),p}switch(t[0].value){case"farthest-corner":g=Math.max(Math.abs(c-d),Math.abs(d)),b=Math.max(Math.abs(u-f),Math.abs(f));break;case"closest-corner":g=Math.min(Math.abs(c-d),Math.abs(d)),b=Math.min(Math.abs(u-f),Math.abs(f));break;case"farthest-side":return e==="circle"?p.r=Math.max(Math.abs(c-d),Math.abs(d),Math.abs(u-f),Math.abs(f)):(p.rx=Math.max(Math.abs(c-d),Math.abs(d)),p.ry=Math.max(Math.abs(u-f),Math.abs(f))),Sn(p,c,u,d,f,a,e),p;case"closest-side":return e==="circle"?p.r=Math.min(Math.abs(c-d),Math.abs(d),Math.abs(u-f),Math.abs(f)):(p.rx=Math.min(Math.abs(c-d),Math.abs(d)),p.ry=Math.min(Math.abs(u-f),Math.abs(f))),Sn(p,c,u,d,f,a,e),p}return e==="circle"?p.r=Math.sqrt(g*g+b*b):Object.assign(p,xo(g,b)),Sn(p,c,u,d,f,a,e),p}function Sn(e,t,n,o,i,r,a){if(r)if(a==="ellipse"){let c=Math.max(Math.abs(t-o),Math.abs(o)),u=Math.max(Math.abs(n-i),Math.abs(i)),{rx:d,ry:f}=xo(c,u);e.ratio=Math.max(d/e.rx,f/e.ry),e.ratio>1&&(e.rx*=e.ratio,e.ry*=e.ratio)}else{let c=Math.max(Math.abs(t-o),Math.abs(o)),u=Math.max(Math.abs(n-i),Math.abs(i)),d=Math.sqrt(c*c+u*u);e.ratio=d/e.r,e.ratio>1&&(e.r=d)}}function xo(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 ca(e){return!e.some(t=>t.type==="keyword")}import So from"parse-css-color";function or(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function da(e,t,n,o,i){if(!o||!i)return[t,n];if(e==="cover"){let r=t/o,a=n/i,c=Math.max(r,a);return[o*c,i*c]}if(e==="contain"){let r=t/o,a=n/i,c=Math.min(r,a);return[o*c,i*c]}if(e==="auto"||e.includes("auto")){let r=e.split(" "),a=r[0]||"auto",c=r[1]||r[0]||"auto",u=o,d=i;if(a==="auto"&&c!=="auto"){let f=or(c,n);d=f,u=o/i*f}else if(c==="auto"&&a!=="auto"){let f=or(a,t);u=f,d=i/o*f}return[u,d]}return[t,n]}function rr(e,{x:t,y:n,defaultX:o,defaultY:i}){return(e?e.split(" ").map(r=>{try{let a=new et(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)=>or(r,[t,n][a]))}async function qt({id:e,width:t,height:n,left:o,top:i},{image:r,size:a,position:c,repeat:u},d,f){u=u||"repeat",f=f||"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]:rr(a,{x:t,y:n,defaultX:t,defaultY:n}),C=rr(c,{x:t,y:n,defaultX:0,defaultY:0});if(r.startsWith("linear-gradient(")||r.startsWith("repeating-linear-gradient("))return go({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,C,d,f);if(r.startsWith("radial-gradient(")||r.startsWith("repeating-radial-gradient("))return yo({id:e,width:t,height:n,repeatX:p,repeatY:g},r,E,C,d,f);if(r.startsWith("url(")){let[W,L,v]=await Lt(r.slice(4,-1)),S,T;if(b){let[M,F]=da(a,t,n,L,v);S=M,T=F}else{let M=rr(a,{x:t,y:n,defaultX:0,defaultY:0});S=f==="mask"?L||M[0]:M[0]||L,T=f==="mask"?v||M[1]:M[1]||v}return[`satori_bi${e}`,_("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%"},_("image",{x:0,y:0,width:S,height:T,preserveAspectRatio:"none",href:W}))]}if(So(r)){let W=So(r),[L,v,S,T]=W.values,F=`rgba(${L},${v},${S},${T!==void 0?T:1})`;return[`satori_bi${e}`,_("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:o,y:i,width:t,height:n},_("rect",{x:0,y:0,width:t,height:n,fill:F}))]}throw new Error(`Invalid background image: "${r}"`)}function pa([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 wn(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 vn(e){e[0]=e[1]=Math.min(e[0],e[1])}function En(e,t,n,o,i){if(typeof e=="string"){let r=e.split(" ").map(c=>c.trim()),a=!r[1]&&!r[0].endsWith("%");return r[1]=r[1]||r[0],[a,[Math.min(G(r[0],o,t,i,!0),t),Math.min(G(r[1],o,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}var Tn=e=>e&&e[0]!==0&&e[1]!==0;function wo({id:e,borderRadiusPath:t,borderType:n,left:o,top:i,width:r,height:a},c){let u=`satori_brc-${e}`;return[_("clipPath",{id:u},_(n,{x:o,y:i,width:r,height:a,d:t||void 0})),u]}function ht({left:e,top:t,width:n,height:o},i,r){let{borderTopLeftRadius:a,borderTopRightRadius:c,borderBottomLeftRadius:u,borderBottomRightRadius:d,fontSize:f}=i,p,g,b,x;if([p,a]=En(a,n,o,f,i),[g,c]=En(c,n,o,f,i),[b,u]=En(u,n,o,f,i),[x,d]=En(d,n,o,f,i),!r&&!Tn(a)&&!Tn(c)&&!Tn(u)&&!Tn(d))return"";a||=[0,0],c||=[0,0],u||=[0,0],d||=[0,0],[a[0],c[0]]=wn(a[0],c[0],n),[u[0],d[0]]=wn(u[0],d[0],n),[a[1],u[1]]=wn(a[1],u[1],o),[c[1],d[1]]=wn(c[1],d[1],o),p&&vn(a),g&&vn(c),b&&vn(u),x&&vn(d);let E=[];E[0]=[c,c],E[1]=[d,[-d[0],d[1]]],E[2]=[u,[-u[0],-u[1]]],E[3]=[a,[a[0],-a[1]]];let C=`h${n-a[0]-c[0]} a${E[0][0]} 0 0 1 ${E[0][1]}`,W=`v${o-c[1]-d[1]} a${E[1][0]} 0 0 1 ${E[1][1]}`,L=`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 T=function(be){let Z=pa([a,c,d,u][be]);return be===0?[[e+a[0]-Z,t+a[1]-Z],[e+a[0],t]]:be===1?[[e+n-c[0]+Z,t+c[1]-Z],[e+n,t+c[1]]]:be===2?[[e+n-d[0]+Z,t+o-d[1]+Z],[e+n-d[0],t+o]]:[[e+u[0]-Z,t+o-u[1]+Z],[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="",F=T(S),H=`M${F[0]} A${E[(S+3)%4][0]} 0 0 1 ${F[1]}`,j=0;for(;j<4&&r[(S+j)%4];j++)M+=H+" ",H=[C,W,L,v][(S+j)%4];let de=(S+j)%4;M+=H.split(" ")[0];let le=T(de);return M+=` A${E[(de+3)%4][0]} 0 0 1 ${le[0]}`,M}return`M${e+a[0]},${t} ${C} ${W} ${L} ${v}`}function vo(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function Eo({id:e,currentClipPathId:t,borderPath:n,borderType:o,left:i,top:r,width:a,height:c},u){if(!(u.borderTopWidth||u.borderRightWidth||u.borderBottomWidth||u.borderLeftWidth))return null;let f=`satori_bc-${e}`;return[_("clipPath",{id:f,"clip-path":t?`url(#${t})`:void 0},_(o,{x:i,y:r,width:a,height:c,d:n||void 0})),f]}function Kt({left:e,top:t,width:n,height:o,props:i,asContentMask:r,maskBorderOnly:a},c){let u=["borderTop","borderRight","borderBottom","borderLeft"];if(!r&&!u.some(b=>c[b+"Width"]))return"";let d="",f=0;for(;f>0&&vo(u[f],u[(f+3)%4],c);)f=(f+3)%4;let p=[!1,!1,!1,!1],g=[];for(let b=0;b<4;b++){let x=(f+b)%4,E=(f+b+1)%4,C=u[x],W=u[E];if(p[x]=!0,g=[c[C+"Width"],c[C+"Style"],c[C+"Color"],C],!vo(C,W,c)){let L=(g[0]||0)+(r&&!a&&c[C.replace("border","padding")]||0);L&&(d+=_("path",{width:n,height:o,...i,fill:"none",stroke:r?"#000":g[2],"stroke-width":L*2,"stroke-dasharray":!r&&g[1]==="dashed"?L*2+" "+L:void 0,d:ht({left:e,top:t,width:n,height:o},c,p)})),p=[!1,!1,!1,!1]}}if(p.some(Boolean)){let b=(g[0]||0)+(r&&!a&&c[g[3].replace("border","padding")]||0);b&&(d+=_("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:ht({left:e,top:t,width:n,height:o},c,p)}))}return d}function ir({id:e,left:t,top:n,width:o,height:i,matrix:r,borderOnly:a},c){let u=(c.borderLeftWidth||0)+(a?0:c.paddingLeft||0),d=(c.borderTopWidth||0)+(a?0:c.paddingTop||0),f=(c.borderRightWidth||0)+(a?0:c.paddingRight||0),p=(c.borderBottomWidth||0)+(a?0:c.paddingBottom||0),g={x:t+u,y:n+d,width:o-u-f,height:i-d-p};return _("mask",{id:e},_("rect",{...g,fill:"#fff",transform:c.overflow==="hidden"&&c.transform&&r?r:void 0,mask:c._inheritedMaskId?`url(#${c._inheritedMaskId})`:void 0})+Kt({left:t,top:n,width:o,height:i,props:{transform:r||void 0},asContentMask:!0,maskBorderOnly:a},c))}import{getStylesForProperty as To}from"css-to-react-native";var Jt={circle:/circle\((.+)\)/,ellipse:/ellipse\((.+)\)/,path:/path\((.+)\)/,polygon:/polygon\((.+)\)/,inset:/inset\((.+)\)/};function Io({width:e,height:t},n,o){function i(d){let f=d.match(Jt.circle);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(C=>C.trim()),{x,y:E}=ko(b,e,t);return{type:"circle",r:G(g,o.fontSize,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/Math.sqrt(2),o,!0),cx:G(x,o.fontSize,e,o,!0),cy:G(E,o.fontSize,t,o,!0)}}function r(d){let f=d.match(Jt.ellipse);if(!f)return null;let[,p]=f,[g,b=""]=p.split("at").map(L=>L.trim()),[x,E]=g.split(" "),{x:C,y:W}=ko(b,e,t);return{type:"ellipse",rx:G(x||"50%",o.fontSize,e,o,!0),ry:G(E||"50%",o.fontSize,t,o,!0),cx:G(C,o.fontSize,e,o,!0),cy:G(W,o.fontSize,t,o,!0)}}function a(d){let f=d.match(Jt.path);if(!f)return null;let[p,g]=Ro(f[1]);return{type:"path",d:g,"fill-rule":p}}function c(d){let f=d.match(Jt.polygon);if(!f)return null;let[p,g]=Ro(f[1]);return{type:"polygon","fill-rule":p,points:g.split(",").map(b=>b.split(" ").map((x,E)=>G(x,o.fontSize,E===0?e:t,o,!0)).join(" ")).join(",")}}function u(d){let f=d.match(Jt.inset);if(!f)return null;let[p,g]=(f[1].includes("round")?f[1]:`${f[1].trim()} round 0`).split("round"),b=To("borderRadius",g,!0),x=Object.values(b).map(S=>String(S)).map((S,T)=>G(S,o.fontSize,T===0||T===2?t:e,o,!0)||0),E=Object.values(To("margin",p,!0)).map(S=>String(S)).map((S,T)=>G(S,o.fontSize,T===0||T===2?t:e,o,!0)||0),C=E[3],W=E[0],L=e-(E[1]+E[3]),v=t-(E[0]+E[2]);return x.some(S=>S>0)?{type:"path",d:ht({left:C,top:W,width:L,height:v},{...n,...b})}:{type:"rect",x:C,y:W,width:L,height:v}}return{parseCircle:i,parseEllipse:r,parsePath:a,parsePolygon:c,parseInset:u}}function Ro(e){let[,t="nonzero",n]=e.replace(/('|")/g,"").match(/^(nonzero|evenodd)?,?(.+)/)||[];return[t,n]}function ko(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 Rn(e){return`satori_cp-${e}`}function _o(e){return`url(#${Rn(e)})`}function Ao(e,t,n){if(t.clipPath==="none")return"";let o=Io(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,...c}=r;return _("clipPath",{id:Rn(e.id),"clip-path":e.currentClipPath,transform:`translate(${e.left}, ${e.top})`},_(a,c))}return""}function ar({left:e,top:t,width:n,height:o,path:i,matrix:r,id:a,currentClipPath:c,src:u},d,f){let p="",g=d.clipPath&&d.clipPath!=="none"?Ao({left:e,top:t,width:n,height:o,path:i,id:a,matrix:r,currentClipPath:c,src:u},d,f):"";if(d.overflow!=="hidden"&&!u)p="";else{let x=g?`satori_ocp-${a}`:Rn(a);p=_("clipPath",{id:x,"clip-path":c},_(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=ir({id:`satori_om-${a}`,left:e,top:t,width:n,height:o,matrix:r,borderOnly:!u},d);return g+p+b}var ma=e=>`satori_mi-${e}`;async function sr(e,t,n){if(!t.maskImage)return["",""];let{left:o,top:i,width:r,height:a,id:c}=e,u=t.maskImage,d=u.length;if(!d)return["",""];let f=ma(c),p="";for(let g=0;g<d;g++){let b=u[g],[x,E]=await qt({id:`${f}-${g}`,left:o,top:i,width:r,height:a},b,n,"mask");p+=E+_("rect",{x:o,y:i,width:r,height:a,fill:`url(#${x})`})}return p=_("mask",{id:f},p),[f,p]}function ha(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 c=(u,d)=>{try{if(u.endsWith("%"))return d*parseFloat(u)/100;let f=new et(u);return f.type==="length"||f.type==="number"?f.value:0}catch{return 0}};return[c(r,t),c(a,n)]}async function Zt({id:e,left:t,top:n,width:o,height:i,isInheritingTransform:r,src:a,debug:c},u,d){if(u.display==="none")return"";let f=!!a,p="rect",g="",b="",x=[],E=1,C="";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 W="";if(u.backgroundImage){let Y=[];for(let z=0;z<u.backgroundImage.length;z++){let Ge=u.backgroundImage[z],De=await qt({id:e+"_"+z,width:o,height:i,left:t,top:n},Ge,d);De&&Y.unshift(De)}for(let z of Y)x.push(`url(#${z[0]})`),b+=z[1],z[2]&&(W+=z[2])}let[L,v]=await sr({id:e,left:t,top:n,width:o,height:i},u,d);b+=v;let S=L?`url(#${L})`:u._inheritedMaskId?`url(#${u._inheritedMaskId})`:void 0,T=ht({left:t,top:n,width:o,height:i},u);T&&(p="path");let M=u._inheritedClipPathId;c&&(C=_("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:F,filter:H,mixBlendMode:j}=u,de=[H?`filter:${H}`:void 0,j?`mix-blend-mode:${j}`:void 0].filter(Y=>Y).join(";")||void 0,le=F==="text"?`url(#satori_bct-${e})`:M?`url(#${M})`:u.clipPath?_o(e):void 0,be=ar({left:t,top:n,width:o,height:i,path:T,id:e,matrix:g,currentClipPath:le,src:a},u,d),Z=x.map(Y=>_(p,{x:t,y:n,width:o,height:i,fill:Y,d:T||void 0,transform:g||void 0,"clip-path":u.transform?void 0:le,style:de,mask:u.transform?void 0:S})).join(""),fe=Eo({id:e,left:t,top:n,width:o,height:i,currentClipPathId:M,borderPath:T,borderType:p},u),pe;if(f){let Y=(u.borderLeftWidth||0)+(u.paddingLeft||0),z=(u.borderTopWidth||0)+(u.paddingTop||0),Ge=(u.borderRightWidth||0)+(u.paddingRight||0),De=(u.borderBottomWidth||0)+(u.paddingBottom||0),ie=o-Y-Ge,ye=i-z-De,V=(u.objectPosition||"center").toString(),[X,xe]=ha(V,ie,ye),ne=u.__naturalWidth||ie,me=u.__naturalHeight||ye,N,ae=ie,he=ye,Le=t+Y,ke=n+z;if(u.objectFit==="contain"){let re=ie/ne,Ie=ye/me,Se=Math.min(re,Ie);ae=ne*Se,he=me*Se,Le=t+Y+X-ae*X/ie,ke=n+z+xe-he*xe/ye,N="none"}else if(u.objectFit==="cover"){let re=ie/ne,Ie=ye/me,Se=Math.max(re,Ie);ae=ne*Se,he=me*Se,Le=t+Y+X-ae*X/ie,ke=n+z+xe-he*xe/ye,N="none"}else if(u.objectFit==="fill")N="none";else if(u.objectFit==="scale-down")if(ne&&me){let re=ie/ne,Ie=ye/me,Se=Math.min(re,Ie);if(Se>=1)ae=ne,he=me,N="none",Le=t+Y+X-ae*X/ie,ke=n+z+xe-he*xe/ye;else{let Ne=Se;ae=ne*Ne,he=me*Ne,Le=t+Y+X-ae*X/ie,ke=n+z+xe-he*xe/ye,N="none"}}else{let re=ie/ne,Ie=ye/me,Se=Math.min(re,Ie);ae=ne*Se,he=me*Se,Le=t+Y+X-ae*X/ie,ke=n+z+xe-he*xe/ye,N="none"}else N="none";u.transform&&(pe=wo({id:e,borderRadiusPath:T,borderType:p,left:t,top:n,width:o,height:i},u)),Z+=_("image",{x:Le,y:ke,width:ae,height:he,href:a,preserveAspectRatio:N,transform:g||void 0,style:de,"clip-path":u.transform?pe?`url(#${pe[1]})`:void 0:`url(#satori_cp-${e})`,mask:u.transform?void 0:L?`url(#${L})`:`url(#satori_om-${e})`})}if(fe){b+=fe[0];let Y=fe[1];Z+=Kt({left:t,top:n,width:o,height:i,props:{transform:g||void 0,"clip-path":`url(#${Y})`}},u)}let Te=fo({width:o,height:i,id:e,opacity:E,shape:_(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":le,mask:S})},u);return(b?_("defs",{},b):"")+(Te?Te[0]:"")+(pe?pe[0]:"")+be+(E!==1?`<g opacity="${E}">`:"")+(u.transform&&(le||S)?`<g${le?` clip-path="${le}"`:""}${S?` mask="${S}"`:""}>`:"")+(W||Z)+(u.transform&&(le||S)?"</g>":"")+(E!==1?"</g>":"")+(Te?Te[1]:"")+C}var Mo=String.raw,Co=Mo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Po=()=>new RegExp(Mo`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Co}(?:\u200D${Co})*`,"gu");var ga=new RegExp(Po(),"u"),ur={emoji:ga,symbol:new RegExp("\\p{Symbol}","u"),math:new RegExp("\\p{Math}","u")},lr={"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")},kn=Object.keys({...lr,...ur});function Lo(e){return kn.includes(e)}function Wo(e,t){for(let o of Object.keys(ur))if(ur[o].test(e))return[o];let n=Object.keys(lr).filter(o=>lr[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 No(e){if(e)return kn.find(t=>t.toLowerCase().startsWith(e.toLowerCase()))}async function*Qt(e,t){var ye;let n=await pt(),{id:o,inheritedStyle:i,parent:r,font:a,debug:c,locale:u,embedFont:d=!0,graphemeImages:f,canLoadAdditionalAssets:p}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!_t(e)||Tr(e.type)){let V;if(!_t(e))V=nr(String(e),t),yield(await V.next()).value;else{if(Er(e.type))throw new Error("Class component is not supported.");let xe;Pn(e.type)?xe=e.type.render:xe=e.type,V=Qt(await xe(e.props),t),yield(await V.next()).value}await V.next();let X=yield;return(await V.next(X)).value}let{type:g,props:b}=e,x=g;if(b&&Rr(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:W=u}=b||{},L=No(W),v=n.Node.create();r.insertChild(v,r.getChildCount());let[S,T]=await Kn(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.backgroundClip==="text"){let V={value:""};T._inheritedBackgroundClipTextPath=V,S._inheritedBackgroundClipTextPath=V,S.backgroundImage&&(T._inheritedBackgroundClipTextHasBackground="true",S._inheritedBackgroundClipTextHasBackground="true")}let F=kr(C),H=[],j=0,de=[];for(let V of F){let X=Qt(V,{id:o+"-"+j++,parentStyle:S,inheritedStyle:T,isInheritingTransform:!0,parent:v,font:a,embedFont:d,debug:c,graphemeImages:f,canLoadAdditionalAssets:p,locale:L,onNodeDetected:t.onNodeDetected});p?de.push(...(await X.next()).value||[]):await X.next(),H.push(X)}yield de;for(let V of H)await V.next();let[le,be]=yield,{left:Z,top:fe,width:pe,height:Te}=v.getComputedLayout();Z+=le,fe+=be;let Y="",z="",Ge="",{children:De,...ie}=b;if((ye=t.onNodeDetected)==null||ye.call(t,{left:Z,top:fe,width:pe,height:Te,type:x,props:ie,key:e.key,textContent:_t(De)?void 0:De}),x==="img"){let V=S.__src;z=await Zt({id:o,left:Z,top:fe,width:pe,height:Te,src:V,isInheritingTransform:M,debug:c},S,T)}else if(x==="svg"){let V=S.color,X=await Kr(e,V);z=await Zt({id:o,left:Z,top:fe,width:pe,height:Te,src:X,isInheritingTransform:M,debug:c},S,T)}else{let V=E==null?void 0:E.display;if(x==="div"&&C&&typeof C!="string"&&V!=="flex"&&V!=="none"&&V!=="contents")throw new Error('Expected <div> to have explicit "display: flex", "display: contents", or "display: none" if it has more than one child node.');z=await Zt({id:o,left:Z,top:fe,width:pe,height:Te,isInheritingTransform:M,debug:c},S,T)}for(let V of H)Y+=(await V.next([Z,fe])).value;return S._inheritedBackgroundClipTextPath&&(Ge+=_("clipPath",{id:`satori_bct-${o}`,"clip-path":S._inheritedClipPathId?`url(#${S._inheritedClipPathId})`:void 0},S._inheritedBackgroundClipTextPath.value)),Ge+z+Y}import en from"@shuding/opentype.js";var Oo="unknown";function ba(e){let t=[],n=[0,0],o=[0,0],i=(r,a)=>{let c=r[0];for(let u=1;u<=a;u++){let d=u/a,f=ya(r,d);t.push({from:c,to:f}),c=f}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 ya(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 xa(e,t){if(!t)return[];let n=t.strokeWidth,o=t.underlineY-n*.25,i=t.underlineY+n*2.5,r=ba(e);if(!r.length)return[];let a=i-o,c=Math.max(12,Math.ceil(a/.25)),u=a/c,d=o+u/2,f=new Set;for(let v=0;v<c;v++){let S=d+u*v,T=[];for(let M of r){let[F,H]=M.from,[j,de]=M.to;if(H===de)continue;let le=Math.min(H,de),be=Math.max(H,de);if(S<le||S>=be)continue;let Z=(S-H)/(de-H),fe=F+(j-F)*Z;T.push(fe)}if(T.length){T.sort((M,F)=>M-F);for(let M=0;M<T.length-1;M+=2){let F=Math.min(T[M],T[M+1]),H=Math.max(T[M],T[M+1]),j=Math.floor(F),de=Math.ceil(H);for(let le=j;le<de;le++)f.add(le)}}}if(!f.size)return[];let p=Array.from(f.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,W=g[0][0],L=g[g.length-1][1];for(let[v,S]of g){let T=Math.min(v,W)-C,M=Math.max(S,L)+C;E.push({x1:T,x2:M,y1:o,y2:i})}return E}function Sa(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,tn=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[,c,u]=r,[,d,f]=i[a];Sa(n,o,[c,u],[d,f])>0&&(r=i[a])}return r[0]}addFonts(t){for(let n of t){let{name:o,data:i,lang:r}=n;if(r&&!Lo(r))throw new Error(`Invalid value for props \`lang\`: "${r}". The value must be one of the following: ${kn.join(", ")}.`);let a=r??Oo,c;if(fr.has(i))c=fr.get(i);else{c=en.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0});let d=c.charToGlyphIndex;c.charToGlyphIndex=f=>{let p=d.call(c,f);return p===0&&c._trackBrokenChars&&c._trackBrokenChars.push(f),p},fr.set(i,c)}this.defaultFont||(this.defaultFont=c);let u=`${o.toLowerCase()}_${a}`;this.fonts.has(u)||this.fonts.set(u,[]),this.fonts.get(u).push([c,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 c=[];o.forEach(v=>{let S=this.get({name:v,weight:i,style:r});if(S){c.push(S);return}let T=this.get({name:v+"_unknown",weight:i,style:r});if(T){c.push(T);return}});let u=Array.from(this.fonts.keys()),d=[],f=[],p=[];for(let v of u)if(!o.includes(v))if(a){let S=wa(v);S?S===a?d.push(this.get({name:v,weight:i,style:r})):f.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=[...c,...p,...d,...S?f:[]];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 F=T.find((H,j)=>!!H.charToGlyphIndex(v)||S&&j===T.length-1);return F&&g.set(M,F),F},x=(v,S=!1)=>{var M,F;return((S?(F=(M=v.tables)==null?void 0:M.os2)==null?void 0:F.sTypoAscender:0)||v.ascender)/v.unitsPerEm*t},E=(v,S=!1)=>{var M,F;return((S?(F=(M=v.tables)==null?void 0:M.os2)==null?void 0:F.sTypoDescender:0)||v.descender)/v.unitsPerEm*t},C=(v,S=!1)=>{var T,M;if(typeof n=="string"&&n==="normal"){let F=(S?(M=(T=v.tables)==null?void 0:T.os2)==null?void 0:M.sTypoLineGap:0)||0;return x(v,S)-E(v,S)+F/v.unitsPerEm*t}else if(typeof n=="number")return t*n},W=v=>b(v,!1);return{has:v=>{if(v===`
5
+ `)return!0;let S=W(v);return S?(S._trackBrokenChars=[],S.stringToGlyphs(v),S._trackBrokenChars.length?(S._trackBrokenChars=void 0,!1):!0):!1},baseline:(v,S=typeof v>"u"?c[0]:b(v))=>{let T=x(S),M=E(S),F=T-M;return T+(C(S)-F)/2},height:(v,S=typeof v>"u"?c[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 c=i.call(t,r,...a);for(let u=0;u<c.length;u++)if(c[u].unicode===void 0){let d=o.shift(),f=n(d);if(f!==t){let p=f.charToGlyph(d),g=t.unitsPerEm/f.unitsPerEm,b=new en.Path;b.unitsPerEm=t.unitsPerEm,b.commands=p.path.commands.map(E=>{let C={...E};for(let W in C)typeof C[W]=="number"&&(C[W]*=g);return C});let x=new en.Glyph({...p,advanceWidth:p.advanceWidth*g,xMin:p.xMin*g,xMax:p.xMax*g,yMin:p.yMin*g,yMax:p.yMax*g,path:b});c[u]=x}}return c},()=>{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},c){let u=t(n),d=this.patchFontFallbackResolver(u,t);try{if(o===0)return{path:"",boxes:[]};let f=new en.Path,p=[],g={letterSpacing:a/o},b=new WeakMap;return u.forEachGlyph(n.replace(/\n/g,""),r,i,o,g,function(x,E,C,W){let L;if(!b.has(x))L=x.getPath(E,C,W,g),b.set(x,[E,C,L]);else{let[S,T,M]=b.get(x);L=new en.Path,L.commands=M.commands.map(F=>{let H={...F};for(let j in H)typeof H[j]=="number"&&((j==="x"||j==="x1"||j==="x2")&&(H[j]+=E-S),(j==="y"||j==="y1"||j==="y2")&&(H[j]+=C-T));return H})}let v=c?xa(L.commands,c):[];v.length&&p.push(...v),f.extend(L)}),{path:f.toPathData(1),boxes:p}}finally{d()}}};function wa(e){let t=e.split("_"),n=t[t.length-1];return n===Oo?void 0:n}function cr({width:e,height:t,content:n}){return _("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}var dr=new WeakMap;async function Fo(e,t){let n=await pt();if(!n||!n.Node)throw new Error("Satori is not initialized: expect `yoga` to be loaded, got "+n);t.fonts=t.fonts||[];let o;dr.has(t.fonts)?o=dr.get(t.fonts):dr.set(t.fonts,o=new tn(t.fonts));let i="width"in t?t.width:void 0,r="height"in t?t.height:void 0,a=va(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 c={...t.graphemeImages},u=new Set;ot.clear(),jt.clear(),await qr(e);let d=Qt(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:c,canLoadAdditionalAssets:!!t.loadAdditionalAsset,onNodeDetected:t.onNodeDetected}),f=(await d.next()).value;if(t.loadAdditionalAsset&&f.length){let x=Ea(f),E=[],C={};await Promise.all(Object.entries(x).flatMap(([W,L])=>L.map(v=>{let S=`${W}_${v}`;return u.has(S)?null:(u.add(S),t.loadAdditionalAsset(W,v).then(T=>{typeof T=="string"?C[v]=T:T&&(Array.isArray(T)?E.push(...T):E.push(T))}))}))),o.addFonts(E),Object.assign(c,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(),cr({width:g,height:b,content:p})}function va(e,t){if(t){let n=e.Config.create();return n.setPointScaleFactor(t),e.Node.createWithConfig(n)}else return e.Node.create()}function Ea(e){let t={},n={};for(let{word:o,locale:i}of e){let r=Wo(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(...Bo(Me(n[o],"grapheme"))):(t[o][0]=t[o][0]||"",t[o][0]+=Bo(Me(n[o],"grapheme",o==="unknown"?void 0:o)).join(""))}),t}function Bo(e){return Array.from(new Set(e))}export{Fo as default,di as init};
6
+ //# sourceMappingURL=standalone.js.map
File without changes