@embedreach/components 0.1.8 → 0.1.20

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,132 @@
1
+ (function(re,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react/jsx-runtime"),require("@tanstack/react-query"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@tanstack/react-query","react","react-router-dom"],A):(re=typeof globalThis<"u"?globalThis:re||self,A(re.ReachProvider={},re.jsxRuntime,re.ReactQuery,re.React,re.ReactRouterDOM))})(this,function(re,A,Se,P,Fl){"use strict";var Qg=Object.defineProperty;var ey=(re,A,Se)=>A in re?Qg(re,A,{enumerable:!0,configurable:!0,writable:!0,value:Se}):re[A]=Se;var Rl=(re,A,Se)=>ey(re,typeof A!="symbol"?A+"":A,Se);function jl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Pn=jl(P);function Le(e){function t(n,r){Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.message=n,this.code=r}return t.prototype=new Error,t.prototype.name=e,t.prototype.constructor=t,t}const Nl=Le("LaunchDarklyUnexpectedResponseError"),Ul=Le("LaunchDarklyInvalidEnvironmentIdError"),Bl=Le("LaunchDarklyInvalidUserError"),_l=Le("LaunchDarklyInvalidEventKeyError"),$l=Le("LaunchDarklyInvalidArgumentError"),zl=Le("LaunchDarklyFlagFetchError");for(var X={LDUnexpectedResponseError:Nl,LDInvalidEnvironmentIdError:Ul,LDInvalidUserError:Bl,LDInvalidEventKeyError:_l,LDInvalidArgumentError:$l,LDInvalidDataError:Le("LaunchDarklyInvalidDataError"),LDFlagFetchError:zl,LDTimeoutError:Le("LaunchDarklyTimeoutError"),isHttpErrorRecoverable:function(e){return!(e>=400&&e<500)||e===400||e===408||e===429}},Kl=function(e){var t=So(e),n=t[0],r=t[1];return 3*(n+r)/4-r},Hl=function(e){var t,n,r=So(e),o=r[0],i=r[1],s=new Wl(function(c,u,d){return 3*(u+d)/4-d}(0,o,i)),a=0,l=i>0?o-4:o;for(n=0;n<l;n+=4)t=ve[e.charCodeAt(n)]<<18|ve[e.charCodeAt(n+1)]<<12|ve[e.charCodeAt(n+2)]<<6|ve[e.charCodeAt(n+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return i===2&&(t=ve[e.charCodeAt(n)]<<2|ve[e.charCodeAt(n+1)]>>4,s[a++]=255&t),i===1&&(t=ve[e.charCodeAt(n)]<<10|ve[e.charCodeAt(n+1)]<<4|ve[e.charCodeAt(n+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},Gl=function(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(ql(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(Ee[t>>2]+Ee[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(Ee[t>>10]+Ee[t>>4&63]+Ee[t<<2&63]+"=")),o.join("")},Ee=[],ve=[],Wl=typeof Uint8Array<"u"?Uint8Array:Array,To="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=0;Ye<64;++Ye)Ee[Ye]=To[Ye],ve[To.charCodeAt(Ye)]=Ye;function So(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return n===-1&&(n=t),[n,n===t?0:4-n%4]}function ql(e,t,n){for(var r,o,i=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(Ee[(o=r)>>18&63]+Ee[o>>12&63]+Ee[o>>6&63]+Ee[63&o]);return i.join("")}ve[45]=62,ve[95]=63;var Yl={byteLength:Kl,toByteArray:Hl,fromByteArray:Gl},Eo=Array.isArray,Po=Object.keys,Xl=Object.prototype.hasOwnProperty,Zl=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){var r,o,i,s=Eo(t),a=Eo(n);if(s&&a){if((o=t.length)!=n.length)return!1;for(r=o;r--!=0;)if(!e(t[r],n[r]))return!1;return!0}if(s!=a)return!1;var l=t instanceof Date,c=n instanceof Date;if(l!=c)return!1;if(l&&c)return t.getTime()==n.getTime();var u=t instanceof RegExp,d=n instanceof RegExp;if(u!=d)return!1;if(u&&d)return t.toString()==n.toString();var f=Po(t);if((o=f.length)!==Po(n).length)return!1;for(r=o;r--!=0;)if(!Xl.call(n,f[r]))return!1;for(r=o;r--!=0;)if(!e(t[i=f[r]],n[i]))return!1;return!0}return t!=t&&n!=n};const Jl=["key","ip","country","email","firstName","lastName","avatar","name"];function Co(e){const t=unescape(encodeURIComponent(e));return Yl.fromByteArray(function(n){const r=[];for(let o=0;o<n.length;o++)r.push(n.charCodeAt(o));return r}(t))}function Cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var An,F={appendUrlPath:function(e,t){return(e.endsWith("/")?e.substring(0,e.length-1):e)+(t.startsWith("/")?"":"/")+t},base64URLEncode:function(e){return Co(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},btoa:Co,clone:function(e){return JSON.parse(JSON.stringify(e))},deepEquals:function(e,t){return Zl(e,t)},extend:function(...e){return e.reduce((t,n)=>({...t,...n}),{})},getLDUserAgentString:function(e){const t=e.version||"?";return e.userAgent+"/"+t},objectHasOwnProperty:Cn,onNextTick:function(e){setTimeout(e,0)},sanitizeContext:function(e){if(!e)return e;let t;return e.kind!==null&&e.kind!==void 0||Jl.forEach(n=>{const r=e[n];r!==void 0&&typeof r!="string"&&(t=t||{...e},t[n]=String(r))}),t||e},transformValuesToVersionedValues:function(e){const t={};for(const n in e)Cn(e,n)&&(t[n]={value:e[n],version:0});return t},transformVersionedValuesToValues:function(e){const t={};for(const n in e)Cn(e,n)&&(t[n]=e[n].value);return t},wrapPromiseCallback:function(e,t){const n=e.then(r=>(t&&setTimeout(()=>{t(null,r)},0),r),r=>{if(!t)return Promise.reject(r);setTimeout(()=>{t(r,null)},0)});return t?void 0:n}},Ql=new Uint8Array(16);function Ao(){if(!An&&!(An=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return An(Ql)}var ec=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Nt(e){return typeof e=="string"&&ec.test(e)}for(var ko,kn,oe=[],Dn=0;Dn<256;++Dn)oe.push((Dn+256).toString(16).substr(1));function Ut(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(oe[e[t+0]]+oe[e[t+1]]+oe[e[t+2]]+oe[e[t+3]]+"-"+oe[e[t+4]]+oe[e[t+5]]+"-"+oe[e[t+6]]+oe[e[t+7]]+"-"+oe[e[t+8]]+oe[e[t+9]]+"-"+oe[e[t+10]]+oe[e[t+11]]+oe[e[t+12]]+oe[e[t+13]]+oe[e[t+14]]+oe[e[t+15]]).toLowerCase();if(!Nt(n))throw TypeError("Stringified UUID is invalid");return n}var Mn=0,Vn=0;function Do(e){if(!Nt(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function Mo(e,t,n){function r(o,i,s,a){if(typeof o=="string"&&(o=function(u){u=unescape(encodeURIComponent(u));for(var d=[],f=0;f<u.length;++f)d.push(u.charCodeAt(f));return d}(o)),typeof i=="string"&&(i=Do(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+o.length);if(l.set(i),l.set(o,i.length),(l=n(l))[6]=15&l[6]|t,l[8]=63&l[8]|128,s){a=a||0;for(var c=0;c<16;++c)s[a+c]=l[c];return s}return Ut(l)}try{r.name=e}catch{}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function Vo(e){return 14+(e+64>>>9<<4)+1}function Oe(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Bt(e,t,n,r,o,i){return Oe((s=Oe(Oe(t,e),Oe(r,i)))<<(a=o)|s>>>32-a,n);var s,a}function ie(e,t,n,r,o,i,s){return Bt(t&n|~t&r,e,t,o,i,s)}function ae(e,t,n,r,o,i,s){return Bt(t&r|n&~r,e,t,o,i,s)}function le(e,t,n,r,o,i,s){return Bt(t^n^r,e,t,o,i,s)}function ce(e,t,n,r,o,i,s){return Bt(n^(t|~r),e,t,o,i,s)}var tc=Mo("v3",48,function(e){if(typeof e=="string"){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(r){for(var o=[],i=32*r.length,s="0123456789abcdef",a=0;a<i;a+=8){var l=r[a>>5]>>>a%32&255,c=parseInt(s.charAt(l>>>4&15)+s.charAt(15&l),16);o.push(c)}return o}(function(r,o){r[o>>5]|=128<<o%32,r[Vo(o)-1]=o;for(var i=1732584193,s=-271733879,a=-1732584194,l=271733878,c=0;c<r.length;c+=16){var u=i,d=s,f=a,h=l;i=ie(i,s,a,l,r[c],7,-680876936),l=ie(l,i,s,a,r[c+1],12,-389564586),a=ie(a,l,i,s,r[c+2],17,606105819),s=ie(s,a,l,i,r[c+3],22,-1044525330),i=ie(i,s,a,l,r[c+4],7,-176418897),l=ie(l,i,s,a,r[c+5],12,1200080426),a=ie(a,l,i,s,r[c+6],17,-1473231341),s=ie(s,a,l,i,r[c+7],22,-45705983),i=ie(i,s,a,l,r[c+8],7,1770035416),l=ie(l,i,s,a,r[c+9],12,-1958414417),a=ie(a,l,i,s,r[c+10],17,-42063),s=ie(s,a,l,i,r[c+11],22,-1990404162),i=ie(i,s,a,l,r[c+12],7,1804603682),l=ie(l,i,s,a,r[c+13],12,-40341101),a=ie(a,l,i,s,r[c+14],17,-1502002290),i=ae(i,s=ie(s,a,l,i,r[c+15],22,1236535329),a,l,r[c+1],5,-165796510),l=ae(l,i,s,a,r[c+6],9,-1069501632),a=ae(a,l,i,s,r[c+11],14,643717713),s=ae(s,a,l,i,r[c],20,-373897302),i=ae(i,s,a,l,r[c+5],5,-701558691),l=ae(l,i,s,a,r[c+10],9,38016083),a=ae(a,l,i,s,r[c+15],14,-660478335),s=ae(s,a,l,i,r[c+4],20,-405537848),i=ae(i,s,a,l,r[c+9],5,568446438),l=ae(l,i,s,a,r[c+14],9,-1019803690),a=ae(a,l,i,s,r[c+3],14,-187363961),s=ae(s,a,l,i,r[c+8],20,1163531501),i=ae(i,s,a,l,r[c+13],5,-1444681467),l=ae(l,i,s,a,r[c+2],9,-51403784),a=ae(a,l,i,s,r[c+7],14,1735328473),i=le(i,s=ae(s,a,l,i,r[c+12],20,-1926607734),a,l,r[c+5],4,-378558),l=le(l,i,s,a,r[c+8],11,-2022574463),a=le(a,l,i,s,r[c+11],16,1839030562),s=le(s,a,l,i,r[c+14],23,-35309556),i=le(i,s,a,l,r[c+1],4,-1530992060),l=le(l,i,s,a,r[c+4],11,1272893353),a=le(a,l,i,s,r[c+7],16,-155497632),s=le(s,a,l,i,r[c+10],23,-1094730640),i=le(i,s,a,l,r[c+13],4,681279174),l=le(l,i,s,a,r[c],11,-358537222),a=le(a,l,i,s,r[c+3],16,-722521979),s=le(s,a,l,i,r[c+6],23,76029189),i=le(i,s,a,l,r[c+9],4,-640364487),l=le(l,i,s,a,r[c+12],11,-421815835),a=le(a,l,i,s,r[c+15],16,530742520),i=ce(i,s=le(s,a,l,i,r[c+2],23,-995338651),a,l,r[c],6,-198630844),l=ce(l,i,s,a,r[c+7],10,1126891415),a=ce(a,l,i,s,r[c+14],15,-1416354905),s=ce(s,a,l,i,r[c+5],21,-57434055),i=ce(i,s,a,l,r[c+12],6,1700485571),l=ce(l,i,s,a,r[c+3],10,-1894986606),a=ce(a,l,i,s,r[c+10],15,-1051523),s=ce(s,a,l,i,r[c+1],21,-2054922799),i=ce(i,s,a,l,r[c+8],6,1873313359),l=ce(l,i,s,a,r[c+15],10,-30611744),a=ce(a,l,i,s,r[c+6],15,-1560198380),s=ce(s,a,l,i,r[c+13],21,1309151649),i=ce(i,s,a,l,r[c+4],6,-145523070),l=ce(l,i,s,a,r[c+11],10,-1120210379),a=ce(a,l,i,s,r[c+2],15,718787259),s=ce(s,a,l,i,r[c+9],21,-343485551),i=Oe(i,u),s=Oe(s,d),a=Oe(a,f),l=Oe(l,h)}return[i,s,a,l]}(function(r){if(r.length===0)return[];for(var o=8*r.length,i=new Uint32Array(Vo(o)),s=0;s<o;s+=8)i[s>>5]|=(255&r[s/8])<<s%32;return i}(e),8*e.length))}),nc=tc;function rc(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function Ln(e,t){return e<<t|e>>>32-t}var oc=Mo("v5",80,function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var i=e.length/4+2,s=Math.ceil(i/16),a=new Array(s),l=0;l<s;++l){for(var c=new Uint32Array(16),u=0;u<16;++u)c[u]=e[64*l+4*u]<<24|e[64*l+4*u+1]<<16|e[64*l+4*u+2]<<8|e[64*l+4*u+3];a[l]=c}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<s;++d){for(var f=new Uint32Array(80),h=0;h<16;++h)f[h]=a[d][h];for(var p=16;p<80;++p)f[p]=Ln(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var y=n[0],v=n[1],m=n[2],b=n[3],x=n[4],S=0;S<80;++S){var g=Math.floor(S/20),k=Ln(y,5)+rc(g,v,m,b)+x+t[g]+f[S]>>>0;x=b,b=m,m=Ln(v,30)>>>0,v=y,y=k}n[0]=n[0]+y>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+x>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}),sc=oc,On=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||ko,s=e.clockseq!==void 0?e.clockseq:kn;if(i==null||s==null){var a=e.random||(e.rng||Ao)();i==null&&(i=ko=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),s==null&&(s=kn=16383&(a[6]<<8|a[7]))}var l=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:Vn+1,u=l-Mn+(c-Vn)/1e4;if(u<0&&e.clockseq===void 0&&(s=s+1&16383),(u<0||l>Mn)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Mn=l,Vn=c,kn=s;var d=(1e4*(268435455&(l+=122192928e5))+c)%4294967296;o[r++]=d>>>24&255,o[r++]=d>>>16&255,o[r++]=d>>>8&255,o[r++]=255&d;var f=l/4294967296*1e4&268435455;o[r++]=f>>>8&255,o[r++]=255&f,o[r++]=f>>>24&15|16,o[r++]=f>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var h=0;h<6;++h)o[r+h]=i[h];return t||Ut(o)},v3:nc,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||Ao)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ut(r)},v5:sc,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Nt(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Nt,stringify:Ut,parse:Do});const ft=["debug","info","warn","error","none"];var In={commonBasicLogger:function(e,t){if(e&&e.destination&&typeof e.destination!="function")throw new Error("destination for basicLogger was set to a non-function");function n(c){return function(u){console&&console[c]&&console[c].call(console,u)}}const r=e&&e.destination?[e.destination,e.destination,e.destination,e.destination]:[n("log"),n("info"),n("warn"),n("error")],o=!(!e||!e.destination),i=e&&e.prefix!==void 0&&e.prefix!==null?e.prefix:"[LaunchDarkly] ";let s=1;if(e&&e.level)for(let c=0;c<ft.length;c++)ft[c]===e.level&&(s=c);function a(c,u,d){if(d.length<1)return;let f;const h=o?u+": "+i:i;if(d.length!==1&&t){const p=[...d];p[0]=h+p[0],f=t(...p)}else f=h+d[0];try{r[c](f)}catch(p){console&&console.log&&console.log("[LaunchDarkly] Configured logger's "+u+" method threw an exception: "+p)}}const l={};for(let c=0;c<ft.length;c++){const u=ft[c];if(u!=="none")if(c<s)l[u]=()=>{};else{const d=c;l[u]=function(){a(d,u,arguments)}}}return l},validateLogger:function(e){ft.forEach(t=>{if(t!=="none"&&(!e[t]||typeof e[t]!="function"))throw new Error("Provided logger instance must support logger."+t+"(...) method")})}};function _t(e){return e&&e.message?e.message:typeof e=="string"||e instanceof String?e:JSON.stringify(e)}const Xe=" Please see https://docs.launchdarkly.com/sdk/client-side/javascript#initialize-the-client for instructions on SDK initialization.";var I={bootstrapInvalid:function(){return"LaunchDarkly bootstrap data is not available because the back end could not read the flags."},bootstrapOldFormat:function(){return"LaunchDarkly client was initialized with bootstrap data that did not include flag metadata. Events may not be sent correctly."+Xe},clientInitialized:function(){return"LaunchDarkly client initialized"},clientNotReady:function(){return"LaunchDarkly client is not ready"},debugEnqueueingEvent:function(e){return'enqueueing "'+e+'" event'},debugPostingDiagnosticEvent:function(e){return"sending diagnostic event ("+e.kind+")"},debugPostingEvents:function(e){return"sending "+e+" events"},debugStreamDelete:function(e){return'received streaming deletion for flag "'+e+'"'},debugStreamDeleteIgnored:function(e){return'received streaming deletion for flag "'+e+'" but ignored due to version check'},debugStreamPatch:function(e){return'received streaming update for flag "'+e+'"'},debugStreamPatchIgnored:function(e){return'received streaming update for flag "'+e+'" but ignored due to version check'},debugStreamPing:function(){return"received ping message from stream"},debugPolling:function(e){return"polling for feature flags at "+e},debugStreamPut:function(){return"received streaming update for all flags"},deprecated:function(e,t){return t?'"'+e+'" is deprecated, please use "'+t+'"':'"'+e+'" is deprecated'},environmentNotFound:function(){return"Environment not found. Double check that you specified a valid environment/client-side ID."+Xe},environmentNotSpecified:function(){return"No environment/client-side ID was specified."+Xe},errorFetchingFlags:function(e){return"Error fetching flag settings: "+_t(e)},eventCapacityExceeded:function(){return"Exceeded event queue capacity. Increase capacity to avoid dropping events."},eventWithoutContext:function(){return"Be sure to call `identify` in the LaunchDarkly client: https://docs.launchdarkly.com/sdk/features/identify#javascript"},httpErrorMessage:function(e,t,n){return"Received error "+e+(e===401?" (invalid SDK key)":"")+" for "+t+" - "+(X.isHttpErrorRecoverable(e)?n:"giving up permanently")},httpUnavailable:function(){return"Cannot make HTTP requests in this environment."+Xe},identifyDisabled:function(){return"identify() has no effect here; it must be called on the main client instance"},inspectorMethodError:(e,t)=>`an inspector: "${t}" of type: "${e}" generated an exception`,invalidContentType:function(e){return'Expected application/json content type but got "'+e+'"'},invalidData:function(){return"Invalid data received from LaunchDarkly; connection may have been interrupted"},invalidInspector:(e,t)=>`an inspector: "${t}" of an invalid type (${e}) was configured`,invalidKey:function(){return"Event key must be a string"},invalidMetricValue:e=>`The track function was called with a non-numeric "metricValue" (${e}), only numeric metric values are supported.`,invalidContext:function(){return"Invalid context specified."+Xe},invalidTagValue:e=>`Config option "${e}" must only contain letters, numbers, ., _ or -.`,localStorageUnavailable:function(e){return"local storage is unavailable: "+_t(e)},networkError:e=>"network error"+(e?" ("+e+")":""),optionBelowMinimum:(e,t,n)=>'Config option "'+e+'" was set to '+t+", changing to minimum value of "+n,streamClosing:function(){return"Closing stream connection"},streamConnecting:function(e){return"Opening stream connection to "+e},streamError:function(e,t){return"Error on stream connection: "+_t(e)+", will continue retrying after "+t+" milliseconds."},tagValueTooLong:e=>`Value of "${e}" was longer than 64 characters and was discarded.`,unknownCustomEventKey:function(e){return'Custom event "'+e+'" does not exist'},unknownOption:e=>'Ignoring unknown config option "'+e+'"',contextNotSpecified:function(){return"No context specified."+Xe},unrecoverableStreamError:e=>`Error on stream connection ${_t(e)}, giving up permanently`,wrongOptionType:(e,t,n)=>'Config option "'+e+'" should be of type '+t+", got "+n+", using default value",wrongOptionTypeBoolean:(e,t)=>'Config option "'+e+'" should be a boolean, got '+t+", converting to boolean"};const{validateLogger:ic}=In,Lo={baseUrl:{default:"https://app.launchdarkly.com"},streamUrl:{default:"https://clientstream.launchdarkly.com"},eventsUrl:{default:"https://events.launchdarkly.com"},sendEvents:{default:!0},streaming:{type:"boolean"},sendLDHeaders:{default:!0},requestHeaderTransform:{type:"function"},sendEventsOnlyForVariation:{default:!1},useReport:{default:!1},evaluationReasons:{default:!1},eventCapacity:{default:100,minimum:1},flushInterval:{default:2e3,minimum:2e3},samplingInterval:{default:0,minimum:0},streamReconnectDelay:{default:1e3,minimum:0},allAttributesPrivate:{default:!1},privateAttributes:{default:[]},bootstrap:{type:"string|object"},diagnosticRecordingInterval:{default:9e5,minimum:2e3},diagnosticOptOut:{default:!1},wrapperName:{type:"string"},wrapperVersion:{type:"string"},stateProvider:{type:"object"},application:{validator:function(e,t,n){const r={};return t.id&&(r.id=Oo(`${e}.id`,t.id,n)),t.version&&(r.version=Oo(`${e}.version`,t.version,n)),r}},inspectors:{default:[]}},ac=/^(\w|\.|-)+$/;function Rn(e){return e&&e.replace(/\/+$/,"")}function Oo(e,t,n){if(typeof t=="string"&&t.match(ac)){if(!(t.length>64))return t;n.warn(I.tagValueTooLong(e))}else n.warn(I.invalidTagValue(e))}var Fn={baseOptionDefs:Lo,validate:function(e,t,n,r){const o=F.extend({logger:{default:r}},Lo,n),i={};function s(l){F.onNextTick(()=>{t&&t.maybeReportError(new X.LDInvalidArgumentError(l))})}let a=F.extend({},e||{});return function(l){const c=l;Object.keys(i).forEach(u=>{if(c[u]!==void 0){const d=i[u];r&&r.warn(I.deprecated(u,d)),d&&(c[d]===void 0&&(c[d]=c[u]),delete c[u])}})}(a),a=function(l){const c=F.extend({},l);return Object.keys(o).forEach(u=>{c[u]!==void 0&&c[u]!==null||(c[u]=o[u]&&o[u].default)}),c}(a),a=function(l){const c=F.extend({},l),u=d=>{if(d===null)return"any";if(d===void 0)return;if(Array.isArray(d))return"array";const f=typeof d;return f==="boolean"||f==="string"||f==="number"||f==="function"?f:"object"};return Object.keys(l).forEach(d=>{const f=l[d];if(f!=null){const h=o[d];if(h===void 0)s(I.unknownOption(d));else{const p=h.type||u(h.default),y=h.validator;if(y){const v=y(d,l[d],r);v!==void 0?c[d]=v:delete c[d]}else if(p!=="any"){const v=p.split("|"),m=u(f);v.indexOf(m)<0?p==="boolean"?(c[d]=!!f,s(I.wrongOptionTypeBoolean(d,m))):(s(I.wrongOptionType(d,p,m)),c[d]=h.default):m==="number"&&h.minimum!==void 0&&f<h.minimum&&(s(I.optionBelowMinimum(d,f,h.minimum)),c[d]=h.minimum)}}}}),c.baseUrl=Rn(c.baseUrl),c.streamUrl=Rn(c.streamUrl),c.eventsUrl=Rn(c.eventsUrl),c}(a),ic(a.logger),a},getTags:function(e){const t={};return e&&(e.application&&e.application.id!==void 0&&e.application.id!==null&&(t["application-id"]=[e.application.id]),e.application&&e.application.version!==void 0&&e.application.id!==null&&(t["application-version"]=[e.application.version])),t}};const{getLDUserAgentString:lc}=F;var jn={getLDHeaders:function(e,t){if(t&&!t.sendLDHeaders)return{};const n={};n[e.userAgentHeaderName||"User-Agent"]=lc(e),t&&t.wrapperName&&(n["X-LaunchDarkly-Wrapper"]=t.wrapperVersion?t.wrapperName+"/"+t.wrapperVersion:t.wrapperName);const r=Fn.getTags(t),o=Object.keys(r);return o.length&&(n["x-launchdarkly-tags"]=o.sort().map(i=>Array.isArray(r[i])?r[i].sort().map(s=>`${i}/${s}`):[`${i}/${r[i]}`]).reduce((i,s)=>i.concat(s),[]).join(" ")),n},transformHeaders:function(e,t){return t&&t.requestHeaderTransform?t.requestHeaderTransform({...e}):e}};const{v1:cc}=On,{getLDHeaders:uc,transformHeaders:dc}=jn;var Io=function(e,t,n){const r=F.extend({"Content-Type":"application/json"},uc(e,n)),o={};return o.sendEvents=(i,s,a)=>{if(!e.httpRequest)return Promise.resolve();const l=JSON.stringify(i),c=a?null:cc();return function u(d){const f=a?r:F.extend({},r,{"X-LaunchDarkly-Event-Schema":"4","X-LaunchDarkly-Payload-ID":c});return e.httpRequest("POST",s,dc(f,n),l).promise.then(h=>{if(h)return h.status>=400&&X.isHttpErrorRecoverable(h.status)&&d?u(!1):function(p){const y={status:p.status},v=p.header("date");if(v){const m=Date.parse(v);m&&(y.serverTime=m)}return y}(h)}).catch(()=>d?u(!1):Promise.reject())}(!0).catch(()=>{})},o};const{commonBasicLogger:fc}=In;function Ro(e){return typeof e=="string"&&e!=="kind"&&e.match(/^(\w|\.|-)+$/)}function Fo(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}var $t={checkContext:function(e,t){if(e){if(t&&(e.kind===void 0||e.kind===null))return e.key!==void 0&&e.key!==null;const n=e.key,r=e.kind===void 0?"user":e.kind,o=Ro(r),i=r==="multi"||n!=null&&n!=="";if(r==="multi"){const s=Object.keys(e).filter(a=>a!=="kind");return i&&s.every(a=>Ro(a))&&s.every(a=>{const l=e[a].key;return l!=null&&l!==""})}return i&&o}return!1},getContextKeys:function(e,t=fc()){if(!e)return;const n={},{kind:r,key:o}=e;switch(r){case void 0:n.user=`${o}`;break;case"multi":Object.entries(e).filter(([i])=>i!=="kind").forEach(([i,s])=>{s&&s.key&&(n[i]=s.key)});break;case null:t.warn(`null is not a valid context kind: ${e}`);break;case"":t.warn(`'' is not a valid context kind: ${e}`);break;default:n[r]=`${o}`}return n},getContextKinds:function(e){return e?e.kind===null||e.kind===void 0?["user"]:e.kind!=="multi"?[e.kind]:Object.keys(e).filter(t=>t!=="kind"):[]},getCanonicalKey:function(e){if(e){if((e.kind===void 0||e.kind===null||e.kind==="user")&&e.key)return e.key;if(e.kind!=="multi"&&e.key)return`${e.kind}:${Fo(e.key)}`;if(e.kind==="multi")return Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${Fo(e[t].key)}`).join(":")}}};const{getContextKinds:hc}=$t;var pc=function(){const e={};let t=0,n=0,r={},o={};return e.summarizeEvent=i=>{if(i.kind==="feature"){const s=i.key+":"+(i.variation!==null&&i.variation!==void 0?i.variation:"")+":"+(i.version!==null&&i.version!==void 0?i.version:""),a=r[s];let l=o[i.key];l||(l=new Set,o[i.key]=l),function(c){return c.context?hc(c.context):c.contextKeys?Object.keys(c.contextKeys):[]}(i).forEach(c=>l.add(c)),a?a.count=a.count+1:r[s]={count:1,key:i.key,version:i.version,variation:i.variation,value:i.value,default:i.default},(t===0||i.creationDate<t)&&(t=i.creationDate),i.creationDate>n&&(n=i.creationDate)}},e.getSummary=()=>{const i={};let s=!0;for(const a of Object.values(r)){let l=i[a.key];l||(l={default:a.default,counters:[],contextKinds:[...o[a.key]]},i[a.key]=l);const c={value:a.value,count:a.count};a.variation!==void 0&&a.variation!==null&&(c.variation=a.variation),a.version!==void 0&&a.version!==null?c.version=a.version:c.unknown=!0,l.counters.push(c),s=!1}return s?null:{startDate:t,endDate:n,features:i}},e.clearSummary=()=>{t=0,n=0,r={},o={}},e};function jo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function No(e){return(e.startsWith("/")?e.substring(1):e).split("/").map(t=>t.indexOf("~")>=0?t.replace(/~1/g,"/").replace(/~0/g,"~"):t)}function Uo(e){return!e.startsWith("/")}function Bo(e,t){const n=Uo(e),r=Uo(t);if(n&&r)return e===t;if(n){const o=No(t);return o.length===1&&e===o[0]}if(r){const o=No(e);return o.length===1&&t===o[0]}return e===t}function _o(e){return`/${jo(e)}`}var Nn={cloneExcluding:function(e,t){const n=[],r={},o=[];for(n.push(...Object.keys(e).map(i=>({key:i,ptr:_o(i),source:e,parent:r,visited:[e]})));n.length;){const i=n.pop();if(t.some(s=>Bo(s,i.ptr)))o.push(i.ptr);else{const s=i.source[i.key];if(s===null)i.parent[i.key]=s;else if(Array.isArray(s))i.parent[i.key]=[...s];else if(typeof s=="object"){if(i.visited.includes(s))continue;i.parent[i.key]={},n.push(...Object.keys(s).map(a=>{return{key:a,ptr:(l=i.ptr,c=jo(a),`${l}/${c}`),source:s,parent:i.parent[i.key],visited:[...i.visited,s]};var l,c}))}else i.parent[i.key]=s}}return{cloned:r,excluded:o.sort()}},compare:Bo,literalToReference:_o},mc=function(e){const t={},n=e.allAttributesPrivate,r=e.privateAttributes||[],o=["key","kind","_meta","anonymous"],i=["name","ip","firstName","lastName","email","avatar","country"],s=(a,l)=>{if(typeof a!="object"||a===null||Array.isArray(a))return;const{cloned:c,excluded:u}=Nn.cloneExcluding(a,((d,f)=>(n||f&&d.anonymous?Object.keys(d):[...r,...d._meta&&d._meta.privateAttributes||[]]).filter(h=>!o.some(p=>Nn.compare(h,p))))(a,l));return c.key=String(c.key),u.length&&(c._meta||(c._meta={}),c._meta.redactedAttributes=u),c._meta&&(delete c._meta.privateAttributes,Object.keys(c._meta).length===0&&delete c._meta),c.anonymous!==void 0&&(c.anonymous=!!c.anonymous),c};return t.filter=(a,l=!1)=>a.kind===void 0||a.kind===null?s((c=>{const u={...c.custom||{},kind:"user",key:c.key};c.anonymous!==void 0&&(u.anonymous=!!c.anonymous);for(const d of i)delete u[d],c[d]!==void 0&&c[d]!==null&&(u[d]=String(c[d]));return c.privateAttributeNames!==void 0&&c.privateAttributeNames!==null&&(u._meta=u._meta||{},u._meta.privateAttributes=c.privateAttributeNames.map(d=>d.startsWith("/")?Nn.literalToReference(d):d)),u})(a),l):a.kind==="multi"?((c,u)=>{const d={kind:c.kind},f=Object.keys(c);for(const h of f)if(h!=="kind"){const p=s(c[h],u);p&&(d[h]=p)}return d})(a,l):s(a,l),t};const{getContextKeys:gc}=$t;var yc=function(e,t,n,r=null,o=null,i=null){const s={},a=i||Io(e,n,t),l=F.appendUrlPath(t.eventsUrl,"/events/bulk/"+n),c=pc(),u=mc(t),d=t.samplingInterval,f=t.eventCapacity,h=t.flushInterval,p=t.logger;let y,v=[],m=0,b=!1,x=!1;function S(){return d===0||Math.floor(Math.random()*d)===0}function g(D){const M=F.extend({},D);return D.kind==="identify"?M.context=u.filter(D.context):D.kind==="feature"?M.context=u.filter(D.context,!0):(M.contextKeys=gc(D.context,p),delete M.context),D.kind==="feature"&&(delete M.trackEvents,delete M.debugEventsUntilDate),M}function k(D){v.length<f?(v.push(D),x=!1):(x||(x=!0,p.warn(I.eventCapacityExceeded())),r&&r.incrementDroppedEvents())}return s.enqueue=function(D){if(b)return;let M=!1,C=!1;var L;if(c.summarizeEvent(D),D.kind==="feature"?S()&&(M=!!D.trackEvents,C=!!(L=D).debugEventsUntilDate&&L.debugEventsUntilDate>m&&L.debugEventsUntilDate>new Date().getTime()):M=S(),M&&k(g(D)),C){const N=F.extend({},D,{kind:"debug"});N.context=u.filter(N.context),delete N.trackEvents,delete N.debugEventsUntilDate,k(N)}},s.flush=function(){if(b)return Promise.resolve();const D=v,M=c.getSummary();return c.clearSummary(),M&&(M.kind="summary",D.push(M)),r&&r.setEventsInLastBatch(D.length),D.length===0?Promise.resolve():(v=[],p.debug(I.debugPostingEvents(D.length)),a.sendEvents(D,l).then(C=>{C&&(C.serverTime&&(m=C.serverTime),X.isHttpErrorRecoverable(C.status)||(b=!0),C.status>=400&&F.onNextTick(()=>{o.maybeReportError(new X.LDUnexpectedResponseError(I.httpErrorMessage(C.status,"event posting","some events were dropped")))}))}))},s.start=function(){const D=()=>{s.flush(),y=setTimeout(D,h)};y=setTimeout(D,h)},s.stop=function(){clearTimeout(y)},s},vc=function(e){const t={},n={};return t.on=function(r,o,i){n[r]=n[r]||[],n[r]=n[r].concat({handler:o,context:i})},t.off=function(r,o,i){if(n[r])for(let s=0;s<n[r].length;s++)n[r][s].handler===o&&n[r][s].context===i&&(n[r]=n[r].slice(0,s).concat(n[r].slice(s+1)))},t.emit=function(r){if(!n[r])return;const o=n[r].slice(0);for(let i=0;i<o.length;i++)o[i].handler.apply(o[i].context,Array.prototype.slice.call(arguments,1))},t.getEvents=function(){return Object.keys(n)},t.getEventListenerCount=function(r){return n[r]?n[r].length:0},t.maybeReportError=function(r){r&&(n.error?this.emit("error",r):(e||console).error(r.message))},t};const zt="ready",Un="initialized",Bn="failed";var bc=function(e){let t=!1,n=!1,r=null,o=null;const i=new Promise(s=>{const a=()=>{e.off(zt,a),s()};e.on(zt,a)}).catch(()=>{});return{getInitializationPromise:()=>o||(t?Promise.resolve():n?Promise.reject(r):(o=new Promise((s,a)=>{const l=()=>{e.off(Un,l),s()},c=u=>{e.off(Bn,c),a(u)};e.on(Un,l),e.on(Bn,c)}),o)),getReadyPromise:()=>i,signalSuccess:()=>{t||n||(t=!0,e.emit(Un),e.emit(zt))},signalFailure:s=>{t||n||(n=!0,r=s,e.emit(Bn,s),e.emit(zt)),e.maybeReportError(s)}}},xc=function(e,t,n,r){const o={};function i(){let s="";const a=r.getContext();return a&&(s=n||F.btoa(JSON.stringify(a))),"ld:"+t+":"+s}return o.loadFlags=()=>e.get(i()).then(s=>{if(s==null)return null;try{let a=JSON.parse(s);if(a){const l=a.$schema;l===void 0||l<1?a=F.transformValuesToVersionedValues(a):delete a.$schema}return a}catch{return o.clearFlags().then(()=>null)}}),o.saveFlags=s=>{const a=F.extend({},s,{$schema:1});return e.set(i(),JSON.stringify(a))},o.clearFlags=()=>e.clear(i()),o},wc=function(e,t){const n={};let r=!1;const o=i=>{r||(r=!0,t.warn(I.localStorageUnavailable(i)))};return n.isEnabled=()=>!!e,n.get=i=>new Promise(s=>{e?e.get(i).then(s).catch(a=>{o(a),s(void 0)}):s(void 0)}),n.set=(i,s)=>new Promise(a=>{e?e.set(i,s).then(()=>a(!0)).catch(l=>{o(l),a(!1)}):a(!1)}),n.clear=i=>new Promise(s=>{e?e.clear(i).then(()=>s(!0)).catch(a=>{o(a),s(!1)}):s(!1)}),n};const{appendUrlPath:$o,base64URLEncode:Tc,objectHasOwnProperty:Sc}=F,{getLDHeaders:Ec,transformHeaders:Pc}=jn,{isHttpErrorRecoverable:Cc}=X;var Ac=function(e,t,n,r){const o=t.streamUrl,i=t.logger,s={},a=$o(o,"/eval/"+n),l=t.useReport,c=t.evaluationReasons,u=t.streamReconnectDelay,d=Ec(e,t);let f,h=!1,p=null,y=null,v=null,m=null,b=null,x=0;function S(){const L=(N=function(){const R=u*Math.pow(2,x);return R>3e4?3e4:R}(),N-Math.trunc(.5*Math.random()*N));var N;return x+=1,L}function g(L){if(L.status&&typeof L.status=="number"&&!Cc(L.status))return M(),i.error(I.unrecoverableStreamError(L)),void(y&&(clearTimeout(y),y=null));const N=S();h||(i.warn(I.streamError(L,N)),h=!0),C(!1),M(),k(N)}function k(L){y||(L?y=setTimeout(D,L):D())}function D(){let L;y=null;let N="";const R={headers:d,readTimeoutMillis:3e5};if(e.eventSourceFactory){m!=null&&(N="h="+m),l?e.eventSourceAllowsReport?(L=a,R.method="REPORT",R.headers["Content-Type"]="application/json",R.body=JSON.stringify(v)):(L=$o(o,"/ping/"+n),N=""):L=a+"/"+Tc(JSON.stringify(v)),R.headers=Pc(R.headers,t),c&&(N=N+(N?"&":"")+"withReasons=true"),L=L+(N?"?":"")+N,M(),i.info(I.streamConnecting(L)),f=new Date().getTime(),p=e.eventSourceFactory(L,R);for(const te in b)Sc(b,te)&&p.addEventListener(te,b[te]);p.onerror=g,p.onopen=()=>{x=0}}}function M(){p&&(i.info(I.streamClosing()),p.close(),p=null)}function C(L){f&&r&&r.recordStreamInit(f,!L,new Date().getTime()-f),f=null}return s.connect=function(L,N,R){v=L,m=N,b={};for(const te in R||{})b[te]=function(Z){h=!1,C(!0),R[te]&&R[te](Z)};k()},s.disconnect=function(){clearTimeout(y),y=null,M()},s.isConnected=function(){return!!(p&&e.eventSourceIsActive&&e.eventSourceIsActive(p))},s},kc=function(e){let t,n,r,o;const i={addPromise:(s,a)=>{t=s,n&&n(),n=a,s.then(l=>{t===s&&(r(l),e&&e())},l=>{t===s&&(o(l),e&&e())})}};return i.resultPromise=new Promise((s,a)=>{r=s,o=a}),i};const{transformHeaders:Dc,getLDHeaders:Mc}=jn,zo="application/json";var Vc=function(e,t,n){const r=t.baseUrl,o=t.useReport,i=t.evaluationReasons,s=t.logger,a={},l={};function c(u,d){if(!e.httpRequest)return new Promise((m,b)=>{b(new X.LDFlagFetchError(I.httpUnavailable()))});const f=d?"REPORT":"GET",h=Mc(e,t);d&&(h["Content-Type"]=zo);let p=l[u];p||(p=kc(()=>{delete l[u]}),l[u]=p);const y=e.httpRequest(f,u,Dc(h,t),d),v=y.promise.then(m=>{if(m.status===200){if(m.header("content-type")&&m.header("content-type").substring(0,16)===zo)return JSON.parse(m.body);{const b=I.invalidContentType(m.header("content-type")||"");return Promise.reject(new X.LDFlagFetchError(b))}}return Promise.reject(function(b){return b.status===404?new X.LDInvalidEnvironmentIdError(I.environmentNotFound()):new X.LDFlagFetchError(I.errorFetchingFlags(b.statusText||String(b.status)))}(m))},m=>Promise.reject(new X.LDFlagFetchError(I.networkError(m))));return p.addPromise(v,()=>{y.cancel&&y.cancel()}),p.resultPromise}return a.fetchJSON=function(u){return c(F.appendUrlPath(r,u),null)},a.fetchFlagSettings=function(u,d){let f,h,p,y="";return o?(h=[r,"/sdk/evalx/",n,"/context"].join(""),p=JSON.stringify(u)):(f=F.base64URLEncode(JSON.stringify(u)),h=[r,"/sdk/evalx/",n,"/contexts/",f].join("")),d&&(y="h="+d),i&&(y=y+(y?"&":"")+"withReasons=true"),h=h+(y?"?":"")+y,s.debug(I.debugPolling(h)),c(h,p)},a},Lc=function(e,t){const n={};let r;return n.setContext=function(o){r=F.sanitizeContext(o),r&&t&&t(F.clone(r))},n.getContext=function(){return r?F.clone(r):null},n};const{v1:Oc}=On,{getContextKinds:Ic}=$t;var Rc=function(e){function t(r){return r==null||r==="user"?"ld:$anonUserId":`ld:$contextKey:${r}`}function n(r,o){return o.key!==null&&o.key!==void 0?(o.key=o.key.toString(),Promise.resolve(o)):o.anonymous?function(i){return e.get(t(i))}(r).then(i=>{if(i)return o.key=i,o;{const s=Oc();return o.key=s,function(a,l){return e.set(t(l),a)}(s,r).then(()=>o)}}):Promise.reject(new X.LDInvalidUserError(I.invalidContext()))}this.processContext=r=>{if(!r)return Promise.reject(new X.LDInvalidUserError(I.contextNotSpecified()));const o=F.clone(r);if(r.kind==="multi"){const i=Ic(o);return Promise.all(i.map(s=>n(s,o[s]))).then(()=>o)}return n(r.kind,o)}};const{v1:Fc}=On,{baseOptionDefs:_n}=Fn,{appendUrlPath:jc}=F;var $n={DiagnosticId:function(e){const t={diagnosticId:Fc()};return e&&(t.sdkKeySuffix=e.length>6?e.substring(e.length-6):e),t},DiagnosticsAccumulator:function(e){let t,n,r,o;function i(s){t=s,n=0,r=0,o=[]}return i(e),{getProps:()=>({dataSinceDate:t,droppedEvents:n,eventsInLastBatch:r,streamInits:o}),setProps:s=>{t=s.dataSinceDate,n=s.droppedEvents||0,r=s.eventsInLastBatch||0,o=s.streamInits||[]},incrementDroppedEvents:()=>{n++},setEventsInLastBatch:s=>{r=s},recordStreamInit:(s,a,l)=>{const c={timestamp:s,failed:a,durationMillis:l};o.push(c)},reset:i}},DiagnosticsManager:function(e,t,n,r,o,i,s){const a=!!e.diagnosticUseCombinedEvent,l="ld:"+o+":$diagnostics",c=jc(i.eventsUrl,"/events/diagnostic/"+o),u=i.diagnosticRecordingInterval,d=n;let f,h,p=!!i.streaming;const y={};function v(){return{sdk:x(),configuration:S(),platform:e.diagnosticPlatformData}}function m(g){i.logger&&i.logger.debug(I.debugPostingDiagnosticEvent(g)),r.sendEvents(g,c,!0).then(()=>{}).catch(()=>{})}function b(){m(function(){const g=new Date().getTime();let k={kind:a?"diagnostic-combined":"diagnostic",id:s,creationDate:g,...d.getProps()};return a&&(k={...k,...v()}),d.reset(g),k}()),h=setTimeout(b,u),f=new Date().getTime(),a&&function(){if(t.isEnabled()){const g={...d.getProps()};t.set(l,JSON.stringify(g))}}()}function x(){const g={...e.diagnosticSdkData};return i.wrapperName&&(g.wrapperName=i.wrapperName),i.wrapperVersion&&(g.wrapperVersion=i.wrapperVersion),g}function S(){return{customBaseURI:i.baseUrl!==_n.baseUrl.default,customStreamURI:i.streamUrl!==_n.streamUrl.default,customEventsURI:i.eventsUrl!==_n.eventsUrl.default,eventsCapacity:i.eventCapacity,eventsFlushIntervalMillis:i.flushInterval,reconnectTimeMillis:i.streamReconnectDelay,streamingDisabled:!p,allAttributesPrivate:!!i.allAttributesPrivate,diagnosticRecordingIntervalMillis:i.diagnosticRecordingInterval,usingSecureMode:!!i.hash,bootstrapMode:!!i.bootstrap,fetchGoalsDisabled:!i.fetchGoals,sendEventsOnlyForVariation:!!i.sendEventsOnlyForVariation}}return y.start=()=>{a?function(g){if(!t.isEnabled())return g(!1);t.get(l).then(k=>{if(k)try{const D=JSON.parse(k);d.setProps(D),f=D.dataSinceDate}catch{}g(!0)}).catch(()=>{g(!1)})}(g=>{if(g){const k=(f||0)+u,D=new Date().getTime();D>=k?b():h=setTimeout(b,k-D)}else Math.floor(4*Math.random())===0?b():h=setTimeout(b,u)}):(m({kind:"diagnostic-init",id:s,creationDate:d.getProps().dataSinceDate,...v()}),h=setTimeout(b,u))},y.stop=()=>{h&&clearTimeout(h)},y.setStreaming=g=>{p=g},y}},Nc=function(e,t){let n=!1;const r={type:e.type,name:e.name,synchronous:e.synchronous,method:(...o)=>{try{e.method(...o)}catch{n||(n=!0,t.warn(I.inspectorMethodError(r.type,r.name)))}}};return r};const{onNextTick:Kt}=F,he={flagUsed:"flag-used",flagDetailsChanged:"flag-details-changed",flagDetailChanged:"flag-detail-changed",clientIdentityChanged:"client-identity-changed"};Object.freeze(he);var Uc={InspectorTypes:he,InspectorManager:function(e,t){const n={},r={[he.flagUsed]:[],[he.flagDetailsChanged]:[],[he.flagDetailChanged]:[],[he.clientIdentityChanged]:[]},o={[he.flagUsed]:[],[he.flagDetailsChanged]:[],[he.flagDetailChanged]:[],[he.clientIdentityChanged]:[]},i=e&&e.map(s=>Nc(s,t));return i&&i.forEach(s=>{Object.prototype.hasOwnProperty.call(r,s.type)&&!s.synchronous?r[s.type].push(s):Object.prototype.hasOwnProperty.call(o,s.type)&&s.synchronous?o[s.type].push(s):t.warn(I.invalidInspector(s.type,s.name))}),n.hasListeners=s=>r[s]&&r[s].length||o[s]&&o[s].length,n.onFlagUsed=(s,a,l)=>{const c=he.flagUsed;o[c].length&&o[c].forEach(u=>u.method(s,a,l)),r[c].length&&Kt(()=>{r[c].forEach(u=>u.method(s,a,l))})},n.onFlags=s=>{const a=he.flagDetailsChanged;o[a].length&&o[a].forEach(l=>l.method(s)),r[a].length&&Kt(()=>{r[a].forEach(l=>l.method(s))})},n.onFlagChanged=(s,a)=>{const l=he.flagDetailChanged;o[l].length&&o[l].forEach(c=>c.method(s,a)),r[l].length&&Kt(()=>{r[l].forEach(c=>c.method(s,a))})},n.onIdentityChanged=s=>{const a=he.clientIdentityChanged;o[a].length&&o[a].forEach(l=>l.method(s)),r[a].length&&Kt(()=>{r[a].forEach(l=>l.method(s))})},n}};const{LDTimeoutError:Bc}=X;var _c=function(e,t){return new Promise((n,r)=>{setTimeout(()=>{r(new Bc(`${t} timed out after ${e} seconds.`))},1e3*e)})};const{commonBasicLogger:Ko}=In,{checkContext:$c,getContextKeys:zc}=$t,{InspectorTypes:Ht,InspectorManager:Kc}=Uc,Gt="change",Ho="internal-change";var Go={initialize:function(e,t,n,r,o){const i=function(){return n&&n.logger?n.logger:o&&o.logger&&o.logger.default||Ko("warn")}(),s=vc(i),a=bc(s),l=Fn.validate(n,s,o,i),c=Kc(l.inspectors,i),u=l.sendEvents;let d=e,f=l.hash;const h=wc(r.localStorage,i),p=Io(r,d,l),y=l.sendEvents&&!l.diagnosticOptOut,v=y?$n.DiagnosticId(d):null,m=y?$n.DiagnosticsAccumulator(new Date().getTime()):null,b=y?$n.DiagnosticsManager(r,h,m,p,d,l,v):null,x=Ac(r,l,d,m),S=l.eventProcessor||yc(r,l,d,m,s,p),g=Vc(r,l,d);let k,D,M,C={},L=l.streaming,N=!1,R=!1,te=!0;const Z=l.stateProvider,W=Lc(null,function(w){(function(E){Z||E&&Q({kind:"identify",context:E,creationDate:new Date().getTime()})})(w),c.hasListeners(Ht.clientIdentityChanged)&&c.onIdentityChanged(W.getContext())}),ke=new Rc(h),K=h.isEnabled()?xc(h,d,f,W):null;function Q(w){d&&(Z&&Z.enqueueEvent&&Z.enqueueEvent(w)||(w.context?(te=!1,!u||R||r.isDoNotTrack()||(i.debug(I.debugEnqueueingEvent(w.kind)),S.enqueue(w))):te&&(i.warn(I.eventWithoutContext()),te=!1)))}function me(w,E){c.hasListeners(Ht.flagDetailChanged)&&c.onFlagChanged(w.key,_e(E))}function we(){c.hasListeners(Ht.flagDetailsChanged)&&c.onFlags(Object.entries(C).map(([w,E])=>({key:w,detail:_e(E)})).reduce((w,E)=>(w[E.key]=E.detail,w),{}))}function ge(w,E,T,B){const U=W.getContext(),ne=new Date,z={kind:"feature",key:w,context:U,value:E?E.value:null,variation:E?E.variationIndex:null,default:T,creationDate:ne.getTime()},ee=C[w];ee&&(z.version=ee.flagVersion?ee.flagVersion:ee.version,z.trackEvents=ee.trackEvents,z.debugEventsUntilDate=ee.debugEventsUntilDate),(B||ee&&ee.trackReason)&&E&&(z.reason=E.reason),Q(z)}function Tn(w){return $c(w,!1)?Promise.resolve(w):Promise.reject(new X.LDInvalidUserError(I.invalidContext()))}function dt(w,E,T,B,U,ne){var Il;let z,ee;return C&&F.objectHasOwnProperty(C,w)&&C[w]&&!C[w].deleted?(ee=C[w],z=_e(ee),ee.value!==null&&ee.value!==void 0||(z.value=E)):z={value:E,variationIndex:null,reason:{kind:"ERROR",errorKind:"FLAG_NOT_FOUND"}},T&&(U||((Il=ee==null?void 0:ee.prerequisites)==null||Il.forEach(wo=>{dt(wo,void 0,T,!1,!1,!1)})),ge(w,z,E,B)),!U&&ne&&function(wo,Jg){c.hasListeners(Ht.flagUsed)&&c.onFlagUsed(wo,Jg,W.getContext())}(w,z),z}function _e(w){return{value:w.value,variationIndex:w.variation===void 0?null:w.variation,reason:w.reason||null}}function Sn(){if(D=!0,!W.getContext())return;const w=E=>{try{return JSON.parse(E)}catch{return void s.maybeReportError(new X.LDInvalidDataError(I.invalidData()))}};x.connect(W.getContext(),f,{ping:function(){i.debug(I.debugStreamPing());const E=W.getContext();g.fetchFlagSettings(E,f).then(T=>{F.deepEquals(E,W.getContext())&&$e(T||{})}).catch(T=>{s.maybeReportError(new X.LDFlagFetchError(I.errorFetchingFlags(T)))})},put:function(E){const T=w(E.data);T&&(i.debug(I.debugStreamPut()),$e(T))},patch:function(E){const T=w(E.data);if(!T)return;const B=C[T.key];if(!B||!B.version||!T.version||B.version<T.version){i.debug(I.debugStreamPatch(T.key));const U={},ne=F.extend({},T);delete ne.key,C[T.key]=ne;const z=_e(ne);U[T.key]=B?{previous:B.value,current:z}:{current:z},me(T,ne),It(U)}else i.debug(I.debugStreamPatchIgnored(T.key))},delete:function(E){const T=w(E.data);if(T)if(!C[T.key]||C[T.key].version<T.version){i.debug(I.debugStreamDelete(T.key));const B={};C[T.key]&&!C[T.key].deleted&&(B[T.key]={previous:C[T.key].value}),C[T.key]={version:T.version,deleted:!0},me(T,C[T.key]),It(B)}else i.debug(I.debugStreamDeleteIgnored(T.key))}})}function Ot(){D&&(x.disconnect(),D=!1)}function $e(w){const E={};if(!w)return Promise.resolve();for(const T in C)F.objectHasOwnProperty(C,T)&&C[T]&&(w[T]&&!F.deepEquals(w[T].value,C[T].value)?E[T]={previous:C[T].value,current:_e(w[T])}:w[T]&&!w[T].deleted||(E[T]={previous:C[T].value}));for(const T in w)F.objectHasOwnProperty(w,T)&&w[T]&&(!C[T]||C[T].deleted)&&(E[T]={current:_e(w[T])});return C={...w},we(),It(E).catch(()=>{})}function It(w){const E=Object.keys(w);if(E.length>0){const T={};E.forEach(B=>{const U=w[B].current,ne=U?U.value:void 0,z=w[B].previous;s.emit(Gt+":"+B,ne,z),T[B]=U?{current:ne,previous:z}:{previous:z}}),s.emit(Gt,T),s.emit(Ho,C),l.sendEventsOnlyForVariation||Z||E.forEach(B=>{ge(B,w[B].current)})}return k&&K?K.saveFlags(C):Promise.resolve()}function Rt(){const w=L||M&&L===void 0;w&&!D?Sn():!w&&D&&Ot(),b&&b.setStreaming(w)}function Ft(w){return w===Gt||w.substr(0,7)===Gt+":"}if(typeof l.bootstrap=="string"&&l.bootstrap.toUpperCase()==="LOCALSTORAGE"&&(K?k=!0:i.warn(I.localStorageUnavailable())),typeof l.bootstrap=="object"&&(C=function(w){const E=Object.keys(w),T="$flagsState",B="$valid",U=w[T];!U&&E.length&&i.warn(I.bootstrapOldFormat()),w[B]===!1&&i.warn(I.bootstrapInvalid());const ne={};return E.forEach(z=>{if(z!==T&&z!==B){let ee={value:w[z]};U&&U[z]?ee=F.extend(ee,U[z]):ee.version=0,ne[z]=ee}}),ne}(l.bootstrap)),Z){const w=Z.getInitialState();w?En(w):Z.on("init",En),Z.on("update",function(E){E.context&&W.setContext(E.context),E.flags&&$e(E.flags)})}else(function(){return e?ke.processContext(t).then(Tn).then(w=>(W.setContext(w),typeof l.bootstrap=="object"?V():k?K.loadFlags().then(E=>E==null?(C={},g.fetchFlagSettings(W.getContext(),f).then(T=>$e(T||{})).then(V).catch(T=>{qe(new X.LDFlagFetchError(I.errorFetchingFlags(T)))})):(C=E,F.onNextTick(V),g.fetchFlagSettings(W.getContext(),f).then(T=>$e(T)).catch(T=>s.maybeReportError(T)))):g.fetchFlagSettings(W.getContext(),f).then(E=>{C=E||{},we(),V()}).catch(E=>{C={},qe(E)}))):Promise.reject(new X.LDInvalidEnvironmentIdError(I.environmentNotSpecified()))})().catch(qe);function En(w){d=w.environment,W.setContext(w.context),C={...w.flags},F.onNextTick(V)}function V(){i.info(I.clientInitialized()),N=!0,Rt(),a.signalSuccess()}function qe(w){a.signalFailure(w)}return{client:{waitForInitialization:function(w=void 0){if(w!=null){if(typeof w=="number")return function(E){E>5&&i.warn("The waitForInitialization function was called with a timeout greater than 5 seconds. We recommend a timeout of 5 seconds or less.");const T=a.getInitializationPromise(),B=_c(E,"waitForInitialization");return Promise.race([B,T]).catch(U=>{throw U instanceof X.LDTimeoutError&&i.error(`waitForInitialization error: ${U}`),U})}(w);i.warn("The waitForInitialization method was provided with a non-numeric timeout.")}return i.warn("The waitForInitialization function was called without a timeout specified. In a future version a default timeout will be applied."),a.getInitializationPromise()},waitUntilReady:()=>a.getReadyPromise(),identify:function(w,E,T){if(R)return F.wrapPromiseCallback(Promise.resolve({}),T);if(Z)return i.warn(I.identifyDisabled()),F.wrapPromiseCallback(Promise.resolve(F.transformVersionedValuesToValues(C)),T);const B=k&&K?K.clearFlags():Promise.resolve();return F.wrapPromiseCallback(B.then(()=>ke.processContext(w)).then(Tn).then(U=>g.fetchFlagSettings(U,E).then(ne=>{const z=F.transformVersionedValuesToValues(ne);return W.setContext(U),f=E,ne?$e(ne).then(()=>z):z})).then(U=>(D&&Sn(),U)).catch(U=>(s.maybeReportError(U),Promise.reject(U))),T)},getContext:function(){return W.getContext()},variation:function(w,E){return dt(w,E,!0,!1,!1,!0).value},variationDetail:function(w,E){return dt(w,E,!0,!0,!1,!0)},track:function(w,E,T){if(typeof w!="string")return void s.maybeReportError(new X.LDInvalidEventKeyError(I.unknownCustomEventKey(w)));T!==void 0&&typeof T!="number"&&i.warn(I.invalidMetricValue(typeof T)),r.customEventFilter&&!r.customEventFilter(w)&&i.warn(I.unknownCustomEventKey(w));const B=W.getContext(),U={kind:"custom",key:w,context:B,url:r.getCurrentUrl(),creationDate:new Date().getTime()};B&&B.anonymous&&(U.contextKind=B.anonymous?"anonymousUser":"user"),E!=null&&(U.data=E),T!=null&&(U.metricValue=T),Q(U)},on:function(w,E,T){Ft(w)?(M=!0,N&&Rt(),s.on(w,E,T)):s.on(...arguments)},off:function(w){if(s.off(...arguments),Ft(w)){let E=!1;s.getEvents().forEach(T=>{Ft(T)&&s.getEventListenerCount(T)>0&&(E=!0)}),E||(M=!1,D&&L===void 0&&Ot())}},setStreaming:function(w){const E=w===null?void 0:w;E!==L&&(L=E,Rt())},flush:function(w){return F.wrapPromiseCallback(u?S.flush():Promise.resolve(),w)},allFlags:function(){const w={};if(!C)return w;for(const E in C)F.objectHasOwnProperty(C,E)&&!C[E].deleted&&(w[E]=dt(E,null,!l.sendEventsOnlyForVariation,!1,!0,!1).value);return w},close:function(w){if(R)return F.wrapPromiseCallback(Promise.resolve(),w);const E=()=>{R=!0,C={}},T=Promise.resolve().then(()=>{if(Ot(),b&&b.stop(),u)return S.stop(),S.flush()}).then(E).catch(E);return F.wrapPromiseCallback(T,w)}},options:l,emitter:s,ident:W,logger:i,requestor:g,start:function(){u&&(b&&b.start(),S.start())},enqueueEvent:Q,getFlagsInternal:function(){return C},getEnvironmentId:()=>d,internalChangeEventName:Ho}},commonBasicLogger:Ko,errors:X,messages:I,utils:F,getContextKeys:zc},Hc=Go.initialize,Gc=Go.errors;function Wc(e,t,n){return(t=function(r){var o=function(i,s){if(typeof i!="object"||!i)return i;var a=i[Symbol.toPrimitive];if(a!==void 0){var l=a.call(i,s||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}(r,"string");return typeof o=="symbol"?o:o+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wo(Object(n),!0).forEach(function(r){Wc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wo(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Yo={promise:Promise.resolve({status:200,header:function(){return null},body:null})};function qc(e,t,n,r,o){if(o&&!function(){var c=window.navigator&&window.navigator.userAgent;if(c){var u=c.match(/Chrom(e|ium)\/([0-9]+)\./);if(u)return parseInt(u[2],10)<73}return!0}())return Yo;var i=new window.XMLHttpRequest;for(var s in i.open(e,t,!o),n||{})Object.prototype.hasOwnProperty.call(n,s)&&i.setRequestHeader(s,n[s]);if(o){try{i.send(r)}catch{}return Yo}var a,l=new Promise(function(c,u){i.addEventListener("load",function(){a||c({status:i.status,header:function(d){return i.getResponseHeader(d)},body:i.responseText})}),i.addEventListener("error",function(){a||u(new Error)}),i.send(r)});return{promise:l,cancel:function(){a=!0,i.abort()}}}var zn=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function Yc(e,t,n,r){var o,i,s=((e.kind==="substring"||e.kind==="regex")&&r.includes("/")?t:t.replace(r,"")).replace(n,"");switch(e.kind){case"exact":i=t,o=new RegExp("^"+zn(e.url)+"/?$");break;case"canonical":i=s,o=new RegExp("^"+zn(e.url)+"/?$");break;case"substring":i=s,o=new RegExp(".*"+zn(e.substring)+".*$");break;case"regex":i=s,o=new RegExp(e.pattern);break;default:return!1}return o.test(i)}function Xo(e,t){for(var n={},r=null,o=[],i=0;i<e.length;i++)for(var s=e[i],a=s.urls||[],l=0;l<a.length;l++)if(Yc(a[l],window.location.href,window.location.search,window.location.hash)){s.kind==="pageview"?t("pageview",s):(o.push(s),t("click_pageview",s));break}return o.length>0&&(r=function(c){for(var u=function(f,h){for(var p=[],y=0;y<h.length;y++)for(var v=f.target,m=h[y],b=m.selector,x=document.querySelectorAll(b);v&&x.length>0;){for(var S=0;S<x.length;S++)v===x[S]&&p.push(m);v=v.parentNode}return p}(c,o),d=0;d<u.length;d++)t("click",u[d])},document.addEventListener("click",r)),n.dispose=function(){document.removeEventListener("click",r)},n}function Xc(e,t){var n,r;function o(){r&&r.dispose(),n&&n.length&&(r=Xo(n,i))}function i(s,a){var l=e.ident.getContext(),c={kind:s,key:a.key,data:null,url:window.location.href,creationDate:new Date().getTime(),context:l};return s==="click"&&(c.selector=a.selector),e.enqueueEvent(c)}return e.requestor.fetchJSON("/sdk/goals/"+e.getEnvironmentId()).then(function(s){s&&s.length>0&&(r=Xo(n=s,i),function(a,l){var c,u=window.location.href;function d(){(c=window.location.href)!==u&&(u=c,l())}(function f(h,p){h(),setTimeout(function(){f(h,p)},p)})(d,a),window.history&&window.history.pushState?window.addEventListener("popstate",d):window.addEventListener("hashchange",d)}(300,o)),t()}).catch(function(s){e.emitter.maybeReportError(new Gc.LDUnexpectedResponseError((s&&s.message,s.message))),t()}),{}}var Wt="goalsReady",Zc={fetchGoals:{default:!0},hash:{type:"string"},eventProcessor:{type:"object"},eventUrlTransformer:{type:"function"},disableSyncEventPost:{default:!1}};function Jc(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=function(u){var d,f={userAgentHeaderName:"X-LaunchDarkly-User-Agent",synchronousFlush:!1};if(window.XMLHttpRequest){var h=u&&u.disableSyncEventPost;f.httpRequest=function(m,b,x,S){var g=f.synchronousFlush&!h;return f.synchronousFlush=!1,qc(m,b,x,S,g)}}f.httpAllowsPost=function(){return d===void 0&&(d=!!window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest),d},f.httpFallbackPing=function(m){new window.Image().src=m};var p,y=u&&u.eventUrlTransformer;f.getCurrentUrl=function(){return y?y(window.location.href):window.location.href},f.isDoNotTrack=function(){var m;return(m=window.navigator&&window.navigator.doNotTrack!==void 0?window.navigator.doNotTrack:window.navigator&&window.navigator.msDoNotTrack!==void 0?window.navigator.msDoNotTrack:window.doNotTrack)===1||m===!0||m==="1"||m==="yes"};try{window.localStorage&&(f.localStorage={get:function(m){return new Promise(function(b){b(window.localStorage.getItem(m))})},set:function(m,b){return new Promise(function(x){window.localStorage.setItem(m,b),x()})},clear:function(m){return new Promise(function(b){window.localStorage.removeItem(m),b()})}})}catch{f.localStorage=null}if(u&&u.useReport&&typeof window.EventSourcePolyfill=="function"&&window.EventSourcePolyfill.supportedOptions&&window.EventSourcePolyfill.supportedOptions.method?(f.eventSourceAllowsReport=!0,p=window.EventSourcePolyfill):(f.eventSourceAllowsReport=!1,p=window.EventSource),window.EventSource){var v=3e5;f.eventSourceFactory=function(m,b){var x=qo(qo({},{heartbeatTimeout:v,silentTimeout:v,skipDefaultHeaders:!0}),b);return new p(m,x)},f.eventSourceIsActive=function(m){return m.readyState===window.EventSource.OPEN||m.readyState===window.EventSource.CONNECTING}}return f.userAgent="JSClient",f.version="3.5.0",f.diagnosticSdkData={name:"js-client-sdk",version:"3.5.0"},f.diagnosticPlatformData={name:"JS"},f.diagnosticUseCombinedEvent=!0,f}(n),o=Hc(e,t,n,r,Zc),i=o.client,s=o.options,a=o.emitter,l=new Promise(function(u){var d=a.on(Wt,function(){a.off(Wt,d),u()})});i.waitUntilGoalsReady=function(){return l},s.fetchGoals?Xc(o,function(){return a.emit(Wt)}):a.emit(Wt),document.readyState!=="complete"?window.addEventListener("load",o.start):o.start();var c=function(){r.synchronousFlush=!0,i.flush().catch(function(){}),r.synchronousFlush=!1};return document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&c()}),window.addEventListener("pagehide",c),i}var qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eu=1/0,tu="[object Symbol]",nu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ru=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yt="\\ud800-\\udfff",Zo="\\u0300-\\u036f\\ufe20-\\ufe23",Jo="\\u20d0-\\u20f0",Qo="\\u2700-\\u27bf",es="a-z\\xdf-\\xf6\\xf8-\\xff",ou="\\xac\\xb1\\xd7\\xf7",su="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iu="\\u2000-\\u206f",au=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ts="A-Z\\xc0-\\xd6\\xd8-\\xde",ns="\\ufe0e\\ufe0f",rs=ou+su+iu+au,Kn="['’]",lu="["+Yt+"]",os="["+rs+"]",Xt="["+Zo+Jo+"]",ss="\\d+",cu="["+Qo+"]",is="["+es+"]",as="[^"+Yt+rs+ss+Qo+es+ts+"]",Hn="\\ud83c[\\udffb-\\udfff]",uu="(?:"+Xt+"|"+Hn+")",ls="[^"+Yt+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",Wn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ze="["+ts+"]",cs="\\u200d",us="(?:"+is+"|"+as+")",du="(?:"+Ze+"|"+as+")",ds="(?:"+Kn+"(?:d|ll|m|re|s|t|ve))?",fs="(?:"+Kn+"(?:D|LL|M|RE|S|T|VE))?",hs=uu+"?",ps="["+ns+"]?",fu="(?:"+cs+"(?:"+[ls,Gn,Wn].join("|")+")"+ps+hs+")*",ms=ps+hs+fu,hu="(?:"+[cu,Gn,Wn].join("|")+")"+ms,pu="(?:"+[ls+Xt+"?",Xt,Gn,Wn,lu].join("|")+")",mu=RegExp(Kn,"g"),gu=RegExp(Xt,"g"),yu=RegExp(Hn+"(?="+Hn+")|"+pu+ms,"g"),vu=RegExp([Ze+"?"+is+"+"+ds+"(?="+[os,Ze,"$"].join("|")+")",du+"+"+fs+"(?="+[os,Ze+us,"$"].join("|")+")",Ze+"?"+us+"+"+ds,Ze+"+"+fs,ss,hu].join("|"),"g"),bu=RegExp("["+cs+Yt+Zo+Jo+ns+"]"),xu=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},Tu=typeof qt=="object"&&qt&&qt.Object===Object&&qt,Su=typeof self=="object"&&self&&self.Object===Object&&self,Eu=Tu||Su||Function("return this")();function Pu(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;)n=t(n,e[o],o,e);return n}function Cu(e){return e.split("")}function Au(e){return e.match(nu)||[]}function ku(e){return function(t){return e==null?void 0:e[t]}}var Du=ku(wu);function gs(e){return bu.test(e)}function Mu(e){return xu.test(e)}function Vu(e){return gs(e)?Lu(e):Cu(e)}function Lu(e){return e.match(yu)||[]}function Ou(e){return e.match(vu)||[]}var Iu=Object.prototype,Ru=Iu.toString,ys=Eu.Symbol,vs=ys?ys.prototype:void 0,bs=vs?vs.toString:void 0;function Fu(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function ju(e){if(typeof e=="string")return e;if($u(e))return bs?bs.call(e):"";var t=e+"";return t=="0"&&1/e==-eu?"-0":t}function Nu(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Fu(e,t,n)}function Uu(e){return function(t){t=Zt(t);var n=gs(t)?Vu(t):void 0,r=n?n[0]:t.charAt(0),o=n?Nu(n,1).join(""):t.slice(1);return r[e]()+o}}function Bu(e){return function(t){return Pu(Wu(Hu(t).replace(mu,"")),e,"")}}function _u(e){return!!e&&typeof e=="object"}function $u(e){return typeof e=="symbol"||_u(e)&&Ru.call(e)==tu}function Zt(e){return e==null?"":ju(e)}var zu=Bu(function(e,t,n){return t=t.toLowerCase(),e+(n?Ku(t):t)});function Ku(e){return Gu(Zt(e).toLowerCase())}function Hu(e){return e=Zt(e),e&&e.replace(ru,Du).replace(gu,"")}var Gu=Uu("toUpperCase");function Wu(e,t,n){return e=Zt(e),t=t,t===void 0?Mu(e)?Ou(e):Au(e):e.match(t)||[]}var qu=zu;const xs=Qc(qu);var qn={exports:{}},_={};/** @license React v16.13.1
2
+ * react-is.production.min.js
3
+ *
4
+ * Copyright (c) Facebook, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */var ws;function Yu(){if(ws)return _;ws=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(g){if(typeof g=="object"&&g!==null){var k=g.$$typeof;switch(k){case t:switch(g=g.type,g){case l:case c:case r:case i:case o:case d:return g;default:switch(g=g&&g.$$typeof,g){case a:case u:case p:case h:case s:return g;default:return k}}case n:return k}}}function S(g){return x(g)===c}return _.AsyncMode=l,_.ConcurrentMode=c,_.ContextConsumer=a,_.ContextProvider=s,_.Element=t,_.ForwardRef=u,_.Fragment=r,_.Lazy=p,_.Memo=h,_.Portal=n,_.Profiler=i,_.StrictMode=o,_.Suspense=d,_.isAsyncMode=function(g){return S(g)||x(g)===l},_.isConcurrentMode=S,_.isContextConsumer=function(g){return x(g)===a},_.isContextProvider=function(g){return x(g)===s},_.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},_.isForwardRef=function(g){return x(g)===u},_.isFragment=function(g){return x(g)===r},_.isLazy=function(g){return x(g)===p},_.isMemo=function(g){return x(g)===h},_.isPortal=function(g){return x(g)===n},_.isProfiler=function(g){return x(g)===i},_.isStrictMode=function(g){return x(g)===o},_.isSuspense=function(g){return x(g)===d},_.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===o||g===d||g===f||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===h||g.$$typeof===s||g.$$typeof===a||g.$$typeof===u||g.$$typeof===v||g.$$typeof===m||g.$$typeof===b||g.$$typeof===y)},_.typeOf=x,_}var $={};/** @license React v16.13.1
9
+ * react-is.development.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */var Ts;function Xu(){return Ts||(Ts=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(V){return typeof V=="string"||typeof V=="function"||V===r||V===c||V===i||V===o||V===d||V===f||typeof V=="object"&&V!==null&&(V.$$typeof===p||V.$$typeof===h||V.$$typeof===s||V.$$typeof===a||V.$$typeof===u||V.$$typeof===v||V.$$typeof===m||V.$$typeof===b||V.$$typeof===y)}function S(V){if(typeof V=="object"&&V!==null){var qe=V.$$typeof;switch(qe){case t:var jt=V.type;switch(jt){case l:case c:case r:case i:case o:case d:return jt;default:var w=jt&&jt.$$typeof;switch(w){case a:case u:case p:case h:case s:return w;default:return qe}}case n:return qe}}}var g=l,k=c,D=a,M=s,C=t,L=u,N=r,R=p,te=h,Z=n,W=i,ke=o,K=d,Q=!1;function me(V){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),we(V)||S(V)===l}function we(V){return S(V)===c}function ge(V){return S(V)===a}function Tn(V){return S(V)===s}function dt(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function _e(V){return S(V)===u}function Sn(V){return S(V)===r}function Ot(V){return S(V)===p}function $e(V){return S(V)===h}function It(V){return S(V)===n}function Rt(V){return S(V)===i}function Ft(V){return S(V)===o}function En(V){return S(V)===d}$.AsyncMode=g,$.ConcurrentMode=k,$.ContextConsumer=D,$.ContextProvider=M,$.Element=C,$.ForwardRef=L,$.Fragment=N,$.Lazy=R,$.Memo=te,$.Portal=Z,$.Profiler=W,$.StrictMode=ke,$.Suspense=K,$.isAsyncMode=me,$.isConcurrentMode=we,$.isContextConsumer=ge,$.isContextProvider=Tn,$.isElement=dt,$.isForwardRef=_e,$.isFragment=Sn,$.isLazy=Ot,$.isMemo=$e,$.isPortal=It,$.isProfiler=Rt,$.isStrictMode=Ft,$.isSuspense=En,$.isValidElementType=x,$.typeOf=S}()),$}process.env.NODE_ENV==="production"?qn.exports=Yu():qn.exports=Xu();var Zu=qn.exports,Ss=Zu,Ju={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qu={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Es={};Es[Ss.ForwardRef]=Ju,Es[Ss.Memo]=Qu;const ed=()=>P.createContext({flags:{},flagKeyMap:{},ldClient:void 0}),Ps={useCamelCaseFlagKeys:!0,sendEventsOnFlagRead:!0,reactContext:ed()},Jt=e=>{var t;return(t=e.context)!=null?t:e.user},Yn=e=>{const t={};for(const n in e)n.indexOf("$")!==0&&(t[xs(n)]=e[n]);return t},td=(e,t)=>{const n={};for(const r in e)t&&t[r]===void 0||(n[r]=e[r].current);return n},Xn=(e,t)=>{const n=e.allFlags();return t?Object.keys(t).reduce((r,o)=>(r[o]=Object.prototype.hasOwnProperty.call(n,o)?n[o]:t[o],r),{}):n};function Zn(e,t,n=Ps,r){const o=function(l,c){return c===void 0?l:Object.keys(c).reduce((u,d)=>(Jn(l,d)&&(u[d]=l[d]),u),{})}(t,r),{useCamelCaseFlagKeys:i=!0}=n,[s,a={}]=i?function(l){const c={},u={};for(const d in l){if(d.indexOf("$")===0)continue;const f=xs(d);c[f]=l[d],u[f]=d}return[c,u]}(o):[o];return{flags:n.sendEventsOnFlagRead?nd(e,s,a,i):s,flagKeyMap:a}}function Jn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nd(e,t,n,r){return new Proxy(t,{get(o,i,s){const a=Reflect.get(o,i,s),l=r&&Jn(n,i)||Jn(o,i);if(typeof i=="symbol"||!l)return a;if(a===void 0)return;const c=r?n[i]:i;return e.variation(c,a)}})}Yn.camelCaseKeys=Yn;const rd={wrapperName:"react-client-sdk",wrapperVersion:"3.6.1",sendEventsOnlyForVariation:!0};var od=Object.defineProperty,sd=Object.defineProperties,id=Object.getOwnPropertyDescriptors,Cs=Object.getOwnPropertySymbols,ad=Object.prototype.hasOwnProperty,ld=Object.prototype.propertyIsEnumerable,As=(e,t,n)=>t in e?od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ye=(e,t)=>{for(var n in t||(t={}))ad.call(t,n)&&As(e,n,t[n]);if(Cs)for(var n of Cs(t))ld.call(t,n)&&As(e,n,t[n]);return e},ht=(e,t)=>sd(e,id(t)),Qn=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{a(n.next(l))}catch(c){o(c)}},s=l=>{try{a(n.throw(l))}catch(c){o(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,s);a((n=n.apply(e,t)).next())});class cd extends P.Component{constructor(t){super(t),this.getReactOptions=()=>ye(ye({},Ps),this.props.reactOptions),this.subscribeToChanges=r=>{const{flags:o}=this.props;r.on("change",i=>{const s=this.getReactOptions(),a=td(i,o),l=ye(ye({},this.state.unproxiedFlags),a);Object.keys(a).length>0&&this.setState(c=>ye(ht(ye({},c),{unproxiedFlags:l}),Zn(r,l,s,o)))})},this.onFailed=(r,o)=>{this.setState(i=>ht(ye({},i),{error:o}))},this.onReady=(r,o,i)=>{const s=Xn(r,i);this.setState(a=>ye(ht(ye({},a),{unproxiedFlags:s}),Zn(r,s,o,i)))},this.prepareLDClient=()=>Qn(this,null,function*(){var r;const{clientSideID:o,flags:i,options:s}=this.props;let a=yield this.props.ldClient;const l=this.getReactOptions();let c,u=this.state.unproxiedFlags;if(a)u=Xn(a,i);else{const d=(r=Jt(this.props))!=null?r:{anonymous:!0,kind:"user"};a=Jc(o,d,ye(ye({},rd),s));try{yield a.waitForInitialization(this.props.timeout),u=Xn(a,i)}catch(f){c=f,c!=null&&c.name.toLowerCase().includes("timeout")&&(a.on("failed",this.onFailed),a.on("ready",()=>{this.onReady(a,l,i)}))}}this.setState(d=>ht(ye(ht(ye({},d),{unproxiedFlags:u}),Zn(a,u,l,i)),{ldClient:a,error:c})),this.subscribeToChanges(a)});const{options:n}=t;if(this.state={flags:{},unproxiedFlags:{},flagKeyMap:{}},n){const{bootstrap:r}=n;if(r&&r!=="localStorage"){const{useCamelCaseFlagKeys:o}=this.getReactOptions();this.state={flags:o?Yn(r):r,unproxiedFlags:r,flagKeyMap:{}}}}}componentDidMount(){return Qn(this,null,function*(){const{deferInitialization:t}=this.props;t&&!Jt(this.props)||(yield this.prepareLDClient())})}componentDidUpdate(t){return Qn(this,null,function*(){const{deferInitialization:n}=this.props,r=!Jt(t)&&Jt(this.props);n&&r&&(yield this.prepareLDClient())})}render(){const{flags:t,flagKeyMap:n,ldClient:r,error:o}=this.state,{reactContext:i}=this.getReactOptions();return P.createElement(i.Provider,{value:{flags:t,flagKeyMap:n,ldClient:r,error:o}},this.props.children)}}const ks="api:unauthorized",Ds="api:authorized";class ud{constructor(){Rl(this,"handlers",new Map)}subscribe(t,n){const r=this.handlers.get(t)||new Set;return r.add(n),this.handlers.set(t,r),()=>{const o=this.handlers.get(t);o&&(o.delete(n),o.size===0&&this.handlers.delete(t))}}emit(t,n){const r=this.handlers.get(t);r&&r.forEach(o=>o(n))}clearAll(){this.handlers.clear()}}const er=new ud,dd={staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!0},fd="http://localhost:3001/api";let tr,nr=!1,Qt=null,rr=!1;const hd=e=>{tr=e},Ms=async(e,t={})=>{const n=await fetch(`${fd}${e}`,{...t,credentials:"include",headers:{"Content-Type":"application/json",...tr&&{Authorization:`Bearer ${tr}`},...t.headers}});if(n.status===401)throw nr||(nr=!0,er.emit(ks,void 0),Qt&&window.clearTimeout(Qt),Qt=window.setTimeout(()=>{nr=!1,rr=!1,Qt=null},5e3)),new Error("Unauthorized");if(!n.ok)throw new Error(`API Error: ${n.statusText}`);return rr||(er.emit(Ds,void 0),rr=!0),n.json()},pd=()=>new Se.QueryClient({defaultOptions:{queries:{retry:(e,t)=>t instanceof Error&&t.message==="Unauthorized"?!1:e<3,...dd}}}),Vs=(e,t,n,r)=>{const o=P.createContext({state:n});return{Context:o,Provider:({children:s})=>{const[a,l]=P.useReducer(e,n),c=P.useMemo(()=>Object.keys(t).reduce((d,f)=>({...d,[f]:t[f](l)}),{}),[l]);P.useEffect(()=>{const d=[];return r!=null&&r.length&&r.forEach(({eventName:f,handler:h})=>{const p=h(l),y=er.subscribe(f,p);d.push(y)}),()=>d.forEach(f=>f())},[l]);const u=P.useMemo(()=>({state:a,...c}),[a,c]);return A.jsx(o.Provider,{value:u,children:s})}}},md=(e,t)=>{switch(t.type){case"SET_AUTHENTICATED":return{...e,isAuthenticated:t.payload,error:null,reauthing:!1};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload,isAuthenticated:!1,reauthing:!1};case"SET_REAUTHING":return e.reauthing&&t.payload?e:{...e,reauthing:t.payload};default:return e}},gd=e=>async t=>{if(!t){console.error("No reauth callback provided for onReauthRequested"),e({type:"SET_ERROR",payload:"No reauth callback provided"});return}e({type:"SET_REAUTHING",payload:!0});try{t()}catch(n){console.error("Error during reauth:",n),e({type:"SET_ERROR",payload:n instanceof Error?n.message:"Reauthorization failed"})}},yd=[{eventName:ks,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!1}),e({type:"SET_REAUTHING",payload:!0})}},{eventName:Ds,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!0})}}],{Context:ny,Provider:vd}=Vs(md,{handleReauth:gd},{isAuthenticated:!1,loading:!1,error:null,reauthing:!1},yd),bd={primary:"hsl(222.2 47.4% 11.2%)",background:"hsl(0 0% 100%)",foreground:"hsl(222.2 47.4% 11.2%)","primary-foreground":"hsl(210 40% 98%)",secondary:"hsl(210 40% 96.1%)","secondary-foreground":"hsl(222.2 47.4% 11.2%)",muted:"hsl(210 40% 96.1%)","muted-foreground":"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96.1%)","accent-foreground":"hsl(222.2 47.4% 11.2%)",border:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)","destructive-foreground":"hsl(210 40% 98%)",card:"hsl(0 0% 100%)","card-foreground":"hsl(222.2 47.4% 11.2%)",popover:"hsl(0 0% 100%)","popover-foreground":"hsl(222.2 47.4% 11.2%)"},xd=e=>{const t=document.createElement("div");t.style.color=e,document.body.appendChild(t);const n=window.getComputedStyle(t).color;return document.body.removeChild(t),n},wd=e=>{const t=document.createElement("div"),n=t.style.color;return t.style.color=e,t.style.color!==n},Td=e=>{const t=document.getElementById("reach-theme-styles");t&&t.remove();const n=document.createElement("style");n.id="reach-theme-styles";const r=`
16
+ [data-reach-root] {
17
+ ${Object.entries(bd).map(([o,i])=>{const s=e[o];let a=i;if(s&&wd(s))try{a=xd(s)}catch{console.warn(`Failed to normalize color for ${o}, using default`)}return`--reach-${o}: ${a};`}).join(`
18
+ `)}
19
+ }
20
+ `;n.textContent=r,document.head.appendChild(n)},Sd=(e,t)=>{switch(t.type){case"set_theme":return t.payload&&Td(t.payload.styles),{...e,loading:!1,error:null,theme:t.payload};case"set_loading":return{...e,loading:t.payload};case"set_error":return{...e,loading:!1,error:t.payload};default:return e}},Ed=e=>t=>e({type:"set_theme",payload:t}),Pd=e=>t=>e({type:"set_loading",payload:t}),Cd=e=>t=>e({type:"set_error",payload:t}),{Context:ry,Provider:Ad}=Vs(Sd,{setTheme:Ed,setLoading:Pd,setError:Cd},{theme:null,loading:!1,error:null}),kd=({feature:e,authToken:t,tenantId:n,children:r})=>{const[o]=P.useState(()=>(t&&hd(t),pd())),i=e?["/automations/segment-builder"]:["/"];return A.jsxs(Se.QueryClientProvider,{client:o,children:[A.jsx(cd,{clientSideID:void 0,context:{kind:"user",key:n||"anonymous",custom:{businessId:n}},options:{streaming:!1},timeout:2,reactOptions:{useCamelCaseFlagKeys:!1,sendEventsOnFlagRead:!0},children:A.jsx(Ad,{children:A.jsx(vd,{children:A.jsx(Fl.MemoryRouter,{initialEntries:i,initialIndex:0,children:r})})})}),!1]})},Ls="/segments",Dd=async()=>(await Ms(`${Ls}/conditions`,{method:"GET"})).data,Md=async e=>(await Ms(Ls,{method:"POST",body:JSON.stringify(e)})).data,Vd=()=>{const e=Se.useQueryClient(),t=Se.useMutation({mutationFn:r=>Md(r),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=Se.useQuery({queryKey:["segments-conditions"],queryFn:()=>Dd()});return{createSegment:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess,segmentsConditions:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchSegmentsConditions:n.refetch}},Ld=({children:e})=>A.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),Os=({size:e=35,color:t="black",speed:n=.9,strokeWidth:r=3.5,text:o,textSpeed:i=2e3})=>{const[s,a]=P.useState(0),l=Array.isArray(o)?o:o?[o]:[];return P.useEffect(()=>{if(l.length<=1||s>=l.length-1)return;const c=setInterval(()=>{a(u=>u<l.length-1?u+1:u)},i);return()=>clearInterval(c)},[l.length,i,s]),A.jsx("div",{className:"flex flex-col justify-center items-center h-full",children:A.jsxs("div",{className:"flex flex-col items-center gap-4",children:[A.jsxs("div",{className:"loader-container",style:{"--uib-size":`${e}px`,"--uib-color":t,"--uib-speed":`${n}s`,"--uib-stroke":`${r}px`},children:[A.jsx("div",{className:"line"}),A.jsx("div",{className:"line"}),A.jsx("div",{className:"line"}),A.jsx("div",{className:"line"}),A.jsx("div",{className:"line"}),A.jsx("div",{className:"line"})]}),l.length>0&&A.jsx("div",{className:"text-center text-sm text-muted-foreground animate-fade-in",children:A.jsx(Ld,{children:l[s]})},s),A.jsx("style",{children:`
21
+ .loader-container {
22
+ position: relative;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ height: var(--uib-size);
27
+ width: var(--uib-size);
28
+ }
29
+ .line {
30
+ position: absolute;
31
+ top: calc(50% - var(--uib-stroke) / 2);
32
+ left: 0;
33
+ height: var(--uib-stroke);
34
+ width: 100%;
35
+ border-radius: calc(var(--uib-stroke) / 2);
36
+ background-color: var(--uib-color);
37
+ animation: rotate var(--uib-speed) ease-in-out infinite;
38
+ transition: background-color 0.3s ease;
39
+ }
40
+ .line:nth-child(1) {
41
+ animation-delay: calc(var(--uib-speed) * -0.375);
42
+ }
43
+ .line:nth-child(2) {
44
+ animation-delay: calc(var(--uib-speed) * -0.375);
45
+ opacity: 0.8;
46
+ }
47
+ .line:nth-child(3) {
48
+ animation-delay: calc(var(--uib-speed) * -0.3);
49
+ opacity: 0.6;
50
+ }
51
+ .line:nth-child(4) {
52
+ animation-delay: calc(var(--uib-speed) * -0.225);
53
+ opacity: 0.4;
54
+ }
55
+ .line:nth-child(5) {
56
+ animation-delay: calc(var(--uib-speed) * -0.15);
57
+ opacity: 0.2;
58
+ }
59
+ .line:nth-child(6) {
60
+ animation-delay: calc(var(--uib-speed) * -0.075);
61
+ opacity: 0.1;
62
+ }
63
+ @keyframes rotate {
64
+ 0% {
65
+ transform: rotate(0deg);
66
+ }
67
+ 100% {
68
+ transform: rotate(180deg);
69
+ }
70
+ }
71
+ .animate-fade-in {
72
+ animation: fadeIn 0.5s ease-in-out;
73
+ }
74
+ @keyframes fadeIn {
75
+ from {
76
+ opacity: 0;
77
+ transform: translateY(5px);
78
+ }
79
+ to {
80
+ opacity: 1;
81
+ transform: translateY(0);
82
+ }
83
+ }
84
+ `})]})})};/**
85
+ * @license lucide-react v0.464.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const Od=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Is=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
90
+ * @license lucide-react v0.464.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */var Id={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
95
+ * @license lucide-react v0.464.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const Rd=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>P.createElement("svg",{ref:l,...Id,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Is("lucide",o),...a},[...s.map(([c,u])=>P.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
100
+ * @license lucide-react v0.464.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const en=(e,t)=>{const n=P.forwardRef(({className:r,...o},i)=>P.createElement(Rd,{ref:i,iconNode:t,className:Is(`lucide-${Od(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
105
+ * @license lucide-react v0.464.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const Fd=en("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
110
+ * @license lucide-react v0.464.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const jd=en("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
115
+ * @license lucide-react v0.464.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const Nd=en("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
120
+ * @license lucide-react v0.464.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Ud=en("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Bd={PrimaryButton:"bg-purple-600 text-white rounded-lg",PrimaryButtonHover:"hover:bg-purple-700",PrimaryButtonDisabled:"opacity-50 cursor-not-allowed",SecondaryButton:"border bg-gray-100 rounded-lg",SecondaryButtonHover:"hover:bg-gray-200"},_d={CloseButton:Ud,DropdownMenuTrigger:jd,UserIcon:Nd,ScheduleButton:Fd},$d=e=>({...Bd,...e||{}}),zd=e=>({..._d,...e||{}});function Rs(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Rs(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Kd(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rs(e))&&(r&&(r+=" "),r+=t);return r}const or="-",Hd=e=>{const t=Wd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(or);return a[0]===""&&a.length!==1&&a.shift(),Fs(a,t)||Gd(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Fs=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fs(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(or);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},js=/^\[(.+)\]$/,Gd=e=>{if(js.test(e)){const t=js.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wd=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Yd(Object.entries(e.classGroups),n).forEach(([i,s])=>{sr(s,r,i,t)}),r},sr=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ns(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(qd(o)){sr(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{sr(s,Ns(t,i),n,r)})})},Ns=(e,t)=>{let n=e;return t.split(or).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qd=e=>e.isThemeGetter,Yd=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,Xd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Us="!",Zd=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let m=a[v];if(c===0){if(m===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(m==="/"){d=v;continue}}m==="["?c++:m==="]"&&c--}const f=l.length===0?a:a.substring(u),h=f.startsWith(Us),p=h?f.substring(1):f,y=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},Jd=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Qd=e=>({cache:Xd(e.cacheSize),parseClassName:Zd(e),...Hd(e)}),ef=/\s+/,tf=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(ef);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(c);let p=!!h,y=r(p?f.substring(0,h):f);if(!y){if(!p){a=c+(a.length>0?" "+a:a);continue}if(y=r(f),!y){a=c+(a.length>0?" "+a:a);continue}p=!1}const v=Jd(u).join(":"),m=d?v+Us:v,b=m+y;if(i.includes(b))continue;i.push(b);const x=o(y,p);for(let S=0;S<x.length;++S){const g=x[S];i.push(m+g)}a=c+(a.length>0?" "+a:a)}return a};function nf(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bs(t))&&(r&&(r+=" "),r+=n);return r}const Bs=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bs(e[r]))&&(n&&(n+=" "),n+=t);return n};function rf(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Qd(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=tf(l,n);return o(l,u),u}return function(){return i(nf.apply(null,arguments))}}const G=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},_s=/^\[(?:([a-z-]+):)?(.+)\]$/i,of=/^\d+\/\d+$/,sf=new Set(["px","full","screen"]),af=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lf=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,df=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,De=e=>Je(e)||sf.has(e)||of.test(e),Ie=e=>Qe(e,"length",bf),Je=e=>!!e&&!Number.isNaN(Number(e)),ir=e=>Qe(e,"number",Je),pt=e=>!!e&&Number.isInteger(Number(e)),ff=e=>e.endsWith("%")&&Je(e.slice(0,-1)),j=e=>_s.test(e),Re=e=>af.test(e),hf=new Set(["length","size","percentage"]),pf=e=>Qe(e,hf,$s),mf=e=>Qe(e,"position",$s),gf=new Set(["image","url"]),yf=e=>Qe(e,gf,wf),vf=e=>Qe(e,"",xf),mt=()=>!0,Qe=(e,t,n)=>{const r=_s.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},bf=e=>lf.test(e)&&!cf.test(e),$s=()=>!1,xf=e=>uf.test(e),wf=e=>df.test(e),Tf=rf(()=>{const e=G("colors"),t=G("spacing"),n=G("blur"),r=G("brightness"),o=G("borderColor"),i=G("borderRadius"),s=G("borderSpacing"),a=G("borderWidth"),l=G("contrast"),c=G("grayscale"),u=G("hueRotate"),d=G("invert"),f=G("gap"),h=G("gradientColorStops"),p=G("gradientColorStopPositions"),y=G("inset"),v=G("margin"),m=G("opacity"),b=G("padding"),x=G("saturate"),S=G("scale"),g=G("sepia"),k=G("skew"),D=G("space"),M=G("translate"),C=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",j,t],R=()=>[j,t],te=()=>["",De,Ie],Z=()=>["auto",Je,j],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ke=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],me=()=>["","0",j],we=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ge=()=>[Je,j];return{cacheSize:500,separator:":",theme:{colors:[mt],spacing:[De,Ie],blur:["none","",Re,j],brightness:ge(),borderColor:[e],borderRadius:["none","","full",Re,j],borderSpacing:R(),borderWidth:te(),contrast:ge(),grayscale:me(),hueRotate:ge(),invert:me(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[ff,Ie],inset:N(),margin:N(),opacity:ge(),padding:R(),saturate:ge(),scale:ge(),sepia:me(),skew:ge(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",j]}],container:["container"],columns:[{columns:[Re]}],"break-after":[{"break-after":we()}],"break-before":[{"break-before":we()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),j]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pt,j]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",j]}],grow:[{grow:me()}],shrink:[{shrink:me()}],order:[{order:["first","last","none",pt,j]}],"grid-cols":[{"grid-cols":[mt]}],"col-start-end":[{col:["auto",{span:["full",pt,j]},j]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[mt]}],"row-start-end":[{row:["auto",{span:[pt,j]},j]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",j]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",j]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",j,t]}],"min-w":[{"min-w":[j,t,"min","max","fit"]}],"max-w":[{"max-w":[j,t,"none","full","min","max","fit","prose",{screen:[Re]},Re]}],h:[{h:[j,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[j,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[j,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[j,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Re,Ie]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ir]}],"font-family":[{font:[mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",j]}],"line-clamp":[{"line-clamp":["none",Je,ir]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",De,j]}],"list-image":[{"list-image":["none",j]}],"list-style-type":[{list:["none","disc","decimal",j]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",De,Ie]}],"underline-offset":[{"underline-offset":["auto",De,j]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),mf]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pf]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...ke(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:ke()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ke()]}],"outline-offset":[{"outline-offset":[De,j]}],"outline-w":[{outline:[De,Ie]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[De,Ie]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Re,vf]}],"shadow-color":[{shadow:[mt]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Re,j]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[g]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",j]}],duration:[{duration:ge()}],ease:[{ease:["linear","in","out","in-out",j]}],delay:[{delay:ge()}],animate:[{animate:["none","spin","ping","pulse","bounce",j]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[pt,j]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",j]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[De,Ie,ir]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function ar(...e){return Tf(Kd(e))}const Sf=({onClose:e,setClickedCreate:t,isDisabled:n,tailwindClassDefinitions:r})=>A.jsx("div",{children:A.jsxs("div",{className:"flex justify-end space-x-4",children:[A.jsx("button",{className:ar("px-4 py-2",r==null?void 0:r.SecondaryButton,r==null?void 0:r.SecondaryButtonHover),onClick:()=>e==null?void 0:e(!1),children:"Cancel"}),A.jsx("button",{className:ar("px-4 py-2",r==null?void 0:r.PrimaryButton,r==null?void 0:r.PrimaryButtonHover,n&&(r==null?void 0:r.PrimaryButtonDisabled)),onClick:()=>{t(!0)},disabled:n,children:"Create"})]})}),lr=P.createContext({});function cr(e){const t=P.useRef(null);return t.current===null&&(t.current=e()),t.current}const tn=P.createContext(null),ur=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Ef extends Pn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Pf({children:e,isPresent:t,anchorX:n}){const r=P.useId(),o=P.useRef(null),i=P.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=P.useContext(ur);return P.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:d}=i.current;if(t||!o.current||!a||!l)return;const f=n==="left"?`left: ${u}`:`right: ${d}`;o.current.dataset.motionPopId=r;const h=document.createElement("style");return s&&(h.nonce=s),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
125
+ [data-motion-pop-id="${r}"] {
126
+ position: absolute !important;
127
+ width: ${a}px !important;
128
+ height: ${l}px !important;
129
+ ${f}px !important;
130
+ top: ${c}px !important;
131
+ }
132
+ `),()=>{document.head.removeChild(h)}},[t]),A.jsx(Ef,{isPresent:t,childRef:o,sizeRef:i,children:Pn.cloneElement(e,{ref:o})})}const Cf=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a})=>{const l=cr(Af),c=P.useId(),u=P.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=P.useMemo(()=>({id:c,initial:t,isPresent:n,custom:o,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return P.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),Pn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),s==="popLayout"&&(e=A.jsx(Pf,{isPresent:n,anchorX:a,children:e})),A.jsx(tn.Provider,{value:d,children:e})};function Af(){return new Map}function zs(e=!0){const t=P.useContext(tn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=P.useId();P.useEffect(()=>{e&&o(i)},[e]);const s=P.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const nn=e=>e.key||"";function Ks(e){const t=[];return P.Children.forEach(e,n=>{P.isValidElement(n)&&t.push(n)}),t}const dr=typeof window<"u",Hs=dr?P.useLayoutEffect:P.useEffect,kf=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left"})=>{const[l,c]=zs(s),u=P.useMemo(()=>Ks(e),[e]),d=s&&!l?[]:u.map(nn),f=P.useRef(!0),h=P.useRef(u),p=cr(()=>new Map),[y,v]=P.useState(u),[m,b]=P.useState(u);Hs(()=>{f.current=!1,h.current=u;for(let g=0;g<m.length;g++){const k=nn(m[g]);d.includes(k)?p.delete(k):p.get(k)!==!0&&p.set(k,!1)}},[m,d.length,d.join("-")]);const x=[];if(u!==y){let g=[...u];for(let k=0;k<m.length;k++){const D=m[k],M=nn(D);d.includes(M)||(g.splice(k,0,D),x.push(D))}return i==="wait"&&x.length&&(g=x),b(Ks(g)),v(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&m.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=P.useContext(lr);return A.jsx(A.Fragment,{children:m.map(g=>{const k=nn(g),D=s&&!l?!1:u===m||d.includes(k),M=()=>{if(p.has(k))p.set(k,!0);else return;let C=!0;p.forEach(L=>{L||(C=!1)}),C&&(S==null||S(),b(h.current),s&&(c==null||c()),r&&r())};return A.jsx(Cf,{isPresent:D,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,onExitComplete:D?void 0:M,anchorX:a,children:g},k)})})},pe=e=>e;let et=pe,Fe=pe;process.env.NODE_ENV!=="production"&&(et=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fe=(e,t)=>{if(!e)throw new Error(t)});function fr(e){let t;return()=>(t===void 0&&(t=e()),t)}const tt=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Pe=e=>e*1e3,Me=e=>e/1e3,Df={skipAnimations:!1,useManualTiming:!1},rn=["read","resolveKeyframes","update","preRender","render","postRender"],Gs={value:null,addProjectionMetrics:null};function Mf(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){s.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const y=h&&o?n:r;return f&&s.add(d),y.has(d)||y.add(d),d},cancel:d=>{r.delete(d),s.delete(d)},process:d=>{if(a=d,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&Gs.value&&Gs.value.frameloop[t].push(l),l=0,n.clear(),o=!1,i&&(i=!1,u.process(d))}};return u}const Vf=40;function Ws(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=rn.reduce((m,b)=>(m[b]=Mf(i,t?b:void 0),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const m=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(m-o.timestamp,Vf),1),o.timestamp=m,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},p=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:rn.reduce((m,b)=>{const x=s[b];return m[b]=(S,g=!1,k=!1)=>(n||p(),x.schedule(S,g,k)),m},{}),cancel:m=>{for(let b=0;b<rn.length;b++)s[rn[b]].cancel(m)},state:o,steps:s}}const{schedule:H,cancel:je,state:se,steps:hr}=Ws(typeof requestAnimationFrame<"u"?requestAnimationFrame:pe,!0),qs=P.createContext({strict:!1}),Ys={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},nt={};for(const e in Ys)nt[e]={isEnabled:t=>Ys[e].some(n=>!!t[n])};function Lf(e){for(const t in e)nt[t]={...nt[t],...e[t]}}const Of=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function on(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Of.has(e)}let Xs=e=>!on(e);function If(e){e&&(Xs=t=>t.startsWith("on")?!on(t):e(t))}try{If(require("@emotion/is-prop-valid").default)}catch{}function Rf(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Xs(o)||n===!0&&on(o)||!t&&!on(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Zs=new Set;function sn(e,t,n){e||Zs.has(t)||(console.warn(t),Zs.add(t))}function Ff(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&sn(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const an=P.createContext({});function ln(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function gt(e){return typeof e=="string"||Array.isArray(e)}const pr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mr=["initial",...pr];function cn(e){return ln(e.animate)||mr.some(t=>gt(e[t]))}function Js(e){return!!(cn(e)||e.variants)}function jf(e,t){if(cn(e)){const{initial:n,animate:r}=e;return{initial:n===!1||gt(n)?n:void 0,animate:gt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Nf(e){const{initial:t,animate:n}=jf(e,P.useContext(an));return P.useMemo(()=>({initial:t,animate:n}),[Qs(t),Qs(n)])}function Qs(e){return Array.isArray(e)?e.join(" "):e}const Uf=Symbol.for("motionComponentSymbol");function rt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Bf(e,t,n){return P.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rt(n)&&(n.current=r))},[t])}const gr=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ei="data-"+gr("framerAppearId"),{schedule:yr,cancel:iy}=Ws(queueMicrotask,!1),ti=P.createContext({});function _f(e,t,n,r,o){var i,s;const{visualElement:a}=P.useContext(an),l=P.useContext(qs),c=P.useContext(tn),u=P.useContext(ur).reducedMotion,d=P.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,h=P.useContext(ti);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&$f(d.current,n,o,h);const p=P.useRef(!1);P.useInsertionEffect(()=>{f&&p.current&&f.update(n,c)});const y=n[ei],v=P.useRef(!!y&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return Hs(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),yr.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),P.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,y)}),v.current=!1))}),f}function $f(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ni(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&rt(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function ni(e){if(e)return e.options.allowProjection!==!1?e.projection:ni(e.parent)}function zf({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var i,s;e&&Lf(e);function a(c,u){let d;const f={...P.useContext(ur),...c,layoutId:Kf(c)},{isStatic:h}=f,p=Nf(c),y=r(c,h);if(!h&&dr){Hf(f,e);const v=Gf(f);d=v.MeasureLayout,p.visualElement=_f(o,y,f,t,v.ProjectionNode)}return A.jsxs(an.Provider,{value:p,children:[d&&p.visualElement?A.jsx(d,{visualElement:p.visualElement,...f}):null,n(o,c,Bf(y,p.visualElement,u),y,h,p.visualElement)]})}a.displayName=`motion.${typeof o=="string"?o:`create(${(s=(i=o.displayName)!==null&&i!==void 0?i:o.name)!==null&&s!==void 0?s:""})`}`;const l=P.forwardRef(a);return l[Uf]=o,l}function Kf({layoutId:e}){const t=P.useContext(lr).id;return t&&e!==void 0?t+"-"+e:e}function Hf(e,t){const n=P.useContext(qs).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?et(!1,r):Fe(!1,r)}}function Gf(e){const{drag:t,layout:n}=nt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ri=e=>t=>typeof t=="string"&&t.startsWith(e),vr=ri("--"),Wf=ri("var(--"),br=e=>Wf(e)?qf.test(e.split("/*")[0].trim()):!1,qf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yt={};function Yf(e){for(const t in e)yt[t]=e[t],vr(t)&&(yt[t].isCSSVariable=!0)}const ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=new Set(ot);function oi(e,{layout:t,layoutId:n}){return ze.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!yt[e]||e==="opacity")}const ue=e=>!!(e&&e.getVelocity),si=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ve=(e,t,n)=>n>t?t:n<e?e:n,st={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vt={...st,transform:e=>Ve(0,1,e)},un={...st,default:1},bt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ne=bt("deg"),Ce=bt("%"),O=bt("px"),Xf=bt("vh"),Zf=bt("vw"),ii={...Ce,parse:e=>Ce.parse(e)/100,transform:e=>Ce.transform(e*100)},Jf={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,radius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,top:O,right:O,bottom:O,left:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,backgroundPositionX:O,backgroundPositionY:O},Qf={rotate:Ne,rotateX:Ne,rotateY:Ne,rotateZ:Ne,scale:un,scaleX:un,scaleY:un,scaleZ:un,skew:Ne,skewX:Ne,skewY:Ne,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:vt,originX:ii,originY:ii,originZ:O},ai={...st,transform:Math.round},xr={...Jf,...Qf,zIndex:ai,size:O,fillOpacity:vt,strokeOpacity:vt,numOctaves:ai},eh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},th=ot.length;function nh(e,t,n){let r="",o=!0;for(let i=0;i<th;i++){const s=ot[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=si(a,xr[s]);if(!l){o=!1;const u=eh[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function wr(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(ze.has(l)){s=!0;continue}else if(vr(l)){o[l]=c;continue}else{const u=si(c,xr[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=nh(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Tr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function li(e,t,n){for(const r in t)!ue(t[r])&&!oi(r,n)&&(e[r]=t[r])}function rh({transformTemplate:e},t){return P.useMemo(()=>{const n=Tr();return wr(n,t,e),Object.assign({},n.vars,n.style)},[t])}function oh(e,t){const n=e.style||{},r={};return li(r,n,e),Object.assign(r,rh(e,t)),r}function sh(e,t){const n={},r=oh(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ih=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Sr(e){return typeof e!="string"||e.includes("-")?!1:!!(ih.indexOf(e)>-1||/[A-Z]/u.test(e))}const ah={offset:"stroke-dashoffset",array:"stroke-dasharray"},lh={offset:"strokeDashoffset",array:"strokeDasharray"};function ch(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?ah:lh;e[i.offset]=O.transform(-r);const s=O.transform(t),a=O.transform(n);e[i.array]=`${s} ${a}`}function ci(e,t,n){return typeof e=="string"?e:O.transform(t+n*e)}function uh(e,t,n){const r=ci(t,e.x,e.width),o=ci(n,e.y,e.height);return`${r} ${o}`}function Er(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(wr(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:p}=e;f.transform&&(p&&(h.transform=f.transform),delete f.transform),p&&(o!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=uh(p,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&ch(f,s,a,l,!1)}const ui=()=>({...Tr(),attrs:{}}),Pr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dh(e,t,n,r){const o=P.useMemo(()=>{const i=ui();return Er(i,t,Pr(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};li(i,e.style,e),o.style={...i,...o.style}}return o}function fh(e=!1){return(n,r,o,{latestValues:i},s)=>{const l=(Sr(n)?dh:sh)(r,i,s,n),c=Rf(r,typeof n=="string",e),u=n!==P.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=P.useMemo(()=>ue(d)?d.get():d,[d]);return P.createElement(n,{...u,children:f})}}function di(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Cr(e,t,n,r){if(typeof t=="function"){const[o,i]=di(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=di(r);t=t(n!==void 0?n:e.custom,o,i)}return t}const Ar=e=>Array.isArray(e),hh=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),ph=e=>Ar(e)?e[e.length-1]||0:e;function dn(e){const t=ue(e)?e.get():e;return hh(t)?t.toValue():t}function mh({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:gh(r,o,i,e),renderState:t()};return n&&(s.onMount=a=>n({props:r,current:a,...s}),s.onUpdate=a=>n(a)),s}const fi=e=>(t,n)=>{const r=P.useContext(an),o=P.useContext(tn),i=()=>mh(e,t,r,o);return n?i():cr(i)};function gh(e,t,n,r){const o={},i=r(e,{});for(const f in i)o[f]=dn(i[f]);let{initial:s,animate:a}=e;const l=cn(e),c=Js(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!ln(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const p=Cr(e,f[h]);if(p){const{transitionEnd:y,transition:v,...m}=p;for(const b in m){let x=m[b];if(Array.isArray(x)){const S=u?x.length-1:0;x=x[S]}x!==null&&(o[b]=x)}for(const b in y)o[b]=y[b]}}}return o}function kr(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(ue(o[s])||t.style&&ue(t.style[s])||oi(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[s]=o[s]);return i}const yh={useVisualState:fi({scrapeMotionValuesFromProps:kr,createRenderState:Tr})};function hi(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function pi(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const mi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function gi(e,t,n,r){pi(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(mi.has(o)?o:gr(o),t.attrs[o])}function yi(e,t,n){const r=kr(e,t,n);for(const o in e)if(ue(e[o])||ue(t[o])){const i=ot.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const vi=["x","y","width","height","cx","cy","r"],vh={useVisualState:fi({scrapeMotionValuesFromProps:yi,createRenderState:ui,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in o)if(ze.has(a)){i=!0;break}}if(!i)return;let s=!t;if(t)for(let a=0;a<vi.length;a++){const l=vi[a];e[l]!==t[l]&&(s=!0)}s&&H.read(()=>{hi(n,r),H.render(()=>{Er(r,o,Pr(n.tagName),e.transformTemplate),gi(n,r)})})}})};function bh(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const s={...Sr(r)?vh:yh,preloadedFeatures:e,useRender:fh(o),createVisualElement:t,Component:r};return zf(s)}}function fn(e,t,n){const r=e.getProps();return Cr(r,t,n!==void 0?n:r.custom,e)}const xh=fr(()=>window.ScrollTimeline!==void 0);class wh{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(xh()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Th extends wh{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Dr(e,t){return e?e[t]||e.default||e:void 0}const Mr=2e4;function bi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Mr;)t+=n,r=e.next(t);return t>=Mr?1/0:t}function Vr(e){return typeof e=="function"}function xi(e,t){e.timeline=t,e.onfinish=null}const Lr=e=>Array.isArray(e)&&typeof e[0]=="number",Sh={linearEasing:void 0};function Eh(e,t){const n=fr(e);return()=>{var r;return(r=Sh[t])!==null&&r!==void 0?r:n()}}const hn=Eh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wi=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(tt(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Ti(e){return!!(typeof e=="function"&&hn()||!e||typeof e=="string"&&(e in Or||hn())||Lr(e)||Array.isArray(e)&&e.every(Ti))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Or={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Si(e,t){if(e)return typeof e=="function"&&hn()?wi(e,t):Lr(e)?xt(e):Array.isArray(e)?e.map(n=>Si(n,t)||Or.easeOut):Or[e]}const Te={x:!1,y:!1};function Ei(){return Te.x||Te.y}function Ph(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;const i=(r=void 0)!==null&&r!==void 0?r:o.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Pi(e,t){const n=Ph(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Ci(e){return!(e.pointerType==="touch"||Ei())}function Ch(e,t,n={}){const[r,o,i]=Pi(e,n),s=a=>{if(!Ci(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Ci(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Ai=(e,t)=>t?e===t?!0:Ai(e,t.parentElement):!1,Ir=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ah=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kh(e){return Ah.has(e.tagName)||e.tabIndex!==-1}const wt=new WeakSet;function ki(e){return t=>{t.key==="Enter"&&e(t)}}function Rr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Dh=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ki(()=>{if(wt.has(n))return;Rr(n,"down");const o=ki(()=>{Rr(n,"up")}),i=()=>Rr(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Di(e){return Ir(e)&&!Ei()}function Mh(e,t,n={}){const[r,o,i]=Pi(e,n),s=a=>{const l=a.currentTarget;if(!Di(a)||wt.has(l))return;wt.add(l);const c=t(l,a),u=(h,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Di(h)||!wt.has(l))&&(wt.delete(l),typeof c=="function"&&c(h,{success:p}))},d=h=>{u(h,n.useGlobalTarget||Ai(l,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{!kh(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),a.addEventListener("focus",c=>Dh(c,o),o)}),i}function Vh(e){return e==="x"||e==="y"?Te[e]?null:(Te[e]=!0,()=>{Te[e]=!1}):Te.x||Te.y?null:(Te.x=Te.y=!0,()=>{Te.x=Te.y=!1})}const Mi=new Set(["width","height","top","left","right","bottom",...ot]);let pn;function Lh(){pn=void 0}const Ae={now:()=>(pn===void 0&&Ae.set(se.isProcessing||Df.useManualTiming?se.timestamp:performance.now()),pn),set:e=>{pn=e,queueMicrotask(Lh)}};function Fr(e,t){e.indexOf(t)===-1&&e.push(t)}function jr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nr{constructor(){this.subscriptions=[]}add(t){return Fr(this.subscriptions,t),()=>jr(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Vi(e,t){return t?e*(1e3/t):0}const Li=30,Oh=e=>!isNaN(parseFloat(e));class Ih{constructor(t,n={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const i=Ae.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ae.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Oh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&sn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Nr);const r=this.events[t].add(n);return t==="change"?()=>{r(),H.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ae.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Li)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Li);return Vi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Tt(e,t){return new Ih(e,t)}function Rh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tt(n))}function Fh(e,t){const n=fn(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=ph(i[s]);Rh(e,s,a)}}function jh(e){return!!(ue(e)&&e.add)}function Ur(e,t){const n=e.getValue("willChange");if(jh(n))return n.add(t)}function Oi(e){return e.props[ei]}const Ii=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Nh=1e-7,Uh=12;function Bh(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=Ii(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>Nh&&++a<Uh);return s}function St(e,t,n,r){if(e===t&&n===r)return pe;const o=i=>Bh(i,0,1,e,n);return i=>i===0||i===1?i:Ii(o(i),t,r)}const Ri=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fi=e=>t=>1-e(1-t),ji=St(.33,1.53,.69,.99),Br=Fi(ji),Ni=Ri(Br),Ui=e=>(e*=2)<1?.5*Br(e):.5*(2-Math.pow(2,-10*(e-1))),_r=e=>1-Math.sin(Math.acos(e)),Bi=Fi(_r),_i=Ri(_r),$i=e=>/^0[^.\s]+$/u.test(e);function _h(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$i(e):!0}const Et=e=>Math.round(e*1e5)/1e5,$r=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $h(e){return e==null}const zh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zr=(e,t)=>n=>!!(typeof n=="string"&&zh.test(n)&&n.startsWith(e)||t&&!$h(n)&&Object.prototype.hasOwnProperty.call(n,t)),zi=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match($r);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Kh=e=>Ve(0,255,e),Kr={...st,transform:e=>Math.round(Kh(e))},Ke={test:zr("rgb","red"),parse:zi("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Kr.transform(e)+", "+Kr.transform(t)+", "+Kr.transform(n)+", "+Et(vt.transform(r))+")"};function Hh(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Hr={test:zr("#"),parse:Hh,transform:Ke.transform},it={test:zr("hsl","hue"),parse:zi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ce.transform(Et(t))+", "+Ce.transform(Et(n))+", "+Et(vt.transform(r))+")"},de={test:e=>Ke.test(e)||Hr.test(e)||it.test(e),parse:e=>Ke.test(e)?Ke.parse(e):it.test(e)?it.parse(e):Hr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ke.transform(e):it.transform(e)},Gh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wh(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match($r))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Gh))===null||n===void 0?void 0:n.length)||0)>0}const Ki="number",Hi="color",qh="var",Yh="var(",Gi="${}",Xh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(Xh,l=>(de.test(l)?(r.color.push(i),o.push(Hi),n.push(de.parse(l))):l.startsWith(Yh)?(r.var.push(i),o.push(qh),n.push(l)):(r.number.push(i),o.push(Ki),n.push(parseFloat(l))),++i,Gi)).split(Gi);return{values:n,split:a,indexes:r,types:o}}function Wi(e){return Pt(e).values}function qi(e){const{split:t,types:n}=Pt(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===Ki?i+=Et(o[s]):a===Hi?i+=de.transform(o[s]):i+=o[s]}return i}}const Zh=e=>typeof e=="number"?0:e;function Jh(e){const t=Wi(e);return qi(e)(t.map(Zh))}const Ue={test:Wh,parse:Wi,createTransformer:qi,getAnimatableNone:Jh},Qh=new Set(["brightness","contrast","saturate","opacity"]);function ep(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($r)||[];if(!r)return e;const o=n.replace(r,"");let i=Qh.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const tp=/\b([a-z-]*)\(.*?\)/gu,Gr={...Ue,getAnimatableNone:e=>{const t=e.match(tp);return t?t.map(ep).join(" "):e}},np={...xr,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Gr,WebkitFilter:Gr},Wr=e=>np[e];function Yi(e,t){let n=Wr(e);return n!==Gr&&(n=Ue),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const rp=new Set(["auto","none","0"]);function op(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!rp.has(i)&&Pt(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Yi(n,o)}const Xi=e=>e===st||e===O,Zi=(e,t)=>parseFloat(e.split(", ")[t]),Ji=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Zi(o[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Zi(i[1],e):0}},sp=new Set(["x","y","z"]),ip=ot.filter(e=>!sp.has(e));function ap(e){const t=[];return ip.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const at={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ji(4,13),y:Ji(5,14)};at.translateX=at.x,at.translateY=at.y;const He=new Set;let qr=!1,Yr=!1;function Qi(){if(Yr){const e=Array.from(He).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=ap(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Yr=!1,qr=!1,He.forEach(e=>e.complete()),He.clear()}function ea(){He.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Yr=!0)})}function lp(){ea(),Qi()}class Xr{constructor(t,n,r,o,i,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(He.add(this),qr||(qr=!0,H.read(ea),H.resolveKeyframes(Qi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const s=o==null?void 0:o.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),o&&s===void 0&&o.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),He.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,He.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ta=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),cp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function up(e){const t=cp.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const dp=4;function na(e,t,n=1){Fe(n<=dp,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=up(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return ta(s)?parseFloat(s):s}return br(o)?na(o,t,n+1):o}const ra=e=>t=>t.test(e),oa=[st,O,Ce,Ne,Zf,Xf,{test:e=>e==="auto",parse:e=>e}],sa=e=>oa.find(ra(e));class ia extends Xr{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),br(c))){const u=na(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Mi.has(r)||t.length!==2)return;const[o,i]=t,s=sa(o),a=sa(i);if(s!==a)if(Xi(s)&&Xi(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)_h(t[o])&&r.push(o);r.length&&op(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const s=o.length-1,a=o[s];o[s]=at[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const aa=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ue.test(e)||e==="0")&&!e.startsWith("url("));function fp(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hp(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=aa(o,t),a=aa(i,t);return et(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!s||!a?!1:fp(e)||(n==="spring"||Vr(n))&&r}const pp=e=>e!==null;function mn(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(pp),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const mp=40;class la{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ae.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>mp?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lp(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ae.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:i,delay:s,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!hp(t,r,o,i))if(s)this.options.duration=0;else{l&&l(mn(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const q=(e,t,n)=>e+(t-e)*n;function Zr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Zr(l,a,e+1/3),i=Zr(l,a,e),s=Zr(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function gn(e,t){return n=>n>0?t:e}const Jr=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yp=[Hr,Ke,it],vp=e=>yp.find(t=>t.test(e));function ca(e){const t=vp(e);if(et(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===it&&(n=gp(n)),n}const ua=(e,t)=>{const n=ca(e),r=ca(t);if(!n||!r)return gn(e,t);const o={...n};return i=>(o.red=Jr(n.red,r.red,i),o.green=Jr(n.green,r.green,i),o.blue=Jr(n.blue,r.blue,i),o.alpha=q(n.alpha,r.alpha,i),Ke.transform(o))},bp=(e,t)=>n=>t(e(n)),Ct=(...e)=>e.reduce(bp),Qr=new Set(["none","hidden"]);function xp(e,t){return Qr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wp(e,t){return n=>q(e,t,n)}function eo(e){return typeof e=="number"?wp:typeof e=="string"?br(e)?gn:de.test(e)?ua:Ep:Array.isArray(e)?da:typeof e=="object"?de.test(e)?ua:Tp:gn}function da(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>eo(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function Tp(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=eo(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function Sp(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][o[s]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,o[s]++}return r}const Ep=(e,t)=>{const n=Ue.createTransformer(t),r=Pt(e),o=Pt(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Qr.has(e)&&!o.values.length||Qr.has(t)&&!r.values.length?xp(e,t):Ct(da(Sp(r,o),o.values),n):(et(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gn(e,t))};function fa(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?q(e,t,n):eo(e)(e,t)}const Pp=5;function ha(e,t,n){const r=Math.max(t-Pp,0);return Vi(n-e(r),t-r)}const Y={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},to=.001;function Cp({duration:e=Y.duration,bounce:t=Y.bounce,velocity:n=Y.velocity,mass:r=Y.mass}){let o,i;et(e<=Pe(Y.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=Ve(Y.minDamping,Y.maxDamping,s),e=Ve(Y.minDuration,Y.maxDuration,Me(e)),s<1?(o=c=>{const u=c*s,d=u*e,f=u-n,h=no(c,s),p=Math.exp(-d);return to-f/h*p},i=c=>{const d=c*s*e,f=d*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,p=Math.exp(-d),y=no(Math.pow(c,2),s);return(-o(c)+to>0?-1:1)*((f-h)*p)/y}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-to+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kp(o,i,a);if(e=Pe(e),isNaN(l))return{stiffness:Y.stiffness,damping:Y.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const Ap=12;function kp(e,t,n){let r=n;for(let o=1;o<Ap;o++)r=r-e(r)/t(r);return r}function no(e,t){return e*Math.sqrt(1-t*t)}const Dp=["duration","bounce"],Mp=["stiffness","damping","mass"];function pa(e,t){return t.some(n=>e[n]!==void 0)}function Vp(e){let t={velocity:Y.velocity,stiffness:Y.stiffness,damping:Y.damping,mass:Y.mass,isResolvedFromDuration:!1,...e};if(!pa(e,Mp)&&pa(e,Dp))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Ve(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Y.mass,stiffness:o,damping:i}}else{const n=Cp(e);t={...t,...n,mass:Y.mass},t.isResolvedFromDuration=!0}return t}function ma(e=Y.visualDuration,t=Y.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=Vp({...n,velocity:-Me(n.velocity||0)}),p=f||0,y=c/(2*Math.sqrt(l*u)),v=s-i,m=Me(Math.sqrt(l/u)),b=Math.abs(v)<5;r||(r=b?Y.restSpeed.granular:Y.restSpeed.default),o||(o=b?Y.restDelta.granular:Y.restDelta.default);let x;if(y<1){const g=no(m,y);x=k=>{const D=Math.exp(-y*m*k);return s-D*((p+y*m*v)/g*Math.sin(g*k)+v*Math.cos(g*k))}}else if(y===1)x=g=>s-Math.exp(-m*g)*(v+(p+m*v)*g);else{const g=m*Math.sqrt(y*y-1);x=k=>{const D=Math.exp(-y*m*k),M=Math.min(g*k,300);return s-D*((p+y*m*v)*Math.sinh(M)+g*v*Math.cosh(M))/g}}const S={calculatedDuration:h&&d||null,next:g=>{const k=x(g);if(h)a.done=g>=d;else{let D=0;y<1&&(D=g===0?Pe(p):ha(x,g,k));const M=Math.abs(D)<=r,C=Math.abs(s-k)<=o;a.done=M&&C}return a.value=a.done?s:k,a},toString:()=>{const g=Math.min(bi(S),Mr),k=wi(D=>S.next(g*D).value,g,30);return g+"ms "+k}};return S}function ga({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=M=>a!==void 0&&M<a||l!==void 0&&M>l,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)<Math.abs(l-M)?a:l;let y=n*t;const v=d+y,m=s===void 0?v:s(v);m!==v&&(y=m-d);const b=M=>-y*Math.exp(-M/r),x=M=>m+b(M),S=M=>{const C=b(M),L=x(M);f.done=Math.abs(C)<=c,f.value=f.done?m:L};let g,k;const D=M=>{h(f.value)&&(g=M,k=ma({keyframes:[f.value,p(f.value)],velocity:ha(x,M,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return D(0),{calculatedDuration:null,next:M=>{let C=!1;return!k&&g===void 0&&(C=!0,S(M),D(M)),g!==void 0&&M>=g?k.next(M-g):(!C&&S(M),f)}}}const Lp=St(.42,0,1,1),Op=St(0,0,.58,1),ya=St(.42,0,.58,1),Ip=e=>Array.isArray(e)&&typeof e[0]!="number",va={linear:pe,easeIn:Lp,easeInOut:ya,easeOut:Op,circIn:_r,circInOut:_i,circOut:Bi,backIn:Br,backInOut:Ni,backOut:ji,anticipate:Ui},ba=e=>{if(Lr(e)){Fe(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return St(t,n,r,o)}else if(typeof e=="string")return Fe(va[e]!==void 0,`Invalid easing type '${e}'`),va[e];return e};function Rp(e,t,n){const r=[],o=n||fa,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||pe:t;a=Ct(l,a)}r.push(a)}return r}function Fp(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Fe(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Rp(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=tt(e[d],e[d+1],u);return a[d](f)};return n?u=>c(Ve(e[0],e[i-1],u)):c}function jp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=tt(0,t,r);e.push(q(n,1,o))}}function Np(e){const t=[0];return jp(t,e.length-1),t}function Up(e,t){return e.map(n=>n*t)}function Bp(e,t){return e.map(()=>t||ya).splice(0,e.length-1)}function yn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Ip(r)?r.map(ba):ba(r),i={done:!1,value:t[0]},s=Up(n&&n.length===t.length?n:Np(t),e),a=Fp(s,t,{ease:Array.isArray(o)?o:Bp(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const _p=e=>{const t=({timestamp:n})=>e(n);return{start:()=>H.update(t,!0),stop:()=>je(t),now:()=>se.isProcessing?se.timestamp:Ae.now()}},$p={decay:ga,inertia:ga,tween:yn,keyframes:yn,spring:ma},zp=e=>e/100;class ro extends la{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:o,keyframes:i}=this.options,s=(o==null?void 0:o.KeyframeResolver)||Xr,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new s(i,a,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=this.options,a=Vr(n)?n:$p[n]||yn;let l,c;a!==yn&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&Fe(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l=Ct(zp,fa(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});i==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=bi(u));const{calculatedDuration:d}=u,f=d+o,h=f*(r+1)-o;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:o,generator:i,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return i.next(0);const{delay:f,repeat:h,repeatType:p,repeatDelay:y,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?m<0:m>u;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let x=this.currentTime,S=i;if(h){const M=Math.min(this.currentTime,u)/d;let C=Math.floor(M),L=M%1;!L&&M>=1&&(L=1),L===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(p==="reverse"?(L=1-L,y&&(L-=y/d)):p==="mirror"&&(S=s)),x=Ve(0,1,L)*d}const g=b?{done:!1,value:l[0]}:S.next(x);a&&(g.value=a(g.value));let{done:k}=g;!b&&c!==null&&(k=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return D&&o!==void 0&&(g.value=mn(l,this.options,o)),v&&v(g.value),D&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Me(t.calculatedDuration):0}get time(){return Me(this.currentTime)}set time(t){t=Pe(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Me(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=_p,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Kp=new Set(["opacity","clipPath","filter","transform"]);function Hp(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Si(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"})}const Gp=fr(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),vn=10,Wp=2e4;function qp(e){return Vr(e.type)||e.type==="spring"||!Ti(e.ease)}function Yp(e,t){const n=new ro({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<Wp;)r=n.sample(i),o.push(r.value),i+=vn;return{times:void 0,keyframes:o,duration:i-vn,ease:"linear"}}const xa={anticipate:Ui,backInOut:Ni,circInOut:_i};function Xp(e){return e in xa}class wa extends la{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:i}=this.options;this.resolver=new ia(i,(s,a)=>this.onKeyframesResolved(s,a),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&hn()&&Xp(i)&&(i=xa[i]),qp(this.options)){const{onComplete:d,onUpdate:f,motionValue:h,element:p,...y}=this.options,v=Yp(t,y);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,o=v.times,i=v.ease,s="keyframes"}const u=Hp(a.owner.current,l,t,{...this.options,duration:r,times:o,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(xi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(mn(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:s,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Me(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Me(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Pe(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return pe;const{animation:r}=n;xi(r,t)}return pe}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:i,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...h}=this.options,p=new ro({...h,keyframes:r,duration:o,type:i,ease:s,times:a,isGenerator:!0}),y=Pe(this.time);c.setWithVelocity(p.sample(y-vn).value,p.sample(y).value,vn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:i,damping:s,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Gp()&&r&&Kp.has(r)&&!l&&!c&&!o&&i!=="mirror"&&s!==0&&a!=="inertia"}}const Zp={type:"spring",stiffness:500,damping:25,restSpeed:10},Jp=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Qp={type:"keyframes",duration:.8},em={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tm=(e,{keyframes:t})=>t.length>2?Qp:ze.has(e)?e.startsWith("scale")?Jp(t[1]):Zp:em;function nm({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const oo=(e,t,n,r={},o,i)=>s=>{const a=Dr(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Pe(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};nm(a)||(u={...u,...tm(e,u)}),u.duration&&(u.duration=Pe(u.duration)),u.repeatDelay&&(u.repeatDelay=Pe(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!i&&t.get()!==void 0){const f=mn(u.keyframes,a);if(f!==void 0)return H.update(()=>{u.onUpdate(f),u.onComplete()}),new Th([])}return!i&&wa.supports(u)?new wa(u):new ro(u)};function rm({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ta(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,(i=e.latestValues[d])!==null&&i!==void 0?i:null),h=l[d];if(h===void 0||u&&rm(u,d))continue;const p={delay:n,...Dr(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const m=Oi(e);if(m){const b=window.MotionHandoffAnimation(m,d,H);b!==null&&(p.startTime=b,y=!0)}}Ur(e,d),f.start(oo(d,f,h,e.shouldReduceMotion&&Mi.has(d)?{type:!1}:p,e,y));const v=f.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{H.update(()=>{a&&Fh(e,a)})}),c}function so(e,t,n={}){var r;const o=fn(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Ta(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return om(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[s,a]:[a,s];return c().then(()=>u())}else return Promise.all([s(),a(n.delay)])}function om(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(sm).forEach((c,u)=>{c.notify("AnimationStart",t),s.push(so(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function sm(e,t){return e.sortNodePosition(t)}function im(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>so(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=so(e,t,n);else{const o=typeof t=="function"?fn(e,t,n.custom):t;r=Promise.all(Ta(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Sa(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const am=mr.length;function Ea(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ea(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<am;n++){const r=mr[n],o=e.props[r];(gt(o)||o===!1)&&(t[r]=o)}return t}const lm=[...pr].reverse(),cm=pr.length;function um(e){return t=>Promise.all(t.map(({animation:n,options:r})=>im(e,n,r)))}function dm(e){let t=um(e),n=Pa(),r=!0;const o=l=>(c,u)=>{var d;const f=fn(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:p,...y}=f;c={...c,...y,...p}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=Ea(e.parent)||{},d=[],f=new Set;let h={},p=1/0;for(let v=0;v<cm;v++){const m=lm[v],b=n[m],x=c[m]!==void 0?c[m]:u[m],S=gt(x),g=m===l?b.isActive:null;g===!1&&(p=v);let k=x===u[m]&&x!==c[m]&&S;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),b.protectedKeys={...h},!b.isActive&&g===null||!x&&!b.prevProp||ln(x)||typeof x=="boolean")continue;const D=fm(b.prevProp,x);let M=D||m===l&&b.isActive&&!k&&S||v>p&&S,C=!1;const L=Array.isArray(x)?x:[x];let N=L.reduce(o(m),{});g===!1&&(N={});const{prevResolvedValues:R={}}=b,te={...R,...N},Z=K=>{M=!0,f.has(K)&&(C=!0,f.delete(K)),b.needsAnimating[K]=!0;const Q=e.getValue(K);Q&&(Q.liveStyle=!1)};for(const K in te){const Q=N[K],me=R[K];if(h.hasOwnProperty(K))continue;let we=!1;Ar(Q)&&Ar(me)?we=!Sa(Q,me):we=Q!==me,we?Q!=null?Z(K):f.add(K):Q!==void 0&&f.has(K)?Z(K):b.protectedKeys[K]=!0}b.prevProp=x,b.prevResolvedValues=N,b.isActive&&(h={...h,...N}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(k&&D)||C)&&d.push(...L.map(K=>({animation:K,options:{type:m}})))}if(f.size){const v={};f.forEach(m=>{const b=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),v[m]=b??null}),d.push({animation:v})}let y=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=s(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Pa(),r=!0}}}function fm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Sa(t,e):!1}function Ge(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Pa(){return{animate:Ge(!0),whileInView:Ge(),whileHover:Ge(),whileTap:Ge(),whileDrag:Ge(),whileFocus:Ge(),exit:Ge()}}class Be{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hm extends Be{constructor(t){super(t),t.animationState||(t.animationState=dm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ln(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let pm=0;class mm extends Be{constructor(){super(...arguments),this.id=pm++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gm={animation:{Feature:hm},exit:{Feature:mm}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function kt(e){return{point:{x:e.pageX,y:e.pageY}}}const ym=e=>t=>Ir(t)&&e(t,kt(t));function Dt(e,t,n,r){return At(e,t,ym(n),r)}const Ca=(e,t)=>Math.abs(e-t);function vm(e,t){const n=Ca(e.x,t.x),r=Ca(e.y,t.y);return Math.sqrt(n**2+r**2)}class Aa{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=ao(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=vm(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:p}=d,{timestamp:y}=se;this.history.push({...p,timestamp:y});const{onStart:v,onMove:m}=this.handlers;f||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=io(f,this.transformPagePoint),H.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ao(d.type==="pointercancel"?this.lastMoveEventInfo:io(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,v),p&&p(d,v)},!Ir(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const s=kt(t),a=io(s,this.transformPagePoint),{point:l}=a,{timestamp:c}=se;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,ao(a,this.history)),this.removeListeners=Ct(Dt(this.contextWindow,"pointermove",this.handlePointerMove),Dt(this.contextWindow,"pointerup",this.handlePointerUp),Dt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),je(this.updatePoint)}}function io(e,t){return t?{point:t(e.point)}:e}function ka(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ao({point:e},t){return{point:e,delta:ka(e,Da(t)),offset:ka(e,bm(t)),velocity:xm(t,.1)}}function bm(e){return e[0]}function Da(e){return e[e.length-1]}function xm(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Da(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Pe(t)));)n--;if(!r)return{x:0,y:0};const i=Me(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const Ma=1e-4,wm=1-Ma,Tm=1+Ma,Va=.01,Sm=0-Va,Em=0+Va;function fe(e){return e.max-e.min}function Pm(e,t,n){return Math.abs(e-t)<=n}function La(e,t,n,r=.5){e.origin=r,e.originPoint=q(t.min,t.max,e.origin),e.scale=fe(n)/fe(t),e.translate=q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wm&&e.scale<=Tm||isNaN(e.scale))&&(e.scale=1),(e.translate>=Sm&&e.translate<=Em||isNaN(e.translate))&&(e.translate=0)}function Mt(e,t,n,r){La(e.x,t.x,n.x,r?r.originX:void 0),La(e.y,t.y,n.y,r?r.originY:void 0)}function Oa(e,t,n){e.min=n.min+t.min,e.max=e.min+fe(t)}function Cm(e,t,n){Oa(e.x,t.x,n.x),Oa(e.y,t.y,n.y)}function Ia(e,t,n){e.min=t.min-n.min,e.max=e.min+fe(t)}function Vt(e,t,n){Ia(e.x,t.x,n.x),Ia(e.y,t.y,n.y)}function Am(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?q(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?q(n,e,r.max):Math.min(e,n)),e}function Ra(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function km(e,{top:t,left:n,bottom:r,right:o}){return{x:Ra(e.x,n,o),y:Ra(e.y,t,r)}}function Fa(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Dm(e,t){return{x:Fa(e.x,t.x),y:Fa(e.y,t.y)}}function Mm(e,t){let n=.5;const r=fe(e),o=fe(t);return o>r?n=tt(t.min,t.max-r,e.min):r>o&&(n=tt(e.min,e.max-o,t.min)),Ve(0,1,n)}function Vm(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lo=.35;function Lm(e=lo){return e===!1?e=0:e===!0&&(e=lo),{x:ja(e,"left","right"),y:ja(e,"top","bottom")}}function ja(e,t,n){return{min:Na(e,t),max:Na(e,n)}}function Na(e,t){return typeof e=="number"?e:e[t]||0}const Ua=()=>({translate:0,scale:1,origin:0,originPoint:0}),lt=()=>({x:Ua(),y:Ua()}),Ba=()=>({min:0,max:0}),J=()=>({x:Ba(),y:Ba()});function be(e){return[e("x"),e("y")]}function _a({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Om({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Im(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function co(e){return e===void 0||e===1}function uo({scale:e,scaleX:t,scaleY:n}){return!co(e)||!co(t)||!co(n)}function We(e){return uo(e)||$a(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $a(e){return za(e.x)||za(e.y)}function za(e){return e&&e!=="0%"}function bn(e,t,n){const r=e-n,o=t*r;return n+o}function Ka(e,t,n,r,o){return o!==void 0&&(e=bn(e,o,r)),bn(e,n,r)+t}function fo(e,t=0,n=1,r,o){e.min=Ka(e.min,t,n,r,o),e.max=Ka(e.max,t,n,r,o)}function Ha(e,{x:t,y:n}){fo(e.x,t.translate,t.scale,t.originPoint),fo(e.y,n.translate,n.scale,n.originPoint)}const Ga=.999999999999,Wa=1.0000000000001;function Rm(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ut(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Ha(e,s)),r&&We(i.latestValues)&&ut(e,i.latestValues))}t.x<Wa&&t.x>Ga&&(t.x=1),t.y<Wa&&t.y>Ga&&(t.y=1)}function ct(e,t){e.min=e.min+t,e.max=e.max+t}function qa(e,t,n,r,o=.5){const i=q(e.min,e.max,o);fo(e,t,n,i,r)}function ut(e,t){qa(e.x,t.x,t.scaleX,t.scale,t.originX),qa(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ya(e,t){return _a(Im(e.getBoundingClientRect(),t))}function Fm(e,t,n){const r=Ya(e,n),{scroll:o}=t;return o&&(ct(r.x,o.offset.x),ct(r.y,o.offset.y)),r}const Xa=({current:e})=>e?e.ownerDocument.defaultView:null,jm=new WeakMap;class Nm{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=J(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(kt(u).point)},i=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:p}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vh(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),be(v=>{let m=this.getAxisMotionValue(v).get()||0;if(Ce.test(m)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[v];x&&(m=fe(x)*(parseFloat(m)/100))}}this.originPoint[v]=m}),p&&H.postRender(()=>p(u,d)),Ur(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:p,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:v}=d;if(h&&this.currentDirection===null){this.currentDirection=Um(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),y&&y(u,d)},a=(u,d)=>this.stop(u,d),l=()=>be(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Aa(t,{onSessionStart:o,onStart:i,onMove:s,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Xa(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&H.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!xn(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=Am(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&rt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=km(o.layoutBox,n):this.constraints=!1,this.elastic=Lm(r),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&be(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Vm(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rt(t))return!1;const r=t.current;Fe(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=Fm(r,o.root,this.visualElement.getTransformPagePoint());let s=Dm(o.layout.layoutBox,i);if(n){const a=n(Om(s));this.hasMutatedConstraints=!!a,a&&(s=_a(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=be(u=>{if(!xn(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,p={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ur(this.visualElement,t),r.start(oo(t,r,0,n,this.visualElement,!1))}stopAnimation(){be(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){be(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){be(n=>{const{drag:r}=this.getProps();if(!xn(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-q(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};be(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=Mm({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),be(s=>{if(!xn(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(q(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;jm.set(this.visualElement,this);const t=this.visualElement.current,n=Dt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),H.read(r);const s=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(be(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=lo,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function xn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Um(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Bm extends Be{constructor(t){super(t),this.removeGroupControls=pe,this.removeListeners=pe,this.controls=new Nm(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Za=e=>(t,n)=>{e&&H.postRender(()=>e(t,n))};class _m extends Be{constructor(){super(...arguments),this.removePointerDownListener=pe}onPointerDown(t){this.session=new Aa(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Xa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Za(t),onStart:Za(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&H.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Dt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const wn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ja(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Lt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=Ja(e,t.target.x),r=Ja(e,t.target.y);return`${n}% ${r}%`}},$m={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ue.parse(e);if(o.length>5)return r;const i=Ue.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=q(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}};class zm extends P.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;Yf(Km),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),wn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,s=r.projection;return s&&(s.isPresent=i,o||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||H.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),yr.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Qa(e){const[t,n]=zs(),r=P.useContext(lr);return A.jsx(zm,{...e,layoutGroup:r,switchLayoutGroup:P.useContext(ti),isPresent:t,safeToRemove:n})}const Km={borderRadius:{...Lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomLeftRadius:Lt,borderBottomRightRadius:Lt,boxShadow:$m};function Hm(e,t,n){const r=ue(e)?e:Tt(e);return r.start(oo("",r,t,n)),r.animation}function Gm(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Wm=(e,t)=>e.depth-t.depth;class qm{constructor(){this.children=[],this.isDirty=!1}add(t){Fr(this.children,t),this.isDirty=!0}remove(t){jr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Wm),this.isDirty=!1,this.children.forEach(t)}}function Ym(e,t){const n=Ae.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(je(r),e(i-t))};return H.read(r,!0),()=>je(r)}const el=["TopLeft","TopRight","BottomLeft","BottomRight"],Xm=el.length,tl=e=>typeof e=="string"?parseFloat(e):e,nl=e=>typeof e=="number"||O.test(e);function Zm(e,t,n,r,o,i){o?(e.opacity=q(0,n.opacity!==void 0?n.opacity:1,Jm(r)),e.opacityExit=q(t.opacity!==void 0?t.opacity:1,0,Qm(r))):i&&(e.opacity=q(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<Xm;s++){const a=`border${el[s]}Radius`;let l=rl(t,a),c=rl(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||nl(l)===nl(c)?(e[a]=Math.max(q(tl(l),tl(c),r),0),(Ce.test(c)||Ce.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=q(t.rotate||0,n.rotate||0,r))}function rl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Jm=ol(0,.5,Bi),Qm=ol(.5,.95,pe);function ol(e,t,n){return r=>r<e?0:r>t?1:n(tt(e,t,r))}function sl(e,t){e.min=t.min,e.max=t.max}function xe(e,t){sl(e.x,t.x),sl(e.y,t.y)}function il(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function al(e,t,n,r,o){return e-=t,e=bn(e,1/n,r),o!==void 0&&(e=bn(e,1/o,r)),e}function eg(e,t=0,n=1,r=.5,o,i=e,s=e){if(Ce.test(t)&&(t=parseFloat(t),t=q(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=q(i.min,i.max,r);e===i&&(a-=t),e.min=al(e.min,t,n,a,o),e.max=al(e.max,t,n,a,o)}function ll(e,t,[n,r,o],i,s){eg(e,t[n],t[r],t[o],t.scale,i,s)}const tg=["x","scaleX","originX"],ng=["y","scaleY","originY"];function cl(e,t,n,r){ll(e.x,t,tg,n?n.x:void 0,r?r.x:void 0),ll(e.y,t,ng,n?n.y:void 0,r?r.y:void 0)}function ul(e){return e.translate===0&&e.scale===1}function dl(e){return ul(e.x)&&ul(e.y)}function fl(e,t){return e.min===t.min&&e.max===t.max}function rg(e,t){return fl(e.x,t.x)&&fl(e.y,t.y)}function hl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pl(e,t){return hl(e.x,t.x)&&hl(e.y,t.y)}function ml(e){return fe(e.x)/fe(e.y)}function gl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class og{constructor(){this.members=[]}add(t){Fr(this.members,t),t.scheduleRender()}remove(t){if(jr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function sg(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const ho=["","X","Y","Z"],ig={visibility:"hidden"},yl=1e3;let ag=0;function po(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function vl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Oi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",H,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&vl(r)}function bl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t==null?void 0:t()){this.id=ag++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ug),this.nodes.forEach(mg),this.nodes.forEach(gg),this.nodes.forEach(dg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new qm)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Nr),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Gm(s),this.instance=s;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Ym(f,250),wn.hasAnimatedSinceResize&&(wn.hasAnimatedSinceResize=!1,this.nodes.forEach(wl))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||wg,{onLayoutAnimationStart:v,onLayoutAnimationComplete:m}=u.getProps(),b=!this.targetLayout||!pl(this.targetLayout,p),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const S={...Dr(y,"layout"),onPlay:v,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||wl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,je(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yg),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xl);return}this.isUpdating||this.nodes.forEach(hg),this.isUpdating=!1,this.nodes.forEach(pg),this.nodes.forEach(lg),this.nodes.forEach(cg),this.clearAllSnapshots();const a=Ae.now();se.delta=Ve(0,1e3/60,a-se.timestamp),se.timestamp=a,se.isProcessing=!0,hr.update.process(se),hr.preRender.process(se),hr.render.process(se),se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fg),this.sharedNodes.forEach(vg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,H.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){H.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!fe(this.snapshot.measuredBox.x)&&!fe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=J(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!dl(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&(a||We(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),Tg(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:a}=this.options;if(!a)return J();const l=a.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(Sg))){const{scroll:u}=this.root;u&&(ct(l.x,u.offset.x),ct(l.y,u.offset.y))}return l}removeElementScroll(s){var a;const l=J();if(xe(l,s),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&xe(l,s),ct(l.x,d.offset.x),ct(l.y,d.offset.y))}return l}applyTransform(s,a=!1){const l=J();xe(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ut(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),We(u.latestValues)&&ut(l,u.latestValues)}return We(this.latestValues)&&ut(l,this.latestValues),l}removeTransform(s){const a=J();xe(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!We(c.latestValues))continue;uo(c.latestValues)&&c.updateSnapshot();const u=J(),d=c.measurePageBox();xe(u,d),cl(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return We(this.latestValues)&&cl(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==se.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=se.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=J(),this.relativeTargetOrigin=J(),Vt(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=J(),this.targetWithTransforms=J()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xe(this.target,this.layout.layoutBox),Ha(this.target,this.targetDelta)):xe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=J(),this.relativeTargetOrigin=J(),Vt(this.relativeTargetOrigin,this.target,h.target),xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||uo(this.parent.latestValues)||$a(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===se.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;xe(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Rm(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=J());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(il(this.prevProjectionDelta.x,this.projectionDelta.x),il(this.prevProjectionDelta.y,this.projectionDelta.y)),Mt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!gl(this.projectionDelta.x,this.prevProjectionDelta.x)||!gl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=lt(),this.projectionDelta=lt(),this.projectionDeltaWithTransform=lt()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=lt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=J(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,y=h!==p,v=this.getStack(),m=!v||v.members.length<=1,b=!!(y&&!m&&this.options.crossfade===!0&&!this.path.some(xg));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const g=S/1e3;Tl(d.x,s.x,g),Tl(d.y,s.y,g),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bg(this.relativeTarget,this.relativeTargetOrigin,f,g),x&&rg(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=J()),xe(x,this.relativeTarget)),y&&(this.animationValues=u,Zm(u,c,this.latestValues,g,b,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(je(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=H.update(()=>{wn.hasAnimatedSinceResize=!0,this.currentAnimation=Hm(0,yl,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Al(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||J();const d=fe(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=fe(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}xe(a,l),ut(a,u),Mt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new og),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&po("z",s,c,this.animationValues);for(let u=0;u<ho.length;u++)po(`rotate${ho[u]}`,s,c,this.animationValues),po(`skew${ho[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}getProjectionStyles(s){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return ig;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=dn(s==null?void 0:s.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=dn(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!We(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=sg(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:h,y:p}=this.projectionDelta;c.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in yt){if(f[y]===void 0)continue;const{correct:v,applyTo:m,isCSSVariable:b}=yt[y],x=c.transform==="none"?f[y]:v(f[y],d);if(m){const S=m.length;for(let g=0;g<S;g++)c[m[g]]=x}else b?this.options.visualElement.renderState.vars[y]=x:c[y]=x}return this.options.layoutId&&(c.pointerEvents=d===this?dn(s==null?void 0:s.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(xl),this.root.sharedNodes.clear()}}}function lg(e){e.updateLayout()}function cg(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,s=n.source!==e.layout.source;i==="size"?be(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=fe(f);f.min=r[d].min,f.max=f.min+h}):Al(i,n.layoutBox,r)&&be(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=fe(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=lt();Mt(a,r,n.layoutBox);const l=lt();s?Mt(l,e.applyTransform(o,!0),n.measuredBox):Mt(l,r,n.layoutBox);const c=!dl(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=J();Vt(p,n.layoutBox,f.layoutBox);const y=J();Vt(y,r,h.layoutBox),pl(p,y)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ug(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fg(e){e.clearSnapshot()}function xl(e){e.clearMeasurements()}function hg(e){e.isLayoutDirty=!1}function pg(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mg(e){e.resolveTargetDelta()}function gg(e){e.calcProjection()}function yg(e){e.resetSkewAndRotation()}function vg(e){e.removeLeadSnapshot()}function Tl(e,t,n){e.translate=q(t.translate,0,n),e.scale=q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Sl(e,t,n,r){e.min=q(t.min,n.min,r),e.max=q(t.max,n.max,r)}function bg(e,t,n,r){Sl(e.x,t.x,n.x,r),Sl(e.y,t.y,n.y,r)}function xg(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wg={duration:.45,ease:[.4,0,.1,1]},El=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Pl=El("applewebkit/")&&!El("chrome/")?Math.round:pe;function Cl(e){e.min=Pl(e.min),e.max=Pl(e.max)}function Tg(e){Cl(e.x),Cl(e.y)}function Al(e,t,n){return e==="position"||e==="preserve-aspect"&&!Pm(ml(t),ml(n),.2)}function Sg(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Eg=bl({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),mo={current:void 0},kl=bl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!mo.current){const e=new Eg({});e.mount(window),e.setOptions({layoutScroll:!0}),mo.current=e}return mo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Pg={pan:{Feature:_m},drag:{Feature:Bm,ProjectionNode:kl,MeasureLayout:Qa}};function Dl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&H.postRender(()=>i(t,kt(t)))}class Cg extends Be{mount(){const{current:t}=this.node;t&&(this.unmount=Ch(t,(n,r)=>(Dl(this.node,r,"Start"),o=>Dl(this.node,o,"End"))))}unmount(){}}class Ag extends Be{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ct(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ml(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&H.postRender(()=>i(t,kt(t)))}class kg extends Be{mount(){const{current:t}=this.node;t&&(this.unmount=Mh(t,(n,r)=>(Ml(this.node,r,"Start"),(o,{success:i})=>Ml(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const go=new WeakMap,yo=new WeakMap,Dg=e=>{const t=go.get(e.target);t&&t(e)},Mg=e=>{e.forEach(Dg)};function Vg({root:e,...t}){const n=e||document;yo.has(n)||yo.set(n,{});const r=yo.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Mg,{root:e,...t})),r[o]}function Lg(e,t,n){const r=Vg(t);return go.set(e,n),r.observe(e),()=>{go.delete(e),r.unobserve(e)}}const Og={some:0,all:1};class Ig extends Be{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Og[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Lg(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Rg(t,n))&&this.startObserver()}unmount(){}}function Rg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Fg={inView:{Feature:Ig},tap:{Feature:kg},focus:{Feature:Ag},hover:{Feature:Cg}},jg={layout:{ProjectionNode:kl,MeasureLayout:Qa}},vo={current:null},Vl={current:!1};function Ng(){if(Vl.current=!0,!!dr)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vo.current=e.matches;e.addListener(t),t()}else vo.current=!1}const Ug=[...oa,de,Ue],Bg=e=>Ug.find(ra(e)),_g=new WeakMap;function $g(e,t,n){for(const r in t){const o=t[r],i=n[r];if(ue(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&sn(o.version==="12.4.0",`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(ue(i))e.addValue(r,Tt(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Tt(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ll=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class zg{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Ae.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,H.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=s;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=cn(n),this.isVariantNode=Js(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];l[h]!==void 0&&ue(p)&&p.set(l[h],!1)}}mount(t){this.current=t,_g.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Vl.current||Ng(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vo.current,process.env.NODE_ENV!=="production"&&sn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),je(this.notifyUpdate),je(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ze.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&H.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in nt){const n=nt[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):J()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Ll.length;r++){const o=Ll[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=$g(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Tt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(ta(o)||$i(o))?o=parseFloat(o):!Bg(o)&&Ue.test(n)&&(o=Yi(t,n)),this.setBaseTarget(t,ue(o)?o.get():o)),ue(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const s=Cr(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ue(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nr),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ol extends zg{constructor(){super(...arguments),this.KeyframeResolver=ia}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ue(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Kg(e){return window.getComputedStyle(e)}class Hg extends Ol{constructor(){super(...arguments),this.type="html",this.renderInstance=pi}readValueFromInstance(t,n){if(ze.has(n)){const r=Wr(n);return r&&r.default||0}else{const r=Kg(t),o=(vr(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ya(t,n)}build(t,n,r){wr(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return kr(t,n,r)}}class Gg extends Ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=J,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&hi(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ze.has(n)){const r=Wr(n);return r&&r.default||0}return n=mi.has(n)?n:gr(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return yi(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&H.postRender(this.updateDimensions)}build(t,n,r){Er(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){gi(t,n,r,o)}mount(t){this.isSVGTag=Pr(t.tagName),super.mount(t)}}const Wg=(e,t)=>Sr(e)?new Gg(t):new Hg(t,{allowProjection:e!==P.Fragment}),qg=bh({...gm,...Fg,...Pg,...jg},Wg),bo=Ff(qg),Yg=({conditionNameToOperators:e,setConditionState:t,conditionState:n,tailwindClassDefinitions:r,iconDefinitions:o})=>{const[i,s]=P.useState(n.map(u=>u.value.map(d=>d.includes(",")?`"${d}"`:d).join(", "))),a=(u,d,f)=>{const h=[...n];if(d==="value"){const p=[...i];p[u]=f,s(p);const y=f.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map(v=>{const m=v.trim(),b=m.match(/^"(.*)"$/);return b?b[1]:m}).filter(v=>v!=="");h[u]={...h[u],[d]:y}}else h[u]={...h[u],[d]:f};t(h)},l=()=>{const u={field:Object.keys(e)[0],operator:e[Object.keys(e)[0]][0],value:[]};t([...n,u]),s([...i,""])},c=u=>{const d=n.filter((h,p)=>p!==u);t(d);const f=i.filter((h,p)=>p!==u);s(f)};return A.jsxs("div",{className:"flex flex-col gap-2 ",children:[A.jsx(kf,{mode:"popLayout",children:n.map((u,d)=>A.jsxs(bo.div,{initial:{opacity:0,height:0,scale:.8},animate:{opacity:1,height:"auto",scale:1},exit:{opacity:0,height:0,scale:.8},transition:{duration:.2},className:`grid ${n.length>1?"grid-cols-[1fr_1fr_1fr_auto]":"grid-cols-[1fr_1fr_1fr]"} gap-4`,children:[A.jsx("select",{className:"p-2 border rounded-lg",value:u.field,onChange:f=>a(d,"field",f.target.value),children:Object.keys(e).map(f=>A.jsx("option",{children:f},f))}),A.jsx("select",{className:"p-2 border rounded-lg",value:u.operator,onChange:f=>a(d,"operator",f.target.value),children:e[u.field].map(f=>A.jsx("option",{children:f},f))}),A.jsx("input",{type:"text",className:"p-2 border rounded-lg",placeholder:'Enter values separated by commas. Use quotes for values containing commas: "San Francisco, CA"',value:i[d]||"",onChange:f=>a(d,"value",f.target.value)}),n.length>1&&A.jsx(bo.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>c(d),className:"p-2 hover:text-red-600","aria-label":"Delete condition",children:A.jsx(o.CloseButton,{})})]},d))}),A.jsx("div",{children:A.jsxs(bo.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:l,className:ar("flex items-center px-4 py-2 ",r==null?void 0:r.SecondaryButton,r==null?void 0:r.SecondaryButtonHover),children:[A.jsx("span",{className:"mr-2",children:"+"}),"Add Condition"]})})]})},Xg=({nameAndDescriptionState:e,setNameAndDescriptionState:t})=>A.jsx("div",{children:A.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[A.jsxs("div",{children:[A.jsx("label",{className:"block text-sm font-medium mb-2",children:"Name"}),A.jsx("input",{type:"text",placeholder:"Segment Name",className:"w-full p-2 border rounded-lg",value:e.name,onChange:n=>t({...e,name:n.target.value})})]}),A.jsxs("div",{children:[A.jsx("label",{className:"block text-sm font-medium mb-2",children:"Description"}),A.jsx("input",{type:"text",placeholder:"Description",className:"w-full p-2 border rounded-lg",value:e.description,onChange:n=>t({...e,description:n.target.value})})]})]})}),xo={container:"relative p-6 border border-gray-200 rounded-lg"},Zg=({onClose:e,tailwindClassDefinitions:t,iconDefinitions:n})=>{const{segmentsConditions:r,isLoading:o,createSegment:i,isCreating:s}=Vd(),[a,l]=P.useState(!1),c=$d(t),u=zd(n),[d,f]=P.useState([]),[h,p]=P.useState({name:"",description:""}),[y,v]=P.useState({}),m=h.name&&h.description&&d.some(x=>x.field&&x.operator&&x.value.length>0);P.useEffect(()=>{r&&(v(r.conditions.reduce((x,S)=>(x[S.name]=S.operators,x),{})),f([{field:r.conditions[0].name,operator:r.conditions[0].operators[0],value:[]}]))},[r]);const b=()=>{if(!h.name||!h.description){console.error("Name and description are required"),e==null||e("error");return}l(!0);const x={name:h.name,description:h.description,conditions:d};i(x,{onSuccess:S=>{S.id?e==null||e(S.id):e==null||e("error")},onError:()=>{console.error("Error creating segment"),e==null||e("error")},onSettled:()=>{f([]),p({name:"",description:""})}})};return o?A.jsx("div",{className:xo.container,children:A.jsx(Os,{text:["Fetching Segment data","Finishing up"]})}):s||a?A.jsx("div",{className:xo.container,children:A.jsx(Os,{text:["Creating Segment","Finishing up"]})}):A.jsxs("div",{className:xo.container,children:[A.jsx("button",{onClick:()=>e==null?void 0:e(!1),className:"absolute top-4 right-4 w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors duration-200","aria-label":"Close",children:A.jsx(u.CloseButton,{})}),A.jsxs("div",{className:"space-y-6",children:[A.jsx(Xg,{nameAndDescriptionState:h,setNameAndDescriptionState:p}),A.jsx(Yg,{conditionNameToOperators:y,conditionState:d,setConditionState:f,tailwindClassDefinitions:c,iconDefinitions:u}),A.jsx(Sf,{onClose:e,isDisabled:!m,setClickedCreate:b,tailwindClassDefinitions:c})]})]})};re.ReachProvider=kd,re.SegmentBuilder=Zg,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});