@embedreach/components 0.1.10 → 0.1.13

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.
package/dist/index.umd.js CHANGED
@@ -1,132 +1,1233 @@
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);
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReachComponents={},e.jsxRuntime,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";var o,i,s,a,l,c,u,d,h,f,p,g,m,v,y,b,w,x,k,S,C,E,P,j,D,T,M,O,A,N,_,R,L,$,F,I,q,z,V,B,U,K,W,H,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,ge,me,ve,ye,be,we,xe,ke,Se,Ce,Ee,Pe,je,De,Te,Me,Oe,Ae,Ne,_e,Re,Le,$e,Fe,Ie,qe,ze,Ve,Be,Ue,Ke,We,He,Ge,Ye,Qe,Xe,Je=Object.defineProperty,Ze=e=>{throw TypeError(e)},et=(e,t,n)=>((e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),tt=(e,t,n)=>t.has(e)||Ze("Cannot "+n),nt=(e,t,n)=>(tt(e,t,"read from private field"),n?n.call(e):t.get(e)),rt=(e,t,n)=>t.has(e)?Ze("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ot=(e,t,n,r)=>(tt(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),it=(e,t,n)=>(tt(e,t,"access private method"),n),st=(e,t,n,r)=>({set _(r){ot(e,t,r,n)},get _(){return nt(e,t,r)}});function at(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){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 lt=at(n),ct=at(r);var ut=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},dt="undefined"==typeof window||"Deno"in globalThis;function ht(){}function ft(e){return"number"==typeof e&&e>=0&&e!==1/0}function pt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gt(e,t){return"function"==typeof e?e(t):e}function mt(e,t){return"function"==typeof e?e(t):e}function vt(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==bt(s,t.options))return!1}else if(!xt(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&((!o||o===t.state.fetchStatus)&&!(i&&!i(t)))}function yt(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(wt(t.options.mutationKey)!==wt(i))return!1}else if(!xt(t.options.mutationKey,i))return!1}return(!r||t.state.status===r)&&!(o&&!o(t))}function bt(e,t){return((null==t?void 0:t.queryKeyHashFn)||wt)(e)}function wt(e){return JSON.stringify(e,((e,t)=>Et(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))}function xt(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((n=>!xt(e[n],t[n]))))}function kt(e,t){if(e===t)return e;const n=Ct(e)&&Ct(t);if(n||Et(e)&&Et(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const o=n?c:i[c];(!n&&r.includes(o)||n)&&void 0===e[o]&&void 0===t[o]?(a[o]=void 0,l++):(a[o]=kt(e[o],t[o]),a[o]===e[o]&&void 0!==e[o]&&l++)}return o===s&&l===o?e:a}return t}function St(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ct(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Et(e){if(!Pt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!Pt(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function Pt(e){return"[object Object]"===Object.prototype.toString.call(e)}function jt(e,t,n){if("function"==typeof n.structuralSharing)return n.structuralSharing(e,t);if(!1!==n.structuralSharing){if("production"!==process.env.NODE_ENV)try{return kt(e,t)}catch(r){}return kt(e,t)}return t}function Dt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Tt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Mt=Symbol();function Ot(e,t){return process,!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==Mt?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var At=new(a=class extends ut{constructor(){super(),rt(this,o),rt(this,i),rt(this,s),ot(this,s,(e=>{if(!dt&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}))}onSubscribe(){nt(this,i)||this.setEventListener(nt(this,s))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=nt(this,i))||e.call(this),ot(this,i,void 0))}setEventListener(e){var t;ot(this,s,e),null==(t=nt(this,i))||t.call(this),ot(this,i,e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})))}setFocused(e){nt(this,o)!==e&&(ot(this,o,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){var e;return"boolean"==typeof nt(this,o)?nt(this,o):"hidden"!==(null==(e=globalThis.document)?void 0:e.visibilityState)}},o=new WeakMap,i=new WeakMap,s=new WeakMap,a),Nt=new(d=class extends ut{constructor(){super(),rt(this,l,!0),rt(this,c),rt(this,u),ot(this,u,(e=>{if(!dt&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}))}onSubscribe(){nt(this,c)||this.setEventListener(nt(this,u))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=nt(this,c))||e.call(this),ot(this,c,void 0))}setEventListener(e){var t;ot(this,u,e),null==(t=nt(this,c))||t.call(this),ot(this,c,e(this.setOnline.bind(this)))}setOnline(e){nt(this,l)!==e&&(ot(this,l,e),this.listeners.forEach((t=>{t(e)})))}isOnline(){return nt(this,l)}},l=new WeakMap,c=new WeakMap,u=new WeakMap,d);function _t(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch((()=>{})),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function Rt(e){return Math.min(1e3*2**e,3e4)}function Lt(e){return"online"!==(null!=e?e:"online")||Nt.isOnline()}var $t=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function Ft(e){return e instanceof $t}function It(e){let t,n=!1,r=0,o=!1;const i=_t(),s=()=>At.isFocused()&&("always"===e.networkMode||Nt.isOnline())&&e.canRun(),a=()=>Lt(e.networkMode)&&e.canRun(),l=n=>{var r;o||(o=!0,null==(r=e.onSuccess)||r.call(e,n),null==t||t(),i.resolve(n))},c=n=>{var r;o||(o=!0,null==(r=e.onError)||r.call(e,n),null==t||t(),i.reject(n))},u=()=>new Promise((n=>{var r;t=e=>{(o||s())&&n(e)},null==(r=e.onPause)||r.call(e)})).then((()=>{var n;t=void 0,o||null==(n=e.onContinue)||n.call(e)})),d=()=>{if(o)return;let t;const i=0===r?e.initialPromise:void 0;try{t=null!=i?i:e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(l).catch((t=>{var i,a,l;if(o)return;const h=null!=(i=e.retry)?i:dt?0:3,f=null!=(a=e.retryDelay)?a:Rt,p="function"==typeof f?f(r,t):f,g=!0===h||"number"==typeof h&&r<h||"function"==typeof h&&h(r,t);var m;!n&&g?(r++,null==(l=e.onFail)||l.call(e,r,t),(m=p,new Promise((e=>{setTimeout(e,m)}))).then((()=>s()?void 0:u())).then((()=>{n?c(t):d()}))):c(t)}))};return{promise:i,cancel:t=>{var n;o||(c(new $t(t)),null==(n=e.abort)||n.call(e))},continue:()=>(null==t||t(),i),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?d():u().then(d),i)}}var qt=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=e=>setTimeout(e,0);const i=r=>{t?e.push(r):o((()=>{n(r)}))};return{batch:i=>{let s;t++;try{s=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o((()=>{r((()=>{t.forEach((e=>{n(e)}))}))}))})()}return s},batchCalls:e=>(...t)=>{i((()=>{e(...t)}))},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}(),zt=(f=class{constructor(){rt(this,h)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ft(this.gcTime)&&ot(this,h,setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,null!=e?e:dt?1/0:3e5)}clearGcTimeout(){nt(this,h)&&(clearTimeout(nt(this,h)),ot(this,h,void 0))}},h=new WeakMap,f),Vt=(k=class extends zt{constructor(e){var t;super(),rt(this,w),rt(this,p),rt(this,g),rt(this,m),rt(this,v),rt(this,y),rt(this,b),ot(this,b,!1),ot(this,y,e.defaultOptions),this.setOptions(e.options),this.observers=[],ot(this,m,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ot(this,p,function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options)),this.state=null!=(t=e.state)?t:nt(this,p),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return null==(e=nt(this,v))?void 0:e.promise}setOptions(e){this.options={...nt(this,y),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||nt(this,m).remove(this)}setData(e,t){const n=jt(this.state.data,e,this.options);return it(this,w,x).call(this,{data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){it(this,w,x).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,n;const r=null==(t=nt(this,v))?void 0:t.promise;return null==(n=nt(this,v))||n.cancel(e),r?r.then(ht).catch(ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(nt(this,p))}isActive(){return this.observers.some((e=>!1!==mt(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!pt(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find((e=>e.shouldFetchOnWindowFocus()));null==t||t.refetch({cancelRefetch:!1}),null==(e=nt(this,v))||e.continue()}onOnline(){var e;const t=this.observers.find((e=>e.shouldFetchOnReconnect()));null==t||t.refetch({cancelRefetch:!1}),null==(e=nt(this,v))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),nt(this,m).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(nt(this,v)&&(nt(this,b)?nt(this,v).cancel({revert:!0}):nt(this,v).cancelRetry()),this.scheduleGc()),nt(this,m).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||it(this,w,x).call(this,{type:"invalidate"})}fetch(e,t){var n,r,o;if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(nt(this,v))return nt(this,v).continueRetry(),nt(this,v).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&Array.isArray(this.options.queryKey);const i=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(ot(this,b,!0),i.signal)})},a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const e=Ot(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return s(n),ot(this,b,!1),this.options.persister?this.options.persister(e,n,this):e(n)}};s(a),null==(n=this.options.behavior)||n.onFetch(a,this),ot(this,g,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===(null==(r=a.fetchOptions)?void 0:r.meta)||it(this,w,x).call(this,{type:"fetch",meta:null==(o=a.fetchOptions)?void 0:o.meta});const l=e=>{var t,n,r,o;Ft(e)&&e.silent||it(this,w,x).call(this,{type:"error",error:e}),Ft(e)||(null==(n=(t=nt(this,m).config).onError)||n.call(t,e,this),null==(o=(r=nt(this,m).config).onSettled)||o.call(r,this.state.data,e,this)),this.scheduleGc()};return ot(this,v,It({initialPromise:null==t?void 0:t.initialPromise,fn:a.fetchFn,abort:i.abort.bind(i),onSuccess:e=>{var t,n,r,o;if(void 0===e)return process,void l(new Error(`${this.queryHash} data is undefined`));try{this.setData(e)}catch(i){return void l(i)}null==(n=(t=nt(this,m).config).onSuccess)||n.call(t,e,this),null==(o=(r=nt(this,m).config).onSettled)||o.call(r,e,this.state.error,this),this.scheduleGc()},onError:l,onFail:(e,t)=>{it(this,w,x).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{it(this,w,x).call(this,{type:"pause"})},onContinue:()=>{it(this,w,x).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),nt(this,v).start()}},p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakSet,x=function(e){this.state=(t=>{var n,r;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Bt(t.data,this.options),fetchMeta:null!=(n=e.meta)?n:null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(r=e.dataUpdatedAt)?r:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return Ft(o)&&o.revert&&nt(this,g)?{...nt(this,g),fetchStatus:"idle"}:{...t,error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),qt.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),nt(this,m).notify({query:this,type:"updated",action:e})}))},k);function Bt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lt(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var Ut=(C=class extends ut{constructor(e={}){super(),rt(this,S),this.config=e,ot(this,S,new Map)}build(e,t,n){var r;const o=t.queryKey,i=null!=(r=t.queryHash)?r:bt(o,t);let s=this.get(i);return s||(s=new Vt({cache:this,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){nt(this,S).has(e.queryHash)||(nt(this,S).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=nt(this,S).get(e.queryHash);t&&(e.destroy(),t===e&&nt(this,S).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){qt.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return nt(this,S).get(e)}getAll(){return[...nt(this,S).values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>vt(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>vt(e,t))):t}notify(e){qt.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){qt.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){qt.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},S=new WeakMap,C),Kt=(M=class extends zt{constructor(e){super(),rt(this,D),rt(this,E),rt(this,P),rt(this,j),this.mutationId=e.mutationId,ot(this,P,e.mutationCache),ot(this,E,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){nt(this,E).includes(e)||(nt(this,E).push(e),this.clearGcTimeout(),nt(this,P).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ot(this,E,nt(this,E).filter((t=>t!==e))),this.scheduleGc(),nt(this,P).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){nt(this,E).length||("pending"===this.state.status?this.scheduleGc():nt(this,P).remove(this))}continue(){var e,t;return null!=(t=null==(e=nt(this,j))?void 0:e.continue())?t:this.execute(this.state.variables)}async execute(e){var t,n,r,o,i,s,a,l,c,u,d,h,f,p,g,m,v,y,b,w,x;ot(this,j,It({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{it(this,D,T).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{it(this,D,T).call(this,{type:"pause"})},onContinue:()=>{it(this,D,T).call(this,{type:"continue"})},retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>nt(this,P).canRun(this)}));const k="pending"===this.state.status,S=!nt(this,j).canStart();try{if(!k){it(this,D,T).call(this,{type:"pending",variables:e,isPaused:S}),await(null==(r=(n=nt(this,P).config).onMutate)?void 0:r.call(n,e,this));const t=await(null==(i=(o=this.options).onMutate)?void 0:i.call(o,e));t!==this.state.context&&it(this,D,T).call(this,{type:"pending",context:t,variables:e,isPaused:S})}const t=await nt(this,j).start();return await(null==(a=(s=nt(this,P).config).onSuccess)?void 0:a.call(s,t,e,this.state.context,this)),await(null==(c=(l=this.options).onSuccess)?void 0:c.call(l,t,e,this.state.context)),await(null==(d=(u=nt(this,P).config).onSettled)?void 0:d.call(u,t,null,this.state.variables,this.state.context,this)),await(null==(f=(h=this.options).onSettled)?void 0:f.call(h,t,null,e,this.state.context)),it(this,D,T).call(this,{type:"success",data:t}),t}catch(C){try{throw await(null==(g=(p=nt(this,P).config).onError)?void 0:g.call(p,C,e,this.state.context,this)),await(null==(v=(m=this.options).onError)?void 0:v.call(m,C,e,this.state.context)),await(null==(b=(y=nt(this,P).config).onSettled)?void 0:b.call(y,void 0,C,this.state.variables,this.state.context,this)),await(null==(x=(w=this.options).onSettled)?void 0:x.call(w,void 0,C,e,this.state.context)),C}finally{it(this,D,T).call(this,{type:"error",error:C})}}finally{nt(this,P).runNext(this)}}},E=new WeakMap,P=new WeakMap,j=new WeakMap,D=new WeakSet,T=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),qt.batch((()=>{nt(this,E).forEach((t=>{t.onMutationUpdate(e)})),nt(this,P).notify({mutation:this,type:"updated",action:e})}))},M);var Wt=(N=class extends ut{constructor(e={}){super(),rt(this,O),rt(this,A),this.config=e,ot(this,O,new Map),ot(this,A,Date.now())}build(e,t,n){const r=new Kt({mutationCache:this,mutationId:++st(this,A)._,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){var t;const n=Ht(e),r=null!=(t=nt(this,O).get(n))?t:[];r.push(e),nt(this,O).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var t;const n=Ht(e);if(nt(this,O).has(n)){const r=null==(t=nt(this,O).get(n))?void 0:t.filter((t=>t!==e));r&&(0===r.length?nt(this,O).delete(n):nt(this,O).set(n,r))}this.notify({type:"removed",mutation:e})}canRun(e){var t;const n=null==(t=nt(this,O).get(Ht(e)))?void 0:t.find((e=>"pending"===e.state.status));return!n||n===e}runNext(e){var t,n;const r=null==(t=nt(this,O).get(Ht(e)))?void 0:t.find((t=>t!==e&&t.state.isPaused));return null!=(n=null==r?void 0:r.continue())?n:Promise.resolve()}clear(){qt.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}getAll(){return[...nt(this,O).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find((e=>yt(t,e)))}findAll(e={}){return this.getAll().filter((t=>yt(e,t)))}notify(e){qt.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return qt.batch((()=>Promise.all(e.map((e=>e.continue().catch(ht))))))}},O=new WeakMap,A=new WeakMap,N);function Ht(e){var t,n;return null!=(n=null==(t=e.options.scope)?void 0:t.id)?n:String(e.mutationId)}function Gt(e){return{onFetch:(t,n)=>{var r,o,i,s,a;const l=t.options,c=null==(i=null==(o=null==(r=t.fetchOptions)?void 0:r.meta)?void 0:o.fetchMore)?void 0:i.direction,u=(null==(s=t.state.data)?void 0:s.pages)||[],d=(null==(a=t.state.data)?void 0:a.pageParams)||[];let h={pages:[],pageParams:[]},f=0;const p=async()=>{var n;let r=!1;const o=Ot(t.options,t.fetchOptions),i=async(e,n,i)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const s={queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",(()=>{r=!0})),t.signal)});const a=await o(s),{maxPages:l}=t.options,c=i?Tt:Dt;return{pages:c(e.pages,a,l),pageParams:c(e.pageParams,n,l)}};if(c&&u.length){const e="backward"===c,t={pages:u,pageParams:d},n=(e?Qt:Yt)(l,t);h=await i(t,n,e)}else{const t=null!=e?e:u.length;do{const e=0===f?null!=(n=d[0])?n:l.initialPageParam:Yt(l,h);if(f>0&&null==e)break;h=await i(h,e),f++}while(f<t)}return h};t.fetchFn=t.options.persister?()=>{var e,r;return null==(r=(e=t.options).persister)?void 0:r.call(e,p,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:p}}}function Yt(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Qt(e,{pages:t,pageParams:n}){var r;return t.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xt=(V=class{constructor(e={}){rt(this,_),rt(this,R),rt(this,L),rt(this,$),rt(this,F),rt(this,I),rt(this,q),rt(this,z),ot(this,_,e.queryCache||new Ut),ot(this,R,e.mutationCache||new Wt),ot(this,L,e.defaultOptions||{}),ot(this,$,new Map),ot(this,F,new Map),ot(this,I,0)}mount(){st(this,I)._++,1===nt(this,I)&&(ot(this,q,At.subscribe((async e=>{e&&(await this.resumePausedMutations(),nt(this,_).onFocus())}))),ot(this,z,Nt.subscribe((async e=>{e&&(await this.resumePausedMutations(),nt(this,_).onOnline())}))))}unmount(){var e,t;st(this,I)._--,0===nt(this,I)&&(null==(e=nt(this,q))||e.call(this),ot(this,q,void 0),null==(t=nt(this,z))||t.call(this),ot(this,z,void 0))}isFetching(e){return nt(this,_).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return nt(this,R).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=nt(this,_).get(n.queryHash))?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=nt(this,_).build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return nt(this,_).findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=nt(this,_).get(r.queryHash),i=function(e,t){return"function"==typeof e?e(t):e}(t,null==o?void 0:o.state.data);if(void 0!==i)return nt(this,_).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return qt.batch((()=>nt(this,_).findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=nt(this,_).get(n.queryHash))?void 0:t.state}removeQueries(e){const t=nt(this,_);qt.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const n=nt(this,_),r={type:"active",...e};return qt.batch((()=>(n.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(r,t))))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qt.batch((()=>nt(this,_).findAll(e).map((e=>e.cancel(n)))));return Promise.all(r).then(ht).catch(ht)}invalidateQueries(e,t={}){return qt.batch((()=>{var n,r;if(nt(this,_).findAll(e).forEach((e=>{e.invalidate()})),"none"===(null==e?void 0:e.refetchType))return Promise.resolve();const o={...e,type:null!=(r=null!=(n=null==e?void 0:e.refetchType)?n:null==e?void 0:e.type)?r:"active"};return this.refetchQueries(o,t)}))}refetchQueries(e,t={}){var n;const r={...t,cancelRefetch:null==(n=t.cancelRefetch)||n},o=qt.batch((()=>nt(this,_).findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(ht)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(o).then(ht)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=nt(this,_).build(this,t);return n.isStaleByTime(gt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ht).catch(ht)}fetchInfiniteQuery(e){return e.behavior=Gt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ht).catch(ht)}ensureInfiniteQueryData(e){return e.behavior=Gt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nt.isOnline()?nt(this,R).resumePausedMutations():Promise.resolve()}getQueryCache(){return nt(this,_)}getMutationCache(){return nt(this,R)}getDefaultOptions(){return nt(this,L)}setDefaultOptions(e){ot(this,L,e)}setQueryDefaults(e,t){nt(this,$).set(wt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...nt(this,$).values()],n={};return t.forEach((t=>{xt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)})),n}setMutationDefaults(e,t){nt(this,F).set(wt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...nt(this,F).values()];let n={};return t.forEach((t=>{xt(e,t.mutationKey)&&(n={...n,...t.defaultOptions})})),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...nt(this,L).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bt(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Mt&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...nt(this,L).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){nt(this,_).clear(),nt(this,R).clear()}},_=new WeakMap,R=new WeakMap,L=new WeakMap,$=new WeakMap,F=new WeakMap,I=new WeakMap,q=new WeakMap,z=new WeakMap,V),Jt=(pe=class extends ut{constructor(e,t){super(),rt(this,oe),rt(this,B),rt(this,U),rt(this,K),rt(this,W),rt(this,H),rt(this,G),rt(this,Y),rt(this,Q),rt(this,X),rt(this,J),rt(this,Z),rt(this,ee),rt(this,te),rt(this,ne),rt(this,re,new Set),this.options=t,ot(this,B,e),ot(this,Q,null),ot(this,Y,_t()),this.options.experimental_prefetchInRender||nt(this,Y).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(nt(this,U).addObserver(this),Zt(nt(this,U),this.options)?it(this,oe,ie).call(this):this.updateResult(),it(this,oe,ce).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return en(nt(this,U),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return en(nt(this,U),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,it(this,oe,ue).call(this),it(this,oe,de).call(this),nt(this,U).removeObserver(this)}setOptions(e,t){const n=this.options,r=nt(this,U);if(this.options=nt(this,B).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof mt(this.options.enabled,nt(this,U)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");it(this,oe,he).call(this),nt(this,U).setOptions(this.options),n._defaulted&&!St(this.options,n)&&nt(this,B).getQueryCache().notify({type:"observerOptionsUpdated",query:nt(this,U),observer:this});const o=this.hasListeners();o&&tn(nt(this,U),r,this.options,n)&&it(this,oe,ie).call(this),this.updateResult(t),!o||nt(this,U)===r&&mt(this.options.enabled,nt(this,U))===mt(n.enabled,nt(this,U))&&gt(this.options.staleTime,nt(this,U))===gt(n.staleTime,nt(this,U))||it(this,oe,se).call(this);const i=it(this,oe,ae).call(this);!o||nt(this,U)===r&&mt(this.options.enabled,nt(this,U))===mt(n.enabled,nt(this,U))&&i===nt(this,ne)||it(this,oe,le).call(this,i)}getOptimisticResult(e){const t=nt(this,B).getQueryCache().build(nt(this,B),e),n=this.createResult(t,e);return function(e,t){if(!St(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(ot(this,W,n),ot(this,G,this.options),ot(this,H,nt(this,U).state)),n}getCurrentResult(){return nt(this,W)}trackResult(e,t){const n={};return Object.keys(e).forEach((r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),null==t||t(r),e[r])})})),n}trackProp(e){nt(this,re).add(e)}getCurrentQuery(){return nt(this,U)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=nt(this,B).defaultQueryOptions(e),n=nt(this,B).getQueryCache().build(nt(this,B),t);return n.fetch().then((()=>this.createResult(n,t)))}fetch(e){var t;return it(this,oe,ie).call(this,{...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then((()=>(this.updateResult(),nt(this,W))))}createResult(e,t){var n;const r=nt(this,U),o=this.options,i=nt(this,W),s=nt(this,H),a=nt(this,G),l=e!==r?e.state:nt(this,K),{state:c}=e;let u,d={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),i=!n&&Zt(e,t),s=n&&tn(e,r,t,o);(i||s)&&(d={...d,...Bt(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:g}=d;if(t.select&&void 0!==d.data)if(i&&d.data===(null==s?void 0:s.data)&&t.select===nt(this,X))u=nt(this,J);else try{ot(this,X,t.select),u=t.select(d.data),u=jt(null==i?void 0:i.data,u,t),ot(this,J,u),ot(this,Q,null)}catch(k){ot(this,Q,k)}else u=d.data;if(void 0!==t.placeholderData&&void 0===u&&"pending"===g){let e;if((null==i?void 0:i.isPlaceholderData)&&t.placeholderData===(null==a?void 0:a.placeholderData))e=i.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(null==(n=nt(this,Z))?void 0:n.state.data,nt(this,Z)):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),ot(this,Q,null)}catch(k){ot(this,Q,k)}void 0!==e&&(g="success",u=jt(null==i?void 0:i.data,e,t),h=!0)}nt(this,Q)&&(f=nt(this,Q),u=nt(this,J),p=Date.now(),g="error");const m="fetching"===d.fetchStatus,v="pending"===g,y="error"===g,b=v&&m,w=void 0!==u,x={status:g,fetchStatus:d.fetchStatus,isPending:v,isSuccess:"success"===g,isError:y,isInitialLoading:b,isLoading:b,data:u,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:y&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:h,isRefetchError:y&&w,isStale:nn(e,t),refetch:this.refetch,promise:nt(this,Y)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===x.status?e.reject(x.error):void 0!==x.data&&e.resolve(x.data)},n=()=>{const e=ot(this,Y,x.promise=_t());t(e)},o=nt(this,Y);switch(o.status){case"pending":e.queryHash===r.queryHash&&t(o);break;case"fulfilled":"error"!==x.status&&x.data===o.value||n();break;case"rejected":"error"===x.status&&x.error===o.reason||n()}}return x}updateResult(e){const t=nt(this,W),n=this.createResult(nt(this,U),this.options);if(ot(this,H,nt(this,U).state),ot(this,G,this.options),void 0!==nt(this,H).data&&ot(this,Z,nt(this,U)),St(n,t))return;ot(this,W,n);const r={};!1!==(null==e?void 0:e.listeners)&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!nt(this,re).size)return!0;const r=new Set(null!=n?n:nt(this,re));return this.options.throwOnError&&r.add("error"),Object.keys(nt(this,W)).some((e=>{const n=e;return nt(this,W)[n]!==t[n]&&r.has(n)}))})()&&(r.listeners=!0),it(this,oe,fe).call(this,{...r,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&it(this,oe,ce).call(this)}},B=new WeakMap,U=new WeakMap,K=new WeakMap,W=new WeakMap,H=new WeakMap,G=new WeakMap,Y=new WeakMap,Q=new WeakMap,X=new WeakMap,J=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakSet,ie=function(e){it(this,oe,he).call(this);let t=nt(this,U).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(ht)),t},se=function(){it(this,oe,ue).call(this);const e=gt(this.options.staleTime,nt(this,U));if(dt||nt(this,W).isStale||!ft(e))return;const t=pt(nt(this,W).dataUpdatedAt,e);ot(this,ee,setTimeout((()=>{nt(this,W).isStale||this.updateResult()}),t+1))},ae=function(){var e;return null!=(e="function"==typeof this.options.refetchInterval?this.options.refetchInterval(nt(this,U)):this.options.refetchInterval)&&e},le=function(e){it(this,oe,de).call(this),ot(this,ne,e),!dt&&!1!==mt(this.options.enabled,nt(this,U))&&ft(nt(this,ne))&&0!==nt(this,ne)&&ot(this,te,setInterval((()=>{(this.options.refetchIntervalInBackground||At.isFocused())&&it(this,oe,ie).call(this)}),nt(this,ne)))},ce=function(){it(this,oe,se).call(this),it(this,oe,le).call(this,it(this,oe,ae).call(this))},ue=function(){nt(this,ee)&&(clearTimeout(nt(this,ee)),ot(this,ee,void 0))},de=function(){nt(this,te)&&(clearInterval(nt(this,te)),ot(this,te,void 0))},he=function(){const e=nt(this,B).getQueryCache().build(nt(this,B),this.options);if(e===nt(this,U))return;const t=nt(this,U);ot(this,U,e),ot(this,K,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))},fe=function(e){qt.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(nt(this,W))})),nt(this,B).getQueryCache().notify({query:nt(this,U),type:"observerResultsUpdated"})}))},pe);function Zt(e,t){return function(e,t){return!1!==mt(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&en(e,t,t.refetchOnMount)}function en(e,t,n){if(!1!==mt(t.enabled,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&nn(e,t)}return!1}function tn(e,t,n,r){return(e!==t||!1===mt(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&nn(e,n)}function nn(e,t){return!1!==mt(t.enabled,e)&&e.isStaleByTime(gt(t.staleTime,e))}var rn=(ke=class extends ut{constructor(e,t){super(),rt(this,be),rt(this,ge),rt(this,me),rt(this,ve),rt(this,ye),ot(this,ge,e),this.setOptions(t),this.bindMethods(),it(this,be,we).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const n=this.options;this.options=nt(this,ge).defaultMutationOptions(e),St(this.options,n)||nt(this,ge).getMutationCache().notify({type:"observerOptionsUpdated",mutation:nt(this,ve),observer:this}),(null==n?void 0:n.mutationKey)&&this.options.mutationKey&&wt(n.mutationKey)!==wt(this.options.mutationKey)?this.reset():"pending"===(null==(t=nt(this,ve))?void 0:t.state.status)&&nt(this,ve).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||null==(e=nt(this,ve))||e.removeObserver(this)}onMutationUpdate(e){it(this,be,we).call(this),it(this,be,xe).call(this,e)}getCurrentResult(){return nt(this,me)}reset(){var e;null==(e=nt(this,ve))||e.removeObserver(this),ot(this,ve,void 0),it(this,be,we).call(this),it(this,be,xe).call(this)}mutate(e,t){var n;return ot(this,ye,t),null==(n=nt(this,ve))||n.removeObserver(this),ot(this,ve,nt(this,ge).getMutationCache().build(nt(this,ge),this.options)),nt(this,ve).addObserver(this),nt(this,ve).execute(e)}},ge=new WeakMap,me=new WeakMap,ve=new WeakMap,ye=new WeakMap,be=new WeakSet,we=function(){var e,t;const n=null!=(t=null==(e=nt(this,ve))?void 0:e.state)?t:{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};ot(this,me,{...n,isPending:"pending"===n.status,isSuccess:"success"===n.status,isError:"error"===n.status,isIdle:"idle"===n.status,mutate:this.mutate,reset:this.reset})},xe=function(e){qt.batch((()=>{var t,n,r,o,i,s,a,l;if(nt(this,ye)&&this.hasListeners()){const c=nt(this,me).variables,u=nt(this,me).context;"success"===(null==e?void 0:e.type)?(null==(n=(t=nt(this,ye)).onSuccess)||n.call(t,e.data,c,u),null==(o=(r=nt(this,ye)).onSettled)||o.call(r,e.data,null,c,u)):"error"===(null==e?void 0:e.type)&&(null==(s=(i=nt(this,ye)).onError)||s.call(i,e.error,c,u),null==(l=(a=nt(this,ye)).onSettled)||l.call(a,void 0,e.error,c,u))}this.listeners.forEach((e=>{e(nt(this,me))}))}))},ke),on=lt.createContext(void 0),sn=e=>{const t=lt.useContext(on);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},an=({client:e,children:n})=>(lt.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),t.jsx(on.Provider,{value:e,children:n})),ln=lt.createContext(!1);var cn=lt.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}());function un(e,t){return"function"==typeof e?e(...t):!!e}function dn(){}var hn=(e,t,n)=>t.fetchOptimistic(e).catch((()=>{n.clearReset()}));function fn(e,t,n){var r,o,i,s,a;if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const l=sn(n),c=lt.useContext(ln),u=lt.useContext(cn),d=l.defaultQueryOptions(e);null==(o=null==(r=l.getDefaultOptions().queries)?void 0:r._experimental_beforeQuery)||o.call(r,d),d._optimisticResults=c?"isRestoring":"optimistic",(e=>{e.suspense&&(void 0===e.staleTime&&(e.staleTime=1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))})(d),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(d,u),(e=>{lt.useEffect((()=>{e.clearReset()}),[e])})(u);const h=!l.getQueryCache().get(d.queryHash),[f]=lt.useState((()=>new t(l,d))),p=f.getOptimisticResult(d);if(lt.useSyncExternalStore(lt.useCallback((e=>{const t=c?dn:f.subscribe(qt.batchCalls(e));return f.updateResult(),t}),[f,c]),(()=>f.getCurrentResult()),(()=>f.getCurrentResult())),lt.useEffect((()=>{f.setOptions(d,{listeners:!1})}),[d,f]),((e,t)=>(null==e?void 0:e.suspense)&&t.isPending)(d,p))throw hn(d,f,u);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&un(n,[e.error,r]))({result:p,errorResetBoundary:u,throwOnError:d.throwOnError,query:l.getQueryCache().get(d.queryHash)}))throw p.error;if(null==(s=null==(i=l.getDefaultOptions().queries)?void 0:i._experimental_afterQuery)||s.call(i,d,p),d.experimental_prefetchInRender&&!dt&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,c)){const e=h?hn(d,f,u):null==(a=l.getQueryCache().get(d.queryHash))?void 0:a.promise;null==e||e.catch(dn).finally((()=>{f.updateResult()}))}return d.notifyOnChangeProps?p:f.trackResult(p)}function pn(e,t){return fn(e,Jt,t)}function gn(e,t){const n=sn(t),[r]=lt.useState((()=>new rn(n,e)));lt.useEffect((()=>{r.setOptions(e)}),[r,e]);const o=lt.useSyncExternalStore(lt.useCallback((e=>r.subscribe(qt.batchCalls(e))),[r]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),i=lt.useCallback(((e,t)=>{r.mutate(e,t).catch(dn)}),[r]);if(o.error&&un(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}var mn={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vn(this.context.count)},getNextContextId(){return vn(this.context.count++)}};function vn(e){const t=String(e),n=t.length-1;return mn.context.id+(n?String.fromCharCode(96+n):"")+t}function yn(e){mn.context=e}var bn=Symbol("solid-proxy"),wn="function"==typeof Proxy,xn=(Symbol("solid-track"),{equals:(e,t)=>e===t}),kn=rr,Sn=1,Cn=2,En={owned:null,cleanups:null,context:null,owner:null},Pn={},jn=null,Dn=null,Tn=null,Mn=null,On=null,An=0;function Nn(e,t){const n=Tn,r=jn,o=0===e.length,i=void 0===t?r:t,s=o?En:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>qn((()=>ar(s)))));jn=s,Tn=null;try{return nr(a,!0)}finally{Tn=n,jn=r}}function _n(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},xn,t):xn).equals||void 0};return[Xn.bind(n),e=>("function"==typeof e&&(e=e(n.value)),Jn(n,e))]}function Rn(e,t,n){Zn(er(e,t,!0,Sn))}function Ln(e,t,n){Zn(er(e,t,!1,Sn))}function $n(e,t,n){kn=or;const r=er(e,t,!1,Sn);n&&n.render||(r.user=!0),On?On.push(r):Zn(r)}function Fn(e,t,n){n=n?Object.assign({},xn,n):xn;const r=er(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Zn(r),Xn.bind(r)}function In(e,t,n){let r,o,i;1===arguments.length?(r=!0,o=e,i={}):(r=e,o=t,i={});let s=null,a=Pn,l=null,c=!1,u="initialValue"in i,d="function"==typeof r&&Fn(r);const h=new Set,[f,p]=(i.storage||_n)(i.initialValue),[g,m]=_n(void 0),[v,y]=_n(void 0,{equals:!1}),[b,w]=_n(u?"ready":"unresolved");function x(e,t,n,r){return s===e&&(s=null,void 0!==r&&(u=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(r,{value:t}))),a=Pn,function(e,t){nr((()=>{void 0===t&&p((()=>e)),w(void 0!==t?"errored":u?"ready":"unresolved"),m(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,n)),t}function k(){const e=f(),t=g();if(void 0!==t&&!s)throw t;return e}function S(e=!0){if(!1!==e&&c)return;c=!1;const t=d?d():r;if(null==t||!1===t)return void x(s,qn(f));const n=a!==Pn?a:qn((()=>o(t,{value:f(),refetching:e})));return(i=n)&&"object"==typeof i&&"then"in i?(s=n,"value"in n?("success"===n.status?x(s,n.value,void 0,t):x(s,void 0,lr(n.value),t),n):(c=!0,queueMicrotask((()=>c=!1)),nr((()=>{w(u?"refreshing":"pending"),y()}),!1),n.then((e=>x(n,e,void 0,t)),(e=>x(n,void 0,lr(e),t))))):(x(s,n,void 0,t),n);var i}return mn.context&&(l=mn.getNextContextId(),"initial"===i.ssrLoadFrom?a=i.initialValue:mn.load&&mn.has(l)&&(a=mn.load(l))),Object.defineProperties(k,{state:{get:()=>b()},error:{get:()=>g()},loading:{get(){const e=b();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return k();const e=g();if(e&&!s)throw e;return f()}}}),d?Rn((()=>S(!1))):S(!1),[k,{refetch:S,mutate:p}]}function qn(e){if(null===Tn)return e();const t=Tn;Tn=null;try{return e()}finally{Tn=t}}function zn(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return n=>{let s;if(r){s=Array(e.length);for(let t=0;t<e.length;t++)s[t]=e[t]()}else s=e();if(i)return i=!1,n;const a=qn((()=>t(s,o,n)));return o=s,a}}function Vn(e){$n((()=>qn(e)))}function Bn(e){return null===jn||(null===jn.cleanups?jn.cleanups=[e]:jn.cleanups.push(e)),e}function Un(){return jn}function Kn(e){const t=Tn,n=jn;return Promise.resolve().then((()=>{Tn=t,jn=n,nr(e,!1),Tn=jn=null}))}var[Wn,Hn]=_n(!1);function Gn(e,t){const n=Symbol("context");return{id:n,Provider:dr(n),defaultValue:e}}function Yn(e){let t;return jn&&jn.context&&void 0!==(t=jn.context[e.id])?t:e.defaultValue}function Qn(e){const t=Fn(e),n=Fn((()=>ur(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function Xn(){if(this.sources&&this.state)if(this.state===Sn)Zn(this);else{const e=Mn;Mn=null,nr((()=>ir(this)),!1),Mn=e}if(Tn){const e=this.observers?this.observers.length:0;Tn.sources?(Tn.sources.push(this),Tn.sourceSlots.push(e)):(Tn.sources=[this],Tn.sourceSlots=[e]),this.observers?(this.observers.push(Tn),this.observerSlots.push(Tn.sources.length-1)):(this.observers=[Tn],this.observerSlots=[Tn.sources.length-1])}return this.value}function Jn(e,t,n){return e.comparator&&e.comparator(e.value,t)||(e.value=t,e.observers&&e.observers.length&&nr((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=Dn&&Dn.running;r&&Dn.disposed.has(n),(r?n.tState:n.state)||(n.pure?Mn.push(n):On.push(n),n.observers&&sr(n)),r||(n.state=Sn)}if(Mn.length>1e6)throw Mn=[],new Error}),!1)),t}function Zn(e){if(!e.fn)return;ar(e);!function(e,t,n){let r;const o=jn,i=Tn;Tn=jn=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Sn,e.owned&&e.owned.forEach(ar),e.owned=null),e.updatedAt=n+1,cr(s)}finally{Tn=i,jn=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Jn(e,r):e.value=r,e.updatedAt=n)}(e,e.value,An)}function er(e,t,n,r=Sn,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:jn,context:jn?jn.context:null,pure:n};return null===jn||jn!==En&&(jn.owned?jn.owned.push(i):jn.owned=[i]),i}function tr(e){if(0===e.state)return;if(e.state===Cn)return ir(e);if(e.suspense&&qn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<An);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===Sn)Zn(e);else if(e.state===Cn){const n=Mn;Mn=null,nr((()=>ir(e,t[0])),!1),Mn=n}}function nr(e,t){if(Mn)return e();let n=!1;t||(Mn=[]),On?n=!0:On=[],An++;try{const t=e();return function(e){Mn&&(rr(Mn),Mn=null);if(e)return;const t=On;On=null,t.length&&nr((()=>kn(t)),!1)}(n),t}catch(r){n||(On=null),Mn=null,cr(r)}}function rr(e){for(let t=0;t<e.length;t++)tr(e[t])}function or(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:tr(r)}if(mn.context){if(mn.count)return mn.effects||(mn.effects=[]),void mn.effects.push(...e.slice(0,n));yn()}for(!mn.effects||!mn.done&&mn.count||(e=[...mn.effects,...e],n+=mn.effects.length,delete mn.effects),t=0;t<n;t++)tr(e[t])}function ir(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===Sn?r!==t&&(!r.updatedAt||r.updatedAt<An)&&tr(r):e===Cn&&ir(r,t)}}}function sr(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Cn,n.pure?Mn.push(n):On.push(n),n.observers&&sr(n))}}function ar(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ar(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ar(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function lr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function cr(e,t=jn){throw lr(e)}function ur(e){if("function"==typeof e&&!e.length)return ur(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=ur(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function dr(e,t){return function(t){let n;return Ln((()=>n=qn((()=>(jn.context={...jn.context,[e]:t.value},Qn((()=>t.children)))))),void 0),n}}var hr=Symbol("fallback");function fr(e){for(let t=0;t<e.length;t++)e[t]()}function pr(e,t){return qn((()=>e(t||{})))}function gr(){return!0}var mr={get:(e,t,n)=>t===bn?n:e.get(t),has:(e,t)=>t===bn||e.has(t),set:gr,deleteProperty:gr,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:gr,deleteProperty:gr}),ownKeys:e=>e.keys()};function vr(e){return(e="function"==typeof e?e():e)?e:{}}function yr(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function br(...e){let t=!1;for(let s=0;s<e.length;s++){const n=e[s];t=t||!!n&&bn in n,e[s]="function"==typeof n?(t=!0,Fn(n)):n}if(wn&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=vr(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in vr(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(vr(e[n])));return[...new Set(t)]}},mr);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const t=e[s];if(!t)continue;const o=Object.getOwnPropertyNames(t);for(let e=o.length-1;e>=0;e--){const i=o[e];if("__proto__"===i||"constructor"===i)continue;const s=Object.getOwnPropertyDescriptor(t,i);if(r[i]){const e=n[i];e&&(s.get?e.push(s.get.bind(t)):void 0!==s.value&&e.push((()=>s.value)))}else r[i]=s.get?{enumerable:!0,configurable:!0,get:yr.bind(n[i]=[s.get.bind(t)])}:void 0!==s.value?s:void 0}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const e=i[s],t=r[e];t&&t.get?Object.defineProperty(o,e,t):o[e]=t?t.value:void 0}return o}function wr(e,...t){if(wn&&bn in e){const n=new Set(t.length>1?t.flat():t[0]),r=t.map((t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter((t=>t in e))},mr)));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!n.has(e)))},mr)),r}const n={},r=t.map((()=>({})));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const e of t)e.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function xr(e){let t,n;const r=r=>{const o=mn.context;if(o){const[r,i]=_n();mn.count||(mn.count=0),mn.count++,(n||(n=e())).then((e=>{!mn.done&&yn(o),mn.count--,i((()=>e.default)),yn()})),t=r}else if(!t){const[r]=In((()=>(n||(n=e())).then((e=>e.default))));t=r}let i;return Fn((()=>(i=t())?qn((()=>{if(!o||mn.done)return i(r);const e=mn.context;yn(o);const t=i(r);return yn(e),t})):""))};return r.preload=()=>n||((n=e()).then((e=>t=()=>e.default)),n),r}var kr=0;function Sr(){return mn.context?mn.getNextContextId():"cl-"+kr++}var Cr=e=>`Stale read from <${e}>.`;function Er(e){return Fn(function(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Bn((()=>fr(i))),()=>{let l,c,u=e()||[],d=u.length;return qn((()=>{let e,t,f,p,g,m,v,y,b;if(0===d)0!==s&&(fr(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[hr],o[0]=Nn((e=>(i[0]=e,n.fallback()))),s=1);else if(0===s){for(o=new Array(d),c=0;c<d;c++)r[c]=u[c],o[c]=Nn(h);s=d}else{for(f=new Array(d),p=new Array(d),a&&(g=new Array(d)),m=0,v=Math.min(s,d);m<v&&r[m]===u[m];m++);for(v=s-1,y=d-1;v>=m&&y>=m&&r[v]===u[y];v--,y--)f[y]=o[v],p[y]=i[v],a&&(g[y]=a[v]);for(e=new Map,t=new Array(y+1),c=y;c>=m;c--)b=u[c],l=e.get(b),t[c]=void 0===l?-1:l,e.set(b,c);for(l=m;l<=v;l++)b=r[l],c=e.get(b),void 0!==c&&-1!==c?(f[c]=o[l],p[c]=i[l],a&&(g[c]=a[l]),c=t[c],e.set(b,c)):i[l]();for(c=m;c<d;c++)c in f?(o[c]=f[c],i[c]=p[c],a&&(a[c]=g[c],a[c](c))):o[c]=Nn(h);o=o.slice(0,s=d),r=u.slice(0)}return o}));function h(e){if(i[c]=e,a){const[e,n]=_n(c);return a[c]=n,t(u[c],e)}return t(u[c])}}}((()=>e.each),e.children,"fallback"in e&&{fallback:()=>e.fallback}||void 0))}function Pr(e){return Fn(function(e,t,n={}){let r,o=[],i=[],s=[],a=[],l=0;return Bn((()=>fr(s))),()=>{const c=e()||[],u=c.length;return qn((()=>{if(0===u)return 0!==l&&(fr(s),s=[],o=[],i=[],l=0,a=[]),n.fallback&&(o=[hr],i[0]=Nn((e=>(s[0]=e,n.fallback()))),l=1),i;for(o[0]===hr&&(s[0](),s=[],o=[],i=[],l=0),r=0;r<u;r++)r<o.length&&o[r]!==c[r]?a[r]((()=>c[r])):r>=o.length&&(i[r]=Nn(d));for(;r<o.length;r++)s[r]();return l=a.length=s.length=u,o=c.slice(0),i=i.slice(0,l)}));function d(e){s[r]=e;const[n,o]=_n(c[r]);return a[r]=o,t(n,r)}}}((()=>e.each),e.children,"fallback"in e&&{fallback:()=>e.fallback}||void 0))}function jr(e){const t=e.keyed,n=Fn((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return Fn((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?qn((()=>o(t?r:()=>{if(!qn(n))throw Cr("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}function Dr(e){let t=!1;const n=Qn((()=>e.children)),r=Fn((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]}),void 0,{equals:(e,n)=>(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return Fn((()=>{const[n,o,i]=r();if(n<0)return e.fallback;const s=i.children;return"function"==typeof s&&s.length>0?qn((()=>s(t?o:()=>{if(qn(r)[0]!==n)throw Cr("Match");return i.when}))):s}),void 0,void 0)}function Tr(e){return e}var Mr=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),Or=new Set(["innerHTML","textContent","innerText","children"]),Ar=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Nr=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});var _r=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Rr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Lr={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};var $r="_$DX_DELEGATE";function Fr(e,t,n,r={}){let o;return Nn((r=>{o=r,t===document?e():Wr(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function Ir(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function qr(e,t=window.document){const n=t[$r]||(t[$r]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Xr))}}function zr(e,t,n){Gr(e)||(null==n?e.removeAttribute(t):e.setAttribute(t,n))}function Vr(e,t){Gr(e)||(null==t?e.removeAttribute("class"):e.className=t)}function Br(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,"function"!=typeof n&&n)}function Ur(e,t={},n,r){const o={};return r||Ln((()=>o.children=Jr(e,t.children,o.children))),Ln((()=>"function"==typeof t.ref&&Kr(t.ref,e))),Ln((()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if("children"===s)continue;o[s]=Qr(e,s,null,o[s],n,i,t)}for(const s in t){if("children"===s)continue;o[s]=Qr(e,s,t[s],o[s],n,i,t)}}(e,t,n,0,o,!0))),o}function Kr(e,t,n){return qn((()=>e(t,n)))}function Wr(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return Jr(e,t,r,n);Ln((r=>Jr(e,t(),r,n)),r)}function Hr(e){let t,n;return Gr()&&(t=mn.registry.get(n=mn.getNextContextId()))?(mn.completed&&mn.completed.add(t),mn.registry.delete(n),t):e()}function Gr(e){return!!mn.context&&!mn.done&&(!e||e.isConnected)}function Yr(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Qr(e,t,n,r,o,i,s){let a,l,c,u,d;if("style"===t)return function(e,t,n){if(!t)return n?zr(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Yr(e,r,!1),delete n[r])}for(i=0,s=r.length;i<s;i++){const o=r[i],s=!!t[o];o&&"undefined"!==o&&n[o]!==s&&s&&(Yr(e,o,!0),n[o]=s)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r,"function"!=typeof r&&r),n&&e.addEventListener(o,n,"function"!=typeof n&&n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=_r.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(Br(e,o,n,i),i&&qr([o]))}else if("attr:"===t.slice(0,5))zr(e,t.slice(5),n);else if("bool:"===t.slice(0,5))!function(e,t,n){Gr(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}(e,t.slice(5),n);else if((d="prop:"===t.slice(0,5))||(c=Or.has(t))||!o&&((u=function(e,t){const n=Nr[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(l=Mr.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),l=!0;else if(Gr(e))return n;"class"===t||"className"===t?Vr(e,n):!a||l||c?e[u||t]=n:e[(h=t,h.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase())))]=n}else{const r=o&&t.indexOf(":")>-1&&Lr[t.split(":")[0]];r?function(e,t,n,r){Gr(e)||(null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}(e,r,t,n):zr(e,Ar[t]||t,n)}var h;return n}function Xr(e){if(mn.registry&&mn.events&&mn.events.find((([t,n])=>n===e)))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),mn.registry&&!mn.done&&(mn.done=_$HY.done=!0),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Jr(e,t,n,r,o){const i=Gr(e);if(i){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){const r=n[e];8===r.nodeType&&"!$"===r.data.slice(0,2)?r.remove():t.push(r)}n=t}for(;"function"==typeof n;)n=n();if(t===n)return n;const s=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===s||"number"===s){if(i)return n;if("number"===s&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=to(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===s){if(i)return n;n=to(e,n,r)}else{if("function"===s)return Ln((()=>{let o=t();for(;"function"==typeof o;)o=o();n=Jr(e,o,n,r)})),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(Zr(s,t,n,o))return Ln((()=>n=Jr(e,s,n,r,!0))),()=>n;if(i){if(!s.length)return n;if(void 0===r)return n=[...e.childNodes];let t=s[0];if(t.parentNode!==e)return n;const o=[t];for(;(t=t.nextSibling)!==r;)o.push(t);return n=o}if(0===s.length){if(n=to(e,n,r),a)return n}else l?0===n.length?eo(e,s,r):function(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;)if(t[s]!==n[a]){for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const t=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],t)}else if(i===a)for(;s<o;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=a;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[s]);if(null!=r)if(a<r&&r<i){let l,u=s,d=1;for(;++u<o&&u<i&&null!=(l=c.get(t[u]))&&l===r+d;)d++;if(d>r-a){const o=t[s];for(;a<r;)e.insertBefore(n[a++],o)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,n,s):(n&&to(e),eo(e,s));n=s}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=to(e,n,r,t);to(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function Zr(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let s,a=t[i],l=n&&n[e.length];if(null==a||!0===a||!1===a);else if("object"==(s=typeof a)&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zr(e,a,l)||o;else if("function"===s)if(r){for(;"function"==typeof a;)a=a();o=Zr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const t=String(a);e.push(l&&3===l.nodeType&&l.data===t?l:document.createTextNode(t))}}return o}function eo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function to(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const s=t[i];if(o!==s){const t=s.parentNode===e;r||i?t&&s.remove():t?e.replaceChild(o,s):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function no(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function ro(e){const{useShadow:t}=e,n=document.createTextNode(""),r=Un();let o,i=!!mn.context;return $n((()=>{i&&(Un().user=i=!1),o||(o=function(e,t){const n=jn,r=Tn;jn=e,Tn=null;try{return nr(t,!0)}catch(o){cr(o)}finally{jn=n,Tn=r}}(r,(()=>Fn((()=>e.children)))));const s=e.mount||document.body;if(s instanceof HTMLHeadElement){const[e,t]=_n(!1),n=()=>t(!0);Nn((t=>Wr(s,(()=>e()?t():o()),null))),Bn(n)}else{const r=no(e.isSVG?"g":"div",e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Wr(i,o),s.appendChild(r),e.ref&&e.ref(r),Bn((()=>s.removeChild(r)))}}),void 0,{render:!i}),n}function oo(e){const[t,n]=wr(e,["component"]),r=Fn((()=>t.component));return Fn((()=>{const e=r();switch(typeof e){case"function":return qn((()=>e(n)));case"string":const t=Rr.has(e),r=mn.context?Hr():no(e,t);return Ur(r,n,t),r}}))}var io=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},so=class{constructor(e){this.generateIdentifier=e,this.kv=new io}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},ao=class extends so{constructor(){super((e=>e.name)),this.classToAllowedProps=new Map}register(e,t){"object"==typeof t?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function lo(e,t){const n=function(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}(e);if("find"in n)return n.find(t);const r=n;for(let o=0;o<r.length;o++){const e=r[o];if(t(e))return e}}function co(e,t){Object.entries(e).forEach((([e,n])=>t(n,e)))}function uo(e,t){return-1!==e.indexOf(t)}function ho(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var fo=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return lo(this.transfomers,(t=>t.isApplicable(e)))}findByName(e){return this.transfomers[e]}},po=e=>void 0===e,go=e=>"object"==typeof e&&null!==e&&(e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype)),mo=e=>go(e)&&0===Object.keys(e).length,vo=e=>Array.isArray(e),yo=e=>e instanceof Map,bo=e=>e instanceof Set,wo=e=>"Symbol"===(e=>Object.prototype.toString.call(e).slice(8,-1))(e),xo=e=>"number"==typeof e&&isNaN(e),ko=e=>(e=>"boolean"==typeof e)(e)||(e=>null===e)(e)||po(e)||(e=>"number"==typeof e&&!isNaN(e))(e)||(e=>"string"==typeof e)(e)||wo(e),So=e=>e.replace(/\./g,"\\."),Co=e=>e.map(String).map(So).join("."),Eo=e=>{const t=[];let n="";for(let r=0;r<e.length;r++){let o=e.charAt(r);if("\\"===o&&"."===e.charAt(r+1)){n+=".",r++;continue}"."===o?(t.push(n),n=""):n+=o}return t.push(n),t};function Po(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var jo=[Po(po,"undefined",(()=>null),(()=>{})),Po((e=>"bigint"==typeof e),"bigint",(e=>e.toString()),(e=>"undefined"!=typeof BigInt?BigInt(e):e)),Po((e=>e instanceof Date&&!isNaN(e.valueOf())),"Date",(e=>e.toISOString()),(e=>new Date(e))),Po((e=>e instanceof Error),"Error",((e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach((t=>{n[t]=e[t]})),n}),((e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach((t=>{n[t]=e[t]})),n})),Po((e=>e instanceof RegExp),"regexp",(e=>""+e),(e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)})),Po(bo,"set",(e=>[...e.values()]),(e=>new Set(e))),Po(yo,"map",(e=>[...e.entries()]),(e=>new Map(e))),Po((e=>{return xo(e)||((t=e)===1/0||t===-1/0);var t}),"number",(e=>xo(e)?"NaN":e>0?"Infinity":"-Infinity"),Number),Po((e=>0===e&&1/e==-1/0),"number",(()=>"-0"),Number),Po((e=>e instanceof URL),"URL",(e=>e.toString()),(e=>new URL(e)))];function Do(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var To=Do(((e,t)=>{if(wo(e)){return!!t.symbolRegistry.getIdentifier(e)}return!1}),((e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)]),(e=>e.description),((e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r})),Mo=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(((e,t)=>(e[t.name]=t,e)),{}),Oo=Do((e=>ArrayBuffer.isView(e)&&!(e instanceof DataView)),(e=>["typed-array",e.constructor.name]),(e=>[...e]),((e,t)=>{const n=Mo[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)}));function Ao(e,t){if(null==e?void 0:e.constructor){return!!t.classRegistry.getIdentifier(e.constructor)}return!1}var No=Do(Ao,((e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)]),((e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach((t=>{r[t]=e[t]})),r}),((e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)})),_o=Do(((e,t)=>!!t.customTransformerRegistry.findApplicable(e)),((e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name]),((e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e)),((e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)})),Ro=[No,To,_o,Oo],Lo=(e,t)=>{const n=ho(Ro,(n=>n.isApplicable(e,t)));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=ho(jo,(n=>n.isApplicable(e,t)));return r?{value:r.transform(e,t),type:r.annotation}:void 0},$o={};jo.forEach((e=>{$o[e.annotation]=e}));var Fo=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Io(e){if(uo(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(uo(e,"prototype"))throw new Error("prototype is not allowed as a property");if(uo(e,"constructor"))throw new Error("constructor is not allowed as a property")}var qo=(e,t,n)=>{if(Io(t),0===t.length)return n(e);let r=e;for(let i=0;i<t.length-1;i++){const e=t[i];if(vo(r)){r=r[+e]}else if(go(r))r=r[e];else if(bo(r)){r=Fo(r,+e)}else if(yo(r)){if(i===t.length-2)break;const n=0==+t[++i]?"key":"value",o=Fo(r,+e);switch(n){case"key":r=o;break;case"value":r=r.get(o)}}}const o=t[t.length-1];if(vo(r)?r[+o]=n(r[+o]):go(r)&&(r[o]=n(r[o])),bo(r)){const e=Fo(r,+o),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(yo(r)){const e=Fo(r,+t[t.length-2]);switch(0==+o?"key":"value"){case"key":{const t=n(e);r.set(t,r.get(e)),t!==e&&r.delete(e);break}case"value":r.set(e,n(r.get(e)))}}return e};function zo(e,t,n=[]){if(!e)return;if(!vo(e))return void co(e,((e,r)=>zo(e,t,[...n,...Eo(r)])));const[r,o]=e;o&&co(o,((e,r)=>{zo(e,t,[...n,...Eo(r)])})),t(r,n)}function Vo(e,t,n){return zo(t,((t,r)=>{e=qo(e,r,(e=>((e,t,n)=>{if(!vo(t)){const r=$o[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}switch(t[0]){case"symbol":return To.untransform(e,t,n);case"class":return No.untransform(e,t,n);case"custom":return _o.untransform(e,t,n);case"typed-array":return Oo.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}})(e,t,n)))})),e}function Bo(e,t){function n(t,n){const r=((e,t)=>{Io(t);for(let n=0;n<t.length;n++){const r=t[n];if(bo(e))e=Fo(e,+r);else if(yo(e)){const o=0==+t[++n]?"key":"value",i=Fo(e,+r);switch(o){case"key":e=i;break;case"value":e=e.get(i)}}else e=e[r]}return e})(e,Eo(n));t.map(Eo).forEach((t=>{e=qo(e,t,(()=>r))}))}if(vo(t)){const[r,o]=t;r.forEach((t=>{e=qo(e,Eo(t),(()=>e))})),o&&co(o,n)}else co(t,n);return e}var Uo=(e,t,n,r,o=[],i=[],s=new Map)=>{var a;const l=ko(e);if(!l){!function(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}(e,o,t);const n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!((e,t)=>go(e)||vo(e)||yo(e)||bo(e)||Ao(e,t))(e,n)){const t=Lo(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return l||s.set(e,r),r}if(uo(i,e))return{transformedValue:null};const c=Lo(e,n),u=null!=(a=null==c?void 0:c.value)?a:e,d=vo(u)?[]:{},h={};co(u,((a,l)=>{if("__proto__"===l||"constructor"===l||"prototype"===l)throw new Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);const c=Uo(a,t,n,r,[...o,l],[...i,e],s);d[l]=c.transformedValue,vo(c.annotations)?h[l]=c.annotations:go(c.annotations)&&co(c.annotations,((e,t)=>{h[So(l)+"."+t]=e}))}));const f=mo(h)?{transformedValue:d,annotations:c?[c.type]:void 0}:{transformedValue:d,annotations:c?[c.type,h]:h};return l||s.set(e,f),f};function Ko(e){return Object.prototype.toString.call(e).slice(8,-1)}function Wo(e){return"Array"===Ko(e)}function Ho(e,t={}){if(Wo(e))return e.map((e=>Ho(e,t)));if(!function(e){if("Object"!==Ko(e))return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(e))return e;return[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].reduce(((n,r)=>{if(Wo(t.props)&&!t.props.includes(r))return n;return function(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";"enumerable"===i&&(e[t]=n),o&&"nonenumerable"===i&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}(n,r,Ho(e[r],t),e,t.nonenumerable),n}),{})}var Go=class{constructor({dedupe:e=!1}={}){this.classRegistry=new ao,this.symbolRegistry=new so((e=>{var t;return null!=(t=e.description)?t:""})),this.customTransformerRegistry=new fo,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=Uo(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const o=function(e,t){const n={};let r;return e.forEach((e=>{if(e.length<=1)return;t||(e=e.map((e=>e.map(String))).sort(((e,t)=>e.length-t.length)));const[o,...i]=e;0===o.length?r=i.map(Co):n[Co(o)]=i.map(Co)})),r?mo(n)?[r]:[r,n]:mo(n)?void 0:n}(t,this.dedupe);return o&&(r.meta={...r.meta,referentialEqualities:o}),r}deserialize(e){const{json:t,meta:n}=e;let r=Ho(t);return(null==n?void 0:n.values)&&(r=Vo(r,n.values,this)),(null==n?void 0:n.referentialEqualities)&&(r=Bo(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Go.defaultInstance=new Go,Go.serialize=Go.defaultInstance.serialize.bind(Go.defaultInstance),Go.deserialize=Go.defaultInstance.deserialize.bind(Go.defaultInstance),Go.stringify=Go.defaultInstance.stringify.bind(Go.defaultInstance),Go.parse=Go.defaultInstance.parse.bind(Go.defaultInstance),Go.registerClass=Go.defaultInstance.registerClass.bind(Go.defaultInstance),Go.registerSymbol=Go.defaultInstance.registerSymbol.bind(Go.defaultInstance),Go.registerCustom=Go.defaultInstance.registerCustom.bind(Go.defaultInstance),Go.allowErrorProps=Go.defaultInstance.allowErrorProps.bind(Go.defaultInstance);var Yo=Go.serialize,Qo=Go.stringify;function Xo(e){return"fetching"===e.state.fetchStatus?"fetching":e.getObserversCount()?"paused"===e.state.fetchStatus?"paused":e.isStale()?"stale":"fresh":"inactive"}function Jo({status:e,isPaused:t}){return t?"purple":"error"===e?"red":"pending"===e?"yellow":"success"===e?"green":"gray"}var Zo=(e,t=!1)=>{const{json:n}=Yo(e);return JSON.stringify(n,null,t?2:void 0)},ei=e=>"idle"!==e.state.fetchStatus?0:e.getObserversCount()?e.isStale()?2:1:3,ti=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,ni={status:(e,t)=>ei(e)===ei(t)?ti(e,t):ei(e)>ei(t)?1:-1,"query hash":(e,t)=>e.queryHash.localeCompare(t.queryHash),"last updated":ti},ri=e=>e.state.isPaused?0:"error"===e.state.status?2:"pending"===e.state.status?1:3,oi=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,ii={status:(e,t)=>ri(e)===ri(t)?oi(e,t):ri(e)>ri(t)?1:-1,"last updated":oi},si=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),ai=()=>{const[e,t]=_n("dark");return Vn((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");t(e.matches?"dark":"light");const n=e=>{t(e.matches?"dark":"light")};e.addEventListener("change",n),Bn((()=>e.removeEventListener("change",n)))})),e},li=(e,t,n)=>{if(0===t.length)return n;if(e instanceof Map){const r=new Map(e);if(1===t.length)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,li(r.get(o),i,n)),r}if(e instanceof Set){const r=li(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(1===t.length)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=li(r[o],i,n),r}if(e instanceof Object){const r={...e};if(1===t.length)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=li(r[o],i,n),r}return e},ci=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(1===t.length)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,ci(n.get(r),o)),n}if(e instanceof Set){const n=ci(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(1===t.length)return n.filter(((e,n)=>n.toString()!==t[0]));const[r,...o]=t;return n[r]=ci(n[r],o),n}if(e instanceof Object){const n={...e};if(1===t.length)return delete n[t[0]],n;const[r,...o]=t;return n[r]=ci(n[r],o),n}return e},ui=(e,t)=>{if(!e)return;if(document.querySelector("#_goober")||(null==t?void 0:t.querySelector("#_goober")))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),t?t.appendChild(n):document.head.appendChild(n)},di=(Le=class{constructor(e){rt(this,Se),rt(this,Ce),rt(this,Ee),rt(this,Pe),rt(this,je,!1),rt(this,De),rt(this,Te),rt(this,Me),rt(this,Oe),rt(this,Ae),rt(this,Ne),rt(this,_e),rt(this,Re);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;ot(this,Se,_n(t)),ot(this,Ee,n),ot(this,Pe,r),ot(this,Ce,o),ot(this,De,c),ot(this,Te,u),ot(this,Me,_n(i)),ot(this,Oe,_n(s)),ot(this,Ae,_n(a)),ot(this,Ne,_n(l))}setButtonPosition(e){nt(this,Me)[1](e)}setPosition(e){nt(this,Oe)[1](e)}setInitialIsOpen(e){nt(this,Ae)[1](e)}setErrorTypes(e){nt(this,Ne)[1](e)}setClient(e){nt(this,Se)[1](e)}mount(e){if(nt(this,je))throw new Error("Devtools is already mounted");const t=Fr((()=>{const e=this,[t]=nt(this,Me),[n]=nt(this,Oe),[r]=nt(this,Ae),[o]=nt(this,Ne),[i]=nt(this,Se);let s;return nt(this,_e)?s=nt(this,_e):(s=xr((()=>Promise.resolve().then((()=>_B)))),ot(this,_e,s)),ui(nt(this,De),nt(this,Te)),pr(s,br({get queryFlavor(){return nt(e,Ee)},get version(){return nt(e,Pe)},get onlineManager(){return nt(e,Ce)},get shadowDOMTarget(){return nt(e,Te)}},{get client(){return i()},get buttonPosition(){return t()},get position(){return n()},get initialIsOpen(){return r()},get errorTypes(){return o()}}))}),e);ot(this,je,!0),ot(this,Re,t)}unmount(){var e;if(!nt(this,je))throw new Error("Devtools is not mounted");null==(e=nt(this,Re))||e.call(this),ot(this,je,!1)}},Se=new WeakMap,Ce=new WeakMap,Ee=new WeakMap,Pe=new WeakMap,je=new WeakMap,De=new WeakMap,Te=new WeakMap,Me=new WeakMap,Oe=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,_e=new WeakMap,Re=new WeakMap,Le);Xe=class{constructor(e){rt(this,$e),rt(this,Fe),rt(this,Ie),rt(this,qe),rt(this,ze,!1),rt(this,Ve),rt(this,Be),rt(this,Ue),rt(this,Ke),rt(this,We),rt(this,He),rt(this,Ge),rt(this,Ye),rt(this,Qe);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;ot(this,$e,_n(t)),ot(this,Ie,n),ot(this,qe,r),ot(this,Fe,o),ot(this,Ve,c),ot(this,Be,u),ot(this,Ue,_n(i)),ot(this,Ke,_n(s)),ot(this,We,_n(a)),ot(this,He,_n(l)),ot(this,Ge,_n(d))}setButtonPosition(e){nt(this,Ue)[1](e)}setPosition(e){nt(this,Ke)[1](e)}setInitialIsOpen(e){nt(this,We)[1](e)}setErrorTypes(e){nt(this,He)[1](e)}setClient(e){nt(this,$e)[1](e)}setOnClose(e){nt(this,Ge)[1]((()=>e))}mount(e){if(nt(this,ze))throw new Error("Devtools is already mounted");const t=Fr((()=>{const e=this,[t]=nt(this,Ue),[n]=nt(this,Ke),[r]=nt(this,We),[o]=nt(this,He),[i]=nt(this,$e),[s]=nt(this,Ge);let a;return nt(this,Ye)?a=nt(this,Ye):(a=xr((()=>Promise.resolve().then((()=>RB)))),ot(this,Ye,a)),ui(nt(this,Ve),nt(this,Be)),pr(a,br({get queryFlavor(){return nt(e,Ie)},get version(){return nt(e,qe)},get onlineManager(){return nt(e,Fe)},get shadowDOMTarget(){return nt(e,Be)}},{get client(){return i()},get buttonPosition(){return t()},get position(){return n()},get initialIsOpen(){return r()},get errorTypes(){return o()},get onClose(){return s()}}))}),e);ot(this,ze,!0),ot(this,Qe,t)}unmount(){var e;if(!nt(this,ze))throw new Error("Devtools is not mounted");null==(e=nt(this,Qe))||e.call(this),ot(this,ze,!1)}},$e=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,qe=new WeakMap,ze=new WeakMap,Ve=new WeakMap,Be=new WeakMap,Ue=new WeakMap,Ke=new WeakMap,We=new WeakMap,He=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Qe=new WeakMap;var hi="development"!==process.env.NODE_ENV?function(){return null}:function(e){const n=sn(e.client),r=lt.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l,shadowDOMTarget:c}=e,[u]=lt.useState(new di({client:n,queryFlavor:"React Query",version:"5",onlineManager:Nt,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l,shadowDOMTarget:c}));return lt.useEffect((()=>{u.setClient(n)}),[n,u]),lt.useEffect((()=>{o&&u.setButtonPosition(o)}),[o,u]),lt.useEffect((()=>{i&&u.setPosition(i)}),[i,u]),lt.useEffect((()=>{u.setInitialIsOpen(s||!1)}),[s,u]),lt.useEffect((()=>{u.setErrorTypes(a||[])}),[a,u]),lt.useEffect((()=>(r.current&&u.mount(r.current),()=>{u.unmount()})),[u]),t.jsx("div",{className:"tsqd-parent-container",ref:r})};function fi(e){function t(e,t){Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.message=e,this.code=t}return(t.prototype=new Error).name=e,t.prototype.constructor=t,t}process;const pi=fi("LaunchDarklyUnexpectedResponseError"),gi=fi("LaunchDarklyInvalidEnvironmentIdError"),mi=fi("LaunchDarklyInvalidUserError"),vi=fi("LaunchDarklyInvalidEventKeyError"),yi=fi("LaunchDarklyInvalidArgumentError"),bi=fi("LaunchDarklyFlagFetchError");for(var wi={LDUnexpectedResponseError:pi,LDInvalidEnvironmentIdError:gi,LDInvalidUserError:mi,LDInvalidEventKeyError:vi,LDInvalidArgumentError:yi,LDInvalidDataError:fi("LaunchDarklyInvalidDataError"),LDFlagFetchError:bi,LDTimeoutError:fi("LaunchDarklyTimeoutError"),isHttpErrorRecoverable:function(e){return!(e>=400&&e<500)||400===e||408===e||429===e}},xi=[],ki=[],Si=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ci=0;Ci<64;++Ci)xi[Ci]=Si[Ci],ki[Si.charCodeAt(Ci)]=Ci;function Ei(e,t,n){for(var r,o=[],i=t;i<n;i+=3)o.push(xi[(r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+xi[r>>12&63]+xi[r>>6&63]+xi[63&r]);return o.join("")}ki["-".charCodeAt(0)]=62,ki["_".charCodeAt(0)]=63;var Pi=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(Ei(e,s,s+i>a?a:s+i));return 1===r?o.push(xi[(t=e[n-1])>>2]+xi[t<<4&63]+"=="):2===r&&o.push(xi[(t=(e[n-2]<<8)+e[n-1])>>10]+xi[t>>4&63]+xi[t<<2&63]+"="),o.join("")},ji=Array.isArray,Di=Object.keys,Ti=Object.prototype.hasOwnProperty,Mi=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,o,i,s=ji(t),a=ji(n);if(s&&a){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)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 h=Di(t);if((o=h.length)!==Di(n).length)return!1;for(r=o;0!=r--;)if(!Ti.call(n,h[r]))return!1;for(r=o;0!=r--;)if(!e(t[i=h[r]],n[i]))return!1;return!0}return t!=t&&n!=n};const Oi=["key","ip","country","email","firstName","lastName","avatar","name"];function Ai(e){const t=unescape(encodeURIComponent(e));return Pi(function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return t}(t))}function Ni(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var _i,Ri={appendUrlPath:function(e,t){return(e.endsWith("/")?e.substring(0,e.length-1):e)+(t.startsWith("/")?"":"/")+t},base64URLEncode:function(e){return Ai(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},btoa:Ai,clone:function(e){return JSON.parse(JSON.stringify(e))},deepEquals:function(e,t){return Mi(e,t)},extend:function(...e){return e.reduce(((e,t)=>({...e,...t})),{})},getLDUserAgentString:function(e){return e.userAgent+"/"+(e.version||"?")},objectHasOwnProperty:Ni,onNextTick:function(e){setTimeout(e,0)},sanitizeContext:function(e){if(!e)return e;let t;return null!=e.kind||Oi.forEach((n=>{const r=e[n];void 0!==r&&"string"!=typeof r&&(t=t||{...e},t[n]=String(r))})),t||e},transformValuesToVersionedValues:function(e){const t={};for(const n in e)Ni(e,n)&&(t[n]={value:e[n],version:0});return t},transformVersionedValuesToValues:function(e){const t={};for(const n in e)Ni(e,n)&&(t[n]=e[n].value);return t},wrapPromiseCallback:function(e,t){const n=e.then((e=>(t&&setTimeout((()=>{t(null,e)}),0),e)),(e=>{if(!t)return Promise.reject(e);setTimeout((()=>{t(e,null)}),0)}));return t?void 0:n}},Li=new Uint8Array(16);function $i(){if(!_i&&!(_i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _i(Li)}var Fi=/^(?:[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 Ii(e){return"string"==typeof e&&Fi.test(e)}for(var qi,zi,Vi=[],Bi=0;Bi<256;++Bi)Vi.push((Bi+256).toString(16).substr(1));function Ui(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Vi[e[t+0]]+Vi[e[t+1]]+Vi[e[t+2]]+Vi[e[t+3]]+"-"+Vi[e[t+4]]+Vi[e[t+5]]+"-"+Vi[e[t+6]]+Vi[e[t+7]]+"-"+Vi[e[t+8]]+Vi[e[t+9]]+"-"+Vi[e[t+10]]+Vi[e[t+11]]+Vi[e[t+12]]+Vi[e[t+13]]+Vi[e[t+14]]+Vi[e[t+15]]).toLowerCase();if(!Ii(n))throw TypeError("Stringified UUID is invalid");return n}var Ki=0,Wi=0;function Hi(e){if(!Ii(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 Gi(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=Hi(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+e.length);if(s.set(r),s.set(e,r.length),(s=n(s))[6]=15&s[6]|t,s[8]=63&s[8]|128,o){i=i||0;for(var a=0;a<16;++a)o[i+a]=s[a];return o}return Ui(s)}try{r.name=e}catch(o){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function Yi(e){return 14+(e+64>>>9<<4)+1}function Qi(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Xi(e,t,n,r,o,i){return Qi((s=Qi(Qi(t,e),Qi(r,i)))<<(a=o)|s>>>32-a,n);var s,a}function Ji(e,t,n,r,o,i,s){return Xi(t&n|~t&r,e,t,o,i,s)}function Zi(e,t,n,r,o,i,s){return Xi(t&r|n&~r,e,t,o,i,s)}function es(e,t,n,r,o,i,s){return Xi(t^n^r,e,t,o,i,s)}function ts(e,t,n,r,o,i,s){return Xi(n^(t|~r),e,t,o,i,s)}var ns=Gi("v3",48,(function(e){if("string"==typeof e){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(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var i=e[o>>5]>>>o%32&255,s=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Yi(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,s=0;s<e.length;s+=16){var a=n,l=r,c=o,u=i;n=Ji(n,r,o,i,e[s],7,-680876936),i=Ji(i,n,r,o,e[s+1],12,-389564586),o=Ji(o,i,n,r,e[s+2],17,606105819),r=Ji(r,o,i,n,e[s+3],22,-1044525330),n=Ji(n,r,o,i,e[s+4],7,-176418897),i=Ji(i,n,r,o,e[s+5],12,1200080426),o=Ji(o,i,n,r,e[s+6],17,-1473231341),r=Ji(r,o,i,n,e[s+7],22,-45705983),n=Ji(n,r,o,i,e[s+8],7,1770035416),i=Ji(i,n,r,o,e[s+9],12,-1958414417),o=Ji(o,i,n,r,e[s+10],17,-42063),r=Ji(r,o,i,n,e[s+11],22,-1990404162),n=Ji(n,r,o,i,e[s+12],7,1804603682),i=Ji(i,n,r,o,e[s+13],12,-40341101),o=Ji(o,i,n,r,e[s+14],17,-1502002290),n=Zi(n,r=Ji(r,o,i,n,e[s+15],22,1236535329),o,i,e[s+1],5,-165796510),i=Zi(i,n,r,o,e[s+6],9,-1069501632),o=Zi(o,i,n,r,e[s+11],14,643717713),r=Zi(r,o,i,n,e[s],20,-373897302),n=Zi(n,r,o,i,e[s+5],5,-701558691),i=Zi(i,n,r,o,e[s+10],9,38016083),o=Zi(o,i,n,r,e[s+15],14,-660478335),r=Zi(r,o,i,n,e[s+4],20,-405537848),n=Zi(n,r,o,i,e[s+9],5,568446438),i=Zi(i,n,r,o,e[s+14],9,-1019803690),o=Zi(o,i,n,r,e[s+3],14,-187363961),r=Zi(r,o,i,n,e[s+8],20,1163531501),n=Zi(n,r,o,i,e[s+13],5,-1444681467),i=Zi(i,n,r,o,e[s+2],9,-51403784),o=Zi(o,i,n,r,e[s+7],14,1735328473),n=es(n,r=Zi(r,o,i,n,e[s+12],20,-1926607734),o,i,e[s+5],4,-378558),i=es(i,n,r,o,e[s+8],11,-2022574463),o=es(o,i,n,r,e[s+11],16,1839030562),r=es(r,o,i,n,e[s+14],23,-35309556),n=es(n,r,o,i,e[s+1],4,-1530992060),i=es(i,n,r,o,e[s+4],11,1272893353),o=es(o,i,n,r,e[s+7],16,-155497632),r=es(r,o,i,n,e[s+10],23,-1094730640),n=es(n,r,o,i,e[s+13],4,681279174),i=es(i,n,r,o,e[s],11,-358537222),o=es(o,i,n,r,e[s+3],16,-722521979),r=es(r,o,i,n,e[s+6],23,76029189),n=es(n,r,o,i,e[s+9],4,-640364487),i=es(i,n,r,o,e[s+12],11,-421815835),o=es(o,i,n,r,e[s+15],16,530742520),n=ts(n,r=es(r,o,i,n,e[s+2],23,-995338651),o,i,e[s],6,-198630844),i=ts(i,n,r,o,e[s+7],10,1126891415),o=ts(o,i,n,r,e[s+14],15,-1416354905),r=ts(r,o,i,n,e[s+5],21,-57434055),n=ts(n,r,o,i,e[s+12],6,1700485571),i=ts(i,n,r,o,e[s+3],10,-1894986606),o=ts(o,i,n,r,e[s+10],15,-1051523),r=ts(r,o,i,n,e[s+1],21,-2054922799),n=ts(n,r,o,i,e[s+8],6,1873313359),i=ts(i,n,r,o,e[s+15],10,-30611744),o=ts(o,i,n,r,e[s+6],15,-1560198380),r=ts(r,o,i,n,e[s+13],21,1309151649),n=ts(n,r,o,i,e[s+4],6,-145523070),i=ts(i,n,r,o,e[s+11],10,-1120210379),o=ts(o,i,n,r,e[s+2],15,718787259),r=ts(r,o,i,n,e[s+9],21,-343485551),n=Qi(n,a),r=Qi(r,l),o=Qi(o,c),i=Qi(i,u)}return[n,r,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(Yi(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}));function rs(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 os(e,t){return e<<t|e>>>32-t}var is=Gi("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){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=Math.ceil((e.length/4+2)/16),s=new Array(i),a=0;a<i;++a){for(var l=new Uint32Array(16),c=0;c<16;++c)l[c]=e[64*a+4*c]<<24|e[64*a+4*c+1]<<16|e[64*a+4*c+2]<<8|e[64*a+4*c+3];s[a]=l}s[i-1][14]=8*(e.length-1)/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=8*(e.length-1)&4294967295;for(var u=0;u<i;++u){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[u][h];for(var f=16;f<80;++f)d[f]=os(d[f-3]^d[f-8]^d[f-14]^d[f-16],1);for(var p=n[0],g=n[1],m=n[2],v=n[3],y=n[4],b=0;b<80;++b){var w=Math.floor(b/20),x=os(p,5)+rs(w,g,m,v)+y+t[w]+d[b]>>>0;y=v,v=m,m=os(g,30)>>>0,g=p,p=x}n[0]=n[0]+p>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>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]]})),ss=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||qi,s=void 0!==e.clockseq?e.clockseq:zi;if(null==i||null==s){var a=e.random||(e.rng||$i)();null==i&&(i=qi=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=zi=16383&(a[6]<<8|a[7]))}var l=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:Wi+1,u=l-Ki+(c-Wi)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||l>Ki)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ki=l,Wi=c,zi=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 h=l/4294967296*1e4&268435455;o[r++]=h>>>8&255,o[r++]=255&h,o[r++]=h>>>24&15|16,o[r++]=h>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var f=0;f<6;++f)o[r+f]=i[f];return t||Ui(o)},v3:ns,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||$i)();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 Ui(r)},v5:is,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Ii(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Ii,stringify:Ui,parse:Hi});const as=["debug","info","warn","error","none"];var ls={commonBasicLogger:function(e,t){if(e&&e.destination&&"function"!=typeof e.destination)throw new Error("destination for basicLogger was set to a non-function");function n(e){return function(e){console&&console}}const r=e&&e.destination?[e.destination,e.destination,e.destination,e.destination]:[n(),n(),n(),n()],o=!(!e||!e.destination),i=e&&null!=e.prefix?e.prefix:"[LaunchDarkly] ";let s=1;if(e&&e.level)for(let c=0;c<as.length;c++)as[c]===e.level&&(s=c);function a(e,n,s){if(s.length<1)return;let a;const l=o?n+": "+i:i;if(1!==s.length&&t){const e=[...s];e[0]=l+e[0],a=t(...e)}else a=l+s[0];try{r[e](a)}catch(c){console&&console}}const l={};for(let c=0;c<as.length;c++){const e=as[c];if("none"!==e)if(c<s)l[e]=()=>{};else{const t=c;l[e]=function(){a(t,e,arguments)}}}return l},validateLogger:function(e){as.forEach((t=>{if("none"!==t&&(!e[t]||"function"!=typeof e[t]))throw new Error("Provided logger instance must support logger."+t+"(...) method")}))}};function cs(e){return e&&e.message?e.message:"string"==typeof e||e instanceof String?e:JSON.stringify(e)}const us=" Please see https://docs.launchdarkly.com/sdk/client-side/javascript#initialize-the-client for instructions on SDK initialization.";var ds=function(){return"LaunchDarkly bootstrap data is not available because the back end could not read the flags."},hs=function(){return"LaunchDarkly client was initialized with bootstrap data that did not include flag metadata. Events may not be sent correctly."+us},fs=function(){return"LaunchDarkly client initialized"},ps=function(e){return'enqueueing "'+e+'" event'},gs=function(e){return"sending diagnostic event ("+e.kind+")"},ms=function(e){return"sending "+e+" events"},vs=function(e){return'received streaming deletion for flag "'+e+'"'},ys=function(e){return'received streaming deletion for flag "'+e+'" but ignored due to version check'},bs=function(e){return'received streaming update for flag "'+e+'"'},ws=function(e){return'received streaming update for flag "'+e+'" but ignored due to version check'},xs=function(){return"received ping message from stream"},ks=function(e){return"polling for feature flags at "+e},Ss=function(){return"received streaming update for all flags"},Cs=function(e,t){return t?'"'+e+'" is deprecated, please use "'+t+'"':'"'+e+'" is deprecated'},Es=function(){return"Environment not found. Double check that you specified a valid environment/client-side ID."+us},Ps=function(){return"No environment/client-side ID was specified."+us},js=function(e){return"Error fetching flag settings: "+cs(e)},Ds=function(){return"Exceeded event queue capacity. Increase capacity to avoid dropping events."},Ts=function(){return"Be sure to call `identify` in the LaunchDarkly client: https://docs.launchdarkly.com/sdk/features/identify#javascript"},Ms=function(e,t,n){return"Received error "+e+(401===e?" (invalid SDK key)":"")+" for "+t+" - "+(wi.isHttpErrorRecoverable(e)?n:"giving up permanently")},Os=function(){return"Cannot make HTTP requests in this environment."+us},As=function(){return"identify() has no effect here; it must be called on the main client instance"},Ns=(e,t)=>`an inspector: "${t}" of type: "${e}" generated an exception`,_s=function(e){return'Expected application/json content type but got "'+e+'"'},Rs=function(){return"Invalid data received from LaunchDarkly; connection may have been interrupted"},Ls=(e,t)=>`an inspector: "${t}" of an invalid type (${e}) was configured`,$s=e=>`The track function was called with a non-numeric "metricValue" (${e}), only numeric metric values are supported.`,Fs=function(){return"Invalid context specified."+us},Is=e=>`Config option "${e}" must only contain letters, numbers, ., _ or -.`,qs=function(e){return"local storage is unavailable: "+cs(e)},zs=e=>"network error"+(e?" ("+e+")":""),Vs=(e,t,n)=>'Config option "'+e+'" was set to '+t+", changing to minimum value of "+n,Bs=function(){return"Closing stream connection"},Us=function(e){return"Opening stream connection to "+e},Ks=function(e,t){return"Error on stream connection: "+cs(e)+", will continue retrying after "+t+" milliseconds."},Ws=e=>`Value of "${e}" was longer than 64 characters and was discarded.`,Hs=function(e){return'Custom event "'+e+'" does not exist'},Gs=e=>'Ignoring unknown config option "'+e+'"',Ys=function(){return"No context specified."+us},Qs=e=>`Error on stream connection ${cs(e)}, giving up permanently`,Xs=(e,t,n)=>'Config option "'+e+'" should be of type '+t+", got "+n+", using default value",Js=(e,t)=>'Config option "'+e+'" should be a boolean, got '+t+", converting to boolean";const{validateLogger:Zs}=ls,ea={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=ra(`${e}.id`,t.id,n)),t.version&&(r.version=ra(`${e}.version`,t.version,n)),r}},inspectors:{default:[]}},ta=/^(\w|\.|-)+$/;function na(e){return e&&e.replace(/\/+$/,"")}function ra(e,t,n){if("string"==typeof t&&t.match(ta)){if(!(t.length>64))return t;n.warn(Ws(e))}else n.warn(Is(e))}var oa={baseOptionDefs:ea,validate:function(e,t,n,r){const o=Ri.extend({logger:{default:r}},ea,n),i={};function s(e){Ri.onNextTick((()=>{t&&t.maybeReportError(new wi.LDInvalidArgumentError(e))}))}let a=Ri.extend({},e||{});return function(e){const t=e;Object.keys(i).forEach((e=>{if(void 0!==t[e]){const n=i[e];r&&r.warn(Cs(e,n)),n&&(void 0===t[n]&&(t[n]=t[e]),delete t[e])}}))}(a),a=function(e){const t=Ri.extend({},e);return Object.keys(o).forEach((e=>{null!=t[e]||(t[e]=o[e]&&o[e].default)})),t}(a),a=function(e){const t=Ri.extend({},e),n=e=>{if(null===e)return"any";if(void 0===e)return;if(Array.isArray(e))return"array";const t=typeof e;return"boolean"===t||"string"===t||"number"===t||"function"===t?t:"object"};return Object.keys(e).forEach((i=>{const a=e[i];if(null!=a){const l=o[i];if(void 0===l)s(Gs(i));else{const o=l.type||n(l.default),c=l.validator;if(c){const n=c(i,e[i],r);void 0!==n?t[i]=n:delete t[i]}else if("any"!==o){const e=o.split("|"),r=n(a);e.indexOf(r)<0?"boolean"===o?(t[i]=!!a,s(Js(i,r))):(s(Xs(i,o,r)),t[i]=l.default):"number"===r&&void 0!==l.minimum&&a<l.minimum&&(s(Vs(i,a,l.minimum)),t[i]=l.minimum)}}}})),t.baseUrl=na(t.baseUrl),t.streamUrl=na(t.streamUrl),t.eventsUrl=na(t.eventsUrl),t}(a),Zs(a.logger),a},getTags:function(e){const t={};return e&&(e.application&&null!=e.application.id&&(t["application-id"]=[e.application.id]),e.application&&void 0!==e.application.version&&null!==e.application.id&&(t["application-version"]=[e.application.version])),t}};const{getLDUserAgentString:ia}=Ri;var sa={getLDHeaders:function(e,t){if(t&&!t.sendLDHeaders)return{};const n={};n[e.userAgentHeaderName||"User-Agent"]=ia(e),t&&t.wrapperName&&(n["X-LaunchDarkly-Wrapper"]=t.wrapperVersion?t.wrapperName+"/"+t.wrapperVersion:t.wrapperName);const r=oa.getTags(t),o=Object.keys(r);return o.length&&(n["x-launchdarkly-tags"]=o.sort().map((e=>Array.isArray(r[e])?r[e].sort().map((t=>`${e}/${t}`)):[`${e}/${r[e]}`])).reduce(((e,t)=>e.concat(t)),[]).join(" ")),n},transformHeaders:function(e,t){return t&&t.requestHeaderTransform?t.requestHeaderTransform({...e}):e}};const{v1:aa}=ss,{getLDHeaders:la,transformHeaders:ca}=sa;var ua=function(e,t,n){const r=Ri.extend({"Content-Type":"application/json"},la(e,n)),o={sendEvents:(t,o,i)=>{if(!e.httpRequest)return Promise.resolve();const s=JSON.stringify(t),a=i?null:aa();return function t(l){const c=i?r:Ri.extend({},r,{"X-LaunchDarkly-Event-Schema":"4","X-LaunchDarkly-Payload-ID":a});return e.httpRequest("POST",o,ca(c,n),s).promise.then((e=>{if(e)return e.status>=400&&wi.isHttpErrorRecoverable(e.status)&&l?t(!1):function(e){const t={status:e.status},n=e.header("date");if(n){const e=Date.parse(n);e&&(t.serverTime=e)}return t}(e)})).catch((()=>l?t(!1):Promise.reject()))}(!0).catch((()=>{}))}};return o};const{commonBasicLogger:da}=ls;function ha(e){return"string"==typeof e&&"kind"!==e&&e.match(/^(\w|\.|-)+$/)}var fa={checkContext:function(e,t){if(e){if(t&&null==e.kind)return null!=e.key;const n=e.key,r=void 0===e.kind?"user":e.kind,o=ha(r),i="multi"===r||null!=n&&""!==n;if("multi"===r){const t=Object.keys(e).filter((e=>"kind"!==e));return i&&t.every((e=>ha(e)))&&t.every((t=>{const n=e[t].key;return null!=n&&""!==n}))}return i&&o}return!1},getContextKeys:function(e,t=da()){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((([e])=>"kind"!==e)).forEach((([e,t])=>{t&&t.key&&(n[e]=t.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?null==e.kind?["user"]:"multi"!==e.kind?[e.kind]:Object.keys(e).filter((e=>"kind"!==e)):[]}};const{getContextKinds:pa}=fa;function ga(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ma(e){return(e.startsWith("/")?e.substring(1):e).split("/").map((e=>e.indexOf("~")>=0?e.replace(/~1/g,"/").replace(/~0/g,"~"):e))}function va(e){return!e.startsWith("/")}function ya(e,t){const n=va(e),r=va(t);if(n&&r)return e===t;if(n){const n=ma(t);return 1===n.length&&e===n[0]}if(r){const n=ma(e);return 1===n.length&&t===n[0]}return e===t}function ba(e){return`/${ga(e)}`}var wa={cloneExcluding:function(e,t){const n=[],r={},o=[];for(n.push(...Object.keys(e).map((t=>({key:t,ptr:ba(t),source:e,parent:r,visited:[e]}))));n.length;){const e=n.pop();if(t.some((t=>ya(t,e.ptr))))o.push(e.ptr);else{const t=e.source[e.key];if(null===t)e.parent[e.key]=t;else if(Array.isArray(t))e.parent[e.key]=[...t];else if("object"==typeof t){if(e.visited.includes(t))continue;e.parent[e.key]={},n.push(...Object.keys(t).map((n=>{return{key:n,ptr:(r=e.ptr,o=ga(n),`${r}/${o}`),source:t,parent:e.parent[e.key],visited:[...e.visited,t]};var r,o})))}else e.parent[e.key]=t}}return{cloned:r,excluded:o.sort()}},compare:ya,literalToReference:ba};const{getContextKeys:xa}=fa;var ka=function(e,t,n,r=null,o=null,i=null){const s={},a=i||ua(e,0,t),l=Ri.appendUrlPath(t.eventsUrl,"/events/bulk/"+n),c=function(){const e={};let t=0,n=0,r={},o={};return e.summarizeEvent=e=>{if("feature"===e.kind){const s=e.key+":"+(null!=e.variation?e.variation:"")+":"+(null!=e.version?e.version:""),a=r[s];let l=o[e.key];l||(l=new Set,o[e.key]=l),(i=e,i.context?pa(i.context):i.contextKeys?Object.keys(i.contextKeys):[]).forEach((e=>l.add(e))),a?a.count=a.count+1:r[s]={count:1,key:e.key,version:e.version,variation:e.variation,value:e.value,default:e.default},(0===t||e.creationDate<t)&&(t=e.creationDate),e.creationDate>n&&(n=e.creationDate)}var i},e.getSummary=()=>{const e={};let i=!0;for(const t of Object.values(r)){let n=e[t.key];n||(n={default:t.default,counters:[],contextKinds:[...o[t.key]]},e[t.key]=n);const r={value:t.value,count:t.count};null!=t.variation&&(r.variation=t.variation),null!=t.version?r.version=t.version:r.unknown=!0,n.counters.push(r),i=!1}return i?null:{startDate:t,endDate:n,features:e}},e.clearSummary=()=>{t=0,n=0,r={},o={}},e}(),u=function(e){const t={},n=e.allAttributesPrivate,r=e.privateAttributes||[],o=["key","kind","_meta","anonymous"],i=["name","ip","firstName","lastName","email","avatar","country"],s=(e,t)=>{if("object"!=typeof e||null===e||Array.isArray(e))return;const{cloned:i,excluded:s}=wa.cloneExcluding(e,(a=e,(n||t&&a.anonymous?Object.keys(a):[...r,...a._meta&&a._meta.privateAttributes||[]]).filter((e=>!o.some((t=>wa.compare(e,t)))))));var a;return i.key=String(i.key),s.length&&(i._meta||(i._meta={}),i._meta.redactedAttributes=s),i._meta&&(delete i._meta.privateAttributes,0===Object.keys(i._meta).length&&delete i._meta),void 0!==i.anonymous&&(i.anonymous=!!i.anonymous),i};return t.filter=(e,t=!1)=>null==e.kind?s((e=>{const t={...e.custom||{},kind:"user",key:e.key};void 0!==e.anonymous&&(t.anonymous=!!e.anonymous);for(const n of i)delete t[n],null!=e[n]&&(t[n]=String(e[n]));return null!=e.privateAttributeNames&&(t._meta=t._meta||{},t._meta.privateAttributes=e.privateAttributeNames.map((e=>e.startsWith("/")?wa.literalToReference(e):e))),t})(e),t):"multi"===e.kind?((e,t)=>{const n={kind:e.kind},r=Object.keys(e);for(const o of r)if("kind"!==o){const r=s(e[o],t);r&&(n[o]=r)}return n})(e,t):s(e,t),t}(t),d=t.samplingInterval,h=t.eventCapacity,f=t.flushInterval,p=t.logger;let g,m=[],v=0,y=!1,b=!1;function w(){return 0===d||0===Math.floor(Math.random()*d)}function x(e){m.length<h?(m.push(e),b=!1):(b||(b=!0,p.warn(Ds())),r&&r.incrementDroppedEvents())}return s.enqueue=function(e){if(y)return;let t=!1,n=!1;var r;if(c.summarizeEvent(e),"feature"===e.kind?w()&&(t=!!e.trackEvents,n=!!(r=e).debugEventsUntilDate&&r.debugEventsUntilDate>v&&r.debugEventsUntilDate>(new Date).getTime()):t=w(),t&&x(function(e){const t=Ri.extend({},e);return"identify"===e.kind?t.context=u.filter(e.context):"feature"===e.kind?t.context=u.filter(e.context,!0):(t.contextKeys=xa(e.context,p),delete t.context),"feature"===e.kind&&(delete t.trackEvents,delete t.debugEventsUntilDate),t}(e)),n){const t=Ri.extend({},e,{kind:"debug"});t.context=u.filter(t.context),delete t.trackEvents,delete t.debugEventsUntilDate,x(t)}},s.flush=function(){if(y)return Promise.resolve();const e=m,t=c.getSummary();return c.clearSummary(),t&&(t.kind="summary",e.push(t)),r&&r.setEventsInLastBatch(e.length),0===e.length?Promise.resolve():(m=[],p.debug(ms(e.length)),a.sendEvents(e,l).then((e=>{e&&(e.serverTime&&(v=e.serverTime),wi.isHttpErrorRecoverable(e.status)||(y=!0),e.status>=400&&Ri.onNextTick((()=>{o.maybeReportError(new wi.LDUnexpectedResponseError(Ms(e.status,"event posting","some events were dropped")))})))})))},s.start=function(){const e=()=>{s.flush(),g=setTimeout(e,f)};g=setTimeout(e,f)},s.stop=function(){clearTimeout(g)},s};const Sa="ready",Ca="initialized",Ea="failed";const{appendUrlPath:Pa,base64URLEncode:ja,objectHasOwnProperty:Da}=Ri,{getLDHeaders:Ta,transformHeaders:Ma}=sa,{isHttpErrorRecoverable:Oa}=wi;var Aa=function(e,t,n,r){const o=t.streamUrl,i=t.logger,s={},a=Pa(o,"/eval/"+n),l=t.useReport,c=t.evaluationReasons,u=t.streamReconnectDelay,d=Ta(e,t);let h,f=!1,p=null,g=null,m=null,v=null,y=null,b=0;function w(e){if(e.status&&"number"==typeof e.status&&!Oa(e.status))return S(),i.error(Qs(e)),void(g&&(clearTimeout(g),g=null));const t=function(){const e=(t=function(){const e=u*Math.pow(2,b);return e>3e4?3e4:e}())-Math.trunc(.5*Math.random()*t);var t;return b+=1,e}();f||(i.warn(Ks(e,t)),f=!0),C(!1),S(),x(t)}function x(e){g||(e?g=setTimeout(k,e):k())}function k(){let r;g=null;let s="";const u={headers:d,readTimeoutMillis:3e5};if(e.eventSourceFactory){null!=v&&(s="h="+v),l?e.eventSourceAllowsReport?(r=a,u.method="REPORT",u.headers["Content-Type"]="application/json",u.body=JSON.stringify(m)):(r=Pa(o,"/ping/"+n),s=""):r=a+"/"+ja(JSON.stringify(m)),u.headers=Ma(u.headers,t),c&&(s=s+(s?"&":"")+"withReasons=true"),r=r+(s?"?":"")+s,S(),i.info(Us(r)),h=(new Date).getTime(),p=e.eventSourceFactory(r,u);for(const e in y)Da(y,e)&&p.addEventListener(e,y[e]);p.onerror=w,p.onopen=()=>{b=0}}}function S(){p&&(i.info(Bs()),p.close(),p=null)}function C(e){h&&r&&r.recordStreamInit(h,!e,(new Date).getTime()-h),h=null}return s.connect=function(e,t,n){m=e,v=t,y={};for(const r in n||{})y[r]=function(e){f=!1,C(!0),n[r]&&n[r](e)};x()},s.disconnect=function(){clearTimeout(g),g=null,S()},s.isConnected=function(){return!!(p&&e.eventSourceIsActive&&e.eventSourceIsActive(p))},s};const{transformHeaders:Na,getLDHeaders:_a}=sa,Ra="application/json";var La=function(e,t,n){const r=t.baseUrl,o=t.useReport,i=t.evaluationReasons,s=t.logger,a={},l={};function c(n,r){if(!e.httpRequest)return new Promise(((e,t)=>{t(new wi.LDFlagFetchError(Os()))}));const o=r?"REPORT":"GET",i=_a(e,t);r&&(i["Content-Type"]=Ra);let s=l[n];s||(s=function(e){let t,n,r,o;const i={addPromise:(i,s)=>{t=i,n&&n(),n=s,i.then((n=>{t===i&&(r(n),e&&e())}),(n=>{t===i&&(o(n),e&&e())}))}};return i.resultPromise=new Promise(((e,t)=>{r=e,o=t})),i}((()=>{delete l[n]})),l[n]=s);const a=e.httpRequest(o,n,Na(i,t),r),c=a.promise.then((e=>{if(200===e.status){if(e.header("content-type")&&e.header("content-type").substring(0,16)===Ra)return JSON.parse(e.body);{const t=_s(e.header("content-type")||"");return Promise.reject(new wi.LDFlagFetchError(t))}}return Promise.reject(404===(t=e).status?new wi.LDInvalidEnvironmentIdError(Es()):new wi.LDFlagFetchError(js(t.statusText||String(t.status))));var t}),(e=>Promise.reject(new wi.LDFlagFetchError(zs(e)))));return s.addPromise(c,(()=>{a.cancel&&a.cancel()})),s.resultPromise}return a.fetchJSON=function(e){return c(Ri.appendUrlPath(r,e),null)},a.fetchFlagSettings=function(e,t){let a,l,u,d="";return o?(l=[r,"/sdk/evalx/",n,"/context"].join(""),u=JSON.stringify(e)):(a=Ri.base64URLEncode(JSON.stringify(e)),l=[r,"/sdk/evalx/",n,"/contexts/",a].join("")),t&&(d="h="+t),i&&(d=d+(d?"&":"")+"withReasons=true"),l=l+(d?"?":"")+d,s.debug(ks(l)),c(l,u)},a};const{v1:$a}=ss,{getContextKinds:Fa}=fa;var Ia=function(e){function t(e){return null==e||"user"===e?"ld:$anonUserId":`ld:$contextKey:${e}`}function n(n,r){return null!=r.key?(r.key=r.key.toString(),Promise.resolve(r)):r.anonymous?(o=n,e.get(t(o))).then((o=>{if(o)return r.key=o,r;{const o=$a();return r.key=o,function(n,r){return e.set(t(r),n)}(o,n).then((()=>r))}})):Promise.reject(new wi.LDInvalidUserError(Fs()));var o}this.processContext=e=>{if(!e)return Promise.reject(new wi.LDInvalidUserError(Ys()));const t=Ri.clone(e);if("multi"===e.kind){const e=Fa(t);return Promise.all(e.map((e=>n(e,t[e])))).then((()=>t))}return n(e.kind,t)}};const{v1:qa}=ss,{baseOptionDefs:za}=oa,{appendUrlPath:Va}=Ri;var Ba=function(e){const t={diagnosticId:qa()};return e&&(t.sdkKeySuffix=e.length>6?e.substring(e.length-6):e),t},Ua=function(e){let t,n,r,o;function i(e){t=e,n=0,r=0,o=[]}return i(e),{getProps:()=>({dataSinceDate:t,droppedEvents:n,eventsInLastBatch:r,streamInits:o}),setProps:e=>{t=e.dataSinceDate,n=e.droppedEvents||0,r=e.eventsInLastBatch||0,o=e.streamInits||[]},incrementDroppedEvents:()=>{n++},setEventsInLastBatch:e=>{r=e},recordStreamInit:(e,t,n)=>{o.push({timestamp:e,failed:t,durationMillis:n})},reset:i}},Ka=function(e,t,n,r,o,i,s){const a=!!e.diagnosticUseCombinedEvent,l="ld:"+o+":$diagnostics",c=Va(i.eventsUrl,"/events/diagnostic/"+o),u=i.diagnosticRecordingInterval,d=n;let h,f,p=!!i.streaming;const g={};function m(){return{sdk:b(),configuration:{customBaseURI:i.baseUrl!==za.baseUrl.default,customStreamURI:i.streamUrl!==za.streamUrl.default,customEventsURI:i.eventsUrl!==za.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},platform:e.diagnosticPlatformData}}function v(e){i.logger&&i.logger.debug(gs(e)),r.sendEvents(e,c,!0).then((()=>{})).catch((()=>{}))}function y(){v(function(){const e=(new Date).getTime();let t={kind:a?"diagnostic-combined":"diagnostic",id:s,creationDate:e,...d.getProps()};return a&&(t={...t,...m()}),d.reset(e),t}()),f=setTimeout(y,u),h=(new Date).getTime(),a&&function(){if(t.isEnabled()){const e={...d.getProps()};t.set(l,JSON.stringify(e))}}()}function b(){const t={...e.diagnosticSdkData};return i.wrapperName&&(t.wrapperName=i.wrapperName),i.wrapperVersion&&(t.wrapperVersion=i.wrapperVersion),t}return g.start=()=>{a?function(e){if(!t.isEnabled())return e(!1);t.get(l).then((t=>{if(t)try{const e=JSON.parse(t);d.setProps(e),h=e.dataSinceDate}catch(n){}e(!0)})).catch((()=>{e(!1)}))}((e=>{if(e){const e=(h||0)+u,t=(new Date).getTime();t>=e?y():f=setTimeout(y,e-t)}else 0===Math.floor(4*Math.random())?y():f=setTimeout(y,u)})):(v({kind:"diagnostic-init",id:s,creationDate:d.getProps().dataSinceDate,...m()}),f=setTimeout(y,u))},g.stop=()=>{f&&clearTimeout(f)},g.setStreaming=e=>{p=e},g};const{onNextTick:Wa}=Ri,Ha={flagUsed:"flag-used",flagDetailsChanged:"flag-details-changed",flagDetailChanged:"flag-detail-changed",clientIdentityChanged:"client-identity-changed"};Object.freeze(Ha);var Ga={InspectorTypes:Ha,InspectorManager:function(e,t){const n={},r={[Ha.flagUsed]:[],[Ha.flagDetailsChanged]:[],[Ha.flagDetailChanged]:[],[Ha.clientIdentityChanged]:[]},o={[Ha.flagUsed]:[],[Ha.flagDetailsChanged]:[],[Ha.flagDetailChanged]:[],[Ha.clientIdentityChanged]:[]},i=e&&e.map((e=>function(t,n){let r=!1;const o={type:t.type,name:t.name,synchronous:t.synchronous,method:(...i)=>{try{t.method(...i)}catch(e){r||(r=!0,n.warn(Ns(o.type,o.name)))}}};return o}(e,t)));return i&&i.forEach((e=>{Object.prototype.hasOwnProperty.call(r,e.type)&&!e.synchronous?r[e.type].push(e):Object.prototype.hasOwnProperty.call(o,e.type)&&e.synchronous?o[e.type].push(e):t.warn(Ls(e.type,e.name))})),n.hasListeners=e=>r[e]&&r[e].length||o[e]&&o[e].length,n.onFlagUsed=(e,t,n)=>{const i=Ha.flagUsed;o[i].length&&o[i].forEach((r=>r.method(e,t,n))),r[i].length&&Wa((()=>{r[i].forEach((r=>r.method(e,t,n)))}))},n.onFlags=e=>{const t=Ha.flagDetailsChanged;o[t].length&&o[t].forEach((t=>t.method(e))),r[t].length&&Wa((()=>{r[t].forEach((t=>t.method(e)))}))},n.onFlagChanged=(e,t)=>{const n=Ha.flagDetailChanged;o[n].length&&o[n].forEach((n=>n.method(e,t))),r[n].length&&Wa((()=>{r[n].forEach((n=>n.method(e,t)))}))},n.onIdentityChanged=e=>{const t=Ha.clientIdentityChanged;o[t].length&&o[t].forEach((t=>t.method(e))),r[t].length&&Wa((()=>{r[t].forEach((t=>t.method(e)))}))},n}};const{LDTimeoutError:Ya}=wi;const{commonBasicLogger:Qa}=ls,{checkContext:Xa}=fa,{InspectorTypes:Ja,InspectorManager:Za}=Ga,el="change",tl="internal-change";var nl={initialize:function(e,t,n,r,o){const i=n&&n.logger?n.logger:o&&o.logger&&o.logger.default||Qa("warn"),s=function(e){const t={},n={};return t.on=function(e,t,r){n[e]=n[e]||[],n[e]=n[e].concat({handler:t,context:r})},t.off=function(e,t,r){if(n[e])for(let o=0;o<n[e].length;o++)n[e][o].handler===t&&n[e][o].context===r&&(n[e]=n[e].slice(0,o).concat(n[e].slice(o+1)))},t.emit=function(e){if(!n[e])return;const t=n[e].slice(0);for(let n=0;n<t.length;n++)t[n].handler.apply(t[n].context,Array.prototype.slice.call(arguments,1))},t.getEvents=function(){return Object.keys(n)},t.getEventListenerCount=function(e){return n[e]?n[e].length:0},t.maybeReportError=function(t){t&&(n.error?this.emit("error",t):(e||console).error(t.message))},t}(i),a=function(e){let t=!1,n=!1,r=null,o=null;const i=new Promise((t=>{const n=()=>{e.off(Sa,n),t()};e.on(Sa,n)})).catch((()=>{}));return{getInitializationPromise:()=>o||(t?Promise.resolve():n?Promise.reject(r):(o=new Promise(((t,n)=>{const r=()=>{e.off(Ca,r),t()},o=t=>{e.off(Ea,o),n(t)};e.on(Ca,r),e.on(Ea,o)})),o)),getReadyPromise:()=>i,signalSuccess:()=>{t||n||(t=!0,e.emit(Ca),e.emit(Sa))},signalFailure:o=>{t||n||(n=!0,r=o,e.emit(Ea,o),e.emit(Sa)),e.maybeReportError(o)}}}(s),l=oa.validate(n,s,o,i),c=Za(l.inspectors,i),u=l.sendEvents;let d=e,h=l.hash;const f=function(e,t){const n={};let r=!1;const o=e=>{r||(r=!0,t.warn(qs(e)))};return n.isEnabled=()=>!!e,n.get=t=>new Promise((n=>{e?e.get(t).then(n).catch((e=>{o(e),n(void 0)})):n(void 0)})),n.set=(t,n)=>new Promise((r=>{e?e.set(t,n).then((()=>r(!0))).catch((e=>{o(e),r(!1)})):r(!1)})),n.clear=t=>new Promise((n=>{e?e.clear(t).then((()=>n(!0))).catch((e=>{o(e),n(!1)})):n(!1)})),n}(r.localStorage,i),p=ua(r,0,l),g=l.sendEvents&&!l.diagnosticOptOut,m=g?Ba(d):null,v=g?Ua((new Date).getTime()):null,y=g?Ka(r,f,v,p,d,l,m):null,b=Aa(r,l,d,v),w=l.eventProcessor||ka(r,l,d,v,s,p),x=La(r,l,d);let k,S,C,E={},P=l.streaming,j=!1,D=!1,T=!0;const M=l.stateProvider,O=function(e,t){const n={};let r;return n.setContext=function(e){r=Ri.sanitizeContext(e),r&&t&&t(Ri.clone(r))},n.getContext=function(){return r?Ri.clone(r):null},n}(0,(function(e){var t;t=e,M||t&&_({kind:"identify",context:t,creationDate:(new Date).getTime()}),c.hasListeners(Ja.clientIdentityChanged)&&c.onIdentityChanged(O.getContext())})),A=new Ia(f),N=f.isEnabled()?function(e,t,n,r){const o={};function i(){let e="";const o=r.getContext();return o&&(e=n||Ri.btoa(JSON.stringify(o))),"ld:"+t+":"+e}return o.loadFlags=()=>e.get(i()).then((e=>{if(null==e)return null;try{let t=JSON.parse(e);if(t){const e=t.$schema;void 0===e||e<1?t=Ri.transformValuesToVersionedValues(t):delete t.$schema}return t}catch(t){return o.clearFlags().then((()=>null))}})),o.saveFlags=t=>{const n=Ri.extend({},t,{$schema:1});return e.set(i(),JSON.stringify(n))},o.clearFlags=()=>e.clear(i()),o}(f,d,h,O):null;function _(e){d&&(M&&M.enqueueEvent&&M.enqueueEvent(e)||(e.context?(T=!1,!u||D||r.isDoNotTrack()||(i.debug(ps(e.kind)),w.enqueue(e))):T&&(i.warn(Ts()),T=!1)))}function R(e,t){c.hasListeners(Ja.flagDetailChanged)&&c.onFlagChanged(e.key,q(t))}function L(){c.hasListeners(Ja.flagDetailsChanged)&&c.onFlags(Object.entries(E).map((([e,t])=>({key:e,detail:q(t)}))).reduce(((e,t)=>(e[t.key]=t.detail,e)),{}))}function $(e,t,n,r){const o={kind:"feature",key:e,context:O.getContext(),value:t?t.value:null,variation:t?t.variationIndex:null,default:n,creationDate:(new Date).getTime()},i=E[e];i&&(o.version=i.flagVersion?i.flagVersion:i.version,o.trackEvents=i.trackEvents,o.debugEventsUntilDate=i.debugEventsUntilDate),(r||i&&i.trackReason)&&t&&(o.reason=t.reason),_(o)}function F(e){return Xa(e,!1)?Promise.resolve(e):Promise.reject(new wi.LDInvalidUserError(Fs()))}function I(e,t,n,r,o,i){var s;let a,l;return E&&Ri.objectHasOwnProperty(E,e)&&E[e]&&!E[e].deleted?(l=E[e],a=q(l),null!=l.value||(a.value=t)):a={value:t,variationIndex:null,reason:{kind:"ERROR",errorKind:"FLAG_NOT_FOUND"}},n&&(o||(null==(s=null==l?void 0:l.prerequisites)||s.forEach((e=>{I(e,void 0,n,!1,!1,!1)}))),$(e,a,t,r)),!o&&i&&(u=e,d=a,c.hasListeners(Ja.flagUsed)&&c.onFlagUsed(u,d,O.getContext())),a;var u,d}function q(e){return{value:e.value,variationIndex:void 0===e.variation?null:e.variation,reason:e.reason||null}}function z(){if(S=!0,!O.getContext())return;const e=e=>{try{return JSON.parse(e)}catch(t){return void s.maybeReportError(new wi.LDInvalidDataError(Rs()))}};b.connect(O.getContext(),h,{ping:function(){i.debug(xs());const e=O.getContext();x.fetchFlagSettings(e,h).then((t=>{Ri.deepEquals(e,O.getContext())&&B(t||{})})).catch((e=>{s.maybeReportError(new wi.LDFlagFetchError(js(e)))}))},put:function(t){const n=e(t.data);n&&(i.debug(Ss()),B(n))},patch:function(t){const n=e(t.data);if(!n)return;const r=E[n.key];if(!r||!r.version||!n.version||r.version<n.version){i.debug(bs(n.key));const e={},t=Ri.extend({},n);delete t.key,E[n.key]=t;const o=q(t);e[n.key]=r?{previous:r.value,current:o}:{current:o},R(n,t),U(e)}else i.debug(ws(n.key))},delete:function(t){const n=e(t.data);if(n)if(!E[n.key]||E[n.key].version<n.version){i.debug(vs(n.key));const e={};E[n.key]&&!E[n.key].deleted&&(e[n.key]={previous:E[n.key].value}),E[n.key]={version:n.version,deleted:!0},R(n,E[n.key]),U(e)}else i.debug(ys(n.key))}})}function V(){S&&(b.disconnect(),S=!1)}function B(e){const t={};if(!e)return Promise.resolve();for(const n in E)Ri.objectHasOwnProperty(E,n)&&E[n]&&(e[n]&&!Ri.deepEquals(e[n].value,E[n].value)?t[n]={previous:E[n].value,current:q(e[n])}:e[n]&&!e[n].deleted||(t[n]={previous:E[n].value}));for(const n in e)Ri.objectHasOwnProperty(e,n)&&e[n]&&(!E[n]||E[n].deleted)&&(t[n]={current:q(e[n])});return E={...e},L(),U(t).catch((()=>{}))}function U(e){const t=Object.keys(e);if(t.length>0){const n={};t.forEach((t=>{const r=e[t].current,o=r?r.value:void 0,i=e[t].previous;s.emit(el+":"+t,o,i),n[t]=r?{current:o,previous:i}:{previous:i}})),s.emit(el,n),s.emit(tl,E),l.sendEventsOnlyForVariation||M||t.forEach((t=>{$(t,e[t].current)}))}return k&&N?N.saveFlags(E):Promise.resolve()}function K(){const e=P||C&&void 0===P;e&&!S?z():!e&&S&&V(),y&&y.setStreaming(e)}function W(e){return e===el||e.substr(0,7)===el+":"}if("string"==typeof l.bootstrap&&"LOCALSTORAGE"===l.bootstrap.toUpperCase()&&(N?k=!0:i.warn(qs())),"object"==typeof l.bootstrap&&(E=function(e){const t=Object.keys(e),n="$flagsState",r="$valid",o=e[n];!o&&t.length&&i.warn(hs()),!1===e[r]&&i.warn(ds());const s={};return t.forEach((t=>{if(t!==n&&t!==r){let n={value:e[t]};o&&o[t]?n=Ri.extend(n,o[t]):n.version=0,s[t]=n}})),s}(l.bootstrap)),M){const e=M.getInitialState();e?H(e):M.on("init",H),M.on("update",(function(e){e.context&&O.setContext(e.context),e.flags&&B(e.flags)}))}else(e?A.processContext(t).then(F).then((e=>(O.setContext(e),"object"==typeof l.bootstrap?G():k?N.loadFlags().then((e=>null==e?(E={},x.fetchFlagSettings(O.getContext(),h).then((e=>B(e||{}))).then(G).catch((e=>{Y(new wi.LDFlagFetchError(js(e)))}))):(E=e,Ri.onNextTick(G),x.fetchFlagSettings(O.getContext(),h).then((e=>B(e))).catch((e=>s.maybeReportError(e)))))):x.fetchFlagSettings(O.getContext(),h).then((e=>{E=e||{},L(),G()})).catch((e=>{E={},Y(e)}))))):Promise.reject(new wi.LDInvalidEnvironmentIdError(Ps()))).catch(Y);function H(e){d=e.environment,O.setContext(e.context),E={...e.flags},Ri.onNextTick(G)}function G(){i.info(fs()),j=!0,K(),a.signalSuccess()}function Y(e){a.signalFailure(e)}const Q={waitForInitialization:function(e=void 0){if(null!=e){if("number"==typeof e)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(),n=function(e,t){return new Promise(((n,r)=>{setTimeout((()=>{r(new Ya(`${t} timed out after ${e} seconds.`))}),1e3*e)}))}(e,"waitForInitialization");return Promise.race([n,t]).catch((e=>{throw e instanceof wi.LDTimeoutError&&i.error(`waitForInitialization error: ${e}`),e}))}(e);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(e,t,n){if(D)return Ri.wrapPromiseCallback(Promise.resolve({}),n);if(M)return i.warn(As()),Ri.wrapPromiseCallback(Promise.resolve(Ri.transformVersionedValuesToValues(E)),n);const r=k&&N?N.clearFlags():Promise.resolve();return Ri.wrapPromiseCallback(r.then((()=>A.processContext(e))).then(F).then((e=>x.fetchFlagSettings(e,t).then((n=>{const r=Ri.transformVersionedValuesToValues(n);return O.setContext(e),h=t,n?B(n).then((()=>r)):r})))).then((e=>(S&&z(),e))).catch((e=>(s.maybeReportError(e),Promise.reject(e)))),n)},getContext:function(){return O.getContext()},variation:function(e,t){return I(e,t,!0,!1,!1,!0).value},variationDetail:function(e,t){return I(e,t,!0,!0,!1,!0)},track:function(e,t,n){if("string"!=typeof e)return void s.maybeReportError(new wi.LDInvalidEventKeyError(Hs(e)));void 0!==n&&"number"!=typeof n&&i.warn($s(typeof n)),r.customEventFilter&&!r.customEventFilter(e)&&i.warn(Hs(e));const o=O.getContext(),a={kind:"custom",key:e,context:o,url:r.getCurrentUrl(),creationDate:(new Date).getTime()};o&&o.anonymous&&(a.contextKind=o.anonymous?"anonymousUser":"user"),null!=t&&(a.data=t),null!=n&&(a.metricValue=n),_(a)},on:function(e,t,n){W(e)?(C=!0,j&&K(),s.on(e,t,n)):s.on(...arguments)},off:function(e){if(s.off(...arguments),W(e)){let e=!1;s.getEvents().forEach((t=>{W(t)&&s.getEventListenerCount(t)>0&&(e=!0)})),e||(C=!1,S&&void 0===P&&V())}},setStreaming:function(e){const t=null===e?void 0:e;t!==P&&(P=t,K())},flush:function(e){return Ri.wrapPromiseCallback(u?w.flush():Promise.resolve(),e)},allFlags:function(){const e={};if(!E)return e;for(const t in E)Ri.objectHasOwnProperty(E,t)&&!E[t].deleted&&(e[t]=I(t,null,!l.sendEventsOnlyForVariation,!1,!0,!1).value);return e},close:function(e){if(D)return Ri.wrapPromiseCallback(Promise.resolve(),e);const t=()=>{D=!0,E={}},n=Promise.resolve().then((()=>{if(V(),y&&y.stop(),u)return w.stop(),w.flush()})).then(t).catch(t);return Ri.wrapPromiseCallback(n,e)}};return{client:Q,options:l,emitter:s,ident:O,logger:i,requestor:x,start:function(){u&&(y&&y.start(),w.start())},enqueueEvent:_,getFlagsInternal:function(){return E},getEnvironmentId:()=>d,internalChangeEventName:tl}},errors:wi},rl=nl.initialize,ol=nl.errors;function il(e,t,n){return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var r}function sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(n),!0).forEach((function(t){il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ll={promise:Promise.resolve({status:200,header:function(){return null},body:null})};var cl=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function ul(e,t,n,r){var o,i,s=("substring"!==e.kind&&"regex"!==e.kind||!r.includes("/")?t.replace(r,""):t).replace(n,"");switch(e.kind){case"exact":i=t,o=new RegExp("^"+cl(e.url)+"/?$");break;case"canonical":i=s,o=new RegExp("^"+cl(e.url)+"/?$");break;case"substring":i=s,o=new RegExp(".*"+cl(e.substring)+".*$");break;case"regex":i=s,o=new RegExp(e.pattern);break;default:return!1}return o.test(i)}function dl(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(ul(a[l],window.location.href,window.location.search,window.location.hash)){"pageview"===s.kind?t("pageview",s):(o.push(s),t("click_pageview",s));break}return o.length>0&&(r=function(e){for(var n=function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=e.target,i=t[r],s=document.querySelectorAll(i.selector);o&&s.length>0;){for(var a=0;a<s.length;a++)o===s[a]&&n.push(i);o=o.parentNode}return n}(e,o),r=0;r<n.length;r++)t("click",n[r])},document.addEventListener("click",r)),n.dispose=function(){document.removeEventListener("click",r)},n}var hl="goalsReady",fl={fetchGoals:{default:!0},hash:{type:"string"},eventProcessor:{type:"object"},eventUrlTransformer:{type:"function"},disableSyncEventPost:{default:!1}};function pl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){var t,n={userAgentHeaderName:"X-LaunchDarkly-User-Agent",synchronousFlush:!1};if(window.XMLHttpRequest){var r=e&&e.disableSyncEventPost;n.httpRequest=function(t,o,i,s){var a=n.synchronousFlush&!r;return n.synchronousFlush=!1,function(t,n,r,o,i){if(i&&!function(){var e=window.navigator&&window.navigator.userAgent;if(e){var t=e.match(/Chrom(e|ium)\/([0-9]+)\./);if(t)return parseInt(t[2],10)<73}return!0}())return ll;var s,a=new window.XMLHttpRequest;for(var l in a.open(t,n,!i),r||{})Object.prototype.hasOwnProperty.call(r,l)&&a.setRequestHeader(l,r[l]);if(i){try{a.send(o)}catch(e){}return ll}return{promise:new Promise((function(e,t){a.addEventListener("load",(function(){s||e({status:a.status,header:function(e){return a.getResponseHeader(e)},body:a.responseText})})),a.addEventListener("error",(function(){s||t(new Error)})),a.send(o)})),cancel:function(){s=!0,a.abort()}}}(t,o,i,s,a)}}n.httpAllowsPost=function(){return void 0===t&&(t=!!window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest),t},n.httpFallbackPing=function(e){(new window.Image).src=e};var o,i=e&&e.eventUrlTransformer;n.getCurrentUrl=function(){return i?i(window.location.href):window.location.href},n.isDoNotTrack=function(){var e;return 1===(e=window.navigator&&void 0!==window.navigator.doNotTrack?window.navigator.doNotTrack:window.navigator&&void 0!==window.navigator.msDoNotTrack?window.navigator.msDoNotTrack:window.doNotTrack)||!0===e||"1"===e||"yes"===e};try{window.localStorage&&(n.localStorage={get:function(e){return new Promise((function(t){t(window.localStorage.getItem(e))}))},set:function(e,t){return new Promise((function(n){window.localStorage.setItem(e,t),n()}))},clear:function(e){return new Promise((function(t){window.localStorage.removeItem(e),t()}))}})}catch(a){n.localStorage=null}if(e&&e.useReport&&"function"==typeof window.EventSourcePolyfill&&window.EventSourcePolyfill.supportedOptions&&window.EventSourcePolyfill.supportedOptions.method?(n.eventSourceAllowsReport=!0,o=window.EventSourcePolyfill):(n.eventSourceAllowsReport=!1,o=window.EventSource),window.EventSource){var s=3e5;n.eventSourceFactory=function(e,t){var n=al(al({},{heartbeatTimeout:s,silentTimeout:s,skipDefaultHeaders:!0}),t);return new o(e,n)},n.eventSourceIsActive=function(e){return e.readyState===window.EventSource.OPEN||e.readyState===window.EventSource.CONNECTING}}return n.userAgent="JSClient",n.version="3.5.0",n.diagnosticSdkData={name:"js-client-sdk",version:"3.5.0"},n.diagnosticPlatformData={name:"JS"},n.diagnosticUseCombinedEvent=!0,n}(n),o=rl(e,t,n,r,fl),i=o.client,s=o.options,a=o.emitter,l=new Promise((function(e){var t=a.on(hl,(function(){a.off(hl,t),e()}))}));i.waitUntilGoalsReady=function(){return l},s.fetchGoals?function(e,t){var n,r;function o(){r&&r.dispose(),n&&n.length&&(r=dl(n,i))}function i(t,n){var r=e.ident.getContext(),o={kind:t,key:n.key,data:null,url:window.location.href,creationDate:(new Date).getTime(),context:r};return"click"===t&&(o.selector=n.selector),e.enqueueEvent(o)}e.requestor.fetchJSON("/sdk/goals/"+e.getEnvironmentId()).then((function(e){e&&e.length>0&&(r=dl(n=e,i),function(e,t){var n,r=window.location.href;function o(){(n=window.location.href)!==r&&(r=n,t())}!function e(t,n){t(),setTimeout((function(){e(t,n)}),n)}(o,300),window.history&&window.history.pushState?window.addEventListener("popstate",o):window.addEventListener("hashchange",o)}(0,o)),t()})).catch((function(n){e.emitter.maybeReportError(new ol.LDUnexpectedResponseError(n.message)),t()}))}(o,(function(){return a.emit(hl)})):a.emit(hl),"complete"!==document.readyState?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(){"hidden"===document.visibilityState&&c()})),window.addEventListener("pagehide",c),i}var gl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vl="[object Symbol]",yl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,bl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wl="\\ud800-\\udfff",xl="\\u0300-\\u036f\\ufe20-\\ufe23",kl="\\u20d0-\\u20f0",Sl="\\u2700-\\u27bf",Cl="a-z\\xdf-\\xf6\\xf8-\\xff",El="A-Z\\xc0-\\xd6\\xd8-\\xde",Pl="\\ufe0e\\ufe0f",jl="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Dl="['’]",Tl="["+wl+"]",Ml="["+jl+"]",Ol="["+xl+kl+"]",Al="\\d+",Nl="["+Sl+"]",_l="["+Cl+"]",Rl="[^"+wl+jl+Al+Sl+Cl+El+"]",Ll="\\ud83c[\\udffb-\\udfff]",$l="[^"+wl+"]",Fl="(?:\\ud83c[\\udde6-\\uddff]){2}",Il="[\\ud800-\\udbff][\\udc00-\\udfff]",ql="["+El+"]",zl="\\u200d",Vl="(?:"+_l+"|"+Rl+")",Bl="(?:"+ql+"|"+Rl+")",Ul="(?:['’](?:d|ll|m|re|s|t|ve))?",Kl="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wl="(?:"+Ol+"|"+Ll+")"+"?",Hl="["+Pl+"]?",Gl=Hl+Wl+("(?:"+zl+"(?:"+[$l,Fl,Il].join("|")+")"+Hl+Wl+")*"),Yl="(?:"+[Nl,Fl,Il].join("|")+")"+Gl,Ql="(?:"+[$l+Ol+"?",Ol,Fl,Il,Tl].join("|")+")",Xl=RegExp(Dl,"g"),Jl=RegExp(Ol,"g"),Zl=RegExp(Ll+"(?="+Ll+")|"+Ql+Gl,"g"),ec=RegExp([ql+"?"+_l+"+"+Ul+"(?="+[Ml,ql,"$"].join("|")+")",Bl+"+"+Kl+"(?="+[Ml,ql+Vl,"$"].join("|")+")",ql+"?"+Vl+"+"+Ul,ql+"+"+Kl,Al,Yl].join("|"),"g"),tc=RegExp("["+zl+wl+xl+kl+Pl+"]"),nc=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rc="object"==typeof self&&self&&self.Object===Object&&self,oc="object"==typeof gl&&gl&&gl.Object===Object&&gl||rc||Function("return this")();var ic,sc=(ic={"À":"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"},function(e){return null==ic?void 0:ic[e]});function ac(e){return tc.test(e)}function lc(e){return ac(e)?function(e){return e.match(Zl)||[]}(e):function(e){return e.split("")}(e)}var cc=Object.prototype.toString,uc=oc.Symbol,dc=uc?uc.prototype:void 0,hc=dc?dc.toString:void 0;function fc(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&cc.call(e)==vl}(e))return hc?hc.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function pc(e,t,n){return function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o: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}(e,t,n=void 0===n?e.length:n)}function gc(e){return null==e?"":fc(e)}var mc,vc=(mc=function(e,t,n){return t=t.toLowerCase(),e+(n?bc(gc(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)n=t(n,e[r],r,e);return n}(function(e,t){return e=gc(e),void 0===t?function(e){return nc.test(e)}(e)?function(e){return e.match(ec)||[]}(e):function(e){return e.match(yl)||[]}(e):e.match(t)||[]}(function(e){return(e=gc(e))&&e.replace(bl,sc).replace(Jl,"")}(e).replace(Xl,"")),mc,"")});var yc,bc=(yc="toUpperCase",function(e){var t=ac(e=gc(e))?lc(e):void 0,n=t?t[0]:e.charAt(0),r=t?pc(t,1).join(""):e.slice(1);return n[yc]()+r});const wc=ml(vc);var xc,kc={exports:{}},Sc={};var Cc,Ec={};
2
+ /** @license React v16.13.1
3
+ * react-is.development.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */kc.exports="production"===process.env.NODE_ENV?function(){if(xc)return Sc;xc=1;var e="function"==typeof Symbol&&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,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case l:case c:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case a:case u:case p:case f:case s:return e;default:return h}}case n:return h}}}function w(e){return b(e)===c}return Sc.AsyncMode=l,Sc.ConcurrentMode=c,Sc.ContextConsumer=a,Sc.ContextProvider=s,Sc.Element=t,Sc.ForwardRef=u,Sc.Fragment=r,Sc.Lazy=p,Sc.Memo=f,Sc.Portal=n,Sc.Profiler=i,Sc.StrictMode=o,Sc.Suspense=d,Sc.isAsyncMode=function(e){return w(e)||b(e)===l},Sc.isConcurrentMode=w,Sc.isContextConsumer=function(e){return b(e)===a},Sc.isContextProvider=function(e){return b(e)===s},Sc.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Sc.isForwardRef=function(e){return b(e)===u},Sc.isFragment=function(e){return b(e)===r},Sc.isLazy=function(e){return b(e)===p},Sc.isMemo=function(e){return b(e)===f},Sc.isPortal=function(e){return b(e)===n},Sc.isProfiler=function(e){return b(e)===i},Sc.isStrictMode=function(e){return b(e)===o},Sc.isSuspense=function(e){return b(e)===d},Sc.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===s||e.$$typeof===a||e.$$typeof===u||e.$$typeof===m||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},Sc.typeOf=b,Sc}():(Cc||(Cc=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&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,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var g=e.type;switch(g){case l:case c:case r:case i:case o:case d:return g;default:var m=g&&g.$$typeof;switch(m){case a:case u:case p:case f:case s:return m;default:return h}}case n:return h}}}var w=c,x=a,k=s,S=t,C=u,E=r,P=p,j=f,D=n,T=i,M=o,O=d,A=!1;function N(e){return b(e)===c}Ec.AsyncMode=l,Ec.ConcurrentMode=w,Ec.ContextConsumer=x,Ec.ContextProvider=k,Ec.Element=S,Ec.ForwardRef=C,Ec.Fragment=E,Ec.Lazy=P,Ec.Memo=j,Ec.Portal=D,Ec.Profiler=T,Ec.StrictMode=M,Ec.Suspense=O,Ec.isAsyncMode=function(e){return A||(A=!0),N(e)||b(e)===l},Ec.isConcurrentMode=N,Ec.isContextConsumer=function(e){return b(e)===a},Ec.isContextProvider=function(e){return b(e)===s},Ec.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ec.isForwardRef=function(e){return b(e)===u},Ec.isFragment=function(e){return b(e)===r},Ec.isLazy=function(e){return b(e)===p},Ec.isMemo=function(e){return b(e)===f},Ec.isPortal=function(e){return b(e)===n},Ec.isProfiler=function(e){return b(e)===i},Ec.isStrictMode=function(e){return b(e)===o},Ec.isSuspense=function(e){return b(e)===d},Ec.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===s||e.$$typeof===a||e.$$typeof===u||e.$$typeof===m||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},Ec.typeOf=b}()),Ec);var Pc=kc.exports,jc={};jc[Pc.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jc[Pc.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};const Dc={useCamelCaseFlagKeys:!0,sendEventsOnFlagRead:!0,reactContext:n.createContext({flags:{},flagKeyMap:{},ldClient:void 0})},Tc=e=>{var t;return null!=(t=e.context)?t:e.user},Mc=e=>{const t={};for(const n in e)0!==n.indexOf("$")&&(t[wc(n)]=e[n]);return t},Oc=(e,t)=>{const n=e.allFlags();return t?Object.keys(t).reduce(((e,r)=>(e[r]=Object.prototype.hasOwnProperty.call(n,r)?n[r]:t[r],e)),{}):n};function Ac(e,t,n=Dc,r){const o=(l=t,void 0===(c=r)?l:Object.keys(c).reduce(((e,t)=>(Nc(l,t)&&(e[t]=l[t]),e)),{})),{useCamelCaseFlagKeys:i=!0}=n,[s,a={}]=i?function(e){const t={},n={};for(const r in e){if(0===r.indexOf("$"))continue;const o=wc(r);t[o]=e[r],n[o]=r}return[t,n]}(o):[o];var l,c;return{flags:n.sendEventsOnFlagRead?_c(e,s,a,i):s,flagKeyMap:a}}function Nc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _c(e,t,n,r){return new Proxy(t,{get(t,o,i){const s=Reflect.get(t,o,i),a=r&&Nc(n,o)||Nc(t,o);if("symbol"==typeof o||!a)return s;if(void 0===s)return;return e.variation(r?n[o]:o,s)}})}Mc.camelCaseKeys=Mc;const Rc={wrapperName:"react-client-sdk",wrapperVersion:"3.6.1",sendEventsOnlyForVariation:!0};var Lc=Object.defineProperty,$c=Object.defineProperties,Fc=Object.getOwnPropertyDescriptors,Ic=Object.getOwnPropertySymbols,qc=Object.prototype.hasOwnProperty,zc=Object.prototype.propertyIsEnumerable,Vc=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t)=>{for(var n in t||(t={}))qc.call(t,n)&&Vc(e,n,t[n]);if(Ic)for(var n of Ic(t))zc.call(t,n)&&Vc(e,n,t[n]);return e},Uc=(e,t)=>$c(e,Fc(t)),Kc=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(t){o(t)}},s=e=>{try{a(n.throw(e))}catch(t){o(t)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));class Wc extends n.Component{constructor(e){super(e),this.getReactOptions=()=>Bc(Bc({},Dc),this.props.reactOptions),this.subscribeToChanges=e=>{const{flags:t}=this.props;e.on("change",(n=>{const r=this.getReactOptions(),o=((e,t)=>{const n={};for(const r in e)t&&void 0===t[r]||(n[r]=e[r].current);return n})(n,t),i=Bc(Bc({},this.state.unproxiedFlags),o);Object.keys(o).length>0&&this.setState((n=>Bc(Uc(Bc({},n),{unproxiedFlags:i}),Ac(e,i,r,t))))}))},this.onFailed=(e,t)=>{this.setState((e=>Uc(Bc({},e),{error:t})))},this.onReady=(e,t,n)=>{const r=Oc(e,n);this.setState((o=>Bc(Uc(Bc({},o),{unproxiedFlags:r}),Ac(e,r,t,n))))},this.prepareLDClient=()=>Kc(this,null,(function*(){var e;const{clientSideID:t,flags:n,options:r}=this.props;let o=yield this.props.ldClient;const i=this.getReactOptions();let s,a=this.state.unproxiedFlags;if(o)a=Oc(o,n);else{const c=null!=(e=Tc(this.props))?e:{anonymous:!0,kind:"user"};o=pl(t,c,Bc(Bc({},Rc),r));try{yield o.waitForInitialization(this.props.timeout),a=Oc(o,n)}catch(l){s=l,(null==s?void 0:s.name.toLowerCase().includes("timeout"))&&(o.on("failed",this.onFailed),o.on("ready",(()=>{this.onReady(o,i,n)})))}}this.setState((e=>Uc(Bc(Uc(Bc({},e),{unproxiedFlags:a}),Ac(o,a,i,n)),{ldClient:o,error:s}))),this.subscribeToChanges(o)}));const{options:t}=e;if(this.state={flags:{},unproxiedFlags:{},flagKeyMap:{}},t){const{bootstrap:e}=t;if(e&&"localStorage"!==e){const{useCamelCaseFlagKeys:t}=this.getReactOptions();this.state={flags:t?Mc(e):e,unproxiedFlags:e,flagKeyMap:{}}}}}componentDidMount(){return Kc(this,null,(function*(){const{deferInitialization:e}=this.props;e&&!Tc(this.props)||(yield this.prepareLDClient())}))}componentDidUpdate(e){return Kc(this,null,(function*(){const{deferInitialization:t}=this.props,n=!Tc(e)&&Tc(this.props);t&&n&&(yield this.prepareLDClient())}))}render(){const{flags:e,flagKeyMap:t,ldClient:r,error:o}=this.state,{reactContext:i}=this.getReactOptions();return n.createElement(i.Provider,{value:{flags:e,flagKeyMap:t,ldClient:r,error:o}},this.props.children)}}const Hc=new class{constructor(){et(this,"handlers",new Map)}subscribe(e,t){const n=this.handlers.get(e)||new Set;return n.add(t),this.handlers.set(e,n),()=>{const n=this.handlers.get(e);n&&(n.delete(t),0===n.size&&this.handlers.delete(e))}}emit(e,t){const n=this.handlers.get(e);n&&n.forEach((e=>e(t)))}clearAll(){this.handlers.clear()}},Gc="api:unauthorized",Yc="api:authorized",Qc={staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!0};let Xc,Jc=!1,Zc=null,eu=!1;const tu=async(e,t={})=>{const n=await fetch(`https://api.embedreach.com/api${e}`,{...t,credentials:"include",headers:{"Content-Type":"application/json",...Xc&&{Authorization:`Bearer ${Xc}`},...t.headers}});if(401===n.status)throw Jc||(Jc=!0,Hc.emit(Gc,void 0),Zc&&window.clearTimeout(Zc),Zc=window.setTimeout((()=>{Jc=!1,eu=!1,Zc=null}),5e3)),new Error("Unauthorized");if(!n.ok)throw new Error(`API Error: ${n.statusText}`);return eu||(Hc.emit(Yc,void 0),eu=!0),n.json()},nu=(e,r,o,i)=>{const s=n.createContext({state:o});return{Context:s,Provider:({children:a})=>{const[l,c]=n.useReducer(e,o),u=n.useMemo((()=>Object.keys(r).reduce(((e,t)=>({...e,[t]:r[t](c)})),{})),[c]);n.useEffect((()=>{const e=[];return(null==i?void 0:i.length)&&i.forEach((({eventName:t,handler:n})=>{const r=n(c),o=Hc.subscribe(t,r);e.push(o)})),()=>e.forEach((e=>e()))}),[c]);const d=n.useMemo((()=>({state:l,...u})),[l,u]);return t.jsx(s.Provider,{value:d,children:a})}}},ru=[{eventName:Gc,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!1}),e({type:"SET_REAUTHING",payload:!0})}},{eventName:Yc,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!0})}}],{Provider:ou}=nu(((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}}),{handleReauth:e=>async t=>{if(t){e({type:"SET_REAUTHING",payload:!0});try{t()}catch(n){e({type:"SET_ERROR",payload:n instanceof Error?n.message:"Reauthorization failed"})}}else e({type:"SET_ERROR",payload:"No reauth callback provided"})}},{isAuthenticated:!1,loading:!1,error:null,reauthing:!1},ru),iu={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%)"},su=e=>{const t=document.getElementById("reach-theme-styles");t&&t.remove();const n=document.createElement("style");n.id="reach-theme-styles";const r=`\n [data-reach-root] {\n ${Object.entries(iu).map((([t,n])=>{const r=e[t];let o=n;if(r&&(e=>{const t=document.createElement("div"),n=t.style.color;return t.style.color=e,t.style.color!==n})(r))try{o=(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})(r)}catch(i){}return`--reach-${t}: ${o};`})).join("\n")}\n }\n `;n.textContent=r,document.head.appendChild(n)},{Provider:au}=nu(((e,t)=>{switch(t.type){case"set_theme":return t.payload&&su(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}}),{setTheme:e=>t=>e({type:"set_theme",payload:t}),setLoading:e=>t=>e({type:"set_loading",payload:t}),setError:e=>t=>e({type:"set_error",payload:t})},{theme:null,loading:!1,error:null}),lu=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,cu={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},uu=e=>cu[e];let du={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(lu,uu)};const hu={type:"3rdParty",init(e){((e={})=>{du={...du,...e}})(e.options.react)}},fu=n.createContext();function pu({i18n:e,defaultNS:t,children:r}){const o=n.useMemo((()=>({i18n:e,defaultNS:t})),[e,t]);return n.createElement(fu.Provider,{value:o},r)}const gu=e=>"string"==typeof e,mu=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},vu=e=>null==e?"":""+e,yu=/###/g,bu=e=>e&&e.indexOf("###")>-1?e.replace(yu,"."):e,wu=e=>!e||gu(e),xu=(e,t,n)=>{const r=gu(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(wu(e))return{};const t=bu(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return wu(e)?{}:{obj:e,k:bu(r[o])}},ku=(e,t,n)=>{const{obj:r,k:o}=xu(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=xu(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=xu(e,s,Object),(null==a?void 0:a.obj)&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Su=(e,t)=>{const{obj:n,k:r}=xu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Cu=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?gu(e[r])||e[r]instanceof String||gu(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Cu(e[r],t[r],n):e[r]=t[r]);return e},Eu=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ju=e=>gu(e)?e.replace(/[&<>"'\/]/g,(e=>Pu[e])):e;const Du=[" ",",","?","!",";"],Tu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Mu=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||"object"!=typeof o)return;let e,t="";for(let s=i;s<r.length;++s)if(s!==i&&(t+=n),t+=r[s],e=o[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&s<r.length-1)continue;i+=s-i+1;break}o=e}return o},Ou=e=>null==e?void 0:e.replace("_","-"),Au={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;null==(r=null==(n=null==console?void 0:console[e])?void 0:n.apply)||r.call(n,console,t)}};class Nu{constructor(e){this.init(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Au,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(gu(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Nu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Nu(this.logger,e)}}var _u=new Nu;class Ru{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((e=>{let[t,r]=e;for(let o=0;o<r;o++)t(...n)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((t=>{let[r,o]=t;for(let i=0;i<o;i++)r.apply(r,[e,...n])}))}}}class Lu extends Ru{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){var r,o;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,t],n&&(Array.isArray(n)?l.push(...n):gu(n)&&s?l.push(...n.split(s)):l.push(n)));const c=Su(this.data,l);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=l[0],t=l[1],n=l.slice(2).join(".")),!c&&a&&gu(n)?Mu(null==(o=null==(r=this.data)?void 0:r[e])?void 0:o[t],n,s):c}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),ku(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const o in n)(gu(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=Su(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Cu(a,n,o):a={...a,...n},ku(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var $u={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach((e=>{var i,s;t=null!=(s=null==(i=this.processors[e])?void 0:i.process(t,n,r,o))?s:t})),t}};const Fu={};class Iu extends Ru{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{n[e]&&(r[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=_u.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){if(null==e)return!1;const t=this.resolve(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return void 0!==(null==t?void 0:t.res)}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Du.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=Tu.getRegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:gu(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:gu(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],t),a=s[s.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===(null==l?void 0:l.toLowerCase())){if(c){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${a}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:i}const u=this.resolve(e,t);let d=null==u?void 0:u.res;const h=(null==u?void 0:u.usedKey)||i,f=(null==u?void 0:u.exactUsedKey)||i,p=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,v=!gu(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(m&&d&&v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0)||gu(g)&&Array.isArray(d))if(m&&gu(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,s=!1;const c=void 0!==t.count&&!gu(t.count),h=Iu.hasDefaultValue(t),f=c?this.pluralResolver.getSuffix(l,t.count,t):"",p=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",g=c&&!t.ordinal&&0===t.count,m=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${f}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(d)&&h&&(r=!0,d=m),this.isValidLookup(d)||(s=!0,d=i);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:d,y=h&&m!==d&&this.options.updateMissing;if(s||r||y){if(this.logger.log(y?"updateKey":"missingKey",l,a,i,y?m:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{var o;const i=h&&r!==d?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,i,y,t):(null==(o=this.backendConnector)?void 0:o.saveMissing)&&this.backendConnector.saveMissing(e,a,n,i,y,t),this.emit("missingKey",e,a,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{r([e],i+n,t[`defaultValue${n}`]||m)}))})):r(e,i,m))}d=this.extendTranslation(d,e,t,u,n),s&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${a}:${i}`),(s||r)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,r?d:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,d,{...t,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?f:h;for(const i in d)if(Object.prototype.hasOwnProperty.call(d,i)){const e=`${r}${o}${i}`;n[i]=this.translate(e,{...t,joinArrays:!1,ns:s}),n[i]===e&&(n[i]=d[i])}d=n}}return r?(u.res=d,u.usedParams=this.getUsedParamsDetails(t),u):d}extendTranslation(e,t,n,r,o){var i,s,a=this;if(null==(i=this.i18nFormat)?void 0:i.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=gu(e)&&(void 0!==(null==(s=null==n?void 0:n.interpolation)?void 0:s.skipOnVariables)?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(i){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let c=n.replace&&!gu(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return(null==o?void 0:o[0])!==r[0]||n.context?a.translate(...r,t):(a.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const l=n.postProcess||this.options.postProcess,c=gu(l)?[l]:l;return null!=e&&(null==c?void 0:c.length)&&!1!==n.applyPostProcessor&&(e=$u.handle(c,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gu(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,s),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==s.count&&!gu(s.count),d=u&&!s.ordinal&&0===s.count,h=void 0!==s.context&&(gu(s.context)||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);c.forEach((e=>{var a,c;this.isValidLookup(t)||(i=e,Fu[`${f[0]}-${e}`]||!(null==(a=this.utils)?void 0:a.hasLoadedNamespace)||(null==(c=this.utils)?void 0:c.hasLoadedNamespace(i))||(Fu[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((n=>{var i;if(this.isValidLookup(t))return;o=n;const a=[l];if(null==(i=this.i18nFormat)?void 0:i.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,s);else{let e;u&&(e=this.pluralResolver.getSuffix(n,s.count,s));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(a.push(l+e),s.ordinal&&0===e.indexOf(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),d&&a.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${s.context}`;a.push(n),u&&(a.push(n+e),s.ordinal&&0===e.indexOf(r)&&a.push(n+e.replace(r,this.options.pluralSeparator)),d&&a.push(n+t))}}let c;for(;c=a.pop();)this.isValidLookup(t)||(r=c,t=this.getResource(n,e,c,s))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){var r;let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(null==(r=this.i18nFormat)?void 0:r.getResource)?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!gu(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class qu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=_u.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ou(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Ou(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(gu(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch(t){}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),gu(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return gu(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):gu(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}const zu={zero:0,one:1,two:2,few:3,many:4,other:5},Vu={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Bu{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=_u.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Ou("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(s){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Vu;if(!e.match(/-|_/))return Vu;const n=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(n,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(null==n?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){return this.getSuffixes(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>zu[e]-zu[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Uu=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=Su(e,n);return void 0!==r?r:Su(t,n)})(e,t,n);return!i&&o&&gu(n)&&(i=Mu(e,n,r),void 0===i&&(i=Mu(t,n,r))),i},Ku=e=>e.replace(/\$/g,"$$$$");class Wu{constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=_u.create("interpolator"),this.options=t,this.format=(null==(e=null==t?void 0:t.interpolation)?void 0:e.format)||(e=>e),this.init(t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:ju,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Eu(o):i||"{{",this.suffix=s?Eu(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Eu(d):h||Eu("$t("),this.nestingSuffix=f?Eu(f):p||Eu(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>(null==e?void 0:e.source)===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){var o;let i,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Uu(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(Uu(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const u=(null==r?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=void 0!==(null==(o=null==r?void 0:r.interpolation)?void 0:o.skipOnVariables)?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Ku(e)},{regex:this.regexp,safeValue:e=>Ku(this.escapeValue?this.escape(e):e)}].forEach((t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(s=c(n),void 0===s)if("function"==typeof u){const t=u(e,i,r);s=gu(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))s="";else{if(d){s=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s=""}else gu(s)||this.useRawValueToEscape||(s=vu(s));const o=t.safeValue(s);if(e=e.replace(i[0],o),d?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(e,t)=>{var n;const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const i=e.split(new RegExp(`${r}[ ]*{`));let s=`{${i[1]}`;e=i[0],s=this.interpolate(s,o);const a=s.match(/'/g),l=s.match(/"/g);((null!=(n=null==a?void 0:a.length)?n:0)%2==0&&!l||l.length%2!=0)&&(s=s.replace(/'/g,'"'));try{o=JSON.parse(s),t&&(o={...t,...o})}catch(c){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,c),`${e}${r}${s}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];o={...i},o=o.replace&&!gu(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),a=e,l=!0}if(r=t(s.call(this,n[1].trim(),o),o),r&&n[0]===e&&!gu(r))return r;gu(r)||(r=vu(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l&&(r=a.reduce(((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const Hu=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(Ou(r),o),t[s]=a),a(n)}};class Gu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=_u.create("formatter"),this.options=e,this.formats={number:Hu(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Hu(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Hu(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Hu(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Hu(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){this.formatSeparator=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Hu(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((e=>e.indexOf(")")>-1))){const e=o.findIndex((e=>e.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce(((e,t)=>{var o;const{formatName:i,formatOptions:s}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=(null==(o=null==r?void 0:r.formatParams)?void 0:o[r.interpolationkey])||{};t=this.formats[i](e,a.locale||a.lng||r.locale||r.lng||n,{...s,...r,...a})}catch(a){this.logger.warn(a)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class Yu extends Ru{constructor(e,t,n){var r,o;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=_u.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],null==(o=null==(r=this.backend)?void 0:r.init)||o.call(r,n,i.backend,i)}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:r,k:o}=xu(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*o,i)}),o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then((e=>s(null,e))).catch(s):s(null,n)}catch(l){s(l)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();gu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),gu(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)}))}saveMissing(e,t,n,r,o){var i,s,a,l,c;let u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!(null==(s=null==(i=this.services)?void 0:i.utils)?void 0:s.hasLoadedNamespace)||(null==(l=null==(a=this.services)?void 0:a.utils)?void 0:l.hasLoadedNamespace(t))){if(null!=n&&""!==n){if(null==(c=this.backend)?void 0:c.create){const i={...u,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;o=5===s.length?s(e,t,n,r,i):s(e,t,n,r),o&&"function"==typeof o.then?o.then((e=>d(null,e))).catch(d):d(null,o)}catch(h){d(h)}else s(e,t,n,r,d,i)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Qu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),gu(e[1])&&(t.defaultValue=e[1]),gu(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Xu=e=>{var t,n;return gu(e.ns)&&(e.ns=[e.ns]),gu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),gu(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),(null==(n=null==(t=e.supportedLngs)?void 0:t.indexOf)?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e},Ju=()=>{};class Zu extends Ru{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Xu(e),this.services={},this.logger=_u,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(gu(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Qu();this.options={...r,...this.options,...Xu(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;_u.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Gu;const n=new qu(this.options);this.store=new Lu(this.options.resources,this.options);const i=this.services;i.logger=_u,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Bu(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Wu(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Yu(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)})),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Iu(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=Ju),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const i=mu(),s=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ju;const o=gu(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===(null==o?void 0:o.toLowerCase())&&(!this.options.preload||0===this.options.preload.length))return r();const e=[],i=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(o)i(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>i(e)))}null==(n=null==(t=this.options.preload)?void 0:t.forEach)||n.call(t,(e=>i(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)}))}else r(null)}reloadResources(e,t,n){const r=mu();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ju),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&$u.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=mu();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},s=t=>{var n,r;e||t||!this.services.languageDetector||(t=[]);const s=gu(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);s&&(this.language||o(s),this.translator.language||this.translator.changeLanguage(s),null==(r=null==(n=this.services.languageDetector)?void 0:n.cacheUserLanguage)||r.call(n,s)),this.loadResources(s,(e=>{i(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];i=r.options.overloadTranslationOptionHandler([e,t].concat(a))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const c=r.options.keySeparator||".";let u;return u=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${c}${e}`)):i.keyPrefix?`${i.keyPrefix}${c}${e}`:e,r.t(u,i)};return gu(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return null==(e=this.translator)?void 0:e.translate(...n)}exists(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return null==(e=this.translator)?void 0:e.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=mu();return this.options.ns?(gu(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=mu();gu(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter((e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return o.length?(this.options.preload=r.concat(o),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){var t,n;if(e||(e=this.resolvedLanguage||((null==(t=this.languages)?void 0:t.length)>0?this.languages[0]:this.language)),!e)return"rtl";const r=(null==(n=this.services)?void 0:n.languageUtils)||new qu(Qu());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Zu(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ju;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Zu(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,r)=>(n[r]={...e[t][r]},n)),{}))),{});o.store=new Lu(e,r),o.services.resourceStore=o.store}return o.translator=new Iu(o.services,r),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)})),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ed=Zu.createInstance();ed.createInstance=Zu.createInstance;const{slice:td,forEach:nd}=[];const rd=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,od={create(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!rd.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!rd.test(n.path))throw new TypeError("option path is invalid");r+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r}(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}return null},remove(e){this.create(e,"",-1)}};var id={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return od.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&od.create(n,e,r,o,i)}},sd={name:"querystring",lookup(e){var t;let n,{lookupQuerystring:r}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&(null==(t=window.location.hash)?void 0:t.indexOf("?"))>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const o=e.substring(1).split("&");for(let t=0;t<o.length;t++){const e=o[t].indexOf("=");if(e>0){o[t].substring(0,e)===r&&(n=o[t].substring(e+1))}}}return n}};let ad=null;const ld=()=>{if(null!==ad)return ad;try{ad="undefined"!==window&&null!==window.localStorage;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ad=!1}return ad};var cd={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&ld())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&ld()&&window.localStorage.setItem(n,e)}};let ud=null;const dd=()=>{if(null!==ud)return ud;try{ud="undefined"!==window&&null!==window.sessionStorage;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){ud=!1}return ud};var hd={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&dd())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&dd()&&window.sessionStorage.setItem(n,e)}},fd={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let o=0;o<e.length;o++)t.push(e[o]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},pd={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const r=n||("undefined"!=typeof document?document.documentElement:null);return r&&"function"==typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},gd={name:"path",lookup(e){var t;let{lookupFromPathIndex:n}=e;if("undefined"==typeof window)return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(r))return;return null==(t=r["number"==typeof n?n:0])?void 0:t.replace("/","")}},md={name:"subdomain",lookup(e){var t,n;let{lookupFromSubdomainIndex:r}=e;const o="number"==typeof r?r+1:1,i="undefined"!=typeof window&&(null==(n=null==(t=window.location)?void 0:t.hostname)?void 0:n.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[o]}};let vd=!1;try{document,vd=!0}catch(LB){}const yd=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];vd||yd.splice(1,1);class bd{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(e){return nd.call(td.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(e,this.options||{},{order:yd,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=t,this.addDetector(id),this.addDetector(sd),this.addDetector(cd),this.addDetector(hd),this.addDetector(fd),this.addDetector(pd),this.addDetector(gd),this.addDetector(md)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((t=>{if(this.detectors[t]){let n=this.detectors[t].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(e=e.concat(n))}})),e=e.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?e:e.length>0?e[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}bd.type="languageDetector";const wd={en:{common:{ad_spend:"Ad Spend",date:"Date",close:"Close",continue:"Continue",connected:"Connected",connecting:"Connecting...",reauth_required:"Re-authentication required",reauth_required_description:"Re-authentication required for one of your ad accounts",reauthenticate:"Reauthenticate",account_settings:"Account Settings",manage_account_settings:"Manage your account settings",copy:"Copy",copied:"Copied",error:"An error occurred",filter:"Filter",finishingUp:"Finishing up...",loading:"Loading...",need_help:"Need help? let us know",next:"Next",next_steps:"Next steps:",number:"{{number}}",previous:"Previous",revenue:"Revenue",revenue_from_ads:"Revenue From Ads",roas:"ROAS",return_on_ad_spend:"Return on Ad Spend",select_dates:"Select dates",total_ads_spend:"Total Ads Spend",authentication:{required:"Authentication required",failed:"Authentication failed",connect_account_title:"Connect Your {{provider}} Account",connect_account_description:"To create and manage ad campaigns, please connect your {{provider}} account",connect_account_button:"Continue with {{provider}}",connect_account_TOS:"By connecting, you agree to our Terms of Service and Privacy Policy"},theme:{loading:"Loading theme...",error:"Error loading theme: {{message}}"},dates:{last_week:"Last week",last_month:"Last month",last_quarter:"Last quarter",last_year:"Last year"},campaigns:{setup:{card_header:"Run paid digital ads to get new leads & customers",title:"Create your first AI-driven Ad campaign in 4 simple clicks",description:"Welcome to the future of advertising! Our AI-powered campaign builder helps you effortlessly design and manage ads that reach your target audience with precision. Get started now to unlock the potential of automated, data-driven advertising.",button:"Set up paid ads",next_steps_description:"Already running ads? Track Your Marketing Results with a few clicks.",link_to_analytics:"Connect your existing accounts to get instant insights into your marketing performance."},how_it_works:{dialog_title:"How It Works",title:"Setup your ad campaign",step1:{title:"Set up budget & review your ads",description:"Define how much you want to spend, review the ad designs, and configure who you want to reach."},step2:{title:"We’ll publish & optimize your ads on Google",description:"We’ll do the hard work of publishing & continuously optimizing your ads on Google making sure you’re getting the best possible return on investment."},step3:{title:"See Customers & Results",description:"When a customer buys from you, we’ll notify you and show you the total revenue driven to your business from each dollar invested in ads. "}},ads_builder:{dialog_trigger:"New campaign",title:"Ads Builder",description:"Create your new ad campaign",review_ad_themes:"Review Ad Themes",example_ad_preview:"Example Ad Preview",example_ad_preview_description:"Here's an example of how prospective customers might see your ads. We will automagically tweak the copy based on your products offered, and improve targeting based on what results in the most dollars to your business."}},analytics:{setup_analytics:"Setup analytics",setup_analytics_description:"Let's get you started with analytics. Connect your data sources to start tracking your customers.",connect_data:{title:"Connect Your Data",description:"We bring all of your ads data together to give you a clear view of which customers are coming in from where."},install_pixel:{copied_to_clipboard:"Copied to clipboard",copied_to_clipboard_description:"The tracking pixel code has been copied to your clipboard.",title:"Install our Tracking Pixel",description:"In order to get a complete picture of how users are interacting with your website, it’s important for the Reach analytics code to be on every page of your website and within as many third-party tools that you use as possible.",card_title:"Install the Snippet inside the <HEAD> of every page",card_description:"Copy this following text and insert it inside of the <HEAD> tags on all pages.",error_generating_pixel_code:"Error generating pixel code - please contact your administrator"},third_party_installation_guides:{title:"Installation Guides",description:"These guides will help you add the Reach analytics snippet to your website. The process works with any website builder or platform and most third-party tools.",installation_guide:"{{name}} Installation Guide",official_guide:"Official Guide",shopify:{step_1:"From your Shopify admin, go to Online Store > Themes",step_2:"Find the theme you want to edit, click the … button to open the actions menu, and then click Edit code",step_3:'Open "theme.liquid"',step_4:"Find the </head> tag",step_5:"Paste the code snippet from the section above just before it"},google_tag_manager:{step_1:"Go to https://tagmanager.google.com",step_2:"Sign in to your Google Account",step_3:"Click the Accounts tab, then select Create Account",step_4:"Enter an account name and select your country location",step_5:"In Container Setup, enter a container name (e.g., your website URL)",step_6:'Select "Web" as the container type',step_7:"Click Create and agree to the Terms of Service",step_8:"Once created, you'll receive two code snippets to install:",step_9:"• Place the first snippet in the <head> of your page",step_10:"• Place the second snippet immediately after the opening <body> tag",step_11:"In the Tags tab, click the + button to create a new tag",step_12:'Select "Google Analytics: Universal Analytics" as the tag type',special_note:"Make sure you have the Google Tag Manager container code already installed on your site before adding this tag."},hubspot:{step_1:"Go to Settings → Content → Pages",step_2:'In the upper left, select a domain to edit its settings. Or select "Default settings for all domains"',step_3:'Paste the code from the section above to the "Site Header HTML" field',step_4:'Click "Save"'},wordpress:{step_1:"We recommend using the popular WPCode Plugin",step_2:'In the plugin, select "+ Add Snippet"',step_3:'When presented with a menu of options, navigate to "Add Your Custom Code (New Snippet)" and select "Use snippet"',step_4:"Paste the code snippet from the section above",step_5:'For Insert Method, choose "Auto Insert"',step_6:'For Location, select "Site Wide Header"',step_7:"Be sure to save your snippet"},squarespace:{step_1:"Go to Settings → Advanced → Code Injection",step_2:'Paste the code from the section above into the "Header" field',step_3:'Click "Save"'},wix:{step_1:"Go to Settings → Custom Code",step_2:'Click "+ Add Custom Code"',step_3:"Paste the code from the section above",step_4:'Click "Apply"',step_5:'Set "Add Code to Pages" to "All Pages"'},webflow:{step_1:"Open your project settings",step_2:'Navigate to "Custom Code"',step_3:'Paste the code from the section above into the "Head Code" section',step_4:'Click "Save Changes"'},third_party_systems:{step_1:"Check if your third-party tools (lead forms, scheduling tools, etc.) allow custom code injection",step_2:'Look for options labeled "Custom Code", "Embed Code", or "Advanced Settings"',step_3:"Paste the same tracking code into these sections where available",step_4:"Common locations include:",step_5:"• Head section of your website (for tracking scripts and styles)",step_6:"• Footer section of your website (for tracking scripts and styles)",special_note:"This helps ensure consistent tracking across all your customer touchpoints, even when using external tools."},custom:{step_1:"Locate your website's HTML template or main layout file",step_2:"Find the </head> tag in your HTML",step_3:"Paste the code snippet just before the </head> tag",step_4:"Save the file and deploy your changes"}},success:{title:"Success!",description:"You have successfully connected your data sources and installed our tracking pixel.",what_next:"What happens next?",step_1:"Your ad data will start syncing automatically",step_2:"The pixel will begin tracking conversions on your site",step_3:"You'll see your first analytics reports within 24 hours"}},dashboard:{banners:{metrics_crunching:{title:"Crunching your data",description:"You have successfully connected your ad accounts. We're now crunching your data. Check back soon for relevant metrics."},revoked_accounts:{title:"Your ad accounts have been revoked",description:"Please reconnect your ad accounts to continue using the dashboard."}},roas_chart:{title:"Ad Spend vs Revenue Over Time"},client_acquisition:{title:"Client Acquisition",description:"See how many new clients you acquired from each channel",client:"Client",source:"Source",total_spent:"Total Spent",total_revenue:"Total Revenue",status:"Status",no_data:"No data available",source_breakdown:"Source",payment_status:"Payment Status",paid:"Paid",unpaid:"Unpaid"},channel_performance:{title:"Channel Performance",description:"See how each channel performs",channel:"Channel",spend:"Spend",revenue:"Revenue",roas:"ROAS",new_customers:"New Customers"},tabs:{overview:"Overview",channel_performance:"Channel Performance"},metrics:{ads_spend:"Ads Spend",ads_spend_description:"The amount spent on ads in a given period. Sum of all sub-ads accounts (e.g. insta, google). Excluding agency fees",measured_revenue:"Measured Revenue",measured_revenue_description:"The amount of revenue measured from ads",measured_conversions:"Measured Conversions",measured_conversions_description:"The amount of conversions measured from ads",roas:"ROAS",roas_description:"This is the ratio of the revenue to the ads spend",impressions:"Impressions",impressions_description:"Number of times your ads were shown to potential customers",clicks:"Clicks/Actions",clicks_description:"Total interactions with your ads, including clicks and other actions",website_visitors:"Website Visitors",website_visitors_description:"Unique visitors to your website from advertising campaigns",new_leads:"New Leads",new_leads_description:"New potential customers who provided contact information",customer_ltv:"Customer LTV",customer_ltv_description:"Average lifetime value of customers acquired through ads"},title:"Marketing Revenue Dashboard",settings_sheet:{setup:"Setup",connected_accounts:"Connected Accounts",setup_analytics:"Setup analytics",setup_analytics_description:"Configure your analytics tracking",setup_campaigns:"Setup campaigns",setup_campaigns_description:"Set up your first campaign",legal:"Legal",terms_of_service:"Terms of Service",privacy_policy:"Privacy Policy"}},setup:{how_it_works:{title:"How It Works",dialog_title:"Setup Marketing Insights",connect_ads_title:"Connect your Ads Accounts",connect_ads_description:"Link your advertising accounts from platforms like Google and Meta to consolidate all your campaign data in one place. This enables comprehensive tracking and analysis of your marketing spend.",install_pixel_title:"Install Our Tracking Pixel",install_pixel_description:"Add our lightweight tracking code to your website to accurately measure customer interactions and conversions. This simple integration helps identify which ads are driving real results for your business.",see_customers_results_title:"See Customers & Results",see_customers_results_description:"Get clear insights into your marketing performance with detailed analytics on customer acquisition, conversion rates, and return on ad spend. Make data-driven decisions to optimize your campaigns and grow your business.",still_have_more_questions:"Still have more questions?",get_started:"Get Started"},initial_setup:{wizard_title:"Connect your ad accounts and see exactly how your campaigns drive revenue",title:"Unlock Clear Insights into Your Marketing Performance",description:"Stop guessing and start knowing. Our performance dashboard gives you a complete view of your marketing efforts, including ad spend, conversions, and return on ad spend (ROAS).",description_2:"With a simple setup process, you’ll have actionable insights at your fingertips to help you make smarter decisions and grow your business.",setup_performance_analytics:"Setup Performance Analytics",next_steps_description:"If you're not running ads yet, you can launch your first AI-powered ad campaign in minutes.",next_steps_link:"We will prompt you to connect your ad accounts and set up your first campaign."}},oauth:{selectAccount:{title:"Select {{platform}} Account",description:"Choose the {{platform}} account you want to connect.",loading:"Loading accounts...",loadingPlatform:"Loading {{platform}} accounts...",loadingDescription:"Please wait while we fetch your available accounts...",noAccounts:"No {{platform}} accounts were found for your account.",noAccountsDescription:"Please make sure you have access to a {{platform}} account and try again.",selectAccountPlaceholder:"Select an account",searchPlaceholder:"Search accounts...",fetchAccounts:"Fetching accounts...",noAccountSelected:"No account selected",enableTrackingParams:"Enable Tracking Parameters",enableTrackingParamsDescription:"Apply custom tracking parameters to your campaigns and ad groups. This ensures our pixel will track your ads.",google:{selectAccountDescription:"Select the Google Ads account you want to connect to view your data. These will be linked to our MCC for optimal tracking.",mccAccounts:"MCC Accounts",directAccounts:"Direct Accounts"},meta:{selectAccountDescription:"Choose the Meta Ads account you want to connect to view your data."}},success:{connection:{title:"Connected successfully",description:"Your {{provider}} account has been connected."},revoke:{title:"Account revoked",description:"Your {{provider}} account has been revoked."}},error:{title:"Connection failed",description:"Failed to connect account"},revoke:{title:"Revoke access",description:"Are you sure? Revoking access will remove the connection you have and you will be unable to view your ad metrics.",cancel:"Cancel",revoke:"Revoke",error:{title:"Error",description:"Failed to revoke access"}}},magic_link:{get_started:"Get Started",description:"Reach will be embedded within your platform dashboard but until then, you can get started with a magic link. Log in to your account and start creating AI-powered campaigns or measuring your ad spend and performance.",create_campaigns:"Create AI-generated ad campaigns in minutes",unlock_insights:"Unlock insights into your ad spend and performance",save_time:"Save time with automated campaign optimization",request_new_magic_link:"Request New Magic Link",go_to_dashboard:"Go to Dashboard",continuation_disclaimer:"By continuing, you agree to our <terms_of_service>Terms of Service</terms_of_service> and <privacy_policy>Privacy Policy</privacy_policy>."},empty_state:{analytics:{title:"You haven't connected any ad accounts yet",description:"You can connect your ad accounts in minutes and start driving more customers to your business.",button_text:"Setup analytics"}}}},es:{common:{ad_spend:"Gasto en anuncios",date:"Fecha",close:"Cerrar",continue:"Continuar",connected:"Conectado",connecting:"Conectando...",reauth_required:"Re-autenticación requerida",reauth_required_description:"Re-autenticación requerida para una de tus cuentas de anuncios",reauthenticate:"Reautenticar",account_settings:"Configuración de cuenta",manage_account_settings:"Configuración de tu cuenta",copy:"Copiar",copied:"Copiado",error:"Se produjo un error",filter:"Filtrar",finishingUp:"Finalizando...",loading:"Cargando...",need_help:"¿Necesitas ayuda? Háznoslo saber",next:"Siguiente",next_steps:"Siguientes pasos:",number:"{{number}}",previous:"Anterior",revenue:"Ingresos",revenue_from_ads:"Ingresos de anuncios",roas:"ROAS",return_on_ad_spend:"Retorno de inversión en anuncios",select_dates:"Selecciona fechas",total_ads_spend:"Gasto total en anuncios",authentication:{required:"Se requiere autenticación",failed:"Error de autenticación",connect_account_title:"Conecta tu cuenta de {{provider}}",connect_account_description:"Para crear y gestionar campañas de anuncios, por favor conecta tu cuenta de {{provider}}",connect_account_button:"Continuar con {{provider}}",connect_account_TOS:"Al conectarte, aceptas nuestros Términos de Servicio y Política de Privacidad"},theme:{loading:"Cargando tema...",error:"Error al cargar el tema: {{message}}"},dates:{last_week:"Semana pasada",last_month:"Mes pasado",last_quarter:"Trimestre pasado",last_year:"Año pasado"},campaigns:{setup:{card_header:"Lanza anuncios pagados para obtener nuevos leads y clientes",title:"Crea tu primera campaña de anuncios AI en 4 clicks",description:"Bienvenido al futuro del marketing! Nuestro creador de campañas AI te ayuda a diseñar y gestionar anuncios que alcanzan a tu audiencia con precisión. ¡Comienza ahora para desbloquear el potencial de anuncios automatizados y basados en datos.",button:"Configura tus anuncios pagados",next_steps_description:"¿Ya tienes anuncios? Rastrea tus resultados de marketing con solo unos clicks.",link_to_analytics:"Conecta tus cuentas existentes para obtener insights instantáneos sobre tu rendimiento de marketing."},how_it_works:{dialog_title:"Cómo funciona",title:"Configura tu campaña de anuncios",step1:{title:"Configura tu presupuesto y revisa tus anuncios",description:"Define cuánto quieres gastar, revisa los diseños de anuncios y configura quién quieres llegar."},step2:{title:"Publicaremos y optimizaremos tus anuncios en Google",description:"Haremos el trabajo duro de publicar y optimizar tus anuncios en Google para asegurarnos de que obtengas el mejor retorno de inversión posible."},step3:{title:"Ver clientes y resultados",description:"Cuando un cliente compra de ti, te notificaremos y te mostraremos el total de ingresos generados para tu negocio por cada dólar invertido en anuncios."}},ads_builder:{dialog_trigger:"Nueva campaña",title:"Ads Builder",description:"Crea tu nueva campaña de anuncios",review_ad_themes:"Revisa temas de anuncios",example_ad_preview:"Ejemplo de anuncio",example_ad_preview_description:"Aquí tienes un ejemplo de cómo los clientes potenciales podrían ver tus anuncios. Automáticamente ajustaremos el texto basándonos en tus productos ofrecidos y mejoraremos el targeting basándonos en lo que resulta en más dinero para tu negocio."}},analytics:{setup_analytics:"Configura analytics",setup_analytics_description:"Vamos a empezar con analytics. Conecta tus fuentes de datos para empezar a rastrear tus clientes.",connect_data:{title:"Conecta tus datos",description:"Juntamos todos tus datos de anuncios para darte una visión clara de qué clientes están llegando de dónde."},install_pixel:{copied_to_clipboard:"Copiado al portapapeles",copied_to_clipboard_description:"El código del pixel de seguimiento ha sido copiado a tu portapapeles.",title:"Instala nuestro pixel de seguimiento",description:"Para obtener una visión completa de cómo los usuarios interactúan con tu sitio web, es importante que el código de analytics de Reach esté en cada página de tu sitio web y dentro de tantos terceros como puedas usar.",card_title:"Instala el fragmento dentro del <HEAD> de cada página",card_description:"Copia este texto y insertalo dentro de las etiquetas <HEAD> en todas las páginas.",error_generating_pixel_code:"Error generando código del pixel - por favor contacta a tu administrador"},third_party_installation_guides:{title:"Guías de instalación",description:"Estas guías te ayudarán a agregar el fragmento de analytics de Reach a tu sitio web. El proceso funciona con cualquier constructor de sitios web o plataforma y la mayoría de las herramientas de terceros.",installation_guide:"Guía de instalación de {{name}}",official_guide:"Guía oficial",shopify:{step_1:"Desde tu Shopify admin, ve a Online Store > Themes",step_2:"Encuentra el tema que quieres editar, haz click en el botón … para abrir el menú de acciones y luego haz click en Editar código",step_3:'Abre "theme.liquid"',step_4:"Encuentra la etiqueta </head>",step_5:"Pega el fragmento de código de la sección anterior justo antes de ella"},google_tag_manager:{step_1:"Ve a https://tagmanager.google.com",step_2:"Inicia sesión en tu cuenta de Google",step_3:"Haz click en la pestaña de Cuentas y selecciona Crear cuenta",step_4:"Ingresa un nombre para tu cuenta y selecciona tu ubicación",step_5:"En Container Setup, ingresa un nombre para tu contenedor (e.g., tu URL de sitio web)",step_6:'Selecciona "Web" como tipo de contenedor',step_7:"Haz click en Crear y acepta los Términos de Servicio",step_8:"Una vez creado, recibirás dos fragmentos de código para instalar:",step_9:"• Coloca el primer fragmento en la etiqueta <head> de tu página",step_10:"• Coloca el segundo fragmento justo después de la etiqueta <body>",step_11:"En la pestaña de Etiquetas, haz click en el botón + para crear una nueva etiqueta",step_12:'Selecciona "Google Analytics: Universal Analytics" como tipo de etiqueta',special_note:"Asegúrate de tener el código del contenedor de Google Tag Manager instalado en tu sitio web antes de agregar esta etiqueta."},hubspot:{step_1:"Ve a Configuración → Contenido → Páginas",step_2:'En la esquina superior izquierda, selecciona un dominio para editar sus ajustes. O selecciona "Ajustes predeterminados para todos los dominios"',step_3:'Pega el código de la sección anterior en el campo "HTML del encabezado del sitio"',step_4:'Haz click en "Guardar"'},wordpress:{step_1:"Recomendamos usar el plugin WPCode",step_2:'En el plugin, selecciona "+ Añadir fragmento"',step_3:'Cuando se te presente un menú de opciones, navega a "Añadir tu código personalizado (nuevo fragmento)" y selecciona "Usar fragmento"',step_4:"Pega el fragmento de código de la sección anterior",step_5:'Para el método de inserción, elige "Auto insertar"',step_6:'Para la ubicación, selecciona "Encabezado del sitio"',step_7:"Asegúrate de guardar tu fragmento"},squarespace:{step_1:"Ve a Configuración → Avanzado → Inyección de código",step_2:'Pega el código de la sección anterior en el campo "Encabezado"',step_3:'Haz click en "Guardar"'},wix:{step_1:"Ve a Configuración → Código personalizado",step_2:'Haz click en "+ Añadir código personalizado"',step_3:"Pega el código de la sección anterior",step_4:'Haz click en "Aplicar"',step_5:'Establece "Añadir código a páginas" a "Todas las páginas"'},webflow:{step_1:"Abre tus ajustes de proyecto",step_2:'Navega a "Código personalizado"',step_3:'Pega el código de la sección anterior en la sección "Código de encabezado"',step_4:'Haz click en "Guardar cambios"'},third_party_systems:{step_1:"Revisa si tus herramientas de terceros (formularios de leads, herramientas de programación, etc.) permiten la inyección de código personalizado",step_2:'Busca opciones etiquetadas como "Código personalizado", "Código incrustado" o "Ajustes avanzados"',step_3:"Pega el mismo código de seguimiento en estas secciones donde esté disponible",step_4:"Los lugares comunes incluyen:",step_5:"• Sección de encabezado de tu sitio web (para scripts y estilos de seguimiento)",step_6:"• Sección de pie de página de tu sitio web (para scripts y estilos de seguimiento)",special_note:"Esto asegura un seguimiento consistente en todos tus puntos de contacto con clientes, incluso cuando usas herramientas externas."},custom:{step_1:"Localiza tu plantilla HTML o archivo de diseño principal",step_2:"Encuentra la etiqueta </head> en tu HTML",step_3:"Pega el fragmento de código justo antes de la etiqueta </head>",step_4:"Guarda el archivo y desplíalo"}},success:{title:"¡Éxito!",description:"Has conectado tus fuentes de datos y instalado nuestro pixel de seguimiento.",what_next:"¿Qué pasa a continuación?",step_1:"Tus datos de anuncios comenzarán a sincronizarse automáticamente",step_2:"El pixel comenzará a rastrear conversiones en tu sitio",step_3:"Verás tus primeros informes de analytics en 24 horas"}},dashboard:{banners:{metrics_crunching:{title:"Trabajando en tus datos",description:"Has conectado tus cuentas de anuncios. Estamos ahora trabajando en tus datos. Vuelve pronto para ver tus métricas relevantes."},revoked_accounts:{title:"Tus cuentas de anuncios han sido revocadas",description:"Por favor, reconecta tus cuentas de anuncios para continuar usando el panel."}},roas_chart:{title:"Gasto en anuncios vs ingresos en el tiempo"},client_acquisition:{title:"Adquisición de clientes",description:"Ver cómo has adquirido nuevos clientes de cada canal",client:"Cliente",source:"Fuente",total_spent:"Gasto total",total_revenue:"Ingresos totales",status:"Estado",no_data:"No hay datos disponibles",source_breakdown:"Fuente",payment_status:"Estado de pago",paid:"Pagado",unpaid:"No pagado"},channel_performance:{title:"Rendimiento de canales",description:"Ver cómo cada canal se desempeña",channel:"Canal",spend:"Gasto",revenue:"Ingresos",roas:"ROAS",new_customers:"Nuevos clientes"},tabs:{overview:"Resumen",channel_performance:"Rendimiento de canales"},metrics:{ads_spend:"Gasto en anuncios",ads_spend_description:"El gasto en anuncios en un período determinado. Suma de todos los sub-cuentas de anuncios (e.g. insta, google). Excluyendo comisiones de agencias",measured_revenue:"Ingresos Medidos",measured_revenue_description:"La cantidad de ingresos medidos de los anuncios",measured_conversions:"Conversiones Medidas",measured_conversions_description:"La cantidad de conversiones medidas de los anuncios",roas:"ROAS",roas_description:"Este es el ratio de los ingresos a los gastos en anuncios",impressions:"Impresiones",impressions_description:"Número de veces que tus anuncios fueron mostrados a potenciales clientes",clicks:"Clicks/Acciones",clicks_description:"Total de interacciones con tus anuncios, incluyendo clicks y otras acciones",website_visitors:"Visitantes web",website_visitors_description:"Visitantes únicos a tu sitio web desde campañas de anuncios",new_leads:"Nuevos leads",new_leads_description:"Nuevos potenciales clientes que proporcionaron información de contacto",customer_ltv:"LTV de cliente",customer_ltv_description:"Valor promedio de vida de clientes adquiridos a través de anuncios"},title:"Panel de ingresos de marketing",settings_sheet:{setup:"Configuración",connected_accounts:"Cuentas conectadas",setup_analytics:"Configurar analytics",setup_analytics_description:"Configura tu tracking de analytics",setup_campaigns:"Configurar campañas",setup_campaigns_description:"Configura tu primera campaña",legal:"Legal",terms_of_service:"Términos de servicio",privacy_policy:"Política de privacidad"}},setup:{how_it_works:{title:"Cómo funciona",dialog_title:"Configura Marketing Insights",connect_ads_title:"Conecta tus cuentas de anuncios",connect_ads_description:"Conecta tus cuentas de anuncios de plataformas como Google y Meta para consolidar todos tus datos de campañas en un solo lugar. Esto te permite rastrear y analizar tu gasto en marketing de manera completa.",install_pixel_title:"Instala nuestro pixel de seguimiento",install_pixel_description:"Añade nuestro código de seguimiento ligero a tu sitio web para medir las interacciones y conversiones de los clientes. Esta integración simple ayuda a identificar qué anuncios están generando resultados reales para tu negocio.",see_customers_results_title:"Ver clientes y resultados",see_customers_results_description:"Obtén una visión clara de tu rendimiento en marketing con análisis detallados sobre adquisición de clientes, tasas de conversión y retorno de inversión en anuncios. Haz decisiones basadas en datos para optimizar tus campañas y crecer tu negocio.",still_have_more_questions:"¿Tienes más preguntas?",get_started:"Comenzar"},initial_setup:{wizard_title:"Conecta tus cuentas de anuncios y ver cómo tus campañas generan ingresos",title:"Desbloquea insights claros en tu rendimiento de marketing",description:"Para empezar, conecta tus cuentas de anuncios de Google y Meta. Esto te permitirá rastrear y analizar tu gasto en marketing de manera completa.",description_2:"Con un proceso de configuración simple, tendrás insights accionables a tu disposición para ayudarte a tomar mejores decisiones y crecer tu negocio.",setup_performance_analytics:"Configura analytics de rendimiento",next_steps_description:"Si no tienes anuncios aún, puedes lanzar tu primera campaña de anuncios AI en minutos.",next_steps_link:"Te pediremos que conectes tus cuentas de anuncios y configures tu primera campaña."}},oauth:{selectAccount:{title:"Cuenta de {{platform}}",description:"Elige la cuenta de {{platform}} que quieres conectar.",loading:"Cargando cuentas...",loadingPlatform:"Cargando cuentas de {{platform}}...",loadingDescription:"Por favor, espera mientras obtenemos tus cuentas disponibles...",noAccounts:"No se encontraron cuentas de {{platform}} para tu cuenta.",noAccountsDescription:"Por favor, asegúrate de tener acceso a una cuenta de {{platform}} y vuelve a intentarlo.",selectAccountPlaceholder:"Selecciona una cuenta",searchPlaceholder:"Buscar cuentas...",fetchAccounts:"Buscando cuentas...",noAccountSelected:"No hay cuenta seleccionada",enableTrackingParams:"Habilitar parámetros de seguimiento",enableTrackingParamsDescription:"Aplica parámetros de seguimiento personalizados a tus campañas y grupos de anuncios. Esto asegura que nuestro pixel rastreará tus anuncios.",google:{selectAccountDescription:"Elige la cuenta de Google Ads que quieres conectar para ver tus datos. Estas serán vinculadas a nuestra MCC para un seguimiento óptimo.",mccAccounts:"Cuentas MCC",directAccounts:"Cuentas Directas"},meta:{selectAccountDescription:"Elige la cuenta de Meta Ads que quieres conectar para ver tus datos."}},success:{connection:{title:"Conectado correctamente",description:"Tu cuenta de {{provider}} ha sido conectada."},revoke:{title:"Cuenta revocada",description:"Tu cuenta de {{provider}} ha sido revocada."}},error:{title:"Error al conectar",description:"Error al conectar cuenta"},revoke:{title:"Revocar acceso",description:"¿Estás seguro? Revocar acceso eliminará la conexión que tienes y no podrás ver tus métricas de anuncios.",cancel:"Cancelar",revoke:"Revocar",error:{title:"Error",description:"Error al revocar acceso"}}},magic_link:{get_started:"Comenzar",description:"Reach estará incrustado en tu panel de control pero hasta entonces, puedes comenzar con un enlace mágico. Inicia sesión en tu cuenta y comienza a crear campañas AI o mide tu gasto en anuncios y rendimiento.",create_campaigns:"Crea campañas de anuncios AI en minutos",unlock_insights:"Desbloquea insights en tu gasto en anuncios y rendimiento",save_time:"Ahorra tiempo con optimización de campañas automatizadas",request_new_magic_link:"Solicitar nuevo enlace mágico",go_to_dashboard:"Ir al panel de control",continuation_disclaimer:"Al continuar, aceptas nuestros <terms_of_service>Términos de servicio</terms_of_service> y <privacy_policy>Política de privacidad</privacy_policy>."},empty_state:{analytics:{title:"No tienes ninguna cuenta de anuncios conectada",description:"Puedes conectar tus cuentas de anuncios en minutos y empezar a atraer más clientes a tu negocio.",button_text:"Configurar analytics"}}}}};ed.use(bd).use(hu).init({resources:wd,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1},defaultNS:"common",ns:["common"],load:"languageOnly",detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lang",lookupLocalStorage:"i18nextLng",caches:["localStorage"],convertDetectedLanguage:e=>e.split("-")[0]}});const xd=({children:e})=>t.jsx(pu,{i18n:ed,children:e}),kd=n.createContext({});function Sd(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const Cd=n.createContext(null),Ed=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Pd extends lt.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function jd({children:e,isPresent:r,anchorX:o}){const i=n.useId(),s=n.useRef(null),a=n.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=n.useContext(Ed);return n.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:c,right:u}=a.current;if(r||!s.current||!e||!t)return;const d="left"===o?`left: ${c}`:`right: ${u}`;s.current.dataset.motionPopId=i;const h=document.createElement("style");return l&&(h.nonce=l),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${i}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${d}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.removeChild(h)}}),[r]),t.jsx(Pd,{isPresent:r,childRef:s,sizeRef:a,children:lt.cloneElement(e,{ref:s})})}const Dd=({children:e,initial:r,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l,anchorX:c})=>{const u=Sd(Td),d=n.useId(),h=n.useCallback((e=>{u.set(e,!0);for(const t of u.values())if(!t)return;i&&i()}),[u,i]),f=n.useMemo((()=>({id:d,initial:r,isPresent:o,custom:s,onExitComplete:h,register:e=>(u.set(e,!1),()=>u.delete(e))})),a?[Math.random(),h]:[o,h]);return n.useMemo((()=>{u.forEach(((e,t)=>u.set(t,!1)))}),[o]),lt.useEffect((()=>{!o&&!u.size&&i&&i()}),[o]),"popLayout"===l&&(e=t.jsx(jd,{isPresent:o,anchorX:c,children:e})),t.jsx(Cd.Provider,{value:f,children:e})};function Td(){return new Map}function Md(e=!0){const t=n.useContext(Cd);if(null===t)return[!0,null];const{isPresent:r,onExitComplete:o,register:i}=t,s=n.useId();n.useEffect((()=>{e&&i(s)}),[e]);const a=n.useCallback((()=>e&&o&&o(s)),[s,o,e]);return!r&&o?[!1,a]:[!0]}const Od=e=>e.key||"";function Ad(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const Nd="undefined"!=typeof window,_d=Nd?n.useLayoutEffect:n.useEffect,Rd=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=Md(l),h=n.useMemo((()=>Ad(e)),[e]),f=l&&!u?[]:h.map(Od),p=n.useRef(!0),g=n.useRef(h),m=Sd((()=>new Map)),[v,y]=n.useState(h),[b,w]=n.useState(h);_d((()=>{p.current=!1,g.current=h;for(let e=0;e<b.length;e++){const t=Od(b[e]);f.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}}),[b,f.length,f.join("-")]);const x=[];if(h!==v){let e=[...h];for(let t=0;t<b.length;t++){const n=b[t],r=Od(n);f.includes(r)||(e.splice(t,0,n),x.push(n))}return"wait"===a&&x.length&&(e=x),w(Ad(e)),y(h),null}process;const{forceRender:k}=n.useContext(kd);return t.jsx(t.Fragment,{children:b.map((e=>{const n=Od(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(Dd,{isPresent:v,initial:!(p.current&&!o)&&void 0,custom:r,presenceAffectsLayout:s,mode:a,onExitComplete:v?void 0:()=>{if(!m.has(n))return;m.set(n,!0);let e=!0;m.forEach((t=>{t||(e=!1)})),e&&(null==k||k(),w(g.current),l&&(null==d||d()),i&&i())},anchorX:c,children:e},n)}))})},Ld=e=>e;let $d=Ld,Fd=Ld;function Id(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&($d=(e,t)=>{},Fd=(e,t)=>{if(!e)throw new Error(t)});const qd=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},zd=e=>1e3*e,Vd=e=>e/1e3,Bd=!1,Ud=["read","resolveKeyframes","update","preRender","render","postRender"],Kd={value:null};function Wd(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Ud.reduce(((e,n)=>(e[n]=function(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(t){s.has(t)&&(u.schedule(t),e()),l++,t(a)}const u={schedule:(e,t=!1,i=!1)=>{const a=i&&o?n:r;return t&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{a=e,o?i=!0:(o=!0,[n,r]=[r,n],n.forEach(c),t&&Kd.value&&Kd.value.frameloop[t].push(l),l=0,n.clear(),o=!1,i&&(i=!1,u.process(e)))}};return u}(i,t?n:void 0),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=s,f=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),h.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(f))};return{schedule:Ud.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(f)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t<Ud.length;t++)s[Ud[t]].cancel(e)},state:o,steps:s}}const{schedule:Hd,cancel:Gd,state:Yd,steps:Qd}=Wd("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Ld,!0),Xd=n.createContext({strict:!1}),Jd={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"]},Zd={};for(const IB in Jd)Zd[IB]={isEnabled:e=>Jd[IB].some((t=>!!e[t]))};const eh=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 th(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||eh.has(e)}let nh=e=>!th(e);try{(rh=require("@emotion/is-prop-valid").default)&&(nh=e=>e.startsWith("on")?!th(e):rh(e))}catch($B){}var rh;const oh=new Set;function ih(e,t,n){e||oh.has(t)||oh.add(t)}function sh(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&ih(!1,"motion() is deprecated. Use motion.create() instead."),e(...t))),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const ah=n.createContext({});function lh(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function ch(e){return"string"==typeof e||Array.isArray(e)}const uh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dh=["initial",...uh];function hh(e){return lh(e.animate)||dh.some((t=>ch(e[t])))}function fh(e){return Boolean(hh(e)||e.variants)}function ph(e){const{initial:t,animate:r}=function(e,t){if(hh(e)){const{initial:t,animate:n}=e;return{initial:!1===t||ch(t)?t:void 0,animate:ch(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(ah));return n.useMemo((()=>({initial:t,animate:r})),[gh(t),gh(r)])}function gh(e){return Array.isArray(e)?e.join(" "):e}const mh=Symbol.for("motionComponentSymbol");function vh(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function yh(e,t,r){return n.useCallback((n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"==typeof r?r(n):vh(r)&&(r.current=n))}),[t])}const bh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),wh="data-"+bh("framerAppearId"),{schedule:xh}=Wd(queueMicrotask,!1),kh=n.createContext({});function Sh(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(ah),c=n.useContext(Xd),u=n.useContext(Cd),d=n.useContext(Ed).reducedMotion,h=n.useRef(null);o=o||c.renderer,!h.current&&o&&(h.current=o(e,{visualState:t,parent:l,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const f=h.current,p=n.useContext(kh);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(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:Ch(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&vh(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(h.current,r,i,p);const g=n.useRef(!1);n.useInsertionEffect((()=>{f&&g.current&&f.update(r,u)}));const m=r[wh],v=n.useRef(Boolean(m)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,m))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,m)));return _d((()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),xh.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())})),n.useEffect((()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,m)})),v.current=!1))})),f}function Ch(e){if(e)return!1!==e.options.allowProjection?e.projection:Ch(e.parent)}function Eh({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(Ed),...a,layoutId:Ph(a)},{isStatic:d}=u,h=ph(a),f=i(a,d);if(!d&&Nd){!function(e,t){const r=n.useContext(Xd).strict;if("production"!==process.env.NODE_ENV&&t&&r){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?$d(!1,t):Fd(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=Zd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,h.visualElement=Sh(s,f,u,r,t.ProjectionNode)}return t.jsxs(ah.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,yh(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)Zd[t]={...Zd[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof s?s:`create(${null!==(l=null!==(a=s.displayName)&&void 0!==a?a:s.name)&&void 0!==l?l:""})`}`;const u=n.forwardRef(c);return u[mh]=s,u}function Ph({layoutId:e}){const t=n.useContext(kd).id;return t&&void 0!==e?t+"-"+e:e}const jh=e=>t=>"string"==typeof t&&t.startsWith(e),Dh=jh("--"),Th=jh("var(--"),Mh=e=>!!Th(e)&&Oh.test(e.split("/*")[0].trim()),Oh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ah={};const Nh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_h=new Set(Nh);function Rh(e,{layout:t,layoutId:n}){return _h.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Ah[e]||"opacity"===e)}const Lh=e=>Boolean(e&&e.getVelocity),$h=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Fh=(e,t,n)=>n>t?t:n<e?e:n,Ih={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},qh={...Ih,transform:e=>Fh(0,1,e)},zh={...Ih,default:1},Vh=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Bh=Vh("deg"),Uh=Vh("%"),Kh=Vh("px"),Wh=Vh("vh"),Hh=Vh("vw"),Gh={...Uh,parse:e=>Uh.parse(e)/100,transform:e=>Uh.transform(100*e)},Yh={borderWidth:Kh,borderTopWidth:Kh,borderRightWidth:Kh,borderBottomWidth:Kh,borderLeftWidth:Kh,borderRadius:Kh,radius:Kh,borderTopLeftRadius:Kh,borderTopRightRadius:Kh,borderBottomRightRadius:Kh,borderBottomLeftRadius:Kh,width:Kh,maxWidth:Kh,height:Kh,maxHeight:Kh,top:Kh,right:Kh,bottom:Kh,left:Kh,padding:Kh,paddingTop:Kh,paddingRight:Kh,paddingBottom:Kh,paddingLeft:Kh,margin:Kh,marginTop:Kh,marginRight:Kh,marginBottom:Kh,marginLeft:Kh,backgroundPositionX:Kh,backgroundPositionY:Kh},Qh={rotate:Bh,rotateX:Bh,rotateY:Bh,rotateZ:Bh,scale:zh,scaleX:zh,scaleY:zh,scaleZ:zh,skew:Bh,skewX:Bh,skewY:Bh,distance:Kh,translateX:Kh,translateY:Kh,translateZ:Kh,x:Kh,y:Kh,z:Kh,perspective:Kh,transformPerspective:Kh,opacity:qh,originX:Gh,originY:Gh,originZ:Kh},Xh={...Ih,transform:Math.round},Jh={...Yh,...Qh,zIndex:Xh,size:Kh,fillOpacity:qh,strokeOpacity:qh,numOctaves:Xh},Zh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ef=Nh.length;function tf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const e=t[l];if(_h.has(l))s=!0;else if(Dh(l))o[l]=e;else{const t=$h(e,Jh[l]);l.startsWith("origin")?(a=!0,i[l]=t):r[l]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i<ef;i++){const s=Nh[i],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=$h(a,Jh[s]);l||(o=!1,r+=`${Zh[s]||s}(${e}) `),n&&(t[s]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=i;r.transformOrigin=`${e} ${t} ${n}`}}const nf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rf(e,t,n){for(const r in t)Lh(t[r])||Rh(r,n)||(e[r]=t[r])}function of(e,t){const r={};return rf(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return tf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function sf(e,t){const n={},r=of(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const af=["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 lf(e){return"string"==typeof e&&!e.includes("-")&&!!(af.indexOf(e)>-1||/[A-Z]/u.test(e))}const cf={offset:"stroke-dashoffset",array:"stroke-dasharray"},uf={offset:"strokeDashoffset",array:"strokeDasharray"};function df(e,t,n){return"string"==typeof e?e:Kh.transform(t+n*e)}function hf(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(tf(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:f,dimensions:p}=e;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||f.transform)&&(f.transformOrigin=function(e,t,n){return`${df(t,e.x,e.width)} ${df(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==r&&(h.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?cf:uf;e[i.offset]=Kh.transform(-r);const s=Kh.transform(t),a=Kh.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const ff=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),pf=e=>"string"==typeof e&&"svg"===e.toLowerCase();function gf(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return hf(n,t,pf(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};rf(t,e.style,e),i.style={...t,...i.style}}return i}function mf(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(lf(t)?gf:sf)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(nh(o)||!0===n&&th(o)||!t&&!th(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(r,"string"==typeof t,e),c=t!==n.Fragment?{...l,...a,ref:o}:{},{children:u}=r,d=n.useMemo((()=>Lh(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function vf(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function yf(e,t,n,r){if("function"==typeof t){const[o,i]=vf(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=vf(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const bf=e=>Array.isArray(e);function wf(e){const t=Lh(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const xf=e=>(t,r)=>{const o=n.useContext(ah),i=n.useContext(Cd),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:kf(r,o,i,e),renderState:t()};return n&&(s.onMount=e=>n({props:r,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,o,i);return r?s():Sd(s)};function kf(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=wf(i[h]);let{initial:s,animate:a}=e;const l=hh(e),c=fh(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!lh(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=yf(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[r]=e)}for(const r in e)o[r]=e[r]}}}return o}function Sf(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Lh(o[s])||t.style&&Lh(t.style[s])||Rh(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}const Cf={useVisualState:xf({scrapeMotionValuesFromProps:Sf,createRenderState:nf})};function Ef(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(LB){t.dimensions={x:0,y:0,width:0,height:0}}}function Pf(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 jf=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 Df(e,t,n,r){Pf(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(jf.has(o)?o:bh(o),t.attrs[o])}function Tf(e,t,n){const r=Sf(e,t,n);for(const o in e)if(Lh(e[o])||Lh(t[o])){r[-1!==Nh.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const Mf=["x","y","width","height","cx","cy","r"],Of={useVisualState:xf({scrapeMotionValuesFromProps:Tf,createRenderState:ff,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(_h.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<Mf.length;a++){const n=Mf[a];e[n]!==t[n]&&(s=!0)}s&&Hd.read((()=>{Ef(n,r),Hd.render((()=>{hf(r,o,pf(n.tagName),e.transformTemplate),Df(n,r)}))}))}})};function Af(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Eh({...lf(n)?Of:Cf,preloadedFeatures:e,useRender:mf(r),createVisualElement:t,Component:n})}}function Nf(e,t,n){const r=e.getProps();return yf(r,t,void 0!==n?n:r.custom,e)}const _f=Id((()=>void 0!==window.ScrollTimeline));class Rf{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map((e=>"finished"in e?e.finished:e)))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map((n=>_f()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0));return()=>{n.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach((t=>t[e]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Lf extends Rf{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function $f(e,t){return e?e[t]||e.default||e:void 0}const Ff=2e4;function If(e){let t=0;let n=e.next(t);for(;!n.done&&t<Ff;)t+=50,n=e.next(t);return t>=Ff?1/0:t}function qf(e){return"function"==typeof e}function zf(e,t){e.timeline=t,e.onfinish=null}const Vf=e=>Array.isArray(e)&&"number"==typeof e[0],Bf={linearEasing:void 0};function Uf(e,t){const n=Id(e);return()=>{var e;return null!==(e=Bf[t])&&void 0!==e?e:n()}}const Kf=Uf((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(LB){return!1}return!0}),"linearEasing"),Wf=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(qd(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Hf(e){return Boolean("function"==typeof e&&Kf()||!e||"string"==typeof e&&(e in Yf||Kf())||Vf(e)||Array.isArray(e)&&e.every(Hf))}const Gf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gf([0,.65,.55,1]),circOut:Gf([.55,0,1,.45]),backIn:Gf([.31,.01,.66,-.59]),backOut:Gf([.33,1.53,.69,.99])};function Qf(e,t){return e?"function"==typeof e&&Kf()?Wf(e,t):Vf(e)?Gf(e):Array.isArray(e)?e.map((e=>Qf(e,t)||Yf.easeOut)):Yf[e]:void 0}const Xf={x:!1,y:!1};function Jf(){return Xf.x||Xf.y}function Zf(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ep(e){return!("touch"===e.pointerType||Jf())}const tp=(e,t)=>!!t&&(e===t||tp(e,t.parentElement)),np=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,rp=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const op=new WeakSet;function ip(e){return t=>{"Enter"===t.key&&e(t)}}function sp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function ap(e){return np(e)&&!Jf()}function lp(e,t,n={}){const[r,o,i]=Zf(e,n),s=e=>{const r=e.currentTarget;if(!ap(e)||op.has(r))return;op.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ap(e)&&op.has(r)&&(op.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||tp(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach((e=>{(function(e){return rp.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0);(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,o),e.addEventListener("focus",(e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=ip((()=>{if(op.has(n))return;sp(n,"down");const e=ip((()=>{sp(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>sp(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const cp=new Set(["width","height","top","left","right","bottom",...Nh]);let up;function dp(){up=void 0}const hp={now:()=>(void 0===up&&hp.set(Yd.isProcessing||Bd?Yd.timestamp:performance.now()),up),set:e=>{up=e,queueMicrotask(dp)}};function fp(e,t){-1===e.indexOf(t)&&e.push(t)}function pp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class gp{constructor(){this.subscriptions=[]}add(e){return fp(this.subscriptions,e),()=>pp(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function mp(e,t){return t?e*(1e3/t):0}class vp{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=hp.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=hp.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&ih(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new gp);const n=this.events[e].add(t);return"change"===e?()=>{n(),Hd.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=hp.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return mp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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 yp(e,t){return new vp(e,t)}function bp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,yp(n))}function wp(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Lh(r)&&r.add))return n.add(t);var r}function xp(e){return e.props[wh]}const kp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Sp(e,t,n,r){if(e===t&&n===r)return Ld;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=kp(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:kp(o(e),t,r)}const Cp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ep=e=>t=>1-e(1-t),Pp=Sp(.33,1.53,.69,.99),jp=Ep(Pp),Dp=Cp(jp),Tp=e=>(e*=2)<1?.5*jp(e):.5*(2-Math.pow(2,-10*(e-1))),Mp=e=>1-Math.sin(Math.acos(e)),Op=Ep(Mp),Ap=Cp(Mp),Np=e=>/^0[^.\s]+$/u.test(e);const _p=e=>Math.round(1e5*e)/1e5,Rp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Lp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$p=(e,t)=>n=>Boolean("string"==typeof n&&Lp.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Fp=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(Rp);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Ip={...Ih,transform:e=>Math.round((e=>Fh(0,255,e))(e))},qp={test:$p("rgb","red"),parse:Fp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ip.transform(e)+", "+Ip.transform(t)+", "+Ip.transform(n)+", "+_p(qh.transform(r))+")"};const zp={test:$p("#"),parse:function(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}},transform:qp.transform},Vp={test:$p("hsl","hue"),parse:Fp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Uh.transform(_p(t))+", "+Uh.transform(_p(n))+", "+_p(qh.transform(r))+")"},Bp={test:e=>qp.test(e)||zp.test(e)||Vp.test(e),parse:e=>qp.test(e)?qp.parse(e):Vp.test(e)?Vp.parse(e):zp.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?qp.transform(e):Vp.transform(e)},Up=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Kp="number",Wp="color",Hp=/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 Gp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Hp,(e=>(Bp.test(e)?(r.color.push(i),o.push(Wp),n.push(Bp.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(Kp),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function Yp(e){return Gp(e).values}function Qp(e){const{split:t,types:n}=Gp(e),r=t.length;return e=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],void 0!==e[i]){const t=n[i];o+=t===Kp?_p(e[i]):t===Wp?Bp.transform(e[i]):e[i]}return o}}const Xp=e=>"number"==typeof e?0:e;const Jp={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Rp))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Up))||void 0===n?void 0:n.length)||0)>0},parse:Yp,createTransformer:Qp,getAnimatableNone:function(e){const t=Yp(e);return Qp(e)(t.map(Xp))}},Zp=new Set(["brightness","contrast","saturate","opacity"]);function eg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Rp)||[];if(!r)return e;const o=n.replace(r,"");let i=Zp.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const tg=/\b([a-z-]*)\(.*?\)/gu,ng={...Jp,getAnimatableNone:e=>{const t=e.match(tg);return t?t.map(eg).join(" "):e}},rg={...Jh,color:Bp,backgroundColor:Bp,outlineColor:Bp,fill:Bp,stroke:Bp,borderColor:Bp,borderTopColor:Bp,borderRightColor:Bp,borderBottomColor:Bp,borderLeftColor:Bp,filter:ng,WebkitFilter:ng},og=e=>rg[e];function ig(e,t){let n=og(e);return n!==ng&&(n=Jp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sg=new Set(["auto","none","0"]);const ag=e=>e===Ih||e===Kh,lg=(e,t)=>parseFloat(e.split(", ")[t]),cg=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return lg(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?lg(t[1],e):0}},ug=new Set(["x","y","z"]),dg=Nh.filter((e=>!ug.has(e)));const hg={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:cg(4,13),y:cg(5,14)};hg.translateX=hg.x,hg.translateY=hg.y;const fg=new Set;let pg=!1,gg=!1;function mg(){if(gg){const e=Array.from(fg).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return dg.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}gg=!1,pg=!1,fg.forEach((e=>e.complete())),fg.clear()}function vg(){fg.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(gg=!0)}))}class yg{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(fg.add(this),pg||(pg=!0,Hd.read(vg),Hd.resolveKeyframes(mg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),i=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),fg.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,fg.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const bg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),wg=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xg(e,t,n=1){Fd(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=wg.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return bg(e)?parseFloat(e):e}return Mh(o)?xg(o,t,n+1):o}const kg=e=>t=>t.test(e),Sg=[Ih,Kh,Uh,Bh,Hh,Wh,{test:e=>"auto"===e,parse:e=>e}],Cg=e=>Sg.find(kg(e));class Eg extends yg{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let a=0;a<e.length;a++){let n=e[a];if("string"==typeof n&&(n=n.trim(),Mh(n))){const r=xg(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!cp.has(n)||2!==e.length)return;const[r,o]=e,i=Cg(r),s=Cg(o);if(i!==s)if(ag(i)&&ag(s))for(let a=0;a<e.length;a++){const t=e[a];"string"==typeof t&&(e[a]=parseFloat(t))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let o=0;o<e.length;o++)("number"==typeof(r=e[o])?0===r:null===r||"none"===r||"0"===r||Np(r))&&n.push(o);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!sg.has(t)&&Gp(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=ig(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=hg[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=hg[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Pg=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Jp.test(e)&&"0"!==e||e.startsWith("url(")));const jg=e=>null!==e;function Dg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(jg),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class Tg{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=hp.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(vg(),mg()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=hp.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=Pg(o,t),a=Pg(i,t);return $d(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)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||qf(n))&&r)}(e,n,r,o)){if(!i)return a&&a(Dg(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((e=>{this.resolveFinishedPromise=e}))}}const Mg=(e,t,n)=>e+(t-e)*n;function Og(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ag(e,t){return n=>n>0?t:e}const Ng=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},_g=[zp,qp,Vp];function Rg(e){const t=(n=e,_g.find((e=>e.test(n))));var n;if($d(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===Vp&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Og(a,r,e+1/3),i=Og(a,r,e),s=Og(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(r)),r}const Lg=(e,t)=>{const n=Rg(e),r=Rg(t);if(!n||!r)return Ag(e,t);const o={...n};return e=>(o.red=Ng(n.red,r.red,e),o.green=Ng(n.green,r.green,e),o.blue=Ng(n.blue,r.blue,e),o.alpha=Mg(n.alpha,r.alpha,e),qp.transform(o))},$g=(e,t)=>n=>t(e(n)),Fg=(...e)=>e.reduce($g),Ig=new Set(["none","hidden"]);function qg(e,t){return n=>Mg(e,t,n)}function zg(e){return"number"==typeof e?qg:"string"==typeof e?Mh(e)?Ag:Bp.test(e)?Lg:Ug:Array.isArray(e)?Vg:"object"==typeof e?Bp.test(e)?Lg:Bg:Ag}function Vg(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>zg(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function Bg(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=zg(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Ug=(e,t)=>{const n=Jp.createTransformer(t),r=Gp(e),o=Gp(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?Ig.has(e)&&!o.values.length||Ig.has(t)&&!r.values.length?function(e,t){return Ig.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Fg(Vg(function(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=null!==(n=e.values[e.indexes[s][o[s]]])&&void 0!==n?n:0;r[i]=a,o[s]++}return r}(r,o),o.values),n):($d(!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.`),Ag(e,t))};function Kg(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Mg(e,t,n);return zg(e)(e,t)}function Wg(e,t,n){const r=Math.max(t-5,0);return mp(n-e(r),t-r)}const Hg=100,Gg=10,Yg=1,Qg=0,Xg=800,Jg=.3,Zg=.3,em={granular:.01,default:2},tm={granular:.005,default:.5},nm=.01,rm=10,om=.05,im=1;function sm({duration:e=Xg,bounce:t=Jg,velocity:n=Qg,mass:r=Yg}){let o,i;$d(e<=zd(rm),"Spring duration must be 10 seconds or less");let s=1-t;s=Fh(om,im,s),e=Fh(nm,rm,Vd(e)),s<1?(o=t=>{const r=t*s,o=r*e;return.001-(r-n)/lm(t,s)*Math.exp(-o)},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=lm(Math.pow(t,2),s);return(.001-o(t)>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let o=1;o<am;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=zd(e),isNaN(a))return{stiffness:Hg,damping:Gg,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const am=12;function lm(e,t){return e*Math.sqrt(1-t*t)}const cm=["duration","bounce"],um=["stiffness","damping","mass"];function dm(e,t){return t.some((t=>void 0!==e[t]))}function hm(e=Zg,t=Jg){const n="object"!=typeof e?{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:h,isResolvedFromDuration:f}=function(e){let t={velocity:Qg,stiffness:Hg,damping:Gg,mass:Yg,isResolvedFromDuration:!1,...e};if(!dm(e,um)&&dm(e,cm))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*Fh(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Yg,stiffness:r,damping:o}}else{const n=sm(e);t={...t,...n,mass:Yg},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Vd(n.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*u)),m=s-i,v=Vd(Math.sqrt(l/u)),y=Math.abs(m)<5;let b;if(r||(r=y?em.granular:em.default),o||(o=y?tm.granular:tm.default),g<1){const e=lm(v,g);b=t=>{const n=Math.exp(-g*v*t);return s-n*((p+g*v*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===g)b=e=>s-Math.exp(-v*e)*(m+(p+v*m)*e);else{const e=v*Math.sqrt(g*g-1);b=t=>{const n=Math.exp(-g*v*t),r=Math.min(e*t,300);return s-n*((p+g*v*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}const w={calculatedDuration:f&&d||null,next:e=>{const t=b(e);if(f)a.done=e>=d;else{let n=0;g<1&&(n=0===e?zd(p):Wg(b,e,t));const i=Math.abs(n)<=r,l=Math.abs(s-t)<=o;a.done=i&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(If(w),Ff),t=Wf((t=>w.next(e*t).value),e,30);return e+"ms "+t}};return w}function fm({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],h={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const g=d+p,m=void 0===s?g:s(g);m!==g&&(p=m-d);const v=e=>-p*Math.exp(-e/r),y=e=>m+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?m:n};let w,x;const k=e=>{var t;(t=h.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(w=e,x=hm({keyframes:[h.value,f(h.value)],velocity:Wg(y,e,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return x||void 0!==w||(t=!0,b(e),k(e)),void 0!==w&&e>=w?x.next(e-w):(!t&&b(e),h)}}}const pm=Sp(.42,0,1,1),gm=Sp(0,0,.58,1),mm=Sp(.42,0,.58,1),vm={linear:Ld,easeIn:pm,easeInOut:mm,easeOut:gm,circIn:Mp,circInOut:Ap,circOut:Op,backIn:jp,backInOut:Dp,backOut:Pp,anticipate:Tp},ym=e=>{if(Vf(e)){Fd(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Sp(t,n,r,o)}return"string"==typeof e?(Fd(void 0!==vm[e],`Invalid easing type '${e}'`),vm[e]):e};function bm(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Fd(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&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=function(e,t,n){const r=[],o=n||Kg,i=e.length-1;for(let s=0;s<i;s++){let n=o(e[s],e[s+1]);if(t){const e=Array.isArray(t)?t[s]||Ld:t;n=Fg(e,n)}r.push(n)}return r}(t,r,o),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);return a[r](qd(e[r],e[r+1],n))};return n?t=>c(Fh(e[0],e[i-1],t)):c}function wm(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(Mg(n,1,qd(0,t,r)))}(t,e.length-1),t}function xm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(ym):ym(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:wm(t),e),a=bm(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||mm)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const km=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Hd.update(t,!0),stop:()=>Gd(t),now:()=>Yd.isProcessing?Yd.timestamp:hp.now()}},Sm={decay:fm,inertia:fm,tween:xm,keyframes:xm,spring:hm},Cm=e=>e/100;class Em extends Tg{constructor(e){super(e),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,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new((null==r?void 0:r.KeyframeResolver)||yg)(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=qf(t)?t:Sm[t]||xm;let a,l;s!==xm&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Fd(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=Fg(Cm,Kg(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=If(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:h,repeatType:f,repeatDelay:p,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),this.currentTime=t?e:null!==this.holdTime?this.holdTime:Math.round(e-this.startTime)*this.speed;const m=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?m<0:m>c;this.currentTime=Math.max(m,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1);Boolean(t%2)&&("reverse"===f?(n=1-n,p&&(n-=p/u)):"mirror"===f&&(b=i)),y=Fh(0,1,n)*u}const w=v?{done:!1,value:a[0]}:b.next(y);s&&(w.value=s(w.value));let{done:x}=w;v||null===l||(x=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return k&&void 0!==r&&(w.value=Dg(a,this.options,r)),g&&g(w.value),k&&this.finish(),w}get duration(){const{resolved:e}=this;return e?Vd(e.calculatedDuration):0}get time(){return Vd(this.currentTime)}set time(e){this.currentTime=e=zd(e),null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Vd(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=km,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&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(e){return this.startTime=0,this.tick(e,!0)}}const Pm=new Set(["opacity","clipPath","filter","transform"]);function jm(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=Qf(a,o);Array.isArray(u)&&(c.easing=u);return e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}const Dm=Id((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Tm={anticipate:Tp,backInOut:Dp,circInOut:Ap};class Mm extends Tg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Eg(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:o,type:i,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;var c;if("string"==typeof o&&Kf()&&o in Tm&&(o=Tm[o]),qf((c=this.options).type)||"spring"===c.type||!Hf(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Em({...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<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,o=u.ease,i="keyframes"}const u=jm(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(zf(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(Dg(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:r,type:i,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Vd(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Vd(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=zd(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Ld;const{animation:n}=t;zf(n,e)}else this.pendingTimeline=e;return Ld}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new Em({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=zd(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Dm()&&n&&Pm.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Om={type:"spring",stiffness:500,damping:25,restSpeed:10},Am={type:"keyframes",duration:.8},Nm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_m=(e,{keyframes:t})=>t.length>2?Am:_h.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Om:Nm;const Rm=(e,t,n,r={},o,i)=>s=>{const a=$f(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=zd(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({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})(a)||(u={...u,..._m(e,u)}),u.duration&&(u.duration=zd(u.duration)),u.repeatDelay&&(u.repeatDelay=zd(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!i&&void 0!==t.get()){const e=Dg(u.keyframes,a);if(void 0!==e)return Hd.update((()=>{u.onUpdate(e),u.onComplete()})),new Lf([])}return!i&&Mm.supports(u)?new Mm(u):new Em(u)};function Lm({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function $m(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 t=e.getValue(d,null!==(i=e.latestValues[d])&&void 0!==i?i:null),r=l[d];if(void 0===r||u&&Lm(u,d))continue;const o={delay:n,...$f(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=xp(e);if(t){const e=window.MotionHandoffAnimation(t,d,Hd);null!==e&&(o.startTime=e,a=!0)}}wp(e,d),t.start(Rm(d,t,r,e.shouldReduceMotion&&cp.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{Hd.update((()=>{a&&function(e,t){const n=Nf(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i)bp(e,a,bf(s=i[a])?s[s.length-1]||0:s);var s}(e,a)}))})),c}function Fm(e,t,n={}){var r;const o=Nf(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all($m(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Im).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Fm(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Im(e,t){return e.sortNodePosition(t)}function qm(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 zm=dh.length;function Vm(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Vm(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<zm;n++){const r=dh[n],o=e.props[r];(ch(o)||!1===o)&&(t[r]=o)}return t}const Bm=[...uh].reverse(),Um=uh.length;function Km(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Fm(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Fm(e,t,n);else{const o="function"==typeof t?Nf(e,t,n.custom):t;r=Promise.all($m(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function Wm(e){let t=Km(e),n=Ym(),r=!0;const o=t=>(n,r)=>{var o;const i=Nf(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,a=Vm(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<Um;t++){const h=Bm[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],g=ch(p),m=h===i?f.isActive:null;!1===m&&(d=t);let v=p===a[h]&&p!==s[h]&&g;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===m||!p&&!f.prevProp||lh(p)||"boolean"==typeof p)continue;const y=Hm(f.prevProp,p);let b=y||h===i&&f.isActive&&!v&&g||t>d&&g,w=!1;const x=Array.isArray(p)?p:[p];let k=x.reduce(o(h),{});!1===m&&(k={});const{prevResolvedValues:S={}}=f,C={...S,...k},E=t=>{b=!0,c.has(t)&&(w=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in C){const t=k[e],n=S[e];if(u.hasOwnProperty(e))continue;let r=!1;r=bf(t)&&bf(n)?!qm(t,n):t!==n,r?null!=t?E(e):c.add(e):void 0!==t&&c.has(e)?E(e):f.protectedKeys[e]=!0}f.prevProp=p,f.prevResolvedValues=k,f.isActive&&(u={...u,...k}),r&&e.blockInitialAnimation&&(b=!1);b&&(!(v&&y)||w)&&l.push(...x.map((e=>({animation:e,options:{type:h}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let h=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),r=!1,h?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Ym(),r=!0}}}function Hm(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!qm(t,e)}function Gm(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ym(){return{animate:Gm(!0),whileInView:Gm(),whileHover:Gm(),whileTap:Gm(),whileDrag:Gm(),whileFocus:Gm(),exit:Gm()}}class Qm{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Xm=0;const Jm={animation:{Feature:class extends Qm{constructor(e){super(e),e.animationState||(e.animationState=Wm(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();lh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Qm{constructor(){super(...arguments),this.id=Xm++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>{t(this.id)}))}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Zm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ev(e){return{point:{x:e.pageX,y:e.pageY}}}function tv(e,t,n,r){return Zm(e,t,(e=>t=>np(t)&&e(t,ev(t)))(n),r)}const nv=(e,t)=>Math.abs(e-t);class rv{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!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 e=sv(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=nv(e.x,t.x),r=nv(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Yd;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ov(t,this.transformPagePoint),Hd.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=sv("pointercancel"===e.type?this.lastMoveEventInfo:ov(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!np(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=ov(ev(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Yd;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,sv(i,this.history)),this.removeListeners=Fg(tv(this.contextWindow,"pointermove",this.handlePointerMove),tv(this.contextWindow,"pointerup",this.handlePointerUp),tv(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Gd(this.updatePoint)}}function ov(e,t){return t?{point:t(e.point)}:e}function iv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sv({point:e},t){return{point:e,delta:iv(e,lv(t)),offset:iv(e,av(t)),velocity:cv(t,.1)}}function av(e){return e[0]}function lv(e){return e[e.length-1]}function cv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=lv(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>zd(t)));)n--;if(!r)return{x:0,y:0};const i=Vd(o.timestamp-r.timestamp);if(0===i)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}function uv(e){return e.max-e.min}function dv(e,t,n,r=.5){e.origin=r,e.originPoint=Mg(t.min,t.max,e.origin),e.scale=uv(n)/uv(t),e.translate=Mg(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function hv(e,t,n,r){dv(e.x,t.x,n.x,r?r.originX:void 0),dv(e.y,t.y,n.y,r?r.originY:void 0)}function fv(e,t,n){e.min=n.min+t.min,e.max=e.min+uv(t)}function pv(e,t,n){e.min=t.min-n.min,e.max=e.min+uv(t)}function gv(e,t,n){pv(e.x,t.x,n.x),pv(e.y,t.y,n.y)}function mv(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function vv(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}}const yv=.35;function bv(e,t,n){return{min:wv(e,t),max:wv(e,n)}}function wv(e,t){return"number"==typeof e?e:e[t]||0}const xv=()=>({x:{min:0,max:0},y:{min:0,max:0}});function kv(e){return[e("x"),e("y")]}function Sv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Cv(e){return void 0===e||1===e}function Ev({scale:e,scaleX:t,scaleY:n}){return!Cv(e)||!Cv(t)||!Cv(n)}function Pv(e){return Ev(e)||jv(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function jv(e){return Dv(e.x)||Dv(e.y)}function Dv(e){return e&&"0%"!==e}function Tv(e,t,n){return n+t*(e-n)}function Mv(e,t,n,r,o){return void 0!==o&&(e=Tv(e,o,r)),Tv(e,n,r)+t}function Ov(e,t=0,n=1,r,o){e.min=Mv(e.min,t,n,r,o),e.max=Mv(e.max,t,n,r,o)}function Av(e,{x:t,y:n}){Ov(e.x,t.translate,t.scale,t.originPoint),Ov(e.y,n.translate,n.scale,n.originPoint)}const Nv=.999999999999,_v=1.0000000000001;function Rv(e,t){e.min=e.min+t,e.max=e.max+t}function Lv(e,t,n,r,o=.5){Ov(e,t,n,Mg(e.min,e.max,o),r)}function $v(e,t){Lv(e.x,t.x,t.scaleX,t.scale,t.originX),Lv(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fv(e,t){return Sv(function(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}}(e.getBoundingClientRect(),t))}const Iv=({current:e})=>e?e.ownerDocument.defaultView:null,qv=new WeakMap;class zv{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new rv(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ev(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(i=n)||"y"===i?Xf[i]?null:(Xf[i]=!0,()=>{Xf[i]=!1}):Xf.x||Xf.y?null:(Xf.x=Xf.y=!0,()=>{Xf.x=Xf.y=!1}),!this.openDragLock))return;var i;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kv((e=>{let t=this.getAxisMotionValue(e).get()||0;if(Uh.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=uv(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&Hd.postRender((()=>o(e,t))),wp(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>kv((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Iv(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&Hd.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Vv(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Mg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Mg(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&vh(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:mv(e.x,n,o),y:mv(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=yv){return!1===e?e=0:!0===e&&(e=yv),{x:bv(e,"left","right"),y:bv(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&kv((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!vh(e))return!1;const n=e.current;Fd(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Fv(e,n),{scroll:o}=t;return o&&(Rv(r.x,o.offset.x),Rv(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:vv(e.x,t.x),y:vv(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Sv(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=kv((s=>{if(!Vv(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c={type:"inertia",velocity:n?e[s]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,c)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return wp(this.visualElement,e),n.start(Rm(e,n,0,t,this.visualElement,!1))}stopAnimation(){kv((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){kv((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){kv((t=>{const{drag:n}=this.getProps();if(!Vv(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Mg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!vh(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};kv((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=uv(e),o=uv(t);return o>r?n=qd(t.min,t.max-r,e.min):r>o&&(n=qd(e.min,e.max-o,t.min)),Fh(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),kv((t=>{if(!Vv(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Mg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;qv.set(this.visualElement,this);const e=tv(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();vh(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Hd.read(t);const o=Zm(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(kv((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=yv,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Vv(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Bv=e=>(t,n)=>{e&&Hd.postRender((()=>e(t,n)))};const Uv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wv={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Kh.test(e))return e;e=parseFloat(e)}return`${Kv(e,t.target.x)}% ${Kv(e,t.target.y)}%`}},Hv={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Jp.parse(e);if(o.length>5)return r;const i=Jp.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Mg(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class Gv extends n.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;!function(e){for(const t in e)Ah[t]=e[t],Dh(t)&&(Ah[t].isCSSVariable=!0)}(Qv),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Uv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Hd.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),xh.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Yv(e){const[r,o]=Md(),i=n.useContext(kd);return t.jsx(Gv,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(kh),isPresent:r,safeToRemove:o})}const Qv={borderRadius:{...Wv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wv,borderTopRightRadius:Wv,borderBottomLeftRadius:Wv,borderBottomRightRadius:Wv,boxShadow:Hv};const Xv=(e,t)=>e.depth-t.depth;class Jv{constructor(){this.children=[],this.isDirty=!1}add(e){fp(this.children,e),this.isDirty=!0}remove(e){pp(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xv),this.isDirty=!1,this.children.forEach(e)}}const Zv=["TopLeft","TopRight","BottomLeft","BottomRight"],ey=Zv.length,ty=e=>"string"==typeof e?parseFloat(e):e,ny=e=>"number"==typeof e||Kh.test(e);function ry(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const oy=sy(0,.5,Op),iy=sy(.5,.95,Ld);function sy(e,t,n){return r=>r<e?0:r>t?1:n(qd(e,t,r))}function ay(e,t){e.min=t.min,e.max=t.max}function ly(e,t){ay(e.x,t.x),ay(e.y,t.y)}function cy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function uy(e,t,n,r,o){return e=Tv(e-=t,1/n,r),void 0!==o&&(e=Tv(e,1/o,r)),e}function dy(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){Uh.test(t)&&(t=parseFloat(t),t=Mg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Mg(i.min,i.max,r);e===i&&(a-=t),e.min=uy(e.min,t,n,a,o),e.max=uy(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const hy=["x","scaleX","originX"],fy=["y","scaleY","originY"];function py(e,t,n,r){dy(e.x,t,hy,n?n.x:void 0,r?r.x:void 0),dy(e.y,t,fy,n?n.y:void 0,r?r.y:void 0)}function gy(e){return 0===e.translate&&1===e.scale}function my(e){return gy(e.x)&&gy(e.y)}function vy(e,t){return e.min===t.min&&e.max===t.max}function yy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function by(e,t){return yy(e.x,t.x)&&yy(e.y,t.y)}function wy(e){return uv(e.x)/uv(e.y)}function xy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ky{constructor(){this.members=[]}add(e){fp(this.members,e),e.scheduleRender()}remove(e){if(pp(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Sy=["","X","Y","Z"],Cy={visibility:"hidden"};let Ey=0;function Py(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function jy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=xp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Hd,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&jy(r)}function Dy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Ey++,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(Oy),this.nodes.forEach(Fy),this.nodes.forEach(Iy),this.nodes.forEach(Ay)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jv)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new gp),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=hp.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Gd(r),e(i-t))};return Hd.read(r,!0),()=>Gd(r)}(r,250),Uv.hasAnimatedSinceResize&&(Uv.hasAnimatedSinceResize=!1,this.nodes.forEach($y))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Ky,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!by(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...$f(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||$y(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Gd(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(qy),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(_y);this.isUpdating||this.nodes.forEach(Ry),this.isUpdating=!1,this.nodes.forEach(Ly),this.nodes.forEach(Ty),this.nodes.forEach(My),this.clearAllSnapshots();const e=hp.now();Yd.delta=Fh(0,1e3/60,e-Yd.timestamp),Yd.timestamp=e,Yd.isProcessing=!0,Qd.update.process(Yd),Qd.preRender.process(Yd),Qd.render.process(Yd),Yd.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ny),this.sharedNodes.forEach(zy)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Hd.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Hd.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||uv(this.snapshot.measuredBox.x)||uv(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!my(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||Pv(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Gy((r=n).x),Gy(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)||this.path.some(Qy))){const{scroll:e}=this.root;e&&(Rv(n.x,e.offset.x),Rv(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(ly(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:o,options:i}=t;t!==this.root&&o&&i.layoutScroll&&(o.wasRoot&&ly(n,e),Rv(n.x,o.offset.x),Rv(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ly(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&$v(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),Pv(e.latestValues)&&$v(n,e.latestValues)}return Pv(this.latestValues)&&$v(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};ly(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!Pv(e.latestValues))continue;Ev(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};ly(r,e.measurePageBox()),py(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return Pv(this.latestValues)&&py(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}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!==Yd.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=Yd.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},gv(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),ly(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fv((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),fv(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ly(this.target,this.layout.layoutBox),Av(this.target,this.targetDelta)):ly(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},gv(this.relativeTargetOrigin,this.target,e.target),ly(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ev(this.parent.latestValues)&&!jv(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===Yd.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;ly(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let i,s;t.x=t.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:o}=i.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&$v(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Av(e,s)),r&&Pv(i.latestValues)&&$v(e,i.latestValues))}t.x<_v&&t.x>Nv&&(t.x=1),t.y<_v&&t.y>Nv&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(cy(this.prevProjectionDelta.x,this.projectionDelta.x),cy(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),hv(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&xy(this.projectionDelta.x,this.prevProjectionDelta.x)&&xy(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Uy));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,g,m;Vy(i.x,e.x,n),Vy(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gv(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),By((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(g=s).x,m=n),By(f.y,p.y,g.y,m),d&&(vy((l=this.relativeTarget).x,(h=d).x)&&vy(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ly(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Mg(0,void 0!==n.opacity?n.opacity:1,oy(r)),e.opacityExit=Mg(void 0!==t.opacity?t.opacity:1,0,iy(r))):i&&(e.opacity=Mg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<ey;s++){const o=`border${Zv[s]}Radius`;let i=ry(t,o),a=ry(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||ny(i)===ny(a)?(e[o]=Math.max(Mg(ty(i),ty(a),r),0),(Uh.test(a)||Uh.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=Mg(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Gd(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Hd.update((()=>{Uv.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Lh(e)?e:yp(e);return r.start(Rm("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Yy(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=uv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=uv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}ly(t,n),$v(t,o),hv(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ky);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Py("z",e,r,this.animationValues);for(let o=0;o<Sy.length;o++)Py(`rotate${Sy[o]}`,e,r,this.animationValues),Py(`skew${Sy[o]}`,e,r,this.animationValues);e.render();for(const o in r)e.setStaticValue(o,r[o]),this.animationValues&&(this.animationValues[o]=r[o]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Cy;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=wf(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=wf(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Pv(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,r.opacity=i.animationValues?i===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const c in Ah){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=Ah[c],o="none"===r.transform?s[c]:e(s[c],i);if(t){const e=t.length;for(let n=0;n<e;n++)r[t[n]]=o}else n?this.options.visualElement.renderState.vars[c]=o:r[c]=o}return this.options.layoutId&&(r.pointerEvents=i===this?wf(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(_y),this.root.sharedNodes.clear()}}}function Ty(e){e.updateLayout()}function My(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?kv((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=uv(r);r.min=t[e].min,r.max=r.min+o})):Yy(o,n.layoutBox,t)&&kv((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=uv(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};hv(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?hv(a,e.applyTransform(r,!0),n.measuredBox):hv(a,t,n.layoutBox);const l=!my(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};gv(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};gv(a,t,i.layoutBox),by(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Oy(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ay(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ny(e){e.clearSnapshot()}function _y(e){e.clearMeasurements()}function Ry(e){e.isLayoutDirty=!1}function Ly(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $y(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fy(e){e.resolveTargetDelta()}function Iy(e){e.calcProjection()}function qy(e){e.resetSkewAndRotation()}function zy(e){e.removeLeadSnapshot()}function Vy(e,t,n){e.translate=Mg(t.translate,0,n),e.scale=Mg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function By(e,t,n,r){e.min=Mg(t.min,n.min,r),e.max=Mg(t.max,n.max,r)}function Uy(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Ky={duration:.45,ease:[.4,0,.1,1]},Wy=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hy=Wy("applewebkit/")&&!Wy("chrome/")?Math.round:Ld;function Gy(e){e.min=Hy(e.min),e.max=Hy(e.max)}function Yy(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=wy(t),o=wy(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function Qy(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Xy=Dy({attachResizeListener:(e,t)=>Zm(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jy={current:void 0},Zy=Dy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Jy.current){const e=new Xy({});e.mount(window),e.setOptions({layoutScroll:!0}),Jy.current=e}return Jy.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),eb={pan:{Feature:class extends Qm{constructor(){super(...arguments),this.removePointerDownListener=Ld}onPointerDown(e){this.session=new rv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iv(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Bv(e),onStart:Bv(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Hd.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=tv(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Qm{constructor(e){super(e),this.removeGroupControls=Ld,this.removeListeners=Ld,this.controls=new zv(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ld}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Zy,MeasureLayout:Yv}};function tb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&Hd.postRender((()=>o(t,ev(t))))}function nb(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&Hd.postRender((()=>o(t,ev(t))))}const rb=new WeakMap,ob=new WeakMap,ib=e=>{const t=rb.get(e.target);t&&t(e)},sb=e=>{e.forEach(ib)};function ab(e,t,n){const r=function({root:e,...t}){const n=e||document;ob.has(n)||ob.set(n,{});const r=ob.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(sb,{root:e,...t})),r[o]}(t);return rb.set(e,n),r.observe(e),()=>{rb.delete(e),r.unobserve(e)}}const lb={some:0,all:1};const cb={inView:{Feature:class extends Qm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e;return ab(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:lb[r]},(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Qm{mount(){const{current:e}=this.node;e&&(this.unmount=lp(e,((e,t)=>(nb(this.node,t,"Start"),(e,{success:t})=>nb(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Qm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(LB){e=!0}e&&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=Fg(Zm(this.node.current,"focus",(()=>this.onFocus())),Zm(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Qm{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=Zf(e,n),s=e=>{if(!ep(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{ep(e)&&(r(e),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,o)};return r.forEach((e=>{e.addEventListener("pointerenter",s,o)})),i}(e,((e,t)=>(tb(this.node,t,"Start"),e=>tb(this.node,e,"End")))))}unmount(){}}}},ub={layout:{ProjectionNode:Zy,MeasureLayout:Yv}},db={current:null},hb={current:!1};const fb=[...Sg,Bp,Jp],pb=new WeakMap;const gb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mb{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yg,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 e=hp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Hd.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=i;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=hh(t),this.isVariantNode=fh(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const h in d){const e=d[h];void 0!==a[h]&&Lh(e)&&e.set(a[h],!1)}}mount(e){this.current=e,pb.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),hb.current||function(){if(hb.current=!0,Nd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>db.current=e.matches;e.addListener(t),t()}else db.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||db.current),"production"!==process.env.NODE_ENV&&ih(!0!==this.shouldReduceMotion,"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(),Gd(this.notifyUpdate),Gd(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=_h.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Hd.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Zd){const t=Zd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<gb.length;n++){const t=gb[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Lh(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&ih("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(Lh(i))e.addValue(r,yp(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,yp(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=yp(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(bg(r)||Np(r))?r=parseFloat(r):!fb.find(kg(r))&&Jp.test(t)&&(r=ig(e,t)),this.setBaseTarget(e,Lh(r)?r.get():r)),Lh(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=yf(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Lh(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new gp),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class vb extends mb{constructor(){super(...arguments),this.KeyframeResolver=Eg}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Lh(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class yb extends vb{constructor(){super(...arguments),this.type="html",this.renderInstance=Pf}readValueFromInstance(e,t){if(_h.has(t)){const e=og(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(Dh(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Fv(e,t)}build(e,t,n){tf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Sf(e,t,n)}}class bb extends vb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xv,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Ef(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(_h.has(t)){const e=og(t);return e&&e.default||0}return t=jf.has(t)?t:bh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Tf(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Hd.postRender(this.updateDimensions)}build(e,t,n){hf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Df(e,t,0,r)}mount(e){this.isSVGTag=pf(e.tagName),super.mount(e)}}const wb=sh(Af({...Jm,...cb,...eb,...ub},((e,t)=>lf(e)?new bb(t):new yb(t,{allowProjection:e!==n.Fragment})))),xb=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),kb=({size:e=35,color:r="black",speed:o=.9,strokeWidth:i=3.5,text:s,textSpeed:a=2e3})=>{const[l,c]=n.useState(0),u=Array.isArray(s)?s:s?[s]:[];return n.useEffect((()=>{if(u.length<=1)return;if(l>=u.length-1)return;const e=setInterval((()=>{c((e=>e<u.length-1?e+1:e))}),a);return()=>clearInterval(e)}),[u.length,a,l]),t.jsx("div",{className:"flex flex-col justify-center items-center h-full",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsxs("div",{className:"loader-container",style:{"--uib-size":`${e}px`,"--uib-color":r,"--uib-speed":`${o}s`,"--uib-stroke":`${i}px`},children:[t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"})]}),u.length>0&&t.jsx("div",{className:"text-center text-sm text-muted-foreground animate-fade-in",children:t.jsx(xb,{children:u[l]})},l),t.jsx("style",{children:"\n .loader-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--uib-size);\n width: var(--uib-size);\n }\n .line {\n position: absolute;\n top: calc(50% - var(--uib-stroke) / 2);\n left: 0;\n height: var(--uib-stroke);\n width: 100%;\n border-radius: calc(var(--uib-stroke) / 2);\n background-color: var(--uib-color);\n animation: rotate var(--uib-speed) ease-in-out infinite;\n transition: background-color 0.3s ease;\n }\n .line:nth-child(1) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n }\n .line:nth-child(2) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n opacity: 0.8;\n }\n .line:nth-child(3) {\n animation-delay: calc(var(--uib-speed) * -0.3);\n opacity: 0.6;\n }\n .line:nth-child(4) {\n animation-delay: calc(var(--uib-speed) * -0.225);\n opacity: 0.4;\n }\n .line:nth-child(5) {\n animation-delay: calc(var(--uib-speed) * -0.15);\n opacity: 0.2;\n }\n .line:nth-child(6) {\n animation-delay: calc(var(--uib-speed) * -0.075);\n opacity: 0.1;\n }\n @keyframes rotate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(180deg);\n }\n }\n .animate-fade-in {\n animation: fadeIn 0.5s ease-in-out;\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "})]})})},Sb="/segments",Cb="/automations",Eb="/communication-groups",Pb=async(e,t)=>(await tu(`${Cb}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,jb=e=>{const t=pn({queryKey:["automations",e],queryFn:()=>(async e=>(await tu(`${Cb}/${e}`)).data)(e)});return{automation:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomation:t.refetch}},Db=e=>{const t=pn({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await tu(`${Cb}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},Tb=()=>{const e=sn(),t=gn({mutationFn:e=>(async e=>(await tu(Cb,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["automations"]})}});return{createAutomation:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess}},Mb=e=>{const t=sn(),n=gn({mutationFn:t=>Pb(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}};var Ob=(e=>(e.ONE_TIME="one_time",e))(Ob||{}),Ab=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.SCHEDULED="scheduled",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(Ab||{});
10
+ /**
11
+ * @license lucide-react v0.464.0 - ISC
12
+ *
13
+ * This source code is licensed under the ISC license.
14
+ * See the LICENSE file in the root directory of this source tree.
15
+ */
16
+ const Nb=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim()
17
+ /**
18
+ * @license lucide-react v0.464.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */;var _b={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"};
23
+ /**
24
+ * @license lucide-react v0.464.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */const Rb=n.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:s,iconNode:a,...l},c)=>n.createElement("svg",{ref:c,..._b,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:Nb("lucide",i),...l},[...a.map((([e,t])=>n.createElement(e,t))),...Array.isArray(s)?s:[s]]))),Lb=(e,t)=>{const r=n.forwardRef((({className:r,...o},i)=>{return n.createElement(Rb,{ref:i,iconNode:t,className:Nb(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var s}));return r.displayName=`${e}`,r},$b=Lb("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"}]]),Fb=Lb("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ib=Lb("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),qb=Lb("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),zb=Lb("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Vb=Lb("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Bb=Lb("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Ub=Lb("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Kb=Lb("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Wb=Lb("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"}]]),Hb=Lb("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gb={PrimaryButton:"bg-purple-600 text-white rounded-lg",PrimaryButtonHover:"hover:bg-purple-700",PrimaryButtonDisabled:"opacity-50 cursor-not-allowed",SecondaryButton:"border bg-gray-100 text-gray-800 rounded-lg",SecondaryButtonHover:"hover:bg-gray-200"},Yb={CloseButton:Hb,DropdownMenuTrigger:Ib,UserIcon:Wb,ScheduleButton:$b,SendButton:Kb,BackButton:qb,NextButton:zb},Qb=e=>({...Gb,...e||{}}),Xb=e=>({...Yb,...e||{}});
29
+ /**
30
+ * @license lucide-react v0.464.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */function Jb(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Jb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zb(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Jb(e))&&(r&&(r+=" "),r+=t);return r}const ew=e=>{const t=ow(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),tw(n,t)||rw(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},tw=(e,t)=>{var n;if(0===e.length)return t.classGroupId;const r=t.nextPart.get(e[0]),o=r?tw(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return null==(n=t.validators.find((({validator:e})=>e(i))))?void 0:n.classGroupId},nw=/^\[(.+)\]$/,rw=e=>{if(nw.test(e)){const t=nw.exec(e)[1],n=null==t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ow=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return lw(Object.entries(e.classGroups),n).forEach((([e,n])=>{iw(n,r,e,t)})),r},iw=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return aw(e)?void iw(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{iw(o,sw(t,e),n,r)}))}else{(""===e?t:sw(t,e)).classGroupId=n}}))},sw=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},aw=e=>e.isThemeGetter,lw=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,cw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},uw=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let d=0;d<e.length;d++){let c=e[d];if(0===a){if(c===o&&(r||e.slice(d,d+i)===t)){n.push(e.slice(l,d)),l=d+i;continue}if("/"===c){s=d;continue}}"["===c?a++:"]"===c&&a--}const c=0===n.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:s&&s>l?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},dw=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},hw=/\s+/;function fw(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=pw(e))&&(r&&(r+=" "),r+=t);return r}const pw=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=pw(e[r]))&&(n&&(n+=" "),n+=t);return n};function gw(e,...t){let n,r,o,i=function(a){const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:cw(e.cacheSize),parseClassName:uw(e),...ew(e)}))(l),r=n.cache.get,o=n.cache.set,i=s,s(a)};function s(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(hw);let a="";for(let l=s.length-1;l>=0;l-=1){const e=s[l],{modifiers:t,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(e);let h=Boolean(d),f=r(h?u.substring(0,d):u);if(!f){if(!h){a=e+(a.length>0?" "+a:a);continue}if(f=r(u),!f){a=e+(a.length>0?" "+a:a);continue}h=!1}const p=dw(t).join(":"),g=c?p+"!":p,m=g+f;if(i.includes(m))continue;i.push(m);const v=o(f,h);for(let n=0;n<v.length;++n)i.push(g+v[n]);a=e+(a.length>0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(fw.apply(null,arguments))}}const mw=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},vw=/^\[(?:([a-z-]+):)?(.+)\]$/i,yw=/^\d+\/\d+$/,bw=new Set(["px","full","screen"]),ww=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xw=/\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$/,kw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Sw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Cw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ew=e=>jw(e)||bw.has(e)||yw.test(e),Pw=e=>qw(e,"length",zw),jw=e=>Boolean(e)&&!Number.isNaN(Number(e)),Dw=e=>qw(e,"number",jw),Tw=e=>Boolean(e)&&Number.isInteger(Number(e)),Mw=e=>e.endsWith("%")&&jw(e.slice(0,-1)),Ow=e=>vw.test(e),Aw=e=>ww.test(e),Nw=new Set(["length","size","percentage"]),_w=e=>qw(e,Nw,Vw),Rw=e=>qw(e,"position",Vw),Lw=new Set(["image","url"]),$w=e=>qw(e,Lw,Uw),Fw=e=>qw(e,"",Bw),Iw=()=>!0,qw=(e,t,n)=>{const r=vw.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},zw=e=>xw.test(e)&&!kw.test(e),Vw=()=>!1,Bw=e=>Sw.test(e),Uw=e=>Cw.test(e),Kw=gw((()=>{const e=mw("colors"),t=mw("spacing"),n=mw("blur"),r=mw("brightness"),o=mw("borderColor"),i=mw("borderRadius"),s=mw("borderSpacing"),a=mw("borderWidth"),l=mw("contrast"),c=mw("grayscale"),u=mw("hueRotate"),d=mw("invert"),h=mw("gap"),f=mw("gradientColorStops"),p=mw("gradientColorStopPositions"),g=mw("inset"),m=mw("margin"),v=mw("opacity"),y=mw("padding"),b=mw("saturate"),w=mw("scale"),x=mw("sepia"),k=mw("skew"),S=mw("space"),C=mw("translate"),E=()=>["auto",Ow,t],P=()=>[Ow,t],j=()=>["",Ew,Pw],D=()=>["auto",jw,Ow],T=()=>["","0",Ow],M=()=>[jw,Ow];return{cacheSize:500,separator:":",theme:{colors:[Iw],spacing:[Ew,Pw],blur:["none","",Aw,Ow],brightness:M(),borderColor:[e],borderRadius:["none","","full",Aw,Ow],borderSpacing:P(),borderWidth:j(),contrast:M(),grayscale:T(),hueRotate:M(),invert:T(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Mw,Pw],inset:E(),margin:E(),opacity:M(),padding:P(),saturate:M(),scale:M(),sepia:T(),skew:M(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Ow]}],container:["container"],columns:[{columns:[Aw]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Ow]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tw,Ow]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ow]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Tw,Ow]}],"grid-cols":[{"grid-cols":[Iw]}],"col-start-end":[{col:["auto",{span:["full",Tw,Ow]},Ow]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Iw]}],"row-start-end":[{row:["auto",{span:[Tw,Ow]},Ow]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ow]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ow]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ow,t]}],"min-w":[{"min-w":[Ow,t,"min","max","fit"]}],"max-w":[{"max-w":[Ow,t,"none","full","min","max","fit","prose",{screen:[Aw]},Aw]}],h:[{h:[Ow,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ow,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ow,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ow,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Aw,Pw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dw]}],"font-family":[{font:[Iw]}],"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",Ow]}],"line-clamp":[{"line-clamp":["none",jw,Dw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ew,Ow]}],"list-image":[{"list-image":["none",Ow]}],"list-style-type":[{list:["none","disc","decimal",Ow]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ew,Pw]}],"underline-offset":[{"underline-offset":["auto",Ew,Ow]}],"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:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ow]}],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",Ow]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Rw]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_w]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$w]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],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":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","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":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"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:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Ew,Ow]}],"outline-w":[{outline:[Ew,Pw]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ew,Pw]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Aw,Fw]}],"shadow-color":[{shadow:[Iw]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Aw,Ow]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[x]}],"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":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"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",Ow]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Ow]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ow]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Tw,Ow]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"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",Ow]}],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",Ow]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Ow]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ew,Pw,Dw]}],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 Ww(...e){return Kw(Zb(e))}const Hw=({onClose:e,tailwindClassDefinitions:n,currentStep:r,setCurrentStep:o,isDisabled:i,createAutomation:s})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx("button",{className:Ww("px-4 py-2",null==n?void 0:n.SecondaryButton,null==n?void 0:n.SecondaryButtonHover),onClick:()=>{if("choose-automation-type"===r)null==e||e(!1);else{if("set-automation-name"!==r)throw new Error("Invalid step");o("choose-automation-type")}},children:"choose-automation-type"===r?"Cancel":"Back"}),t.jsx("button",{className:Ww("px-4 py-2",null==n?void 0:n.PrimaryButton,null==n?void 0:n.PrimaryButtonHover,i&&(null==n?void 0:n.PrimaryButtonDisabled)),onClick:()=>{i||s()},disabled:i,children:"set-automation-name"===r?"Create":"Next"})]})}),Gw="mb-4",Yw="text-lg font-medium mb-2",Qw="text-sm text-gray-600",Xw="absolute top-3 right-3 bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full",Jw=()=>t.jsxs("div",{children:[t.jsx("div",{className:Gw,children:"📨"}),t.jsx("h3",{className:Yw,children:"One-Time Broadcast"}),t.jsx("p",{className:Qw,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),Zw=()=>t.jsxs("div",{children:[t.jsx("div",{className:Xw,children:"Coming Soon"}),t.jsx("div",{className:Gw,children:"✉️"}),t.jsx("h3",{className:Yw,children:"Patron Enters a List"}),t.jsx("p",{className:Qw,children:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria."})]}),ex=()=>t.jsxs("div",{children:[t.jsx("div",{className:Xw,children:"Coming Soon"}),t.jsx("div",{className:Gw,children:"📅"}),t.jsx("h3",{className:Yw,children:"Date Milestone"}),t.jsx("p",{className:Qw,children:"Schedules around specific dates in your contact data, like birthdays, membership anniversaries, or renewal dates."})]}),tx=()=>t.jsxs("div",{children:[t.jsx("div",{className:Xw,children:"Coming Soon"}),t.jsx("div",{className:Gw,children:"📬"}),t.jsx("h3",{className:Yw,children:"Realtime Activity"}),t.jsx("p",{className:Qw,children:"Responds to immediate actions your contacts take, like abandoned carts, form submissions, or appointment bookings."})]}),nx="text-3xl mb-8",rx="grid grid-cols-2 gap-6",ox="relative p-6 rounded-lg border border-gray-200 cursor-pointer flex flex-col items-center text-center hover:border-indigo-500 transition-colors",ix="opacity-60 cursor-not-allowed hover:border-gray-200",sx="relative p-6 border border-gray-200 rounded-lg",ax=({onNext:e})=>t.jsxs("div",{className:sx,children:[t.jsx("h1",{className:nx,children:"Choose Your Automation Type"}),t.jsxs("div",{className:rx,children:[t.jsx("div",{className:ox,onClick:()=>{e(Ob.ONE_TIME)},children:t.jsx(Jw,{})}),t.jsx("div",{className:`${ox} ${ix}`,children:t.jsx(Zw,{})}),t.jsx("div",{className:`${ox} ${ix}`,children:t.jsx(ex,{})}),t.jsx("div",{className:`${ox} ${ix}`,children:t.jsx(tx,{})})]})]});function lx(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const cx=({selectedType:e,setAutomationName:n,automationName:r})=>t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 max-w-lg mx-auto",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Name Your Automation"}),t.jsxs("div",{className:"w-full space-y-4",children:[t.jsx("div",{className:"bg-gray-50 p-4 rounded-lg items-center justify-center text-center",children:(()=>{if(e===Ob.ONE_TIME)return t.jsx(Jw,{});throw lx(e,Ob)})()}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"automationName",className:"block text-sm font-medium text-gray-700",children:"Automation Name"}),t.jsx("input",{id:"automationName",type:"text",value:r,onChange:e=>n(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500 shadow-sm",placeholder:"Enter a descriptive name...",autoFocus:!0}),t.jsx("p",{className:"text-sm text-gray-500",children:"Choose a name that helps you identify this automation's purpose"})]})]})]}),ux=()=>{const e=sn(),t=gn({mutationFn:e=>(async e=>(await tu(Sb,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=pn({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await tu(`${Sb}/conditions`,{method:"GET"})).data)()});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}},dx=()=>{const e=pn({queryKey:["segments"],queryFn:()=>(async()=>(await tu(`${Sb}`)).data)()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}},hx=e=>{const t=pn({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await tu(`${Sb}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{count:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchCount:t.refetch}},fx=({onClose:e,setClickedCreate:n,isDisabled:r,tailwindClassDefinitions:o})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx("button",{className:Ww("px-4 py-2",null==o?void 0:o.SecondaryButton,null==o?void 0:o.SecondaryButtonHover),onClick:()=>null==e?void 0:e(!1),children:"Cancel"}),t.jsx("button",{className:Ww("px-4 py-2",null==o?void 0:o.PrimaryButton,null==o?void 0:o.PrimaryButtonHover,r&&(null==o?void 0:o.PrimaryButtonDisabled)),onClick:()=>{n(!0)},disabled:r,children:"Create"})]})}),px=({conditionNameToOperators:e,setConditionState:r,conditionState:o,tailwindClassDefinitions:i,iconDefinitions:s})=>{const[a,l]=n.useState(o.map((e=>e.value.map((e=>e.includes(",")?`"${e}"`:e)).join(", ")))),c=(e,t,n)=>{const i=[...o];if("value"===t){const r=[...a];r[e]=n,l(r);const o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map((e=>{const t=e.trim(),n=t.match(/^"(.*)"$/);return n?n[1]:t})).filter((e=>""!==e));i[e]={...i[e],[t]:o}}else i[e]={...i[e],[t]:n};r(i)};return t.jsxs("div",{className:"flex flex-col gap-2 ",children:[t.jsx(Rd,{mode:"popLayout",children:o.map(((n,i)=>t.jsxs(wb.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 ${o.length>1?"grid-cols-[1fr_1fr_1fr_auto]":"grid-cols-[1fr_1fr_1fr]"} gap-4`,children:[t.jsx("select",{className:"p-2 border rounded-lg",value:n.field,onChange:e=>c(i,"field",e.target.value),children:Object.keys(e).map((e=>t.jsx("option",{children:e},e)))}),t.jsx("select",{className:"p-2 border rounded-lg",value:n.operator,onChange:e=>c(i,"operator",e.target.value),children:e[n.field].map((e=>t.jsx("option",{children:e},e)))}),t.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:a[i]||"",onChange:e=>c(i,"value",e.target.value)}),o.length>1&&t.jsx(wb.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>(e=>{const t=o.filter(((t,n)=>n!==e));r(t);const n=a.filter(((t,n)=>n!==e));l(n)})(i),className:"p-2 hover:text-red-600","aria-label":"Delete condition",children:t.jsx(s.CloseButton,{})})]},i)))}),t.jsx("div",{children:t.jsxs(wb.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>{const t={field:Object.keys(e)[0],operator:e[Object.keys(e)[0]][0],value:[]};r([...o,t]),l([...a,""])},className:Ww("flex items-center px-4 py-2 ",null==i?void 0:i.SecondaryButton,null==i?void 0:i.SecondaryButtonHover),children:[t.jsx("span",{className:"mr-2",children:"+"}),"Add Condition"]})})]})},gx=({nameAndDescriptionState:e,setNameAndDescriptionState:n})=>t.jsx("div",{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Name"}),t.jsx("input",{type:"text",placeholder:"Segment Name",className:"w-full p-2 border rounded-lg",value:e.name,onChange:t=>n({...e,name:t.target.value})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Description"}),t.jsx("input",{type:"text",placeholder:"Description",className:"w-full p-2 border rounded-lg",value:e.description,onChange:t=>n({...e,description:t.target.value})})]})]})}),mx="relative p-6 border border-gray-200 rounded-lg",vx=({onClose:e,tailwindClassDefinitions:r,iconDefinitions:o})=>{const{segmentsConditions:i,isLoading:s,createSegment:a,isCreating:l}=ux(),[c,u]=n.useState(!1),d=Qb(r),h=Xb(o),[f,p]=n.useState([]),[g,m]=n.useState({name:"",description:""}),[v,y]=n.useState({}),b=g.name&&g.description&&f.some((e=>e.field&&e.operator&&e.value.length>0));n.useEffect((()=>{i&&(y(i.conditions.reduce(((e,t)=>(e[t.name]=t.operators,e)),{})),p([{field:i.conditions[0].name,operator:i.conditions[0].operators[0],value:[]}]))}),[i]);return s?t.jsx("div",{className:mx,children:t.jsx(kb,{text:["Fetching Segment data","Finishing up"]})}):l||c?t.jsx("div",{className:mx,children:t.jsx(kb,{text:["Creating Segment","Finishing up"]})}):t.jsxs("div",{className:mx,children:[t.jsx("button",{onClick:()=>null==e?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:t.jsx(h.CloseButton,{})}),t.jsxs("div",{className:"space-y-6",children:[t.jsx(gx,{nameAndDescriptionState:g,setNameAndDescriptionState:m}),t.jsx(px,{conditionNameToOperators:v,conditionState:f,setConditionState:p,tailwindClassDefinitions:d,iconDefinitions:h}),t.jsx(fx,{onClose:e,isDisabled:!b,setClickedCreate:()=>{if(!g.name||!g.description)return void(null==e||e("error"));u(!0);a({name:g.name,description:g.description,conditions:f},{onSuccess:t=>{t.id?null==e||e(t.id):null==e||e("error")},onError:()=>{null==e||e("error")},onSettled:()=>{p([]),m({name:"",description:""})}})},tailwindClassDefinitions:d})]})]})};function yx(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function bx(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>lt.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return lt.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const i=lt.createContext(o),s=r.length;r=[...r,o];const a=n=>{var r;const{scope:o,children:a,...l}=n,c=(null==(r=null==o?void 0:o[e])?void 0:r[s])||i,u=lt.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:a})};return a.displayName=n+"Provider",[a,function(t,r){var a;const l=(null==(a=null==r?void 0:r[e])?void 0:a[s])||i,c=lt.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},wx(o,...n)]}function wx(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return lt.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function xx(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function kx(...e){return t=>{let n=!1;const r=e.map((e=>{const r=xx(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():xx(e[t],null)}}}}function Sx(...e){return lt.useCallback(kx(...e),e)}var Cx=lt.forwardRef(((e,n)=>{const{children:r,...o}=e,i=lt.Children.toArray(r),s=i.find(jx);if(s){const e=s.props.children,r=i.map((t=>t===s?lt.Children.count(e)>1?lt.Children.only(null):lt.isValidElement(e)?e.props.children:null:t));return t.jsx(Ex,{...o,ref:n,children:lt.isValidElement(e)?lt.cloneElement(e,void 0,r):null})}return t.jsx(Ex,{...o,ref:n,children:r})}));Cx.displayName="Slot";var Ex=lt.forwardRef(((e,t)=>{const{children:n,...r}=e;if(lt.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return lt.cloneElement(n,{...Dx(r,n.props),ref:t?kx(t,e):e})}return lt.Children.count(n)>1?lt.Children.only(null):null}));Ex.displayName="SlotClone";var Px=({children:e})=>t.jsx(t.Fragment,{children:e});function jx(e){return lt.isValidElement(e)&&e.type===Px}function Dx(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Tx(e){const r=e+"CollectionProvider",[o,i]=bx(r),[s,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),a=n.useRef(new Map).current;return t.jsx(s,{scope:r,itemMap:a,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=Sx(n,a(c,r).collectionRef);return t.jsx(Cx,{ref:i,children:o})}));u.displayName=c;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=n.forwardRef(((e,r)=>{const{scope:o,children:i,...s}=e,l=n.useRef(null),c=Sx(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(Cx,{[h]:"",ref:c,children:i})}));return f.displayName=d,[{Provider:l,Slot:u,ItemSlot:f},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}var Mx=Boolean(null==globalThis?void 0:globalThis.document)?lt.useLayoutEffect:()=>{},Ox=lt["useId".toString()]||(()=>{}),Ax=0;function Nx(e){const[t,n]=lt.useState(Ox());return Mx((()=>{n((e=>null!=e?e:String(Ax++)))}),[e]),e||(t?`radix-${t}`:"")}var _x=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=lt.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?Cx:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});function Rx(e,t){e&&ct.flushSync((()=>e.dispatchEvent(t)))}function Lx(e){const t=lt.useRef(e);return lt.useEffect((()=>{t.current=e})),lt.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function $x({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=lt.useState(e),[r]=n,o=lt.useRef(r),i=Lx(t);return lt.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=Lx(n);return[s,lt.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}var Fx=lt.createContext(void 0);function Ix(e){const t=lt.useContext(Fx);return e||t||"ltr"}var qx="rovingFocusGroup.onEntryFocus",zx={bubbles:!1,cancelable:!0},Vx="RovingFocusGroup",[Bx,Ux,Kx]=Tx(Vx),[Wx,Hx]=bx(Vx,[Kx]),[Gx,Yx]=Wx(Vx),Qx=lt.forwardRef(((e,n)=>t.jsx(Bx.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Bx.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Xx,{...e,ref:n})})})));Qx.displayName=Vx;var Xx=lt.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=lt.useRef(null),p=Sx(n,f),g=Ix(s),[m=null,v]=$x({prop:a,defaultProp:l,onChange:c}),[y,b]=lt.useState(!1),w=Lx(u),x=Ux(r),k=lt.useRef(!1),[S,C]=lt.useState(0);return lt.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(qx,w),()=>e.removeEventListener(qx,w)}),[w]),t.jsx(Gx,{scope:r,orientation:o,dir:g,loop:i,currentTabStopId:m,onItemFocus:lt.useCallback((e=>v(e)),[v]),onItemShiftTab:lt.useCallback((()=>b(!0)),[]),onFocusableItemAdd:lt.useCallback((()=>C((e=>e+1))),[]),onFocusableItemRemove:lt.useCallback((()=>C((e=>e-1))),[]),children:t.jsx(_x.div,{tabIndex:y||0===S?-1:0,"data-orientation":o,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:yx(e.onMouseDown,(()=>{k.current=!0})),onFocus:yx(e.onFocus,(e=>{if(e.target===e.currentTarget&&!k.current&&!y){const t=new CustomEvent(qx,zx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));tk([e.find((e=>e.active)),e.find((e=>e.id===m)),...e].filter(Boolean).map((e=>e.ref.current)),d)}}k.current=!1})),onBlur:yx(e.onBlur,(()=>b(!1)))})})})),Jx="RovingFocusGroupItem",Zx=lt.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:s,...a}=e,l=Nx(),c=s||l,u=Yx(Jx,r),d=u.currentTabStopId===c,h=Ux(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return lt.useEffect((()=>{if(o)return f(),()=>p()}),[o,f,p]),t.jsx(Bx.ItemSlot,{scope:r,id:c,focusable:o,active:i,children:t.jsx(_x.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:n,onMouseDown:yx(e.onMouseDown,(e=>{o?u.onItemFocus(c):e.preventDefault()})),onFocus:yx(e.onFocus,(()=>u.onItemFocus(c))),onKeyDown:yx(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:ek[r]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=h().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=u.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>tk(o)))}var n,r}))})})}));Zx.displayName=Jx;var ek={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tk(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var nk=Qx,rk=Zx;var ok=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=lt.useState(),r=lt.useRef({}),o=lt.useRef(e),i=lt.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return lt.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return lt.useEffect((()=>{const e=ik(r.current);i.current="mounted"===a?e:"none"}),[a]),Mx((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=ik(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),Mx((()=>{var e;if(t){let n;const s=null!=(e=t.ownerDocument.defaultView)?e:window,a=e=>{const i=ik(r.current).includes(e.animationName);if(e.target===t&&i&&(l("ANIMATION_END"),!o.current)){const e=t.style.animationFillMode;t.style.animationFillMode="forwards",n=s.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=e)}))}},c=e=>{e.target===t&&(i.current=ik(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{s.clearTimeout(n),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:lt.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):lt.Children.only(n),i=Sx(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?lt.cloneElement(o,{ref:i}):null};function ik(e){return(null==e?void 0:e.animationName)||"none"}ok.displayName="Presence";var sk="Tabs",[ak,lk]=bx(sk,[Hx]),ck=Hx(),[uk,dk]=ak(sk),hk=lt.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Ix(l),[h,f]=$x({prop:o,onChange:i,defaultProp:s});return t.jsx(uk,{scope:r,baseId:Nx(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(_x.div,{dir:d,"data-orientation":a,...u,ref:n})})}));hk.displayName=sk;var fk="TabsList",pk=lt.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=dk(fk,r),a=ck(r);return t.jsx(nk,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(_x.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));pk.displayName=fk;var gk="TabsTrigger",mk=lt.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=dk(gk,r),l=ck(r),c=bk(a.baseId,o),u=wk(a.baseId,o),d=o===a.value;return t.jsx(rk,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(_x.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:n,onMouseDown:yx(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:yx(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:yx(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));mk.displayName=gk;var vk="TabsContent",yk=lt.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:i,children:s,...a}=e,l=dk(vk,r),c=bk(l.baseId,o),u=wk(l.baseId,o),d=o===l.value,h=lt.useRef(d);return lt.useEffect((()=>{const e=requestAnimationFrame((()=>h.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(ok,{present:i||d,children:({present:r})=>t.jsx(_x.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!r,id:u,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&s})})}));function bk(e,t){return`${e}-trigger-${t}`}function wk(e,t){return`${e}-content-${t}`}yk.displayName=vk;var xk=pk,kk=mk,Sk=yk;const Ck=hk,Ek=lt.forwardRef((({className:e,...n},r)=>t.jsx(xk,{ref:r,className:Ww("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));Ek.displayName=xk.displayName;const Pk=lt.forwardRef((({className:e,...n},r)=>t.jsx(kk,{ref:r,className:Ww("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n})));Pk.displayName=kk.displayName;const jk=lt.forwardRef((({className:e,...n},r)=>t.jsx(Sk,{ref:r,className:Ww("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));jk.displayName=Sk.displayName;const Dk=()=>t.jsx("div",{children:"Coming Soon"}),Tk=lt.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Ww("w-full caption-bottom text-sm",e),...n})})));Tk.displayName="Table";const Mk=lt.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Ww("[&_tr]:border-b",e),...n})));Mk.displayName="TableHeader";const Ok=lt.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Ww("[&_tr:last-child]:border-0",e),...n})));Ok.displayName="TableBody";const Ak=lt.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Ww("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));Ak.displayName="TableRow";const Nk=lt.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Ww("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));Nk.displayName="TableHead";const _k=lt.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Ww("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));_k.displayName="TableCell";const Rk="flex flex-col items-center justify-center h-full",Lk=({automationId:e})=>{const{recipients:n,isLoading:r,fetchError:o}=Db(e);if(r)return t.jsx("div",{className:Rk,children:t.jsx(kb,{text:["Fetching Recipients","Finishing up"]})});if(o)return t.jsxs("div",{children:["Error: ",o.message]});if(!n||0===n.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(Yb.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const i="30%",s="35%",a="35%";return t.jsx("div",{className:"relative",children:t.jsxs(Tk,{children:[t.jsx(Mk,{children:t.jsxs(Ak,{children:[t.jsx(Nk,{style:{width:i},children:"Name"}),t.jsx(Nk,{style:{width:s},children:"Email"}),t.jsx(Nk,{style:{width:a},children:"Phone"})]})}),t.jsx(Ok,{children:n.recipients.map((e=>t.jsxs(Ak,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(_k,{style:{width:i},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(_k,{style:{width:s},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(_k,{style:{width:a},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})})};function $k(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Fk(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Ik=6048e5;let qk={};function zk(){return qk}function Vk(e,t){var n,r,o,i,s,a,l,c;const u=zk(),d=null!=(c=null!=(l=null!=(i=null!=(o=null==t?void 0:t.weekStartsOn)?o:null==(r=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:r.weekStartsOn)?i:u.weekStartsOn)?l:null==(a=null==(s=u.locale)?void 0:s.options)?void 0:a.weekStartsOn)?c:0,h=$k(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function Bk(e){return Vk(e,{weekStartsOn:1})}function Uk(e){const t=$k(e),n=t.getFullYear(),r=Fk(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Bk(r),i=Fk(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Bk(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Kk(e){const t=$k(e);return t.setHours(0,0,0,0),t}function Wk(e){const t=$k(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Hk(e,t){return function(e,t){return Fk(e,+$k(e)+t)}(e,6e4*t)}function Gk(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=$k(e);return!isNaN(Number(n))}const Yk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Qk(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Xk={date:Qk({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Qk({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Qk({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Jk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Zk(e){return(t,n)=>{let r;if("formatting"===((null==n?void 0:n.context)?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=(null==n?void 0:n.width)?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=(null==n?void 0:n.width)?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eS(e){return(t,n={})=>{const r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(i)));let l;l=e.valueCallback?e.valueCallback(a):a,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(i.length)}}}var tS;const nS={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=Yk[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),(null==n?void 0:n.addSuffix)?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:Xk,formatRelative:(e,t,n,r)=>Jk[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Zk({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Zk({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zk({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Zk({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Zk({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(tS={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(tS.matchPattern);if(!n)return null;const r=n[0],o=e.match(tS.parsePattern);if(!o)return null;let i=tS.valueCallback?tS.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:eS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:eS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function rS(e){const t=$k(e),n=function(e,t){const n=Kk(e),r=Kk(t),o=+n-Wk(n),i=+r-Wk(r);return Math.round((o-i)/864e5)}(t,function(e){const t=$k(e),n=Fk(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function oS(e){const t=$k(e),n=+Bk(t)-+function(e){const t=Uk(e),n=Fk(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Bk(n)}(t);return Math.round(n/Ik)+1}function iS(e,t){var n,r,o,i,s,a,l,c;const u=$k(e),d=u.getFullYear(),h=zk(),f=null!=(c=null!=(l=null!=(i=null!=(o=null==t?void 0:t.firstWeekContainsDate)?o:null==(r=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:r.firstWeekContainsDate)?i:h.firstWeekContainsDate)?l:null==(a=null==(s=h.locale)?void 0:s.options)?void 0:a.firstWeekContainsDate)?c:1,p=Fk(e,0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);const g=Vk(p,t),m=Fk(e,0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);const v=Vk(m,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function sS(e,t){const n=$k(e),r=+Vk(n,t)-+function(e,t){var n,r,o,i,s,a,l,c;const u=zk(),d=null!=(c=null!=(l=null!=(i=null!=(o=null==t?void 0:t.firstWeekContainsDate)?o:null==(r=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:r.firstWeekContainsDate)?i:u.firstWeekContainsDate)?l:null==(a=null==(s=u.locale)?void 0:s.options)?void 0:a.firstWeekContainsDate)?c:1,h=iS(e,t),f=Fk(e,0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),Vk(f,t)}(n,t);return Math.round(r/Ik)+1}function aS(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const lS={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return aS("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):aS(n+1,2)},d:(e,t)=>aS(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>aS(e.getHours()%12||12,t.length),H:(e,t)=>aS(e.getHours(),t.length),m:(e,t)=>aS(e.getMinutes(),t.length),s:(e,t)=>aS(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return aS(Math.trunc(r*Math.pow(10,n-3)),t.length)}},cS="midnight",uS="noon",dS="morning",hS="afternoon",fS="evening",pS="night",gS={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return lS.y(e,t)},Y:function(e,t,n,r){const o=iS(e,r),i=o>0?o:1-o;if("YY"===t){return aS(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):aS(i,t.length)},R:function(e,t){return aS(Uk(e),t.length)},u:function(e,t){return aS(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return aS(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return aS(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return lS.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return aS(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=sS(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):aS(o,t.length)},I:function(e,t,n){const r=oS(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):aS(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):lS.d(e,t)},D:function(e,t,n){const r=rS(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):aS(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return aS(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return aS(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return aS(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?uS:0===r?cS:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?fS:r>=12?hS:r>=4?dS:pS,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return lS.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):lS.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):aS(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):aS(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):lS.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):lS.s(e,t)},S:function(e,t){return lS.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return vS(r);case"XXXX":case"XX":return yS(r);default:return yS(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return vS(r);case"xxxx":case"xx":return yS(r);default:return yS(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mS(r,":");default:return"GMT"+yS(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mS(r,":");default:return"GMT"+yS(r,":")}},t:function(e,t,n){return aS(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return aS(e.getTime(),t.length)}};function mS(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+aS(i,2)}function vS(e,t){if(e%60==0){return(e>0?"-":"+")+aS(Math.abs(e)/60,2)}return yS(e,t)}function yS(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+aS(Math.trunc(r/60),2)+t+aS(r%60,2)}const bS=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},wS=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},xS={p:wS,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return bS(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",bS(r,t)).replace("{{time}}",wS(o,t))}},kS=/^D+$/,SS=/^Y+$/,CS=["D","DD","YY","YYYY"];const ES=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,PS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jS=/^'([^]*?)'?$/,DS=/''/g,TS=/[a-zA-Z]/;function MS(e,t,n){var r,o,i,s,a,l,c,u,d;const h=zk(),f=null!=(r=h.locale)?r:nS,p=null!=(a=null!=(s=h.firstWeekContainsDate)?s:null==(i=null==(o=h.locale)?void 0:o.options)?void 0:i.firstWeekContainsDate)?a:1,g=null!=(d=null!=(u=h.weekStartsOn)?u:null==(c=null==(l=h.locale)?void 0:l.options)?void 0:c.weekStartsOn)?d:0,m=$k(e);if(!Gk(m))throw new RangeError("Invalid time value");let v=t.match(PS).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,xS[t])(e,f.formatLong)}return e})).join("").match(ES).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:OS(e)};if(gS[t])return{isToken:!0,value:e};if(t.match(TS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));f.localize.preprocessor&&(v=f.localize.preprocessor(m,v));const y={firstWeekContainsDate:p,weekStartsOn:g,locale:f};return v.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return SS.test(e)}(r)||function(e){return kS.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(CS.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,gS[r[0]])(m,r,f.localize,y)})).join("")}function OS(e){const t=e.match(jS);return t?t[1].replace(DS,"'"):e}var AS=lt.forwardRef(((e,n)=>{const{children:r,...o}=e,i=lt.Children.toArray(r),s=i.find(RS);if(s){const e=s.props.children,r=i.map((t=>t===s?lt.Children.count(e)>1?lt.Children.only(null):lt.isValidElement(e)?e.props.children:null:t));return t.jsx(NS,{...o,ref:n,children:lt.isValidElement(e)?lt.cloneElement(e,void 0,r):null})}return t.jsx(NS,{...o,ref:n,children:r})}));AS.displayName="Slot";var NS=lt.forwardRef(((e,t)=>{const{children:n,...r}=e;if(lt.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==lt.Fragment&&(o.ref=t?kx(t,e):e),lt.cloneElement(n,o)}return lt.Children.count(n)>1?lt.Children.only(null):null}));NS.displayName="SlotClone";var _S=({children:e})=>t.jsx(t.Fragment,{children:e});function RS(e){return lt.isValidElement(e)&&e.type===_S}const LS=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,$S=Zb,FS=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return $S(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map((e=>{const t=null==n?void 0:n[e],r=null==i?void 0:i[e];if(null===t)return null;const s=LS(t)||LS(r);return o[e][s]})),a=n&&Object.entries(n).reduce(((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e}),{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce(((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every((e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...a}[t]):{...i,...a}[t]===n}))?[...e,n,r]:e}),[]);return $S(e,s,l,null==n?void 0:n.class,null==n?void 0:n.className)},IS={base:"reach-styles-module__base___RP4iu",default:"reach-styles-module__default___pajjj",destructive:"reach-styles-module__destructive___BZSYi",outline:"reach-styles-module__outline___bNcaI",secondary:"reach-styles-module__secondary___osvqQ",ghost:"reach-styles-module__ghost___uU77B",link:"reach-styles-module__link___nSLOW"},qS=FS([IS.base,"debug-button"],{variants:{variant:{default:IS.default,destructive:IS.destructive,outline:IS.outline,secondary:IS.secondary,ghost:IS.ghost,link:IS.link},size:{default:IS["size-default"],sm:IS["size-sm"],lg:IS["size-lg"],icon:IS["size-icon"]}},defaultVariants:{variant:"default",size:"default"}}),zS=lt.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?AS:"button",{className:Ww(qS({variant:n,size:r,className:e})),ref:s,...i})));function VS(e,t=(null==globalThis?void 0:globalThis.document)){const n=Lx(e);lt.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}zS.displayName="Button";var BS,US="dismissableLayer.update",KS="dismissableLayer.pointerDownOutside",WS="dismissableLayer.focusOutside",HS=lt.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),GS=lt.forwardRef(((e,n)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=lt.useContext(HS),[h,f]=lt.useState(null),p=null!=(r=null==h?void 0:h.ownerDocument)?r:null==globalThis?void 0:globalThis.document,[,g]=lt.useState({}),m=Sx(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),w=h?v.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=w>=b,S=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Lx(e),r=lt.useRef(!1),o=lt.useRef((()=>{}));return lt.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){QS(KS,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Lx(e),r=lt.useRef(!1);return lt.useEffect((()=>{const e=e=>{if(e.target&&!r.current){QS(WS,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return VS((e=>{w===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),lt.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(BS=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),YS(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=BS)}}),[h,p,o,d]),lt.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),YS())}),[h,d]),lt.useEffect((()=>{const e=()=>g({});return document.addEventListener(US,e),()=>document.removeEventListener(US,e)}),[]),t.jsx(_x.div,{...u,ref:m,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:yx(e.onFocusCapture,C.onFocusCapture),onBlurCapture:yx(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:yx(e.onPointerDownCapture,S.onPointerDownCapture)})}));GS.displayName="DismissableLayer";function YS(){const e=new CustomEvent(US);document.dispatchEvent(e)}function QS(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Rx(o,i):o.dispatchEvent(i)}lt.forwardRef(((e,n)=>{const r=lt.useContext(HS),o=lt.useRef(null),i=Sx(n,o);return lt.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(_x.div,{...e,ref:i})})).displayName="DismissableLayerBranch";var XS="focusScope.autoFocusOnMount",JS="focusScope.autoFocusOnUnmount",ZS={bubbles:!1,cancelable:!0},eC=lt.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=lt.useState(null),u=Lx(i),d=Lx(s),h=lt.useRef(null),f=Sx(n,(e=>c(e))),p=lt.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;lt.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:oC(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||oC(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&oC(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,l,p.paused]),lt.useEffect((()=>{if(l){iC.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(XS,ZS);l.addEventListener(XS,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(oC(r,{select:t}),document.activeElement!==n)return}((e=tC(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&oC(l))}return()=>{l.removeEventListener(XS,u),setTimeout((()=>{const e=new CustomEvent(JS,ZS);l.addEventListener(JS,d),l.dispatchEvent(e),e.defaultPrevented||oC(null!=t?t:document.body,{select:!0}),l.removeEventListener(JS,d),iC.remove(p)}),0)}}var e}),[l,u,d,p]);const g=lt.useCallback((e=>{if(!r&&!o)return;if(p.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=tC(e),n=nC(t,e),r=nC(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&oC(i,{select:!0})):(e.preventDefault(),r&&oC(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return t.jsx(_x.div,{tabIndex:-1,...a,ref:f,onKeyDown:g})}));function tC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function nC(e,t){for(const n of e)if(!rC(n,{upTo:t}))return n}function rC(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function oC(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}eC.displayName="FocusScope";var iC=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=sC(e,t),e.unshift(t)},remove(t){var n;e=sC(e,t),null==(n=e[0])||n.resume()}}}();function sC(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var aC=lt.forwardRef(((e,n)=>{var o;const{container:i,...s}=e,[a,l]=lt.useState(!1);Mx((()=>l(!0)),[]);const c=i||a&&(null==(o=null==globalThis?void 0:globalThis.document)?void 0:o.body);return c?r.createPortal(t.jsx(_x.div,{...s,ref:n}),c):null}));aC.displayName="Portal";var lC=0;function cC(){lt.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!=(e=n[0])?e:uC()),document.body.insertAdjacentElement("beforeend",null!=(t=n[1])?t:uC()),lC++,()=>{1===lC&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),lC--}}),[])}function uC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dC=function(){return dC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dC.apply(this,arguments)};function hC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var fC="right-scroll-bar-position",pC="width-before-scroll-bar";function gC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var mC="undefined"!=typeof window?lt.useLayoutEffect:lt.useEffect,vC=new WeakMap;function yC(e,t){var r=function(e,t){var r=n.useState((function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(null,(function(t){return e.forEach((function(e){return gC(e,t)}))}));return mC((function(){var t=vC.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||gC(e,null)})),o.forEach((function(e){n.has(e)||gC(e,i)}))}vC.set(r,e)}),[e]),r}function bC(e){return e}var wC=function(e){var t=e.sideCar,n=hC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return lt.createElement(r,dC({},n))};wC.isSideCarExport=!0;var xC=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=bC);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=dC({async:!0,ssr:!1},e),t}(),kC=function(){},SC=lt.forwardRef((function(e,t){var n=lt.useRef(null),r=lt.useState({onScrollCapture:kC,onWheelCapture:kC,onTouchMoveCapture:kC}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,g=e.allowPinchZoom,m=e.as,v=void 0===m?"div":m,y=e.gapMode,b=hC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,x=yC([n,t]),k=dC(dC({},b),o);return lt.createElement(lt.Fragment,null,u&&lt.createElement(w,{sideCar:xC,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:y}),s?lt.cloneElement(lt.Children.only(a),dC(dC({},k),{ref:x})):lt.createElement(v,dC({},k,{className:l,ref:x}),a))}));SC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},SC.classNames={fullWidth:pC,zeroRight:fC};function CC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var EC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=CC())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},PC=function(){var e,t=(e=EC(),function(t,n){lt.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},jC={left:0,top:0,right:0,gap:0},DC=function(e){return parseInt(e||"",10)||0},TC=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return jC;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[DC(t["padding"===e?"paddingLeft":"marginLeft"]),DC(n),DC(r)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},MC=PC(),OC="data-scroll-locked",AC=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(OC,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(fC," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(pC," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(fC," .").concat(fC," {\n right: 0 ").concat(r,";\n }\n \n .").concat(pC," .").concat(pC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(OC,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},NC=function(){var e=parseInt(document.body.getAttribute(OC)||"0",10);return isFinite(e)?e:0},_C=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;lt.useEffect((function(){return document.body.setAttribute(OC,(NC()+1).toString()),function(){var e=NC()-1;e<=0?document.body.removeAttribute(OC):document.body.setAttribute(OC,e.toString())}}),[]);var i=lt.useMemo((function(){return TC(o)}),[o]);return lt.createElement(MC,{styles:AC(i,!t,o,n?"":"!important")})},RC=!1;if("undefined"!=typeof window)try{var LC=Object.defineProperty({},"passive",{get:function(){return RC=!0,!0}});window.addEventListener("test",LC,LC),window.removeEventListener("test",LC,LC)}catch(FB){RC=!1}var $C=!!RC&&{passive:!1},FC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},IC=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),qC(e,r)){var o=zC(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qC=function(e,t){return"v"===e?function(e){return FC(e,"overflowY")}(t):function(e){return FC(e,"overflowX")}(t)},zC=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},VC=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BC=function(e){return[e.deltaX,e.deltaY]},UC=function(e){return e&&"current"in e?e.current:e},KC=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},WC=0,HC=[];function GC(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const YC=(QC=function(e){var t=lt.useRef([]),n=lt.useRef([0,0]),r=lt.useRef(),o=lt.useState(WC++)[0],i=lt.useState(PC)[0],s=lt.useRef(e);lt.useEffect((function(){s.current=e}),[e]),lt.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(UC),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=lt.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=VC(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=IC(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=IC(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=zC(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&qC(e,s)&&(u+=p,d+=f),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),l=lt.useCallback((function(e){var n=e;if(HC.length&&HC[HC.length-1]===i){var r="deltaY"in n?BC(n):VC(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta)[0]===(o=r)[0]&&t[1]===o[1];var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(UC).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=lt.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:GC(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=lt.useCallback((function(e){n.current=VC(e),r.current=void 0}),[]),d=lt.useCallback((function(t){c(t.type,BC(t),t.target,a(t,e.lockRef.current))}),[]),h=lt.useCallback((function(t){c(t.type,VC(t),t.target,a(t,e.lockRef.current))}),[]);lt.useEffect((function(){return HC.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,$C),document.addEventListener("touchmove",l,$C),document.addEventListener("touchstart",u,$C),function(){HC=HC.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,$C),document.removeEventListener("touchmove",l,$C),document.removeEventListener("touchstart",u,$C)}}),[]);var f=e.removeScrollBar;return lt.createElement(lt.Fragment,null,e.inert?lt.createElement(i,{styles:KC(o)}):null,f?lt.createElement(_C,{gapMode:e.gapMode}):null)},xC.useMedium(QC),wC);var QC,XC=lt.forwardRef((function(e,t){return lt.createElement(SC,dC({},e,{ref:t,sideCar:YC}))}));XC.classNames=SC.classNames;var JC=new WeakMap,ZC=new WeakMap,eE={},tE=0,nE=function(e){return e&&(e.host||nE(e.parentNode))},rE=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=nE(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);eE[n]||(eE[n]=new WeakMap);var i=eE[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(JC.get(e)||0)+1,c=(i.get(e)||0)+1;JC.set(e,l),i.set(e,c),s.push(e),1===l&&o&&ZC.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(LB){}}))};return u(t),a.clear(),tE++,function(){s.forEach((function(e){var t=JC.get(e)-1,o=i.get(e)-1;JC.set(e,t),i.set(e,o),t||(ZC.has(e)||e.removeAttribute(r),ZC.delete(e)),o||e.removeAttribute(n)})),--tE||(JC=new WeakMap,JC=new WeakMap,ZC=new WeakMap,eE={})}},oE=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rE(r,o,n,"aria-hidden")):function(){return null}},iE="Dialog",[sE,aE]=bx(iE),[lE,cE]=sE(iE),uE=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=lt.useRef(null),c=lt.useRef(null),[u=!1,d]=$x({prop:o,defaultProp:i,onChange:s});return t.jsx(lE,{scope:n,triggerRef:l,contentRef:c,contentId:Nx(),titleId:Nx(),descriptionId:Nx(),open:u,onOpenChange:d,onOpenToggle:lt.useCallback((()=>d((e=>!e))),[d]),modal:a,children:r})};uE.displayName=iE;var dE="DialogTrigger";lt.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=cE(dE,r),s=Sx(n,i.triggerRef);return t.jsx(_x.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ME(i.open),...o,ref:s,onClick:yx(e.onClick,i.onOpenToggle)})})).displayName=dE;var hE="DialogPortal",[fE,pE]=sE(hE,{forceMount:void 0}),gE=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=e,s=cE(hE,n);return t.jsx(fE,{scope:n,forceMount:r,children:lt.Children.map(o,(e=>t.jsx(ok,{present:r||s.open,children:t.jsx(aC,{asChild:!0,container:i,children:e})})))})};gE.displayName=hE;var mE="DialogOverlay",vE=lt.forwardRef(((e,n)=>{const r=pE(mE,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=cE(mE,e.__scopeDialog);return s.modal?t.jsx(ok,{present:o||s.open,children:t.jsx(yE,{...i,ref:n})}):null}));vE.displayName=mE;var yE=lt.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=cE(mE,r);return t.jsx(XC,{as:Cx,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(_x.div,{"data-state":ME(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),bE="DialogContent",wE=lt.forwardRef(((e,n)=>{const r=pE(bE,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=cE(bE,e.__scopeDialog);return t.jsx(ok,{present:o||s.open,children:t.jsx(s.modal?xE:kE,{...i,ref:n})})}));wE.displayName=bE;var xE=lt.forwardRef(((e,n)=>{const r=cE(bE,e.__scopeDialog),o=lt.useRef(null),i=Sx(n,r.contentRef,o);return lt.useEffect((()=>{const e=o.current;if(e)return oE(e)}),[]),t.jsx(SE,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yx(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null==(t=r.triggerRef.current)||t.focus()})),onPointerDownOutside:yx(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:yx(e.onFocusOutside,(e=>e.preventDefault()))})})),kE=lt.forwardRef(((e,n)=>{const r=cE(bE,e.__scopeDialog),o=lt.useRef(!1),i=lt.useRef(!1);return t.jsx(SE,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;null==(n=e.onCloseAutoFocus)||n.call(e,t),t.defaultPrevented||(o.current||null==(s=r.triggerRef.current)||s.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null==(n=e.onInteractOutside)||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null==(s=r.triggerRef.current)?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})})),SE=lt.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=cE(bE,r),c=lt.useRef(null),u=Sx(n,c);return cC(),t.jsxs(t.Fragment,{children:[t.jsx(eC,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(GS,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ME(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(_E,{titleId:l.titleId}),t.jsx(RE,{contentRef:c,descriptionId:l.descriptionId})]})]})})),CE="DialogTitle",EE=lt.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=cE(CE,r);return t.jsx(_x.h2,{id:i.titleId,...o,ref:n})}));EE.displayName=CE;var PE="DialogDescription",jE=lt.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=cE(PE,r);return t.jsx(_x.p,{id:i.descriptionId,...o,ref:n})}));jE.displayName=PE;var DE="DialogClose",TE=lt.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=cE(DE,r);return t.jsx(_x.button,{type:"button",...o,ref:n,onClick:yx(e.onClick,(()=>i.onOpenChange(!1)))})}));function ME(e){return e?"open":"closed"}TE.displayName=DE;var OE="DialogTitleWarning",[AE,NE]=function(e,n){const r=lt.createContext(n),o=e=>{const{children:n,...o}=e,i=lt.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:i,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=lt.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(OE,{contentName:bE,titleName:CE,docsSlug:"dialog"}),_E=({titleId:e})=>{const t=NE(OE);return lt.useEffect((()=>{if(e){document.getElementById(e)}}),[`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`,e]),null},RE=({contentRef:e,descriptionId:t})=>{const n=NE("DialogDescriptionWarning");return lt.useEffect((()=>{var n;const r=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},LE=vE,$E=wE,FE=EE,IE=jE,qE=TE;const zE=uE,VE=gE,BE=lt.forwardRef((({className:e,...n},r)=>t.jsx(LE,{ref:r,className:Ww("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));BE.displayName=LE.displayName;const UE=lt.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(VE,{children:[t.jsx(BE,{}),t.jsxs($E,{ref:i,className:Ww("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onInteractOutside:e=>{e.composedPath().some((e=>"classList"in e&&Array.from(e.classList).includes("pac-item")))&&e.preventDefault()},...o,children:[n,!r&&t.jsxs(qE,{className:"absolute right-6 top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Hb,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));UE.displayName=$E.displayName;lt.forwardRef((({className:e,...n},r)=>t.jsx(FE,{ref:r,className:Ww("text-lg font-semibold leading-none tracking-tight",e),...n}))).displayName=FE.displayName;lt.forwardRef((({className:e,...n},r)=>t.jsx(IE,{ref:r,className:Ww("text-sm text-muted-foreground",e),...n}))).displayName=IE.displayName;var KE,WE="dismissableLayer.update",HE="dismissableLayer.pointerDownOutside",GE="dismissableLayer.focusOutside",YE=lt.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QE=lt.forwardRef(((e,n)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=lt.useContext(YE),[h,f]=lt.useState(null),p=null!=(r=null==h?void 0:h.ownerDocument)?r:null==globalThis?void 0:globalThis.document,[,g]=lt.useState({}),m=Sx(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),w=h?v.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=w>=b,S=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Lx(e),r=lt.useRef(!1),o=lt.useRef((()=>{}));return lt.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){JE(HE,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Lx(e),r=lt.useRef(!1);return lt.useEffect((()=>{const e=e=>{if(e.target&&!r.current){JE(GE,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return VS((e=>{w===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),lt.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(KE=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),XE(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=KE)}}),[h,p,o,d]),lt.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),XE())}),[h,d]),lt.useEffect((()=>{const e=()=>g({});return document.addEventListener(WE,e),()=>document.removeEventListener(WE,e)}),[]),t.jsx(_x.div,{...u,ref:m,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:yx(e.onFocusCapture,C.onFocusCapture),onBlurCapture:yx(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:yx(e.onPointerDownCapture,S.onPointerDownCapture)})}));QE.displayName="DismissableLayer";function XE(){const e=new CustomEvent(WE);document.dispatchEvent(e)}function JE(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Rx(o,i):o.dispatchEvent(i)}lt.forwardRef(((e,n)=>{const r=lt.useContext(YE),o=lt.useRef(null),i=Sx(n,o);return lt.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(_x.div,{...e,ref:i})})).displayName="DismissableLayerBranch";const ZE=["top","right","bottom","left"],eP=Math.min,tP=Math.max,nP=Math.round,rP=Math.floor,oP=e=>({x:e,y:e}),iP={left:"right",right:"left",bottom:"top",top:"bottom"},sP={start:"end",end:"start"};function aP(e,t,n){return tP(e,eP(t,n))}function lP(e,t){return"function"==typeof e?e(t):e}function cP(e){return e.split("-")[0]}function uP(e){return e.split("-")[1]}function dP(e){return"x"===e?"y":"x"}function hP(e){return"y"===e?"height":"width"}function fP(e){return["top","bottom"].includes(cP(e))?"y":"x"}function pP(e){return dP(fP(e))}function gP(e){return e.replace(/start|end/g,(e=>sP[e]))}function mP(e){return e.replace(/left|right|bottom|top/g,(e=>iP[e]))}function vP(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yP(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bP(e,t,n){let{reference:r,floating:o}=e;const i=fP(t),s=pP(t),a=hP(s),l=cP(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(uP(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function wP(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=lP(t,e),p=vP(f),g=a[h?"floating"===d?"reference":"floating":d],m=yP(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=yP(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function xP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kP(e){return ZE.some((t=>e[t]>=0))}function SP(){return"undefined"!=typeof window}function CP(e){return jP(e)?(e.nodeName||"").toLowerCase():"#document"}function EP(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function PP(e){var t;return null==(t=(jP(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function jP(e){return!!SP()&&(e instanceof Node||e instanceof EP(e).Node)}function DP(e){return!!SP()&&(e instanceof Element||e instanceof EP(e).Element)}function TP(e){return!!SP()&&(e instanceof HTMLElement||e instanceof EP(e).HTMLElement)}function MP(e){return!(!SP()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof EP(e).ShadowRoot)}function OP(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$P(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function AP(e){return["table","td","th"].includes(CP(e))}function NP(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(LB){return!1}}))}function _P(e){const t=RP(),n=DP(e)?$P(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function RP(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function LP(e){return["html","body","#document"].includes(CP(e))}function $P(e){return EP(e).getComputedStyle(e)}function FP(e){return DP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function IP(e){if("html"===CP(e))return e;const t=e.assignedSlot||e.parentNode||MP(e)&&e.host||PP(e);return MP(t)?t.host:t}function qP(e){const t=IP(e);return LP(t)?e.ownerDocument?e.ownerDocument.body:e.body:TP(t)&&OP(t)?t:qP(t)}function zP(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=qP(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=EP(o);if(i){const e=VP(s);return t.concat(s,s.visualViewport||[],OP(o)?o:[],e&&n?zP(e):[])}return t.concat(o,zP(o,[],n))}function VP(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BP(e){const t=$P(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=TP(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nP(n)!==i||nP(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function UP(e){return DP(e)?e:e.contextElement}function KP(e){const t=UP(e);if(!TP(t))return oP(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=BP(t);let s=(i?nP(n.width):n.width)/r,a=(i?nP(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const WP=oP(0);function HP(e){const t=EP(e);return RP()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:WP}function GP(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=UP(e);let s=oP(1);t&&(r?DP(r)&&(s=KP(r)):s=KP(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==EP(e))&&t}(i,n,r)?HP(i):oP(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=EP(i),t=r&&DP(r)?EP(r):r;let n=e,o=VP(n);for(;o&&r&&t!==n;){const e=KP(o),t=o.getBoundingClientRect(),r=$P(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=EP(o),o=VP(n)}}return yP({width:u,height:d,x:l,y:c})}function YP(e,t){const n=FP(e).scrollLeft;return t?t.left+n:GP(PP(e)).left+n}function QP(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:YP(e,r)),y:r.top+t.scrollTop}}function XP(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=EP(e),r=PP(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=RP();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=PP(e),n=FP(e),r=e.ownerDocument.body,o=tP(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tP(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+YP(e);const a=-n.scrollTop;return"rtl"===$P(r).direction&&(s+=tP(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(PP(e));else if(DP(t))r=function(e,t){const n=GP(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=TP(e)?KP(e):oP(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=HP(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yP(r)}function JP(e,t){const n=IP(e);return!(n===t||!DP(n)||LP(n))&&("fixed"===$P(n).position||JP(n,t))}function ZP(e,t,n){const r=TP(t),o=PP(t),i="fixed"===n,s=GP(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=oP(0);if(r||!r&&!i)if(("body"!==CP(t)||OP(o))&&(a=FP(t)),r){const e=GP(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=YP(o));const c=!o||r||i?oP(0):QP(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function ej(e){return"static"===$P(e).position}function tj(e,t){if(!TP(e)||"fixed"===$P(e).position)return null;if(t)return t(e);let n=e.offsetParent;return PP(e)===n&&(n=n.ownerDocument.body),n}function nj(e,t){const n=EP(e);if(NP(e))return n;if(!TP(e)){let t=IP(e);for(;t&&!LP(t);){if(DP(t)&&!ej(t))return t;t=IP(t)}return n}let r=tj(e,t);for(;r&&AP(r)&&ej(r);)r=tj(r,t);return r&&LP(r)&&ej(r)&&!_P(r)?n:r||function(e){let t=IP(e);for(;TP(t)&&!LP(t);){if(_P(t))return t;if(NP(t))return null;t=IP(t)}return null}(e)||n}const rj={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=PP(r),a=!!t&&NP(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=oP(1);const u=oP(0),d=TP(r);if((d||!d&&!i)&&(("body"!==CP(r)||OP(s))&&(l=FP(r)),TP(r))){const e=GP(r);c=KP(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?oP(0):QP(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:PP,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?NP(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=zP(e,[],!1).filter((e=>DP(e)&&"body"!==CP(e))),o=null;const i="fixed"===$P(e).position;let s=i?IP(e):e;for(;DP(s)&&!LP(s);){const t=$P(s),n=_P(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||OP(s)&&!n&&JP(e,s))?r=r.filter((e=>e!==s)):o=t,s=IP(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=XP(t,n,o);return e.top=tP(r.top,e.top),e.right=eP(r.right,e.right),e.bottom=eP(r.bottom,e.bottom),e.left=tP(r.left,e.left),e}),XP(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:nj,getElementRects:async function(e){const t=this.getOffsetParent||nj,n=this.getDimensions,r=await n(e.floating);return{reference:ZP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=BP(e);return{width:t,height:n}},getScale:KP,isElement:DP,isRTL:function(e){return"rtl"===$P(e).direction}};function oj(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=UP(e),u=o||i?[...c?zP(c):[],...zP(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=PP(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-rP(u)+"px "+-rP(o.clientWidth-(c+d))+"px "+-rP(o.clientHeight-(u+h))+"px "+-rP(c)+"px",threshold:tP(0,eP(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(LB){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let g=l?GP(e):null;return l&&function t(){const r=GP(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const ij=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=cP(n),a=uP(n),l="y"===fP(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=lP(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sj=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lP(e,t),c={x:n,y:r},u=await wP(t,l),d=fP(cP(o)),h=dP(d);let f=c[h],p=c[d];if(i){f=aP(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=aP(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const g=a.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[d]:s}}}}}},aj=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=lP(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=cP(o),y=fP(a),b=cP(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=h||(b||!g?[mP(a)]:function(e){const t=mP(e);return[gP(e),t,gP(t)]}(a)),k="none"!==p;!h&&k&&x.push(...function(e,t,n,r){const o=uP(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(cP(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gP)))),i}(a,g,p,w));const S=[a,...x],C=await wP(t,m),E=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=uP(e),o=pP(e),i=hP(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=mP(s)),[s,mP(s)]}(o,s,w);E.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,D;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(D=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=P.filter((e=>{if(k){const t=fP(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},lj=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=lP(e,t),u=await wP(t,c),d=cP(o),h=uP(o),f="y"===fP(o),{width:p,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m="end"===h?"top":"bottom");const y=g-u.top-u.bottom,b=p-u.left-u.right;let w=eP(g-u[m],y),x=eP(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(x=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(w=y),!t.middlewareData.shift&&!h){const e=tP(u.left,0),t=tP(u.right,0),n=tP(u.top,0),r=tP(u.bottom,0);f?x=p-2*(0!==e||0!==t?e+t:tP(u.left,u.right)):w=g-2*(0!==n||0!==r?n+r:tP(u.top,u.bottom))}await l({...t,availableWidth:x,availableHeight:w});const k=await s.getDimensions(a.floating);return p!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}},cj=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=lP(e,t);switch(r){case"referenceHidden":{const e=xP(await wP(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kP(e)}}}case"escaped":{const e=xP(await wP(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kP(e)}}}default:return{}}}}},uj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=lP(e,t)||{};if(null==c)return{};const d=vP(u),h={x:n,y:r},f=pP(o),p=hP(f),g=await s.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[f]-h[f]-i.floating[p],x=h[f]-i.reference[f],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=k?k[b]:0;S&&await(null==s.isElement?void 0:s.isElement(k))||(S=a.floating[b]||i.floating[p]);const C=w/2-x/2,E=S/2-g[p]/2-1,P=eP(d[v],E),j=eP(d[y],E),D=P,T=S-g[p]-j,M=S/2-g[p]/2+C,O=aP(D,M,T),A=!l.arrow&&null!=uP(o)&&M!==O&&i.reference[p]/2-(M<D?P:j)-g[p]/2<0,N=A?M<D?M-D:M-T:0;return{[f]:h[f]+N,data:{[f]:O,centerOffset:M-O-N,...A&&{alignmentOffset:N}},reset:A}}}),dj=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=lP(e,t),u={x:n,y:r},d=fP(o),h=dP(d);let f=u[h],p=u[d];const g=lP(a,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+m.mainAxis,n=i.reference[h]+i.reference[e]-m.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(cP(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},hj=(e,t,n)=>{const r={platform:rj,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=bP(c,r,l),h=r,f={},p=0;for(let g=0;g<a.length;g++){const{name:n,fn:i}=a[g],{x:m,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=bP(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var fj="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function pj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!pj(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!pj(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function gj(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mj(e,t){const n=gj(e);return Math.round(t*n)/n}function vj(e){const t=lt.useRef(e);return fj((()=>{t.current=e})),t}const yj=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?uj({element:n.current,padding:r}).fn(t):{}:n?uj({element:n,padding:r}).fn(t):{}}}),bj=(e,t)=>({...sj(e),options:[e,t]}),wj=(e,t)=>({...dj(e),options:[e,t]}),xj=(e,t)=>({...aj(e),options:[e,t]}),kj=(e,t)=>({...lj(e),options:[e,t]}),Sj=(e,t)=>({...cj(e),options:[e,t]}),Cj=(e,t)=>({...yj(e),options:[e,t]});var Ej=lt.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(_x.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));Ej.displayName="Arrow";var Pj=Ej;var jj="Popper",[Dj,Tj]=bx(jj),[Mj,Oj]=Dj(jj),Aj=e=>{const{__scopePopper:n,children:r}=e,[o,i]=lt.useState(null);return t.jsx(Mj,{scope:n,anchor:o,onAnchorChange:i,children:r})};Aj.displayName=jj;var Nj="PopperAnchor",_j=lt.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...i}=e,s=Oj(Nj,r),a=lt.useRef(null),l=Sx(n,a);return lt.useEffect((()=>{s.onAnchorChange((null==o?void 0:o.current)||a.current)})),o?null:t.jsx(_x.div,{...i,ref:l})}));_j.displayName=Nj;var Rj="PopperContent",[Lj,$j]=Dj(Rj),Fj=lt.forwardRef(((e,n)=>{var r,o,i,s,a,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:w="partial",hideWhenDetached:x=!1,updatePositionStrategy:k="optimized",onPlaced:S,...C}=e,E=Oj(Rj,d),[P,j]=lt.useState(null),D=Sx(n,(e=>j(e))),[T,M]=lt.useState(null),O=function(e){const[t,n]=lt.useState(void 0);return Mx((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(T),A=null!=(r=null==O?void 0:O.width)?r:0,N=null!=(o=null==O?void 0:O.height)?o:0,_=h+("center"!==p?"-"+p:""),R="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},L=Array.isArray(y)?y:[y],$=L.length>0,F={padding:R,boundary:L.filter(Vj),altBoundary:$},{refs:I,floatingStyles:q,placement:z,isPositioned:V,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=lt.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=lt.useState(r);pj(h,r)||f(r);const[p,g]=lt.useState(null),[m,v]=lt.useState(null),y=lt.useCallback((e=>{e!==k.current&&(k.current=e,g(e))}),[]),b=lt.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),w=i||p,x=s||m,k=lt.useRef(null),S=lt.useRef(null),C=lt.useRef(u),E=null!=l,P=vj(l),j=vj(o),D=vj(c),T=lt.useCallback((()=>{if(!k.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};j.current&&(e.platform=j.current),hj(k.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==D.current};M.current&&!pj(C.current,t)&&(C.current=t,ct.flushSync((()=>{d(t)})))}))}),[h,t,n,j,D]);fj((()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const M=lt.useRef(!1);fj((()=>(M.current=!0,()=>{M.current=!1})),[]),fj((()=>{if(w&&(k.current=w),x&&(S.current=x),w&&x){if(P.current)return P.current(w,x,T);T()}}),[w,x,T,P,E]);const O=lt.useMemo((()=>({reference:k,floating:S,setReference:y,setFloating:b})),[y,b]),A=lt.useMemo((()=>({reference:w,floating:x})),[w,x]),N=lt.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=mj(A.floating,u.x),r=mj(A.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...gj(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,A.floating,u.x,u.y]);return lt.useMemo((()=>({...u,update:T,refs:O,elements:A,floatingStyles:N})),[u,T,O,A,N])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>oj(...e,{animationFrame:"always"===k}),elements:{reference:E.anchor},middleware:[(U={mainAxis:f+N,alignmentAxis:g},{...ij(U),options:[U,K]}),v&&bj({mainAxis:!0,crossAxis:!1,limiter:"partial"===w?wj():void 0,...F}),v&&xj({...F}),kj({...F,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),T&&Cj({element:T,padding:m}),Bj({arrowWidth:A,arrowHeight:N}),x&&Sj({strategy:"referenceHidden",...F})]});var U,K;const[W,H]=Uj(z),G=Lx(S);Mx((()=>{V&&(null==G||G())}),[V,G]);const Y=null==(i=B.arrow)?void 0:i.x,Q=null==(s=B.arrow)?void 0:s.y,X=0!==(null==(a=B.arrow)?void 0:a.centerOffset),[J,Z]=lt.useState();return Mx((()=>{P&&Z(window.getComputedStyle(P).zIndex)}),[P]),t.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[null==(l=B.transformOrigin)?void 0:l.x,null==(c=B.transformOrigin)?void 0:c.y].join(" "),...(null==(u=B.hide)?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Lj,{scope:d,placedSide:W,onArrowChange:M,arrowX:Y,arrowY:Q,shouldHideArrow:X,children:t.jsx(_x.div,{"data-side":W,"data-align":H,...C,ref:D,style:{...C.style,animation:V?void 0:"none"}})})})}));Fj.displayName=Rj;var Ij="PopperArrow",qj={top:"bottom",right:"left",bottom:"top",left:"right"},zj=lt.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=$j(Ij,r),s=qj[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Pj,{...o,ref:n,style:{...o.style,display:"block"}})})}));function Vj(e){return null!==e}zj.displayName=Ij;var Bj=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,u=0!==(null==(n=c.arrow)?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=Uj(a),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!=(o=null==(r=c.arrow)?void 0:r.x)?o:0)+d/2,v=(null!=(s=null==(i=c.arrow)?void 0:i.y)?s:0)+h/2;let y="",b="";return"bottom"===f?(y=u?g:`${m}px`,b=-h+"px"):"top"===f?(y=u?g:`${m}px`,b=`${l.floating.height+h}px`):"right"===f?(y=-h+"px",b=u?g:`${v}px`):"left"===f&&(y=`${l.floating.width+h}px`,b=u?g:`${v}px`),{data:{x:y,y:b}}}});function Uj(e){const[t,n="center"]=e.split("-");return[t,n]}var Kj=Aj,Wj=_j,Hj=Fj,Gj=zj,Yj=["Enter"," "],Qj=["ArrowUp","PageDown","End"],Xj=["ArrowDown","PageUp","Home",...Qj],Jj={ltr:[...Yj,"ArrowRight"],rtl:[...Yj,"ArrowLeft"]},Zj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eD="Menu",[tD,nD,rD]=Tx(eD),[oD,iD]=bx(eD,[rD,Tj,Hx]),sD=Tj(),aD=Hx(),[lD,cD]=oD(eD),[uD,dD]=oD(eD),hD=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:i,onOpenChange:s,modal:a=!0}=e,l=sD(n),[c,u]=lt.useState(null),d=lt.useRef(!1),h=Lx(s),f=Ix(i);return lt.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(Kj,{...l,children:t.jsx(lD,{scope:n,open:r,onOpenChange:h,content:c,onContentChange:u,children:t.jsx(uD,{scope:n,onClose:lt.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:a,children:o})})})};hD.displayName=eD;var fD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=sD(r);return t.jsx(Wj,{...i,...o,ref:n})}));fD.displayName="MenuAnchor";var pD="MenuPortal",[gD,mD]=oD(pD,{forceMount:void 0}),vD=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=cD(pD,n);return t.jsx(gD,{scope:n,forceMount:r,children:t.jsx(ok,{present:r||s.open,children:t.jsx(aC,{asChild:!0,container:i,children:o})})})};vD.displayName=pD;var yD="MenuContent",[bD,wD]=oD(yD),xD=lt.forwardRef(((e,n)=>{const r=mD(yD,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=cD(yD,e.__scopeMenu),a=dD(yD,e.__scopeMenu);return t.jsx(tD.Provider,{scope:e.__scopeMenu,children:t.jsx(ok,{present:o||s.open,children:t.jsx(tD.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?kD:SD,{...i,ref:n})})})})})),kD=lt.forwardRef(((e,n)=>{const r=cD(yD,e.__scopeMenu),o=lt.useRef(null),i=Sx(n,o);return lt.useEffect((()=>{const e=o.current;if(e)return oE(e)}),[]),t.jsx(CD,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:yx(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),SD=lt.forwardRef(((e,n)=>{const r=cD(yD,e.__scopeMenu);return t.jsx(CD,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),CD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:p,disableOutsideScroll:g,...m}=e,v=cD(yD,r),y=dD(yD,r),b=sD(r),w=aD(r),x=nD(r),[k,S]=lt.useState(null),C=lt.useRef(null),E=Sx(n,C,v.onContentChange),P=lt.useRef(0),j=lt.useRef(""),D=lt.useRef(0),T=lt.useRef(null),M=lt.useRef("right"),O=lt.useRef(0),A=g?XC:lt.Fragment,N=g?{as:Cx,allowPinchZoom:!0}:void 0,_=e=>{var t,n;const r=j.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){j.current=t,window.clearTimeout(P.current),""!==t&&(P.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};lt.useEffect((()=>()=>window.clearTimeout(P.current)),[]),cC();const R=lt.useCallback((e=>{var t,n;return M.current===(null==(t=T.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=T.current)?void 0:n.area)}),[]);return t.jsx(bD,{scope:r,searchRef:j,onItemEnter:lt.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:lt.useCallback((e=>{var t;R(e)||(null==(t=C.current)||t.focus(),S(null))}),[R]),onTriggerLeave:lt.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:D,onPointerGraceIntentChange:lt.useCallback((e=>{T.current=e}),[]),children:t.jsx(A,{...N,children:t.jsx(eC,{asChild:!0,trapped:i,onMountAutoFocus:yx(s,(e=>{var t;e.preventDefault(),null==(t=C.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:a,children:t.jsx(QE,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:p,children:t.jsx(nk,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:k,onCurrentTabStopIdChange:S,onEntryFocus:yx(c,(e=>{y.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(Hj,{role:"menu","aria-orientation":"vertical","data-state":QD(v.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:yx(m.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&_(e.key));if(e.target!==C.current)return;if(!Xj.includes(e.key))return;e.preventDefault();const o=x().filter((e=>!e.disabled)).map((e=>e.ref.current));Qj.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:yx(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),j.current="")})),onPointerMove:yx(e.onPointerMove,ZD((e=>{const t=O.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){M.current=e.clientX>O.current?"right":"left",O.current=e.clientX}})))})})})})})})}));xD.displayName=yD;var ED=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(_x.div,{role:"group",...o,ref:n})}));ED.displayName="MenuGroup";var PD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(_x.div,{...o,ref:n})}));PD.displayName="MenuLabel";var jD="MenuItem",DD="menu.itemSelect",TD=lt.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...i}=e,s=lt.useRef(null),a=dD(jD,e.__scopeMenu),l=wD(jD,e.__scopeMenu),c=Sx(n,s),u=lt.useRef(!1);return t.jsx(MD,{...i,ref:c,disabled:r,onClick:yx(e.onClick,(()=>{const e=s.current;if(!r&&e){const t=new CustomEvent(DD,{bubbles:!0,cancelable:!0});e.addEventListener(DD,(e=>null==o?void 0:o(e)),{once:!0}),Rx(e,t),t.defaultPrevented?u.current=!1:a.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),u.current=!0},onPointerUp:yx(e.onPointerUp,(e=>{var t;u.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:yx(e.onKeyDown,(e=>{r||""!==l.searchRef.current&&" "===e.key||Yj.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));TD.displayName=jD;var MD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:i,...s}=e,a=wD(jD,r),l=aD(r),c=lt.useRef(null),u=Sx(n,c),[d,h]=lt.useState(!1),[f,p]=lt.useState("");return lt.useEffect((()=>{var e;const t=c.current;t&&p((null!=(e=t.textContent)?e:"").trim())}),[s.children]),t.jsx(tD.ItemSlot,{scope:r,disabled:o,textValue:null!=i?i:f,children:t.jsx(rk,{asChild:!0,...l,focusable:!o,children:t.jsx(_x.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:yx(e.onPointerMove,ZD((e=>{if(o)a.onItemLeave(e);else if(a.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:yx(e.onPointerLeave,ZD((e=>a.onItemLeave(e)))),onFocus:yx(e.onFocus,(()=>h(!0))),onBlur:yx(e.onBlur,(()=>h(!1)))})})})})),OD=lt.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(ID,{scope:e.__scopeMenu,checked:r,children:t.jsx(TD,{role:"menuitemcheckbox","aria-checked":XD(r)?"mixed":r,...i,ref:n,"data-state":JD(r),onSelect:yx(i.onSelect,(()=>null==o?void 0:o(!!XD(r)||!r)),{checkForDefaultPrevented:!1})})})}));OD.displayName="MenuCheckboxItem";var AD="MenuRadioGroup",[ND,_D]=oD(AD,{value:void 0,onValueChange:()=>{}}),RD=lt.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Lx(o);return t.jsx(ND,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(ED,{...i,ref:n})})}));RD.displayName=AD;var LD="MenuRadioItem",$D=lt.forwardRef(((e,n)=>{const{value:r,...o}=e,i=_D(LD,e.__scopeMenu),s=r===i.value;return t.jsx(ID,{scope:e.__scopeMenu,checked:s,children:t.jsx(TD,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":JD(s),onSelect:yx(o.onSelect,(()=>{var e;return null==(e=i.onValueChange)?void 0:e.call(i,r)}),{checkForDefaultPrevented:!1})})})}));$D.displayName=LD;var FD="MenuItemIndicator",[ID,qD]=oD(FD,{checked:!1}),zD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=qD(FD,r);return t.jsx(ok,{present:o||XD(s.checked)||!0===s.checked,children:t.jsx(_x.span,{...i,ref:n,"data-state":JD(s.checked)})})}));zD.displayName=FD;var VD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(_x.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));VD.displayName="MenuSeparator";var BD=lt.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=sD(r);return t.jsx(Gj,{...i,...o,ref:n})}));BD.displayName="MenuArrow";var[UD,KD]=oD("MenuSub"),WD="MenuSubTrigger",HD=lt.forwardRef(((e,n)=>{const r=cD(WD,e.__scopeMenu),o=dD(WD,e.__scopeMenu),i=KD(WD,e.__scopeMenu),s=wD(WD,e.__scopeMenu),a=lt.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=lt.useCallback((()=>{a.current&&window.clearTimeout(a.current),a.current=null}),[]);return lt.useEffect((()=>d),[d]),lt.useEffect((()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}}),[l,c]),t.jsx(fD,{asChild:!0,...u,children:t.jsx(MD,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":QD(r.open),...e,ref:kx(n,i.onTriggerChange),onClick:t=>{var n;null==(n=e.onClick)||n.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:yx(e.onPointerMove,ZD((t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||a.current||(s.onPointerGraceIntentChange(null),a.current=window.setTimeout((()=>{r.onOpenChange(!0),d()}),100))}))),onPointerLeave:yx(e.onPointerLeave,ZD((e=>{var t,n;d();const o=null==(t=r.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(n=r.content)?void 0:n.dataset.side,i="right"===t,a=o[i?"left":"right"],c=o[i?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+(i?-5:5),y:e.clientY},{x:a,y:o.top},{x:c,y:o.top},{x:c,y:o.bottom},{x:a,y:o.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout((()=>s.onPointerGraceIntentChange(null)),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}}))),onKeyDown:yx(e.onKeyDown,(t=>{var n;e.disabled||""!==s.searchRef.current&&" "===t.key||Jj[o.dir].includes(t.key)&&(r.onOpenChange(!0),null==(n=r.content)||n.focus(),t.preventDefault())}))})})}));HD.displayName=WD;var GD="MenuSubContent",YD=lt.forwardRef(((e,n)=>{const r=mD(yD,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=cD(yD,e.__scopeMenu),a=dD(yD,e.__scopeMenu),l=KD(GD,e.__scopeMenu),c=lt.useRef(null),u=Sx(n,c);return t.jsx(tD.Provider,{scope:e.__scopeMenu,children:t.jsx(ok,{present:o||s.open,children:t.jsx(tD.Slot,{scope:e.__scopeMenu,children:t.jsx(CD,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:"rtl"===a.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;a.isUsingKeyboardRef.current&&(null==(t=c.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:yx(e.onFocusOutside,(e=>{e.target!==l.trigger&&s.onOpenChange(!1)})),onEscapeKeyDown:yx(e.onEscapeKeyDown,(e=>{a.onClose(),e.preventDefault()})),onKeyDown:yx(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=Zj[a.dir].includes(e.key);n&&r&&(s.onOpenChange(!1),null==(t=l.trigger)||t.focus(),e.preventDefault())}))})})})})}));function QD(e){return e?"open":"closed"}function XD(e){return"indeterminate"===e}function JD(e){return XD(e)?"indeterminate":e?"checked":"unchecked"}function ZD(e){return t=>"mouse"===t.pointerType?e(t):void 0}YD.displayName=GD;var eT=hD,tT=fD,nT=vD,rT=xD,oT=ED,iT=PD,sT=TD,aT=OD,lT=RD,cT=$D,uT=zD,dT=VD,hT=BD,fT=HD,pT=YD,gT="DropdownMenu",[mT,vT]=bx(gT,[iD]),yT=iD(),[bT,wT]=mT(gT),xT=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:i,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=yT(n),u=lt.useRef(null),[d=!1,h]=$x({prop:i,defaultProp:s,onChange:a});return t.jsx(bT,{scope:n,triggerId:Nx(),triggerRef:u,contentId:Nx(),open:d,onOpenChange:h,onOpenToggle:lt.useCallback((()=>h((e=>!e))),[h]),modal:l,children:t.jsx(eT,{...c,open:d,onOpenChange:h,dir:o,modal:l,children:r})})};xT.displayName=gT;var kT="DropdownMenuTrigger",ST=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=wT(kT,r),a=yT(r);return t.jsx(tT,{asChild:!0,...a,children:t.jsx(_x.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:kx(n,s.triggerRef),onPointerDown:yx(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:yx(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));ST.displayName=kT;var CT=e=>{const{__scopeDropdownMenu:n,...r}=e,o=yT(n);return t.jsx(nT,{...o,...r})};CT.displayName="DropdownMenuPortal";var ET="DropdownMenuContent",PT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=wT(ET,r),s=yT(r),a=lt.useRef(!1);return t.jsx(rT,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...o,ref:n,onCloseAutoFocus:yx(e.onCloseAutoFocus,(e=>{var t;a.current||null==(t=i.triggerRef.current)||t.focus(),a.current=!1,e.preventDefault()})),onInteractOutside:yx(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;i.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(a.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));PT.displayName=ET;lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(oT,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var jT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(iT,{...i,...o,ref:n})}));jT.displayName="DropdownMenuLabel";var DT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(sT,{...i,...o,ref:n})}));DT.displayName="DropdownMenuItem";var TT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(aT,{...i,...o,ref:n})}));TT.displayName="DropdownMenuCheckboxItem";lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(lT,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var MT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(cT,{...i,...o,ref:n})}));MT.displayName="DropdownMenuRadioItem";var OT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(uT,{...i,...o,ref:n})}));OT.displayName="DropdownMenuItemIndicator";var AT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(dT,{...i,...o,ref:n})}));AT.displayName="DropdownMenuSeparator";lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(hT,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var NT=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(fT,{...i,...o,ref:n})}));NT.displayName="DropdownMenuSubTrigger";var _T=lt.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=yT(r);return t.jsx(pT,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));_T.displayName="DropdownMenuSubContent";var RT=CT,LT=PT,$T=jT,FT=DT,IT=TT,qT=MT,zT=OT,VT=AT,BT=NT,UT=_T;const KT=xT,WT=ST;lt.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(BT,{ref:i,className:Ww("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(zb,{className:"ml-auto"})]}))).displayName=BT.displayName;lt.forwardRef((({className:e,...n},r)=>t.jsx(UT,{ref:r,className:Ww("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=UT.displayName;const HT=lt.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(RT,{children:t.jsx(LT,{ref:o,sideOffset:n,className:Ww("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));HT.displayName=LT.displayName;const GT=lt.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(FT,{ref:o,className:Ww("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));GT.displayName=FT.displayName;lt.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(IT,{ref:i,className:Ww("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(zT,{children:t.jsx(Fb,{className:"h-4 w-4"})})}),n]}))).displayName=IT.displayName;lt.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(qT,{ref:o,className:Ww("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(zT,{children:t.jsx(Bb,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=qT.displayName;lt.forwardRef((({className:e,inset:n,...r},o)=>t.jsx($T,{ref:o,className:Ww("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=$T.displayName;const YT=lt.forwardRef((({className:e,...n},r)=>t.jsx(VT,{ref:r,className:Ww("-mx-1 my-1 h-px bg-muted",e),...n})));YT.displayName=VT.displayName;const QT=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:"flex items-center gap-3 py-3",children:[t.jsx("div",n?{className:"w-6 h-6 flex items-center justify-center",children:t.jsx(Fb,{className:"w-4 h-4 text-emerald-500"})}:{className:"w-6 h-6 flex items-center justify-center",children:t.jsx(Ub,{className:Ww("w-4 h-4",r?"text-[var(--reach-primary)]":"text-gray-600")})}),t.jsx("span",{className:Ww("text-sm font-medium",r?"text-gray-900":"text-gray-400"),children:e})]});function XT(...e){return Kw(Zb(e))}const JT=({iconDefinitions:e,tailwindClassDefinitions:n,handleBack:r,handleNext:o,backText:i,nextText:s,backDisabled:a,nextDisabled:l,hideBack:c})=>t.jsxs("div",{className:"flex gap-4",children:[!c&&t.jsxs(zS,{onClick:r,disabled:a,className:XT("flex items-center gap-2",n.SecondaryButton,n.SecondaryButtonHover,a&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:i})]}),t.jsxs(zS,{onClick:o,disabled:l,className:XT("flex items-center gap-2",n.PrimaryButton,n.PrimaryButtonHover,l&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:s}),t.jsx(e.NextButton,{})]})]}),ZT=()=>{const e=pn({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await tu("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var eM=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(eM||{});const tM=()=>{const e=pn({queryKey:["channel-senders"],queryFn:()=>(async()=>(await tu("/channel/senders",{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},nM=()=>{const e=sn(),t=gn({mutationFn:e=>(async e=>(await tu(`${Eb}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},rM=(e,t)=>{const n=sn(),r=gn({mutationFn:e=>(async e=>(await tu(`${Eb}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Pb(e,{action:[...t.action_data||[],{action_type:"send_communication",action_metadata:{action_type:"send_communication",communication_group_id:r.id}}]}),n.invalidateQueries({queryKey:["automations"]}),n.invalidateQueries({queryKey:["communicationGroups"]}),r)});return{createCommunicationForAutomation:r.mutate,isCreating:r.isPending}},oM=()=>{const e=sn(),t=gn({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await tu(`${Eb}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},iM=lt.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Ww("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));iM.displayName="Input";var sM=lt.forwardRef(((e,n)=>t.jsx(_x.label,{...e,ref:n,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));sM.displayName="Label";var aM=sM;const lM=FS("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),cM=lt.forwardRef((({className:e,...n},r)=>t.jsx(aM,{ref:r,className:Ww(lM(),e),...n})));function uM(e,[t,n]){return Math.min(n,Math.max(t,e))}cM.displayName=aM.displayName;var dM=lt.forwardRef(((e,n)=>t.jsx(_x.span,{...e,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));dM.displayName="VisuallyHidden";var hM=[" ","Enter","ArrowUp","ArrowDown"],fM=[" ","Enter"],pM="Select",[gM,mM,vM]=Tx(pM),[yM,bM]=bx(pM,[vM,Tj]),wM=Tj(),[xM,kM]=yM(pM),[SM,CM]=yM(pM),EM=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:i,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:p,form:g}=e,m=wM(n),[v,y]=lt.useState(null),[b,w]=lt.useState(null),[x,k]=lt.useState(!1),S=Ix(u),[C=!1,E]=$x({prop:o,defaultProp:i,onChange:s}),[P,j]=$x({prop:a,defaultProp:l,onChange:c}),D=lt.useRef(null),T=!v||(g||!!v.closest("form")),[M,O]=lt.useState(new Set),A=Array.from(M).map((e=>e.props.value)).join(";");return t.jsx(Kj,{...m,children:t.jsxs(xM,{required:p,scope:n,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:k,contentId:Nx(),value:P,onValueChange:j,open:C,onOpenChange:E,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[t.jsx(gM.Provider,{scope:n,children:t.jsx(SM,{scope:e.__scopeSelect,onNativeOptionAdd:lt.useCallback((e=>{O((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:lt.useCallback((e=>{O((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),T?t.jsxs(dO,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:e=>j(e.target.value),disabled:f,form:g,children:[void 0===P?t.jsx("option",{value:""}):null,Array.from(M)]},A):null]})})};EM.displayName=pM;var PM="SelectTrigger",jM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...i}=e,s=wM(r),a=kM(PM,r),l=a.disabled||o,c=Sx(n,a.onTriggerChange),u=mM(r),d=lt.useRef("touch"),[h,f,p]=hO((e=>{const t=u().filter((e=>!e.disabled)),n=t.find((e=>e.value===a.value)),r=fO(t,e,n);void 0!==r&&a.onValueChange(r.value)})),g=e=>{l||(a.onOpenChange(!0),p()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Wj,{asChild:!0,...s,children:t.jsx(_x.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":uO(a.value)?"":void 0,...i,ref:c,onClick:yx(i.onClick,(e=>{e.currentTarget.focus(),"mouse"!==d.current&&g(e)})),onPointerDown:yx(i.onPointerDown,(e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:yx(i.onKeyDown,(e=>{const t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||hM.includes(e.key)&&(g(),e.preventDefault())}))})})}));jM.displayName=PM;var DM="SelectValue",TM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=kM(DM,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Sx(n,c.onValueNodeChange);return Mx((()=>{u(d)}),[u,d]),t.jsx(_x.span,{...l,ref:h,style:{pointerEvents:"none"},children:uO(c.value)?t.jsx(t.Fragment,{children:a}):s})}));TM.displayName=DM;var MM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(_x.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));MM.displayName="SelectIcon";var OM=e=>t.jsx(aC,{asChild:!0,...e});OM.displayName="SelectPortal";var AM="SelectContent",NM=lt.forwardRef(((e,n)=>{const r=kM(AM,e.__scopeSelect),[o,i]=lt.useState();if(Mx((()=>{i(new DocumentFragment)}),[]),!r.open){const n=o;return n?ct.createPortal(t.jsx(RM,{scope:e.__scopeSelect,children:t.jsx(gM.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx($M,{...e,ref:n})}));NM.displayName=AM;var _M=10,[RM,LM]=yM(AM),$M=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v,...y}=e,b=kM(AM,r),[w,x]=lt.useState(null),[k,S]=lt.useState(null),C=Sx(n,(e=>x(e))),[E,P]=lt.useState(null),[j,D]=lt.useState(null),T=mM(r),[M,O]=lt.useState(!1),A=lt.useRef(!1);lt.useEffect((()=>{if(w)return oE(w)}),[w]),cC();const N=lt.useCallback((e=>{const[t,...n]=T().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(null==i||i.scrollIntoView({block:"nearest"}),i===t&&k&&(k.scrollTop=0),i===r&&k&&(k.scrollTop=k.scrollHeight),null==i||i.focus(),document.activeElement!==o)return}}),[T,k]),_=lt.useCallback((()=>N([E,w])),[N,E,w]);lt.useEffect((()=>{M&&_()}),[M,_]);const{onOpenChange:R,triggerPointerDownPosRef:L}=b;lt.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{var n,r,o,i;e={x:Math.abs(Math.round(t.pageX)-(null!=(r=null==(n=L.current)?void 0:n.x)?r:0)),y:Math.abs(Math.round(t.pageY)-(null!=(i=null==(o=L.current)?void 0:o.y)?i:0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||R(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,R,L]),lt.useEffect((()=>{const e=()=>R(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[R]);const[$,F]=hO((e=>{const t=T().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=fO(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),I=lt.useCallback(((e,t,n)=>{const r=!A.current&&!n;(void 0!==b.value&&b.value===t||r)&&(P(e),r&&(A.current=!0))}),[b.value]),q=lt.useCallback((()=>null==w?void 0:w.focus()),[w]),z=lt.useCallback(((e,t,n)=>{(void 0!==b.value&&b.value===t||!A.current&&!n)&&D(e)}),[b.value]),V="popper"===o?IM:FM,B=V===IM?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return t.jsx(RM,{scope:r,content:w,viewport:k,onViewportChange:S,itemRefCallback:I,selectedItem:E,onItemLeave:q,itemTextRefCallback:z,focusSelectedItem:_,selectedItemText:j,position:o,isPositioned:M,searchRef:$,children:t.jsx(XC,{as:Cx,allowPinchZoom:!0,children:t.jsx(eC,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:yx(i,(e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(GS,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...B,onPlaced:()=>O(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:yx(y.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>N(t))),e.preventDefault()}}))})})})})})}));$M.displayName="SelectContentImpl";var FM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...i}=e,s=kM(AM,r),a=LM(AM,r),[l,c]=lt.useState(null),[u,d]=lt.useState(null),h=Sx(n,(e=>d(e))),f=mM(r),p=lt.useRef(!1),g=lt.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=a,w=lt.useCallback((()=>{if(s.trigger&&s.valueNode&&l&&u&&m&&v&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=y.getBoundingClientRect();if("rtl"!==s.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-_M,c=uM(o,[_M,Math.max(_M,a-s)]);l.style.minWidth=i+"px",l.style.left=c+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),c=window.innerWidth-_M,u=uM(o,[_M,Math.max(_M,c-a)]);l.style.minWidth=s+"px",l.style.right=u+"px"}const i=f(),a=window.innerHeight-2*_M,c=m.scrollHeight,d=window.getComputedStyle(u),h=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),w=h+g+c+parseInt(d.paddingBottom,10)+b,x=Math.min(5*v.offsetHeight,w),k=window.getComputedStyle(m),S=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),E=e.top+e.height/2-_M,P=a-E,j=v.offsetHeight/2,D=h+g+(v.offsetTop+j),T=w-D;if(D<=E){const e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";const t=Math.max(P,j+(e?C:0)+(u.clientHeight-m.offsetTop-m.offsetHeight)+b);l.style.height=D+t+"px"}else{const e=i.length>0&&v===i[0].ref.current;l.style.top="0px";const t=Math.max(E,h+m.offsetTop+(e?S:0)+j);l.style.height=t+T+"px",m.scrollTop=D-E+m.offsetTop}l.style.margin=`${_M}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=a+"px",null==o||o(),requestAnimationFrame((()=>p.current=!0))}}),[f,s.trigger,s.valueNode,l,u,m,v,y,s.dir,o]);Mx((()=>w()),[w]);const[x,k]=lt.useState();Mx((()=>{u&&k(window.getComputedStyle(u).zIndex)}),[u]);const S=lt.useCallback((e=>{e&&!0===g.current&&(w(),null==b||b(),g.current=!1)}),[w,b]);return t.jsx(qM,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:t.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:t.jsx(_x.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})}));FM.displayName="SelectItemAlignedPosition";var IM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=_M,...s}=e,a=wM(r);return t.jsx(Hj,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));IM.displayName="SelectPopperPosition";var[qM,zM]=yM(AM,{}),VM="SelectViewport",BM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...i}=e,s=LM(VM,r),a=zM(VM,r),l=Sx(n,s.onViewportChange),c=lt.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(gM.Slot,{scope:r,children:t.jsx(_x.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:yx(i.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=a;if((null==r?void 0:r.current)&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*_M,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop}))})})]})}));BM.displayName=VM;var UM="SelectGroup",[KM,WM]=yM(UM);lt.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=Nx();return t.jsx(KM,{scope:r,id:i,children:t.jsx(_x.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=UM;var HM="SelectLabel",GM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=WM(HM,r);return t.jsx(_x.div,{id:i.id,...o,ref:n})}));GM.displayName=HM;var YM="SelectItem",[QM,XM]=yM(YM),JM=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:s,...a}=e,l=kM(YM,r),c=LM(YM,r),u=l.value===o,[d,h]=lt.useState(null!=s?s:""),[f,p]=lt.useState(!1),g=Sx(n,(e=>{var t;return null==(t=c.itemRefCallback)?void 0:t.call(c,e,o,i)})),m=Nx(),v=lt.useRef("touch"),y=()=>{i||(l.onValueChange(o),l.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(QM,{scope:r,value:o,disabled:i,textId:m,isSelected:u,onItemTextChange:lt.useCallback((e=>{h((t=>{var n;return t||(null!=(n=null==e?void 0:e.textContent)?n:"").trim()}))}),[]),children:t.jsx(gM.ItemSlot,{scope:r,value:o,disabled:i,textValue:d,children:t.jsx(_x.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:g,onFocus:yx(a.onFocus,(()=>p(!0))),onBlur:yx(a.onBlur,(()=>p(!1))),onClick:yx(a.onClick,(()=>{"mouse"!==v.current&&y()})),onPointerUp:yx(a.onPointerUp,(()=>{"mouse"===v.current&&y()})),onPointerDown:yx(a.onPointerDown,(e=>{v.current=e.pointerType})),onPointerMove:yx(a.onPointerMove,(e=>{var t;v.current=e.pointerType,i?null==(t=c.onItemLeave)||t.call(c):"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:yx(a.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null==(t=c.onItemLeave)||t.call(c))})),onKeyDown:yx(a.onKeyDown,(e=>{var t;""!==(null==(t=c.searchRef)?void 0:t.current)&&" "===e.key||(fM.includes(e.key)&&y()," "===e.key&&e.preventDefault())}))})})})}));JM.displayName=YM;var ZM="SelectItemText",eO=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,...s}=e,a=kM(ZM,r),l=LM(ZM,r),c=XM(ZM,r),u=CM(ZM,r),[d,h]=lt.useState(null),f=Sx(n,(e=>h(e)),c.onItemTextChange,(e=>{var t;return null==(t=l.itemTextRefCallback)?void 0:t.call(l,e,c.value,c.disabled)})),p=null==d?void 0:d.textContent,g=lt.useMemo((()=>t.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value)),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return Mx((()=>(m(g),()=>v(g))),[m,v,g]),t.jsxs(t.Fragment,{children:[t.jsx(_x.span,{id:c.textId,...s,ref:f}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ct.createPortal(s.children,a.valueNode):null]})}));eO.displayName=ZM;var tO="SelectItemIndicator",nO=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return XM(tO,r).isSelected?t.jsx(_x.span,{"aria-hidden":!0,...o,ref:n}):null}));nO.displayName=tO;var rO="SelectScrollUpButton",oO=lt.forwardRef(((e,n)=>{const r=LM(rO,e.__scopeSelect),o=zM(rO,e.__scopeSelect),[i,s]=lt.useState(!1),a=Sx(n,o.onScrollButtonChange);return Mx((()=>{if(r.viewport&&r.isPositioned){let e=function(){s(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),i?t.jsx(aO,{...e,ref:a,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));oO.displayName=rO;var iO="SelectScrollDownButton",sO=lt.forwardRef(((e,n)=>{const r=LM(iO,e.__scopeSelect),o=zM(iO,e.__scopeSelect),[i,s]=lt.useState(!1),a=Sx(n,o.onScrollButtonChange);return Mx((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),i?t.jsx(aO,{...e,ref:a,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));sO.displayName=iO;var aO=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=e,s=LM("SelectScrollButton",r),a=lt.useRef(null),l=mM(r),c=lt.useCallback((()=>{null!==a.current&&(window.clearInterval(a.current),a.current=null)}),[]);return lt.useEffect((()=>()=>c()),[c]),Mx((()=>{var e;const t=l().find((e=>e.ref.current===document.activeElement));null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})}),[l]),t.jsx(_x.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:yx(i.onPointerDown,(()=>{null===a.current&&(a.current=window.setInterval(o,50))})),onPointerMove:yx(i.onPointerMove,(()=>{var e;null==(e=s.onItemLeave)||e.call(s),null===a.current&&(a.current=window.setInterval(o,50))})),onPointerLeave:yx(i.onPointerLeave,(()=>{c()}))})})),lO=lt.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(_x.div,{"aria-hidden":!0,...o,ref:n})}));lO.displayName="SelectSeparator";var cO="SelectArrow";function uO(e){return""===e||void 0===e}lt.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=wM(r),s=kM(cO,r),a=LM(cO,r);return s.open&&"popper"===a.position?t.jsx(Gj,{...i,...o,ref:n}):null})).displayName=cO;var dO=lt.forwardRef(((e,n)=>{const{value:r,...o}=e,i=lt.useRef(null),s=Sx(n,i),a=function(e){const t=lt.useRef({value:e,previous:e});return lt.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(r);return lt.useEffect((()=>{const e=i.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(a!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[a,r]),t.jsx(dM,{asChild:!0,children:t.jsx("select",{...o,ref:s,defaultValue:r})})}));function hO(e){const t=Lx(e),n=lt.useRef(""),r=lt.useRef(0),o=lt.useCallback((e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(o)}),[t]),i=lt.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return lt.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,i]}function fO(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}dO.displayName="BubbleSelect";var pO=jM,gO=MM,mO=OM,vO=NM,yO=BM,bO=GM,wO=JM,xO=eO,kO=nO,SO=oO,CO=sO,EO=lO;const PO=EM,jO=TM,DO=lt.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(pO,{ref:o,className:Ww("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(gO,{asChild:!0,children:t.jsx(Ib,{className:"h-4 w-4 opacity-50"})})]})));DO.displayName=pO.displayName;const TO=lt.forwardRef((({className:e,...n},r)=>t.jsx(SO,{ref:r,className:Ww("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Vb,{className:"h-4 w-4"})})));TO.displayName=SO.displayName;const MO=lt.forwardRef((({className:e,...n},r)=>t.jsx(CO,{ref:r,className:Ww("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Ib,{className:"h-4 w-4"})})));MO.displayName=CO.displayName;const OO=lt.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(mO,{children:t.jsxs(vO,{ref:i,className:Ww("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(TO,{}),t.jsx(yO,{className:Ww("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(MO,{})]})})));OO.displayName=vO.displayName;lt.forwardRef((({className:e,...n},r)=>t.jsx(bO,{ref:r,className:Ww("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=bO.displayName;const AO=lt.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(wO,{ref:o,className:Ww("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(kO,{children:t.jsx(Fb,{className:"h-4 w-4"})})}),t.jsx(xO,{children:n})]})));AO.displayName=wO.displayName;lt.forwardRef((({className:e,...n},r)=>t.jsx(EO,{ref:r,className:Ww("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=EO.displayName;const NO=({automation:e})=>{var r,o,i;const s=n.useCallback((()=>{var t;const n=null==(t=e.action_data)?void 0:t.find((e=>"send_communication"===e.action_type));return null==n?void 0:n.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(null!=(r=s())?r:null),[c,u]=n.useState(!1),[d,h]=n.useState(null),[f,p]=n.useState(null),[g,m]=n.useState(null),[v,y]=n.useState(null),{channelSenders:b}=tM(),{channelAccounts:w}=ZT(),{getCommunicationGroup:x}=nM(),{createCommunicationForAutomation:k}=rM(e.id,e),{updateCommunicationGroup:S}=oM(),{updateAutomation:C}=Mb(e.id);if(n.useEffect((()=>{d&&f&&v&&!c&&(u(!0),a?S({groupId:a,params:{email_channel_sender_id:d,email_html_body:v,email_subject:f,...g&&{email_preview_text:g}}}):k({email_channel_sender_id:d,email_html_body:v,email_subject:f,...g&&{email_preview_text:g}},{onSuccess:e=>{l(e.id)}}),u(!1))}),[d,f,g,v,e.action_data,S,C,s,a,c,k]),n.useEffect((()=>{a&&x(a,{onSuccess:e=>{h(e.email_channel_sender_id),p(e.email_subject),m(e.email_preview_text),y(e.email_html_body)}})}),[s,x,e.action_data,e,a]),!w||!b)return t.jsx("div",{children:t.jsx(kb,{text:["Loading..."]})});const E=null==(o=b.channel_senders)?void 0:o.filter((e=>e.channel_sender_metadata.userPart)),P=null==E?void 0:E.map((e=>{var t;const n=null==(t=w.channel_accounts)?void 0:t.find((t=>t.id===e.channel_account_id));if(!n)return null;switch(n.channel_account_metadata.type){case eM.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${n.channel_account_metadata.baseDomain}.embedreach.org`};case eM.TWILLIO:return null;default:throw lx(n.channel_account_metadata.type,eM)}})).filter((e=>null!==e));return t.jsx("div",{children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(cM,{children:"From Email"}),t.jsxs(PO,{onValueChange:e=>{h(e)},value:null!=d?d:void 0,children:[t.jsx(DO,{children:t.jsx(jO,{placeholder:"Select email",children:d?null==(i=null==P?void 0:P.find((e=>e.channel_sender_id===d)))?void 0:i.full_domain:""})}),t.jsx(OO,{children:null==P?void 0:P.map((e=>t.jsx(AO,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(cM,{children:"Subject"}),t.jsx(iM,{placeholder:"Enter email subject",value:null!=f?f:"",onChange:e=>p(e.target.value)})]}),t.jsxs("div",{children:[t.jsx(cM,{children:"Preview Text"}),t.jsx(iM,{placeholder:"Enter preview text",value:null!=g?g:"",onChange:e=>m(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsx("div",{className:"flex justify-between items-center mb-4",children:t.jsx("h3",{className:"font-medium",children:"Preview"})}),t.jsx(iM,{className:"min-h-[300px]",placeholder:"Email content preview...",value:null!=v?v:"",onChange:e=>y(e.target.value)})]})]})})},_O=({automation:e})=>{var r,o,i;const[s,a]=n.useState(!1),l=n.useCallback((()=>{var t;const n=null==(t=e.action_data)?void 0:t.find((e=>"send_communication"===e.action_type));return null==n?void 0:n.action_metadata.communication_group_id}),[e.action_data]),[c,u]=n.useState(null),[d,h]=n.useState(null),[f,p]=n.useState(null!=(r=l())?r:null),{channelSenders:g}=tM(),{channelAccounts:m}=ZT(),{createCommunicationForAutomation:v}=rM(e.id,e),{updateCommunicationGroup:y}=oM(),{getCommunicationGroup:b}=nM(),{updateAutomation:w}=Mb(e.id);if(n.useEffect((()=>{null===c||null===d||s||(a(!0),f?y({groupId:f,params:{sms_channel_sender_id:c,sms_message_body:d}}):v({sms_channel_sender_id:c,sms_message_body:d},{onSuccess:e=>{p(e.id)}}),a(!1))}),[c,d,s,e.action_data,f,v,w,y]),n.useEffect((()=>{f&&b(f,{onSuccess:e=>{u(e.sms_channel_sender_id),h(e.sms_message_body)}})}),[e.action_data,f,b]),!m||!g)return t.jsx("div",{children:t.jsx(kb,{text:["Loading..."]})});const x=null==(o=g.channel_senders)?void 0:o.filter((e=>e.channel_sender_metadata.from));return t.jsx("div",{children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{children:[t.jsx(cM,{children:"From Number"}),t.jsxs(PO,{onValueChange:e=>{u(e)},value:null!=c?c:void 0,children:[t.jsx(DO,{children:t.jsx(jO,{placeholder:"Select number",children:c?null==(i=null==x?void 0:x.find((e=>e.id===c)))?void 0:i.channel_sender_metadata.from:""})}),t.jsx(OO,{children:null==x?void 0:x.map((e=>t.jsx(AO,{value:e.id,children:e.channel_sender_metadata.from},e.id)))})]})]})}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsx("div",{className:"flex justify-between items-center mb-4",children:t.jsx("h3",{className:"font-medium",children:"Preview"})}),t.jsxs("div",{className:"relative",children:[t.jsx(iM,{className:"min-h-[300px]",placeholder:"Text message preview...",value:null!=d?d:"",onChange:e=>{h(e.target.value.slice(0,1600))},maxLength:1600}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(d&&d.length>1400?d.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[d?d.length:0,"/1600 characters"]})]})]})]})})},RO=({automation:e})=>t.jsxs("div",{className:"p-6",children:[t.jsx("h2",{className:"text-lg font-semibold mb-6",children:"Edit Message Content"}),t.jsxs(Ck,{defaultValue:"email",className:"w-full",children:[t.jsxs(Ek,{className:"mb-6 w-full justify-center",children:[t.jsx(Pk,{value:"email",children:"Email"}),t.jsx(Pk,{value:"text",children:"Text Message"})]}),t.jsx(jk,{value:"email",className:"space-y-6",children:t.jsx(NO,{automation:e})}),t.jsx(jk,{value:"text",className:"space-y-6",children:t.jsx(_O,{automation:e})})]})]});function LO(e){return(LO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $O(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function FO(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function IO(e){FO(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===LO(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function qO(e,t){FO(2,arguments);var n=IO(e),r=$O(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function zO(e,t){FO(2,arguments);var n=IO(e),r=$O(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var VO={};function BO(){return VO}function UO(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=BO(),d=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=IO(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function KO(e){return FO(1,arguments),UO(e,{weekStartsOn:1})}function WO(e){FO(1,arguments);var t=function(e){FO(1,arguments);var t=IO(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=KO(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=KO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),KO(n)}function HO(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function GO(e){FO(1,arguments);var t=IO(e);return t.setHours(0,0,0,0),t}function YO(e,t){FO(2,arguments);var n=GO(e),r=GO(t),o=n.getTime()-HO(n),i=r.getTime()-HO(r);return Math.round((o-i)/864e5)}function QO(e,t){return FO(2,arguments),qO(e,7*$O(t))}function XO(e,t){return FO(2,arguments),zO(e,12*$O(t))}function JO(e,t){FO(2,arguments);var n=GO(e),r=GO(t);return n.getTime()===r.getTime()}function ZO(e){return FO(1,arguments),e instanceof Date||"object"===LO(e)&&"[object Date]"===Object.prototype.toString.call(e)}function eA(e,t){FO(2,arguments);var n=IO(e),r=IO(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function tA(e){FO(1,arguments);var t=IO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function nA(e){FO(1,arguments);var t=IO(e);return t.setDate(1),t.setHours(0,0,0,0),t}function rA(e){FO(1,arguments);var t=IO(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function oA(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=BO(),d=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=IO(e),f=h.getDay(),p=6+(f<d?-7:0)-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function iA(e){return FO(1,arguments),oA(e,{weekStartsOn:1})}function sA(e,t){return FO(2,arguments),function(e,t){FO(2,arguments);var n=IO(e).getTime(),r=$O(t);return new Date(n+r)}(e,-$O(t))}function aA(e){FO(1,arguments);var t=IO(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function lA(e){FO(1,arguments);var t=IO(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=aA(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=aA(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function cA(e){FO(1,arguments);var t=IO(e),n=aA(t).getTime()-function(e){FO(1,arguments);var t=lA(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),aA(n)}(t).getTime();return Math.round(n/6048e5)+1}function uA(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=BO(),d=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=IO(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function dA(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=IO(e),d=u.getUTCFullYear(),h=BO(),f=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var g=uA(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var v=uA(m,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function hA(e,t){FO(1,arguments);var n=IO(e),r=uA(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=BO(),d=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=dA(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),uA(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function fA(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var pA=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return fA("yy"===t?r%100:r,t.length)},gA=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):fA(n+1,2)},mA=function(e,t){return fA(e.getUTCDate(),t.length)},vA=function(e,t){return fA(e.getUTCHours()%12||12,t.length)},yA=function(e,t){return fA(e.getUTCHours(),t.length)},bA=function(e,t){return fA(e.getUTCMinutes(),t.length)},wA=function(e,t){return fA(e.getUTCSeconds(),t.length)},xA=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return fA(Math.floor(r*Math.pow(10,n-3)),t.length)},kA="midnight",SA="noon",CA="morning",EA="afternoon",PA="evening",jA="night",DA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return pA(e,t)},Y:function(e,t,n,r){var o=dA(e,r),i=o>0?o:1-o;return"YY"===t?fA(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):fA(i,t.length)},R:function(e,t){return fA(lA(e),t.length)},u:function(e,t){return fA(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return fA(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return fA(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return gA(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return fA(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=hA(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):fA(o,t.length)},I:function(e,t,n){var r=cA(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):fA(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):mA(e,t)},D:function(e,t,n){var r=function(e){FO(1,arguments);var t=IO(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):fA(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return fA(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return fA(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return fA(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?SA:0===o?kA:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?PA:o>=12?EA:o>=4?CA:jA,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return vA(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):yA(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):fA(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):fA(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):bA(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):wA(e,t)},S:function(e,t){return xA(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return MA(o);case"XXXX":case"XX":return OA(o);default:return OA(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return MA(o);case"xxxx":case"xx":return OA(o);default:return OA(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+TA(o,":");default:return"GMT"+OA(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+TA(o,":");default:return"GMT"+OA(o,":")}},t:function(e,t,n,r){return fA(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return fA((r._originalDate||e).getTime(),t.length)}};function TA(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+fA(i,2)}function MA(e,t){return e%60==0?(e>0?"-":"+")+fA(Math.abs(e)/60,2):OA(e,t)}function OA(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+fA(Math.floor(o/60),2)+n+fA(o%60,2)}var AA=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},NA=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},_A={p:NA,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return AA(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",AA(o,t)).replace("{{time}}",NA(i,t))}},RA=["D","DD"],LA=["YY","YYYY"];function $A(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var FA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function IA(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var qA={date:IA({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:IA({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:IA({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},zA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function VA(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var BA={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:VA({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:VA({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:VA({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:VA({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:VA({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function UA(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var KA={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:UA({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:UA({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:UA({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:UA({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:UA({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},WA={code:"en-US",formatDistance:function(e,t,n){var r,o=FA[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:qA,formatRelative:function(e,t,n,r){return zA[e]},localize:BA,match:KA,options:{weekStartsOn:0,firstWeekContainsDate:1}},HA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,GA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YA=/^'([^]*?)'?$/,QA=/''/g,XA=/[a-zA-Z]/;function JA(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,g,m,v,y,b,w;FO(2,arguments);var x=String(t),k=BO(),S=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:k.locale)&&void 0!==r?r:WA,C=$O(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:k.firstWeekContainsDate)&&void 0!==s?s:null===(d=k.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=$O(null!==(f=null!==(p=null!==(g=null!==(m=null==n?void 0:n.weekStartsOn)&&void 0!==m?m:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==g?g:k.weekStartsOn)&&void 0!==p?p:null===(b=k.locale)||void 0===b||null===(w=b.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var P=IO(e);if(!function(e){if(FO(1,arguments),!ZO(e)&&"number"!=typeof e)return!1;var t=IO(e);return!isNaN(Number(t))}(P))throw new RangeError("Invalid time value");var j=sA(P,HO(P)),D={firstWeekContainsDate:C,weekStartsOn:E,locale:S,_originalDate:P};return x.match(GA).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,_A[t])(e,S.formatLong):e})).join("").match(HA).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(YA);if(!t)return e;return t[1].replace(QA,"'")}(r);var i=DA[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===LA.indexOf(r)||$A(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==RA.indexOf(e)}(r)||$A(r,t,String(e)),i(j,r,S.localize,D);if(o.match(XA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function ZA(e){return FO(1,arguments),Math.floor(function(e){return FO(1,arguments),IO(e).getTime()}(e)/1e3)}function eN(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=BO(),d=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=function(e,t){var n,r,o,i,s,a,l,c;FO(1,arguments);var u=IO(e),d=u.getFullYear(),h=BO(),f=$O(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var g=UO(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var v=UO(m,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),UO(f,t)}function tN(e,t){return FO(1,arguments),function(e,t,n){FO(2,arguments);var r=UO(e,n),o=UO(t,n),i=r.getTime()-HO(r),s=o.getTime()-HO(o);return Math.round((i-s)/6048e5)}(function(e){FO(1,arguments);var t=IO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),nA(e),t)+1}function nN(e,t){FO(2,arguments);var n=IO(e),r=IO(t);return n.getTime()>r.getTime()}function rN(e,t){FO(2,arguments);var n=IO(e),r=IO(t);return n.getTime()<r.getTime()}function oN(e,t){FO(2,arguments);var n=IO(e),r=IO(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function iN(e,t){return FO(2,arguments),qO(e,-$O(t))}function sN(e,t){FO(2,arguments);var n=IO(e),r=$O(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){FO(1,arguments);var t=IO(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function aN(e,t){FO(2,arguments);var n=IO(e),r=$O(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var lN=function(){return lN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lN.apply(this,arguments)};function cN(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function uN(e){return"multiple"===e.mode}function dN(e){return"range"===e.mode}function hN(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var fN={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var pN=Object.freeze({__proto__:null,formatCaption:function(e,t){return JA(e,"LLLL y",t)},formatDay:function(e,t){return JA(e,"d",t)},formatMonthCaption:function(e,t){return JA(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return JA(e,"cccccc",t)},formatYearCaption:function(e,t){return JA(e,"yyyy",t)}}),gN=Object.freeze({__proto__:null,labelDay:function(e,t,n){return JA(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return JA(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var mN=n.createContext(void 0);function vN(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:fN,formatters:pN,labels:gN,locale:WA,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=nA(r):t&&(i=new Date(t,0,1)),o?s=tA(o):n&&(s=new Date(n,11,31)),{fromDate:i?GO(i):void 0,toDate:s?GO(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(hN(o)||uN(o)||dN(o))&&(r=o.onSelect);var u=lN(lN(lN({},i),o),{captionLayout:c,classNames:lN(lN({},i.classNames),o.classNames),components:lN({},o.components),formatters:lN(lN({},i.formatters),o.formatters),fromDate:a,labels:lN(lN({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:lN(lN({},i.modifiers),o.modifiers),modifiersClassNames:lN(lN({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:lN(lN({},i.styles),o.styles),toDate:l});return t.jsx(mN.Provider,{value:u,children:e.children})}function yN(){var e=n.useContext(mN);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function bN(e){var n=yN();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function wN(e){return t.jsx("svg",lN({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function xN(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=yN(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:wN;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function kN(e){var n,r=yN(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var h=[];if(function(e,t){FO(2,arguments);var n=IO(e),r=IO(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=nA(o),p=o.getMonth();p<=i.getMonth();p++)h.push(sN(f,p));else for(f=nA(new Date),p=0;p<=11;p++)h.push(sN(f,p));var g=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:xN;return t.jsx(g,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=sN(nA(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:h.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function SN(e){var n,r=e.displayMonth,o=yN(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,h=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var p=i.getFullYear(),g=s.getFullYear(),m=p;m<=g;m++)f.push(aN(rA(new Date),m));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:xN;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=aN(nA(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function CN(){var e=yN(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&eA(n,t)<0&&(t=zO(n,-1*(i-1))),r&&eA(t,r)<0&&(t=r),nA(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=nA(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var EN=n.createContext(void 0);function PN(e){var n=yN(),r=CN(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=nA(e),i=eA(nA(zO(o,r)),o),s=[],a=0;a<i;a++){var l=zO(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=nA(e);if(!n)return zO(s,i);if(!(eA(n,e)<o))return zO(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=nA(e);if(!n)return zO(i,-o);if(!(eA(i,n)<=0))return zO(i,-o)}}(o,n),c=function(e){return s.some((function(t){return oN(e,t)}))};return t.jsx(EN.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&rN(e,t)?i(zO(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function jN(){var e=n.useContext(EN);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function DN(e){var n,r=yN(),o=r.classNames,i=r.styles,s=r.components,a=jN().goToMonth,l=function(t){a(zO(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:bN,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(kN,{onChange:l,displayMonth:e.displayMonth}),t.jsx(SN,{onChange:l,displayMonth:e.displayMonth})]})}function TN(e){return t.jsx("svg",lN({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function MN(e){return t.jsx("svg",lN({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var ON=n.forwardRef((function(e,n){var r=yN(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=lN(lN({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",lN({},e,{ref:n,type:"button",className:a,style:l}))}));function AN(e){var n,r,o=yN(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,h=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),p=[a.nav_button,a.nav_button_previous].join(" "),g=d(e.nextMonth,{locale:s}),m=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:MN,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:TN;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(ON,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(ON,{name:"next-month","aria-label":g,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})})]})}function NN(e){var n=yN().numberOfMonths,r=jN(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return oN(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(AN,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function _N(e){var n,r,o=yN(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:bN;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(DN,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(DN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(NN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(NN,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function RN(e){var n=yN(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function LN(){var e=yN(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?KO(new Date):UO(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=qO(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function $N(){var e,n=yN(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:LN;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function FN(e){var n=yN();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var IN=n.createContext(void 0);function qN(e){if(!uN(e.initialProps)){return t.jsx(IN.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(zN,{initialProps:e.initialProps,children:e.children})}function zN(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return JO(t,e)}));return Boolean(t&&!n)})),t.jsx(IN.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?cN([],o):[];if(t.selected){var u=c.findIndex((function(t){return JO(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function VN(){var e=n.useContext(IN);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var BN,UN,KN=n.createContext(void 0);function WN(e){if(!dN(e.initialProps)){return t.jsx(KN.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(HN,{initialProps:e.initialProps,children:e.children})}function HN(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],JO(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:iN(s,l-1),before:qO(s,l-1)}),s&&a&&u.disabled.push({after:s,before:qO(s,l-1)}),!s&&a&&u.disabled.push({after:iN(a,l-1),before:qO(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:qO(s,1-c)}),u.disabled.push({after:qO(s,c-1)})),s&&a){var d=c-(YO(a,s)+1);u.disabled.push({before:iN(s,d)}),u.disabled.push({after:qO(a,d)})}!s&&a&&(u.disabled.push({before:qO(a,1-c)}),u.disabled.push({after:qO(a,c-1)}))}return t.jsx(KN.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(JO(o,e)&&JO(r,e))return;if(JO(o,e))return{from:o,to:void 0};if(JO(r,e))return;return nN(r,e)?{from:e,to:o}:{from:r,to:e}}return o?nN(e,o)?{from:o,to:e}:{from:e,to:o}:r?rN(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function GN(){var e=n.useContext(KN);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function YN(e){return Array.isArray(e)?cN([],e):void 0!==e?[e]:[]}(UN=BN||(BN={})).Outside="outside",UN.Disabled="disabled",UN.Selected="selected",UN.Hidden="hidden",UN.Today="today",UN.RangeStart="range_start",UN.RangeEnd="range_end",UN.RangeMiddle="range_middle";var QN=BN.Selected,XN=BN.Disabled,JN=BN.Hidden,ZN=BN.Today,e_=BN.RangeEnd,t_=BN.RangeMiddle,n_=BN.RangeStart,r_=BN.Outside;var o_=n.createContext(void 0);function i_(e){var n=yN(),r=function(e,t,n){var r,o=((r={})[QN]=YN(e.selected),r[XN]=YN(e.disabled),r[JN]=YN(e.hidden),r[ZN]=[e.today],r[e_]=[],r[t_]=[],r[n_]=[],r[r_]=[],r);return e.fromDate&&o[XN].push({before:e.fromDate}),e.toDate&&o[XN].push({after:e.toDate}),uN(e)?o[XN]=o[XN].concat(t.modifiers[XN]):dN(e)&&(o[XN]=o[XN].concat(n.modifiers[XN]),o[n_]=n.modifiers[n_],o[t_]=n.modifiers[t_],o[e_]=n.modifiers[e_]),o}(n,VN(),GN()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=YN(e[1])})),t}(n.modifiers),i=lN(lN({},r),o);return t.jsx(o_.Provider,{value:i,children:e.children})}function s_(){var e=n.useContext(o_);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function a_(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(ZO(t))return JO(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(ZO)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(YO(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),YO(n,i)>=0&&YO(s,n)>=0):s?JO(s,n):!!i&&JO(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=YO(t.before,e)>0,l=YO(t.after,e)<0;return nN(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?YO(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?YO(t.before,e)>0:"function"==typeof t&&t(e)}))}function l_(e,t,n){var r=Object.keys(t).reduce((function(n,r){return a_(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!oN(e,n)&&(o.outside=!0),o}function c_(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:qO,week:QO,month:zO,year:XO,startOfWeek:function(e){return o.ISOWeek?KO(e):UO(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?iA(e):oA(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(FO(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==LO(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=IO(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,h]):"after"===r&&u&&(h=function(e){var t,n;if(FO(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==LO(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=IO(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=l_(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:c_(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:lN(lN({},a),{count:a.count+1})})}var u_=n.createContext(void 0);function d_(e){var r=jN(),o=s_(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=nA(e[0]),i=tA(e[e.length-1]),s=o;s<=i;){var a=l_(s,t);if(a.disabled||a.hidden)s=qO(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=qO(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=yN(),g=function(e,t){if(s){var n=c_(s,{moveBy:e,direction:t,context:p,modifiers:o});JO(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(u_.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}},children:e.children})}function h_(){var e=n.useContext(u_);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var f_=n.createContext(void 0);function p_(e){if(!hN(e.initialProps)){return t.jsx(f_.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(g_,{initialProps:e.initialProps,children:e.children})}function g_(e){var n=e.initialProps;return t.jsx(f_.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function m_(){var e=n.useContext(f_);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function v_(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(BN).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function y_(e,r,o){var i,s,a,l=yN(),c=h_(),u=function(e,t){return l_(e,s_(),t)}(e,r),d=function(e,t){var n=yN(),r=m_(),o=VN(),i=GN(),s=h_(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,g=s.focusYearBefore,m=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;hN(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):uN(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):dN(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;h(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),y()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),h=function(){var e=yN(),t=m_(),n=VN(),r=GN();return hN(e)?t.selected:uN(e)?n.selected:dN(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&JO(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=v_(l,u).join(" "),g=function(e,t){var n=lN({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=lN(lN({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),m=Boolean(u.outside&&!l.showOutsideDays||u.hidden),v=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:FN,y={style:g,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&JO(c.focusTarget,e)&&!u.outside,w=c.focusedDay&&JO(c.focusedDay,e),x=lN(lN(lN({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=w||b?0:-1,i)),d);return{isButton:f,isHidden:m,activeModifiers:u,selectedDays:h,buttonProps:x,divProps:y}}function b_(e){var r=n.useRef(null),o=y_(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(ON,lN({name:"day",ref:r},o.buttonProps)):t.jsx("div",lN({},o.divProps))}function w_(e){var n=e.number,r=e.dates,o=yN(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(ON,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function x_(e){var n,r,o,i=yN(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:b_,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:w_;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},ZA(n))}))]})}function k_(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?iA(t):oA(t,n),o=(null==n?void 0:n.ISOWeek)?KO(e):UO(e,n),i=YO(r,o),s=[],a=0;a<=i;a++)s.push(qO(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){FO(1,arguments);var t=IO(e),n=KO(t).getTime()-WO(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){FO(1,arguments);var n=IO(e),r=UO(n,t).getTime()-eN(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function S_(e){var n,r,o,i=yN(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,p=function(e,t){var n=k_(nA(e),tA(e),t);if(null==t?void 0:t.useFixedWeeks){var r=tN(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=QO(i,6-r),a=k_(QO(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:h}),g=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:$N,m=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:x_,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:RN;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(g,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(m,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var C_="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,E_=!1,P_=0;function j_(){return"react-day-picker-".concat(++P_)}function D_(e){var r,o,i=yN(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=jN().displayMonths,d=function(e){var t,r=null!=e?e:E_?j_():null,o=n.useState(r),i=o[0],s=o[1];return C_((function(){null===i&&s(j_())}),[]),n.useEffect((function(){!1===E_&&(E_=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),h=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],p=l.month,g=0===e.displayIndex,m=e.displayIndex===u.length-1,v=!g&&!m;"rtl"===s&&(m=(r=[g,m])[0],g=r[1]),g&&(f.push(a.caption_start),p=lN(lN({},p),l.caption_start)),m&&(f.push(a.caption_end),p=lN(lN({},p),l.caption_end)),v&&(f.push(a.caption_between),p=lN(lN({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:_N;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(S_,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function T_(e){var n=yN();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function M_(e){var r,o,i=e.initialProps,s=yN(),a=h_(),l=jN(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var f=lN(lN({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return lN(lN({},e),((n={})[t]=i[t],n))}),{}),g=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:T_;return t.jsx("div",lN({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(g,{children:l.displayMonths.map((function(e,n){return t.jsx(D_,{displayIndex:n,displayMonth:e},n)}))})}))}function O_(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(vN,{initialProps:r,children:t.jsx(PN,{children:t.jsx(p_,{initialProps:r,children:t.jsx(qN,{initialProps:r,children:t.jsx(WN,{initialProps:r,children:t.jsx(i_,{children:t.jsx(d_,{children:n})})})})})})})}function A_(e){return t.jsx(O_,lN({},e,{children:t.jsx(M_,{initialProps:e})}))}const N_=FS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}});function __({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(A_,{showOutsideDays:r,className:Ww("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Ww(N_({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Ww("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Ww(N_({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(qb,{className:"h-4 w-4"}),IconRight:()=>t.jsx(zb,{className:"h-4 w-4"})},...o})}__.displayName="Calendar";var R_="Popover",[L_,$_]=bx(R_,[Tj]),F_=Tj(),[I_,q_]=L_(R_),z_=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,l=F_(n),c=lt.useRef(null),[u,d]=lt.useState(!1),[h=!1,f]=$x({prop:o,defaultProp:i,onChange:s});return t.jsx(Kj,{...l,children:t.jsx(I_,{scope:n,contentId:Nx(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:lt.useCallback((()=>f((e=>!e))),[f]),hasCustomAnchor:u,onCustomAnchorAdd:lt.useCallback((()=>d(!0)),[]),onCustomAnchorRemove:lt.useCallback((()=>d(!1)),[]),modal:a,children:r})})};z_.displayName=R_;var V_="PopoverAnchor";lt.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=q_(V_,r),s=F_(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=i;return lt.useEffect((()=>(a(),()=>l())),[a,l]),t.jsx(Wj,{...s,...o,ref:n})})).displayName=V_;var B_="PopoverTrigger",U_=lt.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=q_(B_,r),s=F_(r),a=Sx(n,i.triggerRef),l=t.jsx(_x.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tR(i.open),...o,ref:a,onClick:yx(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(Wj,{asChild:!0,...s,children:l})}));U_.displayName=B_;var K_="PopoverPortal",[W_,H_]=L_(K_,{forceMount:void 0}),G_=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=q_(K_,n);return t.jsx(W_,{scope:n,forceMount:r,children:t.jsx(ok,{present:r||s.open,children:t.jsx(aC,{asChild:!0,container:i,children:o})})})};G_.displayName=K_;var Y_="PopoverContent",Q_=lt.forwardRef(((e,n)=>{const r=H_(Y_,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=q_(Y_,e.__scopePopover);return t.jsx(ok,{present:o||s.open,children:t.jsx(s.modal?X_:J_,{...i,ref:n})})}));Q_.displayName=Y_;var X_=lt.forwardRef(((e,n)=>{const r=q_(Y_,e.__scopePopover),o=lt.useRef(null),i=Sx(n,o),s=lt.useRef(!1);return lt.useEffect((()=>{const e=o.current;if(e)return oE(e)}),[]),t.jsx(XC,{as:Cx,allowPinchZoom:!0,children:t.jsx(Z_,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yx(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),s.current||null==(t=r.triggerRef.current)||t.focus()})),onPointerDownOutside:yx(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;s.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:yx(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),J_=lt.forwardRef(((e,n)=>{const r=q_(Y_,e.__scopePopover),o=lt.useRef(!1),i=lt.useRef(!1);return t.jsx(Z_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;null==(n=e.onCloseAutoFocus)||n.call(e,t),t.defaultPrevented||(o.current||null==(s=r.triggerRef.current)||s.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null==(n=e.onInteractOutside)||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null==(s=r.triggerRef.current)?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})})),Z_=lt.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=q_(Y_,r),p=F_(r);return cC(),t.jsx(eC,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(GS,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(Hj,{"data-state":tR(f.open),role:"dialog",id:f.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),eR="PopoverClose";lt.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=q_(eR,r);return t.jsx(_x.button,{type:"button",...o,ref:n,onClick:yx(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=eR;function tR(e){return e?"open":"closed"}lt.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=F_(r);return t.jsx(Gj,{...i,...o,ref:n})})).displayName="PopoverArrow";var nR=G_,rR=Q_;const oR=z_,iR=U_,sR=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(nR,{children:t.jsx(rR,{ref:i,align:n,sideOffset:r,className:Ww("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})));sR.displayName=rR.displayName;const aR=({automation:e})=>{const r=()=>{var t;return(null==(t=e.trigger_metadata)?void 0:t.scheduled_at)?new Date(e.trigger_metadata.scheduled_at):Hk(new Date,15)},[o,i]=lt.useState(r()),[s,a]=lt.useState(r()<new Date?"Please select a time in the future":null),[l,c]=lt.useState(MS(o,"HH:mm")),{updateAutomation:u}=Mb(e.id),d=e=>{e<Hk(new Date,15)?a("Please select a time at least 15 minutes in the future"):(a(null),i(e))};return n.useEffect((()=>{u({trigger:{trigger_type:Ob.ONE_TIME,scheduled_at:o.toISOString()}})}),[o,u]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full max-w-[440px]",children:[t.jsxs(oR,{children:[t.jsx(iR,{asChild:!0,children:t.jsxs(zS,{variant:"outline",className:Ww("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx($b,{className:"mr-2 h-4 w-4"}),o?MS(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(sR,{className:"w-auto p-0",children:t.jsx(__,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=l.split(":").map(Number);e.setHours(t,n),d(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:l,onChange:e=>{if(c(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),d(r)}},className:Ww("flex h-10 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]}),s&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),s]})]})},lR=({automation:e,iconDefinitions:r,loading:o})=>{var i,s;const a=n.useCallback((()=>{var t;const n=null==(t=e.action_data)?void 0:t.find((e=>"send_communication"===e.action_type));return null==n?void 0:n.action_metadata.communication_group_id}),[e.action_data]),[l,c]=n.useState("email"),[u,d]=n.useState("sendNow"),{updateAutomation:h}=Mb(e.id),{count:f,isLoading:p}=hx({include_segments:e.includeSegmentIds,exclude_segments:e.excludeSegmentIds}),g=a(),{getCommunicationGroup:m}=nM(),{channelSenders:v}=tM(),{channelAccounts:y}=ZT(),[b,w]=n.useState(null),[x,k]=n.useState(null),[S,C]=n.useState(null),[E,P]=n.useState(null);return n.useEffect((()=>{v&&C(v),y&&P(y)}),[v,y]),n.useEffect((()=>{g&&m(g,{onSuccess:e=>{var t,n;const r=e.email_channel_sender_id,o=e.sms_channel_sender_id,i=null==S?void 0:S.channel_senders.find((e=>e.id===r)),s=null==S?void 0:S.channel_senders.find((e=>e.id===o));if(i&&e.email_subject&&e.email_preview_text&&e.email_html_body){const n=null==(t=i.channel_sender_metadata)?void 0:t.userPart,r=null==E?void 0:E.channel_accounts.find((e=>e.id===i.channel_account_id));if(r)switch(r.channel_account_metadata.type){case eM.REACH_MANAGED:w({fromEmail:`${n}@${r.channel_account_metadata.baseDomain}.embedreach.com`,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case eM.TWILLIO:break;default:throw lx(r.channel_account_metadata.type,eM)}}if(s){const t=null==S?void 0:S.channel_senders.find((e=>e.id===o));t&&e.sms_message_body&&(null==(n=t.channel_sender_metadata)?void 0:n.from)&&k({fromPhone:t.channel_sender_metadata.from,body:e.sms_message_body})}}})}),[null==E?void 0:E.channel_accounts,null==S?void 0:S.channel_senders,g,m]),n.useEffect((()=>{b?c("email"):x&&c("sms")}),[b,x]),o?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(kb,{text:["Loading..."]})}):b||x?t.jsxs("div",{className:"max-w-6xl mx-auto p-6",children:[t.jsxs(wb.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"text-center mb-8",children:[t.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Message Preview"}),t.jsx("p",{className:"text-gray-500 mt-2 text-lg",children:"Review your automation messages before sending"})]}),t.jsxs("div",{className:"flex gap-8",children:[t.jsx(wb.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-white rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-100",children:[b&&t.jsxs("button",{onClick:()=>c("email"),className:"flex-1 py-4 px-6 text-center relative "+("email"===l?"text-primary font-medium":"text-gray-500 hover:text-gray-700"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),t.jsx("span",{children:"Email Preview"})]}),"email"===l&&t.jsx(wb.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),x&&t.jsxs("button",{onClick:()=>c("sms"),className:"flex-1 py-4 px-6 text-center relative "+("sms"===l?"text-primary font-medium":"text-gray-500 hover:text-gray-700"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===l&&t.jsx(wb.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(Rd,{mode:"wait",children:["email"===l&&b&&t.jsx(wb.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:b.fromEmail})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:b.subject})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:b.previewText})]})]}),t.jsx("div",{className:"border rounded-lg p-6 min-h-[300px] bg-white shadow-inner",children:t.jsx("div",{dangerouslySetInnerHTML:{__html:b.body},className:"prose max-w-none"})})]})},"email"),"sms"===l&&x&&t.jsx(wb.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsxs("div",{className:"max-w-sm mx-auto",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:x.fromPhone})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[400px] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-blue-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm",children:x.body})})})})]})},"sms")]})})]})}),t.jsx(wb.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full flex flex-col justify-center",children:t.jsxs("div",{className:"bg-white rounded-xl shadow-lg border border-gray-100 p-6",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"Delivery Options"}),t.jsxs("div",{className:"mb-6 bg-gray-50 rounded-lg p-6 flex flex-col justify-center",children:[t.jsx("h3",{className:"text-lg font-medium mb-3",children:"Estimated Matches"}),t.jsxs("div",{className:"flex items-center gap-3",children:[r.UserIcon&&t.jsx(r.UserIcon,{className:"w-6 h-6 text-purple-600"}),t.jsx("span",{className:"text-2xl font-bold text-purple-600",children:p?t.jsx("span",{className:"animate-pulse",children:"..."}):null!=(s=null==(i=null==f?void 0:f.count)?void 0:i.toLocaleString())?s:0}),t.jsx("span",{className:"text-gray-600",children:"users will receive this message"})]})]}),e.trigger_metadata.scheduled_at&&t.jsx("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg border border-blue-100 flex items-center",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx("p",{className:"text-md font-bold text-blue-500",children:new Date(e.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"})})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-8 max-w-2xl mx-auto",children:[t.jsxs("button",{onClick:()=>{d("sendNow"),h({trigger:{trigger_type:Ob.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})},className:"flex flex-col items-center justify-center p-4 rounded-xl transition-all "+("sendNow"===u?"bg-primary/10 border-2 border-primary text-primary":"bg-gray-50 border-2 border-gray-100 text-gray-700 hover:bg-gray-100"),children:[t.jsx("div",{className:"w-12 h-12 flex items-center justify-center mb-2",children:r.SendButton?t.jsx(r.SendButton,{className:"w-6 h-6"}):t.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})}),t.jsx("span",{className:"font-medium",children:"Send now"}),t.jsx("span",{className:"text-xs mt-1 text-center",children:"Campaign will begin sending in 5 minutes"})]}),t.jsxs("button",{onClick:()=>d("schedule"),className:"flex flex-col items-center justify-center p-4 rounded-xl transition-all "+("schedule"===u?"bg-primary/10 border-2 border-primary text-primary":"bg-gray-50 border-2 border-gray-100 text-gray-700 hover:bg-gray-100"),children:[t.jsx("div",{className:"w-12 h-12 flex items-center justify-center mb-2",children:r.ScheduleButton?t.jsx(r.ScheduleButton,{className:"w-6 h-6"}):t.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),t.jsx("span",{className:"font-medium",children:"Schedule"}),t.jsx("span",{className:"text-xs mt-1 text-center",children:"Choose date and time"})]})]}),t.jsx(Rd,{children:"schedule"===u&&t.jsx(wb.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mb-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100",children:t.jsx(aR,{automation:e})})})})]})})]})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},cR=({segments:e,allSegments:n,onRemove:r,availableSegments:o,onAddSegment:i,onCreateSegment:s})=>t.jsxs("div",{className:"relative min-h-[60px]",children:[t.jsx("div",{className:"overflow-y-auto h-[75px] flex flex-wrap gap-2 p-4 bg-gray-50 rounded-lg border border-gray-200",children:n.filter((t=>e.includes(t.id))).map((e=>t.jsxs("div",{className:"inline-flex items-center bg-gray-100 rounded-lg px-4 py-2",children:[t.jsx("span",{className:"max-w-[200px] truncate",title:e.name,children:e.name}),t.jsx("button",{className:"ml-2 text-gray-500 hover:text-gray-700",onClick:()=>r(e.id),children:"✕"})]},e.id)))}),t.jsxs(KT,{children:[t.jsx(WT,{asChild:!0,children:t.jsx("button",{className:"absolute -right-3 -top-3 w-8 h-8 bg-blue-500 hover:bg-blue-600 text-white rounded-full flex items-center justify-center shadow-md",children:"+"})}),t.jsxs(HT,{children:[o.map((e=>t.jsx(GT,{onClick:()=>i(e.id),children:e.name},e.id))),t.jsx(YT,{}),t.jsx(GT,{onClick:s,className:"text-blue-600",children:"+ Create New Segment"})]})]})]}),uR=({label:e,segments:n,allSegments:r,onAddSegment:o,onRemoveSegment:i,onCreateSegment:s})=>t.jsxs("div",{children:[t.jsx("label",{className:"block mb-2",children:e}),t.jsx("div",{className:"space-y-4",children:t.jsx(cR,{segments:n,allSegments:r,onRemove:i,availableSegments:r,onAddSegment:o,onCreateSegment:s})})]}),dR=({tailwindClassDefinitions:e,iconDefinitions:r,automation:o})=>{var i,s;const[a,l]=n.useState(!1),{segments:c,isLoading:u,refetchSegments:d}=dx(),{updateAutomation:h}=Mb(o.id),[f,p]=n.useState(o.includeSegmentIds||[]),[g,m]=n.useState(o.excludeSegmentIds||[]),{count:v,isLoading:y,refetchCount:b}=hx({include_segments:f,exclude_segments:g}),w=(e,t)=>{"include"===t?p((t=>[...t,e])):m((t=>[...t,e]))},x=(e,t)=>{"include"===t?p((t=>t.filter((t=>t!==e)))):m((t=>t.filter((t=>t!==e))))},k=()=>{l(!0)};n.useEffect((()=>{(JSON.stringify(o.includeSegmentIds)!==JSON.stringify(f)||JSON.stringify(o.excludeSegmentIds)!==JSON.stringify(g))&&(h({include_segments:f,exclude_segments:g}),b())}),[f,g,o.includeSegmentIds,o.excludeSegmentIds,h,b]);const[S,C]=n.useState(!1);return u?t.jsx("div",{children:t.jsx(kb,{text:["Fetching segments","Finishing up"]})}):t.jsxs("div",{className:"p-6",children:[t.jsx(zE,{open:a,onOpenChange:l,children:t.jsx(UE,{className:"max-w-4xl",hideCloseButton:!0,children:t.jsx(vx,{tailwindClassDefinitions:e,iconDefinitions:r,onClose:e=>{!1!==e&&"error"!==e&&d(),l(!1)}})})}),t.jsx("h2",{className:"text-2xl font-semibold",children:"Choose Audience"}),t.jsx("p",{className:"text-gray-600 mb-8",children:"The number of recipients will update in real-time as you add or remove lists."}),t.jsx("div",{className:"space-y-6 mx-auto ",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx(uR,{label:"Include Patrons from Lists",segments:f,allSegments:(null==c?void 0:c.segments)||[],onAddSegment:e=>w(e,"include"),onRemoveSegment:e=>x(e,"include"),onCreateSegment:k}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("button",{onClick:()=>C(!S),className:"flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(wb.div,{animate:{rotate:S?180:0},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Don't send to"})]}),t.jsx(Rd,{children:S&&t.jsx(wb.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(uR,{label:"Exclude Patrons from Lists",segments:g,allSegments:(null==c?void 0:c.segments)||[],onAddSegment:e=>w(e,"exclude"),onRemoveSegment:e=>x(e,"exclude"),onCreateSegment:k})})})]})]}),t.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 flex flex-col justify-center h-full",children:[t.jsx("h3",{className:"text-xl font-medium mb-6",children:"Estimated Matches"}),t.jsxs("div",{className:"flex items-center gap-3",children:[r.UserIcon&&t.jsx(r.UserIcon,{className:"w-6 h-6 text-purple-600"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-semibold text-purple-600",children:y?t.jsx("span",{className:"animate-pulse",children:"..."}):null!=(s=null==(i=null==v?void 0:v.count)?void 0:i.toLocaleString())?s:0}),t.jsx("div",{className:"text-gray-600",children:"Matching Customers"})]})]})]})]})})]})},hR=({automationId:e,tailwindClassDefinitions:r,iconDefinitions:o,setOpenEditAutomationPopup:i})=>{var s;const[a,l]=n.useState(0),{automation:c}=jb(e),[u,d]=n.useState(!1),{updateAutomation:h}=Mb(e);if(!c)return t.jsx("div",{children:t.jsx(kb,{text:["Fetching Automation data","Finishing up"]})});return t.jsxs("div",{className:"relative min-h-[500px] pb-16 flex flex-col justify-center",children:[t.jsxs("div",{className:"flex gap-8 items-center",children:[t.jsx("nav",{className:"space-y-0 w-50",children:[{id:"audience",title:"Choose Audience",isValid:()=>!!(c&&c.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>{var e,t,n,r;return!(null==(t=null==(e=c.action_data)?void 0:e.length)||!t)&&null!==(null==(r=null==(n=c.action_data)?void 0:n.find((e=>"send_communication"===e.action_type)))?void 0:r.action_metadata.communication_group_id)}},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}].map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors cursor-pointer\n ${n===a?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<a?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,onClick:()=>{l(n)},children:t.jsx(QT,{label:e.title,isActive:n===a,isCompleted:e.isValid()})},e.id)))}),t.jsx("div",{className:"h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1",children:t.jsxs(Rd,{mode:"wait",children:[0===a&&t.jsx(wb.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:t.jsx(dR,{tailwindClassDefinitions:r,iconDefinitions:o,automation:c})},"audience"),1===a&&t.jsx(wb.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:t.jsx(RO,{automation:c})},"content"),2===a&&t.jsx(wb.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:t.jsx(lR,{automation:c,tailwindClassDefinitions:r,iconDefinitions:o,loading:u})},"preview")]})})]}),t.jsx("div",{className:"absolute bottom-0 right-0 z-50",children:t.jsx(JT,{iconDefinitions:o,tailwindClassDefinitions:r,handleBack:()=>{l(a-1)},handleNext:()=>{2===a?(d(!0),h({status:Ab.ACTIVE}),i(!1)):l(a+1)},hideBack:0===a,backText:0===a?"Cancel":"Back",nextText:2===a?"Schedule":"Next",backDisabled:0===a,nextDisabled:2===a&&!(c.trigger_metadata.scheduled_at&&new Date(c.trigger_metadata.scheduled_at)>new Date&&Boolean(null==(s=c.action_data)?void 0:s.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))))})})]})},fR=FS("inline-flex items-center rounded-full border text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",google:"border-transparent bg-blue-100 font-normal dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",date:"border-transparent bg-gray-200 font-normal dark:bg-gray-800 text-gray-700 dark:text-gray-300"},size:{default:"px-2.5 py-0.5",sm:"px-1.5 py-0.5 text-[10px]"},iconOnly:{true:"w-5 h-5 p-0 justify-center",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"w-4 h-4"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}});function pR({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s}){return t.jsx("div",{className:Ww(fR({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})}const gR=({status:e})=>{switch(e){case Ab.DRAFT:return t.jsx(pR,{variant:"secondary",children:"Draft"});case Ab.ACTIVE:return t.jsx(pR,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case Ab.RUNNING:return t.jsx(pR,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case Ab.SCHEDULED:return t.jsx(pR,{variant:"default",className:"bg-purple-500 hover:bg-purple-600",children:"Scheduled"});case Ab.COMPLETED:return t.jsx(pR,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case Ab.FAILED:return t.jsx(pR,{variant:"destructive",children:"Failed"});case Ab.DEACTIVATED:return t.jsx(pR,{variant:"outline",className:"text-gray-500",children:"Deactivated"});default:lx(e,Ab)}},mR=({automation:e,tailwindClassDefinitions:r,iconDefinitions:o,autoOpenEditPopup:i})=>{var s,a;const[l,c]=n.useState(!1),{updateAutomation:u}=Mb(e.id);n.useEffect((()=>{i&&c(!0)}),[i]);return t.jsxs(t.Fragment,{children:[t.jsx(zE,{open:l,onOpenChange:c,children:t.jsx(UE,{className:"max-w-[98vw] max-h-[98vh] min-h-[80vh]",children:t.jsx(hR,{automationId:e.id,tailwindClassDefinitions:r,iconDefinitions:o,setOpenEditAutomationPopup:c})})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(gR,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(KT,{modal:!1,children:[t.jsx(WT,{asChild:!0,children:t.jsxs(zS,{className:Ww(r.PrimaryButton),children:["Actions",t.jsx(o.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(HT,{children:[(e.status===Ab.DRAFT||e.status===Ab.ACTIVE)&&t.jsx(GT,{onClick:()=>c(!0),children:"Edit"}),e.status===Ab.ACTIVE&&t.jsx(GT,{onClick:()=>{u({status:Ab.DRAFT})},children:"Convert to Draft"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Name"}),t.jsx("div",{className:"font-medium",children:e.name})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:MS(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===Ob.ONE_TIME&&(null==(s=e.trigger_metadata)?void 0:s.scheduled_at)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]})}),t.jsx("div",{children:e.trigger_type===Ob.ONE_TIME&&(null==(a=e.trigger_metadata)?void 0:a.scheduled_at)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:MS(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})};var vR=e=>null!=e;var yR=e=>"function"!=typeof e||e.length?e:e(),bR=e=>Array.isArray(e)?e:e?[e]:[];var wR=Bn;var xR,kR=function(e){const[t,n]=_n(),r=(null==e?void 0:e.throw)?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=(null==e?void 0:e.api)?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=(null==e?void 0:e.prefix)?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=_n(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(FB){return r(FB,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&(null==e?void 0:e.deserializer)?e.deserializer(l,n,e.options):l}});return!1!==(null==e?void 0:e.sync)&&Vn((()=>{const e=e=>{var t;let n=!1;o.forEach((t=>{try{t!==e.storageArea&&e.key&&e.newValue!==t.getItem(e.key)&&(e.newValue?t.setItem(e.key,e.newValue):t.removeItem(e.key),n=!0)}catch(FB){r(FB,`Error synching api ${t.name} from storage event (${e.key}=${e.newValue})`)}})),n&&e.key&&(null==(t=s.get(e.key))||t[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),Bn((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>{var n;return null==(n=t.addEventListener)?void 0:n.call(t,"storage",e)})),Bn((()=>o.forEach((t=>{var n;return null==(n=t.removeEventListener)?void 0:n.call(t,"storage",e)})))))})),[a,(t,n,a)=>{const l=(null==e?void 0:e.serializer)?e.serializer(n,t,null!=a?a:e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(FB){r(FB,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(FB){r(FB,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(FB){r(FB,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&(null==e?void 0:e.deserializer)?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(FB){r(FB,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(FB){r(FB,`Error getting all values from ${e.name}`)}}})),t}}]},SR=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},CR=("function"==typeof(xR={_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return null!=(n=null==(t=CR._cookies[0][CR._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))?void 0:t.pop())?n:null},setItem:(e,t,n)=>{const r=CR.getItem(e);CR._cookies[0][CR._cookies[1]]=`${e}=${t}${SR(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:CR});window.dispatchEvent(o)},removeItem:e=>{CR._cookies[0][CR._cookies[1]]=`${e}=deleted${SR({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return CR._cookies[0][CR._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return CR._cookies[0][CR._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(xR.clear=()=>{let e;for(;e=xR.key(0);)xR.removeItem(e)}),xR),ER=796,PR="bottom",jR="system",DR=Object.keys(ni)[0],TR=Object.keys(ii)[0],MR=Gn({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function OR(){return Yn(MR)}var AR=Gn(void 0),NR=e=>{const[t,n]=_n(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[$r]){for(let t of e[$r].keys())e.removeEventListener(t,Xr);delete e[$r]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(OR().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(LB){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),qr(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};$n((()=>{var t;"true"!==(null!=(t=e.localStore.pip_open)?t:"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),$n((()=>{const e=(OR().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(OR().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),Bn((()=>{t.disconnect()}))}}));const i=Fn((()=>{var n;return{pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:null!=(n=e.disabled)&&n}}));return pr(AR.Provider,{value:i,get children(){return e.children}})},_R=()=>Fn((()=>{const e=Yn(AR);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),RR=Gn((()=>"dark"));function LR(){return Yn(RR)}var $R={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"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","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},FR=Object.keys($R).join("|"),IR=new RegExp(FR,"g");var qR=7,zR=6,VR=5,BR=4,UR=3,KR=2,WR=1,HR=0;function GR(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:WR,!n.accessors){const r=YR(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=ZR(o),s=XR(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:HR,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=YR(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=WR?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function YR(e,t,n){return e=QR(e,n),(t=QR(t,n)).length>e.length?HR:e===t?qR:(e=e.toLowerCase())===(t=t.toLowerCase())?zR:e.startsWith(t)?VR:e.includes(` ${t}`)?BR:e.includes(t)?UR:1===t.length?HR:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?KR:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return WR+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return HR;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return HR}return i(r-s)}(e,t)}function QR(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(IR,(e=>$R[e]))),e}function XR(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var JR={maxRanking:1/0,minRanking:-1/0};function ZR(e){return"function"==typeof e?JR:{...JR,...e}}var eL={data:""},tL=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nL=/\/\*[^]*?\*\/| +/g,rL=/\n+/g,oL=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?oL(s,i):i+"{"+oL(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=oL(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=oL.p?oL.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},iL={},sL=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+sL(e[n]);return t}return e};function aL(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=sL(e),s=iL[i]||(iL[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!iL[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=tL.exec(e.replace(nL,""));)t[4]?r.shift():t[3]?(n=t[3].replace(rL," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(rL," ").trim();return r[0]})(e);iL[s]=oL(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&iL.g?iL.g:null;return n&&(iL.g=iL[s]),l=iL[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":oL(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||eL),t.g,t.o,t.k);var r}function lL(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=lL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function cL(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=lL(e))&&(r&&(r+=" "),r+=t);return r}function uL(e,t){const n=qn(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=_n([],{equals:!1}),[l]=[Wn,Kn],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return Fn((t=>{const n=s(),a=e();if(qn(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return qn((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let h=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),h&&o!==n[r]&&(h=!1)}return!l.length&&h?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function dL(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}aL.bind({g:1}),aL.bind({k:1});var hL=e=>e instanceof Element;function fL(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return fL(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=fL(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function pL(e,t=hL,n=hL){const r=Fn(e),o=Fn((()=>fL(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function gL(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function mL(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),null==s||s(n))}null==o||o(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return null==r?void 0:r();null==i||i(n,(()=>a()))})),gL((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function vL(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return null==r?void 0:r();function a(t){t&&t.target!==n||(null==r||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),null==s||s(n))}null==o||o(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),null==i||i(n,(()=>a())),gL((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var yL=e=>{const t=function(e){return Fn((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return uL(pL((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)mL(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)vL(s,e,t,(()=>o([t])))}})},bL=Symbol("fallback");function wL(e){for(const t of e)t.dispose()}function xL(e){const{by:t}=e;return Fn(function(e,t,n,r={}){const o=new Map;return Bn((()=>wL(o.values()))),()=>{const n=e()||[];return qn((()=>{var e,s;if(!n.length)return wL(o.values()),o.clear(),r.fallback?[Nn((e=>(o.set(bL,{dispose:e}),r.fallback())))]:[];const a=new Array(n.length),l=o.get(bL);if(!o.size||l){null==l||l.dispose(),o.delete(bL);for(let e=0;e<n.length;e++){const r=n[e];i(a,r,e,t(r,e))}return a}const c=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);c.delete(l);const u=o.get(l);u?(a[r]=u.mapped,null==(e=u.setIndex)||e.call(u,r),u.setItem((()=>s))):i(a,s,r,l)}for(const t of c)null==(s=o.get(t))||s.dispose(),o.delete(t);return a}))};function i(e,t,r,i){Nn((s=>{const[a,l]=_n(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=_n(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function kL(e,t,n,r){const o=()=>{bR(yR(e)).forEach((e=>{e&&bR(yR(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),wR(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?$n(o):Ln(o)}function SL(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return Bn(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);$n((t=>{const n=bR(yR(e)).filter(vR);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var CL=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function EL(e){const t={};let n;for(;n=CL.exec(e);)t[n[1]]=n[2];return t}function PL(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=EL(e)}else"string"==typeof t&&(t=EL(t));return{...e,...t}}function jL(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function DL(e){return"[object String]"===Object.prototype.toString.call(e)}function TL(e){return t=>`${e()}-${t}`}function ML(e,t){return!!e&&(e===t||e.contains(t))}function OL(e,t=!1){const{activeElement:n}=AL(e);if(!(null==n?void 0:n.nodeName))return null;if(NL(n)&&n.contentDocument)return OL(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=AL(n).getElementById(e);if(t)return t}}return n}function AL(e){return e?e.ownerDocument||e:document}function NL(e){return"IFRAME"===e.tagName}var _L=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(_L||{});function RL(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}function LL(){return RL(/^Mac/i)}function $L(){return RL(/^iPhone/i)||RL(/^iPad/i)||LL()&&navigator.maxTouchPoints>1}function FL(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),null==e?void 0:e.defaultPrevented}function IL(e){return t=>{for(const n of e)FL(t,n)}}function qL(e){return LL()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function zL(e){if(e)if(function(){if(null==VL){VL=!1;try{document.createElement("div").focus({get preventScroll(){return VL=!0,!0}})}catch(LB){}}return VL}())e.focus({preventScroll:!0});else{const t=function(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var VL=null;var BL=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],UL=[...BL,'[tabindex]:not([tabindex="-1"]):not([disabled])'],KL=BL.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",WL=UL.join(':not([hidden]):not([tabindex="-1"]),');function HL(e,t){const n=Array.from(e.querySelectorAll(KL)).filter(GL);return t&&GL(e)&&n.unshift(e),n.forEach(((e,t)=>{if(NL(e)&&e.contentDocument){const r=HL(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function GL(e){return YL(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function YL(e){return e.matches(KL)&&QL(e)}function QL(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||QL(e.parentElement,e))}function XL(e){for(;e&&!JL(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function JL(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ZL(){}function e$(e,t){return br(e,t)}var t$=new Map,n$=new Set;function r$(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=t$.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),t$.delete(t.target)),0===t$.size)){for(const e of n$)e();n$.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=t$.get(t.target);n||(n=new Set,t$.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function o$(e,t){const n=i$(e,t,"left"),r=i$(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function i$(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}"undefined"!=typeof document&&("loading"!==document.readyState?r$():document.addEventListener("DOMContentLoaded",r$));var s$={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function a$(e){return t=>(e(t),()=>e(void 0))}function l$(e,t){const[n,r]=_n(c$(null==t?void 0:t()));return $n((()=>{var n;r((null==(n=e())?void 0:n.tagName.toLowerCase())||c$(null==t?void 0:t()))})),n}function c$(e){return DL(e)?e:void 0}function u$(e){const[t,n]=wr(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return pr(oo,br(n,{get component(){return t.as}}))}var d$=["id","name","validationState","required","disabled","readOnly"];var h$=Gn();function f$(){const e=Yn(h$);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function p$(e){const t=f$(),n=e$({id:t.generateId("description")},e);return $n((()=>Bn(t.registerDescription(n.id)))),pr(u$,br({as:"div"},(()=>t.dataset()),n))}function g$(e){const t=f$(),n=e$({id:t.generateId("error-message")},e),[r,o]=wr(n,["forceMount"]),i=()=>"invalid"===t.validationState();return $n((()=>{i()&&Bn(t.registerErrorMessage(o.id))})),pr(jr,{get when(){return r.forceMount||i()},get children(){return pr(u$,br({as:"div"},(()=>t.dataset()),o))}})}function m$(e){let t;const n=f$(),r=e$({id:n.generateId("label")},e),[o,i]=wr(r,["ref"]),s=l$((()=>t),(()=>"label"));return $n((()=>Bn(n.registerLabel(i.id)))),pr(u$,br({as:"label",ref(e){const n=dL((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Fn((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function v$(e,t){$n(zn(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),Bn((()=>{n.removeEventListener("reset",t)})))})))}function y$(e){var t;const[n,r]=_n(null==(t=e.defaultValue)?void 0:t.call(e)),o=Fn((()=>{var t;return void 0!==(null==(t=e.value)?void 0:t.call(e))})),i=Fn((()=>{var t;return o()?null==(t=e.value)?void 0:t.call(e):n()}));return[i,t=>{qn((()=>{var n;const s=function(e,...t){return"function"==typeof e?e(...t):e}(t,i());return Object.is(s,i())||(o()||r(s),null==(n=e.onChange)||n.call(e,s)),s}))}]}function b$(e){const[t,n]=y$(e);return[()=>{var e;return null!=(e=t())&&e},n]}var w$=Object.defineProperty,x$=(e,t)=>{for(var n in t)w$(e,n,{get:t[n],enumerable:!0})},k$=Gn();function S$(){return Yn(k$)}function C$(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function E$(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?C$(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function P$(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){$n((()=>{const n=setTimeout((()=>{E$(e(),t)}));Bn((()=>clearTimeout(n)))}))}(e,t);let n=[];$n((()=>{const r=function(e){var t,n;const r=e[0],o=null==(t=e[e.length-1])?void 0:t.ref();let i=null==(n=null==r?void 0:r.ref())?void 0:n.parentElement;for(;i;){if(o&&i.contains(o))return i;i=i.parentElement}return AL(i).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&E$(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}Bn((()=>o.disconnect()))}))}function j$(e={}){const[t,n]=function(e){const[t,n]=y$(e);return[()=>{var e;return null!=(e=t())?e:[]},n]}({value:()=>yR(e.items),onChange:t=>{var n;return null==(n=e.onItemsChange)?void 0:n.call(e,t)}});P$(t,n);const r=e=>(n((t=>{const n=function(e,t){var n;const r=t.ref();if(!r)return-1;let o=e.length;if(!o)return-1;for(;o--;){const t=null==(n=e[o])?void 0:n.ref();if(t&&C$(t,r))return o+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>pr(k$.Provider,{value:{registerItem:r},get children(){return e.children}})}}function D$(e){const t=function(){const e=S$();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=e$({shouldRegisterItem:!0},e);$n((()=>{if(!n.shouldRegisterItem)return;Bn(t.registerItem(n.getItem()))}))}function T$(e){var t,n,r;let o=null!=(t=e.startIndex)?t:0;const i=null!=(n=e.startLevel)?n:0,s=[],a=t=>{var n;if(null==t)return"";const r=null!=(n=e.getKey)?n:"key",o=DL(r)?t[r]:r(t);return null!=o?String(o):""},l=t=>{var n;if(null==t)return"";const r=null!=(n=e.getTextValue)?n:"textValue",o=DL(r)?t[r]:r(t);return null!=o?String(o):""},c=t=>{var n,r;if(null==t)return!1;const o=null!=(n=e.getDisabled)?n:"disabled";return null!=(r=DL(o)?t[o]:o(t))&&r},u=t=>{var n;if(null!=t)return DL(e.getSectionChildren)?t[e.getSectionChildren]:null==(n=e.getSectionChildren)?void 0:n.call(e,t)};for(const d of e.dataSource)if(DL(d)||"number"==typeof d)s.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:c(d),level:i,index:o}),o++;else if(null!=u(d)){s.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:i,index:o}),o++;const t=null!=(r=u(d))?r:[];if(t.length>0){const n=T$({dataSource:t,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:o,startLevel:i+1});s.push(...n),o+=n.length}}else s.push({type:"item",rawValue:d,key:a(d),textValue:l(d),disabled:c(d),level:i,index:o}),o++;return s}function M$(e,t=[]){return Fn((()=>{const n=T$({dataSource:yR(e.dataSource),getKey:yR(e.getKey),getTextValue:yR(e.getTextValue),getDisabled:yR(e.getDisabled),getSectionChildren:yR(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var O$=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),A$=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function N$(e){return function(e){var t;if(Intl.Locale){const n=null!=(t=new Intl.Locale(e).maximize().script)?t:"";return O$.has(n)}const n=e.split("-")[0];return A$.has(n)}(e)?"rtl":"ltr"}function _$(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:N$(e)}}var R$=_$(),L$=new Set;function $$(){R$=_$();for(const e of L$)e(R$)}var F$=Gn();function I$(){const e=function(){const[e,t]=_n(R$),n=Fn((()=>e()));return Vn((()=>{0===L$.size&&window.addEventListener("languagechange",$$),L$.add(t),Bn((()=>{L$.delete(t),0===L$.size&&window.removeEventListener("languagechange",$$)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Yn(F$)||e}var q$=new Map;var z$=class e extends Set{constructor(t,n,r){super(t),et(this,"anchorKey"),et(this,"currentKey"),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function V$(e){return LL()||$L()?e.altKey:e.ctrlKey}function B$(e){return LL()?e.metaKey:e.ctrlKey}function U$(e){return new z$(e)}function K$(e){const t=e$({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_n(!1),[o,i]=_n(),s=Fn((()=>{const e=yR(t.selectedKeys);return null!=e?U$(e):e})),a=Fn((()=>{const e=yR(t.defaultSelectedKeys);return null!=e?U$(e):new z$})),[l,c]=function(e){const[t,n]=y$(e);return[()=>{var e;return null!=(e=t())?e:new z$},n]}({value:s,defaultValue:a,onChange:e=>{var n;return null==(n=t.onSelectionChange)?void 0:n.call(t,e)}}),[u,d]=_n(yR(t.selectionBehavior));return $n((()=>{const e=l();"replace"===yR(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),$n((()=>{var e;d(null!=(e=yR(t.selectionBehavior))?e:"toggle")})),{selectionMode:()=>yR(t.selectionMode),disallowEmptySelection:()=>{var e;return null!=(e=yR(t.disallowEmptySelection))&&e},selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!yR(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function W$(e,t,n){const r=br({selectOnFocus:()=>"replace"===yR(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=I$();let s={top:0,left:0};kL((()=>yR(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=_n(""),[r,o]=_n(-1);return{typeSelectHandlers:{onKeyDown:i=>{var s,a,l;if(yR(e.isDisabled))return;const c=yR(e.keyboardDelegate),u=yR(e.selectionManager);if(!c.getKeyForSearch)return;const d=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!d||i.ctrlKey||i.metaKey)return;" "===d&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let h=n((e=>e+d)),f=null!=(s=c.getKeyForSearch(h,u.focusedKey()))?s:c.getKeyForSearch(h);null==f&&function(e){return e.split("").every((t=>t===e[0]))}(h)&&(h=h[0],f=null!=(a=c.getKeyForSearch(h,u.focusedKey()))?a:c.getKeyForSearch(h)),null!=f&&(u.setFocusedKey(f),null==(l=e.onTypeSelect)||l.call(e,f)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>yR(r.disallowTypeAhead),keyboardDelegate:()=>yR(r.keyboardDelegate),selectionManager:()=>yR(r.selectionManager)}),l=()=>{var e;return null!=(e=yR(r.orientation))?e:"vertical"},c=()=>{var e,n;const o=yR(r.autoFocus);if(!o)return;const i=yR(r.selectionManager),s=yR(r.keyboardDelegate);let a;"first"===o&&(a=null==(e=s.getFirstKey)?void 0:e.call(s)),"last"===o&&(a=null==(n=s.getLastKey)?void 0:n.call(s));const l=i.selectedKeys();l.size&&(a=l.values().next().value),i.setFocused(!0),i.setFocusedKey(a);const c=t();c&&null==a&&!yR(r.shouldUseVirtualFocus)&&zL(c)};Vn((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),$n(zn([o,()=>yR(r.isVirtualized),()=>yR(r.selectionManager).focusedKey()],(e=>{var t;const[n,o,i]=e;if(o)i&&(null==(t=r.scrollToKey)||t.call(r,i));else if(i&&n){const e=n.querySelector(`[data-key="${i}"]`);e&&o$(n,e)}})));return{tabIndex:Fn((()=>{if(!yR(r.shouldUseVirtualFocus))return null==yR(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{var n,o,s,c,u,d,h,f;FL(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const p=t();if(!(null==p?void 0:p.contains(e.target)))return;const g=yR(r.selectionManager),m=yR(r.selectOnFocus),v=t=>{null!=t&&(g.setFocusedKey(t),e.shiftKey&&"multiple"===g.selectionMode()?g.extendSelection(t):m&&!V$(e)&&g.replaceSelection(t))},y=yR(r.keyboardDelegate),b=yR(r.shouldFocusWrap),w=g.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(y.getKeyBelow){let t;e.preventDefault(),t=null!=w?y.getKeyBelow(w):null==(n=y.getFirstKey)?void 0:n.call(y),null==t&&b&&(t=null==(o=y.getFirstKey)?void 0:o.call(y,w)),v(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(y.getKeyAbove){let t;e.preventDefault(),t=null!=w?y.getKeyAbove(w):null==(s=y.getLastKey)?void 0:s.call(y),null==t&&b&&(t=null==(c=y.getLastKey)?void 0:c.call(y,w)),v(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(y.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=w?y.getKeyLeftOf(w):t?null==(u=y.getFirstKey)?void 0:u.call(y):null==(d=y.getLastKey)?void 0:d.call(y),v(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(y.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=w?y.getKeyRightOf(w):t?null==(h=y.getLastKey)?void 0:h.call(y):null==(f=y.getFirstKey)?void 0:f.call(y),v(n)}break;case"Home":if(y.getFirstKey){e.preventDefault();const t=y.getFirstKey(w,B$(e));null!=t&&(g.setFocusedKey(t),B$(e)&&e.shiftKey&&"multiple"===g.selectionMode()?g.extendSelection(t):m&&g.replaceSelection(t))}break;case"End":if(y.getLastKey){e.preventDefault();const t=y.getLastKey(w,B$(e));null!=t&&(g.setFocusedKey(t),B$(e)&&e.shiftKey&&"multiple"===g.selectionMode()?g.extendSelection(t):m&&g.replaceSelection(t))}break;case"PageDown":if(y.getKeyPageBelow&&null!=w){e.preventDefault();v(y.getKeyPageBelow(w))}break;case"PageUp":if(y.getKeyPageAbove&&null!=w){e.preventDefault();v(y.getKeyPageAbove(w))}break;case"a":B$(e)&&"multiple"===g.selectionMode()&&!0!==yR(r.disallowSelectAll)&&(e.preventDefault(),g.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),yR(r.disallowEmptySelection)||g.clearSelection());break;case"Tab":if(!yR(r.allowsTabNavigation)){if(e.shiftKey)p.focus();else{const e=function(e,t){const n=(null==t?void 0:t.tabbable)?WL:KL,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var r;return(null==(r=null==t?void 0:t.from)?void 0:r.contains(e))?NodeFilter.FILTER_REJECT:e.matches(n)&&QL(e)&&(!(null==t?void 0:t.accept)||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return(null==t?void 0:t.from)&&(r.currentNode=t.from),r}(p,{tabbable:!0});let t,n;do{n=e.lastChild(),n&&(t=n)}while(n);t&&!t.contains(document.activeElement)&&zL(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{var t,n,i,a;const l=yR(r.selectionManager),c=yR(r.keyboardDelegate),u=yR(r.selectOnFocus);if(l.isFocused())e.currentTarget.contains(e.target)||l.setFocused(!1);else if(e.currentTarget.contains(e.target))if(l.setFocused(!0),null==l.focusedKey()){const r=e=>{null!=e&&(l.setFocusedKey(e),u&&l.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(null!=(n=l.lastSelectedKey())?n:null==(t=c.getLastKey)?void 0:t.call(c)):r(null!=(a=l.firstSelectedKey())?a:null==(i=c.getFirstKey)?void 0:i.call(c))}else if(!yR(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const t=e.querySelector(`[data-key="${l.focusedKey()}"]`);t&&(zL(t),o$(e,t))}}},onFocusOut:e=>{const t=yR(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function H$(e,t){const n=()=>yR(e.selectionManager),r=()=>yR(e.key),o=()=>yR(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):(null==e?void 0:e.shiftKey)?n().extendSelection(r()):"toggle"===n().selectionBehavior()||B$(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>yR(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Fn((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Fn((()=>yR(e.virtualized)?void 0:r()));return $n(zn([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():zL(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||yR(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&yR(e.shouldSelectOnPressUp)&&yR(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(yR(e.shouldSelectOnPressUp)&&!yR(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(V$(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var G$=class{constructor(e,t){et(this,"collection"),et(this,"state"),this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=(null==n?void 0:n.index)&&null!=(null==e?void 0:e.index)&&n.index<e.index)||(e=n)}return null==e?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=(null==n?void 0:n.index)&&null!=(null==e?void 0:e.index)&&n.index>e.index)||(e=n)}return null==e?void 0:e.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new z$(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new z$(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new z$([t],t,t):new z$;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new z$;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new z$)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},Y$=class{constructor(e){et(this,"keyMap",new Map),et(this,"iterable"),et(this,"firstKey"),et(this,"lastKey"),this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return null==(t=this.keyMap.get(e))?void 0:t.prevKey}getKeyAfter(e){var t;return null==(t=this.keyMap.get(e))?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var Q$,X$=e=>"function"==typeof e?e():e,J$=e=>{const t=Fn((()=>{const t=X$(e.element);if(t)return getComputedStyle(t)})),n=()=>{var e,n;return null!=(n=null==(e=t())?void 0:e.animationName)?n:"none"},[r,o]=_n(X$(e.show)?"present":"hidden");let i="none";return $n((r=>{const s=X$(e.show);return qn((()=>{var e;if(r===s)return s;const a=i,l=n();if(s)o("present");else if("none"===l||"none"===(null==(e=t())?void 0:e.display))o("hidden");else{o(!0===r&&a!==l?"hiding":"hidden")}})),s})),$n((()=>{const t=X$(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),Bn((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},Z$="data-kb-top-layer",eF=!1,tF=[];function nF(e){return tF.findIndex((t=>t.node===e))}function rF(){return tF.filter((e=>e.isPointerBlocking))}function oF(){return rF().length>0}function iF(e){var t;const n=nF(null==(t=[...rF()].slice(-1)[0])?void 0:t.node);return nF(e)<n}var sF={layers:tF,isTopMostLayer:function(e){return tF[tF.length-1].node===e},hasPointerBlockingLayer:oF,isBelowPointerBlockingLayer:iF,addLayer:function(e){tF.push(e)},removeLayer:function(e){const t=nF(e);t<0||tF.splice(t,1)},indexOf:nF,find:function(e){return tF[nF(e)]},assignPointerEventToLayers:function(){for(const{node:e}of tF)e.style.pointerEvents=iF(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(oF()&&!eF){const t=AL(e);Q$=document.body.style.pointerEvents,t.body.style.pointerEvents="none",eF=!0}},restoreBodyPointerEvents:function(e){if(oF())return;const t=AL(e);t.body.style.pointerEvents=Q$,0===t.body.style.length&&t.body.removeAttribute("style"),eF=!1}};x$({},{Button:()=>cF,Root:()=>lF});var aF=["button","color","file","image","reset","submit"];function lF(e){let t;const n=e$({type:"button"},e),[r,o]=wr(n,["ref","type","disabled"]),i=l$((()=>t),(()=>"button")),s=Fn((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==aF.indexOf(e.type)}({tagName:e,type:r.type})})),a=Fn((()=>"input"===i())),l=Fn((()=>"a"===i()&&null!=(null==t?void 0:t.getAttribute("href"))));return pr(u$,br({as:"button",ref(e){const n=dL((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var cF=lF,uF=["top","right","bottom","left"],dF=Math.min,hF=Math.max,fF=Math.round,pF=Math.floor,gF=e=>({x:e,y:e}),mF={left:"right",right:"left",bottom:"top",top:"bottom"},vF={start:"end",end:"start"};function yF(e,t,n){return hF(e,dF(t,n))}function bF(e,t){return"function"==typeof e?e(t):e}function wF(e){return e.split("-")[0]}function xF(e){return e.split("-")[1]}function kF(e){return"x"===e?"y":"x"}function SF(e){return"y"===e?"height":"width"}function CF(e){return["top","bottom"].includes(wF(e))?"y":"x"}function EF(e){return kF(CF(e))}function PF(e){return e.replace(/start|end/g,(e=>vF[e]))}function jF(e){return e.replace(/left|right|bottom|top/g,(e=>mF[e]))}function DF(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function TF(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function MF(e,t,n){let{reference:r,floating:o}=e;const i=CF(t),s=EF(t),a=SF(s),l=wF(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xF(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function OF(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=bF(t,e),p=DF(f),g=a[h?"floating"===d?"reference":"floating":d],m=TF(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=TF(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function AF(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function NF(e){return uF.some((t=>e[t]>=0))}function _F(e){return $F(e)?(e.nodeName||"").toLowerCase():"#document"}function RF(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function LF(e){var t;return null==(t=($F(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $F(e){return e instanceof Node||e instanceof RF(e).Node}function FF(e){return e instanceof Element||e instanceof RF(e).Element}function IF(e){return e instanceof HTMLElement||e instanceof RF(e).HTMLElement}function qF(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof RF(e).ShadowRoot)}function zF(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=HF(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function VF(e){return["table","td","th"].includes(_F(e))}function BF(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(LB){return!1}}))}function UF(e){const t=KF(),n=FF(e)?HF(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function KF(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function WF(e){return["html","body","#document"].includes(_F(e))}function HF(e){return RF(e).getComputedStyle(e)}function GF(e){return FF(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function YF(e){if("html"===_F(e))return e;const t=e.assignedSlot||e.parentNode||qF(e)&&e.host||LF(e);return qF(t)?t.host:t}function QF(e){const t=YF(e);return WF(t)?e.ownerDocument?e.ownerDocument.body:e.body:IF(t)&&zF(t)?t:QF(t)}function XF(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=QF(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=RF(o);return i?t.concat(s,s.visualViewport||[],zF(o)?o:[],s.frameElement&&n?XF(s.frameElement):[]):t.concat(o,XF(o,[],n))}function JF(e){const t=HF(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=IF(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=fF(n)!==i||fF(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ZF(e){return FF(e)?e:e.contextElement}function eI(e){const t=ZF(e);if(!IF(t))return gF(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=JF(t);let s=(i?fF(n.width):n.width)/r,a=(i?fF(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var tI=gF(0);function nI(e){const t=RF(e);return KF()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:tI}function rI(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ZF(e);let s=gF(1);t&&(r?FF(r)&&(s=eI(r)):s=eI(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==RF(e))&&t}(i,n,r)?nI(i):gF(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=RF(i),t=r&&FF(r)?RF(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=eI(o),t=o.getBoundingClientRect(),r=HF(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=RF(o),o=n.frameElement}}return TF({width:u,height:d,x:l,y:c})}function oI(e){return rI(LF(e)).left+GF(e).scrollLeft}function iI(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=RF(e),r=LF(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=KF();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=LF(e),n=GF(e),r=e.ownerDocument.body,o=hF(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=hF(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+oI(e);const a=-n.scrollTop;return"rtl"===HF(r).direction&&(s+=hF(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(LF(e));else if(FF(t))r=function(e,t){const n=rI(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=IF(e)?eI(e):gF(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=nI(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return TF(r)}function sI(e,t){const n=YF(e);return!(n===t||!FF(n)||WF(n))&&("fixed"===HF(n).position||sI(n,t))}function aI(e,t,n){const r=IF(t),o=LF(t),i="fixed"===n,s=rI(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=gF(0);if(r||!r&&!i)if(("body"!==_F(t)||zF(o))&&(a=GF(t)),r){const e=rI(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=oI(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function lI(e){return"static"===HF(e).position}function cI(e,t){return IF(e)&&"fixed"!==HF(e).position?t?t(e):e.offsetParent:null}function uI(e,t){const n=RF(e);if(BF(e))return n;if(!IF(e)){let t=YF(e);for(;t&&!WF(t);){if(FF(t)&&!lI(t))return t;t=YF(t)}return n}let r=cI(e,t);for(;r&&VF(r)&&lI(r);)r=cI(r,t);return r&&WF(r)&&lI(r)&&!UF(r)?n:r||function(e){let t=YF(e);for(;IF(t)&&!WF(t);){if(UF(t))return t;if(BF(t))return null;t=YF(t)}return null}(e)||n}var dI={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=LF(r),a=!!t&&BF(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=gF(1);const u=gF(0),d=IF(r);if((d||!d&&!i)&&(("body"!==_F(r)||zF(s))&&(l=GF(r)),IF(r))){const e=rI(r);c=eI(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:LF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?BF(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=XF(e,[],!1).filter((e=>FF(e)&&"body"!==_F(e))),o=null;const i="fixed"===HF(e).position;let s=i?YF(e):e;for(;FF(s)&&!WF(s);){const t=HF(s),n=UF(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||zF(s)&&!n&&sI(e,s))?r=r.filter((e=>e!==s)):o=t,s=YF(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=iI(t,n,o);return e.top=hF(r.top,e.top),e.right=dF(r.right,e.right),e.bottom=dF(r.bottom,e.bottom),e.left=hF(r.left,e.left),e}),iI(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:uI,getElementRects:async function(e){const t=this.getOffsetParent||uI,n=this.getDimensions,r=await n(e.floating);return{reference:aI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=JF(e);return{width:t,height:n}},getScale:eI,isElement:FF,isRTL:function(e){return"rtl"===HF(e).direction}};function hI(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ZF(e),u=o||i?[...c?XF(c):[],...XF(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=LF(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-pF(u)+"px "+-pF(o.clientWidth-(c+d))+"px "+-pF(o.clientHeight-(u+h))+"px "+-pF(c)+"px",threshold:hF(0,dF(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(LB){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let g=l?rI(e):null;return l&&function t(){const r=rI(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var fI=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=wF(n),a=xF(n),l="y"===CF(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=bF(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},pI=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=bF(e,t),c={x:n,y:r},u=await OF(t,l),d=CF(wF(o)),h=kF(d);let f=c[h],p=c[d];if(i){f=yF(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=yF(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const g=a.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},gI=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=bF(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=wF(o),y=CF(a),b=wF(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=h||(b||!g?[jF(a)]:function(e){const t=jF(e);return[PF(e),t,PF(t)]}(a)),k="none"!==p;!h&&k&&x.push(...function(e,t,n,r){const o=xF(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(wF(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(PF)))),i}(a,g,p,w));const S=[a,...x],C=await OF(t,m),E=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=xF(e),o=EF(e),i=SF(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=jF(s)),[s,jF(s)]}(o,s,w);E.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,D;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(D=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=P.filter((e=>{if(k){const t=CF(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},mI=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=bF(e,t),l=await OF(t,a),c=wF(n),u=xF(n),d="y"===CF(n),{width:h,height:f}=r.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=f-l.top-l.bottom,v=h-l.left-l.right,y=dF(f-l[p],m),b=dF(h-l[g],v),w=!t.middlewareData.shift;let x=y,k=b;if(d?k=u||w?dF(b,v):v:x=u||w?dF(y,m):m,w&&!u){const e=hF(l.left,0),t=hF(l.right,0),n=hF(l.top,0),r=hF(l.bottom,0);d?k=h-2*(0!==e||0!==t?e+t:hF(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:hF(l.top,l.bottom))}await s({...t,availableWidth:k,availableHeight:x});const S=await o.getDimensions(i.floating);return h!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}},vI=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bF(e,t);switch(r){case"referenceHidden":{const e=AF(await OF(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:NF(e)}}}case"escaped":{const e=AF(await OF(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:NF(e)}}}default:return{}}}}},yI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=bF(e,t)||{};if(null==c)return{};const d=DF(u),h={x:n,y:r},f=EF(o),p=SF(f),g=await s.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[f]-h[f]-i.floating[p],x=h[f]-i.reference[f],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=k?k[b]:0;S&&await(null==s.isElement?void 0:s.isElement(k))||(S=a.floating[b]||i.floating[p]);const C=w/2-x/2,E=S/2-g[p]/2-1,P=dF(d[v],E),j=dF(d[y],E),D=P,T=S-g[p]-j,M=S/2-g[p]/2+C,O=yF(D,M,T),A=!l.arrow&&null!=xF(o)&&M!==O&&i.reference[p]/2-(M<D?P:j)-g[p]/2<0,N=A?M<D?M-D:M-T:0;return{[f]:h[f]+N,data:{[f]:O,centerOffset:M-O-N,...A&&{alignmentOffset:N}},reset:A}}}),bI=(e,t,n)=>{const r={platform:dI,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=MF(c,r,l),h=r,f={},p=0;for(let g=0;g<a.length;g++){const{name:n,fn:i}=a[g],{x:m,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=MF(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},wI=Gn();function xI(){const e=Yn(wI);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var kI=Ir('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),SI={top:180,right:-90,bottom:0,left:90};function CI(e){const t=xI(),n=e$({size:30},e),[r,o]=wr(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=_n();return $n((()=>{const t=e();var r;t&&n((r=t,AL(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>{var e;return(null==(e=s())?void 0:e.getPropertyValue(`border-${i()}-color`))||"none"},l=()=>{return 2*Number.parseInt((null==(e=s())?void 0:e.getPropertyValue(`border-${i()}-width`))||"0px")*(30/r.size);var e};return pr(u$,br({as:"div",ref(e){const n=dL(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return PL({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:(null==(e=s())?void 0:e.getPropertyValue("background-color"))||"none",stroke:a(),"stroke-width":l()},r.style);var e}},o,{get children(){const e=kI(),t=e.firstChild;return Ln((()=>zr(t,"transform",`rotate(${SI[i()]} 15 15) translate(0 2)`))),e}}))}function EI(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=null!=e?e:{};if("function"==typeof DOMRect)return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function PI(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var jI={top:"bottom",right:"left",bottom:"top",left:"right"};var DI=Object.assign((function(e){const t=e$({getAnchorRect:e=>null==e?void 0:e.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=_n(),[o,i]=_n(),[s,a]=_n(t.placement),l=()=>{var e,n,r;return n=null==(e=t.anchorRef)?void 0:e.call(t),r=t.getAnchorRect,{contextElement:n,getBoundingClientRect:()=>{const e=r(n);return e?EI(e):n?n.getBoundingClientRect():EI()}}},{direction:c}=I$();async function u(){var e,r,i;const s=l(),u=n(),d=o();if(!s||!u)return;const h=((null==d?void 0:d.clientHeight)||0)/2,f="number"==typeof t.gutter?t.gutter+h:null!=(e=t.gutter)?e:h;u.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),s.getBoundingClientRect();const p=[fI((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:f,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(PI))throw new Error("`flip` expects a spaced-delimited list of placements");p.push(gI({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&p.push(pI({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),p.push(mI({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:r}){const o=Math.round(r.reference.width);e=Math.floor(e),n=Math.floor(n),u.style.setProperty("--kb-popper-anchor-width",`${o}px`),u.style.setProperty("--kb-popper-content-available-width",`${e}px`),u.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(u.style.width=`${o}px`),t.fitViewport&&(u.style.maxWidth=`${e}px`,u.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&p.push(vI({padding:t.detachedPadding})),d&&p.push(yI({element:d,padding:t.arrowPadding}));const g=await bI(s,u,{placement:t.placement,strategy:"absolute",middleware:p,platform:{...dI,isRTL:()=>"rtl"===c()}});if(a(g.placement),null==(r=t.onCurrentPlacementChange)||r.call(t,g.placement),!u)return;u.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=jI[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(g.placement,c()));const m=Math.round(g.x),v=Math.round(g.y);let y;if(t.hideWhenDetached&&(y=(null==(i=g.middlewareData.hide)?void 0:i.referenceHidden)?"hidden":"visible"),Object.assign(u.style,{top:"0",left:"0",transform:`translate3d(${m}px, ${v}px, 0)`,visibility:y}),d&&g.middlewareData.arrow){const{x:e,y:t}=g.middlewareData.arrow,n=g.placement.split("-")[0];Object.assign(d.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return $n((()=>{const e=l(),t=n();if(!e||!t)return;Bn(hI(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),$n((()=>{var e;const r=n(),o=null==(e=t.contentRef)?void 0:e.call(t);r&&o&&queueMicrotask((()=>{r.style.zIndex=getComputedStyle(o).zIndex}))})),pr(wI.Provider,{value:{currentPlacement:s,contentRef:()=>{var e;return null==(e=t.contentRef)?void 0:e.call(t)},setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:CI,Context:wI,usePopperContext:xI,Positioner:function(e){const t=xI(),[n,r]=wr(e,["ref","style"]);return pr(u$,br({as:"div",ref(e){const r=dL(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return PL({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var TI="interactOutside.pointerDownOutside",MI="interactOutside.focusOutside";var OI=Gn();function AI(e){let t;const n=Yn(OI),[r,o]=wr(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=ZL;const o=()=>AL(t()),i=t=>{var n;return null==(n=e.onPointerDownOutside)?void 0:n.call(e,t)},s=t=>{var n;return null==(n=e.onFocusOutside)?void 0:n.call(e,t)},a=t=>{var n;return null==(n=e.onInteractOutside)?void 0:n.call(e,t)},l=n=>{var r;const i=n.target;return i instanceof HTMLElement&&!i.closest(`[${Z$}]`)&&!!ML(o(),i)&&!ML(t(),i)&&!(null==(r=e.shouldExcludeElement)?void 0:r.call(e,i))},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=IL([i,a]);r.addEventListener(TI,o,{once:!0});const s=new CustomEvent(TI,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||qL(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=IL([s,a]);r.addEventListener(MI,o,{once:!0});const i=new CustomEvent(MI,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};$n((()=>{yR(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),Bn((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>{var n;return!!t&&((null==(n=r.excludedElements)?void 0:n.some((t=>ML(t(),e))))||[...i].some((t=>ML(t,e))))},onPointerDownOutside:e=>{var n,o,i;t&&!sF.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||sF.isTopMostLayer(t))&&(null==(n=r.onPointerDownOutside)||n.call(r,e),null==(o=r.onInteractOutside)||o.call(r,e),e.defaultPrevented||null==(i=r.onDismiss)||i.call(r))},onFocusOutside:e=>{var t,n,o;null==(t=r.onFocusOutside)||t.call(r,e),null==(n=r.onInteractOutside)||n.call(r,e),e.defaultPrevented||null==(o=r.onDismiss)||o.call(r)}},(()=>t)),function(e){const t=t=>{var n;t.key===_L.Escape&&(null==(n=e.onEscapeKeyDown)||n.call(e,t))};$n((()=>{var n,r;if(yR(e.isDisabled))return;const o=null!=(r=null==(n=e.ownerDocument)?void 0:n.call(e))?r:AL();o.addEventListener("keydown",t),Bn((()=>{o.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>AL(t),onEscapeKeyDown:e=>{var n;t&&sF.isTopMostLayer(t)&&(null==(n=r.onEscapeKeyDown)||n.call(r,e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Vn((()=>{if(!t)return;sF.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=null==n?void 0:n.registerNestedLayer(t);sF.assignPointerEventToLayers(),sF.disableBodyPointerEvents(t),Bn((()=>{t&&(sF.removeLayer(t),null==e||e(),sF.assignPointerEventToLayers(),sF.restoreBodyPointerEvents(t))}))})),$n(zn([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=sF.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,sF.assignPointerEventToLayers()),t&&sF.disableBodyPointerEvents(e),Bn((()=>{sF.restoreBodyPointerEvents(e)}))}),{defer:!0}));return pr(OI.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=null==n?void 0:n.registerNestedLayer(e);return()=>{i.delete(e),null==t||t()}}},get children(){return pr(u$,br({as:"div",ref(e){const n=dL((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function NI(e={}){const[t,n]=b$({value:()=>yR(e.open),defaultValue:()=>!!yR(e.defaultOpen),onChange:t=>{var n;return null==(n=e.onOpenChange)?void 0:n.call(e,t)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var _I={};x$(_I,{Description:()=>p$,ErrorMessage:()=>g$,Item:()=>II,ItemControl:()=>qI,ItemDescription:()=>zI,ItemIndicator:()=>VI,ItemInput:()=>BI,ItemLabel:()=>UI,Label:()=>KI,RadioGroup:()=>HI,Root:()=>WI});var RI=Gn();function LI(){const e=Yn(RI);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var $I=Gn();function FI(){const e=Yn($I);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function II(e){const t=f$(),n=LI(),r=e$({id:`${t.generateId("item")}-${Sr()}`},e),[o,i]=wr(r,["value","disabled","onPointerDown"]),[s,a]=_n(),[l,c]=_n(),[u,d]=_n(),[h,f]=_n(),[p,g]=_n(!1),m=Fn((()=>n.isSelectedValue(o.value))),v=Fn((()=>o.disabled||t.isDisabled()||!1)),y=e=>{FL(e,o.onPointerDown),p()&&e.preventDefault()},b=Fn((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":m()?"":void 0}))),w={value:()=>o.value,dataset:b,isSelected:m,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:TL((()=>i.id)),registerInput:a$(a),registerLabel:a$(c),registerDescription:a$(d),setIsFocused:g,setInputRef:f};return pr($I.Provider,{value:w,get children(){return pr(u$,br({as:"div",role:"group",onPointerDown:y},b,i))}})}function qI(e){const t=FI(),n=e$({id:t.generateId("control")},e),[r,o]=wr(n,["onClick","onKeyDown"]);return pr(u$,br({as:"div",onClick:e=>{var n;FL(e,r.onClick),t.select(),null==(n=t.inputRef())||n.focus()},onKeyDown:e=>{var n;FL(e,r.onKeyDown),e.key===_L.Space&&(t.select(),null==(n=t.inputRef())||n.focus())}},(()=>t.dataset()),o))}function zI(e){const t=FI(),n=e$({id:t.generateId("description")},e);return $n((()=>Bn(t.registerDescription(n.id)))),pr(u$,br({as:"div"},(()=>t.dataset()),n))}function VI(e){const t=FI(),n=e$({id:t.generateId("indicator")},e),[r,o]=wr(n,["ref","forceMount"]),[i,s]=_n(),{present:a}=J$({show:()=>r.forceMount||t.isSelected(),element:()=>{var e;return null!=(e=i())?e:null}});return pr(jr,{get when(){return a()},get children(){return pr(u$,br({as:"div",ref(e){const t=dL(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function BI(e){const t=f$(),n=LI(),r=FI(),o=e$({id:r.generateId("input")},e),[i,s]=wr(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=_n(!1);return $n(zn([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();null==t||t.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),null==t||t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),$n((()=>Bn(r.registerInput(s.id)))),pr(u$,br({as:"input",ref(e){const t=dL(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return PL({...s$},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(FL(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{FL(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{FL(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function UI(e){const t=FI(),n=e$({id:t.generateId("label")},e);return $n((()=>Bn(t.registerLabel(n.id)))),pr(u$,br({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function KI(e){return pr(m$,br({as:"span"},e))}function WI(e){let t;const n=e$({id:`radiogroup-${Sr()}`,orientation:"vertical"},e),[r,o,i]=wr(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],d$),[s,a]=y$({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>{var t;return null==(t=r.onChange)?void 0:t.call(r,e)}}),{formControlContext:l}=function(e){const t=e$({id:`form-control-${Sr()}`},e),[n,r]=_n(),[o,i]=_n(),[s,a]=_n(),[l,c]=_n();return{formControlContext:{name:()=>{var e;return null!=(e=yR(t.name))?e:yR(t.id)},dataset:Fn((()=>({"data-valid":"valid"===yR(t.validationState)?"":void 0,"data-invalid":"invalid"===yR(t.validationState)?"":void 0,"data-required":yR(t.required)?"":void 0,"data-disabled":yR(t.disabled)?"":void 0,"data-readonly":yR(t.readOnly)?"":void 0}))),validationState:()=>yR(t.validationState),isRequired:()=>yR(t.required),isDisabled:()=>yR(t.disabled),isReadOnly:()=>yR(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:TL((()=>yR(t.id))),registerLabel:a$(r),registerField:a$(i),registerDescription:a$(a),registerErrorMessage:a$(c)}}}(o);v$((()=>t),(()=>{var e;return a(null!=(e=r.defaultValue)?e:"")}));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return pr(h$.Provider,{value:l,get children(){return pr(RI.Provider,{value:d,get children(){return pr(u$,br({as:"div",ref(e){const n=dL((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return yR(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy(yR(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var HI=Object.assign(WI,{Description:p$,ErrorMessage:g$,Item:II,ItemControl:qI,ItemDescription:zI,ItemIndicator:VI,ItemInput:BI,ItemLabel:UI,Label:KI}),GI=class{constructor(e,t,n){et(this,"collection"),et(this,"ref"),et(this,"collator"),this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return null!=(r=null==(n=null==(t=this.ref)?void 0:t.call(this))?void 0:n.querySelector(`[data-key="${e}"]`))?r:null}getKeyPageAbove(e){var t;const n=null==(t=this.ref)?void 0:t.call(this);let r=this.getItem(e);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=e;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=null!=i?this.getItem(i):null;return i}getKeyPageBelow(e){var t;const n=null==(t=this.ref)?void 0:t.call(this);let r=this.getItem(e);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=e;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=null!=i?this.getItem(i):null;return i}getKeyForSearch(e,t){var n;const r=null==(n=this.collator)?void 0:n.call(this);if(!r)return;let o=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=o;){const t=this.collection().getItem(o);if(t){const n=t.textValue.slice(0,e.length);if(t.textValue&&0===r.compare(n,e))return o}o=this.getKeyBelow(o)}}};function YI(e,t,n){const r=function(e){const{locale:t}=I$(),n=Fn((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Fn((()=>{const r=n();let o;return q$.has(r)&&(o=q$.get(r)),o||(o=new Intl.Collator(t(),e),q$.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return W$({selectionManager:()=>yR(e.selectionManager),keyboardDelegate:Fn((()=>{const n=yR(e.keyboardDelegate);return n||new GI(e.collection,t,r)})),autoFocus:()=>yR(e.autoFocus),deferAutoFocus:()=>yR(e.deferAutoFocus),shouldFocusWrap:()=>yR(e.shouldFocusWrap),disallowEmptySelection:()=>yR(e.disallowEmptySelection),selectOnFocus:()=>yR(e.selectOnFocus),disallowTypeAhead:()=>yR(e.disallowTypeAhead),shouldUseVirtualFocus:()=>yR(e.shouldUseVirtualFocus),allowsTabNavigation:()=>yR(e.allowsTabNavigation),isVirtualized:()=>yR(e.isVirtualized),scrollToKey:t=>{var n;return null==(n=yR(e.scrollToKey))?void 0:n(t)},orientation:()=>yR(e.orientation)},t)}var QI="focusScope.autoFocusOnMount",XI="focusScope.autoFocusOnUnmount",JI={bubbles:!1,cancelable:!0},ZI={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&(null==(t=this.active())||t.pause()),this.stack=jL(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=jL(this.stack,e),null==(t=this.active())||t.resume()}};function eq(e,t){const[n,r]=_n(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>{var n;return null==(n=e.onMountAutoFocus)?void 0:n.call(e,t)},a=t=>{var n;return null==(n=e.onUnmountAutoFocus)?void 0:n.call(e,t)},l=()=>AL(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,s$),e},u=()=>{const e=t();return e?HL(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};$n((()=>{const e=t();if(!e)return;ZI.add(o);const n=OL(e);if(!ML(e,n)){const t=new CustomEvent(QI,JI);e.addEventListener(QI,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{zL(d()),OL(e)===n&&zL(e)}),0)}Bn((()=>{e.removeEventListener(QI,s),setTimeout((()=>{const r=new CustomEvent(XI,JI);(()=>{const e=t();if(!e)return!1;const n=OL(e);return!!n&&!ML(e,n)&&YL(n)})()&&r.preventDefault(),e.addEventListener(XI,a),e.dispatchEvent(r),r.defaultPrevented||zL(null!=n?n:l().body),e.removeEventListener(XI,a),ZI.remove(o)}),0)}))})),$n((()=>{const r=t();if(!r||!yR(e.trapFocus)||n())return;const o=e=>{const t=e.target;(null==t?void 0:t.closest(`[${Z$}]`))||(ML(r,t)?i=t:zL(i))},s=e=>{const t=e.relatedTarget,n=null!=t?t:OL(r);(null==n?void 0:n.closest(`[${Z$}]`))||ML(r,n)||zL(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),Bn((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),$n((()=>{const r=t();if(!r||!yR(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();zL(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),Bn((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var tq="data-live-announcer";function nq(e){$n((()=>{yR(e.isDisabled)||Bn(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${tq}], [${Z$}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{var t;const n=null!=(t=rq.get(e))?t:0;"true"===e.getAttribute("aria-hidden")&&0===n||(0===n&&e.setAttribute("aria-hidden","true"),r.add(e),rq.set(e,n+1))};oq.length&&oq[oq.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return oq.push(a),()=>{s.disconnect();for(const e of r){const t=rq.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),rq.delete(e)):rq.set(e,t-1)}a===oq[oq.length-1]?(oq.pop(),oq.length&&oq[oq.length-1].observe()):oq.splice(oq.indexOf(a),1)}}(yR(e.targets),yR(e.root)))}))}var rq=new WeakMap,oq=[];var iq=new Map,sq=e=>{$n((()=>{var t,n;const r=null!=(t=X$(e.style))?t:{},o=null!=(n=X$(e.properties))?n:[],i={};for(const a in r)i[a]=e.element.style[a];const s=iq.get(e.key);s?s.activeCount++:iq.set(e.key,{activeCount:1,originalStyles:i,properties:o.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const a of o)e.element.style.setProperty(a.key,a.value);Bn((()=>{var t;const n=iq.get(e.key);if(n)if(1===n.activeCount){iq.delete(e.key);for(const[t,r]of Object.entries(n.originalStyles))e.element.style[t]=r;for(const t of n.properties)e.element.style.removeProperty(t);0===e.element.style.length&&e.element.removeAttribute("style"),null==(t=e.cleanup)||t.call(e)}else n.activeCount--}))}))},aq=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},lq=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[cq,uq]=_n([]),dq=e=>[e.deltaX,e.deltaY],hq=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],fq=(e,t,n,r)=>{const o=null!==r&&pq(r,e),[i,s]=((e,t,n)=>{var r;const o="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let i=e,s=0,a=0,l=!1;do{const[e,c,u]=aq(i,t),d=u-e-o*c;0===c&&0===d||!lq(i,t)||(s+=d,a+=c),i===(null!=n?n:document.documentElement)?l=!0:i=null!=(r=i._$host)?r:i.parentElement}while(i&&!l);return[s,a]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},pq=(e,t)=>{var n;if(e.contains(t))return!0;let r=t;for(;r;){if(r===e)return!0;r=null!=(n=r._$host)?n:r.parentElement}return!1},gq=e=>{const t=br({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Sr();let r=[0,0],o=null,i=null;$n((()=>{X$(t.enabled)&&(uq((e=>[...e,n])),Bn((()=>{uq((e=>e.filter((e=>e!==n))))})))})),$n((()=>{if(!X$(t.enabled)||!X$(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(X$(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===X$(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;sq({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{X$(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else sq({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),$n((()=>{var e;(e=n,cq().indexOf(e)===cq().length-1&&X$(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Bn((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=hq(e),o=null,i=null},a=e=>{const n=e.target,r=X$(t.element),o=dq(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=fq(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!pq(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=X$(t.element),s=e.target;let a;if(2===e.touches.length)a=!X$(t.allowPinchZoom);else{if(null==o||null===i){const t=hq(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=fq(s,o,i,n);a=!n||!pq(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},mq=Gn();function vq(){return Yn(mq)}function yq(){const e=vq();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var bq=Gn();function wq(){const e=Yn(bq);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var xq=Gn();function kq(){const e=Yn(xq);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Sq(e){let t;const n=kq(),r=yq(),o=e$({id:n.generateId(`item-${Sr()}`)},e),[i,s]=wr(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_n(),[c,u]=_n(),[d,h]=_n(),f=()=>r.listState().selectionManager(),p=()=>s.id,g=()=>{var e;null==(e=i.onSelect)||e.call(i),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};D$({getItem:()=>{var e,n,r,o,s;return{ref:()=>t,type:"item",key:p(),textValue:null!=(o=null!=(r=null!=(n=i.textValue)?n:null==(e=d())?void 0:e.textContent)?r:null==t?void 0:t.textContent)?o:"",disabled:null!=(s=i.disabled)&&s}}});const m=H$({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{FL(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(zL(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{FL(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{FL(e,i.onPointerUp),i.disabled||0!==e.button||g()},w=e=>{if(FL(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":g()}},x=Fn((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),k=Fn((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===p()?"":void 0}))),S={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:TL((()=>s.id)),registerLabel:a$(l),registerDescription:a$(u)};return pr(bq.Provider,{value:S,get children(){return pr(u$,br({as:"div",ref(e){const n=dL((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return m.tabIndex()},get"aria-checked"(){return x()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return m.dataKey()},get onPointerDown(){return IL([i.onPointerDown,m.onPointerDown])},get onPointerUp(){return IL([b,m.onPointerUp])},get onClick(){return IL([i.onClick,m.onClick])},get onKeyDown(){return IL([w,m.onKeyDown])},get onMouseDown(){return IL([i.onMouseDown,m.onMouseDown])},get onFocus(){return IL([i.onFocus,m.onFocus])},onPointerMove:v,onPointerLeave:y},k,s))}})}function Cq(e){const t=e$({closeOnSelect:!1},e),[n,r]=wr(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=b$({value:()=>yR(e.isSelected),defaultValue:()=>!!yR(e.defaultIsSelected),onChange:t=>{var n;return null==(n=e.onSelectedChange)?void 0:n.call(e,t)}});return{isSelected:t,setIsSelected:t=>{yR(e.isReadOnly)||yR(e.isDisabled)||n(t)},toggle:()=>{yR(e.isReadOnly)||yR(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>{var t;return null==(t=n.onChange)?void 0:t.call(n,e)},isDisabled:()=>r.disabled});return pr(Sq,br({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var e;null==(e=n.onSelect)||e.call(n),o.toggle()}},r))}var Eq=Gn();function Pq(){return Yn(Eq)}var jq={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>jq.next("ltr"===e?"rtl":"ltr",t)},Dq=e=>"horizontal"===e?"ArrowDown":"ArrowRight",Tq=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function Mq(e){const t=kq(),n=yq(),r=Pq(),{direction:o}=I$(),i=e$({id:t.generateId("trigger")},e),[s,a]=wr(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>{var e;return null!=(e=t.value())?e:s.id},void 0===r.lastValue()&&r.setLastValue(l));const c=l$((()=>n.triggerRef()),(()=>"button")),u=Fn((()=>{var e;return"a"===c()&&null!=(null==(e=n.triggerRef())?void 0:e.getAttribute("href"))}));$n(zn((()=>null==r?void 0:r.value()),(e=>{var t;u()&&e===l()&&(null==(t=n.triggerRef())||t.focus())})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return $n((()=>Bn(n.registerTriggerId(s.id)))),pr(lF,br({ref(e){const t=dL(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Fn((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&(null==r?void 0:r.value())===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{FL(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{var t;FL(e,s.onMouseOver),"touch"!==(null==(t=n.triggerRef())?void 0:t.dataset.pointerType)&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{FL(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(FL(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case Dq(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){var t,n;if(document.contains(e)){const r=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(r).overflow){let t=XL(e);for(;e&&t&&e!==r&&t!==r;)o$(t,e),t=XL(e=t)}else{const{left:r,top:o}=e.getBoundingClientRect();null==(t=null==e?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"});const{left:i,top:s}=e.getBoundingClientRect();(Math.abs(r-i)>1||Math.abs(o-s)>1)&&(null==(n=e.scrollIntoView)||n.call(e,{block:"nearest"}))}}}(e.currentTarget),n.open("first"),null==r||r.setAutoFocusMenu(!0),null==r||r.setValue(l);break;case Tq(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case jq.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case jq.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{FL(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var Oq=Gn();function Aq(){return Yn(Oq)}function Nq(e){let t;const n=kq(),r=yq(),o=Pq(),i=Aq(),{direction:s}=I$(),a=e$({id:n.generateId(`content-${Sr()}`)},e),[l,c]=wr(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),h=YI({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));eq({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{var t;void 0===o&&(null==(t=l.onOpenAutoFocus)||t.call(l,e))},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{var t;null==(t=l.onEscapeKeyDown)||t.call(l,e),null==o||o.setAutoFocusMenu(!1),r.close(!0)},p=e=>{var t;null==(t=l.onFocusOutside)||t.call(l,e),n.isModal()&&e.preventDefault()};$n((()=>Bn(r.registerContentId(l.id))));const g={ref:dL((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:IL([l.onKeyDown,h.onKeyDown,e=>{if(ML(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case jq.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case jq.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:IL([l.onMouseDown,h.onMouseDown]),onFocusIn:IL([l.onFocusIn,h.onFocusIn]),onFocusOut:IL([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{var t,n;FL(e,l.onPointerEnter),r.isOpen()&&(null==(t=r.parentMenuContext())||t.listState().selectionManager().setFocused(!1),null==(n=r.parentMenuContext())||n.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(FL(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;ML(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return pr(jr,{get when(){return r.contentPresent()},get children(){return pr(jr,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return pr(u$,br({as:"div"},(()=>r.dataset()),g,c))},get children(){return pr(DI.Positioner,{get children(){return pr(AI,br({get disableOutsidePointerEvents(){return Fn((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return PL({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:p,get onDismiss(){return r.close}},(()=>r.dataset()),g,c))}})}})}})}function _q(e){let t;const n=kq(),r=yq(),[o,i]=wr(e,["ref"]);return gq({element:()=>null!=t?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),pr(Nq,br({ref(e){const n=dL((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var Rq=Gn();function Lq(e){const t=e$({id:kq().generateId(`group-${Sr()}`)},e),[n,r]=_n(),o={generateId:TL((()=>t.id)),registerLabelId:a$(r)};return pr(Rq.Provider,{value:o,get children(){return pr(u$,br({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function $q(e){const t=function(){const e=Yn(Rq);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=e$({id:t.generateId("label")},e),[r,o]=wr(n,["id"]);return $n((()=>Bn(t.registerLabelId(r.id)))),pr(u$,br({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function Fq(e){const t=yq();return pr(u$,br({as:"span","aria-hidden":"true"},(()=>t.dataset()),e$({children:"▼"},e)))}function Iq(e){return pr(Sq,br({role:"menuitem",closeOnSelect:!0},e))}function qq(e){const t=wq(),n=e$({id:t.generateId("description")},e),[r,o]=wr(n,["id"]);return $n((()=>Bn(t.registerDescription(r.id)))),pr(u$,br({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function zq(e){const t=wq(),n=e$({id:t.generateId("indicator")},e),[r,o]=wr(n,["forceMount"]);return pr(jr,{get when(){return r.forceMount||t.isChecked()},get children(){return pr(u$,br({as:"div"},(()=>t.dataset()),o))}})}function Vq(e){const t=wq(),n=e$({id:t.generateId("label")},e),[r,o]=wr(n,["ref","id"]);return $n((()=>Bn(t.registerLabel(r.id)))),pr(u$,br({as:"div",ref(e){const n=dL(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function Bq(e){const t=yq();return pr(jr,{get when(){return t.contentPresent()},get children(){return pr(ro,e)}})}var Uq=Gn();function Kq(e){const t=e$({id:kq().generateId(`radiogroup-${Sr()}`)},e),[n,r]=wr(t,["value","defaultValue","onChange","disabled"]),[o,i]=y$({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>{var t;return null==(t=n.onChange)?void 0:t.call(n,e)}});return pr(Uq.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return pr(Lq,r)}})}function Wq(e){const t=function(){const e=Yn(Uq);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=e$({closeOnSelect:!1},e),[r,o]=wr(n,["value","onSelect"]);return pr(Sq,br({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var e;null==(e=r.onSelect)||e.call(r),t.setSelectedValue(r.value)}},o))}function Hq(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function Gq(e){const t=kq(),n=S$(),r=vq(),o=Pq(),i=Aq(),s=e$({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=wr(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=_n(),[p,g]=_n(),[m,v]=_n(),[y,b]=_n(),[w,x]=_n(!0),[k,S]=_n(l.placement),[C,E]=_n([]),[P,j]=_n([]),{DomCollectionProvider:D}=j$({items:P,onItemsChange:j}),T=NI({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>{var t;return null==(t=a.onOpenChange)?void 0:t.call(a,e)}}),{present:M}=J$({show:()=>t.forceMount()||T.isOpen(),element:()=>{var e;return null!=(e=y())?e:null}}),O=function(e){const t=K$(e),n=M$({dataSource:()=>yR(e.dataSource),getKey:()=>yR(e.getKey),getTextValue:()=>yR(e.getTextValue),getDisabled:()=>yR(e.getDisabled),getSectionChildren:()=>yR(e.getSectionChildren),factory:t=>new Y$(e.filter?e.filter(t):t)},[()=>e.filter]),r=new G$(n,t);return Rn((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:P}),A=e=>{x(e),T.open()},N=(e=!1)=>{T.close(),e&&r&&r.close(!0)},_=()=>{const e=y();e&&(zL(e),O.selectionManager().setFocused(!0),O.selectionManager().setFocusedKey(void 0))},R=()=>{null!=i?setTimeout((()=>_())):_()},L=e=>{return d===(null==u?void 0:u.side)&&(t=e,!!(n=null==u?void 0:u.area)&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],h=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};nq({isDisabled:()=>!(null==r&&T.isOpen()&&t.isModal()),targets:()=>[y(),...C()].filter(Boolean)}),$n((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);Bn((()=>{t()}))})),$n((()=>{void 0===r&&(null==o||o.registerMenu(t.value(),[y(),...C()]))})),$n((()=>{var e;void 0===r&&void 0!==o&&(o.value()===t.value()?(null==(e=m())||e.focus(),o.autoFocusMenu()&&A(!0)):N())})),$n((()=>{void 0===r&&void 0!==o&&T.isOpen()&&o.setValue(t.value())})),Bn((()=>{void 0===r&&(null==o||o.unregisterMenu(t.value()))}));const $={dataset:Fn((()=>({"data-expanded":T.isOpen()?"":void 0,"data-closed":T.isOpen()?void 0:""}))),isOpen:T.isOpen,contentPresent:M,nestedMenus:C,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:w,listState:()=>O,parentMenuContext:()=>r,triggerRef:m,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:A,close:N,toggle:e=>{x(e),T.toggle()},focusContent:R,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||R()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=null==r?void 0:r.registerNestedMenu(e);return()=>{E((t=>jL(t,e))),null==t||t()}},registerItemToParentDomCollection:null==n?void 0:n.registerItem,registerTriggerId:a$(f),registerContentId:a$(g)};return pr(D,{get children(){return pr(mq.Provider,{value:$,get children(){return pr(jr,{when:void 0===i,get fallback(){return l.children},get children(){return pr(DI,br({anchorRef:m,contentRef:y,onCurrentPlacementChange:S},l))}})}})}})}function Yq(e){const{direction:t}=I$();return pr(Gq,br({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var Qq=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function Xq(e){const t=yq(),n=kq(),[r,o]=wr(e,["onFocusOutside","onKeyDown"]),{direction:i}=I$();return pr(Nq,br({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{var n;null==(n=r.onFocusOutside)||n.call(r,e);const o=e.target;ML(t.triggerRef(),o)||t.close()},onKeyDown:e=>{FL(e,r.onKeyDown);const o=ML(e.currentTarget,e.target),s=Qq(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),zL(t.triggerRef()))}},o))}var Jq=["Enter"," "],Zq=(e,t)=>"ltr"===e?[...Jq,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...Jq,"horizontal"===t?"ArrowLeft":"ArrowUp"];function ez(e){let t;const n=kq(),r=yq(),o=e$({id:n.generateId(`sub-trigger-${Sr()}`)},e),[i,s]=wr(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=I$(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},h=H$({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{FL(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{FL(e,i.onKeyDown),e.repeat||i.disabled||Zq(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return $n((()=>{var e,n,o;if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");Bn(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:null!=(n=null!=(e=i.textValue)?e:null==t?void 0:t.textContent)?n:"",disabled:null!=(o=i.disabled)&&o}))})),$n(zn((()=>{var e;return null==(e=r.parentMenuContext())?void 0:e.pointerGraceTimeoutId()}),(e=>{Bn((()=>{var t;window.clearTimeout(e),null==(t=r.parentMenuContext())||t.setPointerGraceIntent(null)}))}))),$n((()=>Bn(r.registerTriggerId(i.id)))),Bn((()=>{l()})),pr(u$,br({as:"div",ref(e){const n=dL((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Fn((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return IL([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return IL([i.onPointerUp,h.onPointerUp])},get onClick(){return IL([f,h.onClick])},get onKeyDown(){return IL([p,h.onKeyDown])},get onMouseDown(){return IL([i.onMouseDown,h.onMouseDown])},get onFocus(){return IL([i.onFocus,h.onFocus])},onPointerMove:e=>{var t;if(FL(e,i.onPointerMove),"mouse"!==e.pointerType)return;const n=r.parentMenuContext();null==n||n.onItemEnter(e),e.defaultPrevented||(i.disabled?null==n||n.onItemLeave(e):(r.isOpen()||a||(null==(t=r.parentMenuContext())||t.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),null==n||n.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),zL(e.currentTarget),null==n||n.listState().selectionManager().setFocused(!0),null==n||n.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(FL(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){null==t||t.setPointerGraceIntent({area:Hq(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(null==t?void 0:t.pointerGraceTimeoutId());const o=window.setTimeout((()=>{null==t||t.setPointerGraceIntent(null)}),300);null==t||t.setPointerGraceTimeoutId(o)}else{if(null==t||t.onTriggerLeave(e),e.defaultPrevented)return;null==t||t.setPointerGraceIntent(null)}null==t||t.onItemLeave(e)}},(()=>r.dataset()),s))}function tz(e){const t=Pq(),n=e$({id:`menu-${Sr()}`,modal:!0},e),[r,o]=wr(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=NI({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>{var t;return null==(t=r.onOpenChange)?void 0:t.call(r,e)}}),s={isModal:()=>{var e;return null==(e=r.modal)||e},preventScroll:()=>{var e;return null!=(e=r.preventScroll)?e:s.isModal()},forceMount:()=>{var e;return null!=(e=r.forceMount)&&e},generateId:TL((()=>r.id)),value:()=>r.value,orientation:()=>{var e,n;return null!=(n=null!=(e=r.orientation)?e:null==t?void 0:t.orientation())?n:"horizontal"}};return pr(xq.Provider,{value:s,get children(){return pr(Gq,br({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function nz(e){let t;const n=e$({orientation:"horizontal"},e),[r,o]=wr(n,["ref","orientation"]),i=l$((()=>t),(()=>"hr"));return pr(u$,br({as:"hr",ref(e){const n=dL((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}x$({},{Root:()=>nz,Separator:()=>rz});var rz=nz,oz={};function iz(e){const t=kq(),n=yq(),[r,o]=wr(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return pr(_q,br({onCloseAutoFocus:e=>{var t;null==(t=r.onCloseAutoFocus)||t.call(r,e),i||zL(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{var n;null==(n=r.onInteractOutside)||n.call(r,e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function sz(e){return pr(tz,e$({id:`dropdownmenu-${Sr()}`},e))}x$(oz,{Arrow:()=>CI,CheckboxItem:()=>Cq,Content:()=>iz,DropdownMenu:()=>az,Group:()=>Lq,GroupLabel:()=>$q,Icon:()=>Fq,Item:()=>Iq,ItemDescription:()=>qq,ItemIndicator:()=>zq,ItemLabel:()=>Vq,Portal:()=>Bq,RadioGroup:()=>Kq,RadioItem:()=>Wq,Root:()=>sz,Separator:()=>nz,Sub:()=>Yq,SubContent:()=>Xq,SubTrigger:()=>ez,Trigger:()=>Mq});var az=Object.assign(sz,{Arrow:CI,CheckboxItem:Cq,Content:iz,Group:Lq,GroupLabel:$q,Icon:Fq,Item:Iq,ItemDescription:qq,ItemIndicator:zq,ItemLabel:Vq,Portal:Bq,RadioGroup:Kq,RadioItem:Wq,Separator:nz,Sub:Yq,SubContent:Xq,SubTrigger:ez,Trigger:Mq}),lz={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},cz=Ir('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),uz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dz=Ir('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),hz=Ir('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),fz=Ir('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),pz=Ir('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gz=Ir('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mz=Ir('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vz=Ir('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),yz=Ir('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),bz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),wz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),kz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Sz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Cz=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Ez=Ir('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),Pz=Ir('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),jz=Ir('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Dz=Ir('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),Tz=Ir('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Mz=Ir('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Oz=Ir('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function Az(){return cz()}function Nz(){return uz()}function _z(){return dz()}function Rz(){return hz()}function Lz(){return fz()}function $z(){return(e=fz()).style.setProperty("transform","rotate(90deg)"),e;var e}function Fz(){return(e=fz()).style.setProperty("transform","rotate(-90deg)"),e;var e}function Iz(){return pz()}function qz(){return gz()}function zz(){return mz()}function Vz(){return vz()}function Bz(){return yz()}function Uz(){return bz()}function Kz(){return wz()}function Wz(){return xz()}function Hz(){return kz()}function Gz(e){return t=Sz(),n=t.firstChild,Ln((()=>zr(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function Yz(){return Cz()}function Qz(){return Ez()}function Xz(e){return[pr(jr,{get when(){return e.checked},get children(){var t=Sz(),n=t.firstChild;return Ln((()=>zr(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),pr(jr,{get when(){return!e.checked},get children(){var t=Pz(),n=t.firstChild;return Ln((()=>zr(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function Jz(){return jz()}function Zz(){return Dz()}function eV(){return Tz()}function tV(){return Mz()}function nV(){const e=Sr();return t=Oz(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,h=(d=c.nextSibling).firstChild,g=(p=(f=d.nextSibling).nextSibling).firstChild,v=(m=p.nextSibling).firstChild,w=(b=(y=m.nextSibling).nextSibling).firstChild,k=(x=b.nextSibling).firstChild,E=(C=(S=x.nextSibling).nextSibling).firstChild,j=(P=C.nextSibling).firstChild,M=(T=(D=P.nextSibling).nextSibling).firstChild,A=(O=T.nextSibling).firstChild,R=(_=(N=O.nextSibling).nextSibling).firstChild,$=(L=_.nextSibling).firstChild,q=(I=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,V=(z=F.nextSibling).firstChild,U=(B=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(H=(W=(K=B.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,he=(de=(ue=le.nextSibling).firstChild).nextSibling,pe=(fe=ue.nextSibling).firstChild,me=(ge=fe.nextSibling).firstChild,Re=(_e=(Ne=(Ae=(Oe=(Me=(Te=(De=(je=(Pe=(Ee=(Ce=(Se=(ke=(xe=(we=(be=(ye=(ve=ge.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,zr(n,"id",`a-${e}`),zr(r,"fill",`url(#a-${e})`),zr(i,"id",`am-${e}`),zr(s,"id",`b-${e}`),zr(a,"filter",`url(#am-${e})`),zr(l,"mask",`url(#b-${e})`),zr(u,"id",`ah-${e}`),zr(d,"id",`k-${e}`),zr(h,"filter",`url(#ah-${e})`),zr(f,"mask",`url(#k-${e})`),zr(g,"id",`ae-${e}`),zr(m,"id",`j-${e}`),zr(v,"filter",`url(#ae-${e})`),zr(y,"mask",`url(#j-${e})`),zr(w,"id",`ai-${e}`),zr(x,"id",`i-${e}`),zr(k,"filter",`url(#ai-${e})`),zr(S,"mask",`url(#i-${e})`),zr(E,"id",`aj-${e}`),zr(P,"id",`h-${e}`),zr(j,"filter",`url(#aj-${e})`),zr(D,"mask",`url(#h-${e})`),zr(M,"id",`ag-${e}`),zr(O,"id",`g-${e}`),zr(A,"filter",`url(#ag-${e})`),zr(N,"mask",`url(#g-${e})`),zr(R,"id",`af-${e}`),zr(L,"id",`f-${e}`),zr($,"filter",`url(#af-${e})`),zr(F,"mask",`url(#f-${e})`),zr(I,"id",`m-${e}`),zr(q,"fill",`url(#m-${e})`),zr(V,"id",`ak-${e}`),zr(B,"id",`e-${e}`),zr(U,"filter",`url(#ak-${e})`),zr(K,"mask",`url(#e-${e})`),zr(W,"id",`n-${e}`),zr(H,"fill",`url(#n-${e})`),zr(G,"id",`r-${e}`),zr(Y,"fill",`url(#r-${e})`),zr(Q,"id",`s-${e}`),zr(X,"fill",`url(#s-${e})`),zr(J,"id",`q-${e}`),zr(Z,"fill",`url(#q-${e})`),zr(ee,"id",`p-${e}`),zr(te,"fill",`url(#p-${e})`),zr(ne,"id",`o-${e}`),zr(re,"fill",`url(#o-${e})`),zr(oe,"id",`l-${e}`),zr(ie,"fill",`url(#l-${e})`),zr(ae,"id",`al-${e}`),zr(le,"id",`d-${e}`),zr(ce,"filter",`url(#al-${e})`),zr(ue,"mask",`url(#d-${e})`),zr(de,"id",`u-${e}`),zr(he,"fill",`url(#u-${e})`),zr(pe,"id",`ad-${e}`),zr(ge,"id",`c-${e}`),zr(me,"filter",`url(#ad-${e})`),zr(ve,"mask",`url(#c-${e})`),zr(ye,"id",`t-${e}`),zr(be,"fill",`url(#t-${e})`),zr(we,"id",`v-${e}`),zr(xe,"stroke",`url(#v-${e})`),zr(ke,"id",`aa-${e}`),zr(Se,"stroke",`url(#aa-${e})`),zr(Ce,"id",`w-${e}`),zr(Ee,"stroke",`url(#w-${e})`),zr(Pe,"id",`ac-${e}`),zr(je,"stroke",`url(#ac-${e})`),zr(De,"id",`ab-${e}`),zr(Te,"stroke",`url(#ab-${e})`),zr(Me,"id",`y-${e}`),zr(Oe,"stroke",`url(#y-${e})`),zr(Ae,"id",`x-${e}`),zr(Ne,"stroke",`url(#x-${e})`),zr(_e,"id",`z-${e}`),zr(Re,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,g,m,v,y,b,w,x,k,S,C,E,P,j,D,T,M,O,A,N,_,R,L,$,F,I,q,z,V,B,U,K,W,H,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,ge,me,ve,ye,be,we,xe,ke,Se,Ce,Ee,Pe,je,De,Te,Me,Oe,Ae,Ne,_e,Re}var rV=Ir('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),oV=Ir('<button title="Copy object to clipboard">'),iV=Ir('<button title="Remove all items"aria-label="Remove all items">'),sV=Ir('<button title="Delete item"aria-label="Delete item">'),aV=Ir('<button title="Toggle value"aria-label="Toggle value">'),lV=Ir('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),cV=Ir("<div>"),uV=Ir("<div><button> <span></span> <span> "),dV=Ir("<input>"),hV=Ir("<span>"),fV=Ir("<div><span>:"),pV=Ir("<div><div><button> [<!>...<!>]");var gV=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?CV(n):SV(n)));return o=rV(),Ln((()=>Vr(o,cL(r().expander,n`
35
+ transform: rotate(${e.expanded?90:0}deg);
36
+ `,e.expanded&&n`
37
+ & svg {
38
+ top: -1px;
66
39
  }
67
- 100% {
68
- transform: rotate(180deg);
40
+ `)))),o;var o},mV=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?CV(n):SV(n))),[o,i]=_n("NoCopy");return Br(s=oV(),"click","NoCopy"===o()?()=>{navigator.clipboard.writeText(Qo(e.value)).then((()=>{i("SuccessCopy"),setTimeout((()=>{i("NoCopy")}),1500)}),(e=>{i("ErrorCopy"),setTimeout((()=>{i("NoCopy")}),1500)}))}:void 0,!0),Wr(s,pr(Dr,{get children(){return[pr(Tr,{get when(){return"NoCopy"===o()},get children(){return pr(Wz,{})}}),pr(Tr,{get when(){return"SuccessCopy"===o()},get children(){return pr(Gz,{get theme(){return t()}})}}),pr(Tr,{get when(){return"ErrorCopy"===o()},get children(){return pr(Yz,{})}})]}})),Ln((e=>{var t=r().actionButton,n="NoCopy"===o()?"Copy object to clipboard":"SuccessCopy"===o()?"Object copied to clipboard":"Error copying object to clipboard";return t!==e.e&&Vr(s,e.e=t),n!==e.t&&zr(s,"aria-label",e.t=n),e}),{e:void 0,t:void 0}),s;var s},vV=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?CV(n):SV(n))),o=OR().client;return(i=iV()).$$click=()=>{const t=li(e.activeQuery.state.data,e.dataPath,[]);o.setQueryData(e.activeQuery.queryKey,t)},Wr(i,pr(Qz,{})),Ln((()=>Vr(i,r().actionButton))),i;var i},yV=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?CV(n):SV(n))),o=OR().client;return(i=sV()).$$click=()=>{const t=ci(e.activeQuery.state.data,e.dataPath);o.setQueryData(e.activeQuery.queryKey,t)},Wr(i,pr(Nz,{})),Ln((()=>Vr(i,cL(r().actionButton)))),i;var i},bV=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?CV(n):SV(n))),o=OR().client;return(i=aV()).$$click=()=>{const t=li(e.activeQuery.state.data,e.dataPath,!e.value);o.setQueryData(e.activeQuery.queryKey,t)},Wr(i,pr(Xz,{get theme(){return t()},get checked(){return e.value}})),Ln((()=>Vr(i,cL(r().actionButton,n`
41
+ width: ${lz.size[3.5]};
42
+ height: ${lz.size[3.5]};
43
+ `)))),i;var i};function wV(e){return Symbol.iterator in e}function xV(e){var t;const n=LR(),r=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,o=Fn((()=>"dark"===n()?CV(r):SV(r))),i=OR().client,[s,a]=_n((e.defaultExpanded||[]).includes(e.label)),[l,c]=_n([]),u=Fn((()=>Array.isArray(e.value)?e.value.map(((e,t)=>({label:t.toString(),value:e}))):null!==e.value&&"object"==typeof e.value&&wV(e.value)&&"function"==typeof e.value[Symbol.iterator]?e.value instanceof Map?Array.from(e.value,(([e,t])=>({label:e,value:t}))):Array.from(e.value,((e,t)=>({label:t.toString(),value:e}))):"object"==typeof e.value&&null!==e.value?Object.entries(e.value).map((([e,t])=>({label:e,value:t}))):[])),d=Fn((()=>Array.isArray(e.value)?"array":null!==e.value&&"object"==typeof e.value&&wV(e.value)&&"function"==typeof e.value[Symbol.iterator]?"Iterable":"object"==typeof e.value&&null!==e.value?"object":typeof e.value)),h=Fn((()=>function(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n+=t;return r}(u(),100))),f=null!=(t=e.dataPath)?t:[];return Wr(p=cV(),pr(jr,{get when(){return h().length},get children(){return[(t=uV(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,p=i.nextSibling.nextSibling,g=p.firstChild,n.$$click=()=>a((e=>!e)),Wr(n,pr(gV,{get expanded(){return s()}}),r),Wr(i,(()=>e.label)),Wr(p,(()=>"iterable"===String(d()).toLowerCase()?"(Iterable) ":""),g),Wr(p,(()=>u().length),g),Wr(p,(()=>u().length>1?"items":"item"),null),Wr(t,pr(jr,{get when(){return e.editable},get children(){var t=cV();return Wr(t,pr(mV,{get value(){return e.value}}),null),Wr(t,pr(jr,{get when(){return e.itemsDeletable&&void 0!==e.activeQuery},get children(){return pr(yV,{get activeQuery(){return e.activeQuery},dataPath:f})}}),null),Wr(t,pr(jr,{get when(){return"array"===d()&&void 0!==e.activeQuery},get children(){return pr(vV,{get activeQuery(){return e.activeQuery},dataPath:f})}}),null),Wr(t,pr(jr,{get when(){return Fn((()=>!!e.onEdit))()&&!Yo(e.value).meta},get children(){var t=lV();return t.$$click=()=>{var t;null==(t=e.onEdit)||t.call(e)},Wr(t,pr(Hz,{})),Ln((()=>Vr(t,o().actionButton))),t}}),null),Ln((()=>Vr(t,o().actions))),t}}),null),Ln((e=>{var r=o().expanderButtonContainer,i=o().expanderButton,s=o().info;return r!==e.e&&Vr(t,e.e=r),i!==e.t&&Vr(n,e.t=i),s!==e.a&&Vr(p,e.a=s),e}),{e:void 0,t:void 0,a:void 0}),t),pr(jr,{get when(){return s()},get children(){return[pr(jr,{get when(){return 1===h().length},get children(){var t=cV();return Wr(t,pr(xL,{get each(){return u()},by:e=>e.label,children:t=>pr(xV,{get defaultExpanded(){return e.defaultExpanded},get label(){return t().label},get value(){return t().value},get editable(){return e.editable},get dataPath(){return[...f,t().label]},get activeQuery(){return e.activeQuery},get itemsDeletable(){return"array"===d()||"Iterable"===d()||"object"===d()}})})),Ln((()=>Vr(t,o().subEntry))),t}}),pr(jr,{get when(){return h().length>1},get children(){var t=cV();return Wr(t,pr(Pr,{get each(){return h()},children:(t,n)=>{return r=pV(),d=(u=(a=(s=(i=r.firstChild).firstChild).firstChild).nextSibling).nextSibling.nextSibling,s.$$click=()=>c((e=>e.includes(n)?e.filter((e=>e!==n)):[...e,n])),Wr(s,pr(gV,{get expanded(){return l().includes(n)}}),a),Wr(s,100*n,u),Wr(s,100*n+100-1,d),Wr(i,pr(jr,{get when(){return l().includes(n)},get children(){var n=cV();return Wr(n,pr(xL,{get each(){return t()},by:e=>e.label,children:t=>pr(xV,{get defaultExpanded(){return e.defaultExpanded},get label(){return t().label},get value(){return t().value},get editable(){return e.editable},get dataPath(){return[...f,t().label]},get activeQuery(){return e.activeQuery}})})),Ln((()=>Vr(n,o().subEntry))),n}}),null),Ln((e=>{var t=o().entry,n=o().expanderButton;return t!==e.e&&Vr(i,e.e=t),n!==e.t&&Vr(s,e.t=n),e}),{e:void 0,t:void 0}),r;var r,i,s,a,u,d}})),Ln((()=>Vr(t,o().subEntry))),t}})]}})];var t,n,r,i,p,g}}),null),Wr(p,pr(jr,{get when(){return 0===h().length},get children(){var t=fV(),n=t.firstChild;return Wr(n,(()=>e.label),n.firstChild),Wr(t,pr(jr,{get when(){return Fn((()=>!(!e.editable||void 0===e.activeQuery)))()&&("string"===d()||"number"===d()||"boolean"===d())},get fallback(){return Wr(t=hV(),(()=>Zo(e.value))),Ln((()=>Vr(t,o().value))),t;var t},get children(){return[pr(jr,{get when(){return Fn((()=>!(!e.editable||void 0===e.activeQuery)))()&&("string"===d()||"number"===d())},get children(){var t=dV();return t.addEventListener("change",(t=>{const n=li(e.activeQuery.state.data,f,"number"===d()?t.target.valueAsNumber:t.target.value);i.setQueryData(e.activeQuery.queryKey,n)})),Ln((e=>{var n="number"===d()?"number":"text",r=cL(o().value,o().editableInput);return n!==e.e&&zr(t,"type",e.e=n),r!==e.t&&Vr(t,e.t=r),e}),{e:void 0,t:void 0}),Ln((()=>t.value=e.value)),t}}),pr(jr,{get when(){return"boolean"===d()},get children(){var t=hV();return Wr(t,pr(bV,{get activeQuery(){return e.activeQuery},dataPath:f,get value(){return e.value}}),null),Wr(t,(()=>Zo(e.value)),null),Ln((()=>Vr(t,cL(o().value,o().actions,o().editableInput)))),t}})]}}),null),Wr(t,pr(jr,{get when(){return e.editable&&e.itemsDeletable&&void 0!==e.activeQuery},get children(){return pr(yV,{get activeQuery(){return e.activeQuery},dataPath:f})}}),null),Ln((e=>{var r=o().row,i=o().label;return r!==e.e&&Vr(t,e.e=r),i!==e.t&&Vr(n,e.t=i),e}),{e:void 0,t:void 0}),t}}),null),Ln((()=>Vr(p,o().entry))),p;var p}var kV=(e,t)=>{const{colors:n,font:r,size:o,border:i}=lz,s=(t,n)=>"light"===e?t:n;return{entry:t`
44
+ & * {
45
+ font-size: ${r.size.xs};
46
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
47
+ 'Liberation Mono', 'Courier New', monospace;
48
+ }
49
+ position: relative;
50
+ outline: none;
51
+ word-break: break-word;
52
+ `,subEntry:t`
53
+ margin: 0 0 0 0.5em;
54
+ padding-left: 0.75em;
55
+ border-left: 2px solid ${s(n.gray[300],n.darkGray[400])};
56
+ /* outline: 1px solid ${n.teal[400]}; */
57
+ `,expander:t`
58
+ & path {
59
+ stroke: ${n.gray[400]};
60
+ }
61
+ & svg {
62
+ width: ${o[3]};
63
+ height: ${o[3]};
64
+ }
65
+ display: inline-flex;
66
+ align-items: center;
67
+ transition: all 0.1s ease;
68
+ /* outline: 1px solid ${n.blue[400]}; */
69
+ `,expanderButtonContainer:t`
70
+ display: flex;
71
+ align-items: center;
72
+ line-height: ${o[4]};
73
+ min-height: ${o[4]};
74
+ gap: ${o[2]};
75
+ `,expanderButton:t`
76
+ cursor: pointer;
77
+ color: inherit;
78
+ font: inherit;
79
+ outline: inherit;
80
+ height: ${o[5]};
81
+ background: transparent;
82
+ border: none;
83
+ padding: 0;
84
+ display: inline-flex;
85
+ align-items: center;
86
+ gap: ${o[1]};
87
+ position: relative;
88
+ /* outline: 1px solid ${n.green[400]}; */
89
+
90
+ &:focus-visible {
91
+ border-radius: ${i.radius.xs};
92
+ outline: 2px solid ${n.blue[800]};
93
+ }
94
+
95
+ & svg {
96
+ position: relative;
97
+ left: 1px;
98
+ }
99
+ `,info:t`
100
+ color: ${s(n.gray[500],n.gray[500])};
101
+ font-size: ${r.size.xs};
102
+ margin-left: ${o[1]};
103
+ /* outline: 1px solid ${n.yellow[400]}; */
104
+ `,label:t`
105
+ color: ${s(n.gray[700],n.gray[300])};
106
+ white-space: nowrap;
107
+ `,value:t`
108
+ color: ${s(n.purple[600],n.purple[400])};
109
+ flex-grow: 1;
110
+ `,actions:t`
111
+ display: inline-flex;
112
+ gap: ${o[2]};
113
+ align-items: center;
114
+ `,row:t`
115
+ display: inline-flex;
116
+ gap: ${o[2]};
117
+ width: 100%;
118
+ margin: ${o[.25]} 0px;
119
+ line-height: ${o[4.5]};
120
+ align-items: center;
121
+ `,editableInput:t`
122
+ border: none;
123
+ padding: ${o[.5]} ${o[1]} ${o[.5]} ${o[1.5]};
124
+ flex-grow: 1;
125
+ border-radius: ${i.radius.xs};
126
+ background-color: ${s(n.gray[200],n.darkGray[500])};
127
+
128
+ &:hover {
129
+ background-color: ${s(n.gray[300],n.darkGray[600])};
130
+ }
131
+ `,actionButton:t`
132
+ background-color: transparent;
133
+ color: ${s(n.gray[500],n.gray[500])};
134
+ border: none;
135
+ display: inline-flex;
136
+ padding: 0px;
137
+ align-items: center;
138
+ justify-content: center;
139
+ cursor: pointer;
140
+ width: ${o[3]};
141
+ height: ${o[3]};
142
+ position: relative;
143
+ z-index: 1;
144
+
145
+ &:hover svg {
146
+ color: ${s(n.gray[600],n.gray[400])};
147
+ }
148
+
149
+ &:focus-visible {
150
+ border-radius: ${i.radius.xs};
151
+ outline: 2px solid ${n.blue[800]};
152
+ outline-offset: 2px;
153
+ }
154
+ `}},SV=e=>kV("light",e),CV=e=>kV("dark",e);qr(["click"]);var EV=Ir('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),PV=Ir("<div>"),jV=Ir('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),DV=Ir("<select name=tsqd-queries-filter-sort>"),TV=Ir("<select name=tsqd-mutations-filter-sort>"),MV=Ir("<span>Asc"),OV=Ir("<span>Desc"),AV=Ir('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),NV=Ir("<div>Settings"),_V=Ir("<span>Position"),RV=Ir("<span>Top"),LV=Ir("<span>Bottom"),$V=Ir("<span>Left"),FV=Ir("<span>Right"),IV=Ir("<span>Theme"),qV=Ir("<span>Light"),zV=Ir("<span>Dark"),VV=Ir("<span>System"),BV=Ir("<div><div class=tsqd-queries-container>"),UV=Ir("<div><div class=tsqd-mutations-container>"),KV=Ir('<div><div><div><button aria-label="Close Tanstack query devtools"><span>TANSTACK</span><span> v</span></button></div></div><div><div><div><input aria-label="Filter queries by query key"type=text placeholder=Filter name=tsqd-query-filter-input></div><div></div><button class=tsqd-query-filter-sort-order-btn></button></div><div><button aria-label="Clear query cache"></button><button>'),WV=Ir("<option>Sort by "),HV=Ir("<div class=tsqd-query-disabled-indicator>disabled"),GV=Ir("<button><div></div><code class=tsqd-query-hash>"),YV=Ir("<div role=tooltip id=tsqd-status-tooltip>"),QV=Ir("<span>"),XV=Ir("<button><span></span><span>"),JV=Ir("<button><span></span> Error"),ZV=Ir('<div><span></span>Trigger Error<select><option value=""disabled selected>'),eB=Ir('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),tB=Ir("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),nB=Ir('<div><div>Query Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-observers-count><span>Observers:</span><span></span></div><div class=tsqd-query-details-last-updated><span>Last Updated:</span><span></span></div></div><div>Actions</div><div><button><span></span>Refetch</button><button><span></span>Invalidate</button><button><span></span>Reset</button><button><span></span>Remove</button><button><span></span> Loading</button></div><div>Data </div><div>Query Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),rB=Ir("<option>"),oB=Ir('<div><div>Mutation Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-last-updated><span>Submitted At:</span><span></span></div></div><div>Variables Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Context Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Data Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Mutations Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),[iB,sB]=_n(null),[aB,lB]=_n(null),[cB,uB]=_n(0),[dB,hB]=_n(!1),fB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n))),o=_R(),i=Fn((()=>OR().buttonPosition||"bottom-right")),s=Fn((()=>"true"===e.localStore.open||"false"!==e.localStore.open&&(OR().initialIsOpen||false))),a=Fn((()=>e.localStore.position||OR().position||PR));let l;$n((()=>{const t=l.parentElement,n=e.localStore.height||500,r=e.localStore.width||500,o=a();t.style.setProperty("--tsqd-panel-height",`${"top"===o?"-":""}${n}px`),t.style.setProperty("--tsqd-panel-width",`${"left"===o?"-":""}${r}px`)})),Vn((()=>{const e=()=>{const e=l.parentElement,t=getComputedStyle(e).fontSize;e.style.setProperty("--tsqd-font-size",t)};e(),window.addEventListener("focus",e),Bn((()=>{window.removeEventListener("focus",e)}))}));const c=Fn((()=>{var t;return null!=(t=e.localStore.pip_open)?t:"false"}));return[pr(jr,{get when(){return Fn((()=>!!o().pipWindow))()&&"true"==c()},get children(){return pr(ro,{get mount(){var e;return null==(e=o().pipWindow)?void 0:e.document.body},get children(){return pr(pB,{get children(){return pr(vB,e)}})}})}}),(u=PV(),"function"==typeof l?Kr(l,u):l=u,Wr(u,pr(yL,{name:"tsqd-panel-transition",get children(){return pr(jr,{get when(){return Fn((()=>!(!s()||o().pipWindow)))()&&"false"==c()},get children(){return pr(mB,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),Wr(u,pr(yL,{name:"tsqd-button-transition",get children(){return pr(jr,{get when(){return!s()},get children(){var t=EV(),n=t.firstChild,o=n.nextSibling;return Wr(n,pr(nV,{})),o.$$click=()=>e.setLocalStore("open","true"),Wr(o,pr(nV,{})),Ln((()=>Vr(t,cL(r().devtoolsBtn,r()[`devtoolsBtn-position-${i()}`],"tsqd-open-btn-container")))),t}})}}),null),Ln((()=>Vr(u,cL(n`
155
+ & .tsqd-panel-transition-exit-active,
156
+ & .tsqd-panel-transition-enter-active {
157
+ transition:
158
+ opacity 0.3s,
159
+ transform 0.3s;
69
160
  }
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);
161
+
162
+ & .tsqd-panel-transition-exit-to,
163
+ & .tsqd-panel-transition-enter {
164
+ ${"top"===a()||"bottom"===a()?"transform: translateY(var(--tsqd-panel-height));":"transform: translateX(var(--tsqd-panel-width));"}
78
165
  }
79
- to {
166
+
167
+ & .tsqd-button-transition-exit-active,
168
+ & .tsqd-button-transition-enter-active {
169
+ transition:
170
+ opacity 0.3s,
171
+ transform 0.3s;
80
172
  opacity: 1;
81
- transform: translateY(0);
82
173
  }
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"})});
174
+
175
+ & .tsqd-button-transition-exit-to,
176
+ & .tsqd-button-transition-enter {
177
+ transform: ${"relative"===i()?"none;":"top-left"===i()?"translateX(-72px);":"top-right"===i()?"translateX(72px);":"translateY(72px);"};
178
+ opacity: 0;
179
+ }
180
+ `,"tsqd-transitions-container")))),u)];var u},pB=e=>{const t=_R(),n=LR(),r=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,o=Fn((()=>"dark"===n()?NB(r):AB(r)));return $n((()=>{const e=t().pipWindow,n=()=>{e&&uB(e.innerWidth)};e&&(e.addEventListener("resize",n),n()),Bn((()=>{e&&e.removeEventListener("resize",n)}))})),(i=PV()).style.setProperty("--tsqd-font-size","16px"),i.style.setProperty("max-height","100vh"),i.style.setProperty("height","100vh"),i.style.setProperty("width","100vw"),Wr(i,(()=>e.children)),Ln((()=>Vr(i,cL(o().panel,(()=>{const{colors:e}=lz,t=(e,t)=>"dark"===n()?t:e;return cB()<ER?r`
181
+ flex-direction: column;
182
+ background-color: ${t(e.gray[300],e.gray[600])};
183
+ `:r`
184
+ flex-direction: row;
185
+ background-color: ${t(e.gray[200],e.darkGray[900])};
186
+ `})(),{[r`
187
+ min-width: min-content;
188
+ `]:cB()<700},"tsqd-main-panel")))),i;var i},gB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n)));let o;Vn((()=>{SL(o,(({width:e},t)=>{t===o&&uB(e)}))}));return i=PV(),"function"==typeof o?Kr(o,i):o=i,i.style.setProperty("--tsqd-font-size","16px"),Wr(i,(()=>e.children)),Ln((()=>Vr(i,cL(r().parentPanel,(()=>{const{colors:e}=lz,r=(e,n)=>"dark"===t()?n:e;return cB()<ER?n`
189
+ flex-direction: column;
190
+ background-color: ${r(e.gray[300],e.gray[600])};
191
+ `:n`
192
+ flex-direction: row;
193
+ background-color: ${r(e.gray[200],e.darkGray[900])};
194
+ `})(),{[n`
195
+ min-width: min-content;
196
+ `]:cB()<700},"tsqd-main-panel")))),i;var i},mB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n))),[o,i]=_n(!1),s=Fn((()=>e.localStore.position||OR().position||PR)),a=t=>{const n=t.currentTarget.parentElement;if(!n)return;i(!0);const{height:r,width:a}=n.getBoundingClientRect(),l=t.clientX,c=t.clientY;let u=0;const d=si(3.5),h=si(12),f=t=>{if(t.preventDefault(),"left"===s()||"right"===s()){const r="right"===s()?l-t.clientX:t.clientX-l;u=Math.round(a+r),u<h&&(u=h),e.setLocalStore("width",String(Math.round(u)));const o=n.getBoundingClientRect().width;Number(e.localStore.width)<o&&e.setLocalStore("width",String(o))}else{const n="bottom"===s()?c-t.clientY:t.clientY-c;u=Math.round(r+n),u<d&&(u=d,sB(null)),e.setLocalStore("height",String(Math.round(u)))}},p=()=>{o()&&i(!1),document.removeEventListener("mousemove",f,!1),document.removeEventListener("mouseUp",p,!1)};document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",p,!1)};let l;Vn((()=>{SL(l,(({width:e},t)=>{t===l&&uB(e)}))})),$n((()=>{var t,n;const r=null==(n=null==(t=l.parentElement)?void 0:t.parentElement)?void 0:n.parentElement;if(!r)return;const o=`${"padding"}${(i=e.localStore.position||PR).charAt(0).toUpperCase()+i.slice(1)}`;var i;const s="left"===e.localStore.position||"right"===e.localStore.position,a=(({padding:e,paddingTop:t,paddingBottom:n,paddingLeft:r,paddingRight:o})=>({padding:e,paddingTop:t,paddingBottom:n,paddingLeft:r,paddingRight:o}))(r.style);r.style[o]=`${s?e.localStore.width:e.localStore.height}px`,Bn((()=>{Object.entries(a).forEach((([e,t])=>{r.style[e]=t}))}))}));return c=jV(),d=(u=c.firstChild).nextSibling,"function"==typeof l?Kr(l,c):l=c,u.$$mousedown=a,d.$$click=()=>e.setLocalStore("open","false"),Wr(d,pr(_z,{})),Wr(c,pr(vB,e),null),Ln((o=>{var i=cL(r().panel,r()[`panel-position-${s()}`],(()=>{const{colors:e}=lz,r=(e,n)=>"dark"===t()?n:e;return cB()<ER?n`
197
+ flex-direction: column;
198
+ background-color: ${r(e.gray[300],e.gray[600])};
199
+ `:n`
200
+ flex-direction: row;
201
+ background-color: ${r(e.gray[200],e.darkGray[900])};
202
+ `})(),{[n`
203
+ min-width: min-content;
204
+ `]:cB()<700&&("right"===s()||"left"===s())},"tsqd-main-panel"),a="bottom"===s()||"top"===s()?`${e.localStore.height||500}px`:"auto",l="right"===s()||"left"===s()?`${e.localStore.width||500}px`:"auto",h=cL(r().dragHandle,r()[`dragHandle-position-${s()}`],"tsqd-drag-handle"),f=cL(r().closeBtn,r()[`closeBtn-position-${s()}`],"tsqd-minimize-btn");return i!==o.e&&Vr(c,o.e=i),a!==o.t&&(null!=(o.t=a)?c.style.setProperty("height",a):c.style.removeProperty("height")),l!==o.a&&(null!=(o.a=l)?c.style.setProperty("width",l):c.style.removeProperty("width")),h!==o.o&&Vr(u,o.o=h),f!==o.i&&Vr(d,o.i=f),o}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c;var c,u,d},vB=e=>{let t;PB(),TB();const n=LR(),r=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,o=Fn((()=>"dark"===n()?NB(r):AB(r))),i=_R(),[s,a]=_n("queries"),l=Fn((()=>e.localStore.sort||DR)),c=Fn((()=>Number(e.localStore.sortOrder)||1)),u=Fn((()=>e.localStore.mutationSort||TR)),d=Fn((()=>Number(e.localStore.mutationSortOrder)||1)),h=Fn((()=>ni[l()])),f=Fn((()=>ii[u()])),p=Fn((()=>OR().onlineManager)),g=Fn((()=>OR().client.getQueryCache())),m=Fn((()=>OR().client.getMutationCache())),v=jB((e=>e().getAll().length),!1),y=Fn(zn((()=>[v(),e.localStore.filter,l(),c()]),(()=>{const t=g().getAll(),n=e.localStore.filter?t.filter((t=>GR(t.queryHash,e.localStore.filter||"").passed)):[...t];return h()?n.sort(((e,t)=>h()(e,t)*c())):n}))),b=MB((e=>e().getAll().length),!1),w=Fn(zn((()=>[b(),e.localStore.mutationFilter,u(),d()]),(()=>{const t=m().getAll(),n=e.localStore.mutationFilter?t.filter((t=>GR(`${t.options.mutationKey?JSON.stringify(t.options.mutationKey)+" - ":""}${new Date(t.state.submittedAt).toLocaleString()}`,e.localStore.mutationFilter||"").passed)):[...t];return f()?n.sort(((e,t)=>f()(e,t)*d())):n}))),x=t=>{e.setLocalStore("position",t)},k=e=>{const n=getComputedStyle(t).getPropertyValue("--tsqd-font-size");e.style.setProperty("--tsqd-font-size",n)};return[(C=KV(),E=C.firstChild,P=E.firstChild,j=P.firstChild,D=j.firstChild,T=D.nextSibling,M=T.firstChild,O=E.nextSibling,A=O.firstChild,N=A.firstChild,_=N.firstChild,R=N.nextSibling,L=R.nextSibling,$=A.nextSibling,F=$.firstChild,I=F.nextSibling,"function"==typeof t?Kr(t,C):t=C,j.$$click=()=>{i().pipWindow||e.showPanelViewOnly?e.onClose&&e.onClose():e.setLocalStore("open","false")},Wr(T,(()=>OR().queryFlavor),M),Wr(T,(()=>OR().version),null),Wr(P,pr(_I.Root,{get class(){return cL(o().viewToggle)},get value(){return s()},onChange:e=>{a(e),sB(null),lB(null)},get children(){return[pr(_I.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[pr(_I.ItemInput,{}),pr(_I.ItemControl,{get children(){return pr(_I.ItemIndicator,{})}}),pr(_I.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),pr(_I.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[pr(_I.ItemInput,{}),pr(_I.ItemControl,{get children(){return pr(_I.ItemIndicator,{})}}),pr(_I.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),Wr(E,pr(jr,{get when(){return"queries"===s()},get children(){return pr(wB,{})}}),null),Wr(E,pr(jr,{get when(){return"mutations"===s()},get children(){return pr(xB,{})}}),null),Wr(N,pr(Az,{}),_),_.$$input=t=>{"queries"===s()?e.setLocalStore("filter",t.currentTarget.value):e.setLocalStore("mutationFilter",t.currentTarget.value)},Wr(R,pr(jr,{get when(){return"queries"===s()},get children(){var t=DV();return t.addEventListener("change",(t=>{e.setLocalStore("sort",t.currentTarget.value)})),Wr(t,(()=>Object.keys(ni).map((e=>{return(t=WV()).value=e,Wr(t,e,null),t;var t})))),Ln((()=>t.value=l())),t}}),null),Wr(R,pr(jr,{get when(){return"mutations"===s()},get children(){var t=TV();return t.addEventListener("change",(t=>{e.setLocalStore("mutationSort",t.currentTarget.value)})),Wr(t,(()=>Object.keys(ii).map((e=>{return(t=WV()).value=e,Wr(t,e,null),t;var t})))),Ln((()=>t.value=u())),t}}),null),Wr(R,pr(_z,{}),null),L.$$click=()=>{"queries"===s()?e.setLocalStore("sortOrder",String(-1*c())):e.setLocalStore("mutationSortOrder",String(-1*d()))},Wr(L,pr(jr,{get when(){return 1===("queries"===s()?c():d())},get children(){return[MV(),pr(Rz,{})]}}),null),Wr(L,pr(jr,{get when(){return-1===("queries"===s()?c():d())},get children(){return[OV(),pr(Lz,{})]}}),null),F.$$click=()=>{"queries"===s()?g().clear():m().clear()},Wr(F,pr(Nz,{})),I.$$click=()=>{dB()?(p().setOnline(!0),hB(!1)):(p().setOnline(!1),hB(!0))},Wr(I,(S=Fn((()=>!!dB())),()=>S()?pr(Bz,{}):pr(Vz,{}))),Wr($,pr(jr,{get when(){return Fn((()=>!i().pipWindow))()&&!i().disabled},get children(){var t=AV();return t.$$click=()=>{var t;i().requestPipWindow(Number(window.innerWidth),Number(null!=(t=e.localStore.height)?t:500))},Wr(t,pr(Kz,{})),Ln((()=>Vr(t,cL(o().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip")))),t}}),null),Wr($,pr(oz.Root,{gutter:4,get children(){return[pr(oz.Trigger,{get class(){return cL(o().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return pr(Uz,{})}}),pr(oz.Portal,{ref:e=>k(e),get mount(){return Fn((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return pr(oz.Content,{get class(){return cL(o().settingsMenu,"tsqd-settings-menu")},get children(){return[(t=NV(),Ln((()=>Vr(t,cL(o().settingsMenuHeader,"tsqd-settings-menu-header")))),t),pr(jr,{get when(){return!e.showPanelViewOnly},get children(){return pr(oz.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[pr(oz.SubTrigger,{get class(){return cL(o().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[_V(),pr(_z,{})]}}),pr(oz.Portal,{ref:e=>k(e),get mount(){return Fn((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return pr(oz.SubContent,{get class(){return cL(o().settingsMenu,"tsqd-settings-submenu")},get children(){return[pr(oz.Item,{onSelect:()=>{x("top")},as:"button",get class(){return cL(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[RV(),pr(Rz,{})]}}),pr(oz.Item,{onSelect:()=>{x("bottom")},as:"button",get class(){return cL(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[LV(),pr(Lz,{})]}}),pr(oz.Item,{onSelect:()=>{x("left")},as:"button",get class(){return cL(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[$V(),pr($z,{})]}}),pr(oz.Item,{onSelect:()=>{x("right")},as:"button",get class(){return cL(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[FV(),pr(Fz,{})]}})]}})}})]}})}}),pr(oz.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[pr(oz.SubTrigger,{get class(){return cL(o().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[IV(),pr(_z,{})]}}),pr(oz.Portal,{ref:e=>k(e),get mount(){return Fn((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return pr(oz.SubContent,{get class(){return cL(o().settingsMenu,"tsqd-settings-submenu")},get children(){return[pr(oz.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return cL(o().settingsSubButton,"light"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[qV(),pr(Iz,{})]}}),pr(oz.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return cL(o().settingsSubButton,"dark"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[zV(),pr(qz,{})]}}),pr(oz.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return cL(o().settingsSubButton,"system"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[VV(),pr(zz,{})]}})]}})}})]}})];var t}})}})]}}),null),Wr(C,pr(jr,{get when(){return"queries"===s()},get children(){var e=BV();return Wr(e.firstChild,pr(xL,{by:e=>e.queryHash,get each(){return y()},children:e=>pr(yB,{get query(){return e()}})})),Ln((()=>Vr(e,cL(o().overflowQueryContainer,"tsqd-queries-overflow-container")))),e}}),null),Wr(C,pr(jr,{get when(){return"mutations"===s()},get children(){var e=UV();return Wr(e.firstChild,pr(xL,{by:e=>e.mutationId,get each(){return w()},children:e=>pr(bB,{get mutation(){return e()}})})),Ln((()=>Vr(e,cL(o().overflowQueryContainer,"tsqd-mutations-overflow-container")))),e}}),null),Ln((e=>{var t=cL(o().queriesContainer,cB()<ER&&(iB()||aB())&&r`
205
+ height: 50%;
206
+ max-height: 50%;
207
+ `,cB()<ER&&!(iB()||aB())&&r`
208
+ height: 100%;
209
+ max-height: 100%;
210
+ `,"tsqd-queries-container"),n=cL(o().row,"tsqd-header"),i=o().logoAndToggleContainer,a=cL(o().logo,"tsqd-text-logo-container"),l=cL(o().tanstackLogo,"tsqd-text-logo-tanstack"),u=cL(o().queryFlavorLogo,"tsqd-text-logo-query-flavor"),h=cL(o().row,"tsqd-filters-actions-container"),f=cL(o().filtersContainer,"tsqd-filters-container"),p=cL(o().filterInput,"tsqd-query-filter-textfield-container"),g=cL("tsqd-query-filter-textfield"),m=cL(o().filterSelect,"tsqd-query-filter-sort-container"),v="Sort order "+(-1===("queries"===s()?c():d())?"descending":"ascending"),y=-1===("queries"===s()?c():d()),b=cL(o().actionsContainer,"tsqd-actions-container"),w=cL(o().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),x=`Clear ${s()} cache`,k=cL(o().actionsBtn,dB()&&o().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),S=dB()?"Unset offline mocking behavior":"Mock offline behavior",M=dB(),q=dB()?"Unset offline mocking behavior":"Mock offline behavior";return t!==e.e&&Vr(C,e.e=t),n!==e.t&&Vr(E,e.t=n),i!==e.a&&Vr(P,e.a=i),a!==e.o&&Vr(j,e.o=a),l!==e.i&&Vr(D,e.i=l),u!==e.n&&Vr(T,e.n=u),h!==e.s&&Vr(O,e.s=h),f!==e.h&&Vr(A,e.h=f),p!==e.r&&Vr(N,e.r=p),g!==e.d&&Vr(_,e.d=g),m!==e.l&&Vr(R,e.l=m),v!==e.u&&zr(L,"aria-label",e.u=v),y!==e.c&&zr(L,"aria-pressed",e.c=y),b!==e.w&&Vr($,e.w=b),w!==e.m&&Vr(F,e.m=w),x!==e.f&&zr(F,"title",e.f=x),k!==e.y&&Vr(I,e.y=k),S!==e.g&&zr(I,"aria-label",e.g=S),M!==e.p&&zr(I,"aria-pressed",e.p=M),q!==e.b&&zr(I,"title",e.b=q),e}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),Ln((()=>_.value="queries"===s()?e.localStore.filter||"":e.localStore.mutationFilter||"")),C),pr(jr,{get when(){return Fn((()=>"queries"===s()))()&&iB()},get children(){return pr(SB,{})}}),pr(jr,{get when(){return Fn((()=>"mutations"===s()))()&&aB()},get children(){return pr(CB,{})}})];var S,C,E,P,j,D,T,M,O,A,N,_,R,L,$,F,I},yB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n))),{colors:o,alpha:i}=lz,s=(e,n)=>"dark"===t()?n:e,a=jB((t=>{var n;return null==(n=t().find({queryKey:e.query.queryKey}))?void 0:n.state}),!0,(t=>t.query.queryHash===e.query.queryHash)),l=jB((t=>{var n,r;return null!=(r=null==(n=t().find({queryKey:e.query.queryKey}))?void 0:n.isDisabled())&&r}),!0,(t=>t.query.queryHash===e.query.queryHash)),c=jB((t=>{var n,r;return null!=(r=null==(n=t().find({queryKey:e.query.queryKey}))?void 0:n.isStale())&&r}),!0,(t=>t.query.queryHash===e.query.queryHash)),u=jB((t=>{var n,r;return null!=(r=null==(n=t().find({queryKey:e.query.queryKey}))?void 0:n.getObserversCount())?r:0}),!0,(t=>t.query.queryHash===e.query.queryHash)),d=Fn((()=>function({queryState:e,observerCount:t,isStale:n}){return"fetching"===e.fetchStatus?"blue":t?"paused"===e.fetchStatus?"purple":n?"yellow":"green":"gray"}({queryState:a(),observerCount:u(),isStale:c()})));return pr(jr,{get when(){return a()},get children(){var t=GV(),a=t.firstChild,c=a.nextSibling;return t.$$click=()=>sB(e.query.queryHash===iB()?null:e.query.queryHash),Wr(a,u),Wr(c,(()=>e.query.queryHash)),Wr(t,pr(jr,{get when(){return l()},get children(){return HV()}}),null),Ln((l=>{var c=cL(r().queryRow,iB()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),u=`Query key ${e.query.queryHash}`,h=cL("gray"===d()?n`
211
+ background-color: ${s(o[d()][200],o[d()][700])};
212
+ color: ${s(o[d()][700],o[d()][300])};
213
+ `:n`
214
+ background-color: ${s(o[d()][200]+i[80],o[d()][900])};
215
+ color: ${s(o[d()][800],o[d()][300])};
216
+ `,"tsqd-query-observer-count");return c!==l.e&&Vr(t,l.e=c),u!==l.t&&zr(t,"aria-label",l.t=u),h!==l.a&&Vr(a,l.a=h),l}),{e:void 0,t:void 0,a:void 0}),t}})},bB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n))),{colors:o,alpha:i}=lz,s=(e,n)=>"dark"===t()?n:e,a=MB((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return null==n?void 0:n.state})),l=MB((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return!!n&&n.state.isPaused})),c=MB((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return n?n.state.status:"idle"})),u=Fn((()=>Jo({isPaused:l(),status:c()})));return pr(jr,{get when(){return a()},get children(){var t=GV(),a=t.firstChild,l=a.nextSibling;return t.$$click=()=>{lB(e.mutation.mutationId===aB()?null:e.mutation.mutationId)},Wr(a,pr(jr,{get when(){return"purple"===u()},get children(){return pr(tV,{})}}),null),Wr(a,pr(jr,{get when(){return"green"===u()},get children(){return pr(Jz,{})}}),null),Wr(a,pr(jr,{get when(){return"red"===u()},get children(){return pr(eV,{})}}),null),Wr(a,pr(jr,{get when(){return"yellow"===u()},get children(){return pr(Zz,{})}}),null),Wr(l,pr(jr,{get when(){return e.mutation.options.mutationKey},get children(){return[Fn((()=>JSON.stringify(e.mutation.options.mutationKey)))," -"," "]}}),null),Wr(l,(()=>new Date(e.mutation.state.submittedAt).toLocaleString()),null),Ln((l=>{var c=cL(r().queryRow,aB()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),d=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,h=cL("gray"===u()?n`
217
+ background-color: ${s(o[u()][200],o[u()][700])};
218
+ color: ${s(o[u()][700],o[u()][300])};
219
+ `:n`
220
+ background-color: ${s(o[u()][200]+i[80],o[u()][900])};
221
+ color: ${s(o[u()][800],o[u()][300])};
222
+ `,"tsqd-query-observer-count");return c!==l.e&&Vr(t,l.e=c),d!==l.t&&zr(t,"aria-label",l.t=d),h!==l.a&&Vr(a,l.a=h),l}),{e:void 0,t:void 0,a:void 0}),t}})},wB=()=>{const e=jB((e=>e().getAll().filter((e=>"stale"===Xo(e))).length)),t=jB((e=>e().getAll().filter((e=>"fresh"===Xo(e))).length)),n=jB((e=>e().getAll().filter((e=>"fetching"===Xo(e))).length)),r=jB((e=>e().getAll().filter((e=>"paused"===Xo(e))).length)),o=jB((e=>e().getAll().filter((e=>"inactive"===Xo(e))).length)),i=LR(),s=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,a=Fn((()=>"dark"===i()?NB(s):AB(s)));return Wr(l=PV(),pr(kB,{label:"Fresh",color:"green",get count(){return t()}}),null),Wr(l,pr(kB,{label:"Fetching",color:"blue",get count(){return n()}}),null),Wr(l,pr(kB,{label:"Paused",color:"purple",get count(){return r()}}),null),Wr(l,pr(kB,{label:"Stale",color:"yellow",get count(){return e()}}),null),Wr(l,pr(kB,{label:"Inactive",color:"gray",get count(){return o()}}),null),Ln((()=>Vr(l,cL(a().queryStatusContainer,"tsqd-query-status-container")))),l;var l},xB=()=>{const e=MB((e=>e().getAll().filter((e=>"green"===Jo({isPaused:e.state.isPaused,status:e.state.status}))).length)),t=MB((e=>e().getAll().filter((e=>"yellow"===Jo({isPaused:e.state.isPaused,status:e.state.status}))).length)),n=MB((e=>e().getAll().filter((e=>"purple"===Jo({isPaused:e.state.isPaused,status:e.state.status}))).length)),r=MB((e=>e().getAll().filter((e=>"red"===Jo({isPaused:e.state.isPaused,status:e.state.status}))).length)),o=LR(),i=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,s=Fn((()=>"dark"===o()?NB(i):AB(i)));return Wr(a=PV(),pr(kB,{label:"Paused",color:"purple",get count(){return n()}}),null),Wr(a,pr(kB,{label:"Pending",color:"yellow",get count(){return t()}}),null),Wr(a,pr(kB,{label:"Success",color:"green",get count(){return e()}}),null),Wr(a,pr(kB,{label:"Error",color:"red",get count(){return r()}}),null),Ln((()=>Vr(a,cL(s().queryStatusContainer,"tsqd-query-status-container")))),a;var a},kB=e=>{const t=LR(),n=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,r=Fn((()=>"dark"===t()?NB(n):AB(n))),{colors:o,alpha:i}=lz,s=(e,n)=>"dark"===t()?n:e;let a;const[l,c]=_n(!1),[u,d]=_n(!1),h=Fn((()=>!(iB()&&cB()<1024&&cB()>ER)&&!(cB()<ER)));return f=XV(),g=(p=f.firstChild).nextSibling,"function"==typeof a?Kr(a,f):a=f,f.addEventListener("mouseleave",(()=>{c(!1),d(!1)})),f.addEventListener("mouseenter",(()=>c(!0))),f.addEventListener("blur",(()=>d(!1))),f.addEventListener("focus",(()=>d(!0))),Ur(f,br({get disabled(){return h()},get class(){return cL(r().queryStatusTag,!h()&&n`
223
+ cursor: pointer;
224
+ &:hover {
225
+ background: ${s(o.gray[200],o.darkGray[400])}${i[80]};
226
+ }
227
+ `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},(()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{})),!1,!0),Wr(f,pr(jr,{get when(){return Fn((()=>!h()))()&&(l()||u())},get children(){var t=YV();return Wr(t,(()=>e.label)),Ln((()=>Vr(t,cL(r().statusTooltip,"tsqd-query-status-tooltip")))),t}}),p),Wr(f,pr(jr,{get when(){return h()},get children(){var t=QV();return Wr(t,(()=>e.label)),Ln((()=>Vr(t,cL(r().queryStatusTagLabel,"tsqd-query-status-tag-label")))),t}}),g),Wr(g,(()=>e.count)),Ln((t=>{var i=cL(n`
228
+ width: ${lz.size[1.5]};
229
+ height: ${lz.size[1.5]};
230
+ border-radius: ${lz.border.radius.full};
231
+ background-color: ${lz.colors[e.color][500]};
232
+ `,"tsqd-query-status-tag-dot"),a=cL(r().queryStatusCount,e.count>0&&"gray"!==e.color&&n`
233
+ background-color: ${s(o[e.color][100],o[e.color][900])};
234
+ color: ${s(o[e.color][700],o[e.color][300])};
235
+ `,"tsqd-query-status-tag-count");return i!==t.e&&Vr(p,t.e=i),a!==t.t&&Vr(g,t.t=a),t}),{e:void 0,t:void 0}),f;var f,p,g},SB=()=>{const e=LR(),t=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,n=Fn((()=>"dark"===e()?NB(t):AB(t))),{colors:r}=lz,o=(t,n)=>"dark"===e()?n:t,i=OR().client,[s,a]=_n(!1),[l,c]=_n("view"),[u,d]=_n(!1),h=Fn((()=>OR().errorTypes||[])),f=jB((e=>e().getAll().find((e=>e.queryHash===iB()))),!1),p=jB((e=>e().getAll().find((e=>e.queryHash===iB()))),!1),g=jB((e=>{var t;return null==(t=e().getAll().find((e=>e.queryHash===iB())))?void 0:t.state}),!1),m=jB((e=>{var t;return null==(t=e().getAll().find((e=>e.queryHash===iB())))?void 0:t.state.data}),!1),v=jB((e=>{const t=e().getAll().find((e=>e.queryHash===iB()));return t?Xo(t):"inactive"})),y=jB((e=>{const t=e().getAll().find((e=>e.queryHash===iB()));return t?t.state.status:"pending"})),b=jB((e=>{var t,n;return null!=(n=null==(t=e().getAll().find((e=>e.queryHash===iB())))?void 0:t.getObserversCount())?n:0})),w=Fn((()=>{return"fresh"===(e=v())?"green":"stale"===e?"yellow":"paused"===e?"purple":"inactive"===e?"gray":"blue";var e})),x=()=>{var e;const t=null==(e=f())?void 0:e.fetch();null==t||t.catch((()=>{}))},k=e=>{var t;const n=null!=(t=null==e?void 0:e.initializer(f()))?t:new Error("Unknown error from devtools"),r=f().options;f().setState({status:"error",error:n,fetchMeta:{...f().state.fetchMeta,__previousQueryOptions:r}})};$n((()=>{"fetching"!==v()&&a(!1)}));return pr(jr,{get when(){return Fn((()=>!!f()))()&&g()},get children(){var e=nB(),S=e.firstChild,C=S.nextSibling,E=C.firstChild,P=E.firstChild,j=P.nextSibling,D=E.nextSibling,T=D.firstChild.nextSibling,M=D.nextSibling.firstChild.nextSibling,O=C.nextSibling,A=O.nextSibling,N=A.firstChild,_=N.firstChild,R=N.nextSibling,L=R.firstChild,$=R.nextSibling,F=$.firstChild,I=$.nextSibling,q=I.firstChild,z=I.nextSibling,V=z.firstChild,B=V.nextSibling,U=A.nextSibling,K=U.nextSibling,W=K.nextSibling;return Wr(P.firstChild,(()=>Zo(f().queryKey,!0))),Wr(j,v),Wr(T,b),Wr(M,(()=>new Date(g().dataUpdatedAt).toLocaleTimeString())),N.$$click=x,R.$$click=()=>i.invalidateQueries(f()),$.$$click=()=>i.resetQueries(f()),I.$$click=()=>{i.removeQueries(f()),sB(null)},z.$$click=()=>{var e;if(void 0===(null==(e=f())?void 0:e.state.data))a(!0),(()=>{const e=f(),t=e.state,n=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:!0}),e.setState({...t,fetchStatus:"idle",fetchMeta:null}),n&&e.fetch(n)})();else{const e=f();if(!e)return;const t=e.options;e.fetch({...t,queryFn:()=>new Promise((()=>{})),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:t}})}},Wr(z,(()=>"pending"===y()?"Restore":"Trigger"),B),Wr(A,pr(jr,{get when(){return 0===h().length||"error"===y()},get children(){var e=JV(),n=e.firstChild,s=n.nextSibling;return e.$$click=()=>{f().state.error?i.resetQueries(f()):k()},Wr(e,(()=>"error"===y()?"Restore":"Trigger"),s),Ln((i=>{var s=cL(t`
236
+ color: ${o(r.red[500],r.red[400])};
237
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),a="pending"===y(),l=t`
238
+ background-color: ${o(r.red[500],r.red[400])};
239
+ `;return s!==i.e&&Vr(e,i.e=s),a!==i.t&&(e.disabled=i.t=a),l!==i.a&&Vr(n,i.a=l),i}),{e:void 0,t:void 0,a:void 0}),e}}),null),Wr(A,pr(jr,{get when(){return!(0===h().length||"error"===y())},get children(){var e=ZV(),r=e.firstChild,o=r.nextSibling.nextSibling;return o.addEventListener("change",(e=>{const t=h().find((t=>t.name===e.currentTarget.value));k(t)})),Wr(o,pr(Er,{get each(){return h()},children:e=>{return Wr(t=rB(),(()=>e.name)),Ln((()=>t.value=e.name)),t;var t}}),null),Wr(e,pr(_z,{}),null),Ln((i=>{var s=cL(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),a=t`
240
+ background-color: ${lz.colors.red[400]};
241
+ `,l="pending"===y();return s!==i.e&&Vr(e,i.e=s),a!==i.t&&Vr(r,i.t=a),l!==i.a&&(o.disabled=i.a=l),i}),{e:void 0,t:void 0,a:void 0}),e}}),null),Wr(U,(()=>"view"===l()?"Explorer":"Editor"),null),Wr(e,pr(jr,{get when(){return"view"===l()},get children(){var e=eB();return Wr(e,pr(xV,{label:"Data",defaultExpanded:["Data"],get value(){return m()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return f()}})),Ln((t=>null!=(t=lz.size[2])?e.style.setProperty("padding",t):e.style.removeProperty("padding"))),e}}),K),Wr(e,pr(jr,{get when(){return"edit"===l()},get children(){var e=tB(),i=e.firstChild,s=i.nextSibling,a=s.firstChild,l=a.nextSibling,h=l.firstChild,p=h.nextSibling;return e.addEventListener("submit",(e=>{e.preventDefault();const t=new FormData(e.currentTarget).get("data");try{const e=JSON.parse(t);f().setState({...f().state,data:e}),c("view")}catch(n){d(!0)}})),i.addEventListener("focus",(()=>d(!1))),Wr(a,(()=>u()?"Invalid Value":"")),h.$$click=()=>c("view"),Ln((c=>{var d=cL(n().devtoolsEditForm,"tsqd-query-details-data-editor"),f=n().devtoolsEditTextarea,g=u(),m=n().devtoolsEditFormActions,v=n().devtoolsEditFormError,y=n().devtoolsEditFormActionContainer,b=cL(n().devtoolsEditFormAction,t`
242
+ color: ${o(r.gray[600],r.gray[300])};
243
+ `),w=cL(n().devtoolsEditFormAction,t`
244
+ color: ${o(r.blue[600],r.blue[400])};
245
+ `);return d!==c.e&&Vr(e,c.e=d),f!==c.t&&Vr(i,c.t=f),g!==c.a&&zr(i,"data-error",c.a=g),m!==c.o&&Vr(s,c.o=m),v!==c.i&&Vr(a,c.i=v),y!==c.n&&Vr(l,c.n=y),b!==c.s&&Vr(h,c.s=b),w!==c.h&&Vr(p,c.h=w),c}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),Ln((()=>i.value=JSON.stringify(m(),null,2))),e}}),K),Wr(W,pr(xV,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return p()}})),Ln((i=>{var a=cL(n().detailsContainer,"tsqd-query-details-container"),l=cL(n().detailsHeader,"tsqd-query-details-header"),c=cL(n().detailsBody,"tsqd-query-details-summary-container"),u=cL(n().queryDetailsStatus,"gray"===w()?t`
246
+ background-color: ${o(r[w()][200],r[w()][700])};
247
+ color: ${o(r[w()][700],r[w()][300])};
248
+ border-color: ${o(r[w()][400],r[w()][600])};
249
+ `:t`
250
+ background-color: ${o(r[w()][100],r[w()][900])};
251
+ color: ${o(r[w()][700],r[w()][300])};
252
+ border-color: ${o(r[w()][400],r[w()][600])};
253
+ `),d=cL(n().detailsHeader,"tsqd-query-details-header"),h=cL(n().actionsBody,"tsqd-query-details-actions-container"),f=cL(t`
254
+ color: ${o(r.blue[600],r.blue[400])};
255
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),p="fetching"===v(),g=t`
256
+ background-color: ${o(r.blue[600],r.blue[400])};
257
+ `,m=cL(t`
258
+ color: ${o(r.yellow[600],r.yellow[400])};
259
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),b="pending"===y(),x=t`
260
+ background-color: ${o(r.yellow[600],r.yellow[400])};
261
+ `,k=cL(t`
262
+ color: ${o(r.gray[600],r.gray[300])};
263
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),E="pending"===y(),P=t`
264
+ background-color: ${o(r.gray[600],r.gray[400])};
265
+ `,D=cL(t`
266
+ color: ${o(r.pink[500],r.pink[400])};
267
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),T="fetching"===v(),M=t`
268
+ background-color: ${o(r.pink[500],r.pink[400])};
269
+ `,B=cL(t`
270
+ color: ${o(r.cyan[500],r.cyan[400])};
271
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),H=s(),G=t`
272
+ background-color: ${o(r.cyan[500],r.cyan[400])};
273
+ `,Y=cL(n().detailsHeader,"tsqd-query-details-header"),Q=cL(n().detailsHeader,"tsqd-query-details-header"),X=lz.size[2];return a!==i.e&&Vr(e,i.e=a),l!==i.t&&Vr(S,i.t=l),c!==i.a&&Vr(C,i.a=c),u!==i.o&&Vr(j,i.o=u),d!==i.i&&Vr(O,i.i=d),h!==i.n&&Vr(A,i.n=h),f!==i.s&&Vr(N,i.s=f),p!==i.h&&(N.disabled=i.h=p),g!==i.r&&Vr(_,i.r=g),m!==i.d&&Vr(R,i.d=m),b!==i.l&&(R.disabled=i.l=b),x!==i.u&&Vr(L,i.u=x),k!==i.c&&Vr($,i.c=k),E!==i.w&&($.disabled=i.w=E),P!==i.m&&Vr(F,i.m=P),D!==i.f&&Vr(I,i.f=D),T!==i.y&&(I.disabled=i.y=T),M!==i.g&&Vr(q,i.g=M),B!==i.p&&Vr(z,i.p=B),H!==i.b&&(z.disabled=i.b=H),G!==i.T&&Vr(V,i.T=G),Y!==i.A&&Vr(U,i.A=Y),Q!==i.O&&Vr(K,i.O=Q),X!==i.I&&(null!=(i.I=X)?W.style.setProperty("padding",X):W.style.removeProperty("padding")),i}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),e}})},CB=()=>{const e=LR(),t=OR().shadowDOMTarget?aL.bind({target:OR().shadowDOMTarget}):aL,n=Fn((()=>"dark"===e()?NB(t):AB(t))),{colors:r}=lz,o=(t,n)=>"dark"===e()?n:t,i=MB((e=>{const t=e().getAll().find((e=>e.mutationId===aB()));return!!t&&t.state.isPaused})),s=MB((e=>{const t=e().getAll().find((e=>e.mutationId===aB()));return t?t.state.status:"idle"})),a=Fn((()=>Jo({isPaused:i(),status:s()}))),l=MB((e=>e().getAll().find((e=>e.mutationId===aB()))),!1);return pr(jr,{get when(){return l()},get children(){var e=oB(),i=e.firstChild,c=i.nextSibling,u=c.firstChild,d=u.firstChild,h=d.nextSibling,f=u.nextSibling.firstChild.nextSibling,p=c.nextSibling,g=p.nextSibling,m=g.nextSibling,v=m.nextSibling,y=v.nextSibling,b=y.nextSibling,w=b.nextSibling,x=w.nextSibling;return Wr(d.firstChild,pr(jr,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Zo(l().options.mutationKey,!0)}})),Wr(h,pr(jr,{get when(){return"purple"===a()},children:"pending"}),null),Wr(h,pr(jr,{get when(){return"purple"!==a()},get children(){return s()}}),null),Wr(f,(()=>new Date(l().state.submittedAt).toLocaleTimeString())),Wr(g,pr(xV,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),Wr(v,pr(xV,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),Wr(b,pr(xV,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),Wr(x,pr(xV,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),Ln((s=>{var l=cL(n().detailsContainer,"tsqd-query-details-container"),u=cL(n().detailsHeader,"tsqd-query-details-header"),d=cL(n().detailsBody,"tsqd-query-details-summary-container"),f=cL(n().queryDetailsStatus,"gray"===a()?t`
274
+ background-color: ${o(r[a()][200],r[a()][700])};
275
+ color: ${o(r[a()][700],r[a()][300])};
276
+ border-color: ${o(r[a()][400],r[a()][600])};
277
+ `:t`
278
+ background-color: ${o(r[a()][100],r[a()][900])};
279
+ color: ${o(r[a()][700],r[a()][300])};
280
+ border-color: ${o(r[a()][400],r[a()][600])};
281
+ `),k=cL(n().detailsHeader,"tsqd-query-details-header"),S=lz.size[2],C=cL(n().detailsHeader,"tsqd-query-details-header"),E=lz.size[2],P=cL(n().detailsHeader,"tsqd-query-details-header"),j=lz.size[2],D=cL(n().detailsHeader,"tsqd-query-details-header"),T=lz.size[2];return l!==s.e&&Vr(e,s.e=l),u!==s.t&&Vr(i,s.t=u),d!==s.a&&Vr(c,s.a=d),f!==s.o&&Vr(h,s.o=f),k!==s.i&&Vr(p,s.i=k),S!==s.n&&(null!=(s.n=S)?g.style.setProperty("padding",S):g.style.removeProperty("padding")),C!==s.s&&Vr(m,s.s=C),E!==s.h&&(null!=(s.h=E)?v.style.setProperty("padding",E):v.style.removeProperty("padding")),P!==s.r&&Vr(y,s.r=P),j!==s.d&&(null!=(s.d=j)?b.style.setProperty("padding",j):b.style.removeProperty("padding")),D!==s.l&&Vr(w,s.l=D),T!==s.u&&(null!=(s.u=T)?x.style.setProperty("padding",T):x.style.removeProperty("padding")),s}),{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),e}})},EB=new Map,PB=()=>{const e=Fn((()=>OR().client.getQueryCache())),t=e().subscribe((t=>{var n;n=()=>{for(const[n,r]of EB.entries())r.shouldUpdate(t)&&r.setter(n(e))},nr(n,!1)}));return Bn((()=>{EB.clear(),t()})),t},jB=(e,t=!0,n=()=>!0)=>{const r=Fn((()=>OR().client.getQueryCache())),[o,i]=_n(e(r),t?void 0:{equals:!1});return $n((()=>{i(e(r))})),EB.set(e,{setter:i,shouldUpdate:n}),Bn((()=>{EB.delete(e)})),o},DB=new Map,TB=()=>{const e=Fn((()=>OR().client.getMutationCache())),t=e().subscribe((()=>{for(const[t,n]of DB.entries())queueMicrotask((()=>{n(t(e))}))}));return Bn((()=>{DB.clear(),t()})),t},MB=(e,t=!0)=>{const n=Fn((()=>OR().client.getMutationCache())),[r,o]=_n(e(n),t?void 0:{equals:!1});return $n((()=>{o(e(n))})),DB.set(e,o),Bn((()=>{DB.delete(e)})),r},OB=(e,t)=>{const{colors:n,font:r,size:o,alpha:i,shadow:s,border:a}=lz,l=(t,n)=>"light"===e?t:n;return{devtoolsBtn:t`
282
+ z-index: 100000;
283
+ position: fixed;
284
+ padding: 4px;
285
+ text-align: left;
286
+
287
+ display: flex;
288
+ align-items: center;
289
+ justify-content: center;
290
+ border-radius: 9999px;
291
+ box-shadow: ${s.md()};
292
+ overflow: hidden;
293
+
294
+ & div {
295
+ position: absolute;
296
+ top: -8px;
297
+ left: -8px;
298
+ right: -8px;
299
+ bottom: -8px;
300
+ border-radius: 9999px;
301
+
302
+ & svg {
303
+ position: absolute;
304
+ width: 100%;
305
+ height: 100%;
306
+ }
307
+ filter: blur(6px) saturate(1.2) contrast(1.1);
308
+ }
309
+
310
+ &:focus-within {
311
+ outline-offset: 2px;
312
+ outline: 3px solid ${n.green[600]};
313
+ }
314
+
315
+ & button {
316
+ position: relative;
317
+ z-index: 1;
318
+ padding: 0;
319
+ border-radius: 9999px;
320
+ background-color: transparent;
321
+ border: none;
322
+ height: 40px;
323
+ display: flex;
324
+ width: 40px;
325
+ overflow: hidden;
326
+ cursor: pointer;
327
+ outline: none;
328
+ & svg {
329
+ position: absolute;
330
+ width: 100%;
331
+ height: 100%;
332
+ }
333
+ }
334
+ `,panel:t`
335
+ position: fixed;
336
+ z-index: 9999;
337
+ display: flex;
338
+ gap: ${lz.size[.5]};
339
+ & * {
340
+ box-sizing: border-box;
341
+ text-transform: none;
342
+ }
343
+
344
+ & *::-webkit-scrollbar {
345
+ width: 7px;
346
+ }
347
+
348
+ & *::-webkit-scrollbar-track {
349
+ background: transparent;
350
+ }
351
+
352
+ & *::-webkit-scrollbar-thumb {
353
+ background: ${l(n.gray[300],n.darkGray[200])};
354
+ }
355
+
356
+ & *::-webkit-scrollbar-thumb:hover {
357
+ background: ${l(n.gray[400],n.darkGray[300])};
358
+ }
359
+ `,parentPanel:t`
360
+ z-index: 9999;
361
+ display: flex;
362
+ height: 100%;
363
+ gap: ${lz.size[.5]};
364
+ & * {
365
+ box-sizing: border-box;
366
+ text-transform: none;
367
+ }
368
+
369
+ & *::-webkit-scrollbar {
370
+ width: 7px;
371
+ }
372
+
373
+ & *::-webkit-scrollbar-track {
374
+ background: transparent;
375
+ }
376
+
377
+ & *::-webkit-scrollbar-thumb {
378
+ background: ${l(n.gray[300],n.darkGray[200])};
379
+ }
380
+
381
+ & *::-webkit-scrollbar-thumb:hover {
382
+ background: ${l(n.gray[400],n.darkGray[300])};
383
+ }
384
+ `,"devtoolsBtn-position-bottom-right":t`
385
+ bottom: 12px;
386
+ right: 12px;
387
+ `,"devtoolsBtn-position-bottom-left":t`
388
+ bottom: 12px;
389
+ left: 12px;
390
+ `,"devtoolsBtn-position-top-left":t`
391
+ top: 12px;
392
+ left: 12px;
393
+ `,"devtoolsBtn-position-top-right":t`
394
+ top: 12px;
395
+ right: 12px;
396
+ `,"devtoolsBtn-position-relative":t`
397
+ position: relative;
398
+ `,"panel-position-top":t`
399
+ top: 0;
400
+ right: 0;
401
+ left: 0;
402
+ max-height: 90%;
403
+ min-height: ${o[14]};
404
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
405
+ `,"panel-position-bottom":t`
406
+ bottom: 0;
407
+ right: 0;
408
+ left: 0;
409
+ max-height: 90%;
410
+ min-height: ${o[14]};
411
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
412
+ `,"panel-position-right":t`
413
+ bottom: 0;
414
+ right: 0;
415
+ top: 0;
416
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
417
+ max-width: 90%;
418
+ `,"panel-position-left":t`
419
+ bottom: 0;
420
+ left: 0;
421
+ top: 0;
422
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
423
+ max-width: 90%;
424
+ `,closeBtn:t`
425
+ position: absolute;
426
+ cursor: pointer;
427
+ z-index: 5;
428
+ display: flex;
429
+ align-items: center;
430
+ justify-content: center;
431
+ outline: none;
432
+ background-color: ${l(n.gray[50],n.darkGray[700])};
433
+ &:hover {
434
+ background-color: ${l(n.gray[200],n.darkGray[500])};
435
+ }
436
+ &:focus-visible {
437
+ outline: 2px solid ${n.blue[600]};
438
+ }
439
+ & svg {
440
+ color: ${l(n.gray[600],n.gray[400])};
441
+ width: ${o[2]};
442
+ height: ${o[2]};
443
+ }
444
+ `,"closeBtn-position-top":t`
445
+ bottom: 0;
446
+ right: ${o[2]};
447
+ transform: translate(0, 100%);
448
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
449
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
450
+ border-top: none;
451
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
452
+ border-radius: 0px 0px ${a.radius.sm} ${a.radius.sm};
453
+ padding: ${o[.5]} ${o[1.5]} ${o[1]} ${o[1.5]};
454
+
455
+ &::after {
456
+ content: ' ';
457
+ position: absolute;
458
+ bottom: 100%;
459
+ left: -${o[2.5]};
460
+ height: ${o[1.5]};
461
+ width: calc(100% + ${o[5]});
462
+ }
463
+
464
+ & svg {
465
+ transform: rotate(180deg);
466
+ }
467
+ `,"closeBtn-position-bottom":t`
468
+ top: 0;
469
+ right: ${o[2]};
470
+ transform: translate(0, -100%);
471
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
472
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
473
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
474
+ border-bottom: none;
475
+ border-radius: ${a.radius.sm} ${a.radius.sm} 0px 0px;
476
+ padding: ${o[1]} ${o[1.5]} ${o[.5]} ${o[1.5]};
477
+
478
+ &::after {
479
+ content: ' ';
480
+ position: absolute;
481
+ top: 100%;
482
+ left: -${o[2.5]};
483
+ height: ${o[1.5]};
484
+ width: calc(100% + ${o[5]});
485
+ }
486
+ `,"closeBtn-position-right":t`
487
+ bottom: ${o[2]};
488
+ left: 0;
489
+ transform: translate(-100%, 0);
490
+ border-right: none;
491
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
492
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
493
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
494
+ border-radius: ${a.radius.sm} 0px 0px ${a.radius.sm};
495
+ padding: ${o[1.5]} ${o[.5]} ${o[1.5]} ${o[1]};
496
+
497
+ &::after {
498
+ content: ' ';
499
+ position: absolute;
500
+ left: 100%;
501
+ height: calc(100% + ${o[5]});
502
+ width: ${o[1.5]};
503
+ }
504
+
505
+ & svg {
506
+ transform: rotate(-90deg);
507
+ }
508
+ `,"closeBtn-position-left":t`
509
+ bottom: ${o[2]};
510
+ right: 0;
511
+ transform: translate(100%, 0);
512
+ border-left: none;
513
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
514
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
515
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
516
+ border-radius: 0px ${a.radius.sm} ${a.radius.sm} 0px;
517
+ padding: ${o[1.5]} ${o[1]} ${o[1.5]} ${o[.5]};
518
+
519
+ &::after {
520
+ content: ' ';
521
+ position: absolute;
522
+ right: 100%;
523
+ height: calc(100% + ${o[5]});
524
+ width: ${o[1.5]};
525
+ }
526
+
527
+ & svg {
528
+ transform: rotate(90deg);
529
+ }
530
+ `,queriesContainer:t`
531
+ flex: 1 1 700px;
532
+ background-color: ${l(n.gray[50],n.darkGray[700])};
533
+ display: flex;
534
+ flex-direction: column;
535
+ & * {
536
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
537
+ }
538
+ `,dragHandle:t`
539
+ position: absolute;
540
+ transition: background-color 0.125s ease;
541
+ &:hover {
542
+ background-color: ${n.purple[400]}${l("",i[90])};
543
+ }
544
+ z-index: 4;
545
+ `,"dragHandle-position-top":t`
546
+ bottom: 0;
547
+ width: 100%;
548
+ height: 3px;
549
+ cursor: ns-resize;
550
+ `,"dragHandle-position-bottom":t`
551
+ top: 0;
552
+ width: 100%;
553
+ height: 3px;
554
+ cursor: ns-resize;
555
+ `,"dragHandle-position-right":t`
556
+ left: 0;
557
+ width: 3px;
558
+ height: 100%;
559
+ cursor: ew-resize;
560
+ `,"dragHandle-position-left":t`
561
+ right: 0;
562
+ width: 3px;
563
+ height: 100%;
564
+ cursor: ew-resize;
565
+ `,row:t`
566
+ display: flex;
567
+ justify-content: space-between;
568
+ align-items: center;
569
+ padding: ${lz.size[2]} ${lz.size[2.5]};
570
+ gap: ${lz.size[2.5]};
571
+ border-bottom: ${l(n.gray[300],n.darkGray[500])} 1px solid;
572
+ align-items: center;
573
+ & > button {
574
+ padding: 0;
575
+ background: transparent;
576
+ border: none;
577
+ display: flex;
578
+ gap: ${o[.5]};
579
+ flex-direction: column;
580
+ }
581
+ `,logoAndToggleContainer:t`
582
+ display: flex;
583
+ gap: ${lz.size[3]};
584
+ align-items: center;
585
+ `,logo:t`
586
+ cursor: pointer;
587
+ display: flex;
588
+ flex-direction: column;
589
+ background-color: transparent;
590
+ border: none;
591
+ gap: ${lz.size[.5]};
592
+ padding: 0px;
593
+ &:hover {
594
+ opacity: 0.7;
595
+ }
596
+ &:focus-visible {
597
+ outline-offset: 4px;
598
+ border-radius: ${a.radius.xs};
599
+ outline: 2px solid ${n.blue[800]};
600
+ }
601
+ `,tanstackLogo:t`
602
+ font-size: ${r.size.md};
603
+ font-weight: ${r.weight.bold};
604
+ line-height: ${r.lineHeight.xs};
605
+ white-space: nowrap;
606
+ color: ${l(n.gray[600],n.gray[300])};
607
+ `,queryFlavorLogo:t`
608
+ font-weight: ${r.weight.semibold};
609
+ font-size: ${r.size.xs};
610
+ background: linear-gradient(
611
+ to right,
612
+ ${l("#ea4037, #ff9b11","#dd524b, #e9a03b")}
613
+ );
614
+ background-clip: text;
615
+ -webkit-background-clip: text;
616
+ line-height: 1;
617
+ -webkit-text-fill-color: transparent;
618
+ white-space: nowrap;
619
+ `,queryStatusContainer:t`
620
+ display: flex;
621
+ gap: ${lz.size[2]};
622
+ height: min-content;
623
+ `,queryStatusTag:t`
624
+ display: flex;
625
+ gap: ${lz.size[1.5]};
626
+ box-sizing: border-box;
627
+ height: ${lz.size[6.5]};
628
+ background: ${l(n.gray[50],n.darkGray[500])};
629
+ color: ${l(n.gray[700],n.gray[300])};
630
+ border-radius: ${lz.border.radius.sm};
631
+ font-size: ${r.size.sm};
632
+ padding: ${lz.size[1]};
633
+ padding-left: ${lz.size[1.5]};
634
+ align-items: center;
635
+ font-weight: ${r.weight.medium};
636
+ border: ${l("1px solid "+n.gray[300],"1px solid transparent")};
637
+ user-select: none;
638
+ position: relative;
639
+ &:focus-visible {
640
+ outline-offset: 2px;
641
+ outline: 2px solid ${n.blue[800]};
642
+ }
643
+ `,queryStatusTagLabel:t`
644
+ font-size: ${r.size.xs};
645
+ `,queryStatusCount:t`
646
+ font-size: ${r.size.xs};
647
+ padding: 0 5px;
648
+ display: flex;
649
+ align-items: center;
650
+ justify-content: center;
651
+ color: ${l(n.gray[500],n.gray[400])};
652
+ background-color: ${l(n.gray[200],n.darkGray[300])};
653
+ border-radius: 2px;
654
+ font-variant-numeric: tabular-nums;
655
+ height: ${lz.size[4.5]};
656
+ `,statusTooltip:t`
657
+ position: absolute;
658
+ z-index: 1;
659
+ background-color: ${l(n.gray[50],n.darkGray[500])};
660
+ top: 100%;
661
+ left: 50%;
662
+ transform: translate(-50%, calc(${lz.size[2]}));
663
+ padding: ${lz.size[.5]} ${lz.size[2]};
664
+ border-radius: ${lz.border.radius.sm};
665
+ font-size: ${r.size.xs};
666
+ border: 1px solid ${l(n.gray[400],n.gray[600])};
667
+ color: ${l(n.gray[600],n.gray[300])};
668
+
669
+ &::before {
670
+ top: 0px;
671
+ content: ' ';
672
+ display: block;
673
+ left: 50%;
674
+ transform: translate(-50%, -100%);
675
+ position: absolute;
676
+ border-color: transparent transparent
677
+ ${l(n.gray[400],n.gray[600])} transparent;
678
+ border-style: solid;
679
+ border-width: 7px;
680
+ /* transform: rotate(180deg); */
681
+ }
682
+
683
+ &::after {
684
+ top: 0px;
685
+ content: ' ';
686
+ display: block;
687
+ left: 50%;
688
+ transform: translate(-50%, calc(-100% + 2px));
689
+ position: absolute;
690
+ border-color: transparent transparent
691
+ ${l(n.gray[100],n.darkGray[500])} transparent;
692
+ border-style: solid;
693
+ border-width: 7px;
694
+ }
695
+ `,filtersContainer:t`
696
+ display: flex;
697
+ gap: ${lz.size[2]};
698
+ & > button {
699
+ cursor: pointer;
700
+ padding: ${lz.size[.5]} ${lz.size[1.5]} ${lz.size[.5]}
701
+ ${lz.size[2]};
702
+ border-radius: ${lz.border.radius.sm};
703
+ background-color: ${l(n.gray[100],n.darkGray[400])};
704
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
705
+ color: ${l(n.gray[700],n.gray[300])};
706
+ font-size: ${r.size.xs};
707
+ display: flex;
708
+ align-items: center;
709
+ line-height: ${r.lineHeight.sm};
710
+ gap: ${lz.size[1.5]};
711
+ max-width: 160px;
712
+ &:focus-visible {
713
+ outline-offset: 2px;
714
+ border-radius: ${a.radius.xs};
715
+ outline: 2px solid ${n.blue[800]};
716
+ }
717
+ & svg {
718
+ width: ${lz.size[3]};
719
+ height: ${lz.size[3]};
720
+ color: ${l(n.gray[500],n.gray[400])};
721
+ }
722
+ }
723
+ `,filterInput:t`
724
+ padding: ${o[.5]} ${o[2]};
725
+ border-radius: ${lz.border.radius.sm};
726
+ background-color: ${l(n.gray[100],n.darkGray[400])};
727
+ display: flex;
728
+ box-sizing: content-box;
729
+ align-items: center;
730
+ gap: ${lz.size[1.5]};
731
+ max-width: 160px;
732
+ min-width: 100px;
733
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
734
+ height: min-content;
735
+ color: ${l(n.gray[600],n.gray[400])};
736
+ & > svg {
737
+ width: ${o[3]};
738
+ height: ${o[3]};
739
+ }
740
+ & input {
741
+ font-size: ${r.size.xs};
742
+ width: 100%;
743
+ background-color: ${l(n.gray[100],n.darkGray[400])};
744
+ border: none;
745
+ padding: 0;
746
+ line-height: ${r.lineHeight.sm};
747
+ color: ${l(n.gray[700],n.gray[300])};
748
+ &::placeholder {
749
+ color: ${l(n.gray[700],n.gray[300])};
750
+ }
751
+ &:focus {
752
+ outline: none;
753
+ }
754
+ }
755
+
756
+ &:focus-within {
757
+ outline-offset: 2px;
758
+ border-radius: ${a.radius.xs};
759
+ outline: 2px solid ${n.blue[800]};
760
+ }
761
+ `,filterSelect:t`
762
+ padding: ${lz.size[.5]} ${lz.size[2]};
763
+ border-radius: ${lz.border.radius.sm};
764
+ background-color: ${l(n.gray[100],n.darkGray[400])};
765
+ display: flex;
766
+ align-items: center;
767
+ gap: ${lz.size[1.5]};
768
+ box-sizing: content-box;
769
+ max-width: 160px;
770
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
771
+ height: min-content;
772
+ & > svg {
773
+ color: ${l(n.gray[600],n.gray[400])};
774
+ width: ${lz.size[2]};
775
+ height: ${lz.size[2]};
776
+ }
777
+ & > select {
778
+ appearance: none;
779
+ color: ${l(n.gray[700],n.gray[300])};
780
+ min-width: 100px;
781
+ line-height: ${r.lineHeight.sm};
782
+ font-size: ${r.size.xs};
783
+ background-color: ${l(n.gray[100],n.darkGray[400])};
784
+ border: none;
785
+ &:focus {
786
+ outline: none;
787
+ }
788
+ }
789
+ &:focus-within {
790
+ outline-offset: 2px;
791
+ border-radius: ${a.radius.xs};
792
+ outline: 2px solid ${n.blue[800]};
793
+ }
794
+ `,actionsContainer:t`
795
+ display: flex;
796
+ gap: ${lz.size[2]};
797
+ `,actionsBtn:t`
798
+ border-radius: ${lz.border.radius.sm};
799
+ background-color: ${l(n.gray[100],n.darkGray[400])};
800
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
801
+ width: ${lz.size[6.5]};
802
+ height: ${lz.size[6.5]};
803
+ justify-content: center;
804
+ display: flex;
805
+ align-items: center;
806
+ gap: ${lz.size[1.5]};
807
+ max-width: 160px;
808
+ cursor: pointer;
809
+ padding: 0;
810
+ &:hover {
811
+ background-color: ${l(n.gray[200],n.darkGray[500])};
812
+ }
813
+ & svg {
814
+ color: ${l(n.gray[700],n.gray[300])};
815
+ width: ${lz.size[3]};
816
+ height: ${lz.size[3]};
817
+ }
818
+ &:focus-visible {
819
+ outline-offset: 2px;
820
+ border-radius: ${a.radius.xs};
821
+ outline: 2px solid ${n.blue[800]};
822
+ }
823
+ `,actionsBtnOffline:t`
824
+ & svg {
825
+ stroke: ${l(n.yellow[700],n.yellow[500])};
826
+ fill: ${l(n.yellow[700],n.yellow[500])};
827
+ }
828
+ `,overflowQueryContainer:t`
829
+ flex: 1;
830
+ overflow-y: auto;
831
+ & > div {
832
+ display: flex;
833
+ flex-direction: column;
834
+ }
835
+ `,queryRow:t`
836
+ display: flex;
837
+ align-items: center;
838
+ padding: 0;
839
+ border: none;
840
+ cursor: pointer;
841
+ color: ${l(n.gray[700],n.gray[300])};
842
+ background-color: ${l(n.gray[50],n.darkGray[700])};
843
+ line-height: 1;
844
+ &:focus {
845
+ outline: none;
846
+ }
847
+ &:focus-visible {
848
+ outline-offset: -2px;
849
+ border-radius: ${a.radius.xs};
850
+ outline: 2px solid ${n.blue[800]};
851
+ }
852
+ &:hover .tsqd-query-hash {
853
+ background-color: ${l(n.gray[200],n.darkGray[600])};
854
+ }
855
+
856
+ & .tsqd-query-observer-count {
857
+ padding: 0 ${lz.size[1]};
858
+ user-select: none;
859
+ min-width: ${lz.size[6.5]};
860
+ align-self: stretch;
861
+ display: flex;
862
+ align-items: center;
863
+ justify-content: center;
864
+ font-size: ${r.size.xs};
865
+ font-weight: ${r.weight.medium};
866
+ border-bottom-width: 1px;
867
+ border-bottom-style: solid;
868
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[700])};
869
+ }
870
+ & .tsqd-query-hash {
871
+ user-select: text;
872
+ font-size: ${r.size.xs};
873
+ display: flex;
874
+ align-items: center;
875
+ min-height: ${lz.size[6]};
876
+ flex: 1;
877
+ padding: ${lz.size[1]} ${lz.size[2]};
878
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
879
+ 'Liberation Mono', 'Courier New', monospace;
880
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
881
+ text-align: left;
882
+ text-overflow: clip;
883
+ word-break: break-word;
884
+ }
885
+
886
+ & .tsqd-query-disabled-indicator {
887
+ align-self: stretch;
888
+ display: flex;
889
+ align-items: center;
890
+ padding: 0 ${lz.size[2]};
891
+ color: ${l(n.gray[800],n.gray[300])};
892
+ background-color: ${l(n.gray[300],n.darkGray[600])};
893
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
894
+ font-size: ${r.size.xs};
895
+ }
896
+ `,selectedQueryRow:t`
897
+ background-color: ${l(n.gray[200],n.darkGray[500])};
898
+ `,detailsContainer:t`
899
+ flex: 1 1 700px;
900
+ background-color: ${l(n.gray[50],n.darkGray[700])};
901
+ color: ${l(n.gray[700],n.gray[300])};
902
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
903
+ display: flex;
904
+ flex-direction: column;
905
+ overflow-y: auto;
906
+ display: flex;
907
+ text-align: left;
908
+ `,detailsHeader:t`
909
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
910
+ position: sticky;
911
+ top: 0;
912
+ z-index: 2;
913
+ background-color: ${l(n.gray[200],n.darkGray[600])};
914
+ padding: ${lz.size[1.5]} ${lz.size[2]};
915
+ font-weight: ${r.weight.medium};
916
+ font-size: ${r.size.xs};
917
+ line-height: ${r.lineHeight.xs};
918
+ text-align: left;
919
+ `,detailsBody:t`
920
+ margin: ${lz.size[1.5]} 0px ${lz.size[2]} 0px;
921
+ & > div {
922
+ display: flex;
923
+ align-items: stretch;
924
+ padding: 0 ${lz.size[2]};
925
+ line-height: ${r.lineHeight.sm};
926
+ justify-content: space-between;
927
+ & > span {
928
+ font-size: ${r.size.xs};
929
+ }
930
+ & > span:nth-child(2) {
931
+ font-variant-numeric: tabular-nums;
932
+ }
933
+ }
934
+
935
+ & > div:first-child {
936
+ margin-bottom: ${lz.size[1.5]};
937
+ }
938
+
939
+ & code {
940
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
941
+ 'Liberation Mono', 'Courier New', monospace;
942
+ margin: 0;
943
+ font-size: ${r.size.xs};
944
+ line-height: ${r.lineHeight.xs};
945
+ }
946
+
947
+ & pre {
948
+ margin: 0;
949
+ display: flex;
950
+ align-items: center;
951
+ }
952
+ `,queryDetailsStatus:t`
953
+ border: 1px solid ${n.darkGray[200]};
954
+ border-radius: ${lz.border.radius.sm};
955
+ font-weight: ${r.weight.medium};
956
+ padding: ${lz.size[1]} ${lz.size[2.5]};
957
+ `,actionsBody:t`
958
+ flex-wrap: wrap;
959
+ margin: ${lz.size[2]} 0px ${lz.size[2]} 0px;
960
+ display: flex;
961
+ gap: ${lz.size[2]};
962
+ padding: 0px ${lz.size[2]};
963
+ & > button {
964
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
965
+ font-size: ${r.size.xs};
966
+ padding: ${lz.size[1]} ${lz.size[2]};
967
+ display: flex;
968
+ border-radius: ${lz.border.radius.sm};
969
+ background-color: ${l(n.gray[100],n.darkGray[600])};
970
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
971
+ align-items: center;
972
+ gap: ${lz.size[2]};
973
+ font-weight: ${r.weight.medium};
974
+ line-height: ${r.lineHeight.xs};
975
+ cursor: pointer;
976
+ &:focus-visible {
977
+ outline-offset: 2px;
978
+ border-radius: ${a.radius.xs};
979
+ outline: 2px solid ${n.blue[800]};
980
+ }
981
+ &:hover {
982
+ background-color: ${l(n.gray[200],n.darkGray[500])};
983
+ }
984
+
985
+ &:disabled {
986
+ opacity: 0.6;
987
+ cursor: not-allowed;
988
+ }
989
+
990
+ & > span {
991
+ width: ${o[1.5]};
992
+ height: ${o[1.5]};
993
+ border-radius: ${lz.border.radius.full};
994
+ }
995
+ }
996
+ `,actionsSelect:t`
997
+ font-size: ${r.size.xs};
998
+ padding: ${lz.size[.5]} ${lz.size[2]};
999
+ display: flex;
1000
+ border-radius: ${lz.border.radius.sm};
1001
+ overflow: hidden;
1002
+ background-color: ${l(n.gray[100],n.darkGray[600])};
1003
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1004
+ align-items: center;
1005
+ gap: ${lz.size[2]};
1006
+ font-weight: ${r.weight.medium};
1007
+ line-height: ${r.lineHeight.sm};
1008
+ color: ${l(n.red[500],n.red[400])};
1009
+ cursor: pointer;
1010
+ position: relative;
1011
+ &:hover {
1012
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1013
+ }
1014
+ & > span {
1015
+ width: ${o[1.5]};
1016
+ height: ${o[1.5]};
1017
+ border-radius: ${lz.border.radius.full};
1018
+ }
1019
+ &:focus-within {
1020
+ outline-offset: 2px;
1021
+ border-radius: ${a.radius.xs};
1022
+ outline: 2px solid ${n.blue[800]};
1023
+ }
1024
+ & select {
1025
+ position: absolute;
1026
+ top: 0;
1027
+ left: 0;
1028
+ width: 100%;
1029
+ height: 100%;
1030
+ appearance: none;
1031
+ background-color: transparent;
1032
+ border: none;
1033
+ color: transparent;
1034
+ outline: none;
1035
+ }
1036
+
1037
+ & svg path {
1038
+ stroke: ${lz.colors.red[400]};
1039
+ }
1040
+ & svg {
1041
+ width: ${lz.size[2]};
1042
+ height: ${lz.size[2]};
1043
+ }
1044
+ `,settingsMenu:t`
1045
+ display: flex;
1046
+ & * {
1047
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1048
+ }
1049
+ flex-direction: column;
1050
+ gap: ${o[.5]};
1051
+ border-radius: ${lz.border.radius.sm};
1052
+ border: 1px solid ${l(n.gray[300],n.gray[700])};
1053
+ background-color: ${l(n.gray[50],n.darkGray[600])};
1054
+ font-size: ${r.size.xs};
1055
+ color: ${l(n.gray[700],n.gray[300])};
1056
+ z-index: 99999;
1057
+ min-width: 120px;
1058
+ padding: ${o[.5]};
1059
+ `,settingsSubTrigger:t`
1060
+ display: flex;
1061
+ align-items: center;
1062
+ justify-content: space-between;
1063
+ border-radius: ${lz.border.radius.xs};
1064
+ padding: ${lz.size[1]} ${lz.size[1]};
1065
+ cursor: pointer;
1066
+ background-color: transparent;
1067
+ border: none;
1068
+ color: ${l(n.gray[700],n.gray[300])};
1069
+ & svg {
1070
+ color: ${l(n.gray[600],n.gray[400])};
1071
+ transform: rotate(-90deg);
1072
+ width: ${lz.size[2]};
1073
+ height: ${lz.size[2]};
1074
+ }
1075
+ &:hover {
1076
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1077
+ }
1078
+ &:focus-visible {
1079
+ outline-offset: 2px;
1080
+ outline: 2px solid ${n.blue[800]};
1081
+ }
1082
+ &.data-disabled {
1083
+ opacity: 0.6;
1084
+ cursor: not-allowed;
1085
+ }
1086
+ `,settingsMenuHeader:t`
1087
+ padding: ${lz.size[1]} ${lz.size[1]};
1088
+ font-weight: ${r.weight.medium};
1089
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
1090
+ color: ${l(n.gray[500],n.gray[400])};
1091
+ font-size: ${r.size.xs};
1092
+ `,settingsSubButton:t`
1093
+ display: flex;
1094
+ align-items: center;
1095
+ justify-content: space-between;
1096
+ color: ${l(n.gray[700],n.gray[300])};
1097
+ font-size: ${r.size.xs};
1098
+ border-radius: ${lz.border.radius.xs};
1099
+ padding: ${lz.size[1]} ${lz.size[1]};
1100
+ cursor: pointer;
1101
+ background-color: transparent;
1102
+ border: none;
1103
+ & svg {
1104
+ color: ${l(n.gray[600],n.gray[400])};
1105
+ }
1106
+ &:hover {
1107
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1108
+ }
1109
+ &:focus-visible {
1110
+ outline-offset: 2px;
1111
+ outline: 2px solid ${n.blue[800]};
1112
+ }
1113
+ `,themeSelectedButton:t`
1114
+ background-color: ${l(n.purple[100],n.purple[900])};
1115
+ color: ${l(n.purple[700],n.purple[300])};
1116
+ & svg {
1117
+ color: ${l(n.purple[700],n.purple[300])};
1118
+ }
1119
+ &:hover {
1120
+ background-color: ${l(n.purple[100],n.purple[900])};
1121
+ }
1122
+ `,viewToggle:t`
1123
+ border-radius: ${lz.border.radius.sm};
1124
+ background-color: ${l(n.gray[200],n.darkGray[600])};
1125
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
1126
+ display: flex;
1127
+ padding: 0;
1128
+ font-size: ${r.size.xs};
1129
+ color: ${l(n.gray[700],n.gray[300])};
1130
+ overflow: hidden;
1131
+
1132
+ &:has(:focus-visible) {
1133
+ outline: 2px solid ${n.blue[800]};
1134
+ }
1135
+
1136
+ & .tsqd-radio-toggle {
1137
+ opacity: 0.5;
1138
+ display: flex;
1139
+ & label {
1140
+ display: flex;
1141
+ align-items: center;
1142
+ cursor: pointer;
1143
+ line-height: ${r.lineHeight.md};
1144
+ }
1145
+
1146
+ & label:hover {
1147
+ background-color: ${l(n.gray[100],n.darkGray[500])};
1148
+ }
1149
+ }
1150
+
1151
+ & > [data-checked] {
1152
+ opacity: 1;
1153
+ background-color: ${l(n.gray[100],n.darkGray[400])};
1154
+ & label:hover {
1155
+ background-color: ${l(n.gray[100],n.darkGray[400])};
1156
+ }
1157
+ }
1158
+
1159
+ & .tsqd-radio-toggle:first-child {
1160
+ & label {
1161
+ padding: 0 ${lz.size[1.5]} 0 ${lz.size[2]};
1162
+ }
1163
+ border-right: 1px solid ${l(n.gray[300],n.darkGray[200])};
1164
+ }
1165
+
1166
+ & .tsqd-radio-toggle:nth-child(2) {
1167
+ & label {
1168
+ padding: 0 ${lz.size[2]} 0 ${lz.size[1.5]};
1169
+ }
1170
+ }
1171
+ `,devtoolsEditForm:t`
1172
+ padding: ${o[2]};
1173
+ & > [data-error='true'] {
1174
+ outline: 2px solid ${l(n.red[200],n.red[800])};
1175
+ outline-offset: 2px;
1176
+ border-radius: ${a.radius.xs};
1177
+ }
1178
+ `,devtoolsEditTextarea:t`
1179
+ width: 100%;
1180
+ max-height: 500px;
1181
+ font-family: 'Fira Code', monospace;
1182
+ font-size: ${r.size.xs};
1183
+ border-radius: ${a.radius.sm};
1184
+ field-sizing: content;
1185
+ padding: ${o[2]};
1186
+ background-color: ${l(n.gray[100],n.darkGray[800])};
1187
+ color: ${l(n.gray[900],n.gray[100])};
1188
+ border: 1px solid ${l(n.gray[200],n.gray[700])};
1189
+ resize: none;
1190
+ &:focus {
1191
+ outline-offset: 2px;
1192
+ border-radius: ${a.radius.xs};
1193
+ outline: 2px solid ${l(n.blue[200],n.blue[800])};
1194
+ }
1195
+ `,devtoolsEditFormActions:t`
1196
+ display: flex;
1197
+ justify-content: space-between;
1198
+ gap: ${o[2]};
1199
+ align-items: center;
1200
+ padding-top: ${o[1]};
1201
+ font-size: ${r.size.xs};
1202
+ `,devtoolsEditFormError:t`
1203
+ color: ${l(n.red[700],n.red[500])};
1204
+ `,devtoolsEditFormActionContainer:t`
1205
+ display: flex;
1206
+ gap: ${o[2]};
1207
+ `,devtoolsEditFormAction:t`
1208
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1209
+ font-size: ${r.size.xs};
1210
+ padding: ${o[1]} ${lz.size[2]};
1211
+ display: flex;
1212
+ border-radius: ${a.radius.sm};
1213
+ background-color: ${l(n.gray[100],n.darkGray[600])};
1214
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1215
+ align-items: center;
1216
+ gap: ${o[2]};
1217
+ font-weight: ${r.weight.medium};
1218
+ line-height: ${r.lineHeight.xs};
1219
+ cursor: pointer;
1220
+ &:focus-visible {
1221
+ outline-offset: 2px;
1222
+ border-radius: ${a.radius.xs};
1223
+ outline: 2px solid ${n.blue[800]};
1224
+ }
1225
+ &:hover {
1226
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1227
+ }
1228
+
1229
+ &:disabled {
1230
+ opacity: 0.6;
1231
+ cursor: not-allowed;
1232
+ }
1233
+ `}},AB=e=>OB("light",e),NB=e=>OB("dark",e);qr(["click","mousedown","input"]);const _B=Object.freeze(Object.defineProperty({__proto__:null,default:e=>{const[t,n]=kR({prefix:"TanstackQueryDevtools"}),r=ai(),o=Fn((()=>{const e=t.theme_preference||jR;return"system"!==e?e:r()}));return pr(MR.Provider,{value:e,get children(){return pr(NR,{localStore:t,setLocalStore:n,get children(){return pr(RR.Provider,{value:o,get children(){return pr(fB,{localStore:t,setLocalStore:n})}})}})}})}},Symbol.toStringTag,{value:"Module"}));const RB=Object.freeze(Object.defineProperty({__proto__:null,default:e=>{const[t,n]=kR({prefix:"TanstackQueryDevtools"}),r=ai(),o=Fn((()=>{const e=t.theme_preference||jR;return"system"!==e?e:r()}));return pr(MR.Provider,{value:e,get children(){return pr(NR,{disabled:!0,localStore:t,setLocalStore:n,get children(){return pr(RR.Provider,{value:o,get children(){return pr(gB,{get children(){return pr(vB,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})}},Symbol.toStringTag,{value:"Module"}));e.CreateAutomationModal=({onClose:e,tailwindClassDefinitions:r,iconDefinitions:o})=>{var i;const{createAutomation:s,isCreating:a}=Tb(),[l,c]=n.useState(!1),u=Qb(r),d=Xb(o),[h,f]=n.useState("choose-automation-type"),[p,g]=n.useState({name:void 0,type:void 0}),m=void 0!==p.name&&void 0!==p.type;n.useEffect((()=>{if(p.type&&!p.name){const e=new Date,t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=`Campaign ${e.toLocaleDateString([],{month:"short",day:"numeric"})} ${t}`;g((e=>({...e,name:n})))}}),[p]);return a||l?t.jsx("div",{className:sx,children:t.jsx(kb,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(Rd,{mode:"wait",children:["choose-automation-type"===h&&t.jsx(wb.div,{initial:{opacity:0,filter:"blur(8px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(8px)"},transition:{duration:.3,ease:"easeInOut"},children:t.jsx(ax,{onNext:e=>{g({...p,type:e}),f("set-automation-name")}})},"choose-automation-type"),"set-automation-name"===h&&p.type&&t.jsx(wb.div,{initial:{opacity:0,filter:"blur(8px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(8px)"},transition:{duration:.3,ease:"easeInOut"},children:t.jsx(cx,{tailwindClassDefinitions:u,iconDefinitions:d,selectedType:p.type,setAutomationName:e=>{g({...p,name:e})},automationName:null!=(i=p.name)?i:""})},"set-automation-name")]}),t.jsx("div",{className:"pt-2",children:t.jsx(Hw,{onClose:e,tailwindClassDefinitions:u,currentStep:h,setCurrentStep:f,isDisabled:!m,createAutomation:async()=>{if(!m||!p.name||!p.type)return;c(!0);s({name:p.name,type:p.type},{onSuccess:t=>{t.id?null==e||e(t.id):null==e||e("error")},onError:()=>{null==e||e("error")},onSettled:()=>{g({name:void 0,type:void 0})}})}})})]})},e.ReachProvider=({authToken:e,tenantExternalId:r,children:o})=>{const[i]=n.useState((()=>(e&&(Xc=e),new Xt({defaultOptions:{queries:{retry:(e,t)=>!(t instanceof Error&&"Unauthorized"===t.message)&&e<3,...Qc}}}))));return t.jsxs(an,{client:i,children:[t.jsx(Wc,{clientSideID:"67a3c277012e1f09c67de499",context:{kind:"user",key:r||"anonymous",custom:{businessId:r}},options:{streaming:!1},timeout:2,reactOptions:{useCamelCaseFlagKeys:!1,sendEventsOnFlagRead:!0},children:t.jsx(xd,{children:t.jsx(au,{children:t.jsx(ou,{children:o})})})}),t.jsx(hi,{})]})},e.SegmentBuilder=vx,e.ViewAutomationModal=({automationId:e,tailwindClassDefinitions:n,iconDefinitions:r,autoOpenEditPopup:o})=>{const i=e,s=o,a=Qb(n),l=Xb(r),{automation:c,isFetching:u,isLoading:d,fetchError:h}=jb(i);return c||!u&&!d?h?t.jsxs("div",{children:["Error: ",h.message]}):c?t.jsxs("div",{className:sx,children:[t.jsx(mR,{automation:c,tailwindClassDefinitions:a,iconDefinitions:l,autoOpenEditPopup:s}),t.jsx("div",{className:"pt-4",children:t.jsxs(Ck,{defaultValue:"content",children:[t.jsxs(Ek,{children:[t.jsx(Pk,{value:"content",children:"Content"}),t.jsx(Pk,{value:"recipients",children:"Recipients"})]}),t.jsx(jk,{value:"recipients",children:t.jsx(Lk,{automationId:i,tailwindClassDefinitions:a,iconDefinitions:l})}),t.jsx(jk,{value:"content",children:t.jsx(Dk,{automationId:i,tailwindClassDefinitions:a,iconDefinitions:l})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:sx,children:t.jsx(kb,{text:["Fetching Automation data","Finishing up"]})})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));