@embedreach/components 0.1.20 → 0.1.22
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/chunks/B4MFY5CR.js +12168 -0
- package/dist/chunks/HO4MOOFI.js +38 -0
- package/dist/chunks/HUY7CZI3.js +47 -0
- package/dist/chunks/index.js +46615 -0
- package/dist/index.d.ts +203 -4
- package/dist/index.es.js +6 -9935
- package/dist/index.umd.js +1237 -127
- package/dist/styles.css +1 -0
- package/package.json +22 -13
- package/dist/style.css +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,132 +1,1242 @@
|
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* react-is.development.js
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
height: var(--uib-stroke);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.line:nth-child(2) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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";function o(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 i=o(n),s=o(r);var a=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(){}},l="undefined"==typeof window||"Deno"in globalThis;function c(){}function u(e){return"number"==typeof e&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return"function"==typeof e?e(t):e}function f(e,t){return"function"==typeof e?e(t):e}function p(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==g(s,t.options))return!1}else if(!y(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 m(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(i))return!1}else if(!y(t.options.mutationKey,i))return!1}return(!r||t.state.status===r)&&!(o&&!o(t))}function g(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,((e,t)=>S(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))}function y(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((n=>!y(e[n],t[n]))))}function b(e,t){if(e===t)return e;const n=w(e)&&w(t);if(n||S(e)&&S(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]=b(e[o],t[o]),a[o]===e[o]&&void 0!==e[o]&&l++)}return o===s&&l===o?e:a}return t}function x(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 w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!C(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!C(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(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 b(e,t)}catch(r){}return b(e,t)}return t}function E(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function j(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var P=Symbol();function T(e,t){return process,!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==P?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var N=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!l&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},D=new class extends a{#r=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!l&&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(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#r!==e&&(this.#r=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#r}};function _(){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 M(e){return Math.min(1e3*2**e,3e4)}function O(e){return"online"!==(e??"online")||D.isOnline()}var R=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function A(e){return e instanceof R}function L(e){let t,n=!1,r=0,o=!1;const i=_(),s=()=>N.isFocused()&&("always"===e.networkMode||D.isOnline())&&e.canRun(),a=()=>O(e.networkMode)&&e.canRun(),c=n=>{o||(o=!0,e.onSuccess?.(n),t?.(),i.resolve(n))},u=n=>{o||(o=!0,e.onError?.(n),t?.(),i.reject(n))},d=()=>new Promise((n=>{t=e=>{(o||s())&&n(e)},e.onPause?.()})).then((()=>{t=void 0,o||e.onContinue?.()})),h=()=>{if(o)return;let t;const i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch((t=>{if(o)return;const i=e.retry??(l?0:3),a=e.retryDelay??M,c="function"==typeof a?a(r,t):a,f=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);var p;!n&&f?(r++,e.onFail?.(r,t),(p=c,new Promise((e=>{setTimeout(e,p)}))).then((()=>s()?void 0:d())).then((()=>{n?u(t):h()}))):u(t)}))};return{promise:i,cancel:t=>{o||(u(new R(t)),e.abort?.())},continue:()=>(t?.(),i),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?h():d().then(h),i)}}var I=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}}}(),F=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#o=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(l?1/0:3e5))}clearGcTimeout(){this.#o&&(clearTimeout(this.#o),this.#o=void 0)}},$=class extends F{#i;#s;#a;#l;#c;#u;constructor(e){super(),this.#u=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#i=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?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=e.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#a.remove(this)}setData(e,t){const n=k(this.state.data,e,this.options);return this.#d({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#d({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#i)}isActive(){return this.observers.some((e=>!1!==f(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P||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||!d(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#l&&(this.#u?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.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 n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#u=!0,n.signal)})},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const e=T(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return r(n),this.#u=!1,this.options.persister?this.options.persister(e,n,this):e(n)}};r(o),this.options.behavior?.onFetch(o,this),this.#s=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#d({type:"fetch",meta:o.fetchOptions?.meta});const i=e=>{A(e)&&e.silent||this.#d({type:"error",error:e}),A(e)||(this.#a.config.onError?.(e,this),this.#a.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#l=L({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e)return process,void i(new Error(`${this.queryHash} data is undefined`));try{this.setData(e)}catch(t){return void i(t)}this.#a.config.onSuccess?.(e,this),this.#a.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:i,onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#l.start()}#d(e){this.state=(t=>{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,...q(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return A(n)&&n.revert&&this.#s?{...this.#s,fetchStatus:"idle"}:{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),I.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#a.notify({query:this,type:"updated",action:e})}))}};function q(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var z=class extends a{constructor(e={}){super(),this.config=e,this.#h=new Map}#h;build(e,t,n){const r=t.queryKey,o=t.queryHash??g(r,t);let i=this.get(o);return i||(i=new $({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#h.has(e.queryHash)||(this.#h.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#h.get(e.queryHash);t&&(e.destroy(),t===e&&this.#h.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){I.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#h.get(e)}getAll(){return[...this.#h.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>p(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>p(e,t))):t}notify(e){I.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){I.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){I.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},U=class extends F{#f;#p;#l;constructor(e){super(),this.mutationId=e.mutationId,this.#p=e.mutationCache,this.#f=[],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){this.#f.includes(e)||(this.#f.push(e),this.clearGcTimeout(),this.#p.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#f=this.#f.filter((t=>t!==e)),this.scheduleGc(),this.#p.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#f.length||("pending"===this.state.status?this.scheduleGc():this.#p.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){this.#l=L({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#p.canRun(this)});const t="pending"===this.state.status,n=!this.#l.canStart();try{if(!t){this.#d({type:"pending",variables:e,isPaused:n}),await(this.#p.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#d({type:"pending",context:t,variables:e,isPaused:n})}const r=await this.#l.start();return await(this.#p.config.onSuccess?.(r,e,this.state.context,this)),await(this.options.onSuccess?.(r,e,this.state.context)),await(this.#p.config.onSettled?.(r,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(r,null,e,this.state.context)),this.#d({type:"success",data:r}),r}catch(r){try{throw await(this.#p.config.onError?.(r,e,this.state.context,this)),await(this.options.onError?.(r,e,this.state.context)),await(this.#p.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,r,e,this.state.context)),r}finally{this.#d({type:"error",error:r})}}finally{this.#p.runNext(this)}}#d(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),I.batch((()=>{this.#f.forEach((t=>{t.onMutationUpdate(e)})),this.#p.notify({mutation:this,type:"updated",action:e})}))}};var B=class extends a{constructor(e={}){super(),this.config=e,this.#m=new Map,this.#g=Date.now()}#m;#g;build(e,t,n){const r=new U({mutationCache:this,mutationId:++this.#g,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=V(e),n=this.#m.get(t)??[];n.push(e),this.#m.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=V(e);if(this.#m.has(t)){const n=this.#m.get(t)?.filter((t=>t!==e));n&&(0===n.length?this.#m.delete(t):this.#m.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#m.get(V(e))?.find((e=>"pending"===e.state.status));return!t||t===e}runNext(e){const t=this.#m.get(V(e))?.find((t=>t!==e&&t.state.isPaused));return t?.continue()??Promise.resolve()}clear(){I.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}getAll(){return[...this.#m.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find((e=>m(t,e)))}findAll(e={}){return this.getAll().filter((t=>m(e,t)))}notify(e){I.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return I.batch((()=>Promise.all(e.map((e=>e.continue().catch(c))))))}};function V(e){return e.options.scope?.id??String(e.mutationId)}function K(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let n=!1;const c=T(t.options,t.fetchOptions),u=async(e,r,o)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i={queryKey:t.queryKey,pageParam:r,direction:o?"backward":"forward",meta:t.options.meta};Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",(()=>{n=!0})),t.signal)});const s=await c(i),{maxPages:a}=t.options,l=o?j:E;return{pages:l(e.pages,s,a),pageParams:l(e.pageParams,r,a)}};if(o&&i.length){const e="backward"===o,t={pages:i,pageParams:s},n=(e?W:H)(r,t);a=await u(t,n,e)}else{const t=e??i.length;do{const e=0===l?s[0]??r.initialPageParam:H(r,a);if(l>0&&null==e)break;a=await u(a,e),l++}while(l<t)}return a};t.fetchFn=t.options.persister?()=>t.options.persister?.(c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):c}}}function H(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 W(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var G=class{#v;#p;#c;#y;#b;#x;#w;#S;constructor(e={}){this.#v=e.queryCache||new z,this.#p=e.mutationCache||new B,this.#c=e.defaultOptions||{},this.#y=new Map,this.#b=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#w=N.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#v.onFocus())})),this.#S=D.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#v.onOnline())})))}unmount(){this.#x--,0===this.#x&&(this.#w?.(),this.#w=void 0,this.#S?.(),this.#S=void 0)}isFetching(e){return this.#v.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#p.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#v.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(h(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#v.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#v.get(r.queryHash),i=o?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==s)return this.#v.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return I.batch((()=>this.#v.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state}removeQueries(e){const t=this.#v;I.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const n=this.#v,r={type:"active",...e};return I.batch((()=>(n.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(r,t))))}cancelQueries(e,t={}){const n={revert:!0,...t},r=I.batch((()=>this.#v.findAll(e).map((e=>e.cancel(n)))));return Promise.all(r).then(c).catch(c)}invalidateQueries(e,t={}){return I.batch((()=>{if(this.#v.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType)return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)}))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=I.batch((()=>this.#v.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(c)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(r).then(c)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#v.build(this,t);return n.isStaleByTime(h(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(c).catch(c)}fetchInfiniteQuery(e){return e.behavior=K(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(c).catch(c)}ensureInfiniteQueryData(e){return e.behavior=K(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return D.isOnline()?this.#p.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#v}getMutationCache(){return this.#p}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#y.set(v(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#y.values()],n={};return t.forEach((t=>{y(e,t.queryKey)&&Object.assign(n,t.defaultOptions)})),n}setMutationDefaults(e,t){this.#b.set(v(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#b.values()];let n={};return t.forEach((t=>{y(e,t.mutationKey)&&(n={...n,...t.defaultOptions})})),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=g(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===P&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#v.clear(),this.#p.clear()}},Y=class extends a{constructor(e,t){super(),this.options=t,this.#C=e,this.#k=null,this.#E=_(),this.options.experimental_prefetchInRender||this.#E.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#C;#j=void 0;#P=void 0;#T=void 0;#N;#D;#E;#k;#_;#M;#O;#R;#A;#L;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#j.addObserver(this),Q(this.#j,this.options)?this.#F():this.updateResult(),this.#$())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return X(this.#j,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return X(this.#j,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#q(),this.#z(),this.#j.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#j;if(this.options=this.#C.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof f(this.options.enabled,this.#j))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#U(),this.#j.setOptions(this.options),n._defaulted&&!x(this.options,n)&&this.#C.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#j,observer:this});const o=this.hasListeners();o&&J(this.#j,r,this.options,n)&&this.#F(),this.updateResult(t),!o||this.#j===r&&f(this.options.enabled,this.#j)===f(n.enabled,this.#j)&&h(this.options.staleTime,this.#j)===h(n.staleTime,this.#j)||this.#B();const i=this.#V();!o||this.#j===r&&f(this.options.enabled,this.#j)===f(n.enabled,this.#j)&&i===this.#L||this.#K(i)}getOptimisticResult(e){const t=this.#C.getQueryCache().build(this.#C,e),n=this.createResult(t,e);return function(e,t){if(!x(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(this.#T=n,this.#D=this.options,this.#N=this.#j.state),n}getCurrentResult(){return this.#T}trackResult(e,t){const n={};return Object.keys(e).forEach((r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})})),n}trackProp(e){this.#I.add(e)}getCurrentQuery(){return this.#j}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#C.defaultQueryOptions(e),n=this.#C.getQueryCache().build(this.#C,t);return n.fetch().then((()=>this.createResult(n,t)))}fetch(e){return this.#F({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#T)))}#F(e){this.#U();let t=this.#j.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#B(){this.#q();const e=h(this.options.staleTime,this.#j);if(l||this.#T.isStale||!u(e))return;const t=d(this.#T.dataUpdatedAt,e);this.#R=setTimeout((()=>{this.#T.isStale||this.updateResult()}),t+1)}#V(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#j):this.options.refetchInterval)??!1}#K(e){this.#z(),this.#L=e,!l&&!1!==f(this.options.enabled,this.#j)&&u(this.#L)&&0!==this.#L&&(this.#A=setInterval((()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#F()}),this.#L))}#$(){this.#B(),this.#K(this.#V())}#q(){this.#R&&(clearTimeout(this.#R),this.#R=void 0)}#z(){this.#A&&(clearInterval(this.#A),this.#A=void 0)}createResult(e,t){const n=this.#j,r=this.options,o=this.#T,i=this.#N,s=this.#D,a=e!==n?e.state:this.#P,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),i=!o&&Q(e,t),s=o&&J(e,n,t,r);(i||s)&&(u={...u,...q(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:f,status:p}=u;if(t.select&&void 0!==u.data)if(o&&u.data===i?.data&&t.select===this.#_)c=this.#M;else try{this.#_=t.select,c=t.select(u.data),c=k(o?.data,c,t),this.#M=c,this.#k=null}catch(w){this.#k=w}else c=u.data;if(void 0!==t.placeholderData&&void 0===c&&"pending"===p){let e;if(o?.isPlaceholderData&&t.placeholderData===s?.placeholderData)e=o.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#k=null}catch(w){this.#k=w}void 0!==e&&(p="success",c=k(o?.data,e,t),d=!0)}this.#k&&(h=this.#k,c=this.#M,f=Date.now(),p="error");const m="fetching"===u.fetchStatus,g="pending"===p,v="error"===p,y=g&&m,b=void 0!==c,x={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:v,isInitialLoading:y,isLoading:y,data:c,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:v&&b,isStale:Z(e,t),refetch:this.refetch,promise:this.#E};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===x.status?e.reject(x.error):void 0!==x.data&&e.resolve(x.data)},r=()=>{const e=this.#E=x.promise=_();t(e)},o=this.#E;switch(o.status){case"pending":e.queryHash===n.queryHash&&t(o);break;case"fulfilled":"error"!==x.status&&x.data===o.value||r();break;case"rejected":"error"===x.status&&x.error===o.reason||r()}}return x}updateResult(e){const t=this.#T,n=this.createResult(this.#j,this.options);if(this.#N=this.#j.state,this.#D=this.options,void 0!==this.#N.data&&(this.#O=this.#j),x(n,t))return;this.#T=n;const r={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#I.size)return!0;const r=new Set(n??this.#I);return this.options.throwOnError&&r.add("error"),Object.keys(this.#T).some((e=>this.#T[e]!==t[e]&&r.has(e)))})()&&(r.listeners=!0),this.#H({...r,...e})}#U(){const e=this.#C.getQueryCache().build(this.#C,this.options);if(e===this.#j)return;const t=this.#j;this.#j=e,this.#P=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#$()}#H(e){I.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#T)})),this.#C.getQueryCache().notify({query:this.#j,type:"observerResultsUpdated"})}))}};function Q(e,t){return function(e,t){return!1!==f(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&X(e,t,t.refetchOnMount)}function X(e,t,n){if(!1!==f(t.enabled,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&Z(e,t)}return!1}function J(e,t,n,r){return(e!==t||!1===f(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&Z(e,n)}function Z(e,t){return!1!==f(t.enabled,e)&&e.isStaleByTime(h(t.staleTime,e))}var ee=class extends a{#C;#T=void 0;#W;#G;constructor(e,t){super(),this.#C=e,this.setOptions(t),this.bindMethods(),this.#Y()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#C.defaultMutationOptions(e),x(this.options,t)||this.#C.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#W,observer:this}),t?.mutationKey&&this.options.mutationKey&&v(t.mutationKey)!==v(this.options.mutationKey)?this.reset():"pending"===this.#W?.state.status&&this.#W.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#W?.removeObserver(this)}onMutationUpdate(e){this.#Y(),this.#H(e)}getCurrentResult(){return this.#T}reset(){this.#W?.removeObserver(this),this.#W=void 0,this.#Y(),this.#H()}mutate(e,t){return this.#G=t,this.#W?.removeObserver(this),this.#W=this.#C.getMutationCache().build(this.#C,this.options),this.#W.addObserver(this),this.#W.execute(e)}#Y(){const e=this.#W?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#T={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#H(e){I.batch((()=>{if(this.#G&&this.hasListeners()){const t=this.#T.variables,n=this.#T.context;"success"===e?.type?(this.#G.onSuccess?.(e.data,t,n),this.#G.onSettled?.(e.data,null,t,n)):"error"===e?.type&&(this.#G.onError?.(e.error,t,n),this.#G.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach((e=>{e(this.#T)}))}))}},te=i.createContext(void 0),ne=e=>{const t=i.useContext(te);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},re=({client:e,children:n})=>(i.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),t.jsx(te.Provider,{value:e,children:n})),oe=i.createContext(!1);var ie=i.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}());function se(e,t){return"function"==typeof e?e(...t):!!e}function ae(){}var le=(e,t,n)=>t.fetchOptimistic(e).catch((()=>{n.clearReset()}));function ce(e,t,n){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 r=ne(n),o=i.useContext(oe),s=i.useContext(ie),a=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=o?"isRestoring":"optimistic",(e=>{e.suspense&&(void 0===e.staleTime&&(e.staleTime=1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))})(a),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(a,s),(e=>{i.useEffect((()=>{e.clearReset()}),[e])})(s);const c=!r.getQueryCache().get(a.queryHash),[u]=i.useState((()=>new t(r,a))),d=u.getOptimisticResult(a);if(i.useSyncExternalStore(i.useCallback((e=>{const t=o?ae:u.subscribe(I.batchCalls(e));return u.updateResult(),t}),[u,o]),(()=>u.getCurrentResult()),(()=>u.getCurrentResult())),i.useEffect((()=>{u.setOptions(a,{listeners:!1})}),[a,u]),((e,t)=>e?.suspense&&t.isPending)(a,d))throw le(a,u,s);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&se(n,[e.error,r]))({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw d.error;if(r.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!l&&((e,t)=>e.isLoading&&e.isFetching&&!t)(d,o)){const e=c?le(a,u,s):r.getQueryCache().get(a.queryHash)?.promise;e?.catch(ae).finally((()=>{u.updateResult()}))}return a.notifyOnChangeProps?d:u.trackResult(d)}function ue(e,t){return ce(e,Y,t)}function de(e,t){const n=ne(t),[r]=i.useState((()=>new ee(n,e)));i.useEffect((()=>{r.setOptions(e)}),[r,e]);const o=i.useSyncExternalStore(i.useCallback((e=>r.subscribe(I.batchCalls(e))),[r]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),s=i.useCallback(((e,t)=>{r.mutate(e,t).catch(ae)}),[r]);if(o.error&&se(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var he={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return fe(this.context.count)},getNextContextId(){return fe(this.context.count++)}};function fe(e){const t=String(e),n=t.length-1;return he.context.id+(n?String.fromCharCode(96+n):"")+t}function pe(e){he.context=e}var me=Symbol("solid-proxy"),ge="function"==typeof Proxy,ve=(Symbol("solid-track"),{equals:(e,t)=>e===t}),ye=Ze,be=1,xe=2,we={owned:null,cleanups:null,context:null,owner:null},Se={},Ce=null,ke=null,Ee=null,je=null,Pe=null,Te=0;function Ne(e,t){const n=Ee,r=Ce,o=0===e.length,i=void 0===t?r:t,s=o?we:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>Le((()=>rt(s)))));Ce=s,Ee=null;try{return Je(a,!0)}finally{Ee=n,Ce=r}}function De(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},ve,t):ve).equals||void 0};return[We.bind(n),e=>("function"==typeof e&&(e=e(n.value)),Ge(n,e))]}function _e(e,t,n){Ye(Qe(e,t,!0,be))}function Me(e,t,n){Ye(Qe(e,t,!1,be))}function Oe(e,t,n){ye=et;const r=Qe(e,t,!1,be);n&&n.render||(r.user=!0),Pe?Pe.push(r):Ye(r)}function Re(e,t,n){n=n?Object.assign({},ve,n):ve;const r=Qe(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ye(r),We.bind(r)}function Ae(e,t,n){let r,o,i;1===arguments.length?(r=!0,o=e,i={}):(r=e,o=t,i={});let s=null,a=Se,l=null,c=!1,u="initialValue"in i,d="function"==typeof r&&Re(r);const h=new Set,[f,p]=(i.storage||De)(i.initialValue),[m,g]=De(void 0),[v,y]=De(void 0,{equals:!1}),[b,x]=De(u?"ready":"unresolved");function w(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=Se,function(e,t){Je((()=>{void 0===t&&p((()=>e)),x(void 0!==t?"errored":u?"ready":"unresolved"),g(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,n)),t}function S(){const e=f(),t=m();if(void 0!==t&&!s)throw t;return e}function C(e=!0){if(!1!==e&&c)return;c=!1;const t=d?d():r;if(null==t||!1===t)return void w(s,Le(f));const n=a!==Se?a:Le((()=>o(t,{value:f(),refetching:e})));return(i=n)&&"object"==typeof i&&"then"in i?(s=n,"value"in n?("success"===n.status?w(s,n.value,void 0,t):w(s,void 0,ot(n.value),t),n):(c=!0,queueMicrotask((()=>c=!1)),Je((()=>{x(u?"refreshing":"pending"),y()}),!1),n.then((e=>w(n,e,void 0,t)),(e=>w(n,void 0,ot(e),t))))):(w(s,n,void 0,t),n);var i}return he.context&&(l=he.getNextContextId(),"initial"===i.ssrLoadFrom?a=i.initialValue:he.load&&he.has(l)&&(a=he.load(l))),Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const e=b();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return S();const e=m();if(e&&!s)throw e;return f()}}}),d?_e((()=>C(!1))):C(!1),[S,{refetch:C,mutate:p}]}function Le(e){if(null===Ee)return e();const t=Ee;Ee=null;try{return e()}finally{Ee=t}}function Ie(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=Le((()=>t(s,o,n)));return o=s,a}}function Fe(e){Oe((()=>Le(e)))}function $e(e){return null===Ce||(null===Ce.cleanups?Ce.cleanups=[e]:Ce.cleanups.push(e)),e}function qe(){return Ce}function ze(e){const t=Ee,n=Ce;return Promise.resolve().then((()=>{Ee=t,Ce=n,Je(e,!1),Ee=Ce=null}))}var[Ue,Be]=De(!1);function Ve(e,t){const n=Symbol("context");return{id:n,Provider:at(n),defaultValue:e}}function Ke(e){let t;return Ce&&Ce.context&&void 0!==(t=Ce.context[e.id])?t:e.defaultValue}function He(e){const t=Re(e),n=Re((()=>st(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function We(){if(this.sources&&this.state)if(this.state===be)Ye(this);else{const e=je;je=null,Je((()=>tt(this)),!1),je=e}if(Ee){const e=this.observers?this.observers.length:0;Ee.sources?(Ee.sources.push(this),Ee.sourceSlots.push(e)):(Ee.sources=[this],Ee.sourceSlots=[e]),this.observers?(this.observers.push(Ee),this.observerSlots.push(Ee.sources.length-1)):(this.observers=[Ee],this.observerSlots=[Ee.sources.length-1])}return this.value}function Ge(e,t,n){return e.comparator&&e.comparator(e.value,t)||(e.value=t,e.observers&&e.observers.length&&Je((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=ke&&ke.running;r&&ke.disposed.has(n),(r?n.tState:n.state)||(n.pure?je.push(n):Pe.push(n),n.observers&&nt(n)),r||(n.state=be)}if(je.length>1e6)throw je=[],new Error}),!1)),t}function Ye(e){if(!e.fn)return;rt(e);!function(e,t,n){let r;const o=Ce,i=Ee;Ee=Ce=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=be,e.owned&&e.owned.forEach(rt),e.owned=null),e.updatedAt=n+1,it(s)}finally{Ee=i,Ce=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Ge(e,r):e.value=r,e.updatedAt=n)}(e,e.value,Te)}function Qe(e,t,n,r=be,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ce,context:Ce?Ce.context:null,pure:n};return null===Ce||Ce!==we&&(Ce.owned?Ce.owned.push(i):Ce.owned=[i]),i}function Xe(e){if(0===e.state)return;if(e.state===xe)return tt(e);if(e.suspense&&Le(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Te);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===be)Ye(e);else if(e.state===xe){const n=je;je=null,Je((()=>tt(e,t[0])),!1),je=n}}function Je(e,t){if(je)return e();let n=!1;t||(je=[]),Pe?n=!0:Pe=[],Te++;try{const t=e();return function(e){je&&(Ze(je),je=null);if(e)return;const t=Pe;Pe=null,t.length&&Je((()=>ye(t)),!1)}(n),t}catch(r){n||(Pe=null),je=null,it(r)}}function Ze(e){for(let t=0;t<e.length;t++)Xe(e[t])}function et(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Xe(r)}if(he.context){if(he.count)return he.effects||(he.effects=[]),void he.effects.push(...e.slice(0,n));pe()}for(!he.effects||!he.done&&he.count||(e=[...he.effects,...e],n+=he.effects.length,delete he.effects),t=0;t<n;t++)Xe(e[t])}function tt(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===be?r!==t&&(!r.updatedAt||r.updatedAt<Te)&&Xe(r):e===xe&&tt(r,t)}}}function nt(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=xe,n.pure?je.push(n):Pe.push(n),n.observers&&nt(n))}}function rt(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--)rt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)rt(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 ot(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function it(e,t=Ce){throw ot(e)}function st(e){if("function"==typeof e&&!e.length)return st(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=st(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function at(e,t){return function(t){let n;return Me((()=>n=Le((()=>(Ce.context={...Ce.context,[e]:t.value},He((()=>t.children)))))),void 0),n}}var lt=Symbol("fallback");function ct(e){for(let t=0;t<e.length;t++)e[t]()}function ut(e,t){return Le((()=>e(t||{})))}function dt(){return!0}var ht={get:(e,t,n)=>t===me?n:e.get(t),has:(e,t)=>t===me||e.has(t),set:dt,deleteProperty:dt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:dt,deleteProperty:dt}),ownKeys:e=>e.keys()};function ft(e){return(e="function"==typeof e?e():e)?e:{}}function pt(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function mt(...e){let t=!1;for(let s=0;s<e.length;s++){const n=e[s];t=t||!!n&&me in n,e[s]="function"==typeof n?(t=!0,Re(n)):n}if(ge&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=ft(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in ft(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(ft(e[n])));return[...new Set(t)]}},ht);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:pt.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 gt(e,...t){if(ge&&me 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))},ht)));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)))},ht)),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 vt(e){let t,n;const r=r=>{const o=he.context;if(o){const[r,i]=De();he.count||(he.count=0),he.count++,(n||(n=e())).then((e=>{!he.done&&pe(o),he.count--,i((()=>e.default)),pe()})),t=r}else if(!t){const[r]=Ae((()=>(n||(n=e())).then((e=>e.default))));t=r}let i;return Re((()=>(i=t())?Le((()=>{if(!o||he.done)return i(r);const e=he.context;pe(o);const t=i(r);return pe(e),t})):""))};return r.preload=()=>n||((n=e()).then((e=>t=()=>e.default)),n),r}var yt=0;function bt(){return he.context?he.getNextContextId():"cl-"+yt++}var xt=e=>`Stale read from <${e}>.`;function wt(e){return Re(function(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return $e((()=>ct(i))),()=>{let l,c,u=e()||[],d=u.length;return Le((()=>{let e,t,f,p,m,g,v,y,b;if(0===d)0!==s&&(ct(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[lt],o[0]=Ne((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]=Ne(h);s=d}else{for(f=new Array(d),p=new Array(d),a&&(m=new Array(d)),g=0,v=Math.min(s,d);g<v&&r[g]===u[g];g++);for(v=s-1,y=d-1;v>=g&&y>=g&&r[v]===u[y];v--,y--)f[y]=o[v],p[y]=i[v],a&&(m[y]=a[v]);for(e=new Map,t=new Array(y+1),c=y;c>=g;c--)b=u[c],l=e.get(b),t[c]=void 0===l?-1:l,e.set(b,c);for(l=g;l<=v;l++)b=r[l],c=e.get(b),void 0!==c&&-1!==c?(f[c]=o[l],p[c]=i[l],a&&(m[c]=a[l]),c=t[c],e.set(b,c)):i[l]();for(c=g;c<d;c++)c in f?(o[c]=f[c],i[c]=p[c],a&&(a[c]=m[c],a[c](c))):o[c]=Ne(h);o=o.slice(0,s=d),r=u.slice(0)}return o}));function h(e){if(i[c]=e,a){const[e,n]=De(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 St(e){return Re(function(e,t,n={}){let r,o=[],i=[],s=[],a=[],l=0;return $e((()=>ct(s))),()=>{const c=e()||[],u=c.length;return Le((()=>{if(0===u)return 0!==l&&(ct(s),s=[],o=[],i=[],l=0,a=[]),n.fallback&&(o=[lt],i[0]=Ne((e=>(s[0]=e,n.fallback()))),l=1),i;for(o[0]===lt&&(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]=Ne(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]=De(c[r]);return a[r]=o,t(n,r)}}}((()=>e.each),e.children,"fallback"in e&&{fallback:()=>e.fallback}||void 0))}function Ct(e){const t=e.keyed,n=Re((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return Re((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?Le((()=>o(t?r:()=>{if(!Le(n))throw xt("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}function kt(e){let t=!1;const n=He((()=>e.children)),r=Re((()=>{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 Re((()=>{const[n,o,i]=r();if(n<0)return e.fallback;const s=i.children;return"function"==typeof s&&s.length>0?Le((()=>s(t?o:()=>{if(Le(r)[0]!==n)throw xt("Match");return i.when}))):s}),void 0,void 0)}function Et(e){return e}var jt=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"]),Pt=new Set(["innerHTML","textContent","innerText","children"]),Tt=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Nt=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 Dt=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),_t=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"]),Mt={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};var Ot="_$DX_DELEGATE";function Rt(e,t,n,r={}){let o;return Ne((r=>{o=r,t===document?e():Ut(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function At(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 Lt(e,t=window.document){const n=t[Ot]||(t[Ot]=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,Wt))}}function It(e,t,n){Vt(e)||(null==n?e.removeAttribute(t):e.setAttribute(t,n))}function Ft(e,t){Vt(e)||(null==t?e.removeAttribute("class"):e.className=t)}function $t(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 qt(e,t={},n,r){const o={};return r||Me((()=>o.children=Gt(e,t.children,o.children))),Me((()=>"function"==typeof t.ref&&zt(t.ref,e))),Me((()=>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]=Ht(e,s,null,o[s],n,i,t)}for(const s in t){if("children"===s)continue;o[s]=Ht(e,s,t[s],o[s],n,i,t)}}(e,t,n,0,o,!0))),o}function zt(e,t,n){return Le((()=>e(t,n)))}function Ut(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return Gt(e,t,r,n);Me((r=>Gt(e,t(),r,n)),r)}function Bt(e){let t,n;return Vt()&&(t=he.registry.get(n=he.getNextContextId()))?(he.completed&&he.completed.add(t),he.registry.delete(n),t):e()}function Vt(e){return!!he.context&&!he.done&&(!e||e.isConnected)}function Kt(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 Ht(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?It(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]&&(Kt(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&&(Kt(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=Dt.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&($t(e,o,n,i),i&&Lt([o]))}else if("attr:"===t.slice(0,5))It(e,t.slice(5),n);else if("bool:"===t.slice(0,5))!function(e,t,n){Vt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}(e,t.slice(5),n);else if((d="prop:"===t.slice(0,5))||(c=Pt.has(t))||!o&&((u=function(e,t){const n=Nt[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(l=jt.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),l=!0;else if(Vt(e))return n;"class"===t||"className"===t?Ft(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&&Mt[t.split(":")[0]];r?function(e,t,n,r){Vt(e)||(null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}(e,r,t,n):It(e,Tt[t]||t,n)}var h;return n}function Wt(e){if(he.registry&&he.events&&he.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}),he.registry&&!he.done&&(he.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 Gt(e,t,n,r,o){const i=Vt(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=Xt(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=Xt(e,n,r)}else{if("function"===s)return Me((()=>{let o=t();for(;"function"==typeof o;)o=o();n=Gt(e,o,n,r)})),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(Yt(s,t,n,o))return Me((()=>n=Gt(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=Xt(e,n,r),a)return n}else l?0===n.length?Qt(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&&Xt(e),Qt(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=Xt(e,n,r,t);Xt(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function Yt(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=Yt(e,a,l)||o;else if("function"===s)if(r){for(;"function"==typeof a;)a=a();o=Yt(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 Qt(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Xt(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 Jt(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Zt(e){const{useShadow:t}=e,n=document.createTextNode(""),r=qe();let o,i=!!he.context;return Oe((()=>{i&&(qe().user=i=!1),o||(o=function(e,t){const n=Ce,r=Ee;Ce=e,Ee=null;try{return Je(t,!0)}catch(o){it(o)}finally{Ce=n,Ee=r}}(r,(()=>Re((()=>e.children)))));const s=e.mount||document.body;if(s instanceof HTMLHeadElement){const[e,t]=De(!1),n=()=>t(!0);Ne((t=>Ut(s,(()=>e()?t():o()),null))),$e(n)}else{const r=Jt(e.isSVG?"g":"div",e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Ut(i,o),s.appendChild(r),e.ref&&e.ref(r),$e((()=>s.removeChild(r)))}}),void 0,{render:!i}),n}function en(e){const[t,n]=gt(e,["component"]),r=Re((()=>t.component));return Re((()=>{const e=r();switch(typeof e){case"function":return Le((()=>e(n)));case"string":const t=_t.has(e),r=he.context?Bt():Jt(e,t);return qt(r,n,t),r}}))}var tn=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()}},nn=class{constructor(e){this.generateIdentifier=e,this.kv=new tn}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)}},rn=class extends nn{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 on(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 sn(e,t){Object.entries(e).forEach((([e,n])=>t(n,e)))}function an(e,t){return-1!==e.indexOf(t)}function ln(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var cn=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return on(this.transfomers,(t=>t.isApplicable(e)))}findByName(e){return this.transfomers[e]}},un=e=>void 0===e,dn=e=>"object"==typeof e&&null!==e&&(e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype)),hn=e=>dn(e)&&0===Object.keys(e).length,fn=e=>Array.isArray(e),pn=e=>e instanceof Map,mn=e=>e instanceof Set,gn=e=>"Symbol"===(e=>Object.prototype.toString.call(e).slice(8,-1))(e),vn=e=>"number"==typeof e&&isNaN(e),yn=e=>(e=>"boolean"==typeof e)(e)||(e=>null===e)(e)||un(e)||(e=>"number"==typeof e&&!isNaN(e))(e)||(e=>"string"==typeof e)(e)||gn(e),bn=e=>e.replace(/\./g,"\\."),xn=e=>e.map(String).map(bn).join("."),wn=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 Sn(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var Cn=[Sn(un,"undefined",(()=>null),(()=>{})),Sn((e=>"bigint"==typeof e),"bigint",(e=>e.toString()),(e=>"undefined"!=typeof BigInt?BigInt(e):e)),Sn((e=>e instanceof Date&&!isNaN(e.valueOf())),"Date",(e=>e.toISOString()),(e=>new Date(e))),Sn((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})),Sn((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)})),Sn(mn,"set",(e=>[...e.values()]),(e=>new Set(e))),Sn(pn,"map",(e=>[...e.entries()]),(e=>new Map(e))),Sn((e=>{return vn(e)||((t=e)===1/0||t===-1/0);var t}),"number",(e=>vn(e)?"NaN":e>0?"Infinity":"-Infinity"),Number),Sn((e=>0===e&&1/e==-1/0),"number",(()=>"-0"),Number),Sn((e=>e instanceof URL),"URL",(e=>e.toString()),(e=>new URL(e)))];function kn(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var En=kn(((e,t)=>{if(gn(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})),jn=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(((e,t)=>(e[t.name]=t,e)),{}),Pn=kn((e=>ArrayBuffer.isView(e)&&!(e instanceof DataView)),(e=>["typed-array",e.constructor.name]),(e=>[...e]),((e,t)=>{const n=jn[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)}));function Tn(e,t){if(e?.constructor){return!!t.classRegistry.getIdentifier(e.constructor)}return!1}var Nn=kn(Tn,((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)})),Dn=kn(((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)})),_n=[Nn,En,Dn,Pn],Mn=(e,t)=>{const n=ln(_n,(n=>n.isApplicable(e,t)));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=ln(Cn,(n=>n.isApplicable(e,t)));return r?{value:r.transform(e,t),type:r.annotation}:void 0},On={};Cn.forEach((e=>{On[e.annotation]=e}));var Rn=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function An(e){if(an(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(an(e,"prototype"))throw new Error("prototype is not allowed as a property");if(an(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Ln=(e,t,n)=>{if(An(t),0===t.length)return n(e);let r=e;for(let i=0;i<t.length-1;i++){const e=t[i];if(fn(r)){r=r[+e]}else if(dn(r))r=r[e];else if(mn(r)){r=Rn(r,+e)}else if(pn(r)){if(i===t.length-2)break;const n=0==+t[++i]?"key":"value",o=Rn(r,+e);switch(n){case"key":r=o;break;case"value":r=r.get(o)}}}const o=t[t.length-1];if(fn(r)?r[+o]=n(r[+o]):dn(r)&&(r[o]=n(r[o])),mn(r)){const e=Rn(r,+o),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(pn(r)){const e=Rn(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 In(e,t,n=[]){if(!e)return;if(!fn(e))return void sn(e,((e,r)=>In(e,t,[...n,...wn(r)])));const[r,o]=e;o&&sn(o,((e,r)=>{In(e,t,[...n,...wn(r)])})),t(r,n)}function Fn(e,t,n){return In(t,((t,r)=>{e=Ln(e,r,(e=>((e,t,n)=>{if(!fn(t)){const r=On[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}switch(t[0]){case"symbol":return En.untransform(e,t,n);case"class":return Nn.untransform(e,t,n);case"custom":return Dn.untransform(e,t,n);case"typed-array":return Pn.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}})(e,t,n)))})),e}function $n(e,t){function n(t,n){const r=((e,t)=>{An(t);for(let n=0;n<t.length;n++){const r=t[n];if(mn(e))e=Rn(e,+r);else if(pn(e)){const o=0==+t[++n]?"key":"value",i=Rn(e,+r);switch(o){case"key":e=i;break;case"value":e=e.get(i)}}else e=e[r]}return e})(e,wn(n));t.map(wn).forEach((t=>{e=Ln(e,t,(()=>r))}))}if(fn(t)){const[r,o]=t;r.forEach((t=>{e=Ln(e,wn(t),(()=>e))})),o&&sn(o,n)}else sn(t,n);return e}var qn=(e,t,n,r,o=[],i=[],s=new Map)=>{const a=yn(e);if(!a){!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)=>dn(e)||fn(e)||pn(e)||mn(e)||Tn(e,t))(e,n)){const t=Mn(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return a||s.set(e,r),r}if(an(i,e))return{transformedValue:null};const l=Mn(e,n),c=l?.value??e,u=fn(c)?[]:{},d={};sn(c,((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=qn(a,t,n,r,[...o,l],[...i,e],s);u[l]=c.transformedValue,fn(c.annotations)?d[l]=c.annotations:dn(c.annotations)&&sn(c.annotations,((e,t)=>{d[bn(l)+"."+t]=e}))}));const h=hn(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return a||s.set(e,h),h};function zn(e){return Object.prototype.toString.call(e).slice(8,-1)}function Un(e){return"Array"===zn(e)}function Bn(e,t={}){if(Un(e))return e.map((e=>Bn(e,t)));if(!function(e){if("Object"!==zn(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(Un(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,Bn(e[r],t),e,t.nonenumerable),n}),{})}var Vn=class{constructor({dedupe:e=!1}={}){this.classRegistry=new rn,this.symbolRegistry=new nn((e=>e.description??"")),this.customTransformerRegistry=new cn,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=qn(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(xn):n[xn(o)]=i.map(xn)})),r?hn(n)?[r]:[r,n]:hn(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=Bn(t);return n?.values&&(r=Fn(r,n.values,this)),n?.referentialEqualities&&(r=$n(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)}};Vn.defaultInstance=new Vn,Vn.serialize=Vn.defaultInstance.serialize.bind(Vn.defaultInstance),Vn.deserialize=Vn.defaultInstance.deserialize.bind(Vn.defaultInstance),Vn.stringify=Vn.defaultInstance.stringify.bind(Vn.defaultInstance),Vn.parse=Vn.defaultInstance.parse.bind(Vn.defaultInstance),Vn.registerClass=Vn.defaultInstance.registerClass.bind(Vn.defaultInstance),Vn.registerSymbol=Vn.defaultInstance.registerSymbol.bind(Vn.defaultInstance),Vn.registerCustom=Vn.defaultInstance.registerCustom.bind(Vn.defaultInstance),Vn.allowErrorProps=Vn.defaultInstance.allowErrorProps.bind(Vn.defaultInstance);var Kn=Vn.serialize,Hn=Vn.stringify;function Wn(e){return"fetching"===e.state.fetchStatus?"fetching":e.getObserversCount()?"paused"===e.state.fetchStatus?"paused":e.isStale()?"stale":"fresh":"inactive"}function Gn({status:e,isPaused:t}){return t?"purple":"error"===e?"red":"pending"===e?"yellow":"success"===e?"green":"gray"}var Yn=(e,t=!1)=>{const{json:n}=Kn(e);return JSON.stringify(n,null,t?2:void 0)},Qn=e=>"idle"!==e.state.fetchStatus?0:e.getObserversCount()?e.isStale()?2:1:3,Xn=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,Jn={status:(e,t)=>Qn(e)===Qn(t)?Xn(e,t):Qn(e)>Qn(t)?1:-1,"query hash":(e,t)=>e.queryHash.localeCompare(t.queryHash),"last updated":Xn},Zn=e=>e.state.isPaused?0:"error"===e.state.status?2:"pending"===e.state.status?1:3,er=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,tr={status:(e,t)=>Zn(e)===Zn(t)?er(e,t):Zn(e)>Zn(t)?1:-1,"last updated":er},nr=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),rr=()=>{const[e,t]=De("dark");return Fe((()=>{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),$e((()=>e.removeEventListener("change",n)))})),e},or=(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,or(r.get(o),i,n)),r}if(e instanceof Set){const r=or(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]=or(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]=or(r[o],i,n),r}return e},ir=(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,ir(n.get(r),o)),n}if(e instanceof Set){const n=ir(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]=ir(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]=ir(n[r],o),n}return e},sr=(e,t)=>{if(!e)return;if(document.querySelector("#_goober")||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)},ar=class{#C;#Q;#X;#J;#Z=!1;#ee;#te;#ne;#re;#oe;#ie;#se;#ae;constructor(e){const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;this.#C=De(t),this.#X=n,this.#J=r,this.#Q=o,this.#ee=c,this.#te=u,this.#ne=De(i),this.#re=De(s),this.#oe=De(a),this.#ie=De(l)}setButtonPosition(e){this.#ne[1](e)}setPosition(e){this.#re[1](e)}setInitialIsOpen(e){this.#oe[1](e)}setErrorTypes(e){this.#ie[1](e)}setClient(e){this.#C[1](e)}mount(e){if(this.#Z)throw new Error("Devtools is already mounted");const t=Rt((()=>{const e=this,[t]=this.#ne,[n]=this.#re,[r]=this.#oe,[o]=this.#ie,[i]=this.#C;let s;return this.#se?s=this.#se:(s=vt((()=>Promise.resolve().then((()=>MY)))),this.#se=s),sr(this.#ee,this.#te),ut(s,mt({get queryFlavor(){return e.#X},get version(){return e.#J},get onlineManager(){return e.#Q},get shadowDOMTarget(){return e.#te}},{get client(){return i()},get buttonPosition(){return t()},get position(){return n()},get initialIsOpen(){return r()},get errorTypes(){return o()}}))}),e);this.#Z=!0,this.#ae=t}unmount(){if(!this.#Z)throw new Error("Devtools is not mounted");this.#ae?.(),this.#Z=!1}};var lr="development"!==process.env.NODE_ENV?function(){return null}:function(e){const n=ne(e.client),r=i.useRef(null),{buttonPosition:o,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e,[d]=i.useState(new ar({client:n,queryFlavor:"React Query",version:"5",onlineManager:D,buttonPosition:o,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}));return i.useEffect((()=>{d.setClient(n)}),[n,d]),i.useEffect((()=>{o&&d.setButtonPosition(o)}),[o,d]),i.useEffect((()=>{s&&d.setPosition(s)}),[s,d]),i.useEffect((()=>{d.setInitialIsOpen(a||!1)}),[a,d]),i.useEffect((()=>{d.setErrorTypes(l||[])}),[l,d]),i.useEffect((()=>(r.current&&d.mount(r.current),()=>{d.unmount()})),[d]),t.jsx("div",{className:"tsqd-parent-container",ref:r})};function cr(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 ur=cr("LaunchDarklyUnexpectedResponseError"),dr=cr("LaunchDarklyInvalidEnvironmentIdError"),hr=cr("LaunchDarklyInvalidUserError"),fr=cr("LaunchDarklyInvalidEventKeyError"),pr=cr("LaunchDarklyInvalidArgumentError"),mr=cr("LaunchDarklyFlagFetchError");for(var gr={LDUnexpectedResponseError:ur,LDInvalidEnvironmentIdError:dr,LDInvalidUserError:hr,LDInvalidEventKeyError:fr,LDInvalidArgumentError:pr,LDInvalidDataError:cr("LaunchDarklyInvalidDataError"),LDFlagFetchError:mr,LDTimeoutError:cr("LaunchDarklyTimeoutError"),isHttpErrorRecoverable:function(e){return!(e>=400&&e<500)||400===e||408===e||429===e}},vr=[],yr=[],br=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),xr=0;xr<64;++xr)vr[xr]=br[xr],yr[br.charCodeAt(xr)]=xr;function wr(e,t,n){for(var r,o=[],i=t;i<n;i+=3)o.push(vr[(r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+vr[r>>12&63]+vr[r>>6&63]+vr[63&r]);return o.join("")}yr["-".charCodeAt(0)]=62,yr["_".charCodeAt(0)]=63;var Sr=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(wr(e,s,s+i>a?a:s+i));return 1===r?o.push(vr[(t=e[n-1])>>2]+vr[t<<4&63]+"=="):2===r&&o.push(vr[(t=(e[n-2]<<8)+e[n-1])>>10]+vr[t>>4&63]+vr[t<<2&63]+"="),o.join("")},Cr=Array.isArray,kr=Object.keys,Er=Object.prototype.hasOwnProperty,jr=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,o,i,s=Cr(t),a=Cr(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=kr(t);if((o=h.length)!==kr(n).length)return!1;for(r=o;0!=r--;)if(!Er.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 Pr=["key","ip","country","email","firstName","lastName","avatar","name"];function Tr(e){const t=unescape(encodeURIComponent(e));return Sr(function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return t}(t))}function Nr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Dr,_r={appendUrlPath:function(e,t){return(e.endsWith("/")?e.substring(0,e.length-1):e)+(t.startsWith("/")?"":"/")+t},base64URLEncode:function(e){return Tr(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},btoa:Tr,clone:function(e){return JSON.parse(JSON.stringify(e))},deepEquals:function(e,t){return jr(e,t)},extend:function(...e){return e.reduce(((e,t)=>({...e,...t})),{})},getLDUserAgentString:function(e){return e.userAgent+"/"+(e.version||"?")},objectHasOwnProperty:Nr,onNextTick:function(e){setTimeout(e,0)},sanitizeContext:function(e){if(!e)return e;let t;return null!=e.kind||Pr.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)Nr(e,n)&&(t[n]={value:e[n],version:0});return t},transformVersionedValuesToValues:function(e){const t={};for(const n in e)Nr(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}},Mr=new Uint8Array(16);function Or(){if(!Dr&&!(Dr="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 Dr(Mr)}var Rr=/^(?:[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 Ar(e){return"string"==typeof e&&Rr.test(e)}for(var Lr,Ir,Fr=[],$r=0;$r<256;++$r)Fr.push(($r+256).toString(16).substr(1));function qr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Fr[e[t+0]]+Fr[e[t+1]]+Fr[e[t+2]]+Fr[e[t+3]]+"-"+Fr[e[t+4]]+Fr[e[t+5]]+"-"+Fr[e[t+6]]+Fr[e[t+7]]+"-"+Fr[e[t+8]]+Fr[e[t+9]]+"-"+Fr[e[t+10]]+Fr[e[t+11]]+Fr[e[t+12]]+Fr[e[t+13]]+Fr[e[t+14]]+Fr[e[t+15]]).toLowerCase();if(!Ar(n))throw TypeError("Stringified UUID is invalid");return n}var zr=0,Ur=0;function Br(e){if(!Ar(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 Vr(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=Br(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 qr(s)}try{r.name=e}catch(o){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function Kr(e){return 14+(e+64>>>9<<4)+1}function Hr(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Wr(e,t,n,r,o,i){return Hr((s=Hr(Hr(t,e),Hr(r,i)))<<(a=o)|s>>>32-a,n);var s,a}function Gr(e,t,n,r,o,i,s){return Wr(t&n|~t&r,e,t,o,i,s)}function Yr(e,t,n,r,o,i,s){return Wr(t&r|n&~r,e,t,o,i,s)}function Qr(e,t,n,r,o,i,s){return Wr(t^n^r,e,t,o,i,s)}function Xr(e,t,n,r,o,i,s){return Wr(n^(t|~r),e,t,o,i,s)}var Jr=Vr("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[Kr(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=Gr(n,r,o,i,e[s],7,-680876936),i=Gr(i,n,r,o,e[s+1],12,-389564586),o=Gr(o,i,n,r,e[s+2],17,606105819),r=Gr(r,o,i,n,e[s+3],22,-1044525330),n=Gr(n,r,o,i,e[s+4],7,-176418897),i=Gr(i,n,r,o,e[s+5],12,1200080426),o=Gr(o,i,n,r,e[s+6],17,-1473231341),r=Gr(r,o,i,n,e[s+7],22,-45705983),n=Gr(n,r,o,i,e[s+8],7,1770035416),i=Gr(i,n,r,o,e[s+9],12,-1958414417),o=Gr(o,i,n,r,e[s+10],17,-42063),r=Gr(r,o,i,n,e[s+11],22,-1990404162),n=Gr(n,r,o,i,e[s+12],7,1804603682),i=Gr(i,n,r,o,e[s+13],12,-40341101),o=Gr(o,i,n,r,e[s+14],17,-1502002290),n=Yr(n,r=Gr(r,o,i,n,e[s+15],22,1236535329),o,i,e[s+1],5,-165796510),i=Yr(i,n,r,o,e[s+6],9,-1069501632),o=Yr(o,i,n,r,e[s+11],14,643717713),r=Yr(r,o,i,n,e[s],20,-373897302),n=Yr(n,r,o,i,e[s+5],5,-701558691),i=Yr(i,n,r,o,e[s+10],9,38016083),o=Yr(o,i,n,r,e[s+15],14,-660478335),r=Yr(r,o,i,n,e[s+4],20,-405537848),n=Yr(n,r,o,i,e[s+9],5,568446438),i=Yr(i,n,r,o,e[s+14],9,-1019803690),o=Yr(o,i,n,r,e[s+3],14,-187363961),r=Yr(r,o,i,n,e[s+8],20,1163531501),n=Yr(n,r,o,i,e[s+13],5,-1444681467),i=Yr(i,n,r,o,e[s+2],9,-51403784),o=Yr(o,i,n,r,e[s+7],14,1735328473),n=Qr(n,r=Yr(r,o,i,n,e[s+12],20,-1926607734),o,i,e[s+5],4,-378558),i=Qr(i,n,r,o,e[s+8],11,-2022574463),o=Qr(o,i,n,r,e[s+11],16,1839030562),r=Qr(r,o,i,n,e[s+14],23,-35309556),n=Qr(n,r,o,i,e[s+1],4,-1530992060),i=Qr(i,n,r,o,e[s+4],11,1272893353),o=Qr(o,i,n,r,e[s+7],16,-155497632),r=Qr(r,o,i,n,e[s+10],23,-1094730640),n=Qr(n,r,o,i,e[s+13],4,681279174),i=Qr(i,n,r,o,e[s],11,-358537222),o=Qr(o,i,n,r,e[s+3],16,-722521979),r=Qr(r,o,i,n,e[s+6],23,76029189),n=Qr(n,r,o,i,e[s+9],4,-640364487),i=Qr(i,n,r,o,e[s+12],11,-421815835),o=Qr(o,i,n,r,e[s+15],16,530742520),n=Xr(n,r=Qr(r,o,i,n,e[s+2],23,-995338651),o,i,e[s],6,-198630844),i=Xr(i,n,r,o,e[s+7],10,1126891415),o=Xr(o,i,n,r,e[s+14],15,-1416354905),r=Xr(r,o,i,n,e[s+5],21,-57434055),n=Xr(n,r,o,i,e[s+12],6,1700485571),i=Xr(i,n,r,o,e[s+3],10,-1894986606),o=Xr(o,i,n,r,e[s+10],15,-1051523),r=Xr(r,o,i,n,e[s+1],21,-2054922799),n=Xr(n,r,o,i,e[s+8],6,1873313359),i=Xr(i,n,r,o,e[s+15],10,-30611744),o=Xr(o,i,n,r,e[s+6],15,-1560198380),r=Xr(r,o,i,n,e[s+13],21,1309151649),n=Xr(n,r,o,i,e[s+4],6,-145523070),i=Xr(i,n,r,o,e[s+11],10,-1120210379),o=Xr(o,i,n,r,e[s+2],15,718787259),r=Xr(r,o,i,n,e[s+9],21,-343485551),n=Hr(n,a),r=Hr(r,l),o=Hr(o,c),i=Hr(i,u)}return[n,r,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(Kr(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}));function Zr(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 eo(e,t){return e<<t|e>>>32-t}var to=Vr("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]=eo(d[f-3]^d[f-8]^d[f-14]^d[f-16],1);for(var p=n[0],m=n[1],g=n[2],v=n[3],y=n[4],b=0;b<80;++b){var x=Math.floor(b/20),w=eo(p,5)+Zr(x,m,g,v)+y+t[x]+d[b]>>>0;y=v,v=g,g=eo(m,30)>>>0,m=p,p=w}n[0]=n[0]+p>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+g>>>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]]})),no=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||Lr,s=void 0!==e.clockseq?e.clockseq:Ir;if(null==i||null==s){var a=e.random||(e.rng||Or)();null==i&&(i=Lr=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=Ir=16383&(a[6]<<8|a[7]))}var l=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:Ur+1,u=l-zr+(c-Ur)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||l>zr)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");zr=l,Ur=c,Ir=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||qr(o)},v3:Jr,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||Or)();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 qr(r)},v5:to,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Ar(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Ar,stringify:qr,parse:Br});const ro=["debug","info","warn","error","none"];var oo={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<ro.length;c++)ro[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<ro.length;c++){const e=ro[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){ro.forEach((t=>{if("none"!==t&&(!e[t]||"function"!=typeof e[t]))throw new Error("Provided logger instance must support logger."+t+"(...) method")}))}};function io(e){return e&&e.message?e.message:"string"==typeof e||e instanceof String?e:JSON.stringify(e)}const so=" Please see https://docs.launchdarkly.com/sdk/client-side/javascript#initialize-the-client for instructions on SDK initialization.";var ao=function(){return"LaunchDarkly bootstrap data is not available because the back end could not read the flags."},lo=function(){return"LaunchDarkly client was initialized with bootstrap data that did not include flag metadata. Events may not be sent correctly."+so},co=function(){return"LaunchDarkly client initialized"},uo=function(e){return'enqueueing "'+e+'" event'},ho=function(e){return"sending diagnostic event ("+e.kind+")"},fo=function(e){return"sending "+e+" events"},po=function(e){return'received streaming deletion for flag "'+e+'"'},mo=function(e){return'received streaming deletion for flag "'+e+'" but ignored due to version check'},go=function(e){return'received streaming update for flag "'+e+'"'},vo=function(e){return'received streaming update for flag "'+e+'" but ignored due to version check'},yo=function(){return"received ping message from stream"},bo=function(e){return"polling for feature flags at "+e},xo=function(){return"received streaming update for all flags"},wo=function(e,t){return t?'"'+e+'" is deprecated, please use "'+t+'"':'"'+e+'" is deprecated'},So=function(){return"Environment not found. Double check that you specified a valid environment/client-side ID."+so},Co=function(){return"No environment/client-side ID was specified."+so},ko=function(e){return"Error fetching flag settings: "+io(e)},Eo=function(){return"Exceeded event queue capacity. Increase capacity to avoid dropping events."},jo=function(){return"Be sure to call `identify` in the LaunchDarkly client: https://docs.launchdarkly.com/sdk/features/identify#javascript"},Po=function(e,t,n){return"Received error "+e+(401===e?" (invalid SDK key)":"")+" for "+t+" - "+(gr.isHttpErrorRecoverable(e)?n:"giving up permanently")},To=function(){return"Cannot make HTTP requests in this environment."+so},No=function(){return"identify() has no effect here; it must be called on the main client instance"},Do=(e,t)=>`an inspector: "${t}" of type: "${e}" generated an exception`,_o=function(e){return'Expected application/json content type but got "'+e+'"'},Mo=function(){return"Invalid data received from LaunchDarkly; connection may have been interrupted"},Oo=(e,t)=>`an inspector: "${t}" of an invalid type (${e}) was configured`,Ro=e=>`The track function was called with a non-numeric "metricValue" (${e}), only numeric metric values are supported.`,Ao=function(){return"Invalid context specified."+so},Lo=e=>`Config option "${e}" must only contain letters, numbers, ., _ or -.`,Io=function(e){return"local storage is unavailable: "+io(e)},Fo=e=>"network error"+(e?" ("+e+")":""),$o=(e,t,n)=>'Config option "'+e+'" was set to '+t+", changing to minimum value of "+n,qo=function(){return"Closing stream connection"},zo=function(e){return"Opening stream connection to "+e},Uo=function(e,t){return"Error on stream connection: "+io(e)+", will continue retrying after "+t+" milliseconds."},Bo=e=>`Value of "${e}" was longer than 64 characters and was discarded.`,Vo=function(e){return'Custom event "'+e+'" does not exist'},Ko=e=>'Ignoring unknown config option "'+e+'"',Ho=function(){return"No context specified."+so},Wo=e=>`Error on stream connection ${io(e)}, giving up permanently`,Go=(e,t,n)=>'Config option "'+e+'" should be of type '+t+", got "+n+", using default value",Yo=(e,t)=>'Config option "'+e+'" should be a boolean, got '+t+", converting to boolean";const{validateLogger:Qo}=oo,Xo={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=ei(`${e}.id`,t.id,n)),t.version&&(r.version=ei(`${e}.version`,t.version,n)),r}},inspectors:{default:[]}},Jo=/^(\w|\.|-)+$/;function Zo(e){return e&&e.replace(/\/+$/,"")}function ei(e,t,n){if("string"==typeof t&&t.match(Jo)){if(!(t.length>64))return t;n.warn(Bo(e))}else n.warn(Lo(e))}var ti={baseOptionDefs:Xo,validate:function(e,t,n,r){const o=_r.extend({logger:{default:r}},Xo,n),i={};function s(e){_r.onNextTick((()=>{t&&t.maybeReportError(new gr.LDInvalidArgumentError(e))}))}let a=_r.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(wo(e,n)),n&&(void 0===t[n]&&(t[n]=t[e]),delete t[e])}}))}(a),a=function(e){const t=_r.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=_r.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(Ko(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(Yo(i,r))):(s(Go(i,o,r)),t[i]=l.default):"number"===r&&void 0!==l.minimum&&a<l.minimum&&(s($o(i,a,l.minimum)),t[i]=l.minimum)}}}})),t.baseUrl=Zo(t.baseUrl),t.streamUrl=Zo(t.streamUrl),t.eventsUrl=Zo(t.eventsUrl),t}(a),Qo(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:ni}=_r;var ri={getLDHeaders:function(e,t){if(t&&!t.sendLDHeaders)return{};const n={};n[e.userAgentHeaderName||"User-Agent"]=ni(e),t&&t.wrapperName&&(n["X-LaunchDarkly-Wrapper"]=t.wrapperVersion?t.wrapperName+"/"+t.wrapperVersion:t.wrapperName);const r=ti.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:oi}=no,{getLDHeaders:ii,transformHeaders:si}=ri;var ai=function(e,t,n){const r=_r.extend({"Content-Type":"application/json"},ii(e,n)),o={sendEvents:(t,o,i)=>{if(!e.httpRequest)return Promise.resolve();const s=JSON.stringify(t),a=i?null:oi();return function t(l){const c=i?r:_r.extend({},r,{"X-LaunchDarkly-Event-Schema":"4","X-LaunchDarkly-Payload-ID":a});return e.httpRequest("POST",o,si(c,n),s).promise.then((e=>{if(e)return e.status>=400&&gr.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:li}=oo;function ci(e){return"string"==typeof e&&"kind"!==e&&e.match(/^(\w|\.|-)+$/)}var ui={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=ci(r),i="multi"===r||null!=n&&""!==n;if("multi"===r){const t=Object.keys(e).filter((e=>"kind"!==e));return i&&t.every((e=>ci(e)))&&t.every((t=>{const n=e[t].key;return null!=n&&""!==n}))}return i&&o}return!1},getContextKeys:function(e,t=li()){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:di}=ui;function hi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function fi(e){return(e.startsWith("/")?e.substring(1):e).split("/").map((e=>e.indexOf("~")>=0?e.replace(/~1/g,"/").replace(/~0/g,"~"):e))}function pi(e){return!e.startsWith("/")}function mi(e,t){const n=pi(e),r=pi(t);if(n&&r)return e===t;if(n){const n=fi(t);return 1===n.length&&e===n[0]}if(r){const n=fi(e);return 1===n.length&&t===n[0]}return e===t}function gi(e){return`/${hi(e)}`}var vi={cloneExcluding:function(e,t){const n=[],r={},o=[];for(n.push(...Object.keys(e).map((t=>({key:t,ptr:gi(t),source:e,parent:r,visited:[e]}))));n.length;){const e=n.pop();if(t.some((t=>mi(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=hi(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:mi,literalToReference:gi};const{getContextKeys:yi}=ui;var bi=function(e,t,n,r=null,o=null,i=null){const s={},a=i||ai(e,0,t),l=_r.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?di(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}=vi.cloneExcluding(e,(a=e,(n||t&&a.anonymous?Object.keys(a):[...r,...a._meta&&a._meta.privateAttributes||[]]).filter((e=>!o.some((t=>vi.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("/")?vi.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 m,g=[],v=0,y=!1,b=!1;function x(){return 0===d||0===Math.floor(Math.random()*d)}function w(e){g.length<h?(g.push(e),b=!1):(b||(b=!0,p.warn(Eo())),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?x()&&(t=!!e.trackEvents,n=!!(r=e).debugEventsUntilDate&&r.debugEventsUntilDate>v&&r.debugEventsUntilDate>(new Date).getTime()):t=x(),t&&w(function(e){const t=_r.extend({},e);return"identify"===e.kind?t.context=u.filter(e.context):"feature"===e.kind?t.context=u.filter(e.context,!0):(t.contextKeys=yi(e.context,p),delete t.context),"feature"===e.kind&&(delete t.trackEvents,delete t.debugEventsUntilDate),t}(e)),n){const t=_r.extend({},e,{kind:"debug"});t.context=u.filter(t.context),delete t.trackEvents,delete t.debugEventsUntilDate,w(t)}},s.flush=function(){if(y)return Promise.resolve();const e=g,t=c.getSummary();return c.clearSummary(),t&&(t.kind="summary",e.push(t)),r&&r.setEventsInLastBatch(e.length),0===e.length?Promise.resolve():(g=[],p.debug(fo(e.length)),a.sendEvents(e,l).then((e=>{e&&(e.serverTime&&(v=e.serverTime),gr.isHttpErrorRecoverable(e.status)||(y=!0),e.status>=400&&_r.onNextTick((()=>{o.maybeReportError(new gr.LDUnexpectedResponseError(Po(e.status,"event posting","some events were dropped")))})))})))},s.start=function(){const e=()=>{s.flush(),m=setTimeout(e,f)};m=setTimeout(e,f)},s.stop=function(){clearTimeout(m)},s};const xi="ready",wi="initialized",Si="failed";const{appendUrlPath:Ci,base64URLEncode:ki,objectHasOwnProperty:Ei}=_r,{getLDHeaders:ji,transformHeaders:Pi}=ri,{isHttpErrorRecoverable:Ti}=gr;var Ni=function(e,t,n,r){const o=t.streamUrl,i=t.logger,s={},a=Ci(o,"/eval/"+n),l=t.useReport,c=t.evaluationReasons,u=t.streamReconnectDelay,d=ji(e,t);let h,f=!1,p=null,m=null,g=null,v=null,y=null,b=0;function x(e){if(e.status&&"number"==typeof e.status&&!Ti(e.status))return C(),i.error(Wo(e)),void(m&&(clearTimeout(m),m=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(Uo(e,t)),f=!0),k(!1),C(),w(t)}function w(e){m||(e?m=setTimeout(S,e):S())}function S(){let r;m=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(g)):(r=Ci(o,"/ping/"+n),s=""):r=a+"/"+ki(JSON.stringify(g)),u.headers=Pi(u.headers,t),c&&(s=s+(s?"&":"")+"withReasons=true"),r=r+(s?"?":"")+s,C(),i.info(zo(r)),h=(new Date).getTime(),p=e.eventSourceFactory(r,u);for(const e in y)Ei(y,e)&&p.addEventListener(e,y[e]);p.onerror=x,p.onopen=()=>{b=0}}}function C(){p&&(i.info(qo()),p.close(),p=null)}function k(e){h&&r&&r.recordStreamInit(h,!e,(new Date).getTime()-h),h=null}return s.connect=function(e,t,n){g=e,v=t,y={};for(const r in n||{})y[r]=function(e){f=!1,k(!0),n[r]&&n[r](e)};w()},s.disconnect=function(){clearTimeout(m),m=null,C()},s.isConnected=function(){return!!(p&&e.eventSourceIsActive&&e.eventSourceIsActive(p))},s};const{transformHeaders:Di,getLDHeaders:_i}=ri,Mi="application/json";var Oi=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 gr.LDFlagFetchError(To()))}));const o=r?"REPORT":"GET",i=_i(e,t);r&&(i["Content-Type"]=Mi);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,Di(i,t),r),c=a.promise.then((e=>{if(200===e.status){if(e.header("content-type")&&e.header("content-type").substring(0,16)===Mi)return JSON.parse(e.body);{const t=_o(e.header("content-type")||"");return Promise.reject(new gr.LDFlagFetchError(t))}}return Promise.reject(404===(t=e).status?new gr.LDInvalidEnvironmentIdError(So()):new gr.LDFlagFetchError(ko(t.statusText||String(t.status))));var t}),(e=>Promise.reject(new gr.LDFlagFetchError(Fo(e)))));return s.addPromise(c,(()=>{a.cancel&&a.cancel()})),s.resultPromise}return a.fetchJSON=function(e){return c(_r.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=_r.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(bo(l)),c(l,u)},a};const{v1:Ri}=no,{getContextKinds:Ai}=ui;var Li=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=Ri();return r.key=o,function(n,r){return e.set(t(r),n)}(o,n).then((()=>r))}})):Promise.reject(new gr.LDInvalidUserError(Ao()));var o}this.processContext=e=>{if(!e)return Promise.reject(new gr.LDInvalidUserError(Ho()));const t=_r.clone(e);if("multi"===e.kind){const e=Ai(t);return Promise.all(e.map((e=>n(e,t[e])))).then((()=>t))}return n(e.kind,t)}};const{v1:Ii}=no,{baseOptionDefs:Fi}=ti,{appendUrlPath:$i}=_r;var qi=function(e){const t={diagnosticId:Ii()};return e&&(t.sdkKeySuffix=e.length>6?e.substring(e.length-6):e),t},zi=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}},Ui=function(e,t,n,r,o,i,s){const a=!!e.diagnosticUseCombinedEvent,l="ld:"+o+":$diagnostics",c=$i(i.eventsUrl,"/events/diagnostic/"+o),u=i.diagnosticRecordingInterval,d=n;let h,f,p=!!i.streaming;const m={};function g(){return{sdk:b(),configuration:{customBaseURI:i.baseUrl!==Fi.baseUrl.default,customStreamURI:i.streamUrl!==Fi.streamUrl.default,customEventsURI:i.eventsUrl!==Fi.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(ho(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,...g()}),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 m.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,...g()}),f=setTimeout(y,u))},m.stop=()=>{f&&clearTimeout(f)},m.setStreaming=e=>{p=e},m};const{onNextTick:Bi}=_r,Vi={flagUsed:"flag-used",flagDetailsChanged:"flag-details-changed",flagDetailChanged:"flag-detail-changed",clientIdentityChanged:"client-identity-changed"};Object.freeze(Vi);var Ki={InspectorTypes:Vi,InspectorManager:function(e,t){const n={},r={[Vi.flagUsed]:[],[Vi.flagDetailsChanged]:[],[Vi.flagDetailChanged]:[],[Vi.clientIdentityChanged]:[]},o={[Vi.flagUsed]:[],[Vi.flagDetailsChanged]:[],[Vi.flagDetailChanged]:[],[Vi.clientIdentityChanged]:[]},i=e&&e.map((e=>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(Do(r.type,r.name)))}}};return r}(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(Oo(e.type,e.name))})),n.hasListeners=e=>r[e]&&r[e].length||o[e]&&o[e].length,n.onFlagUsed=(e,t,n)=>{const i=Vi.flagUsed;o[i].length&&o[i].forEach((r=>r.method(e,t,n))),r[i].length&&Bi((()=>{r[i].forEach((r=>r.method(e,t,n)))}))},n.onFlags=e=>{const t=Vi.flagDetailsChanged;o[t].length&&o[t].forEach((t=>t.method(e))),r[t].length&&Bi((()=>{r[t].forEach((t=>t.method(e)))}))},n.onFlagChanged=(e,t)=>{const n=Vi.flagDetailChanged;o[n].length&&o[n].forEach((n=>n.method(e,t))),r[n].length&&Bi((()=>{r[n].forEach((n=>n.method(e,t)))}))},n.onIdentityChanged=e=>{const t=Vi.clientIdentityChanged;o[t].length&&o[t].forEach((t=>t.method(e))),r[t].length&&Bi((()=>{r[t].forEach((t=>t.method(e)))}))},n}};const{LDTimeoutError:Hi}=gr;const{commonBasicLogger:Wi}=oo,{checkContext:Gi}=ui,{InspectorTypes:Yi,InspectorManager:Qi}=Ki,Xi="change",Ji="internal-change";var Zi={initialize:function(e,t,n,r,o){const i=n&&n.logger?n.logger:o&&o.logger&&o.logger.default||Wi("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(xi,n),t()};e.on(xi,n)})).catch((()=>{}));return{getInitializationPromise:()=>o||(t?Promise.resolve():n?Promise.reject(r):(o=new Promise(((t,n)=>{const r=()=>{e.off(wi,r),t()},o=t=>{e.off(Si,o),n(t)};e.on(wi,r),e.on(Si,o)})),o)),getReadyPromise:()=>i,signalSuccess:()=>{t||n||(t=!0,e.emit(wi),e.emit(xi))},signalFailure:o=>{t||n||(n=!0,r=o,e.emit(Si,o),e.emit(xi)),e.maybeReportError(o)}}}(s),l=ti.validate(n,s,o,i),c=Qi(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(Io(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=ai(r,0,l),m=l.sendEvents&&!l.diagnosticOptOut,g=m?qi(d):null,v=m?zi((new Date).getTime()):null,y=m?Ui(r,f,v,p,d,l,g):null,b=Ni(r,l,d,v),x=l.eventProcessor||bi(r,l,d,v,s,p),w=Oi(r,l,d);let S,C,k,E={},j=l.streaming,P=!1,T=!1,N=!0;const D=l.stateProvider,_=function(e,t){const n={};let r;return n.setContext=function(e){r=_r.sanitizeContext(e),r&&t&&t(_r.clone(r))},n.getContext=function(){return r?_r.clone(r):null},n}(0,(function(e){var t;t=e,D||t&&R({kind:"identify",context:t,creationDate:(new Date).getTime()}),c.hasListeners(Yi.clientIdentityChanged)&&c.onIdentityChanged(_.getContext())})),M=new Li(f),O=f.isEnabled()?function(e,t,n,r){const o={};function i(){let e="";const o=r.getContext();return o&&(e=n||_r.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=_r.transformValuesToVersionedValues(t):delete t.$schema}return t}catch(t){return o.clearFlags().then((()=>null))}})),o.saveFlags=t=>{const n=_r.extend({},t,{$schema:1});return e.set(i(),JSON.stringify(n))},o.clearFlags=()=>e.clear(i()),o}(f,d,h,_):null;function R(e){d&&(D&&D.enqueueEvent&&D.enqueueEvent(e)||(e.context?(N=!1,!u||T||r.isDoNotTrack()||(i.debug(uo(e.kind)),x.enqueue(e))):N&&(i.warn(jo()),N=!1)))}function A(e,t){c.hasListeners(Yi.flagDetailChanged)&&c.onFlagChanged(e.key,q(t))}function L(){c.hasListeners(Yi.flagDetailsChanged)&&c.onFlags(Object.entries(E).map((([e,t])=>({key:e,detail:q(t)}))).reduce(((e,t)=>(e[t.key]=t.detail,e)),{}))}function I(e,t,n,r){const o={kind:"feature",key:e,context:_.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),R(o)}function F(e){return Gi(e,!1)?Promise.resolve(e):Promise.reject(new gr.LDInvalidUserError(Ao()))}function $(e,t,n,r,o,i){let s,a;return E&&_r.objectHasOwnProperty(E,e)&&E[e]&&!E[e].deleted?(a=E[e],s=q(a),null!=a.value||(s.value=t)):s={value:t,variationIndex:null,reason:{kind:"ERROR",errorKind:"FLAG_NOT_FOUND"}},n&&(o||a?.prerequisites?.forEach((e=>{$(e,void 0,n,!1,!1,!1)})),I(e,s,t,r)),!o&&i&&(l=e,u=s,c.hasListeners(Yi.flagUsed)&&c.onFlagUsed(l,u,_.getContext())),s;var l,u}function q(e){return{value:e.value,variationIndex:void 0===e.variation?null:e.variation,reason:e.reason||null}}function z(){if(C=!0,!_.getContext())return;const e=e=>{try{return JSON.parse(e)}catch(t){return void s.maybeReportError(new gr.LDInvalidDataError(Mo()))}};b.connect(_.getContext(),h,{ping:function(){i.debug(yo());const e=_.getContext();w.fetchFlagSettings(e,h).then((t=>{_r.deepEquals(e,_.getContext())&&B(t||{})})).catch((e=>{s.maybeReportError(new gr.LDFlagFetchError(ko(e)))}))},put:function(t){const n=e(t.data);n&&(i.debug(xo()),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(go(n.key));const e={},t=_r.extend({},n);delete t.key,E[n.key]=t;const o=q(t);e[n.key]=r?{previous:r.value,current:o}:{current:o},A(n,t),V(e)}else i.debug(vo(n.key))},delete:function(t){const n=e(t.data);if(n)if(!E[n.key]||E[n.key].version<n.version){i.debug(po(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},A(n,E[n.key]),V(e)}else i.debug(mo(n.key))}})}function U(){C&&(b.disconnect(),C=!1)}function B(e){const t={};if(!e)return Promise.resolve();for(const n in E)_r.objectHasOwnProperty(E,n)&&E[n]&&(e[n]&&!_r.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)_r.objectHasOwnProperty(e,n)&&e[n]&&(!E[n]||E[n].deleted)&&(t[n]={current:q(e[n])});return E={...e},L(),V(t).catch((()=>{}))}function V(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(Xi+":"+t,o,i),n[t]=r?{current:o,previous:i}:{previous:i}})),s.emit(Xi,n),s.emit(Ji,E),l.sendEventsOnlyForVariation||D||t.forEach((t=>{I(t,e[t].current)}))}return S&&O?O.saveFlags(E):Promise.resolve()}function K(){const e=j||k&&void 0===j;e&&!C?z():!e&&C&&U(),y&&y.setStreaming(e)}function H(e){return e===Xi||e.substr(0,7)===Xi+":"}if("string"==typeof l.bootstrap&&"LOCALSTORAGE"===l.bootstrap.toUpperCase()&&(O?S=!0:i.warn(Io())),"object"==typeof l.bootstrap&&(E=function(e){const t=Object.keys(e),n="$flagsState",r="$valid",o=e[n];!o&&t.length&&i.warn(lo()),!1===e[r]&&i.warn(ao());const s={};return t.forEach((t=>{if(t!==n&&t!==r){let n={value:e[t]};o&&o[t]?n=_r.extend(n,o[t]):n.version=0,s[t]=n}})),s}(l.bootstrap)),D){const e=D.getInitialState();e?W(e):D.on("init",W),D.on("update",(function(e){e.context&&_.setContext(e.context),e.flags&&B(e.flags)}))}else(e?M.processContext(t).then(F).then((e=>(_.setContext(e),"object"==typeof l.bootstrap?G():S?O.loadFlags().then((e=>null==e?(E={},w.fetchFlagSettings(_.getContext(),h).then((e=>B(e||{}))).then(G).catch((e=>{Y(new gr.LDFlagFetchError(ko(e)))}))):(E=e,_r.onNextTick(G),w.fetchFlagSettings(_.getContext(),h).then((e=>B(e))).catch((e=>s.maybeReportError(e)))))):w.fetchFlagSettings(_.getContext(),h).then((e=>{E=e||{},L(),G()})).catch((e=>{E={},Y(e)}))))):Promise.reject(new gr.LDInvalidEnvironmentIdError(Co()))).catch(Y);function W(e){d=e.environment,_.setContext(e.context),E={...e.flags},_r.onNextTick(G)}function G(){i.info(co()),P=!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 Hi(`${t} timed out after ${e} seconds.`))}),1e3*e)}))}(e,"waitForInitialization");return Promise.race([n,t]).catch((e=>{throw e instanceof gr.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(T)return _r.wrapPromiseCallback(Promise.resolve({}),n);if(D)return i.warn(No()),_r.wrapPromiseCallback(Promise.resolve(_r.transformVersionedValuesToValues(E)),n);const r=S&&O?O.clearFlags():Promise.resolve();return _r.wrapPromiseCallback(r.then((()=>M.processContext(e))).then(F).then((e=>w.fetchFlagSettings(e,t).then((n=>{const r=_r.transformVersionedValuesToValues(n);return _.setContext(e),h=t,n?B(n).then((()=>r)):r})))).then((e=>(C&&z(),e))).catch((e=>(s.maybeReportError(e),Promise.reject(e)))),n)},getContext:function(){return _.getContext()},variation:function(e,t){return $(e,t,!0,!1,!1,!0).value},variationDetail:function(e,t){return $(e,t,!0,!0,!1,!0)},track:function(e,t,n){if("string"!=typeof e)return void s.maybeReportError(new gr.LDInvalidEventKeyError(Vo(e)));void 0!==n&&"number"!=typeof n&&i.warn(Ro(typeof n)),r.customEventFilter&&!r.customEventFilter(e)&&i.warn(Vo(e));const 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),R(a)},on:function(e,t,n){H(e)?(k=!0,P&&K(),s.on(e,t,n)):s.on(...arguments)},off:function(e){if(s.off(...arguments),H(e)){let e=!1;s.getEvents().forEach((t=>{H(t)&&s.getEventListenerCount(t)>0&&(e=!0)})),e||(k=!1,C&&void 0===j&&U())}},setStreaming:function(e){const t=null===e?void 0:e;t!==j&&(j=t,K())},flush:function(e){return _r.wrapPromiseCallback(u?x.flush():Promise.resolve(),e)},allFlags:function(){const e={};if(!E)return e;for(const t in E)_r.objectHasOwnProperty(E,t)&&!E[t].deleted&&(e[t]=$(t,null,!l.sendEventsOnlyForVariation,!1,!0,!1).value);return e},close:function(e){if(T)return _r.wrapPromiseCallback(Promise.resolve(),e);const t=()=>{T=!0,E={}},n=Promise.resolve().then((()=>{if(U(),y&&y.stop(),u)return x.stop(),x.flush()})).then(t).catch(t);return _r.wrapPromiseCallback(n,e)}};return{client:Q,options:l,emitter:s,ident:_,logger:i,requestor:w,start:function(){u&&(y&&y.start(),x.start())},enqueueEvent:R,getFlagsInternal:function(){return E},getEnvironmentId:()=>d,internalChangeEventName:Ji}},errors:gr},es=Zi.initialize,ts=Zi.errors;function ns(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 rs(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 os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(n),!0).forEach((function(t){ns(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var is={promise:Promise.resolve({status:200,header:function(){return null},body:null})};var ss=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function as(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("^"+ss(e.url)+"/?$");break;case"canonical":i=s,o=new RegExp("^"+ss(e.url)+"/?$");break;case"substring":i=s,o=new RegExp(".*"+ss(e.substring)+".*$");break;case"regex":i=s,o=new RegExp(e.pattern);break;default:return!1}return o.test(i)}function ls(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(as(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 cs="goalsReady",us={fetchGoals:{default:!0},hash:{type:"string"},eventProcessor:{type:"object"},eventUrlTransformer:{type:"function"},disableSyncEventPost:{default:!1}};function ds(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 is;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 is}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=os(os({},{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=es(e,t,n,r,us),i=o.client,s=o.options,a=o.emitter,l=new Promise((function(e){var t=a.on(cs,(function(){a.off(cs,t),e()}))}));i.waitUntilGoalsReady=function(){return l},s.fetchGoals?function(e,t){var n,r;function o(){r&&r.dispose(),n&&n.length&&(r=ls(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=ls(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 ts.LDUnexpectedResponseError(n.message)),t()}))}(o,(function(){return a.emit(cs)})):a.emit(cs),"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 hs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps="[object Symbol]",ms=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vs="\\ud800-\\udfff",ys="\\u0300-\\u036f\\ufe20-\\ufe23",bs="\\u20d0-\\u20f0",xs="\\u2700-\\u27bf",ws="a-z\\xdf-\\xf6\\xf8-\\xff",Ss="A-Z\\xc0-\\xd6\\xd8-\\xde",Cs="\\ufe0e\\ufe0f",ks="\\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",Es="['’]",js="["+vs+"]",Ps="["+ks+"]",Ts="["+ys+bs+"]",Ns="\\d+",Ds="["+xs+"]",_s="["+ws+"]",Ms="[^"+vs+ks+Ns+xs+ws+Ss+"]",Os="\\ud83c[\\udffb-\\udfff]",Rs="[^"+vs+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Ls="[\\ud800-\\udbff][\\udc00-\\udfff]",Is="["+Ss+"]",Fs="\\u200d",$s="(?:"+_s+"|"+Ms+")",qs="(?:"+Is+"|"+Ms+")",zs="(?:['’](?:d|ll|m|re|s|t|ve))?",Us="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bs="(?:"+Ts+"|"+Os+")"+"?",Vs="["+Cs+"]?",Ks=Vs+Bs+("(?:"+Fs+"(?:"+[Rs,As,Ls].join("|")+")"+Vs+Bs+")*"),Hs="(?:"+[Ds,As,Ls].join("|")+")"+Ks,Ws="(?:"+[Rs+Ts+"?",Ts,As,Ls,js].join("|")+")",Gs=RegExp(Es,"g"),Ys=RegExp(Ts,"g"),Qs=RegExp(Os+"(?="+Os+")|"+Ws+Ks,"g"),Xs=RegExp([Is+"?"+_s+"+"+zs+"(?="+[Ps,Is,"$"].join("|")+")",qs+"+"+Us+"(?="+[Ps,Is+$s,"$"].join("|")+")",Is+"?"+$s+"+"+zs,Is+"+"+Us,Ns,Hs].join("|"),"g"),Js=RegExp("["+Fs+vs+ys+bs+Cs+"]"),Zs=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ea="object"==typeof self&&self&&self.Object===Object&&self,ta="object"==typeof hs&&hs&&hs.Object===Object&&hs||ea||Function("return this")();var na,ra=(na={"À":"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==na?void 0:na[e]});function oa(e){return Js.test(e)}function ia(e){return oa(e)?function(e){return e.match(Qs)||[]}(e):function(e){return e.split("")}(e)}var sa=Object.prototype.toString,aa=ta.Symbol,la=aa?aa.prototype:void 0,ca=la?la.toString:void 0;function ua(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&sa.call(e)==ps}(e))return ca?ca.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function da(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 ha(e){return null==e?"":ua(e)}var fa,pa=(fa=function(e,t,n){return t=t.toLowerCase(),e+(n?ga(ha(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=ha(e),void 0===t?function(e){return Zs.test(e)}(e)?function(e){return e.match(Xs)||[]}(e):function(e){return e.match(ms)||[]}(e):e.match(t)||[]}(function(e){return(e=ha(e))&&e.replace(gs,ra).replace(Ys,"")}(e).replace(Gs,"")),fa,"")});var ma,ga=(ma="toUpperCase",function(e){var t=oa(e=ha(e))?ia(e):void 0,n=t?t[0]:e.charAt(0),r=t?da(t,1).join(""):e.slice(1);return n[ma]()+r});const va=fs(pa);var ya,ba={exports:{}},xa={};var wa,Sa={};
|
|
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
|
+
*/ba.exports="production"===process.env.NODE_ENV?function(){if(ya)return xa;ya=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,m=e?Symbol.for("react.block"):60121,g=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 x(e){return b(e)===c}return xa.AsyncMode=l,xa.ConcurrentMode=c,xa.ContextConsumer=a,xa.ContextProvider=s,xa.Element=t,xa.ForwardRef=u,xa.Fragment=r,xa.Lazy=p,xa.Memo=f,xa.Portal=n,xa.Profiler=i,xa.StrictMode=o,xa.Suspense=d,xa.isAsyncMode=function(e){return x(e)||b(e)===l},xa.isConcurrentMode=x,xa.isContextConsumer=function(e){return b(e)===a},xa.isContextProvider=function(e){return b(e)===s},xa.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},xa.isForwardRef=function(e){return b(e)===u},xa.isFragment=function(e){return b(e)===r},xa.isLazy=function(e){return b(e)===p},xa.isMemo=function(e){return b(e)===f},xa.isPortal=function(e){return b(e)===n},xa.isProfiler=function(e){return b(e)===i},xa.isStrictMode=function(e){return b(e)===o},xa.isSuspense=function(e){return b(e)===d},xa.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===g||e.$$typeof===v||e.$$typeof===y||e.$$typeof===m)},xa.typeOf=b,xa}():(wa||(wa=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,m=e?Symbol.for("react.block"):60121,g=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 m=e.type;switch(m){case l:case c:case r:case i:case o:case d:return m;default:var g=m&&m.$$typeof;switch(g){case a:case u:case p:case f:case s:return g;default:return h}}case n:return h}}}var x=c,w=a,S=s,C=t,k=u,E=r,j=p,P=f,T=n,N=i,D=o,_=d,M=!1;function O(e){return b(e)===c}Sa.AsyncMode=l,Sa.ConcurrentMode=x,Sa.ContextConsumer=w,Sa.ContextProvider=S,Sa.Element=C,Sa.ForwardRef=k,Sa.Fragment=E,Sa.Lazy=j,Sa.Memo=P,Sa.Portal=T,Sa.Profiler=N,Sa.StrictMode=D,Sa.Suspense=_,Sa.isAsyncMode=function(e){return M||(M=!0),O(e)||b(e)===l},Sa.isConcurrentMode=O,Sa.isContextConsumer=function(e){return b(e)===a},Sa.isContextProvider=function(e){return b(e)===s},Sa.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Sa.isForwardRef=function(e){return b(e)===u},Sa.isFragment=function(e){return b(e)===r},Sa.isLazy=function(e){return b(e)===p},Sa.isMemo=function(e){return b(e)===f},Sa.isPortal=function(e){return b(e)===n},Sa.isProfiler=function(e){return b(e)===i},Sa.isStrictMode=function(e){return b(e)===o},Sa.isSuspense=function(e){return b(e)===d},Sa.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===g||e.$$typeof===v||e.$$typeof===y||e.$$typeof===m)},Sa.typeOf=b}()),Sa);var Ca=ba.exports,ka={};ka[Ca.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ka[Ca.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};const Ea={useCamelCaseFlagKeys:!0,sendEventsOnFlagRead:!0,reactContext:n.createContext({flags:{},flagKeyMap:{},ldClient:void 0})},ja=e=>{var t;return null!=(t=e.context)?t:e.user},Pa=e=>{const t={};for(const n in e)0!==n.indexOf("$")&&(t[va(n)]=e[n]);return t},Ta=(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 Na(e,t,n=Ea,r){const o=(l=t,void 0===(c=r)?l:Object.keys(c).reduce(((e,t)=>(Da(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=va(r);t[o]=e[r],n[o]=r}return[t,n]}(o):[o];var l,c;return{flags:n.sendEventsOnFlagRead?_a(e,s,a,i):s,flagKeyMap:a}}function Da(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _a(e,t,n,r){return new Proxy(t,{get(t,o,i){const s=Reflect.get(t,o,i),a=r&&Da(n,o)||Da(t,o);if("symbol"==typeof o||!a)return s;if(void 0===s)return;return e.variation(r?n[o]:o,s)}})}Pa.camelCaseKeys=Pa;const Ma={wrapperName:"react-client-sdk",wrapperVersion:"3.6.1",sendEventsOnlyForVariation:!0};var Oa=Object.defineProperty,Ra=Object.defineProperties,Aa=Object.getOwnPropertyDescriptors,La=Object.getOwnPropertySymbols,Ia=Object.prototype.hasOwnProperty,Fa=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?Oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qa=(e,t)=>{for(var n in t||(t={}))Ia.call(t,n)&&$a(e,n,t[n]);if(La)for(var n of La(t))Fa.call(t,n)&&$a(e,n,t[n]);return e},za=(e,t)=>Ra(e,Aa(t)),Ua=(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())}));let Ba=class extends n.Component{constructor(e){super(e),this.getReactOptions=()=>qa(qa({},Ea),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=qa(qa({},this.state.unproxiedFlags),o);Object.keys(o).length>0&&this.setState((n=>qa(za(qa({},n),{unproxiedFlags:i}),Na(e,i,r,t))))}))},this.onFailed=(e,t)=>{this.setState((e=>za(qa({},e),{error:t})))},this.onReady=(e,t,n)=>{const r=Ta(e,n);this.setState((o=>qa(za(qa({},o),{unproxiedFlags:r}),Na(e,r,t,n))))},this.prepareLDClient=()=>Ua(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=Ta(o,n);else{const c=null!=(e=ja(this.props))?e:{anonymous:!0,kind:"user"};o=ds(t,c,qa(qa({},Ma),r));try{yield o.waitForInitialization(this.props.timeout),a=Ta(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=>za(qa(za(qa({},e),{unproxiedFlags:a}),Na(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?Pa(e):e,unproxiedFlags:e,flagKeyMap:{}}}}}componentDidMount(){return Ua(this,null,(function*(){const{deferInitialization:e}=this.props;e&&!ja(this.props)||(yield this.prepareLDClient())}))}componentDidUpdate(e){return Ua(this,null,(function*(){const{deferInitialization:t}=this.props,n=!ja(e)&&ja(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 Va=new class{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()}},Ka="api:unauthorized",Ha="api:authorized",Wa={staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!0};let Ga,Ya=!1,Qa=null,Xa=!1;const Ja=async(e,t={})=>{const n=await fetch(`https://api.embedreach.com/api${e}`,{...t,credentials:"include",headers:{"Content-Type":"application/json",...Ga&&{Authorization:`Bearer ${Ga}`},...t.headers}});if(401===n.status)throw Ya||(Ya=!0,Va.emit(Ka,void 0),Qa&&window.clearTimeout(Qa),Qa=window.setTimeout((()=>{Ya=!1,Xa=!1,Qa=null}),5e3)),new Error("Unauthorized");if(!n.ok)throw new Error(`API Error: ${n.statusText}`);return Xa||(Va.emit(Ha,void 0),Xa=!0),n.json()},Za=(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 i?.length&&i.forEach((({eventName:t,handler:n})=>{const r=n(c),o=Va.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})}}},el=[{eventName:Ka,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!1}),e({type:"SET_REAUTHING",payload:!0})}},{eventName:Ha,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!0})}}],{Provider:tl}=Za(((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},el),nl=e=>{if(/^\d+\s+\d+(?:\.\d+)?%\s+\d+(?:\.\d+)?%$/.test(e.trim()))return e.trim();try{const t=(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})(e),[n,r,o]=(e=>{const t=e.match(/\d+/g);if(!t||t.length<3)throw new Error(`Invalid RGB color format: ${e}`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)]})(t);return((e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=Math.min(e,t,n);let i=0,s=0;const a=(r+o)/2;if(r!==o){const l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4}i*=60}return`${Math.round(i)} ${Math.round(100*s)}% ${Math.round(100*a)}%`})(n,r,o)}catch(t){return e}},rl={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%)","font-body":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-heading":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},ol=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(rl).map((([t,n])=>{const r=e[t];let o=n;if(void 0!==r)if("radius"===t||"font-body"===t||"font-heading"===t)o=r;else if((e=>{if(/^\d+\s+\d+(?:\.\d+)?%\s+\d+(?:\.\d+)?%$/.test(e.trim()))return!0;const t=document.createElement("div"),n=t.style.color;return t.style.color=e,t.style.color!==n})(r))try{o=nl(r)}catch(i){}return`--reach-${t}: ${o};`})).join("\n")}\n }\n\n /* Apply font families directly */\n [data-reach-root] {\n font-family: var(--reach-font-body);\n }\n \n [data-reach-root] h1,\n [data-reach-root] h2,\n [data-reach-root] h3,\n [data-reach-root] h4,\n [data-reach-root] h5,\n [data-reach-root] h6 {\n font-family: var(--reach-font-heading);\n }\n `;n.textContent=r,document.head.appendChild(n)},{Provider:il}=Za(((e,t)=>{switch(t.type){case"set_theme":return t.payload&&!e.theme&&ol(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:!0,error:null}),sl=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,al={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ll=e=>al[e];let cl={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(sl,ll)};const ul={type:"3rdParty",init(e){((e={})=>{cl={...cl,...e}})(e.options.react)}},dl=n.createContext();function hl({i18n:e,defaultNS:t,children:r}){const o=n.useMemo((()=>({i18n:e,defaultNS:t})),[e,t]);return n.createElement(dl.Provider,{value:o},r)}const fl=e=>"string"==typeof e,pl=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},ml=e=>null==e?"":""+e,gl=/###/g,vl=e=>e&&e.indexOf("###")>-1?e.replace(gl,"."):e,yl=e=>!e||fl(e),bl=(e,t,n)=>{const r=fl(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(yl(e))return{};const t=vl(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return yl(e)?{}:{obj:e,k:vl(r[o])}},xl=(e,t,n)=>{const{obj:r,k:o}=bl(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=bl(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=bl(e,s,Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},wl=(e,t)=>{const{obj:n,k:r}=bl(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Sl=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?fl(e[r])||e[r]instanceof String||fl(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Sl(e[r],t[r],n):e[r]=t[r]);return e},Cl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kl={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const El=e=>fl(e)?e.replace(/[&<>"'\/]/g,(e=>kl[e])):e;const jl=[" ",",","?","!",";"],Pl=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),Tl=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},Nl=e=>e?.replace("_","-"),Dl={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class _l{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||Dl,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:(fl(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new _l(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new _l(this.logger,e)}}var Ml=new _l;class Ol{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 Rl extends Ol{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){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):fl(n)&&o?s.push(...n.split(o)):s.push(n)));const a=wl(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&fl(n)?Tl(this.data?.[e]?.[t],n,o):a}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),xl(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)(fl(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=wl(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Sl(a,n,o):a={...a,...n},xl(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 Al={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach((e=>{t=this.processors[e]?.process(t,n,r,o)??t})),t}};const Ll={};class Il extends Ol{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=Ml.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!==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=jl.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=Pl.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:fl(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:fl(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"===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=u?.res;const h=u?.usedKey||i,f=u?.exactUsedKey||i,p=Object.prototype.toString.apply(d),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,v=!fl(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(g&&d&&v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0)||fl(m)&&Array.isArray(d))if(g&&fl(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,s=!1;const c=void 0!==t.count&&!fl(t.count),h=Il.hasDefaultValue(t),f=c?this.pluralResolver.getSuffix(l,t.count,t):"",p=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",m=c&&!t.ordinal&&0===t.count,g=m&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${f}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(d)&&h&&(r=!0,d=g),this.isValidLookup(d)||(s=!0,d=i);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:d,y=h&&g!==d&&this.options.updateMissing;if(s||r||y){if(this.logger.log(y?"updateKey":"missingKey",l,a,i,y?g: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)=>{const o=h&&r!==d?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,o,y,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,a,n,o,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);m&&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}`]||g)}))})):r(e,i,g))}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=this;if(this.i18nFormat?.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 s=fl(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(s){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=n.replace&&!fl(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||r.usedLng,n),s){const t=e.match(this.interpolator.nestingRegexp);a<(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),s=0;s<e;s++)r[s]=arguments[s];return o?.[0]!==r[0]||n.context?i.translate(...r,t):(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,a=fl(s)?[s]:s;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=Al.handle(a,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 fl(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&&!fl(s.count),d=u&&!s.ordinal&&0===s.count,h=void 0!==s.context&&(fl(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=>{this.isValidLookup(t)||(i=e,Ll[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(i)||(Ll[`${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=>{if(this.isValidLookup(t))return;o=n;const i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,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&&(i.push(l+e),s.ordinal&&0===e.indexOf(r)&&i.push(l+e.replace(r,this.options.pluralSeparator)),d&&i.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${s.context}`;i.push(n),u&&(i.push(n+e),s.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let a;for(;a=i.pop();)this.isValidLookup(t)||(r=a,t=this.getResource(n,e,a,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){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}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&&!fl(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 Fl{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ml.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Nl(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=Nl(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(fl(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)),fl(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 fl(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))):fl(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}const $l={zero:0,one:1,two:2,few:3,many:4,other:5},ql={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Ml.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=Nl("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!"),ql;if(!e.match(/-|_/))return ql;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)),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)=>$l[e]-$l[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 Ul=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=wl(e,n);return void 0!==r?r:wl(t,n)})(e,t,n);return!i&&o&&fl(n)&&(i=Tl(e,n,r),void 0===i&&(i=Tl(t,n,r))),i},Bl=e=>e.replace(/\$/g,"$$$$");class Vl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ml.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}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:m,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:El,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Cl(o):i||"{{",this.suffix=s?Cl(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Cl(d):h||Cl("$t("),this.nestingSuffix=f?Cl(f):p||Cl(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>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){let o,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Ul(t,a,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(Ul(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Bl(e)},{regex:this.regexp,safeValue:e=>Bl(this.escapeValue?this.escape(e):e)}].forEach((t=>{for(s=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=fl(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(u){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else fl(i)||this.useRawValueToEscape||(i=ml(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=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)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const s=i.match(/'/g),a=i.match(/"/g);((s?.length??0)%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(l){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,l),`${e}${n}${i}`}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&&!fl(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&&!fl(r))return r;fl(r)||(r=ml(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 Kl=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(Nl(r),o),t[s]=a),a(n)}};class Hl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ml.create("formatter"),this.options=e,this.formats={number:Kl(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Kl(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Kl(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Kl(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Kl(((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()]=Kl(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)=>{const{formatName:o,formatOptions:i}=(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[o]){let t=e;try{const s=r?.formatParams?.[r.interpolationkey]||{};t=this.formats[o](e,s.locale||s.lng||r.locale||r.lng||n,{...i,...r,...s})}catch(s){this.logger.warn(s)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}class Wl extends Ol{constructor(e,t,n){let r=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=r,this.logger=Ml.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}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}=bl(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();fl(e)&&(e=this.languageUtils.toResolveHierarchy(e)),fl(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){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const l={...i,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;o=5===c.length?c(e,t,n,r,l):c(e,t,n,r),o&&"function"==typeof o.then?o.then((e=>s(null,e))).catch(s):s(null,o)}catch(a){s(a)}else c(e,t,n,r,s,l)}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 Gl=()=>({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]),fl(e[1])&&(t.defaultValue=e[1]),fl(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}}),Yl=e=>(fl(e.ns)&&(e.ns=[e.ns]),fl(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),fl(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Ql=()=>{};class Xl extends Ol{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=Yl(e),this.services={},this.logger=Ml,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&&(fl(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Gl();this.options={...r,...this.options,...Yl(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;Ml.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Hl;const n=new Fl(this.options);this.store=new Rl(this.options.resources,this.options);const i=this.services;i.logger=Ml,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new zl(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 Vl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Wl(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 Il(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=Ql),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=pl(),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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ql;const n=fl(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=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(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e)))}this.options.preload?.forEach?.((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=pl();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=Ql),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&&Al.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=pl();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=>{e||t||!this.services.languageDetector||(t=[]);const n=fl(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{i(e,n)}))};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 fl(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}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=pl();return this.options.ns?(fl(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=pl();fl(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){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Fl(Gl());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(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Xl(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]:Ql;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Xl(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 Rl(e,r),o.services.resourceStore=o.store}return o.translator=new Il(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 Jl=Xl.createInstance();Jl.createInstance=Xl.createInstance;const{slice:Zl,forEach:ec}=[];const tc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,nc={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(!tc.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!tc.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 rc={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return nc.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&nc.create(n,e,r,o,i)}},oc={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const r=e.substring(1).split("&");for(let o=0;o<r.length;o++){const e=r[o].indexOf("=");if(e>0){r[o].substring(0,e)===n&&(t=r[o].substring(e+1))}}}return t}};let ic=null;const sc=()=>{if(null!==ic)return ic;try{ic="undefined"!==window&&null!==window.localStorage;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ic=!1}return ic};var ac={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&sc())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&sc()&&window.localStorage.setItem(n,e)}};let lc=null;const cc=()=>{if(null!==lc)return lc;try{lc="undefined"!==window&&null!==window.sessionStorage;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){lc=!1}return lc};var uc={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&cc())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&cc()&&window.sessionStorage.setItem(n,e)}},dc={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}},hc={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}},fc={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const r="number"==typeof t?t:0;return n[r]?.replace("/","")}},pc={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,r="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let mc=!1;try{document,mc=!0}catch(OY){}const gc=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];mc||gc.splice(1,1);class vc{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 ec.call(Zl.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(e,this.options||{},{order:gc,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(rc),this.addDetector(oc),this.addDetector(ac),this.addDetector(uc),this.addDetector(dc),this.addDetector(hc),this.addDetector(fc),this.addDetector(pc)}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)})))}}vc.type="languageDetector";const yc={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",campaign_not_available:"Chart is not available for individual campaigns yet"},customer_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",invoice_details:"Invoice Details",amount:"Amount",service:"Service",invoice_date:"Invoice Date"},channel_performance:{title:"Channel Performance",description:"See how each channel performs",channel:"Channel",spend:"Spend",revenue:"Revenue",roas:"ROAS",new_customers:"New Customers"},traffic_conversion:{title:"Traffic Conversion Funnel"},tabs:{overview:"Overview",channel_performance:"Channel Performance",campaign_performance:"Campaign Performance",customer_acquisition:"Customer Acquisition",traffic_conversion:"Traffic Conversion"},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",direct_measured_revenue:"Direct Measured Revenue",direct_measured_revenue_description:"The amount of revenue directly measured from ads",measured_revenue:"Measured Revenue",measured_revenue_description:"The amount of revenue measured from ads",direct_measured_conversions:"Direct Measured Conversions",direct_measured_conversions_description:"The amount of conversions directly 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",new_customers:"New Customers",new_customers_description:"New customers who made a purchase or took an action",new_leads_conversion_rate:"New Leads Conversion Rate",new_leads_conversion_rate_description:"The ratio of new leads to the total number of leads",new_customers_conversion_rate:"New Customers Conversion Rate",new_customers_conversion_rate_description:"The ratio of new customers to the total number of customers",cost_per_click:"Cost Per Click",cost_per_click_description:"The amount spent per click on your ads",click_conversion_rate:"Click Conversion Rate",click_conversion_rate_description:"The ratio of clicks to the total number of clicks",click_through_rate:"Click Through Rate",click_through_rate_description:"The ratio of clicks to the total number of impressions",conversion_rate:"Conversion Rate",conversion_rate_description:"The ratio of conversions to the total number of clicks",total_conversion:"Total Conversion",total_conversion_description:"The total number of conversions from your ads",cac:"CAC",cac_description:"The amount spent per customer acquisition",revenue_per_click:"Revenue Per Click",revenue_per_click_description:"The amount of revenue generated per click on your ads",revenue_per_new_customer:"Revenue Per New Customer",revenue_per_new_customer_description:"The amount of revenue generated per new customer",reengaged_customers:"Reengaged Customers",reengaged_customers_description:"The number of customers who have been reengaged with your ads",expected_revenue:"Expected Revenue",expected_revenue_description:"The amount of revenue you expect to generate from your ads",estimated_revenue:"Estimated Revenue",estimated_revenue_description:"The amount of revenue you expect to generate from your 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:"Append the reach campaign id parameter to your ad platform tracking settings. We will not overwrite any existing tracking parameters. Required for accurate tracking.",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",campaign_not_available:"El gráfico no está disponible para campañas individuales todavía"},customer_acquisition:{title:"Adquisición de clientes",description:"Ver cómo adquieres nuevos clientes desde cada canal",client:"Cliente",source:"Fuente",total_spent:"Total gastado",total_revenue:"Ingresos totales",status:"Estado",no_data:"No hay datos disponibles",source_breakdown:"Desglose de fuentes",payment_status:"Estado de pago",paid:"Pagado",unpaid:"No pagado",invoice_details:"Detalles de la factura",amount:"Cantidad",service:"Servicio",invoice_date:"Fecha de la factura"},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"},traffic_conversion:{title:"Traffic Conversion Funnel"},tabs:{overview:"Resumen",channel_performance:"Rendimiento de canales",campaign_performance:"Rendimiento de campañas",customer_acquisition:"Adquisición de clientes",traffic_conversion:"Conversión de tráfico"},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",direct_measured_revenue:"Ingresos medidos directamente",direct_measured_revenue_description:"La cantidad de ingresos medidos directamente desde anuncios",measured_revenue:"Ingresos medidos",measured_revenue_description:"La cantidad de ingresos medidos desde anuncios",direct_measured_conversions:"Conversiones medidas directamente",direct_measured_conversions_description:"La cantidad de conversiones medidas directamente desde anuncios",measured_conversions:"Conversiones medidas",measured_conversions_description:"La cantidad de conversiones medidas desde 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",new_customers:"Nuevos clientes",new_customers_description:"Nuevos clientes que hicieron una compra o tomaron una acción",new_leads_conversion_rate:"Tasa de conversión de leads nuevos",new_leads_conversion_rate_description:"El ratio de leads nuevos al total de leads",new_customers_conversion_rate:"Tasa de conversión de nuevos clientes",new_customers_conversion_rate_description:"El ratio de nuevos clientes al total de clientes",cost_per_click:"Costo por click",cost_per_click_description:"El gasto por click en tus anuncios",click_conversion_rate:"Tasa de conversión de clicks",click_conversion_rate_description:"El ratio de clicks al total de clicks",click_through_rate:"Tasa de clics",click_through_rate_description:"El ratio de clicks al total de impresiones",conversion_rate:"Tasa de conversión",conversion_rate_description:"El ratio de conversiones al total de clicks",total_conversion:"Total de conversiones",total_conversion_description:"El número total de conversiones desde tus anuncios",cac:"CAC",cac_description:"El gasto por cliente adquirido",revenue_per_click:"Ingresos por click",revenue_per_click_description:"El ingreso generado por cada click en tus anuncios",revenue_per_new_customer:"Ingresos por nuevo cliente",revenue_per_new_customer_description:"El ingreso generado por cada nuevo cliente",reengaged_customers:"Clientes reactivados",reengaged_customers_description:"El número de clientes que han sido reactivados con tus anuncios",expected_revenue:"Ingresos esperados",expected_revenue_description:"El ingreso que esperas generar desde tus anuncios",estimated_revenue:"Ingresos estimados",estimated_revenue_description:"El ingreso que estimas generar desde tus 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:"Añada el parámetro de ID de campaña de alcance a la configuración de seguimiento de su plataforma publicitaria. No sobrescribiremos ningún parámetro de seguimiento existente. Necesario para un seguimiento preciso.",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"}}}}};Jl.use(vc).use(ul).init({resources:yc,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 bc=({children:e,initialLanguage:r})=>(n.useEffect((()=>{r&&Jl.changeLanguage(r)}),[r]),t.jsx(hl,{i18n:Jl,children:e}));let xc=0;const wc=new Map,Sc=e=>{if(wc.has(e))return;const t=setTimeout((()=>{wc.delete(e),jc({type:"REMOVE_TOAST",toastId:e})}),1e6);wc.set(e,t)},Cc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map((e=>e.id===t.toast.id?{...e,...t.toast}:e))};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Sc(n):e.toasts.forEach((e=>{Sc(e.id)})),{...e,toasts:e.toasts.map((e=>e.id===n||void 0===n?{...e,open:!1}:e))}}case"REMOVE_TOAST":return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((e=>e.id!==t.toastId))}}},kc=[];let Ec={toasts:[]};function jc(e){Ec=Cc(Ec,e),kc.forEach((e=>{e(Ec)}))}function Pc({...e}){const t=(xc=(xc+1)%Number.MAX_SAFE_INTEGER,xc.toString()),n=()=>jc({type:"DISMISS_TOAST",toastId:t});return jc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||n()}}}),{id:t,dismiss:n,update:e=>jc({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function Tc(){const[e,t]=i.useState(Ec);return i.useEffect((()=>(kc.push(t),()=>{const e=kc.indexOf(t);e>-1&&kc.splice(e,1)})),[e]),{...e,toast:Pc,dismiss:e=>jc({type:"DISMISS_TOAST",toastId:e})}}function Nc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Dc(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function _c(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Dc(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():Dc(e[t],null)}}}}function Mc(...e){return i.useCallback(_c(...e),e)}function Oc(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const s=i.createContext(o),a=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[a]||s,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[a]||s);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},Rc(o,...n)]}function Rc(...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 i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var Ac=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(Fc);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(Lc,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(Lc,{...o,ref:n,children:r})}));Ac.displayName="Slot";var Lc=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n);return i.cloneElement(n,{...$c(r,n.props),ref:t?_c(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));Lc.displayName="SlotClone";var Ic=({children:e})=>t.jsx(t.Fragment,{children:e});function Fc(e){return i.isValidElement(e)&&e.type===Ic}function $c(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 qc(e){const r=e+"CollectionProvider",[o,i]=Oc(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=Mc(n,a(c,r).collectionRef);return t.jsx(Ac,{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=Mc(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(Ac,{[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 zc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?Ac: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 Uc(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}function Bc(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function Vc(e,t=globalThis?.document){const n=Bc(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var Kc,Hc="dismissableLayer.update",Wc="dismissableLayer.pointerDownOutside",Gc="dismissableLayer.focusOutside",Yc=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(Yc),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Mc(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Zc(Wc,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)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Zc(Gc,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)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Vc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Kc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Jc(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Kc)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Jc())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(Hc,e),()=>document.removeEventListener(Hc,e)}),[]),t.jsx(zc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Nc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Nc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Nc(e.onPointerDownCapture,C.onPointerDownCapture)})}));Qc.displayName="DismissableLayer";var Xc=i.forwardRef(((e,n)=>{const r=i.useContext(Yc),o=i.useRef(null),s=Mc(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(zc.div,{...e,ref:s})}));function Jc(){const e=new CustomEvent(Hc);document.dispatchEvent(e)}function Zc(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?Uc(o,i):o.dispatchEvent(i)}Xc.displayName="DismissableLayerBranch";var eu=Qc,tu=Xc,nu=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},ru=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);nu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(zc.div,{...s,ref:n}),c):null}));ru.displayName="Portal";var ou=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef({}),o=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect((()=>{const e=iu(r.current);s.current="mounted"===l?e:"none"}),[l]),nu((()=>{const t=r.current,n=o.current;if(n!==e){const r=s.current,i=iu(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),nu((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const s=iu(r.current).includes(i.animationName);if(i.target===t&&s&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(s.current=iu(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),s=Mc(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:s}):null};function iu(e){return e?.animationName||"none"}function su({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,o=i.useRef(r),s=Bc(t);return i.useEffect((()=>{o.current!==r&&(s(r),o.current=r)}),[r,o,s]),n}({defaultProp:t,onChange:n}),s=void 0!==e,a=s?e:r,l=Bc(n);return[a,i.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[s,e,o,l])]}ou.displayName="Presence";var au=i.forwardRef(((e,n)=>t.jsx(zc.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}})));au.displayName="VisuallyHidden";var lu=au,cu="ToastProvider",[uu,du,hu]=qc("Toast"),[fu,pu]=Oc("Toast",[hu]),[mu,gu]=fu(cu),vu=e=>{const{__scopeToast:n,label:r="Notification",duration:o=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:l}=e,[c,u]=i.useState(null),[d,h]=i.useState(0),f=i.useRef(!1),p=i.useRef(!1);return r.trim(),t.jsx(uu.Provider,{scope:n,children:t.jsx(mu,{scope:n,label:r,duration:o,swipeDirection:s,swipeThreshold:a,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:i.useCallback((()=>h((e=>e+1))),[]),onToastRemove:i.useCallback((()=>h((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:l})})};vu.displayName=cu;var yu="ToastViewport",bu=["F8"],xu="toast.viewportPause",wu="toast.viewportResume",Su=i.forwardRef(((e,n)=>{const{__scopeToast:r,hotkey:o=bu,label:s="Notifications ({hotkey})",...a}=e,l=gu(yu,r),c=du(r),u=i.useRef(null),d=i.useRef(null),h=i.useRef(null),f=i.useRef(null),p=Mc(n,f,l.onViewportChange),m=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=l.toastCount>0;i.useEffect((()=>{const e=e=>{0!==o.length&&o.every((t=>e[t]||e.code===t))&&f.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[o]),i.useEffect((()=>{const e=u.current,t=f.current;if(g&&e&&t){const n=()=>{if(!l.isClosePausedRef.current){const e=new CustomEvent(xu);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(wu);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&r()},i=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",i),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}}),[g,l.isClosePausedRef]);const v=i.useCallback((({tabbingDirection:e})=>{const t=c().map((t=>{const n=t.ref.current,r=[n,...qu(n)];return"forwards"===e?r:r.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[c]);return i.useEffect((()=>{const e=f.current;if(e){const t=t=>{if("Tab"===t.key&&!(t.altKey||t.ctrlKey||t.metaKey)){const n=document.activeElement,r=t.shiftKey;if(t.target===e&&r)return void d.current?.focus();const o=v({tabbingDirection:r?"backwards":"forwards"}),i=o.findIndex((e=>e===n));zu(o.slice(i+1))?t.preventDefault():r?d.current?.focus():h.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[c,v]),t.jsxs(tu,{ref:u,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&t.jsx(ku,{ref:d,onFocusFromOutsideViewport:()=>{zu(v({tabbingDirection:"forwards"}))}}),t.jsx(uu.Slot,{scope:r,children:t.jsx(zc.ol,{tabIndex:-1,...a,ref:p})}),g&&t.jsx(ku,{ref:h,onFocusFromOutsideViewport:()=>{zu(v({tabbingDirection:"backwards"}))}})]})}));Su.displayName=yu;var Cu="ToastFocusProxy",ku=i.forwardRef(((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...i}=e,s=gu(Cu,r);return t.jsx(au,{"aria-hidden":!0,tabIndex:0,...i,ref:n,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));ku.displayName=Cu;var Eu="Toast",ju=i.forwardRef(((e,n)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:s,...a}=e,[l=!0,c]=su({prop:o,defaultProp:i,onChange:s});return t.jsx(ou,{present:r||l,children:t.jsx(Nu,{open:l,...a,ref:n,onClose:()=>c(!1),onPause:Bc(e.onPause),onResume:Bc(e.onResume),onSwipeStart:Nc(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:Nc(e.onSwipeMove,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)})),onSwipeCancel:Nc(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:Nc(e.onSwipeEnd,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),c(!1)}))})})}));ju.displayName=Eu;var[Pu,Tu]=fu(Eu,{onClose(){}}),Nu=i.forwardRef(((e,n)=>{const{__scopeToast:r,type:o="foreground",duration:a,open:l,onClose:c,onEscapeKeyDown:u,onPause:d,onResume:h,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:m,onSwipeEnd:g,...v}=e,y=gu(Eu,r),[b,x]=i.useState(null),w=Mc(n,(e=>x(e))),S=i.useRef(null),C=i.useRef(null),k=a||y.duration,E=i.useRef(0),j=i.useRef(k),P=i.useRef(0),{onToastAdd:T,onToastRemove:N}=y,D=Bc((()=>{const e=b?.contains(document.activeElement);e&&y.viewport?.focus(),c()})),_=i.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(P.current),E.current=(new Date).getTime(),P.current=window.setTimeout(D,e))}),[D]);i.useEffect((()=>{const e=y.viewport;if(e){const t=()=>{_(j.current),h?.()},n=()=>{const e=(new Date).getTime()-E.current;j.current=j.current-e,window.clearTimeout(P.current),d?.()};return e.addEventListener(xu,n),e.addEventListener(wu,t),()=>{e.removeEventListener(xu,n),e.removeEventListener(wu,t)}}}),[y.viewport,k,d,h,_]),i.useEffect((()=>{l&&!y.isClosePausedRef.current&&_(k)}),[l,k,y.isClosePausedRef,_]),i.useEffect((()=>(T(),()=>N())),[T,N]);const M=i.useMemo((()=>b?Iu(b):null),[b]);return y.viewport?t.jsxs(t.Fragment,{children:[M&&t.jsx(Du,{__scopeToast:r,role:"status","aria-live":"foreground"===o?"assertive":"polite","aria-atomic":!0,children:M}),t.jsx(Pu,{scope:r,onClose:D,children:s.createPortal(t.jsx(uu.ItemSlot,{scope:r,children:t.jsx(eu,{asChild:!0,onEscapeKeyDown:Nc(u,(()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1})),children:t.jsx(zc.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":y.swipeDirection,...v,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Nc(e.onKeyDown,(e=>{"Escape"===e.key&&(u?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))})),onPointerDown:Nc(e.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:Nc(e.onPointerMove,(e=>{if(!S.current)return;const t=e.clientX-S.current.x,n=e.clientY-S.current.y,r=Boolean(C.current),o=["left","right"].includes(y.swipeDirection),i=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,s=o?i(0,t):0,a=o?0:i(0,n),l="touch"===e.pointerType?10:2,c={x:s,y:a},u={originalEvent:e,delta:c};r?(C.current=c,Fu("toast.swipeMove",p,u,{discrete:!1})):$u(c,y.swipeDirection,l)?(C.current=c,Fu("toast.swipeStart",f,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(n)>l)&&(S.current=null)})),onPointerUp:Nc(e.onPointerUp,(e=>{const t=C.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),C.current=null,S.current=null,t){const n=e.currentTarget,r={originalEvent:e,delta:t};$u(t,y.swipeDirection,y.swipeThreshold)?Fu("toast.swipeEnd",g,r,{discrete:!0}):Fu("toast.swipeCancel",m,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),y.viewport)})]}):null})),Du=e=>{const{__scopeToast:n,children:r,...o}=e,s=gu(Eu,n),[a,l]=i.useState(!1),[c,u]=i.useState(!1);return function(e=()=>{}){const t=Bc(e);nu((()=>{let e=0,n=0;return e=window.requestAnimationFrame((()=>n=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}}),[t])}((()=>l(!0))),i.useEffect((()=>{const e=window.setTimeout((()=>u(!0)),1e3);return()=>window.clearTimeout(e)}),[]),c?null:t.jsx(ru,{asChild:!0,children:t.jsx(au,{...o,children:a&&t.jsxs(t.Fragment,{children:[s.label," ",r]})})})},_u=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(zc.div,{...o,ref:n})}));_u.displayName="ToastTitle";var Mu=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(zc.div,{...o,ref:n})}));Mu.displayName="ToastDescription";var Ou=i.forwardRef(((e,n)=>{const{altText:r,...o}=e;return r.trim()?t.jsx(Lu,{altText:r,asChild:!0,children:t.jsx(Au,{...o,ref:n})}):null}));Ou.displayName="ToastAction";var Ru="ToastClose",Au=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e,i=Tu(Ru,r);return t.jsx(Lu,{asChild:!0,children:t.jsx(zc.button,{type:"button",...o,ref:n,onClick:Nc(e.onClick,i.onClose)})})}));Au.displayName=Ru;var Lu=i.forwardRef(((e,n)=>{const{__scopeToast:r,altText:o,...i}=e;return t.jsx(zc.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:n})}));function Iu(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){if(!(e.ariaHidden||e.hidden||"none"===e.style.display))if(""===e.dataset.radixToastAnnounceExclude){const n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Iu(e))}})),t}function Fu(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Uc(o,i):o.dispatchEvent(i)}var $u=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return"left"===t||"right"===t?i&&r>n:!i&&o>n};function qu(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 zu(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var Uu=vu,Bu=Su,Vu=ju,Ku=_u,Hu=Mu,Wu=Ou,Gu=Au;function Yu(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=Yu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Qu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Yu(e))&&(r&&(r+=" "),r+=t);return r}const Xu=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ju=Qu,Zu=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return Ju(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=Xu(t)||Xu(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 Ju(e,s,l,null==n?void 0:n.class,null==n?void 0:n.className)}
|
|
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
|
+
*/,ed=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim()
|
|
16
|
+
/**
|
|
17
|
+
* @license lucide-react v0.464.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/;var td={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"};
|
|
22
|
+
/**
|
|
23
|
+
* @license lucide-react v0.464.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const nd=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,...td,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:ed("lucide",i),...l},[...a.map((([e,t])=>n.createElement(e,t))),...Array.isArray(s)?s:[s]]))),rd=(e,t)=>{const r=n.forwardRef((({className:r,...o},i)=>{return n.createElement(nd,{ref:i,iconNode:t,className:ed(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var s}));return r.displayName=`${e}`,r},od=rd("CalendarPlus2",[["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"}],["path",{d:"M10 16h4",key:"17e571"}],["path",{d:"M12 14v4",key:"1thi36"}]]),id=rd("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"}]]),sd=rd("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ad=rd("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ld=rd("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),cd=rd("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),ud=rd("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),dd=rd("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),hd=rd("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),fd=rd("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),pd=rd("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),md=rd("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),gd=rd("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),vd=rd("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),yd=rd("MailOpen",[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]),bd=rd("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),xd=rd("Merge",[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]),wd=rd("MessageCircleWarning",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),Sd=rd("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),Cd=rd("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),kd=rd("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]),Ed=rd("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),jd=rd("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Pd=rd("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"}]]),Td=rd("ShieldBan",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]]),Nd=rd("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Dd=rd("UserPen",[["path",{d:"M11.5 15H7a4 4 0 0 0-4 4v2",key:"15lzij"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}]]),_d=rd("UserRoundPen",[["path",{d:"M2 21a8 8 0 0 1 10.821-7.487",key:"1c8h7z"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}]]),Md=rd("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"}]]),Od=rd("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Rd=rd("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),Ad=rd("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ld=e=>{const t=qd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Id(n,t)||$d(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},Id=(e,t)=>{if(0===e.length)return t.classGroupId;const n=t.nextPart.get(e[0]),r=n?Id(e.slice(1),n):void 0;if(r)return r;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find((({validator:e})=>e(o)))?.classGroupId},Fd=/^\[(.+)\]$/,$d=e=>{if(Fd.test(e)){const t=Fd.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qd=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Vd(Object.entries(e.classGroups),n).forEach((([e,n])=>{zd(n,r,e,t)})),r},zd=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return Bd(e)?void zd(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{zd(o,Ud(t,e),n,r)}))}else{(""===e?t:Ud(t,e)).classGroupId=n}}))},Ud=(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},Bd=e=>e.isThemeGetter,Vd=(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,Kd=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)}}},Hd=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},Wd=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},Gd=/\s+/;
|
|
28
|
+
/**
|
|
29
|
+
* @license lucide-react v0.464.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/function Yd(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Qd(e))&&(r&&(r+=" "),r+=t);return r}const Qd=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Qd(e[r]))&&(n&&(n+=" "),n+=t);return n};function Xd(e,...t){let n,r,o,i=function(a){const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:Kd(e.cacheSize),parseClassName:Hd(e),...Ld(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(Gd);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=Wd(t).join(":"),m=c?p+"!":p,g=m+f;if(i.includes(g))continue;i.push(g);const v=o(f,h);for(let n=0;n<v.length;++n)i.push(m+v[n]);a=e+(a.length>0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(Yd.apply(null,arguments))}}const Jd=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Zd=/^\[(?:([a-z-]+):)?(.+)\]$/i,eh=/^\d+\/\d+$/,th=new Set(["px","full","screen"]),nh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rh=/\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$/,oh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ih=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ah=e=>ch(e)||th.has(e)||eh.test(e),lh=e=>Sh(e,"length",Ch),ch=e=>Boolean(e)&&!Number.isNaN(Number(e)),uh=e=>Sh(e,"number",ch),dh=e=>Boolean(e)&&Number.isInteger(Number(e)),hh=e=>e.endsWith("%")&&ch(e.slice(0,-1)),fh=e=>Zd.test(e),ph=e=>nh.test(e),mh=new Set(["length","size","percentage"]),gh=e=>Sh(e,mh,kh),vh=e=>Sh(e,"position",kh),yh=new Set(["image","url"]),bh=e=>Sh(e,yh,jh),xh=e=>Sh(e,"",Eh),wh=()=>!0,Sh=(e,t,n)=>{const r=Zd.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Ch=e=>rh.test(e)&&!oh.test(e),kh=()=>!1,Eh=e=>ih.test(e),jh=e=>sh.test(e),Ph=Xd((()=>{const e=Jd("colors"),t=Jd("spacing"),n=Jd("blur"),r=Jd("brightness"),o=Jd("borderColor"),i=Jd("borderRadius"),s=Jd("borderSpacing"),a=Jd("borderWidth"),l=Jd("contrast"),c=Jd("grayscale"),u=Jd("hueRotate"),d=Jd("invert"),h=Jd("gap"),f=Jd("gradientColorStops"),p=Jd("gradientColorStopPositions"),m=Jd("inset"),g=Jd("margin"),v=Jd("opacity"),y=Jd("padding"),b=Jd("saturate"),x=Jd("scale"),w=Jd("sepia"),S=Jd("skew"),C=Jd("space"),k=Jd("translate"),E=()=>["auto",fh,t],j=()=>[fh,t],P=()=>["",ah,lh],T=()=>["auto",ch,fh],N=()=>["","0",fh],D=()=>[ch,fh];return{cacheSize:500,separator:":",theme:{colors:[wh],spacing:[ah,lh],blur:["none","",ph,fh],brightness:D(),borderColor:[e],borderRadius:["none","","full",ph,fh],borderSpacing:j(),borderWidth:P(),contrast:D(),grayscale:N(),hueRotate:D(),invert:N(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[hh,lh],inset:E(),margin:E(),opacity:D(),padding:j(),saturate:D(),scale:D(),sepia:N(),skew:D(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",fh]}],container:["container"],columns:[{columns:[ph]}],"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",fh]}],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:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dh,fh]}],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",fh]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",dh,fh]}],"grid-cols":[{"grid-cols":[wh]}],"col-start-end":[{col:["auto",{span:["full",dh,fh]},fh]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[wh]}],"row-start-end":[{row:["auto",{span:[dh,fh]},fh]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fh]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fh]}],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:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fh,t]}],"min-w":[{"min-w":[fh,t,"min","max","fit"]}],"max-w":[{"max-w":[fh,t,"none","full","min","max","fit","prose",{screen:[ph]},ph]}],h:[{h:[fh,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fh,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fh,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fh,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ph,lh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uh]}],"font-family":[{font:[wh]}],"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",fh]}],"line-clamp":[{"line-clamp":["none",ch,uh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ah,fh]}],"list-image":[{"list-image":["none",fh]}],"list-style-type":[{list:["none","disc","decimal",fh]}],"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",ah,lh]}],"underline-offset":[{"underline-offset":["auto",ah,fh]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fh]}],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",fh]}],"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",vh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bh]}],"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":[ah,fh]}],"outline-w":[{outline:[ah,lh]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ah,lh]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ph,xh]}],"shadow-color":[{shadow:[wh]}],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",ph,fh]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"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":[w]}],"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",fh]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",fh]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",fh]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[dh,fh]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fh]}],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",fh]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",fh]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ah,lh,uh]}],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 Th(...e){return Ph(Qu(e))}const Nh=Uu,Dh=i.forwardRef((({className:e,...n},r)=>t.jsx(Bu,{ref:r,className:Th("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-0 sm:right-0 sm:bottom-auto sm:flex-col md:max-w-[420px]",e),...n})));Dh.displayName=Bu.displayName;const _h=Zu("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Mh=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx(Vu,{ref:o,className:Th(_h({variant:n}),e),...r})));Mh.displayName=Vu.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(Wu,{ref:r,className:Th("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...n}))).displayName=Wu.displayName;const Oh=i.forwardRef((({className:e,...n},r)=>t.jsx(Gu,{ref:r,className:Th("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...n,children:t.jsx(Ad,{className:"h-4 w-4"})})));Oh.displayName=Gu.displayName;const Rh=i.forwardRef((({className:e,...n},r)=>t.jsx(Ku,{ref:r,className:Th("text-sm font-semibold [&+div]:text-xs",e),...n})));Rh.displayName=Ku.displayName;const Ah=i.forwardRef((({className:e,...n},r)=>t.jsx(Hu,{ref:r,className:Th("text-sm opacity-90",e),...n})));function Lh(){const{toasts:e}=Tc();return t.jsxs(Nh,{children:[e.map((function({id:e,title:n,description:r,action:o,...i}){return t.jsxs(Mh,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Rh,{children:n}),r&&t.jsx(Ah,{children:r})]}),o,t.jsx(Oh,{})]},e)})),t.jsx(Dh,{})]})}Ah.displayName=Hu.displayName;const Ih=n.createContext({});function Fh(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const $h=n.createContext(null),qh=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zh extends i.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 Uh({children:e,isPresent:r,anchorX:o}){const s=n.useId(),a=n.useRef(null),l=n.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=n.useContext(qh);return n.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:i,right:u}=l.current;if(r||!a.current||!e||!t)return;const d="left"===o?`left: ${i}`:`right: ${u}`;a.current.dataset.motionPopId=s;const h=document.createElement("style");return c&&(h.nonce=c),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\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(zh,{isPresent:r,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const Bh=({children:e,initial:r,isPresent:o,onExitComplete:s,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=Fh(Vh),h=n.useId(),f=n.useCallback((e=>{d.set(e,!0);for(const t of d.values())if(!t)return;s&&s()}),[d,s]),p=n.useMemo((()=>({id:h,initial:r,isPresent:o,custom:a,onExitComplete:f,register:e=>(d.set(e,!1),()=>d.delete(e))})),l?[Math.random(),f]:[o,f]);return n.useMemo((()=>{d.forEach(((e,t)=>d.set(t,!1)))}),[o]),i.useEffect((()=>{!o&&!d.size&&s&&s()}),[o]),"popLayout"===c&&(e=t.jsx(Uh,{isPresent:o,anchorX:u,children:e})),t.jsx($h.Provider,{value:p,children:e})};function Vh(){return new Map}function Kh(e=!0){const t=n.useContext($h);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 Hh=e=>e.key||"";function Wh(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const Gh="undefined"!=typeof window,Yh=Gh?n.useLayoutEffect:n.useEffect,Qh=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=Kh(l),h=n.useMemo((()=>Wh(e)),[e]),f=l&&!u?[]:h.map(Hh),p=n.useRef(!0),m=n.useRef(h),g=Fh((()=>new Map)),[v,y]=n.useState(h),[b,x]=n.useState(h);Yh((()=>{p.current=!1,m.current=h;for(let e=0;e<b.length;e++){const t=Hh(b[e]);f.includes(t)?g.delete(t):!0!==g.get(t)&&g.set(t,!1)}}),[b,f.length,f.join("-")]);const w=[];if(h!==v){let e=[...h];for(let t=0;t<b.length;t++){const n=b[t],r=Hh(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===a&&w.length&&(e=w),x(Wh(e)),y(h),null}process;const{forceRender:S}=n.useContext(Ih);return t.jsx(t.Fragment,{children:b.map((e=>{const n=Hh(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(Bh,{isPresent:v,initial:!(p.current&&!o)&&void 0,custom:r,presenceAffectsLayout:s,mode:a,onExitComplete:v?void 0:()=>{if(!g.has(n))return;g.set(n,!0);let e=!0;g.forEach((t=>{t||(e=!1)})),e&&(null==S||S(),x(m.current),l&&(null==d||d()),i&&i())},anchorX:c,children:e},n)}))})},Xh=e=>e;let Jh=Xh,Zh=Xh;function ef(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(Jh=(e,t)=>{},Zh=(e,t)=>{if(!e)throw new Error(t)});const tf=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},nf=e=>1e3*e,rf=e=>e/1e3,of=!1,sf=["read","resolveKeyframes","update","preRender","render","postRender"],af={value:null};function lf(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=sf.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&&af.value&&af.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:sf.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<sf.length;t++)s[sf[t]].cancel(e)},state:o,steps:s}}const{schedule:cf,cancel:uf,state:df,steps:hf}=lf("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Xh,!0),ff=n.createContext({strict:!1}),pf={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"]},mf={};for(const LY in pf)mf[LY]={isEnabled:e=>pf[LY].some((t=>!!e[t]))};const gf=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 vf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gf.has(e)}let yf=e=>!vf(e);try{(bf=require("@emotion/is-prop-valid").default)&&(yf=e=>e.startsWith("on")?!vf(e):bf(e))}catch(RY){}var bf;const xf=new Set;function wf(e,t,n){e||xf.has(t)||xf.add(t)}function Sf(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&wf(!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 Cf=n.createContext({});function kf(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Ef(e){return"string"==typeof e||Array.isArray(e)}const jf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pf=["initial",...jf];function Tf(e){return kf(e.animate)||Pf.some((t=>Ef(e[t])))}function Nf(e){return Boolean(Tf(e)||e.variants)}function Df(e){const{initial:t,animate:r}=function(e,t){if(Tf(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Ef(t)?t:void 0,animate:Ef(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(Cf));return n.useMemo((()=>({initial:t,animate:r})),[_f(t),_f(r)])}function _f(e){return Array.isArray(e)?e.join(" "):e}const Mf=Symbol.for("motionComponentSymbol");function Of(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Rf(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):Of(r)&&(r.current=n))}),[t])}const Af=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Lf="data-"+Af("framerAppearId"),{schedule:If}=lf(queueMicrotask,!1),Ff=n.createContext({});function $f(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(Cf),c=n.useContext(ff),u=n.useContext($h),d=n.useContext(qh).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(Ff);!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:qf(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&Of(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(h.current,r,i,p);const m=n.useRef(!1);n.useInsertionEffect((()=>{f&&m.current&&f.update(r,u)}));const g=r[Lf],v=n.useRef(Boolean(g)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,g))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,g)));return Yh((()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),If.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,g)})),v.current=!1))})),f}function qf(e){if(e)return!1!==e.options.allowProjection?e.projection:qf(e.parent)}function zf({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(qh),...a,layoutId:Uf(a)},{isStatic:d}=u,h=Df(a),f=i(a,d);if(!d&&Gh){!function(e,t){const r=n.useContext(ff).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?Jh(!1,t):Zh(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=mf;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=$f(s,f,u,r,t.ProjectionNode)}return t.jsxs(Cf.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,Rf(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)mf[t]={...mf[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[Mf]=s,u}function Uf({layoutId:e}){const t=n.useContext(Ih).id;return t&&void 0!==e?t+"-"+e:e}const Bf=e=>t=>"string"==typeof t&&t.startsWith(e),Vf=Bf("--"),Kf=Bf("var(--"),Hf=e=>!!Kf(e)&&Wf.test(e.split("/*")[0].trim()),Wf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Gf={};const Yf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qf=new Set(Yf);function Xf(e,{layout:t,layoutId:n}){return Qf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Gf[e]||"opacity"===e)}const Jf=e=>Boolean(e&&e.getVelocity),Zf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ep=(e,t,n)=>n>t?t:n<e?e:n,tp={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},np={...tp,transform:e=>ep(0,1,e)},rp={...tp,default:1},op=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ip=op("deg"),sp=op("%"),ap=op("px"),lp=op("vh"),cp=op("vw"),up={...sp,parse:e=>sp.parse(e)/100,transform:e=>sp.transform(100*e)},dp={borderWidth:ap,borderTopWidth:ap,borderRightWidth:ap,borderBottomWidth:ap,borderLeftWidth:ap,borderRadius:ap,radius:ap,borderTopLeftRadius:ap,borderTopRightRadius:ap,borderBottomRightRadius:ap,borderBottomLeftRadius:ap,width:ap,maxWidth:ap,height:ap,maxHeight:ap,top:ap,right:ap,bottom:ap,left:ap,padding:ap,paddingTop:ap,paddingRight:ap,paddingBottom:ap,paddingLeft:ap,margin:ap,marginTop:ap,marginRight:ap,marginBottom:ap,marginLeft:ap,backgroundPositionX:ap,backgroundPositionY:ap},hp={rotate:ip,rotateX:ip,rotateY:ip,rotateZ:ip,scale:rp,scaleX:rp,scaleY:rp,scaleZ:rp,skew:ip,skewX:ip,skewY:ip,distance:ap,translateX:ap,translateY:ap,translateZ:ap,x:ap,y:ap,z:ap,perspective:ap,transformPerspective:ap,opacity:np,originX:up,originY:up,originZ:ap},fp={...tp,transform:Math.round},pp={...dp,...hp,zIndex:fp,size:ap,fillOpacity:np,strokeOpacity:np,numOctaves:fp},mp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gp=Yf.length;function vp(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(Qf.has(l))s=!0;else if(Vf(l))o[l]=e;else{const t=Zf(e,pp[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<gp;i++){const s=Yf[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=Zf(a,pp[s]);l||(o=!1,r+=`${mp[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 yp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bp(e,t,n){for(const r in t)Jf(t[r])||Xf(r,n)||(e[r]=t[r])}function xp(e,t){const r={};return bp(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return vp(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function wp(e,t){const n={},r=xp(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 Sp=["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 Cp(e){return"string"==typeof e&&!e.includes("-")&&!!(Sp.indexOf(e)>-1||/[A-Z]/u.test(e))}const kp={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ep={offset:"strokeDashoffset",array:"strokeDasharray"};function jp(e,t,n){return"string"==typeof e?e:ap.transform(t+n*e)}function Pp(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(vp(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`${jp(t,e.x,e.width)} ${jp(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?kp:Ep;e[i.offset]=ap.transform(-r);const s=ap.transform(t),a=ap.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const Tp=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Np=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Dp(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Pp(n,t,Np(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};bp(t,e.style,e),i.style={...t,...i.style}}return i}function _p(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(Cp(t)?Dp:wp)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(yf(o)||!0===n&&vf(o)||!t&&!vf(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((()=>Jf(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function Mp(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Op(e,t,n,r){if("function"==typeof t){const[o,i]=Mp(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]=Mp(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const Rp=e=>Array.isArray(e);function Ap(e){const t=Jf(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const Lp=e=>(t,r)=>{const o=n.useContext(Cf),i=n.useContext($h),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:Ip(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():Fh(s)};function Ip(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=Ap(i[h]);let{initial:s,animate:a}=e;const l=Tf(e),c=Nf(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&&!kf(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Op(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 Fp(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Jf(o[s])||t.style&&Jf(t.style[s])||Xf(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 $p={useVisualState:Lp({scrapeMotionValuesFromProps:Fp,createRenderState:yp})};function qp(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(OY){t.dimensions={x:0,y:0,width:0,height:0}}}function zp(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 Up=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 Bp(e,t,n,r){zp(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Up.has(o)?o:Af(o),t.attrs[o])}function Vp(e,t,n){const r=Fp(e,t,n);for(const o in e)if(Jf(e[o])||Jf(t[o])){r[-1!==Yf.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const Kp=["x","y","width","height","cx","cy","r"],Hp={useVisualState:Lp({scrapeMotionValuesFromProps:Vp,createRenderState:Tp,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(Qf.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<Kp.length;a++){const n=Kp[a];e[n]!==t[n]&&(s=!0)}s&&cf.read((()=>{qp(n,r),cf.render((()=>{Pp(r,o,Np(n.tagName),e.transformTemplate),Bp(n,r)}))}))}})};function Wp(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return zf({...Cp(n)?Hp:$p,preloadedFeatures:e,useRender:_p(r),createVisualElement:t,Component:n})}}function Gp(e,t,n){const r=e.getProps();return Op(r,t,void 0!==n?n:r.custom,e)}const Yp=ef((()=>void 0!==window.ScrollTimeline));class Qp{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=>Yp()&&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 Xp extends Qp{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Jp(e,t){return e?e[t]||e.default||e:void 0}const Zp=2e4;function em(e){let t=0;let n=e.next(t);for(;!n.done&&t<Zp;)t+=50,n=e.next(t);return t>=Zp?1/0:t}function tm(e){return"function"==typeof e}function nm(e,t){e.timeline=t,e.onfinish=null}const rm=e=>Array.isArray(e)&&"number"==typeof e[0],om={linearEasing:void 0};function im(e,t){const n=ef(e);return()=>{var e;return null!==(e=om[t])&&void 0!==e?e:n()}}const sm=im((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(OY){return!1}return!0}),"linearEasing"),am=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(tf(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function lm(e){return Boolean("function"==typeof e&&sm()||!e||"string"==typeof e&&(e in um||sm())||rm(e)||Array.isArray(e)&&e.every(lm))}const cm=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,um={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cm([0,.65,.55,1]),circOut:cm([.55,0,1,.45]),backIn:cm([.31,.01,.66,-.59]),backOut:cm([.33,1.53,.69,.99])};function dm(e,t){return e?"function"==typeof e&&sm()?am(e,t):rm(e)?cm(e):Array.isArray(e)?e.map((e=>dm(e,t)||um.easeOut)):um[e]:void 0}const hm={x:!1,y:!1};function fm(){return hm.x||hm.y}function pm(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 mm(e){return!("touch"===e.pointerType||fm())}const gm=(e,t)=>!!t&&(e===t||gm(e,t.parentElement)),vm=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ym=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const bm=new WeakSet;function xm(e){return t=>{"Enter"===t.key&&e(t)}}function wm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Sm(e){return vm(e)&&!fm()}function Cm(e,t,n={}){const[r,o,i]=pm(e,n),s=e=>{const r=e.currentTarget;if(!Sm(e)||bm.has(r))return;bm.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Sm(e)&&bm.has(r)&&(bm.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||gm(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 ym.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=xm((()=>{if(bm.has(n))return;wm(n,"down");const e=xm((()=>{wm(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>wm(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const km=new Set(["width","height","top","left","right","bottom",...Yf]);let Em;function jm(){Em=void 0}const Pm={now:()=>(void 0===Em&&Pm.set(df.isProcessing||of?df.timestamp:performance.now()),Em),set:e=>{Em=e,queueMicrotask(jm)}};function Tm(e,t){-1===e.indexOf(t)&&e.push(t)}function Nm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Dm{constructor(){this.subscriptions=[]}add(e){return Tm(this.subscriptions,e),()=>Nm(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 _m(e,t){return t?e*(1e3/t):0}class Mm{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Pm.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=Pm.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&&wf(!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 Dm);const n=this.events[e].add(t);return"change"===e?()=>{n(),cf.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=Pm.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return _m(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 Om(e,t){return new Mm(e,t)}function Rm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Om(n))}function Am(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Jf(r)&&r.add))return n.add(t);var r}function Lm(e){return e.props[Lf]}const Im=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Fm(e,t,n,r){if(e===t&&n===r)return Xh;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Im(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:Im(o(e),t,r)}const $m=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qm=e=>t=>1-e(1-t),zm=Fm(.33,1.53,.69,.99),Um=qm(zm),Bm=$m(Um),Vm=e=>(e*=2)<1?.5*Um(e):.5*(2-Math.pow(2,-10*(e-1))),Km=e=>1-Math.sin(Math.acos(e)),Hm=qm(Km),Wm=$m(Km),Gm=e=>/^0[^.\s]+$/u.test(e);const Ym=e=>Math.round(1e5*e)/1e5,Qm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Xm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Jm=(e,t)=>n=>Boolean("string"==typeof n&&Xm.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Zm=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(Qm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},eg={...tp,transform:e=>Math.round((e=>ep(0,255,e))(e))},tg={test:Jm("rgb","red"),parse:Zm("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+eg.transform(e)+", "+eg.transform(t)+", "+eg.transform(n)+", "+Ym(np.transform(r))+")"};const ng={test:Jm("#"),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:tg.transform},rg={test:Jm("hsl","hue"),parse:Zm("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+sp.transform(Ym(t))+", "+sp.transform(Ym(n))+", "+Ym(np.transform(r))+")"},og={test:e=>tg.test(e)||ng.test(e)||rg.test(e),parse:e=>tg.test(e)?tg.parse(e):rg.test(e)?rg.parse(e):ng.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?tg.transform(e):rg.transform(e)},ig=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const sg="number",ag="color",lg=/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 cg(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(lg,(e=>(og.test(e)?(r.color.push(i),o.push(ag),n.push(og.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(sg),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function ug(e){return cg(e).values}function dg(e){const{split:t,types:n}=cg(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===sg?Ym(e[i]):t===ag?og.transform(e[i]):e[i]}return o}}const hg=e=>"number"==typeof e?0:e;const fg={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Qm))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(ig))||void 0===n?void 0:n.length)||0)>0},parse:ug,createTransformer:dg,getAnimatableNone:function(e){const t=ug(e);return dg(e)(t.map(hg))}},pg=new Set(["brightness","contrast","saturate","opacity"]);function mg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Qm)||[];if(!r)return e;const o=n.replace(r,"");let i=pg.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const gg=/\b([a-z-]*)\(.*?\)/gu,vg={...fg,getAnimatableNone:e=>{const t=e.match(gg);return t?t.map(mg).join(" "):e}},yg={...pp,color:og,backgroundColor:og,outlineColor:og,fill:og,stroke:og,borderColor:og,borderTopColor:og,borderRightColor:og,borderBottomColor:og,borderLeftColor:og,filter:vg,WebkitFilter:vg},bg=e=>yg[e];function xg(e,t){let n=bg(e);return n!==vg&&(n=fg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wg=new Set(["auto","none","0"]);const Sg=e=>e===tp||e===ap,Cg=(e,t)=>parseFloat(e.split(", ")[t]),kg=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Cg(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Cg(t[1],e):0}},Eg=new Set(["x","y","z"]),jg=Yf.filter((e=>!Eg.has(e)));const Pg={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:kg(4,13),y:kg(5,14)};Pg.translateX=Pg.x,Pg.translateY=Pg.y;const Tg=new Set;let Ng=!1,Dg=!1;function _g(){if(Dg){const e=Array.from(Tg).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 jg.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)}))}Dg=!1,Ng=!1,Tg.forEach((e=>e.complete())),Tg.clear()}function Mg(){Tg.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Dg=!0)}))}class Og{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?(Tg.add(this),Ng||(Ng=!0,cf.read(Mg),cf.resolveKeyframes(_g))):(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),Tg.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Tg.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Rg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ag=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Lg(e,t,n=1){Zh(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=Ag.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 Rg(e)?parseFloat(e):e}return Hf(o)?Lg(o,t,n+1):o}const Ig=e=>t=>t.test(e),Fg=[tp,ap,sp,ip,cp,lp,{test:e=>"auto"===e,parse:e=>e}],$g=e=>Fg.find(Ig(e));class qg extends Og{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(),Hf(n))){const r=Lg(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!km.has(n)||2!==e.length)return;const[r,o]=e,i=$g(r),s=$g(o);if(i!==s)if(Sg(i)&&Sg(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||Gm(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&&!wg.has(t)&&cg(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=xg(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=Pg[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]=Pg[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 zg=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!fg.test(e)&&"0"!==e||e.startsWith("url(")));const Ug=e=>null!==e;function Bg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Ug),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class Vg{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=Pm.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||(Mg(),_g()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Pm.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=zg(o,t),a=zg(i,t);return Jh(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||tm(n))&&r)}(e,n,r,o)){if(!i)return a&&a(Bg(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 Kg=(e,t,n)=>e+(t-e)*n;function Hg(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 Wg(e,t){return n=>n>0?t:e}const Gg=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Yg=[ng,tg,rg];function Qg(e){const t=(n=e,Yg.find((e=>e.test(n))));var n;if(Jh(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===rg&&(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=Hg(a,r,e+1/3),i=Hg(a,r,e),s=Hg(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 Xg=(e,t)=>{const n=Qg(e),r=Qg(t);if(!n||!r)return Wg(e,t);const o={...n};return e=>(o.red=Gg(n.red,r.red,e),o.green=Gg(n.green,r.green,e),o.blue=Gg(n.blue,r.blue,e),o.alpha=Kg(n.alpha,r.alpha,e),tg.transform(o))},Jg=(e,t)=>n=>t(e(n)),Zg=(...e)=>e.reduce(Jg),ev=new Set(["none","hidden"]);function tv(e,t){return n=>Kg(e,t,n)}function nv(e){return"number"==typeof e?tv:"string"==typeof e?Hf(e)?Wg:og.test(e)?Xg:iv:Array.isArray(e)?rv:"object"==typeof e?og.test(e)?Xg:ov:Wg}function rv(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>nv(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function ov(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=nv(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const iv=(e,t)=>{const n=fg.createTransformer(t),r=cg(e),o=cg(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?ev.has(e)&&!o.values.length||ev.has(t)&&!r.values.length?function(e,t){return ev.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Zg(rv(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):(Jh(!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.`),Wg(e,t))};function sv(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Kg(e,t,n);return nv(e)(e,t)}function av(e,t,n){const r=Math.max(t-5,0);return _m(n-e(r),t-r)}const lv=100,cv=10,uv=1,dv=0,hv=800,fv=.3,pv=.3,mv={granular:.01,default:2},gv={granular:.005,default:.5},vv=.01,yv=10,bv=.05,xv=1;function wv({duration:e=hv,bounce:t=fv,velocity:n=dv,mass:r=uv}){let o,i;Jh(e<=nf(yv),"Spring duration must be 10 seconds or less");let s=1-t;s=ep(bv,xv,s),e=ep(vv,yv,rf(e)),s<1?(o=t=>{const r=t*s,o=r*e;return.001-(r-n)/Cv(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=Cv(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<Sv;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=nf(e),isNaN(a))return{stiffness:lv,damping:cv,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Sv=12;function Cv(e,t){return e*Math.sqrt(1-t*t)}const kv=["duration","bounce"],Ev=["stiffness","damping","mass"];function jv(e,t){return t.some((t=>void 0!==e[t]))}function Pv(e=pv,t=fv){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:dv,stiffness:lv,damping:cv,mass:uv,isResolvedFromDuration:!1,...e};if(!jv(e,Ev)&&jv(e,kv))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*ep(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:uv,stiffness:r,damping:o}}else{const n=wv(e);t={...t,...n,mass:uv},t.isResolvedFromDuration=!0}return t}({...n,velocity:-rf(n.velocity||0)}),p=h||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=rf(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?mv.granular:mv.default),o||(o=y?gv.granular:gv.default),m<1){const e=Cv(v,m);b=t=>{const n=Math.exp(-m*v*t);return s-n*((p+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)b=e=>s-Math.exp(-v*e)*(g+(p+v*g)*e);else{const e=v*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return s-n*((p+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:f&&d||null,next:e=>{const t=b(e);if(f)a.done=e>=d;else{let n=0;m<1&&(n=0===e?nf(p):av(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(em(x),Zp),t=am((t=>x.next(e*t).value),e,30);return e+"ms "+t}};return x}function Tv({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 m=d+p,g=void 0===s?m:s(m);g!==m&&(p=g-d);const v=e=>-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let x,w;const S=e=>{var t;(t=h.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=Pv({keyframes:[h.value,f(h.value)],velocity:av(y,e,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),S(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),h)}}}const Nv=Fm(.42,0,1,1),Dv=Fm(0,0,.58,1),_v=Fm(.42,0,.58,1),Mv={linear:Xh,easeIn:Nv,easeInOut:_v,easeOut:Dv,circIn:Km,circInOut:Wm,circOut:Hm,backIn:Um,backInOut:Bm,backOut:zm,anticipate:Vm},Ov=e=>{if(rm(e)){Zh(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Fm(t,n,r,o)}return"string"==typeof e?(Zh(void 0!==Mv[e],`Invalid easing type '${e}'`),Mv[e]):e};function Rv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Zh(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||sv,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]||Xh:t;n=Zg(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](tf(e[r],e[r+1],n))};return n?t=>c(ep(e[0],e[i-1],t)):c}function Av(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(Kg(n,1,tf(0,t,r)))}(t,e.length-1),t}function Lv({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ov):Ov(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:Av(t),e),a=Rv(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||_v)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const Iv=e=>{const t=({timestamp:t})=>e(t);return{start:()=>cf.update(t,!0),stop:()=>uf(t),now:()=>df.isProcessing?df.timestamp:Pm.now()}},Fv={decay:Tv,inertia:Tv,tween:Lv,keyframes:Lv,spring:Pv},$v=e=>e/100;class qv extends Vg{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)||Og)(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=tm(t)?t:Fv[t]||Lv;let a,l;s!==Lv&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Zh(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=Zg($v,sv(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=em(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:m}=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 g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,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=ep(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&void 0!==r&&(x.value=Bg(a,this.options,r)),m&&m(x.value),S&&this.finish(),x}get duration(){const{resolved:e}=this;return e?rf(e.calculatedDuration):0}get time(){return rf(this.currentTime)}set time(e){this.currentTime=e=nf(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=rf(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Iv,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 zv=new Set(["opacity","clipPath","filter","transform"]);function Uv(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=dm(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 Bv=ef((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Vv={anticipate:Vm,backInOut:Bm,circInOut:Wm};class Kv extends Vg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new qg(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&&sm()&&o in Vv&&(o=Vv[o]),tm((c=this.options).type)||"spring"===c.type||!lm(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new qv({...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=Uv(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(nm(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(Bg(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 rf(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return rf(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=nf(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 Xh;const{animation:n}=t;nm(n,e)}else this.pendingTimeline=e;return Xh}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 qv({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=nf(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 Bv()&&n&&zv.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Hv={type:"spring",stiffness:500,damping:25,restSpeed:10},Wv={type:"keyframes",duration:.8},Gv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yv=(e,{keyframes:t})=>t.length>2?Wv:Qf.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Hv:Gv;const Qv=(e,t,n,r={},o,i)=>s=>{const a=Jp(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=nf(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,...Yv(e,u)}),u.duration&&(u.duration=nf(u.duration)),u.repeatDelay&&(u.repeatDelay=nf(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=Bg(u.keyframes,a);if(void 0!==e)return cf.update((()=>{u.onUpdate(e),u.onComplete()})),new Xp([])}return!i&&Kv.supports(u)?new Kv(u):new qv(u)};function Xv({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Jv(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&&Xv(u,d))continue;const o={delay:n,...Jp(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=Lm(e);if(t){const e=window.MotionHandoffAnimation(t,d,cf);null!==e&&(o.startTime=e,a=!0)}}Am(e,d),t.start(Qv(d,t,r,e.shouldReduceMotion&&km.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{cf.update((()=>{a&&function(e,t){const n=Gp(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i)Rm(e,a,Rp(s=i[a])?s[s.length-1]||0:s);var s}(e,a)}))})),c}function Zv(e,t,n={}){var r;const o=Gp(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(Jv(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(ey).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Zv(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 ey(e,t){return e.sortNodePosition(t)}function ty(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 ny=Pf.length;function ry(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&ry(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<ny;n++){const r=Pf[n],o=e.props[r];(Ef(o)||!1===o)&&(t[r]=o)}return t}const oy=[...jf].reverse(),iy=jf.length;function sy(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=>Zv(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Zv(e,t,n);else{const o="function"==typeof t?Gp(e,t,n.custom):t;r=Promise.all(Jv(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function ay(e){let t=sy(e),n=uy(),r=!0;const o=t=>(n,r)=>{var o;const i=Gp(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=ry(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<iy;t++){const h=oy[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],m=Ef(p),g=h===i?f.isActive:null;!1===g&&(d=t);let v=p===a[h]&&p!==s[h]&&m;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===g||!p&&!f.prevProp||kf(p)||"boolean"==typeof p)continue;const y=ly(f.prevProp,p);let b=y||h===i&&f.isActive&&!v&&m||t>d&&m,x=!1;const w=Array.isArray(p)?p:[p];let S=w.reduce(o(h),{});!1===g&&(S={});const{prevResolvedValues:C={}}=f,k={...C,...S},E=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Rp(t)&&Rp(n)?!ty(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=S,f.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(b=!1);b&&(!(v&&y)||x)&&l.push(...w.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=uy(),r=!0}}}function ly(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!ty(t,e)}function cy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uy(){return{animate:cy(!0),whileInView:cy(),whileHover:cy(),whileTap:cy(),whileDrag:cy(),whileFocus:cy(),exit:cy()}}class dy{constructor(e){this.isMounted=!1,this.node=e}update(){}}let hy=0;const fy={animation:{Feature:class extends dy{constructor(e){super(e),e.animationState||(e.animationState=ay(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kf(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 dy{constructor(){super(...arguments),this.id=hy++}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 py(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function my(e){return{point:{x:e.pageX,y:e.pageY}}}function gy(e,t,n,r){return py(e,t,(e=>t=>vm(t)&&e(t,my(t)))(n),r)}const vy=(e,t)=>Math.abs(e-t);class yy{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=wy(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=vy(e.x,t.x),r=vy(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}=df;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=by(t,this.transformPagePoint),cf.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=wy("pointercancel"===e.type?this.lastMoveEventInfo:by(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!vm(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=by(my(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=df;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,wy(i,this.history)),this.removeListeners=Zg(gy(this.contextWindow,"pointermove",this.handlePointerMove),gy(this.contextWindow,"pointerup",this.handlePointerUp),gy(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),uf(this.updatePoint)}}function by(e,t){return t?{point:t(e.point)}:e}function xy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wy({point:e},t){return{point:e,delta:xy(e,Cy(t)),offset:xy(e,Sy(t)),velocity:ky(t,.1)}}function Sy(e){return e[0]}function Cy(e){return e[e.length-1]}function ky(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Cy(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>nf(t)));)n--;if(!r)return{x:0,y:0};const i=rf(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 Ey(e){return e.max-e.min}function jy(e,t,n,r=.5){e.origin=r,e.originPoint=Kg(t.min,t.max,e.origin),e.scale=Ey(n)/Ey(t),e.translate=Kg(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 Py(e,t,n,r){jy(e.x,t.x,n.x,r?r.originX:void 0),jy(e.y,t.y,n.y,r?r.originY:void 0)}function Ty(e,t,n){e.min=n.min+t.min,e.max=e.min+Ey(t)}function Ny(e,t,n){e.min=t.min-n.min,e.max=e.min+Ey(t)}function Dy(e,t,n){Ny(e.x,t.x,n.x),Ny(e.y,t.y,n.y)}function _y(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 My(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 Oy=.35;function Ry(e,t,n){return{min:Ay(e,t),max:Ay(e,n)}}function Ay(e,t){return"number"==typeof e?e:e[t]||0}const Ly=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Iy(e){return[e("x"),e("y")]}function Fy({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $y(e){return void 0===e||1===e}function qy({scale:e,scaleX:t,scaleY:n}){return!$y(e)||!$y(t)||!$y(n)}function zy(e){return qy(e)||Uy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Uy(e){return By(e.x)||By(e.y)}function By(e){return e&&"0%"!==e}function Vy(e,t,n){return n+t*(e-n)}function Ky(e,t,n,r,o){return void 0!==o&&(e=Vy(e,o,r)),Vy(e,n,r)+t}function Hy(e,t=0,n=1,r,o){e.min=Ky(e.min,t,n,r,o),e.max=Ky(e.max,t,n,r,o)}function Wy(e,{x:t,y:n}){Hy(e.x,t.translate,t.scale,t.originPoint),Hy(e.y,n.translate,n.scale,n.originPoint)}const Gy=.999999999999,Yy=1.0000000000001;function Qy(e,t){e.min=e.min+t,e.max=e.max+t}function Xy(e,t,n,r,o=.5){Hy(e,t,n,Kg(e.min,e.max,o),r)}function Jy(e,t){Xy(e.x,t.x,t.scaleX,t.scale,t.originX),Xy(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zy(e,t){return Fy(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 eb=({current:e})=>e?e.ownerDocument.defaultView:null,tb=new WeakMap;class nb{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 yy(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(my(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?hm[i]?null:(hm[i]=!0,()=>{hm[i]=!1}):hm.x||hm.y?null:(hm.x=hm.y=!0,()=>{hm.x=hm.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),Iy((e=>{let t=this.getAxisMotionValue(e).get()||0;if(sp.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Ey(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&cf.postRender((()=>o(e,t))),Am(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:()=>Iy((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:eb(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&&cf.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||!rb(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?Kg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Kg(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&&Of(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:_y(e.x,n,o),y:_y(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Oy){return!1===e?e=0:!0===e&&(e=Oy),{x:Ry(e,"left","right"),y:Ry(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Iy((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||!Of(e))return!1;const n=e.current;Zh(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=Zy(e,n),{scroll:o}=t;return o&&(Qy(r.x,o.offset.x),Qy(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:My(e.x,t.x),y:My(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=Fy(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Iy((s=>{if(!rb(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 Am(this.visualElement,e),n.start(Qv(e,n,0,t,this.visualElement,!1))}stopAnimation(){Iy((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Iy((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){Iy((t=>{const{drag:n}=this.getProps();if(!rb(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]-Kg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Of(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Iy((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=Ey(e),o=Ey(t);return o>r?n=tf(t.min,t.max-r,e.min):r>o&&(n=tf(e.min,e.max-o,t.min)),ep(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(),Iy((t=>{if(!rb(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Kg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;tb.set(this.visualElement,this);const e=gy(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();Of(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()),cf.read(t);const o=py(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Iy((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=Oy,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function rb(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ob=e=>(t,n)=>{e&&cf.postRender((()=>e(t,n)))};const ib={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function sb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ab={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ap.test(e))return e;e=parseFloat(e)}return`${sb(e,t.target.x)}% ${sb(e,t.target.y)}%`}},lb={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=fg.parse(e);if(o.length>5)return r;const i=fg.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=Kg(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 cb 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)Gf[t]=e[t],Vf(t)&&(Gf[t].isCSSVariable=!0)}(db),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()})),ib.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()||cf.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),If.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 ub(e){const[r,o]=Kh(),i=n.useContext(Ih);return t.jsx(cb,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(Ff),isPresent:r,safeToRemove:o})}const db={borderRadius:{...ab,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ab,borderTopRightRadius:ab,borderBottomLeftRadius:ab,borderBottomRightRadius:ab,boxShadow:lb};const hb=(e,t)=>e.depth-t.depth;class fb{constructor(){this.children=[],this.isDirty=!1}add(e){Tm(this.children,e),this.isDirty=!0}remove(e){Nm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hb),this.isDirty=!1,this.children.forEach(e)}}const pb=["TopLeft","TopRight","BottomLeft","BottomRight"],mb=pb.length,gb=e=>"string"==typeof e?parseFloat(e):e,vb=e=>"number"==typeof e||ap.test(e);function yb(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const bb=wb(0,.5,Hm),xb=wb(.5,.95,Xh);function wb(e,t,n){return r=>r<e?0:r>t?1:n(tf(e,t,r))}function Sb(e,t){e.min=t.min,e.max=t.max}function Cb(e,t){Sb(e.x,t.x),Sb(e.y,t.y)}function kb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Eb(e,t,n,r,o){return e=Vy(e-=t,1/n,r),void 0!==o&&(e=Vy(e,1/o,r)),e}function jb(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){sp.test(t)&&(t=parseFloat(t),t=Kg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Kg(i.min,i.max,r);e===i&&(a-=t),e.min=Eb(e.min,t,n,a,o),e.max=Eb(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Pb=["x","scaleX","originX"],Tb=["y","scaleY","originY"];function Nb(e,t,n,r){jb(e.x,t,Pb,n?n.x:void 0,r?r.x:void 0),jb(e.y,t,Tb,n?n.y:void 0,r?r.y:void 0)}function Db(e){return 0===e.translate&&1===e.scale}function _b(e){return Db(e.x)&&Db(e.y)}function Mb(e,t){return e.min===t.min&&e.max===t.max}function Ob(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rb(e,t){return Ob(e.x,t.x)&&Ob(e.y,t.y)}function Ab(e){return Ey(e.x)/Ey(e.y)}function Lb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ib{constructor(){this.members=[]}add(e){Tm(this.members,e),e.scheduleRender()}remove(e){if(Nm(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 Fb=["","X","Y","Z"],$b={visibility:"hidden"};let qb=0;function zb(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ub(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Lm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",cf,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ub(r)}function Bb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=qb++,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(Hb),this.nodes.forEach(Zb),this.nodes.forEach(ex),this.nodes.forEach(Wb)},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 fb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Dm),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=Pm.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(uf(r),e(i-t))};return cf.read(r,!0),()=>uf(r)}(r,250),ib.hasAnimatedSinceResize&&(ib.hasAnimatedSinceResize=!1,this.nodes.forEach(Jb))}))}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()||sx,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Rb(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={...Jp(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Jb(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,uf(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(tx),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&&Ub(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(Yb);this.isUpdating||this.nodes.forEach(Qb),this.isUpdating=!1,this.nodes.forEach(Xb),this.nodes.forEach(Vb),this.nodes.forEach(Kb),this.clearAllSnapshots();const e=Pm.now();df.delta=ep(0,1e3/60,e-df.timestamp),df.timestamp=e,df.isProcessing=!0,hf.update.process(df),hf.preRender.process(df),hf.render.process(df),df.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,If.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gb),this.sharedNodes.forEach(nx)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,cf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){cf.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Ey(this.snapshot.measuredBox.x)||Ey(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&&!_b(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||zy(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)),cx((r=n).x),cx(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(dx))){const{scroll:e}=this.root;e&&(Qy(n.x,e.offset.x),Qy(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Cb(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&&Cb(n,e),Qy(n.x,o.offset.x),Qy(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Cb(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&&Jy(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),zy(e.latestValues)&&Jy(n,e.latestValues)}return zy(this.latestValues)&&Jy(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Cb(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!zy(e.latestValues))continue;qy(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Cb(r,e.measurePageBox()),Nb(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return zy(this.latestValues)&&Nb(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!==df.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=df.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}},Dy(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Cb(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(),Ty((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),Ty(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Cb(this.target,this.layout.layoutBox),Wy(this.target,this.targetDelta)):Cb(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}},Dy(this.relativeTargetOrigin,this.target,e.target),Cb(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!qy(this.parent.latestValues)&&!Uy(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===df.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;Cb(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&&Jy(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Wy(e,s)),r&&zy(i.latestValues)&&Jy(e,i.latestValues))}t.x<Yy&&t.x>Gy&&(t.x=1),t.y<Yy&&t.y>Gy&&(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?(kb(this.prevProjectionDelta.x,this.projectionDelta.x),kb(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Py(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Lb(this.projectionDelta.x,this.prevProjectionDelta.x)&&Lb(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(ix));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,m,g;rx(i.x,e.x,n),rx(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dy(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ox((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(m=s).x,g=n),ox(f.y,p.y,m.y,g),d&&(Mb((l=this.relativeTarget).x,(h=d).x)&&Mb(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Cb(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Kg(0,void 0!==n.opacity?n.opacity:1,bb(r)),e.opacityExit=Kg(void 0!==t.opacity?t.opacity:1,0,xb(r))):i&&(e.opacity=Kg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<mb;s++){const o=`border${pb[s]}Radius`;let i=yb(t,o),a=yb(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||vb(i)===vb(a)?(e[o]=Math.max(Kg(gb(i),gb(a),r),0),(sp.test(a)||sp.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=Kg(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&&(uf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=cf.update((()=>{ib.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Jf(e)?e:Om(e);return r.start(Qv("",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&&ux(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Ey(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Ey(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Cb(t,n),Jy(t,o),Py(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ib);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&&zb("z",e,r,this.animationValues);for(let o=0;o<Fb.length;o++)zb(`rotate${Fb[o]}`,e,r,this.animationValues),zb(`skew${Fb[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 $b;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Ap(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=Ap(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!zy(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 Gf){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=Gf[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?Ap(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(Yb),this.root.sharedNodes.clear()}}}function Vb(e){e.updateLayout()}function Kb(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?Iy((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Ey(r);r.min=t[e].min,r.max=r.min+o})):ux(o,n.layoutBox,t)&&Iy((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Ey(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}};Py(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?Py(a,e.applyTransform(r,!0),n.measuredBox):Py(a,t,n.layoutBox);const l=!_b(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}};Dy(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Dy(a,t,i.layoutBox),Rb(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 Hb(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 Wb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gb(e){e.clearSnapshot()}function Yb(e){e.clearMeasurements()}function Qb(e){e.isLayoutDirty=!1}function Xb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Zb(e){e.resolveTargetDelta()}function ex(e){e.calcProjection()}function tx(e){e.resetSkewAndRotation()}function nx(e){e.removeLeadSnapshot()}function rx(e,t,n){e.translate=Kg(t.translate,0,n),e.scale=Kg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ox(e,t,n,r){e.min=Kg(t.min,n.min,r),e.max=Kg(t.max,n.max,r)}function ix(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const sx={duration:.45,ease:[.4,0,.1,1]},ax=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),lx=ax("applewebkit/")&&!ax("chrome/")?Math.round:Xh;function cx(e){e.min=lx(e.min),e.max=lx(e.max)}function ux(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Ab(t),o=Ab(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function dx(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const hx=Bb({attachResizeListener:(e,t)=>py(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fx={current:void 0},px=Bb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fx.current){const e=new hx({});e.mount(window),e.setOptions({layoutScroll:!0}),fx.current=e}return fx.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),mx={pan:{Feature:class extends dy{constructor(){super(...arguments),this.removePointerDownListener=Xh}onPointerDown(e){this.session=new yy(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ob(e),onStart:ob(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&cf.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=gy(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 dy{constructor(e){super(e),this.removeGroupControls=Xh,this.removeListeners=Xh,this.controls=new nb(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xh}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:px,MeasureLayout:ub}};function gx(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&cf.postRender((()=>o(t,my(t))))}function vx(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&&cf.postRender((()=>o(t,my(t))))}const yx=new WeakMap,bx=new WeakMap,xx=e=>{const t=yx.get(e.target);t&&t(e)},wx=e=>{e.forEach(xx)};function Sx(e,t,n){const r=function({root:e,...t}){const n=e||document;bx.has(n)||bx.set(n,{});const r=bx.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(wx,{root:e,...t})),r[o]}(t);return yx.set(e,n),r.observe(e),()=>{yx.delete(e),r.unobserve(e)}}const Cx={some:0,all:1};const kx={inView:{Feature:class extends dy{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 Sx(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Cx[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 dy{mount(){const{current:e}=this.node;e&&(this.unmount=Cm(e,((e,t)=>(vx(this.node,t,"Start"),(e,{success:t})=>vx(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends dy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(OY){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=Zg(py(this.node.current,"focus",(()=>this.onFocus())),py(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends dy{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=pm(e,n),s=e=>{if(!mm(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{mm(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)=>(gx(this.node,t,"Start"),e=>gx(this.node,e,"End")))))}unmount(){}}}},Ex={layout:{ProjectionNode:px,MeasureLayout:ub}},jx={current:null},Px={current:!1};const Tx=[...Fg,og,fg],Nx=new WeakMap;const Dx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _x{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=Og,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=Pm.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,cf.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=Tf(t),this.isVariantNode=Nf(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]&&Jf(e)&&e.set(a[h],!1)}}mount(e){this.current=e,Nx.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))),Px.current||function(){if(Px.current=!0,Gh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>jx.current=e.matches;e.addListener(t),t()}else jx.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||jx.current),"production"!==process.env.NODE_ENV&&wf(!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(),uf(this.notifyUpdate),uf(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=Qf.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&cf.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 mf){const t=mf[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<Dx.length;n++){const t=Dx[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(Jf(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&wf("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(Jf(i))e.addValue(r,Om(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,Om(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=Om(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&&(Rg(r)||Gm(r))?r=parseFloat(r):!Tx.find(Ig(r))&&fg.test(t)&&(r=xg(e,t)),this.setBaseTarget(e,Jf(r)?r.get():r)),Jf(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=Op(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||Jf(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 Dm),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Mx extends _x{constructor(){super(...arguments),this.KeyframeResolver=qg}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;Jf(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class Ox extends Mx{constructor(){super(...arguments),this.type="html",this.renderInstance=zp}readValueFromInstance(e,t){if(Qf.has(t)){const e=bg(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(Vf(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zy(e,t)}build(e,t,n){vp(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Fp(e,t,n)}}class Rx extends Mx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ly,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&qp(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Qf.has(t)){const e=bg(t);return e&&e.default||0}return t=Up.has(t)?t:Af(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Vp(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&cf.postRender(this.updateDimensions)}build(e,t,n){Pp(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Bp(e,t,0,r)}mount(e){this.isSVGTag=Np(e.tagName),super.mount(e)}}const Ax=Sf(Wp({...fy,...kx,...mx,...Ex},((e,t)=>Cp(e)?new Rx(t):new Ox(t,{allowProjection:e!==n.Fragment})))),Lx=({children:e,className:n,key:r})=>t.jsx(Ax.div,{initial:{opacity:0,filter:"blur(8px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(8px)"},transition:{duration:.3,ease:"easeInOut"},className:n,children:e},r),Ix=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),Fx=({size:e=35,color:r="black",speed:o=.9,strokeWidth:i=3.5,text:s,textSpeed:a=2e3,textColor:l="black"})=>{const[c,u]=n.useState(0),d=Array.isArray(s)?s:s?[s]:[];return n.useEffect((()=>{if(d.length<=1)return;if(c>=d.length-1)return;const e=setInterval((()=>{u((e=>e<d.length-1?e+1:e))}),a);return()=>clearInterval(e)}),[d.length,a,c]),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"})]}),d.length>0&&t.jsx("div",{className:"text-center text-sm text-muted-foreground animate-fade-in "+(l?`text-${l}`:""),children:t.jsx(Ix,{children:d[c]})},c),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 "})]})})},$x="/segments",qx="/automations",zx="/channel/senders",Ux="/communication-groups",Bx=async(e,t)=>(await Ja(`${qx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,Vx=e=>{const t=ue({queryKey:["automations",e],queryFn:()=>(async e=>(await Ja(`${qx}/${e}`)).data)(e)});return{automation:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomation:t.refetch}},Kx=e=>{const t=ue({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await Ja(`${qx}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},Hx=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(qx,{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}},Wx=e=>{const t=ne(),n=de({mutationFn:t=>Bx(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},Gx=e=>{const t=ue({queryKey:["automations",e,"statistics"],queryFn:()=>(async e=>{if(e)return(await Ja(`${qx}/${e}/statistics`)).data;return(await Ja(`${qx}/statistics`)).data})(e)});return{statistics:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error}};var Yx=(e=>(e.ONE_TIME="one_time",e))(Yx||{}),Qx=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.SCHEDULED="scheduled",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(Qx||{});const Xx={CloseButton:Ad,DropdownMenuTrigger:ad,UserIcon:Md,UsersIcon:Od,UserEdit:Dd,ScheduleButton:id,SendButton:Pd,BackButton:ld,NextButton:cd,MergeField:_d,PlusIcon:Ed,AlertCircleIcon:hd,OneTimeBroadcast:wd,PatronEntersList:vd,DateMilestone:id,RealtimeActivity:od,EmailIcon:bd,SmsIcon:Sd,MessagesSent:yd,LinksClicked:kd,OpenRate:md,SpamComplies:Nd,TotalBounceRate:Nd,UnsubscribeRate:Td},Jx=e=>({...Xx,...e||{}});var Zx=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(nw);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(ew,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(ew,{...o,ref:n,children:r})}));Zx.displayName="Slot";var ew=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)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!==i.Fragment&&(o.ref=t?_c(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));ew.displayName="SlotClone";var tw=({children:e})=>t.jsx(t.Fragment,{children:e});function nw(e){return i.isValidElement(e)&&e.type===tw}const rw={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"},ow=Zu([rw.base],{variants:{variant:{default:rw.default,destructive:rw.destructive,outline:rw.outline,secondary:rw.secondary,ghost:rw.ghost,link:rw.link},size:{default:rw["size-default"],sm:rw["size-sm"],lg:rw["size-lg"],icon:rw["size-icon"]}},defaultVariants:{variant:"default",size:"default"}}),iw=i.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?Zx:"button",{className:Th(ow({variant:n,size:r,className:e})),ref:s,...i})));iw.displayName="Button";const sw=({onClose:e,currentStep:n,setCurrentStep:r,isDisabled:o,createAutomation:i})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(iw,{className:Th("px-4 py-2"),onClick:()=>{if("choose-automation-type"===n)e?.(!1);else{if("set-automation-name"!==n)throw new Error("Invalid step");r("choose-automation-type")}},children:"choose-automation-type"===n?"Cancel":"Back"}),t.jsx(iw,{className:Th("px-4 py-2"),onClick:()=>{o||i()},disabled:o,children:"set-automation-name"===n?"Create":"Next"})]})}),aw=({onClick:e,title:n,subtitle:r,icon:o,selected:i,disabled:s=!1})=>t.jsxs("button",{onClick:e,className:"flex flex-col items-center justify-center rounded-lg border-[3px] p-4 transition-all duration-300 ease-in-out "+(s?"opacity-50 cursor-not-allowed":i?"scale-[1.02] hover:scale-[1.04] border-primary bg-primary/5":"border-gray-200 hover:border-primary hover:bg-gray-50"),children:[o,t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:n}),t.jsx("div",{className:"text-xs text-gray-500",children:r})]})]}),lw="text-3xl mb-8",cw="grid grid-cols-2 gap-6",uw="relative p-6 rounded-lg",dw=({onNext:e,iconDefinitions:n})=>t.jsxs("div",{className:uw,children:[t.jsx("h1",{className:lw,children:"Choose Your Automation Type"}),t.jsxs("div",{className:cw,children:[t.jsx(aw,{onClick:()=>{e(Yx.ONE_TIME)},title:"One-Time Broadcast",subtitle:"Send a single message to your current list, like announcing a sale or newsletter.",icon:t.jsx(n.OneTimeBroadcast,{}),selected:!1}),t.jsx(aw,{onClick:()=>{},title:"Patron Enters a List",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.PatronEntersList,{}),selected:!1,disabled:!0}),t.jsx(aw,{onClick:()=>{},title:"Date Milestone",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.DateMilestone,{}),selected:!1,disabled:!0}),t.jsx(aw,{onClick:()=>{},title:"Realtime Activity",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.RealtimeActivity,{}),selected:!1,disabled:!0})]})]});function hw(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const fw="mb-4 flex items-center justify-center",pw="text-lg font-medium mb-2",mw="text-sm text-gray-600",gw=({iconDefinitions:e})=>t.jsxs("div",{children:[t.jsx("div",{className:fw,children:t.jsx(e.OneTimeBroadcast,{})}),t.jsx("h3",{className:pw,children:"One-Time Broadcast"}),t.jsx("p",{className:mw,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),vw=({selectedType:e,setAutomationName:n,automationName:r,iconDefinitions:o})=>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===Yx.ONE_TIME)return t.jsx(gw,{iconDefinitions:o});throw hw(e,Yx)})()}),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:"This name is for your internal reference only - your customers won't see it"})]})]})]}),yw=({onClose:e,iconDefinitions:r})=>{const{createAutomation:o,isCreating:i}=Hx(),[s,a]=n.useState(!1),l=Jx(r),[c,u]=n.useState("choose-automation-type"),[d,h]=n.useState({name:void 0,type:void 0}),f=void 0!==d.name&&void 0!==d.type;n.useEffect((()=>{if(d.type&&!d.name){const e=new Date,t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=`Campaign ${e.toLocaleDateString([],{month:"long",day:"numeric"})} ${t}`;h((e=>({...e,name:n})))}}),[d]);return i||s?t.jsx("div",{className:uw,children:t.jsx(Fx,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(Qh,{mode:"wait",children:["choose-automation-type"===c&&t.jsx(Lx,{children:t.jsx(dw,{onNext:e=>{h({...d,type:e}),u("set-automation-name")},iconDefinitions:l})},"choose-automation-type"),"set-automation-name"===c&&d.type&&t.jsx(Lx,{children:t.jsx(vw,{iconDefinitions:l,selectedType:d.type,setAutomationName:e=>{h({...d,name:e})},automationName:d.name??""})},"set-automation-name")]}),t.jsx("div",{className:"pt-2",children:t.jsx(sw,{onClose:e,currentStep:c,setCurrentStep:u,isDisabled:!f,createAutomation:async()=>{if(!f||!d.name||!d.type)return;a(!0);o({name:d.name,type:d.type},{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{h({name:void 0,type:void 0})}})}})})]})};var bw={};Object.defineProperty(bw,"__esModule",{value:!0}),bw.parse=function(e,t){const n=new Ew,r=e.length;if(r<2)return n;const o=t?.decode||Tw;let i=0;do{const t=e.indexOf("=",i);if(-1===t)break;const s=e.indexOf(";",i),a=-1===s?r:s;if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}const l=jw(e,i,t),c=Pw(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=jw(e,t+1,a),i=Pw(e,a,r);const s=o(e.slice(r,i));n[u]=s}i=a+1}while(i<r);return n},bw.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!xw.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!ww.test(o))throw new TypeError(`argument val is invalid: ${t}`);let i=e+"="+o;if(!n)return i;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);i+="; Max-Age="+n.maxAge}if(n.domain){if(!Sw.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Cw.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);i+="; Path="+n.path}if(n.expires){if(!function(e){return"[object Date]"===kw.call(e)}
|
|
34
|
+
/**
|
|
35
|
+
* react-router v7.1.0
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Remix Software Inc.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
41
|
+
*
|
|
42
|
+
* @license MIT
|
|
43
|
+
*/(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);i+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(i+="; HttpOnly");n.secure&&(i+="; Secure");n.partitioned&&(i+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}}return i};const xw=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,ww=/^[\u0021-\u003A\u003C-\u007E]*$/,Sw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Cw=/^[\u0020-\u003A\u003D-\u007E]*$/,kw=Object.prototype.toString,Ew=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function jw(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Pw(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Tw(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(OY){return e}}function Nw(e,t){if(!1===e||null==e)throw new Error(t)}function Dw(e,t){if(!e)try{throw new Error(t)}catch(OY){}}function _w({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function Mw(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ow(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?Mw(t):t,i=Ww(o.pathname||"/",n);if(null==i)return null;let s=Rw(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let a=null;for(let l=0;null==a&&l<s.length;++l){let e=Hw(i);a=Vw(s[l],e,r)}return a}(e,t,n,!1)}function Rw(e,t=[],n=[],r=""){let o=(e,o,i)=>{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(Nw(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let a=Xw([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Nw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),Rw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Bw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of Aw(e.path))o(e,t,n);else o(e,t)})),t}function Aw(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let s=Aw(r.join("/")),a=[];return a.push(...s.map((e=>""===e?i:[i,e].join("/")))),o&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}var Lw=/^:[\w-]+$/,Iw=3,Fw=2,$w=1,qw=10,zw=-2,Uw=e=>"*"===e;function Bw(e,t){let n=e.split("/"),r=n.length;return n.some(Uw)&&(r+=zw),t&&(r+=Fw),n.filter((e=>!Uw(e))).reduce(((e,t)=>e+(Lw.test(t)?Iw:""===t?$w:qw)),r)}function Vw(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Kw({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Kw({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:Xw([i,u.pathname]),pathnameBase:Jw(Xw([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=Xw([i,u.pathnameBase]))}return s}function Kw(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Dw("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){s=i.slice(0,i.length-(a[r]||"").length).replace(/(.)\/+$/,"$1")}const o=a[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function Hw(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Dw(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ww(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Gw(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yw(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function Qw(e,t,n,r=!1){let o;"string"==typeof e?o=Mw(e):(o={...e},Nw(!o.pathname||!o.pathname.includes("?"),Gw("?","pathname","search",o)),Nw(!o.pathname||!o.pathname.includes("#"),Gw("#","pathname","hash",o)),Nw(!o.search||!o.search.includes("#"),Gw("#","search","hash",o)));let i,s=""===e||""===o.pathname,a=s?"/":o.pathname;if(null==a)i=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Mw(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:Zw(r),hash:eS(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var Xw=e=>e.join("/").replace(/\/\/+/g,"/"),Jw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Zw=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",eS=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var tS=["POST","PUT","PATCH","DELETE"];new Set(tS);var nS=["GET",...tS];new Set(nS);var rS=i.createContext(null);rS.displayName="DataRouter";var oS=i.createContext(null);oS.displayName="DataRouterState";var iS=i.createContext({isTransitioning:!1});iS.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var sS=i.createContext(null);sS.displayName="Navigation";var aS=i.createContext(null);aS.displayName="Location";var lS=i.createContext({outlet:null,matches:[],isDataRoute:!1});lS.displayName="Route";var cS=i.createContext(null);function uS(){return null!=i.useContext(aS)}function dS(){return Nw(uS(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(aS).location}cS.displayName="RouteError";var hS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fS(e){i.useContext(sS).static||i.useLayoutEffect(e)}function pS(){let{isDataRoute:e}=i.useContext(lS);return e?function(){let{router:e}=function(e){let t=i.useContext(rS);return Nw(t,wS(e)),t}("useNavigate"),t=SS("useNavigate"),n=i.useRef(!1);return fS((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Dw(n.current,hS),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Nw(uS(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(rS),{basename:t,navigator:n}=i.useContext(sS),{matches:r}=i.useContext(lS),{pathname:o}=dS(),s=JSON.stringify(Yw(r)),a=i.useRef(!1);return fS((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Dw(a.current,hS),!a.current)return;if("number"==typeof r)return void n.go(r);let l=Qw(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:Xw([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function mS(e,{relative:t}={}){let{matches:n}=i.useContext(lS),{pathname:r}=dS(),o=JSON.stringify(Yw(n));return i.useMemo((()=>Qw(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function gS(e,t,n,r){Nw(uS(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(sS),{matches:a}=i.useContext(lS),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let e=h&&h.path||"";kS(u,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}o=dS();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Ow(e,{pathname:p});Dw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Dw(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=function(e,t=[],n=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,o=n?.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&void 0!==o?.[e.route.id]));Nw(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let s=!1,a=-1;if(n)for(let i=0;i<r.length;i++){let e=r[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(a=i),e.route.id){let{loaderData:t,errors:o}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!o||void 0===o[e.route.id]);if(e.route.lazy||i){s=!0,r=a>=0?r.slice(0,a+1):[r[0]];break}}}return r.reduceRight(((e,l,c)=>{let u,d=!1,h=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||yS,s&&(a<0&&0===c?(kS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):a===c&&(d=!0,f=l.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?h:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(xS,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(bS,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Xw([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:Xw([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function vS(){let e=function(){let e=i.useContext(cS),t=function(e){let t=i.useContext(oS);return Nw(t,wS(e)),t}("useRouteError"),n=SS("useRouteError");if(void 0!==e)return e;return t.errors?.[n]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return a=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,a)}i.createContext(null);var yS=i.createElement(vS,null),bS=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(lS.Provider,{value:this.props.routeContext},i.createElement(cS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function xS({routeContext:e,match:t,children:n}){let r=i.useContext(rS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(lS.Provider,{value:e},n)}function wS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function SS(e){let t=function(e){let t=i.useContext(lS);return Nw(t,wS(e)),t}(e),n=t.matches[t.matches.length-1];return Nw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var CS={};function kS(e,t,n){t||CS[e]||(CS[e]=!0,Dw(!1,n))}i.memo((function({routes:e,future:t,state:n}){return gS(e,0,n,t)}));var ES="get",jS="application/x-www-form-urlencoded";function PS(e){return null!=e&&"string"==typeof e.tagName}function TS(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var NS=null;var DS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _S(e){return null==e||DS.has(e)?e:(Dw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jS}"`),null)}function MS(e,t){let n,r,o,i,s;if(function(e){return PS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?Ww(s,t):null,n=e.getAttribute("method")||ES,o=_S(e.getAttribute("enctype"))||jS,i=new FormData(e)}else if(function(e){return PS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return PS(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||s.getAttribute("action");if(r=a?Ww(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||ES,o=_S(e.getAttribute("formenctype"))||_S(s.getAttribute("enctype"))||jS,i=new FormData(s,e),!function(){if(null===NS)try{new FormData(document.createElement("form"),0),NS=!1}catch(OY){NS=!0}return NS}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(PS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ES,r=null,o=jS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function OS(e,t){if(!1===e||null==e)throw new Error(t)}function RS(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function AS(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce(((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return window.__reactRouterContext&&window,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(RS).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function LS(e,t,n,r,o,i){let s=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>s(e,t)||a(e,t))):"data"===i?t.filter(((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,i)||a(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function IS(e,t){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r})).flat(1),[...new Set(n)];var n}var FS=i.createContext(void 0);function $S(){let e=i.useContext(FS);return OS(e,"You must render this element inside a <HydratedRouter> element"),e}function qS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function zS({page:e,...t}){let{router:n}=function(){let e=i.useContext(rS);return OS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>Ow(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(US,{page:e,matches:r,...t}):null}function US({page:e,matches:t,...n}){let r=dS(),{manifest:o,routeModules:s}=$S(),{loaderData:a,matches:l}=function(){let e=i.useContext(oS);return OS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>LS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>LS(e,t,l,o,r,"assets")),[e,t,l,o,r]),d=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach((e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in a&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))})),0===n.size)return[];let l=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname="/"===t.pathname?"_root.data":`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return i&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[a,r,o,c,t,e,s]),h=i.useMemo((()=>IS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=$S(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return AS(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return i.createElement(i.Fragment,null,d.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),h.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}function BS(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}FS.displayName="FrameworkContext";var VS="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{VS&&(window.__reactRouterVersion="7.1.0")}catch(OY){}var KS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HS=i.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...h},f){let p,{basename:m}=i.useContext(sS),g="string"==typeof c&&KS.test(c),v=!1;if("string"==typeof c&&g&&(p=c,VS))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Ww(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(OY){Dw(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){Nw(uS(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(sS),{hash:o,pathname:s,search:a}=mS(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:Xw([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(FS),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,f=i.useRef(null);i.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let p=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:qS(l,p),onBlur:qS(c,m),onMouseEnter:qS(u,p),onMouseLeave:qS(d,m),onTouchStart:qS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=pS(),c=dS(),u=mS(e,{relative:s});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==n?n:_w(c)===_w(u);l(e,{replace:t,state:r,preventScrollReset:o,relative:s,viewTransition:a})}}),[c,l,u,n,r,t,e,o,s,a])}(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});let C=i.createElement("a",{...h,...w,href:p||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:BS(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(zS,{page:y})):C}));function WS(e){let t=i.useContext(rS);return Nw(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function GS(e){Dw("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(TS(e)),n=i.useRef(!1),r=dS(),o=i.useMemo((()=>function(e,t){let n=TS(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),s=pS(),a=i.useCallback(((e,t)=>{const r=TS("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}HS.displayName="Link",i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:s,viewTransition:a,children:l,...c},u){let d=mS(s,{relative:c.relative}),h=dS(),f=i.useContext(oS),{navigator:p,basename:m}=i.useContext(sS),g=null!=f&&function(e,t={}){let n=i.useContext(iS);Nw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=WS("useViewTransitionState"),o=mS(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Ww(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Ww(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Kw(o.pathname,a)||null!=Kw(o.pathname,s)}(d)&&!0===a,v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&m&&(b=Ww(b,m)||b);const x="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,S=y===v||!r&&y.startsWith(v)&&"/"===y.charAt(x),C=null!=b&&(b===v||!r&&b.startsWith(v)&&"/"===b.charAt(v.length)),k={isActive:S,isPending:C,isTransitioning:g},E=S?e:void 0;w="function"==typeof n?n(k):[n,S?"active":null,C?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let j="function"==typeof o?o(k):o;return i.createElement(HS,{...c,"aria-current":E,className:w,ref:u,style:j,to:s,viewTransition:a},"function"==typeof l?l(k):l)})).displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:a=ES,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,...f},p)=>{let m=function(){let{router:e}=WS("useSubmit"),{basename:t}=i.useContext(sS),n=SS("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=MS(r,t);if(!1===o.navigate){let t=o.fetcherKey||QS();await e.fetch(t,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=i.useContext(sS),r=i.useContext(lS);Nw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...mS(e||".",{relative:t})},a=dS();if(null==e){s.search=a.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:Xw([n,s.pathname]));return _w(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&KS.test(l);return i.createElement("form",{ref:p,method:v,action:g,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||a;m(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:h})},...f,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var YS=0,QS=()=>`__${String(++YS)}__`;new TextEncoder;const XS=({tabs:e,activeTab:r,onTabChange:o,actionButton:i,tabsLocation:s="left"})=>{const[a,l]=n.useState(i?.label||""),[c,u]=n.useState(!1),d=n.useRef([]),[h,f]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=d.current[e.findIndex((e=>e.id===r))];t&&f({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),n.useEffect((()=>{if(i?.label){u(!0);const e=setTimeout((()=>{l(i.label),u(!1)}),200);return()=>clearTimeout(e)}}),[i?.label]),t.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100/50",children:[t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===s?"w-full justify-start":"w-full justify-center"),children:[t.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-gray-100/50 rounded-full"}),t.jsx("div",{className:"absolute bottom-0 h-[1px] rounded-full transition-all duration-300 ease-out\n bg-gradient-to-r from-primary to-primary/90\n shadow-[0_0_8px_rgba(var(--primary-rgb),0.3)]",style:{width:`${h.width}px`,left:`${h.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>d.current[n]=e,onClick:()=>o(e.id),className:"relative px-1 py-3 text-lg transition-all duration-200 \n "+(r===e.id?"text-primary font-medium scale-102":"text-gray-500 hover:text-primary/70 hover:scale-102"),children:e.label},e.id)))]}),i&&t.jsx("div",{className:"relative z-10 pl-8 ml-8 border-l border-gray-100/50",children:t.jsx(iw,{onClick:i.onClick,className:"bg-primary hover:bg-primary/90 text-white shadow-sm hover:shadow-md transition-all duration-200",children:t.jsx("span",{className:`\n inline-block min-w-[80px] text-center\n transition-all duration-400 ease-in-out\n ${c?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}\n `,children:a})})})]}),t.jsx("div",{className:"relative min-h-[200px]",children:e.map((n=>t.jsx("div",{className:"absolute w-full transition-all duration-500 ease-in-out transform \n "+(r===n.id?"translate-x-0 opacity-100 pointer-events-auto":(e.findIndex((e=>e.id===n.id))<e.findIndex((e=>e.id===r))?"translate-x-[-100%]":"translate-x-[100%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})};var JS=i["useId".toString()]||(()=>{}),ZS=0;function eC(e){const[t,n]=i.useState(JS());return nu((()=>{n((e=>e??String(ZS++)))}),[e]),e||(t?`radix-${t}`:"")}var tC=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(oC);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(nC,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(nC,{...o,ref:n,children:r})}));tC.displayName="Slot";var nC=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)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!==i.Fragment&&(o.ref=t?_c(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));nC.displayName="SlotClone";var rC=({children:e})=>t.jsx(t.Fragment,{children:e});function oC(e){return i.isValidElement(e)&&e.type===rC}var iC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?tC: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}}),{});var sC,aC="dismissableLayer.update",lC="dismissableLayer.pointerDownOutside",cC="dismissableLayer.focusOutside",uC=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dC=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(uC),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Mc(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){fC(lC,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)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){fC(cC,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)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Vc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(sC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),hC(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=sC)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),hC())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(aC,e),()=>document.removeEventListener(aC,e)}),[]),t.jsx(iC.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Nc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Nc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Nc(e.onPointerDownCapture,C.onPointerDownCapture)})}));dC.displayName="DismissableLayer";function hC(){const e=new CustomEvent(aC);document.dispatchEvent(e)}function fC(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?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(uC),o=i.useRef(null),s=Mc(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(iC.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var pC="focusScope.autoFocusOnMount",mC="focusScope.autoFocusOnUnmount",gC={bubbles:!1,cancelable:!0},vC=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Bc(s),h=Bc(a),f=i.useRef(null),p=Mc(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:wC(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||wC(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&wC(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){SC.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(pC,gC);c.addEventListener(pC,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wC(r,{select:t}),document.activeElement!==n)return}((e=yC(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&wC(c))}return()=>{c.removeEventListener(pC,d),setTimeout((()=>{const e=new CustomEvent(mC,gC);c.addEventListener(mC,h),c.dispatchEvent(e),e.defaultPrevented||wC(t??document.body,{select:!0}),c.removeEventListener(mC,h),SC.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.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=yC(e),n=bC(t,e),r=bC(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&wC(i,{select:!0})):(e.preventDefault(),r&&wC(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(iC.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function yC(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 bC(e,t){for(const n of e)if(!xC(n,{upTo:t}))return n}function xC(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 wC(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()}}vC.displayName="FocusScope";var SC=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=CC(e,t),e.unshift(t)},remove(t){e=CC(e,t),e[0]?.resume()}}}();function CC(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var kC=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);nu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(iC.div,{...s,ref:n}),c):null}));kC.displayName="Portal";var EC=0;function jC(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PC()),document.body.insertAdjacentElement("beforeend",e[1]??PC()),EC++,()=>{1===EC&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),EC--}}),[])}function PC(){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 TC=function(){return TC=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},TC.apply(this,arguments)};function NC(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 DC(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))}"function"==typeof SuppressedError&&SuppressedError;var _C="right-scroll-bar-position",MC="width-before-scroll-bar";function OC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var RC="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,AC=new WeakMap;function LC(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 OC(e,t)}))}));return RC((function(){var t=AC.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||OC(e,null)})),o.forEach((function(e){n.has(e)||OC(e,i)}))}AC.set(r,e)}),[e]),r}function IC(e){return e}function FC(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=IC);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=TC({async:!0,ssr:!1},e),t}var $C=function(e){var t=e.sideCar,n=NC(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 i.createElement(r,TC({},n))};function qC(e,t){return e.useMedium(t),$C}$C.isSideCarExport=!0;var zC=FC(),UC=function(){},BC=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:UC,onWheelCapture:UC,onTouchMoveCapture:UC}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=NC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=LC([n,t]),C=TC(TC({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:zC,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),TC(TC({},C),{ref:S})):i.createElement(y,TC({},C,{className:c,ref:S}),l))}));BC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},BC.classNames={fullWidth:MC,zeroRight:_C};function VC(){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 KC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=VC())&&(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)}}},HC=function(){var e,t=(e=KC(),function(t,n){i.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},WC={left:0,top:0,right:0,gap:0},GC=function(e){return parseInt(e||"",10)||0},YC=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return WC;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[GC(t["padding"===e?"paddingLeft":"marginLeft"]),GC(n),GC(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])}},QC=HC(),XC="data-scroll-locked",JC=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(XC,"] {\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(_C," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(MC," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(_C," .").concat(_C," {\n right: 0 ").concat(r,";\n }\n \n .").concat(MC," .").concat(MC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(XC,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},ZC=function(){var e=parseInt(document.body.getAttribute(XC)||"0",10);return isFinite(e)?e:0},ek=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect((function(){return document.body.setAttribute(XC,(ZC()+1).toString()),function(){var e=ZC()-1;e<=0?document.body.removeAttribute(XC):document.body.setAttribute(XC,e.toString())}}),[]);var s=i.useMemo((function(){return YC(o)}),[o]);return i.createElement(QC,{styles:JC(s,!t,o,n?"":"!important")})},tk=!1;if("undefined"!=typeof window)try{var nk=Object.defineProperty({},"passive",{get:function(){return tk=!0,!0}});window.addEventListener("test",nk,nk),window.removeEventListener("test",nk,nk)}catch(AY){tk=!1}var rk=!!tk&&{passive:!1},ok=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])},ik=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),sk(e,r)){var o=ak(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sk=function(e,t){return"v"===e?function(e){return ok(e,"overflowY")}(t):function(e){return ok(e,"overflowX")}(t)},ak=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},lk=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ck=function(e){return[e.deltaX,e.deltaY]},uk=function(e){return e&&"current"in e?e.current:e},dk=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},hk=0,fk=[];function pk(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mk=qC(zC,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(hk++)[0],s=i.useState(HC)[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DC([e.lockRef.current],(e.shards||[]).map(uk),!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 l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=lk(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[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=ik(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=ik(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=ak(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&sk(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)}),[]),c=i.useCallback((function(e){var n=e;if(fk.length&&fk[fk.length-1]===s){var r="deltaY"in n?ck(n):lk(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 i=(a.current.shards||[]).map(uk).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:pk(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=lk(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,ck(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,lk(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return fk.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,rk),document.addEventListener("touchmove",c,rk),document.addEventListener("touchstart",d,rk),function(){fk=fk.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,rk),document.removeEventListener("touchmove",c,rk),document.removeEventListener("touchstart",d,rk)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:dk(o)}):null,p?i.createElement(ek,{gapMode:e.gapMode}):null)}));var gk=i.forwardRef((function(e,t){return i.createElement(BC,TC({},e,{ref:t,sideCar:mk}))}));gk.classNames=BC.classNames;var vk=new WeakMap,yk=new WeakMap,bk={},xk=0,wk=function(e){return e&&(e.host||wk(e.parentNode))},Sk=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=wk(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);bk[n]||(bk[n]=new WeakMap);var i=bk[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=(vk.get(e)||0)+1,c=(i.get(e)||0)+1;vk.set(e,l),i.set(e,c),s.push(e),1===l&&o&&yk.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(OY){}}))};return u(t),a.clear(),xk++,function(){s.forEach((function(e){var t=vk.get(e)-1,o=i.get(e)-1;vk.set(e,t),i.set(e,o),t||(yk.has(e)||e.removeAttribute(r),yk.delete(e)),o||e.removeAttribute(n)})),--xk||(vk=new WeakMap,vk=new WeakMap,yk=new WeakMap,bk={})}},Ck=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]"))),Sk(r,o,n,"aria-hidden")):function(){return null}},kk="Dialog",[Ek,jk]=Oc(kk),[Pk,Tk]=Ek(kk),Nk=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d=!1,h]=su({prop:o,defaultProp:s,onChange:a});return t.jsx(Pk,{scope:n,triggerRef:c,contentRef:u,contentId:eC(),titleId:eC(),descriptionId:eC(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};Nk.displayName=kk;var Dk="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Tk(Dk,r),s=Mc(n,i.triggerRef);return t.jsx(iC.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yk(i.open),...o,ref:s,onClick:Nc(e.onClick,i.onOpenToggle)})})).displayName=Dk;var _k="DialogPortal",[Mk,Ok]=Ek(_k,{forceMount:void 0}),Rk=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=Tk(_k,n);return t.jsx(Mk,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(ou,{present:r||a.open,children:t.jsx(kC,{asChild:!0,container:s,children:e})})))})};Rk.displayName=_k;var Ak="DialogOverlay",Lk=i.forwardRef(((e,n)=>{const r=Ok(Ak,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Tk(Ak,e.__scopeDialog);return s.modal?t.jsx(ou,{present:o||s.open,children:t.jsx(Ik,{...i,ref:n})}):null}));Lk.displayName=Ak;var Ik=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Tk(Ak,r);return t.jsx(gk,{as:tC,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(iC.div,{"data-state":Yk(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),Fk="DialogContent",$k=i.forwardRef(((e,n)=>{const r=Ok(Fk,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Tk(Fk,e.__scopeDialog);return t.jsx(ou,{present:o||s.open,children:t.jsx(s.modal?qk:zk,{...i,ref:n})})}));$k.displayName=Fk;var qk=i.forwardRef(((e,n)=>{const r=Tk(Fk,e.__scopeDialog),o=i.useRef(null),s=Mc(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return Ck(e)}),[]),t.jsx(Uk,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nc(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Nc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Nc(e.onFocusOutside,(e=>e.preventDefault()))})})),zk=i.forwardRef(((e,n)=>{const r=Tk(Fk,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(Uk,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),Uk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=Tk(Fk,r),u=i.useRef(null),d=Mc(n,u);return jC(),t.jsxs(t.Fragment,{children:[t.jsx(vC,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(dC,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Yk(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(Zk,{titleId:c.titleId}),t.jsx(eE,{contentRef:u,descriptionId:c.descriptionId})]})]})})),Bk="DialogTitle",Vk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Tk(Bk,r);return t.jsx(iC.h2,{id:i.titleId,...o,ref:n})}));Vk.displayName=Bk;var Kk="DialogDescription",Hk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Tk(Kk,r);return t.jsx(iC.p,{id:i.descriptionId,...o,ref:n})}));Hk.displayName=Kk;var Wk="DialogClose",Gk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Tk(Wk,r);return t.jsx(iC.button,{type:"button",...o,ref:n,onClick:Nc(e.onClick,(()=>i.onOpenChange(!1)))})}));function Yk(e){return e?"open":"closed"}Gk.displayName=Wk;var Qk="DialogTitleWarning",[Xk,Jk]=function(e,n){const r=i.createContext(n),o=e=>{const{children:n,...o}=e,s=i.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=i.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(Qk,{contentName:Fk,titleName:Bk,docsSlug:"dialog"}),Zk=({titleId:e})=>{const t=Jk(Qk);return i.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},eE=({contentRef:e,descriptionId:t})=>{const n=Jk("DialogDescriptionWarning");return i.useEffect((()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},tE=Rk,nE=Lk,rE=$k,oE=Vk,iE=Hk,sE=Gk;function aE(...e){return Ph(Qu(e))}const lE=Nk,cE=({...e})=>t.jsx(tE,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),uE=i.forwardRef((({className:e,...n},r)=>t.jsx(nE,{ref:r,className:aE("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));uE.displayName=nE.displayName;const dE=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(cE,{children:[t.jsx(uE,{}),t.jsxs(rE,{ref:i,className:aE("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(sE,{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(Ad,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));dE.displayName=rE.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(oE,{ref:r,className:aE("text-lg font-semibold leading-none tracking-tight",e),...n}))).displayName=oE.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(iE,{ref:r,className:aE("text-sm text-muted-foreground",e),...n}))).displayName=iE.displayName;var hE,fE="dismissableLayer.update",pE="dismissableLayer.pointerDownOutside",mE="dismissableLayer.focusOutside",gE=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vE=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(gE),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Mc(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){bE(pE,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)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){bE(mE,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)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Vc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(hE=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),yE(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=hE)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),yE())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(fE,e),()=>document.removeEventListener(fE,e)}),[]),t.jsx(zc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Nc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Nc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Nc(e.onPointerDownCapture,C.onPointerDownCapture)})}));vE.displayName="DismissableLayer";function yE(){const e=new CustomEvent(fE);document.dispatchEvent(e)}function bE(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?Uc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(gE),o=i.useRef(null),s=Mc(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(zc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";const xE=["top","right","bottom","left"],wE=Math.min,SE=Math.max,CE=Math.round,kE=Math.floor,EE=e=>({x:e,y:e}),jE={left:"right",right:"left",bottom:"top",top:"bottom"},PE={start:"end",end:"start"};function TE(e,t,n){return SE(e,wE(t,n))}function NE(e,t){return"function"==typeof e?e(t):e}function DE(e){return e.split("-")[0]}function _E(e){return e.split("-")[1]}function ME(e){return"x"===e?"y":"x"}function OE(e){return"y"===e?"height":"width"}function RE(e){return["top","bottom"].includes(DE(e))?"y":"x"}function AE(e){return ME(RE(e))}function LE(e){return e.replace(/start|end/g,(e=>PE[e]))}function IE(e){return e.replace(/left|right|bottom|top/g,(e=>jE[e]))}function FE(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 $E(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 qE(e,t,n){let{reference:r,floating:o}=e;const i=RE(t),s=AE(t),a=OE(s),l=DE(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(_E(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function zE(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}=NE(t,e),p=FE(f),m=a[h?"floating"===d?"reference":"floating":d],g=$E(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.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},x=$E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function UE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BE(e){return xE.some((t=>e[t]>=0))}function VE(){return"undefined"!=typeof window}function KE(e){return GE(e)?(e.nodeName||"").toLowerCase():"#document"}function HE(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function WE(e){var t;return null==(t=(GE(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function GE(e){return!!VE()&&(e instanceof Node||e instanceof HE(e).Node)}function YE(e){return!!VE()&&(e instanceof Element||e instanceof HE(e).Element)}function QE(e){return!!VE()&&(e instanceof HTMLElement||e instanceof HE(e).HTMLElement)}function XE(e){return!(!VE()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof HE(e).ShadowRoot)}function JE(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=oj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ZE(e){return["table","td","th"].includes(KE(e))}function ej(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(OY){return!1}}))}function tj(e){const t=nj(),n=YE(e)?oj(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 nj(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function rj(e){return["html","body","#document"].includes(KE(e))}function oj(e){return HE(e).getComputedStyle(e)}function ij(e){return YE(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sj(e){if("html"===KE(e))return e;const t=e.assignedSlot||e.parentNode||XE(e)&&e.host||WE(e);return XE(t)?t.host:t}function aj(e){const t=sj(e);return rj(t)?e.ownerDocument?e.ownerDocument.body:e.body:QE(t)&&JE(t)?t:aj(t)}function lj(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=aj(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=HE(o);if(i){const e=cj(s);return t.concat(s,s.visualViewport||[],JE(o)?o:[],e&&n?lj(e):[])}return t.concat(o,lj(o,[],n))}function cj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uj(e){const t=oj(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=QE(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=CE(n)!==i||CE(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function dj(e){return YE(e)?e:e.contextElement}function hj(e){const t=dj(e);if(!QE(t))return EE(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=uj(t);let s=(i?CE(n.width):n.width)/r,a=(i?CE(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const fj=EE(0);function pj(e){const t=HE(e);return nj()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fj}function mj(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=dj(e);let s=EE(1);t&&(r?YE(r)&&(s=hj(r)):s=hj(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==HE(e))&&t}(i,n,r)?pj(i):EE(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=HE(i),t=r&&YE(r)?HE(r):r;let n=e,o=cj(n);for(;o&&r&&t!==n;){const e=hj(o),t=o.getBoundingClientRect(),r=oj(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=HE(o),o=cj(n)}}return $E({width:u,height:d,x:l,y:c})}function gj(e,t){const n=ij(e).scrollLeft;return t?t.left+n:mj(WE(e)).left+n}function vj(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:gj(e,r)),y:r.top+t.scrollTop}}function yj(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=HE(e),r=WE(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=nj();(!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=WE(e),n=ij(e),r=e.ownerDocument.body,o=SE(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=SE(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+gj(e);const a=-n.scrollTop;return"rtl"===oj(r).direction&&(s+=SE(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(WE(e));else if(YE(t))r=function(e,t){const n=mj(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=QE(e)?hj(e):EE(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=pj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $E(r)}function bj(e,t){const n=sj(e);return!(n===t||!YE(n)||rj(n))&&("fixed"===oj(n).position||bj(n,t))}function xj(e,t,n){const r=QE(t),o=WE(t),i="fixed"===n,s=mj(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=EE(0);if(r||!r&&!i)if(("body"!==KE(t)||JE(o))&&(a=ij(t)),r){const e=mj(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=gj(o));const c=!o||r||i?EE(0):vj(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 wj(e){return"static"===oj(e).position}function Sj(e,t){if(!QE(e)||"fixed"===oj(e).position)return null;if(t)return t(e);let n=e.offsetParent;return WE(e)===n&&(n=n.ownerDocument.body),n}function Cj(e,t){const n=HE(e);if(ej(e))return n;if(!QE(e)){let t=sj(e);for(;t&&!rj(t);){if(YE(t)&&!wj(t))return t;t=sj(t)}return n}let r=Sj(e,t);for(;r&&ZE(r)&&wj(r);)r=Sj(r,t);return r&&rj(r)&&wj(r)&&!tj(r)?n:r||function(e){let t=sj(e);for(;QE(t)&&!rj(t);){if(tj(t))return t;if(ej(t))return null;t=sj(t)}return null}(e)||n}const kj={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=WE(r),a=!!t&&ej(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=EE(1);const u=EE(0),d=QE(r);if((d||!d&&!i)&&(("body"!==KE(r)||JE(s))&&(l=ij(r)),QE(r))){const e=mj(r);c=hj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?EE(0):vj(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:WE,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ej(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=lj(e,[],!1).filter((e=>YE(e)&&"body"!==KE(e))),o=null;const i="fixed"===oj(e).position;let s=i?sj(e):e;for(;YE(s)&&!rj(s);){const t=oj(s),n=tj(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||JE(s)&&!n&&bj(e,s))?r=r.filter((e=>e!==s)):o=t,s=sj(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=yj(t,n,o);return e.top=SE(r.top,e.top),e.right=wE(r.right,e.right),e.bottom=wE(r.bottom,e.bottom),e.left=SE(r.left,e.left),e}),yj(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Cj,getElementRects:async function(e){const t=this.getOffsetParent||Cj,n=this.getDimensions,r=await n(e.floating);return{reference:xj(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}=uj(e);return{width:t,height:n}},getScale:hj,isElement:YE,isRTL:function(e){return"rtl"===oj(e).direction}};function Ej(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=dj(e),u=o||i?[...c?lj(c):[],...lj(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=WE(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:-kE(u)+"px "+-kE(o.clientWidth-(c+d))+"px "+-kE(o.clientHeight-(u+h))+"px "+-kE(c)+"px",threshold:SE(0,wE(1,l))||1};let p=!0;function m(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(m,{...f,root:o.ownerDocument})}catch(OY){r=new IntersectionObserver(m,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 m=l?mj(e):null;return l&&function t(){const r=mj(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=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 jj=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=DE(n),a=_E(n),l="y"===RE(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=NE(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}}}}},Pj=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}=NE(e,t),c={x:n,y:r},u=await zE(t,l),d=RE(DE(o)),h=ME(d);let f=c[h],p=c[d];if(i){f=TE(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=TE(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:s}}}}}},Tj=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:m=!0,...g}=NE(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=DE(o),y=RE(a),b=DE(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[IE(a)]:function(e){const t=IE(e);return[LE(e),t,LE(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=_E(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[]}}(DE(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(LE)))),i}(a,m,p,x));const C=[a,...w],k=await zE(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=_E(e),o=AE(e),i=OE(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=IE(s)),[s,IE(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var P,T;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(T=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=RE(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:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Nj=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}=NE(e,t),u=await zE(t,c),d=DE(o),h=_E(o),f="y"===RE(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right;let x=wE(m-u[g],y),w=wE(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!h){const e=SE(u.left,0),t=SE(u.right,0),n=SE(u.top,0),r=SE(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:SE(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:SE(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return p!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},Dj=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=NE(e,t);switch(r){case"referenceHidden":{const e=UE(await zE(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:BE(e)}}}case"escaped":{const e=UE(await zE(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:BE(e)}}}default:return{}}}}},_j=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}=NE(e,t)||{};if(null==c)return{};const d=FE(u),h={x:n,y:r},f=AE(o),p=OE(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=wE(d[v],E),P=wE(d[y],E),T=j,N=C-m[p]-P,D=C/2-m[p]/2+k,_=TE(T,D,N),M=!l.arrow&&null!=_E(o)&&D!==_&&i.reference[p]/2-(D<T?j:P)-m[p]/2<0,O=M?D<T?D-T:D-N:0;return{[f]:h[f]+O,data:{[f]:_,centerOffset:D-_-O,...M&&{alignmentOffset:O}},reset:M}}}),Mj=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}=NE(e,t),u={x:n,y:r},d=RE(o),h=ME(d);let f=u[h],p=u[d];const m=NE(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+g.mainAxis,n=i.reference[h]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(DE(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},Oj=(e,t,n)=>{const r={platform:kj,...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}=qE(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,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!=g?g: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}=qE(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var Rj="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Aj(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(!Aj(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)&&!Aj(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Lj(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ij(e,t){const n=Lj(e);return Math.round(t*n)/n}function Fj(e){const t=i.useRef(e);return Rj((()=>{t.current=e})),t}const $j=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?_j({element:n.current,padding:r}).fn(t):{}:n?_j({element:n,padding:r}).fn(t):{}}}),qj=(e,t)=>({...Pj(e),options:[e,t]}),zj=(e,t)=>({...Mj(e),options:[e,t]}),Uj=(e,t)=>({...Tj(e),options:[e,t]}),Bj=(e,t)=>({...Nj(e),options:[e,t]}),Vj=(e,t)=>({...Dj(e),options:[e,t]}),Kj=(e,t)=>({...$j(e),options:[e,t]});var Hj=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(zc.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"})})}));Hj.displayName="Arrow";var Wj=Hj;var Gj="Popper",[Yj,Qj]=Oc(Gj),[Xj,Jj]=Yj(Gj),Zj=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(Xj,{scope:n,anchor:o,onAnchorChange:s,children:r})};Zj.displayName=Gj;var eP="PopperAnchor",tP=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=Jj(eP,r),l=i.useRef(null),c=Mc(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(zc.div,{...s,ref:c})}));tP.displayName=eP;var nP="PopperContent",[rP,oP]=Yj(nP),iP=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=Jj(nP,r),[x,w]=i.useState(null),S=Mc(n,(e=>w(e))),[C,k]=i.useState(null),E=function(e){const[t,n]=i.useState(void 0);return nu((()=>{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}(C),j=E?.width??0,P=E?.height??0,T=o+("center"!==l?"-"+l:""),N="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(h)?h:[h],_=D.length>0,M={padding:N,boundary:D.filter(cP),altBoundary:_},{refs:O,floatingStyles:R,placement:A,isPositioned:L,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Aj(p,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||y,k=i.useRef(null),E=i.useRef(null),j=i.useRef(h),P=null!=u,T=Fj(u),N=Fj(o),D=Fj(d),_=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};N.current&&(e.platform=N.current),Oj(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==D.current};M.current&&!Aj(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,N,D]);Rj((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);Rj((()=>(M.current=!0,()=>{M.current=!1})),[]),Rj((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(T.current)return T.current(S,C,_);_()}}),[S,C,_,T,P]);const O=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),R=i.useMemo((()=>({reference:S,floating:C})),[S,C]),A=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Ij(R.floating,h.x),r=Ij(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Lj(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,R.floating,h.x,h.y]);return i.useMemo((()=>({...h,update:_,refs:O,elements:R,floatingStyles:A})),[h,_,O,R,A])}({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>Ej(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+P,alignmentAxis:c},{...jj(F),options:[F,$]}),d&&qj({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?zj():void 0,...M}),d&&Uj({...M}),Bj({...M,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`)}}),C&&Kj({element:C,padding:u}),uP({arrowWidth:j,arrowHeight:P}),m&&Vj({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=dP(A),U=Bc(v);nu((()=>{L&&U?.()}),[L,U]);const B=I.arrow?.x,V=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return nu((()=>{x&&W(window.getComputedStyle(x).zIndex)}),[x]),t.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:L?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(rP,{scope:r,placedSide:q,onArrowChange:k,arrowX:B,arrowY:V,shouldHideArrow:K,children:t.jsx(zc.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));iP.displayName=nP;var sP="PopperArrow",aP={top:"bottom",right:"left",bottom:"top",left:"right"},lP=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=oP(sP,r),s=aP[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(Wj,{...o,ref:n,style:{...o.style,display:"block"}})})}));function cP(e){return null!==e}lP.displayName=sP;var uP=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=dP(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=i?u:`${d}px`,p=-a+"px"):"top"===l?(f=i?u:`${d}px`,p=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",p=i?u:`${h}px`):"left"===l&&(f=`${r.floating.width+a}px`,p=i?u:`${h}px`),{data:{x:f,y:p}}}});function dP(e){const[t,n="center"]=e.split("-");return[t,n]}var hP=Zj,fP=tP,pP=iP,mP=lP,[gP,vP]=Oc("Tooltip",[Qj]),yP=Qj(),bP="TooltipProvider",xP=700,wP="tooltip.open",[SP,CP]=gP(bP),kP=e=>{const{__scopeTooltip:n,delayDuration:r=xP,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:a}=e,[l,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),t.jsx(SP,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:i.useCallback((()=>{window.clearTimeout(d.current),c(!1)}),[]),onClose:i.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>c(!0)),o)}),[o]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback((e=>{u.current=e}),[]),disableHoverableContent:s,children:a})};kP.displayName=bP;var EP="Tooltip",[jP,PP]=gP(EP),TP=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=CP(EP,e.__scopeTooltip),d=yP(n),[h,f]=i.useState(null),p=eC(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=su({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(wP))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)}),[x]),C=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,x(!1)}),[x]),k=i.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{y.current=!0,x(!0),m.current=0}),v)}),[v,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(hP,{...d,children:t.jsx(jP,{scope:n,contentId:p,open:b,stateAttribute:w,trigger:h,onTriggerChange:f,onTriggerEnter:i.useCallback((()=>{u.isOpenDelayed?k():S()}),[u.isOpenDelayed,k,S]),onTriggerLeave:i.useCallback((()=>{g?C():(window.clearTimeout(m.current),m.current=0)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};TP.displayName=EP;var NP="TooltipTrigger",DP=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=PP(NP,r),a=CP(NP,r),l=yP(r),c=Mc(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),h=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",h)),[h]),t.jsx(fP,{asChild:!0,...l,children:t.jsx(zc.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Nc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Nc(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Nc(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Nc(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Nc(e.onBlur,s.onClose),onClick:Nc(e.onClick,s.onClose)})})}));DP.displayName=NP;var _P="TooltipPortal",[MP,OP]=gP(_P,{forceMount:void 0}),RP=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=PP(_P,n);return t.jsx(MP,{scope:n,forceMount:r,children:t.jsx(ou,{present:r||s.open,children:t.jsx(ru,{asChild:!0,container:i,children:o})})})};RP.displayName=_P;var AP="TooltipContent",LP=i.forwardRef(((e,n)=>{const r=OP(AP,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=PP(AP,e.__scopeTooltip);return t.jsx(ou,{present:o||a.open,children:t.jsx(a.disableHoverableContent?qP:IP,{side:i,...s,ref:n})})})),IP=i.forwardRef(((e,n)=>{const r=PP(AP,e.__scopeTooltip),o=CP(AP,e.__scopeTooltip),s=i.useRef(null),a=Mc(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,h=s.current,{onPointerInTransitChange:f}=o,p=i.useCallback((()=>{c(null),f(!1)}),[f]),m=i.useCallback(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(n,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(n,e.currentTarget.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(o),f(!0)}),[f]);return i.useEffect((()=>()=>p()),[p]),i.useEffect((()=>{if(u&&h){const e=e=>m(e,h),t=e=>m(e,u);return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[u,h,m,p]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||h?.contains(t),o=!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,l);r?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,h,l,d,p]),t.jsx(qP,{...e,ref:a})})),[FP,$P]=gP(EP,{isInside:!1}),qP=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=PP(AP,r),d=yP(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(wP,h),()=>document.removeEventListener(wP,h))),[h]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),t.jsx(vE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(pP,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Ic,{children:o}),t.jsx(FP,{scope:r,isInside:!0,children:t.jsx(lu,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));LP.displayName=AP;var zP="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=yP(r);return $P(zP,r).isInside?null:t.jsx(mP,{...i,...o,ref:n})})).displayName=zP;var UP=RP,BP=LP;const VP=kP,KP=TP,HP=DP,WP=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(UP,{children:t.jsx(BP,{ref:o,sideOffset:n,className:Th("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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})})));WP.displayName=BP.displayName;const GP=({title:e,alertText:n,Icon:r=gd,onClick:o})=>t.jsx(VP,{children:t.jsxs(KP,{children:[t.jsx(HP,{asChild:!0,children:t.jsx(r,{className:"h-4 w-4 cursor-pointer transition-colors",onClick:o})}),t.jsx(WP,{className:"text-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-[300px]",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-amber-500/10 p-2 rounded-full",children:t.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),t.jsx("p",{className:"font-semibold text-amber-500",children:n})]}),t.jsx("p",{className:"text-[13px] leading-relaxed text-primary-foreground/90",children:e})]})})]})}),YP="flex flex-col items-center justify-center h-full",QP=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=Gx(e);if(a||!s)return t.jsx("div",{className:YP,children:t.jsx(Fx,{text:["Fetching Statistics","Finishing up"]})});const l=()=>{const e="flex items-center bg-white rounded-lg p-4 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md";return t.jsxs("div",{className:"grid gap-4 p-4 transition-all duration-300 "+("email"===o?"grid-cols-3":"grid-cols-1 max-w-md mx-auto"),children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.MessagesSent,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("p",{className:"text-sm font-medium text-gray-500",children:["email"===o?"Emails":"SMS"," Sent"]}),t.jsx(GP,{title:`Total number of ${"email"===o?"emails":"SMS messages"} that were successfully sent in this campaign`})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s[o].numberSent})]})]})}),"email"===o&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.OpenRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Open Rate"}),t.jsx(GP,{title:"Percentage of recipients who opened the email out of total emails delivered"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.openPercentage.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.TotalBounceRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Total Bounce Rate"}),t.jsx(GP,{title:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[(s.email.softBounceRate+s.email.hardBounceRate).toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.LinksClicked,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Links Clicked"}),t.jsx(GP,{title:"Total number of times recipients clicked on links within the email"})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.email.linksClicked})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.SpamComplies,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Spam Complaints"}),t.jsx(GP,{title:"Percentage of recipients who marked this email as spam"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.spamComplaintRate.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.UnsubscribeRate,{className:"w-6 h-6"})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Unsubscribe Rate"}),t.jsx(GP,{title:"Percentage of recipients who unsubscribed after receiving this email"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.unsubscribedRate.toFixed(2),"%"]})]})]})})]})]})};return t.jsx("div",{className:"space-y-6",children:t.jsx(XS,{tabs:[{id:"email",label:"Email Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})},{id:"sms",label:"SMS Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"center"})})};function XP(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 JP(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const ZP=6048e5,eT=43200;let tT={};function nT(){return tT}function rT(e,t){const n=nT(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=XP(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function oT(e){return rT(e,{weekStartsOn:1})}function iT(e){const t=XP(e),n=t.getFullYear(),r=JP(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=oT(r),i=JP(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=oT(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function sT(e){const t=XP(e);return t.setHours(0,0,0,0),t}function aT(e){const t=XP(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 lT(e,t){return function(e,t){return JP(e,+XP(e)+t)}(e,6e4*t)}function cT(e,t){const n=XP(e),r=XP(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function uT(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=XP(e);return!isNaN(Number(n))}function dT(e){const t=XP(e);return+function(e){const t=XP(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=XP(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function hT(e,t){const n=XP(e),r=XP(t),o=cT(n,r),i=Math.abs(function(e,t){const n=XP(e),r=XP(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(i<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);let t=cT(n,r)===-o;dT(XP(e))&&1===i&&1===cT(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function fT(e,t,n){const r=function(e,t){return+XP(e)-+XP(t)}(e,t)/1e3;return(o=n?.roundingMethod,e=>{const t=(o?Math[o]:Math.trunc)(e);return 0===t?0:t})(r);var o}const pT={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 mT(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const gT={date:mT({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:mT({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:mT({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},vT={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function yT(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function bT(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 xT;const wT={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=pT[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:gT,formatRelative:(e,t,n,r)=>vT[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:yT({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:yT({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:yT({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:yT({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:yT({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:(xT={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(xT.matchPattern);if(!n)return null;const r=n[0],o=e.match(xT.parsePattern);if(!o)return null;let i=xT.valueCallback?xT.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:bT({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:bT({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:bT({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:bT({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:bT({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 ST(e){const t=XP(e),n=function(e,t){const n=sT(e),r=sT(t),o=+n-aT(n),i=+r-aT(r);return Math.round((o-i)/864e5)}(t,function(e){const t=XP(e),n=JP(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function CT(e){const t=XP(e),n=+oT(t)-+function(e){const t=iT(e),n=JP(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),oT(n)}(t);return Math.round(n/ZP)+1}function kT(e,t){const n=XP(e),r=n.getFullYear(),o=nT(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=JP(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=rT(s,t),l=JP(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=rT(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function ET(e,t){const n=XP(e),r=+rT(n,t)-+function(e,t){const n=nT(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=kT(e,t),i=JP(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),rT(i,t)}(n,t);return Math.round(r/ZP)+1}function jT(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const PT={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return jT("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):jT(n+1,2)},d:(e,t)=>jT(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)=>jT(e.getHours()%12||12,t.length),H:(e,t)=>jT(e.getHours(),t.length),m:(e,t)=>jT(e.getMinutes(),t.length),s:(e,t)=>jT(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return jT(Math.trunc(r*Math.pow(10,n-3)),t.length)}},TT="midnight",NT="noon",DT="morning",_T="afternoon",MT="evening",OT="night",RT={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 PT.y(e,t)},Y:function(e,t,n,r){const o=kT(e,r),i=o>0?o:1-o;if("YY"===t){return jT(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):jT(i,t.length)},R:function(e,t){return jT(iT(e),t.length)},u:function(e,t){return jT(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 jT(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 jT(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 PT.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 jT(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=ET(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):jT(o,t.length)},I:function(e,t,n){const r=CT(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):jT(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):PT.d(e,t)},D:function(e,t,n){const r=ST(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):jT(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 jT(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 jT(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 jT(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?NT:0===r?TT: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?MT:r>=12?_T:r>=4?DT:OT,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 PT.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):PT.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):jT(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):jT(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):PT.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):PT.s(e,t)},S:function(e,t){return PT.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return LT(r);case"XXXX":case"XX":return IT(r);default:return IT(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return LT(r);case"xxxx":case"xx":return IT(r);default:return IT(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+AT(r,":");default:return"GMT"+IT(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+AT(r,":");default:return"GMT"+IT(r,":")}},t:function(e,t,n){return jT(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return jT(e.getTime(),t.length)}};function AT(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+jT(i,2)}function LT(e,t){if(e%60==0){return(e>0?"-":"+")+jT(Math.abs(e)/60,2)}return IT(e,t)}function IT(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+jT(Math.trunc(r/60),2)+t+jT(r%60,2)}const FT=(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"})}},$T=(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"})}},qT={p:$T,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return FT(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}}",FT(r,t)).replace("{{time}}",$T(o,t))}},zT=/^D+$/,UT=/^Y+$/,BT=["D","DD","YY","YYYY"];const VT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HT=/^'([^]*?)'?$/,WT=/''/g,GT=/[a-zA-Z]/;function YT(e,t,n){const r=nT(),o=r.locale??wT,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=XP(e);if(!uT(a))throw new RangeError("Invalid time value");let l=t.match(KT).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,qT[t])(e,o.formatLong)}return e})).join("").match(VT).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:QT(e)};if(RT[t])return{isToken:!0,value:e};if(t.match(GT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return UT.test(e)}(r)||function(e){return zT.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(BT.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,RT[r[0]])(a,r,o.localize,c)})).join("")}function QT(e){const t=e.match(HT);return t?t[1].replace(WT,"'"):e}function XT(e,t){return function(e,t,n){const r=nT(),o=n?.locale??r.locale??wT,i=cT(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i});let a,l;i>0?(a=XP(t),l=XP(e)):(a=XP(e),l=XP(t));const c=fT(l,a),u=(aT(l)-aT(a))/1e3,d=Math.round((c-u)/60);let h;if(d<2)return n?.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,s):c<10?o.formatDistance("lessThanXSeconds",10,s):c<20?o.formatDistance("lessThanXSeconds",20,s):c<40?o.formatDistance("halfAMinute",0,s):o.formatDistance(c<60?"lessThanXMinutes":"xMinutes",1,s):0===d?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",d,s);if(d<45)return o.formatDistance("xMinutes",d,s);if(d<90)return o.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return o.formatDistance("aboutXHours",e,s)}if(d<2520)return o.formatDistance("xDays",1,s);if(d<eT){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/eT),o.formatDistance("aboutXMonths",h,s);if(h=hT(l,a),h<12){const e=Math.round(d/eT);return o.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?o.formatDistance("aboutXYears",t,s):e<9?o.formatDistance("overXYears",t,s):o.formatDistance("almostXYears",t+1,s)}}(e,function(e){return JP(e,Date.now())}(e),t)}const JT={base:"reach-styles-module__base___eJmcH",default:"reach-styles-module__default___8NuEB",secondary:"reach-styles-module__secondary___H-ae8",destructive:"reach-styles-module__destructive___JsRNh",outline:"reach-styles-module__outline___9FFlV",google:"reach-styles-module__google___7eHwU",date:"reach-styles-module__date___gU3Tt",container:"reach-styles-module__container___5PrOx"},ZT=Zu([JT.base],{variants:{variant:{default:JT.default,secondary:JT.secondary,destructive:JT.destructive,outline:JT.outline,google:JT.google,date:JT.date},size:{default:JT["size-default"],sm:JT["size-sm"]},iconOnly:{true:JT["icon-only"],false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:JT["icon-only-sm"]}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),eN=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Th(ZT({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));eN.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(JT.container,e),...n}))).displayName="BadgeContainer";const tN=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Th("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})));tN.displayName="Input";const nN=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Th("w-full caption-bottom text-sm",e),...n})})));nN.displayName="Table";const rN=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Th("[&_tr]:border-b",e),...n})));rN.displayName="TableHeader";const oN=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Th("[&_tr:last-child]:border-0",e),...n})));oN.displayName="TableBody";const iN=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Th("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));iN.displayName="TableRow";const sN=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Th("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));sN.displayName="TableHead";const aN=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Th("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));aN.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Th("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const lN=({columns:e,fetchData:r,itemsPerPage:o=10,emptyState:i={title:"No Items Found",description:"No items are currently available."},className:s,onRowClick:a})=>{const[l,c]=n.useState([]),[u,d]=n.useState(!1),[h,f]=n.useState(),[p,m]=n.useState(!0),[g,v]=n.useState(null),y=n.useCallback((async e=>{try{d(!0),v(null);const t=await r({cursor:e,limit:o});c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(AY){v(AY instanceof Error?AY.message:"An error occurred")}finally{d(!1)}}),[r,o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),y()}),[y]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):t.jsxs("div",u||0!==l.length?{className:Th(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(nN,{children:[t.jsx(rN,{children:t.jsx(iN,{children:e.map((e=>t.jsx(sN,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(oN,{children:l.map(((n,r)=>t.jsx(iN,{onClick:()=>a?.(n),className:a?"cursor-pointer hover:bg-gray-50/50 transition-colors":"hover:bg-gray-50/50 transition-colors",children:e.map((e=>t.jsx(aN,{style:{width:e.width},children:e.cell?e.cell(n[e.accessorKey],n):n[e.accessorKey]||t.jsx("span",{className:"text-gray-400",children:"Not provided"})},String(e.accessorKey))))},r)))})]})}),p&&t.jsx("div",{className:"mt-4 flex justify-center",children:t.jsx("button",{onClick:()=>y(h),disabled:u,className:"rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50",children:u?"Loading...":"Load More"})})]}:{className:"flex flex-col items-center justify-center p-8 text-center",children:[i.icon&&t.jsx("div",{className:"mb-4",children:i.icon}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:i.title}),t.jsx("p",{className:"text-gray-500",children:i.description})]})},cN=({onViewAutomation:e})=>{const[r,o]=n.useState(""),[i,s]=n.useState("all"),a=e=>{const n={draft:{className:"bg-gray-100 text-gray-700",label:"Draft"},active:{className:"bg-green-100 text-green-700",label:"Active"},scheduled:{className:"bg-yellow-100 text-yellow-700",label:"Paused"},completed:{className:"bg-blue-100 text-blue-700",label:"Completed"},failed:{className:"bg-red-100 text-red-700",label:"Error"},running:{className:"bg-purple-100 text-purple-700",label:"Running"},deactivated:{className:"bg-gray-100 text-gray-700",label:"Deactivated"}},r=n[e]||n.draft;return t.jsx(eN,{variant:"outline",className:`${r.className} font-medium`,children:r.label})},l=e=>{let n="bg-gray-400";return n="active"===e?"bg-green-500":"draft"===e?"bg-gray-400":"bg-yellow-400",t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},c=n=>t.jsx(lN,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[l(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),a(n.status)]})]})},{header:"Stats",accessorKey:"emailsSent",width:"25%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Xx.EmailIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.emailsSent||0})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Xx.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-gray-600",children:r?XT(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const o=await(async e=>{const t=new URLSearchParams;return e.cursor&&t.append("cursor",e.cursor),e.limit&&t.append("limit",e.limit.toString()),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search),(await Ja(`${qx}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:r||void 0});return{items:o.automations,cursor:o.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-gray-400"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:t=>{e(t.id)},className:"rounded-lg bg-white"}),u=[{id:"all",label:"All",content:c()},{id:"active",label:"Active",content:c("active")},{id:"draft",label:"Drafts",content:c("draft")}];return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(tN,{placeholder:"Search automations...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(XS,{tabs:u,activeTab:i,onTabChange:s})]})},uN=async e=>{const t=new URLSearchParams;e?.cursor&&t.append("cursor",e.cursor),e?.limit&&t.append("limit",e.limit.toString()),e?.search&&t.append("search",e.search);return(await Ja(`${$x}${t.toString()?`?${t.toString()}`:""}`)).data};var dN=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(dN||{}),hN=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(hN||{}),fN=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(fN||{});const pN=({onSelectSegment:e})=>{const[r,o]=n.useState(""),{toast:i}=Tc(),s=e=>{const n={[hN.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[hN.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[hN.CUSTOM];return t.jsx(eN,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(tN,{placeholder:"Search segments...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(lN,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),s(n.type)]}),t.jsx("span",{className:"text-sm text-gray-500 truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-gray-600",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-gray-600",children:e?XT(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:e,limit:t})=>{const n=await uN({cursor:e,limit:t,search:r||void 0});return{items:n.segments,cursor:n.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-gray-400"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:t=>{t.type===hN.CUSTOM?e(t.id):i({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},mN=({iconDefinitionsPassed:e})=>{const r=pS(),{toast:o}=Tc(),[i,s]=n.useState(!1),[a,l]=n.useState("automations"),[c,u]=n.useState(!1),[d,h]=n.useState(null),f=Jx(e),p=[{id:"automations",label:"Automations",content:t.jsx(cN,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)}})},{id:"segments",label:"Segments",content:t.jsx(pN,{onSelectSegment:e=>{h(e),u(!0)}})}];return t.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[t.jsx(lE,{open:i,onOpenChange:s,children:t.jsx(dE,{hideCloseButton:!0,children:t.jsx(yw,{iconDefinitions:f,onClose:e=>{"error"===e?(o({title:"Error creating automation",description:"Please try again",variant:"destructive"}),s(!1)):!1===e?s(!1):r(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)}})})}),t.jsx(lE,{open:c,onOpenChange:u,children:t.jsx(dE,{hideCloseButton:!0,children:t.jsx(pR,{iconDefinitions:f,segmentId:d??void 0,onClose:e=>{"error"===e?(o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),u(!1),h(null)):!1===e?(u(!1),h(null)):(o({title:"Segment created!"}),h(null))}})})}),t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx("div",{className:"bg-white rounded-2xl w-full p-6 relative",children:t.jsx(QP,{iconDefinitions:f})}),t.jsx("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl",children:t.jsx(XS,{tabs:p,activeTab:a,onTabChange:e=>l(e),actionButton:{onClick:()=>{"automations"===a?s(!0):u(!0)},label:"Create New "+("automations"===a?"Automation":"Segment")}})})]})]})},gN=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja($x,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ja(`${$x}/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}},vN=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ja(`${$x}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{data:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchCount:()=>{t.invalidateQueries({queryKey:["automations","recipients","count",e]})}}},yN=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ja(`${$x}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},bN=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await Ja(`${$x}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data:null)(t,e),onSuccess:()=>{t.invalidateQueries({queryKey:["segments",e]})}});return{updateSegment:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},xN=({onClose:e,setClickedCreate:n,isDisabled:r,createButtonText:o})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(iw,{className:Th("px-4 py-2"),onClick:()=>e?.(!1),variant:"destructive",children:"Cancel"}),t.jsx(iw,{className:Th("px-4 py-2"),onClick:()=>{n(!0)},disabled:r,children:o})]})});var wN=.999,SN=/[\\\/_+.#"@\[\(\{&]/,CN=/[\\\/_+.#"@\[\(\{&]/g,kN=/[\s-]/,EN=/[\s-]/g;function jN(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,h=r.charAt(i),f=n.indexOf(h,o),p=0;f>=0;)(l=jN(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:SN.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(CN))&&o>0&&(l*=Math.pow(wN,u.length))):kN.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(EN))&&o>0&&(l*=Math.pow(wN,d.length))):(l*=.17,o>0&&(l*=Math.pow(wN,f-o))),e.charAt(f)!==t.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(.1*(c=jN(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>p&&(p=l),f=n.indexOf(h,f+1);return s[a]=p,p}function PN(e){return e.toLowerCase().replace(EN," ")}function TN(e,t,n){return jN(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,PN(e),PN(t),0,0,{})}function NN(){return NN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NN.apply(null,arguments)}function DN(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 _N(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function MN(...e){return n.useCallback(_N(...e),e)}function ON(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=r.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return n.useMemo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return r.scopeName=t.scopeName,r}const RN=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{},AN=i["useId".toString()]||(()=>{});let LN=0;function IN(e){const[t,n]=i.useState(AN());return RN((()=>{n((e=>null!=e?e:String(LN++)))}),[e]),e||(t?`radix-${t}`:"")}function FN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function $N({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:t}){const r=n.useState(e),[o]=r,i=n.useRef(o),s=FN(t);return n.useEffect((()=>{i.current!==o&&(s(o),i.current=o)}),[o,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:o,l=FN(r);return[a,n.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)}),[s,e,i,l])]}const qN=n.forwardRef(((e,t)=>{const{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(BN);if(s){const e=s.props.children,r=i.map((t=>t===s?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t));return n.createElement(zN,NN({},o,{ref:t}),n.isValidElement(e)?n.cloneElement(e,void 0,r):null)}return n.createElement(zN,NN({},o,{ref:t}),r)}));qN.displayName="Slot";const zN=n.forwardRef(((e,t)=>{const{children:r,...o}=e;return n.isValidElement(r)?n.cloneElement(r,{...VN(o,r.props),ref:t?_N(t,r.ref):r.ref}):n.Children.count(r)>1?n.Children.only(null):null}));zN.displayName="SlotClone";const UN=({children:e})=>n.createElement(n.Fragment,null,e);function BN(e){return n.isValidElement(e)&&e.type===UN}function VN(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}}const KN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=n.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?qN:t;return n.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),n.createElement(s,NN({},i,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function HN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const WN="dismissableLayer.update",GN="dismissableLayer.pointerDownOutside",YN="dismissableLayer.focusOutside";let QN;const XN=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),JN=n.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=n.useContext(XN),[h,f]=n.useState(null),p=null!==(r=null==h?void 0:h.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,m]=n.useState({}),g=MN(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=HN(e),o=n.useRef(!1),i=n.useRef((()=>{}));return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let n=function(){eD(GN,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);o.current=!1},n=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=HN(e),o=n.useRef(!1);return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){eD(YN,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.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 function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=HN(e);n.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}((e=>{x===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),n.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(QN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ZN(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=QN)}}),[h,p,o,d]),n.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ZN())}),[h,d]),n.useEffect((()=>{const e=()=>m({});return document.addEventListener(WN,e),()=>document.removeEventListener(WN,e)}),[]),n.createElement(KN.div,NN({},u,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:DN(e.onFocusCapture,k.onFocusCapture),onBlurCapture:DN(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:DN(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function ZN(){const e=new CustomEvent(WN);document.dispatchEvent(e)}function eD(e,t,n,{discrete:o}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync((()=>e.dispatchEvent(t)))}(i,s):i.dispatchEvent(s)}function tD(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const nD="focusScope.autoFocusOnMount",rD="focusScope.autoFocusOnUnmount",oD={bubbles:!1,cancelable:!0},iD=n.forwardRef(((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=n.useState(null),u=tD(i),d=tD(s),h=n.useRef(null),f=MN(t,(e=>c(e))),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:cD(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||cD(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&cD(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]),n.useEffect((()=>{if(l){uD.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(nD,oD);l.addEventListener(nD,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(cD(r,{select:t}),document.activeElement!==n)return}((e=sD(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&cD(l))}return()=>{l.removeEventListener(nD,u),setTimeout((()=>{const e=new CustomEvent(rD,oD);l.addEventListener(rD,d),l.dispatchEvent(e),e.defaultPrevented||cD(null!=t?t:document.body,{select:!0}),l.removeEventListener(rD,d),uD.remove(p)}),0)}}var e}),[l,u,d,p]);const m=n.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=sD(e),n=aD(t,e),r=aD(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&cD(i,{select:!0})):(e.preventDefault(),r&&cD(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return n.createElement(KN.div,NN({tabIndex:-1},a,{ref:f,onKeyDown:m}))}));function sD(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 aD(e,t){for(const n of e)if(!lD(n,{upTo:t}))return n}function lD(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 cD(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()}}const uD=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=dD(e,t),e.unshift(t)},remove(t){var n;e=dD(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function dD(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const hD=n.forwardRef(((e,t)=>{var o;const{container:i=(null===globalThis||void 0===globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...s}=e;return i?r.createPortal(n.createElement(KN.div,NN({},s,{ref:t})),i):null})),fD=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{};const pD=e=>{const{present:t,children:o}=e,i=function(e){const[t,o]=n.useState(),i=n.useRef({}),s=n.useRef(e),a=n.useRef("none"),l=e?"mounted":"unmounted",[c,u]=function(e,t){return n.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect((()=>{const e=mD(i.current);a.current="mounted"===c?e:"none"}),[c]),fD((()=>{const t=i.current,n=s.current;if(n!==e){const r=a.current,o=mD(t);if(e)u("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}}),[e,u]),fD((()=>{if(t){const e=e=>{const n=mD(i.current).includes(e.animationName);e.target===t&&n&&r.flushSync((()=>u("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=mD(i.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(t),s="function"==typeof o?o({present:i.isPresent}):n.Children.only(o),a=MN(i.ref,s.ref);return"function"==typeof o||i.isPresent?n.cloneElement(s,{ref:a}):null};function mD(e){return(null==e?void 0:e.animationName)||"none"}pD.displayName="Presence";let gD=0;function vD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var yD=FC(),bD=function(){},xD=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:bD,onWheelCapture:bD,onTouchMoveCapture:bD}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=NC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=LC([n,t]),S=TC(TC({},b),o);return i.createElement(i.Fragment,null,d&&i.createElement(x,{sideCar:yD,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),a?i.cloneElement(i.Children.only(l),TC(TC({},S),{ref:w})):i.createElement(y,TC({},S,{className:c,ref:w}),l))}));xD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xD.classNames={fullWidth:MC,zeroRight:_C};var wD=!1;if("undefined"!=typeof window)try{var SD=Object.defineProperty({},"passive",{get:function(){return wD=!0,!0}});window.addEventListener("test",SD,SD),window.removeEventListener("test",SD,SD)}catch(AY){wD=!1}var CD=!!wD&&{passive:!1},kD=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},ED=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),jD(e,n)){var r=PD(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},jD=function(e,t){return"v"===e?function(e){return kD(e,"overflowY")}(t):function(e){return kD(e,"overflowX")}(t)},PD=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},TD=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ND=function(e){return[e.deltaX,e.deltaY]},DD=function(e){return e&&"current"in e?e.current:e},_D=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},MD=0,OD=[];const RD=qC(yD,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(MD++)[0],s=i.useState((function(){return HC()}))[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DC([e.lockRef.current],(e.shards||[]).map(DD),!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 l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=TD(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[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=ED(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=ED(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=PD(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&jD(e,s)&&(u+=p,d+=f),s=s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return c&&0===u?l=!0:c||0!==d||(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(OD.length&&OD[OD.length-1]===s){var r="deltaY"in n?ND(n):TD(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&((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 i=(a.current.shards||[]).map(DD).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=TD(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,ND(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,TD(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return OD.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,CD),document.addEventListener("touchmove",c,CD),document.addEventListener("touchstart",d,CD),function(){OD=OD.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,CD),document.removeEventListener("touchmove",c,CD),document.removeEventListener("touchstart",d,CD)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:_D(o)}):null,p?i.createElement(ek,{gapMode:"margin"}):null)}));var AD=i.forwardRef((function(e,t){return i.createElement(xD,TC({},e,{ref:t,sideCar:RD}))}));AD.classNames=xD.classNames;const LD="Dialog",[ID,FD]=function(e,t=[]){let r=[];const o=()=>{const t=r.map((e=>n.createContext(e)));return function(r){const o=(null==r?void 0:r[e])||t;return n.useMemo((()=>({[`__scope${e}`]:{...r,[e]:o}})),[r,o])}};return o.scopeName=e,[function(t,o){const i=n.createContext(o),s=r.length;function a(t){const{scope:r,children:o,...a}=t,l=(null==r?void 0:r[e][s])||i,c=n.useMemo((()=>a),Object.values(a));return n.createElement(l.Provider,{value:c},o)}return r=[...r,o],a.displayName=t+"Provider",[a,function(r,a){const l=n.useContext((null==a?void 0:a[e][s])||i);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},ON(o,...t)]}(LD),[$D,qD]=ID(LD),zD="DialogPortal",[UD,BD]=ID(zD,{forceMount:void 0}),VD="DialogOverlay",KD=n.forwardRef(((e,t)=>{const r=BD(VD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=qD(VD,e.__scopeDialog);return s.modal?n.createElement(pD,{present:o||s.open},n.createElement(HD,NN({},i,{ref:t}))):null})),HD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,...o}=e,i=qD(VD,r);return n.createElement(AD,{as:qN,allowPinchZoom:!0,shards:[i.contentRef]},n.createElement(KN.div,NN({"data-state":ZD(i.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))})),WD="DialogContent",GD=n.forwardRef(((e,t)=>{const r=BD(WD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=qD(WD,e.__scopeDialog);return n.createElement(pD,{present:o||s.open},n.createElement(s.modal?YD:QD,NN({},i,{ref:t})))})),YD=n.forwardRef(((e,t)=>{const r=qD(WD,e.__scopeDialog),o=n.useRef(null),i=MN(t,r.contentRef,o);return n.useEffect((()=>{const e=o.current;if(e)return Ck(e)}),[]),n.createElement(XD,NN({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:DN(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:DN(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:DN(e.onFocusOutside,(e=>e.preventDefault()))}))})),QD=n.forwardRef(((e,t)=>{const r=qD(WD,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return n.createElement(XD,NN({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented)||(o.current||null===(s=r.triggerRef.current)||void 0===s||s.focus(),t.preventDefault());o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null===(n=e.onInteractOutside)||void 0===n||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?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}}))})),XD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=qD(WD,r),c=MN(t,n.useRef(null));return n.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:vD()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:vD()),gD++,()=>{1===gD&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),gD--}}),[]),n.createElement(n.Fragment,null,n.createElement(iD,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s},n.createElement(JN,NN({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ZD(l.open)},a,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)})),JD="DialogTitle";function ZD(e){return e?"open":"closed"}!function(e,t){const r=n.createContext(t);function o(e){const{children:t,...o}=e,i=n.useMemo((()=>o),Object.values(o));return n.createElement(r.Provider,{value:i},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:WD,titleName:JD,docsSlug:"dialog"});const e_=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=n.useRef(null),c=n.useRef(null),[u=!1,d]=$N({prop:o,defaultProp:i,onChange:s});return n.createElement($D,{scope:t,triggerRef:l,contentRef:c,contentId:IN(),titleId:IN(),descriptionId:IN(),open:u,onOpenChange:d,onOpenToggle:n.useCallback((()=>d((e=>!e))),[d]),modal:a},r)},t_=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,s=qD(zD,t);return n.createElement(UD,{scope:t,forceMount:r},n.Children.map(o,(e=>n.createElement(pD,{present:r||s.open},n.createElement(hD,{asChild:!0,container:i},e)))))},n_=KD,r_=GD;var o_='[cmdk-group=""]',i_='[cmdk-group-items=""]',s_='[cmdk-item=""]',a_=`${s_}:not([aria-disabled="true"])`,l_="cmdk-item-select",c_="data-value",u_=(e,t,n)=>TN(e,t,n),d_=i.createContext(void 0),h_=()=>i.useContext(d_),f_=i.createContext(void 0),p_=()=>i.useContext(f_),m_=i.createContext(void 0),g_=i.forwardRef(((e,t)=>{let n=D_((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=D_((()=>new Set)),o=D_((()=>new Map)),s=D_((()=>new Map)),a=D_((()=>new Set)),l=T_(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=i.useId(),x=i.useId(),w=i.useId(),S=i.useRef(null),C=R_();N_((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),N_((()=>{C(6,D)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),P(),C(1,T);else if("value"===e&&(r||C(5,D),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,j(t,r)),C(2,(()=>{P(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{N(),P(),n.current.value||T(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=_();C(4,(()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&T(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:g,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function j(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:u_;return e?i(e,n.current.search,t):0}function P(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(i_);t?t.appendChild(e.parentElement===t?e:e.closest(`${i_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${i_} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=S.current.querySelector(`${o_}[${c_}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function T(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(c_);k.setState("value",t||void 0)}function N(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=j(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function D(){var e,t,n;let r=_();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(o_))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function _(){var e;return null==(e=S.current)?void 0:e.querySelector(`${s_}[aria-selected="true"]`)}function M(){var e;return Array.from(null==(e=S.current)?void 0:e.querySelectorAll(a_))}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(c_))}function R(e){var t;let n=_(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(c_))}function A(e){let t,n=_(),r=null==n?void 0:n.closest(o_);for(;r&&!t;)r=e>0?j_(r,o_):P_(r,o_),t=null==r?void 0:r.querySelector(a_);t?k.setState("value",t.getAttribute(c_)):R(e)}let L=()=>O(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):R(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?A(-1):R(-1)};return i.createElement(KN.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=_();if(t){let e=new Event(l_);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:L_},c),A_(e,(e=>i.createElement(f_.Provider,{value:k},i.createElement(d_.Provider,{value:E},e)))))})),v_=i.forwardRef(((e,t)=>{var n,r;let o=i.useId(),s=i.useRef(null),a=i.useContext(m_),l=h_(),c=T_(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;N_((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=O_(o,s,[e.value,e.children,s],e.keywords),h=p_(),f=M_((e=>e.value&&e.value===d.current)),p=M_((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){h.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(l_,m),()=>t.removeEventListener(l_,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(KN.div,{ref:__([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.disablePointerSelection?void 0:g,onClick:v?void 0:m},e.children)})),y_=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=i.useId(),l=i.useRef(null),c=i.useRef(null),u=i.useId(),d=h_(),h=M_((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));N_((()=>d.group(a)),[]),O_(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(KN.div,{ref:__([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),A_(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(m_.Provider,{value:f},e)))))})),b_=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=M_((e=>!e.search));return n||s?i.createElement(KN.div,{ref:__([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),x_=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=p_(),a=M_((e=>e.search)),l=M_((e=>e.value)),c=h_(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${s_}[${c_}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(KN.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),w_=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=h_();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(KN.div,{ref:__([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},A_(e,(e=>i.createElement("div",{ref:__([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),S_=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(e_,{open:n,onOpenChange:r},i.createElement(t_,{container:a},i.createElement(n_,{"cmdk-overlay":"",className:o}),i.createElement(r_,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(g_,{ref:t,...l}))))})),C_=i.forwardRef(((e,t)=>M_((e=>0===e.filtered.count))?i.createElement(KN.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),k_=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(KN.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},A_(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),E_=Object.assign(g_,{List:w_,Item:v_,Input:x_,Group:y_,Separator:b_,Dialog:S_,Empty:C_,Loading:k_});function j_(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function P_(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T_(e){let t=i.useRef(e);return N_((()=>{t.current=e})),t}var N_="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function D_(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function __(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function M_(e){let t=p_(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function O_(e,t,n,r=[]){let o=i.useRef(),s=h_();return N_((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(c_,a),o.current=a})),o}var R_=()=>{let[e,t]=i.useState(),n=D_((()=>new Map));return N_((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function A_({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var L_={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const I_=i.forwardRef((({className:e,...n},r)=>t.jsx(E_,{ref:r,className:Th("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));I_.displayName=E_.displayName;const F_=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(jd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(E_.Input,{ref:o,className:Th("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));F_.displayName=E_.Input.displayName;const $_=i.forwardRef((({className:e,...n},r)=>t.jsx(E_.List,{ref:r,className:Th("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));$_.displayName=E_.List.displayName;const q_=i.forwardRef(((e,n)=>t.jsx(E_.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));q_.displayName=E_.Empty.displayName;const z_=i.forwardRef((({className:e,...n},r)=>t.jsx(E_.Group,{ref:r,className:Th("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));z_.displayName=E_.Group.displayName;const U_=i.forwardRef((({className:e,...n},r)=>t.jsx(E_.Separator,{ref:r,className:Th("-mx-1 h-px bg-border",e),...n})));U_.displayName=E_.Separator.displayName;const B_=i.forwardRef((({className:e,...n},r)=>t.jsx(E_.Item,{ref:r,className:Th("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));B_.displayName=E_.Item.displayName;var V_="focusScope.autoFocusOnMount",K_="focusScope.autoFocusOnUnmount",H_={bubbles:!1,cancelable:!0},W_=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Bc(s),h=Bc(a),f=i.useRef(null),p=Mc(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:X_(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||X_(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&X_(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){J_.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(V_,H_);c.addEventListener(V_,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(X_(r,{select:t}),document.activeElement!==n)return}((e=G_(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&X_(c))}return()=>{c.removeEventListener(V_,d),setTimeout((()=>{const e=new CustomEvent(K_,H_);c.addEventListener(K_,h),c.dispatchEvent(e),e.defaultPrevented||X_(t??document.body,{select:!0}),c.removeEventListener(K_,h),J_.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.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=G_(e),n=Y_(t,e),r=Y_(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&X_(i,{select:!0})):(e.preventDefault(),r&&X_(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(zc.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function G_(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 Y_(e,t){for(const n of e)if(!Q_(n,{upTo:t}))return n}function Q_(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 X_(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()}}W_.displayName="FocusScope";var J_=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Z_(e,t),e.unshift(t)},remove(t){e=Z_(e,t),e[0]?.resume()}}}();function Z_(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var eM="Popover",[tM,nM]=Oc(eM,[Qj]),rM=Qj(),[oM,iM]=tM(eM),sM=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=rM(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=su({prop:o,defaultProp:s,onChange:a});return t.jsx(hP,{...c,children:t.jsx(oM,{scope:n,contentId:eC(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:i.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>h(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>h(!1)),[]),modal:l,children:r})})};sM.displayName=eM;var aM="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=iM(aM,r),a=rM(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(fP,{...a,...o,ref:n})})).displayName=aM;var lM="PopoverTrigger",cM=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=iM(lM,r),s=rM(r),a=Mc(n,i.triggerRef),l=t.jsx(zc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xM(i.open),...o,ref:a,onClick:Nc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(fP,{asChild:!0,...s,children:l})}));cM.displayName=lM;var uM="PopoverPortal",[dM,hM]=tM(uM,{forceMount:void 0}),fM=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=iM(uM,n);return t.jsx(dM,{scope:n,forceMount:r,children:t.jsx(ou,{present:r||s.open,children:t.jsx(ru,{asChild:!0,container:i,children:o})})})};fM.displayName=uM;var pM="PopoverContent",mM=i.forwardRef(((e,n)=>{const r=hM(pM,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=iM(pM,e.__scopePopover);return t.jsx(ou,{present:o||s.open,children:t.jsx(s.modal?gM:vM,{...i,ref:n})})}));mM.displayName=pM;var gM=i.forwardRef(((e,n)=>{const r=iM(pM,e.__scopePopover),o=i.useRef(null),s=Mc(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return Ck(e)}),[]),t.jsx(gk,{as:Ac,allowPinchZoom:!0,children:t.jsx(yM,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nc(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Nc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Nc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),vM=i.forwardRef(((e,n)=>{const r=iM(pM,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(yM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),yM=i.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=iM(pM,r),p=rM(r);return jC(),t.jsx(W_,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(pP,{"data-state":xM(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)"}})})})})),bM="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=iM(bM,r);return t.jsx(zc.button,{type:"button",...o,ref:n,onClick:Nc(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=bM;function xM(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=rM(r);return t.jsx(mP,{...i,...o,ref:n})})).displayName="PopoverArrow";var wM=fM,SM=mM;const CM=sM,kM=cM,EM=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(wM,{children:t.jsx(SM,{ref:i,align:n,sideOffset:r,className:Th("z-[9999] 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})})));EM.displayName=SM.displayName;var jM=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(NM);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(PM,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(PM,{...o,ref:n,children:r})}));jM.displayName="Slot";var PM=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)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!==i.Fragment&&(o.ref=t?_c(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));PM.displayName="SlotClone";var TM=({children:e})=>t.jsx(t.Fragment,{children:e});function NM(e){return i.isValidElement(e)&&e.type===TM}var DM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?jM: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}}),{}),_M="horizontal",MM=["horizontal","vertical"],OM=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=_M,...i}=e,s=function(e){return MM.includes(e)}(o)?o:_M;return t.jsx(DM.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));OM.displayName="Separator";var RM=OM;const AM=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(RM,{ref:i,decorative:r,orientation:n,className:Th("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));AM.displayName=RM.displayName;const LM=Zu("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),IM=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:h,emptyMessage:f="No results found.",searchIcon:p=t.jsx(jd,{className:"h-4 w-4"}),selectedValues:m,setSelectedValues:g,...v},y)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(CM,{open:b,onOpenChange:x,modal:l,children:[t.jsx(kM,{asChild:!0,children:t.jsx(iw,{ref:y,...v,onClick:()=>{x((e=>!e))},className:Th("flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto ",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(eN,{className:Th(w?"animate-bounce":"",LM({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(fd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(eN,{className:Th("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",LM({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(fd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ad,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(AM,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(ad,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(ad,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(EM,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(I_,{children:[t.jsx(F_,{searchIcon:p,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),h&&(h(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs($_,{children:[t.jsx(q_,{children:f}),t.jsxs(z_,{children:[t.jsxs(B_,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:Th("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(sd,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(B_,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Th("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(sd,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(U_,{}),t.jsx(z_,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(B_,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(AM,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(B_,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u]})})]})]})}),s>0&&m.length>0&&t.jsx(Rd,{className:Th("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function FM(e,[t,n]){return Math.min(n,Math.max(t,e))}IM.displayName="MultiSelect";var $M=i.createContext(void 0);function qM(e){const t=i.useContext($M);return e||t||"ltr"}var zM=[" ","Enter","ArrowUp","ArrowDown"],UM=[" ","Enter"],BM="Select",[VM,KM,HM]=qc(BM),[WM,GM]=Oc(BM,[HM,Qj]),YM=Qj(),[QM,XM]=WM(BM),[JM,ZM]=WM(BM),eO=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:p,required:m,form:g}=e,v=YM(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=qM(d),[E=!1,j]=su({prop:o,defaultProp:s,onChange:a}),[P,T]=su({prop:l,defaultProp:c,onChange:u}),N=i.useRef(null),D=!y||(g||!!y.closest("form")),[_,M]=i.useState(new Set),O=Array.from(_).map((e=>e.props.value)).join(";");return t.jsx(hP,{...v,children:t.jsxs(QM,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:eC(),value:P,onValueChange:T,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:N,disabled:p,children:[t.jsx(VM.Provider,{scope:n,children:t.jsx(JM,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),D?t.jsxs(qO,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:P,onChange:e=>T(e.target.value),disabled:p,form:g,children:[void 0===P?t.jsx("option",{value:""}):null,Array.from(_)]},O):null]})})};eO.displayName=BM;var tO="SelectTrigger",nO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=YM(r),l=XM(tO,r),c=l.disabled||o,u=Mc(n,l.onTriggerChange),d=KM(r),h=i.useRef("touch"),[f,p,m]=zO((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=UO(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(fP,{asChild:!0,...a,children:t.jsx(zc.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":$O(l.value)?"":void 0,...s,ref:u,onClick:Nc(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Nc(s.onPointerDown,(e=>{h.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:Nc(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||zM.includes(e.key)&&(g(),e.preventDefault())}))})})}));nO.displayName=tO;var rO="SelectValue",oO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=XM(rO,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Mc(n,c.onValueNodeChange);return nu((()=>{u(d)}),[u,d]),t.jsx(zc.span,{...l,ref:h,style:{pointerEvents:"none"},children:$O(c.value)?t.jsx(t.Fragment,{children:a}):s})}));oO.displayName=rO;var iO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(zc.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));iO.displayName="SelectIcon";var sO=e=>t.jsx(ru,{asChild:!0,...e});sO.displayName="SelectPortal";var aO="SelectContent",lO=i.forwardRef(((e,n)=>{const r=XM(aO,e.__scopeSelect),[o,a]=i.useState();if(nu((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(uO,{scope:e.__scopeSelect,children:t.jsx(VM.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(hO,{...e,ref:n})}));lO.displayName=aO;var cO=10,[uO,dO]=WM(aO),hO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=XM(aO,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Mc(n,(e=>S(e))),[j,P]=i.useState(null),[T,N]=i.useState(null),D=KM(r),[_,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return Ck(w)}),[w]),jC();const R=i.useCallback((e=>{const[t,...n]=D().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[D,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{_&&A()}),[_,A]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=zO((e=>{const t=D().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=UO(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(P(e),r&&(O.current=!0))}),[x.value]),z=i.useCallback((()=>w?.focus()),[w]),U=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!O.current&&!n)&&N(e)}),[x.value]),B="popper"===o?pO:fO,V=B===pO?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(uO,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:T,position:o,isPositioned:_,searchRef:F,children:t.jsx(gk,{as:Ac,allowPinchZoom:!0,children:t.jsx(W_,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Nc(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Nc(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=D().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((()=>R(t))),e.preventDefault()}}))})})})})})}));hO.displayName="SelectContentImpl";var fO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=XM(aO,r),l=dO(aO,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Mc(n,(e=>h(e))),p=KM(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-cO,l=FM(o,[cO,Math.max(cO,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"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),l=window.innerWidth-cO,u=FM(o,[cO,Math.max(cO,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*cO,l=v.scrollHeight,u=window.getComputedStyle(d),h=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=h+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-cO,j=s-E,P=y.offsetHeight/2,T=h+f+(y.offsetTop+P),N=x-T;if(T<=E){const e=i.length>0&&y===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(j,P+(e?k:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+g);c.style.height=T+t+"px"}else{const e=i.length>0&&y===i[0].ref.current;c.style.top="0px";const t=Math.max(E,h+v.offsetTop+(e?C:0)+P);c.style.height=t+N+"px",v.scrollTop=T-E+v.offsetTop}c.style.margin=`${cO}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[p,a.trigger,a.valueNode,c,d,v,y,b,a.dir,o]);nu((()=>w()),[w]);const[S,C]=i.useState();nu((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(mO,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(zc.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));fO.displayName="SelectItemAlignedPosition";var pO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=cO,...s}=e,a=YM(r);return t.jsx(pP,{...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)"}})}));pO.displayName="SelectPopperPosition";var[mO,gO]=WM(aO,{}),vO="SelectViewport",yO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=dO(vO,r),l=gO(vO,r),c=Mc(n,a.onViewportChange),u=i.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(VM.Slot,{scope:r,children:t.jsx(zc.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Nc(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*cO,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")}}}u.current=t.scrollTop}))})})]})}));yO.displayName=vO;var bO="SelectGroup",[xO,wO]=WM(bO);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=eC();return t.jsx(xO,{scope:r,id:i,children:t.jsx(zc.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=bO;var SO="SelectLabel",CO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=wO(SO,r);return t.jsx(zc.div,{id:i.id,...o,ref:n})}));CO.displayName=SO;var kO="SelectItem",[EO,jO]=WM(kO),PO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=XM(kO,r),u=dO(kO,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Mc(n,(e=>u.itemRefCallback?.(e,o,s))),v=eC(),y=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.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(EO,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(VM.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(zc.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Nc(l.onFocus,(()=>m(!0))),onBlur:Nc(l.onBlur,(()=>m(!1))),onClick:Nc(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Nc(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Nc(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Nc(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Nc(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Nc(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(UM.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));PO.displayName=kO;var TO="SelectItemText",NO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=XM(TO,r),u=dO(TO,r),d=jO(TO,r),h=ZM(TO,r),[f,p]=i.useState(null),m=Mc(n,(e=>p(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,v=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=h;return nu((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(zc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));NO.displayName=TO;var DO="SelectItemIndicator",_O=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return jO(DO,r).isSelected?t.jsx(zc.span,{"aria-hidden":!0,...o,ref:n}):null}));_O.displayName=DO;var MO="SelectScrollUpButton",OO=i.forwardRef(((e,n)=>{const r=dO(MO,e.__scopeSelect),o=gO(MO,e.__scopeSelect),[s,a]=i.useState(!1),l=Mc(n,o.onScrollButtonChange);return nu((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(LO,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));OO.displayName=MO;var RO="SelectScrollDownButton",AO=i.forwardRef(((e,n)=>{const r=dO(RO,e.__scopeSelect),o=gO(RO,e.__scopeSelect),[s,a]=i.useState(!1),l=Mc(n,o.onScrollButtonChange);return nu((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(LO,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));AO.displayName=RO;var LO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=dO("SelectScrollButton",r),l=i.useRef(null),c=KM(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),nu((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(zc.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Nc(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Nc(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Nc(s.onPointerLeave,(()=>{u()}))})})),IO=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(zc.div,{"aria-hidden":!0,...o,ref:n})}));IO.displayName="SelectSeparator";var FO="SelectArrow";function $O(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=YM(r),s=XM(FO,r),a=dO(FO,r);return s.open&&"popper"===a.position?t.jsx(mP,{...i,...o,ref:n}):null})).displayName=FO;var qO=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Mc(n,s),l=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(r);return i.useEffect((()=>{const e=s.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[l,r]),t.jsx(au,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function zO(e){const t=Bc(e),n=i.useRef(""),r=i.useRef(0),o=i.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]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function UO(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}qO.displayName="BubbleSelect";var BO=nO,VO=iO,KO=sO,HO=lO,WO=yO,GO=CO,YO=PO,QO=NO,XO=_O,JO=OO,ZO=AO,eR=IO;const tR=eO,nR=oO,rR=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(BO,{ref:o,className:Th("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(VO,{asChild:!0,children:t.jsx(ad,{className:"h-4 w-4 opacity-50"})})]})));rR.displayName=BO.displayName;const oR=i.forwardRef((({className:e,...n},r)=>t.jsx(JO,{ref:r,className:Th("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ud,{className:"h-4 w-4"})})));oR.displayName=JO.displayName;const iR=i.forwardRef((({className:e,...n},r)=>t.jsx(ZO,{ref:r,className:Th("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ad,{className:"h-4 w-4"})})));iR.displayName=ZO.displayName;const sR=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(KO,{children:t.jsxs(HO,{ref:i,className:Th("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(oR,{}),t.jsx(WO,{className:Th("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(iR,{})]})})));sR.displayName=HO.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(GO,{ref:r,className:Th("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=GO.displayName;const aR=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(YO,{ref:o,className:Th("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(XO,{children:t.jsx(sd,{className:"h-4 w-4"})})}),t.jsx(QO,{children:n})]})));aR.displayName=YO.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(eR,{ref:r,className:Th("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=eR.displayName;const lR=({condition:e,conditionNameToMetadata:r,buildInFieldToHumanReadable:o,updateCondition:i,deleteCondition:s,conditionState:a,index:l,iconDefinitions:c,operatorToHumanReadable:u})=>{const{toast:d}=Tc();n.useEffect((()=>{"exists"===e.operator&&i(l,"value",[])}),[e.operator]);const h="exists"!==e.operator,f=e.value.map((e=>String(e)));return t.jsx("div",{children:t.jsxs(Ax.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 ${a.length>1?"grid-cols-[1fr_1fr_1fr_auto]":"grid-cols-[1fr_1fr_1fr]"} gap-4`,children:[t.jsxs(tR,{onValueChange:e=>i(l,"field",e),value:e.field,children:[t.jsx(rR,{children:t.jsx(nR,{placeholder:"Select field",children:o[e.field]??e.field})}),t.jsx(sR,{children:Object.keys(r).map((e=>t.jsx(aR,{value:e,children:o[e]??e},e)))})]}),t.jsxs(tR,{onValueChange:e=>i(l,"operator",e),value:e.operator,children:[t.jsx(rR,{children:t.jsx(nR,{})}),t.jsx(sR,{children:(r[e.field]?.operators||[]).map((e=>t.jsx(aR,{value:e,children:u[e]??e},e)))})]}),t.jsx(Ax.div,{className:"w-full",initial:!1,animate:{opacity:h?1:0,height:h?"auto":0},transition:{type:"spring",damping:25,stiffness:200},children:t.jsx("div",{className:"w-full border rounded-lg overflow-hidden "+(h?"":"hidden"),children:t.jsx(IM,{selectedValues:f,setSelectedValues:e=>{i(l,"value",[...new Set(e)])},options:[...Array.from(new Set([...f,...r[e.field]?.options??[]])).map((e=>({label:e,value:e})))],defaultValue:f,onValueChange:e=>i(l,"value",e),searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:t=>{if(t.length>0){const n=r[e.field];if(!n)return void d({title:"Error",description:"Invalid field selected",variant:"destructive"});const o=(e=>{const{value:t,type:n}=e;switch(n){case dN.String:return t.length>0;case dN.Number:return!isNaN(Number(t));case dN.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case dN.Boolean:return"true"===t||"false"===t;case dN.Date:case dN.DateTime:return!isNaN(new Date(t).getTime());default:throw hw(n,dN)}})({value:t,type:n.type});o?i(l,"value",[...new Set([...f,t])]):d({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${n.type} type`,variant:"destructive"})}},searchIcon:t.jsx(c.PlusIcon,{className:"h-4 w-4"})})})}),a.length>1&&t.jsx(Ax.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>s(l),className:"p-2 hover:text-red-600","aria-label":"Delete condition",children:t.jsx(c.CloseButton,{})})]})})},cR={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"},uR={[fN.EQUALS]:"Equals",[fN.NOT_EQUALS]:"Not Equals",[fN.GREATER_THAN]:"Greater Than",[fN.LESS_THAN]:"Less Than",[fN.EXISTS]:"Exists"},dR=({conditionNameToMetadata:e,setConditionState:r,conditionState:o,iconDefinitions:i})=>{const s=(e,t,n)=>{const i=[...o];i[e]={...i[e],[t]:n},r(i)},a=e=>{const t=o.filter(((t,n)=>n!==e));r(t)};return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Qh,{mode:"popLayout",children:o.map(((r,l)=>t.jsxs(n.Fragment,{children:[t.jsx("div",{children:t.jsx(lR,{condition:r,conditionNameToMetadata:e,buildInFieldToHumanReadable:cR,updateCondition:s,deleteCondition:a,conditionState:o,index:l,iconDefinitions:i,operatorToHumanReadable:uR})}),l<o.length-1&&t.jsxs("div",{className:"flex items-center my-2",children:[t.jsx("div",{className:"h-px flex-1 bg-gray-200"}),t.jsx("span",{className:"px-4 text-sm font-medium text-gray-400",children:"AND"}),t.jsx("div",{className:"h-px flex-1 bg-gray-200"})]})]},l)))}),t.jsx("div",{children:t.jsxs(Ax.button,{whileHover:Object.keys(e).length>0?{scale:1.02}:void 0,whileTap:Object.keys(e).length>0?{scale:.98}:void 0,onClick:()=>{const t=Object.keys(e)[0],n={field:t,operator:e[t].operators[0],value:[]};r([...o,n])},disabled:0===Object.keys(e).length,className:Th("flex items-center px-4 py-2",0===Object.keys(e).length&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{className:"mr-2",children:"+"}),0===Object.keys(e).length?"No Conditions Available":"Add Condition"]})})]})},hR=({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})})]})]})}),fR="relative rounded-lg",pR=({onClose:e,iconDefinitions:r,segmentId:o})=>{const i=o||void 0,{toast:s}=Tc(),{segment:a}=yN(i),{updateSegment:l}=bN(i),{segmentsConditions:c,isLoading:u,createSegment:d,isCreating:h}=gN(),[f,p]=n.useState(!1),m=Jx(r),[g,v]=n.useState([]),[y,b]=n.useState({name:"",description:""}),[x,w]=n.useState({}),S=y.name&&y.description&&g.some((e=>e.field&&e.operator&&e.value.length>0));n.useEffect((()=>{c&&(i&&a?(b({name:a.name,description:a.description}),v(a.conditions)):v([{field:c.conditions[0].field,operator:c.conditions[0].operators[0],value:[]}]),w(c.conditions.reduce(((e,t)=>(e[t.field]={operators:t.operators,type:t.type,options:t.options},e)),{})))}),[c,a,i]);return u?t.jsx("div",{className:fR,children:t.jsx(Fx,{text:["Fetching Segment data","Finishing up"]})}):h||f?t.jsx("div",{className:fR,children:t.jsx(Fx,{text:i&&a?["Updating Segment","Finishing up"]:["Creating Segment","Finishing up"]})}):t.jsxs("div",{className:fR,children:[t.jsx("div",{className:"relative w-full flex justify-end mb-4",children:t.jsx(iw,{onClick:()=>e?.(!1),className:"w-4 h-4 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors duration-200","aria-label":"Close",variant:"ghost",children:t.jsx(m.CloseButton,{})})}),t.jsxs("div",{className:"space-y-6",children:[t.jsx(hR,{nameAndDescriptionState:y,setNameAndDescriptionState:b}),t.jsx(dR,{conditionNameToMetadata:x,conditionState:g,setConditionState:v,iconDefinitions:m}),t.jsx(xN,{onClose:e,isDisabled:!S,setClickedCreate:()=>{if(!y.name||!y.description)return void s({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:n}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==fN.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===fN.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"}}return{valid:!0,error:void 0}})(g);if(!t)return void s({title:"Conditions are invalid",description:n??"Please ensure all fields are filled out",variant:"destructive"});p(!0);const r={name:y.name,description:y.description,conditions:g.map((e=>({...e,value:e.value.map(String)})))};a?l(r,{onSuccess:t=>{e?.(t?.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{v([]),b({name:"",description:""})}}):d(r,{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{v([]),b({name:"",description:""})}})},createButtonText:a?"Update":"Create"})]})]})};var mR="rovingFocusGroup.onEntryFocus",gR={bubbles:!1,cancelable:!0},vR="RovingFocusGroup",[yR,bR,xR]=qc(vR),[wR,SR]=Oc(vR,[xR]),[CR,kR]=wR(vR),ER=i.forwardRef(((e,n)=>t.jsx(yR.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(yR.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(jR,{...e,ref:n})})})));ER.displayName=vR;var jR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=i.useRef(null),m=Mc(n,p),g=qM(a),[v=null,y]=su({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=Bc(d),S=bR(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(mR,w),()=>e.removeEventListener(mR,w)}),[w]),t.jsx(CR,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(zc.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Nc(e.onMouseDown,(()=>{C.current=!0})),onFocus:Nc(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(mR,gR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));DR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Nc(e.onBlur,(()=>x(!1)))})})})),PR="RovingFocusGroupItem",TR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=eC(),u=a||c,d=kR(PR,r),h=d.currentTabStopId===u,f=bR(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(yR.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(zc.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Nc(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Nc(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Nc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.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:NR[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().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=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>DR(o)))}var n,r}))})})}));TR.displayName=PR;var NR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DR(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 _R=ER,MR=TR,OR="Tabs",[RR,AR]=Oc(OR,[SR]),LR=SR(),[IR,FR]=RR(OR),$R=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=qM(l),[h,f]=su({prop:o,onChange:i,defaultProp:s});return t.jsx(IR,{scope:r,baseId:eC(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(zc.div,{dir:d,"data-orientation":a,...u,ref:n})})}));$R.displayName=OR;var qR="TabsList",zR=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=FR(qR,r),a=LR(r);return t.jsx(_R,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(zc.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));zR.displayName=qR;var UR="TabsTrigger",BR=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=FR(UR,r),l=LR(r),c=HR(a.baseId,o),u=WR(a.baseId,o),d=o===a.value;return t.jsx(MR,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(zc.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:Nc(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Nc(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Nc(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));BR.displayName=UR;var VR="TabsContent",KR=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=FR(VR,r),u=HR(c.baseId,o),d=WR(c.baseId,o),h=o===c.value,f=i.useRef(h);return i.useEffect((()=>{const e=requestAnimationFrame((()=>f.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(ou,{present:s||h,children:({present:r})=>t.jsx(zc.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&a})})}));function HR(e,t){return`${e}-trigger-${t}`}function WR(e,t){return`${e}-content-${t}`}KR.displayName=VR;var GR=zR,YR=BR,QR=KR;const XR=$R,JR=i.forwardRef((({className:e,...n},r)=>t.jsx(GR,{ref:r,className:Th("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));JR.displayName=GR.displayName;const ZR=i.forwardRef((({className:e,...n},r)=>t.jsx(YR,{ref:r,className:Th("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})));ZR.displayName=YR.displayName;const eA=i.forwardRef((({className:e,...n},r)=>t.jsx(QR,{ref:r,className:Th("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));eA.displayName=QR.displayName;const tA=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ja(`${zx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},nA=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await Ja(`${zx}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},rA=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(`${Ux}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},oA=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await Ja(`${Ux}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Bx(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}},iA=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ja(`${Ux}/${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}},sA=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await Ja(`${Ux}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},aA=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ja(`${Ux}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},lA=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),cA=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll",style:{border:"none",backgroundColor:"white",height:`${n}px`,width:`${r}px`}}):t.jsx(lA,{type:"email"})}),uA=({emailFromName:e,emailSubject:n,emailPreviewText:r,emailBody:o,emailBaseDomain:i})=>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:e?`${e} <${i}>`:i})]}),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:n})]}),r&&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:r})]})]}),t.jsx("div",{className:"border rounded-lg p-6 min-h-[300px] bg-white shadow-inner flex",children:t.jsx(cA,{html:o,height:500,width:500})})]}),dA=({fromPhone:e,body:n})=>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:e})]})}),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-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap",children:n})})})})]}),hA=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(Ax.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-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(iw,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(Ax.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(iw,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(Ax.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(Qh,{mode:"wait",children:["email"===i&&e&&t.jsx(Ax.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(uA,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(Ax.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(dA,{fromPhone:r.fromPhone,body:r.body})},"sms")]})})]})})},fA=({automationId:e,iconDefinitions:r})=>{const{automation:o}=Vx(e),{getCommunicationGroup:i}=rA(),{channelSenders:s}=tA(),[a,l]=n.useState(null),[c,u]=n.useState(null),[d,h]=n.useState(!1),f=n.useMemo((()=>{const e=o?.action_data?.map((e=>e.action_metadata.communication_group_id));if(e&&0!==e.length&&!(e.length>1))return e[0]}),[o]);return n.useEffect((()=>{f&&s&&i(f,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=s.channel_senders.find((e=>e.id===t));n&&e.email_html_body&&l({emailHtml:e.email_html_body,emailSubject:e.email_subject,emailBaseDomain:n.channel_sender_metadata.baseDomain,emailFromName:n.channel_sender_metadata.emailFromName,emailFromEmail:`${n.channel_sender_metadata.userPart}@${n.channel_sender_metadata.baseDomain}`,emailPreviewText:e.email_preview_text});const r=e.sms_channel_sender_id,o=s.channel_senders.find((e=>e.id===r));o&&o.channel_sender_metadata.from&&e.sms_message_body&&u({fromPhone:o.channel_sender_metadata.from,smsBody:e.sms_message_body})}finally{h(!1)}}})}),[o,i,f,s]),t.jsx("div",d?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(Fx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",a||c?{className:"space-y-4",children:[t.jsx(hA,{iconDefinitions:r,emailPreview:a&&a.emailFromEmail&&a.emailSubject&&a.emailHtml?{fromEmail:a?.emailFromEmail,fromName:a?.emailFromName??null,subject:a?.emailSubject,previewText:a?.emailPreviewText??null,body:a?.emailHtml}:null,smsPreview:c&&c.fromPhone&&c.smsBody?{fromPhone:c?.fromPhone,body:c?.smsBody}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step."}),t.jsx("button",{className:"mt-6 px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 ease-in-out",children:"Set Up Automation"})]})})},pA=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=Kx(e),{isLoading:s}=Gx(e);if(o||s)return t.jsx("div",{className:YP,children:t.jsx(Fx,{text:["Fetching Recipients","Finishing up"]})});if(i)return t.jsxs("div",{children:["Error: ",i.message]});if(!r||0===r.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(Xx.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 a="30%",l="35%",c="35%";return t.jsxs("div",{className:"relative",children:[t.jsx("div",{children:t.jsx(QP,{automationId:e,iconDefinitions:n})}),t.jsx(AM,{className:"my-4"}),t.jsxs(nN,{children:[t.jsx(rN,{children:t.jsxs(iN,{children:[t.jsx(sN,{style:{width:a},children:"Name"}),t.jsx(sN,{style:{width:l},children:"Email"}),t.jsx(sN,{style:{width:c},children:"Phone"})]})}),t.jsx(oN,{children:r.recipients.map((e=>t.jsxs(iN,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(aN,{style:{width:a},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(aN,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(aN,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var mA,gA="dismissableLayer.update",vA="dismissableLayer.pointerDownOutside",yA="dismissableLayer.focusOutside",bA=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xA=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(bA),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Mc(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){SA(vA,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)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Bc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){SA(yA,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)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Vc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(mA=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),wA(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=mA)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),wA())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(gA,e),()=>document.removeEventListener(gA,e)}),[]),t.jsx(zc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Nc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Nc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Nc(e.onPointerDownCapture,C.onPointerDownCapture)})}));xA.displayName="DismissableLayer";function wA(){const e=new CustomEvent(gA);document.dispatchEvent(e)}function SA(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?Uc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(bA),o=i.useRef(null),s=Mc(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(zc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var CA=["Enter"," "],kA=["ArrowUp","PageDown","End"],EA=["ArrowDown","PageUp","Home",...kA],jA={ltr:[...CA,"ArrowRight"],rtl:[...CA,"ArrowLeft"]},PA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},TA="Menu",[NA,DA,_A]=qc(TA),[MA,OA]=Oc(TA,[_A,Qj,SR]),RA=Qj(),AA=SR(),[LA,IA]=MA(TA),[FA,$A]=MA(TA),qA=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=RA(n),[u,d]=i.useState(null),h=i.useRef(!1),f=Bc(a),p=qM(s);return i.useEffect((()=>{const e=()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>h.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(hP,{...c,children:t.jsx(LA,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(FA,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};qA.displayName=TA;var zA=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=RA(r);return t.jsx(fP,{...i,...o,ref:n})}));zA.displayName="MenuAnchor";var UA="MenuPortal",[BA,VA]=MA(UA,{forceMount:void 0}),KA=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=IA(UA,n);return t.jsx(BA,{scope:n,forceMount:r,children:t.jsx(ou,{present:r||s.open,children:t.jsx(ru,{asChild:!0,container:i,children:o})})})};KA.displayName=UA;var HA="MenuContent",[WA,GA]=MA(HA),YA=i.forwardRef(((e,n)=>{const r=VA(HA,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=IA(HA,e.__scopeMenu),a=$A(HA,e.__scopeMenu);return t.jsx(NA.Provider,{scope:e.__scopeMenu,children:t.jsx(ou,{present:o||s.open,children:t.jsx(NA.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?QA:XA,{...i,ref:n})})})})})),QA=i.forwardRef(((e,n)=>{const r=IA(HA,e.__scopeMenu),o=i.useRef(null),s=Mc(n,o);return i.useEffect((()=>{const e=o.current;if(e)return Ck(e)}),[]),t.jsx(JA,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Nc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),XA=i.forwardRef(((e,n)=>{const r=IA(HA,e.__scopeMenu);return t.jsx(JA,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),JA=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,y=IA(HA,r),b=$A(HA,r),x=RA(r),w=AA(r),S=DA(r),[C,k]=i.useState(null),E=i.useRef(null),j=Mc(n,E,y.onContentChange),P=i.useRef(0),T=i.useRef(""),N=i.useRef(0),D=i.useRef(null),_=i.useRef("right"),M=i.useRef(0),O=g?gk:i.Fragment,R=g?{as:Ac,allowPinchZoom:!0}:void 0,A=e=>{const t=T.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=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}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){T.current=t,window.clearTimeout(P.current),""!==t&&(P.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(P.current)),[]),jC();const L=i.useCallback((e=>_.current===D.current?.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,D.current?.area)),[]);return t.jsx(WA,{scope:r,searchRef:T,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:i.useCallback((e=>{D.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(W_,{asChild:!0,trapped:s,onMountAutoFocus:Nc(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(xA,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(_R,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Nc(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(pP,{role:"menu","aria-orientation":"vertical","data-state":kL(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Nc(v.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&&A(e.key));if(e.target!==E.current)return;if(!EA.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));kA.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:Nc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),T.current="")})),onPointerMove:Nc(e.onPointerMove,PL((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){_.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));YA.displayName=HA;var ZA=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(zc.div,{role:"group",...o,ref:n})}));ZA.displayName="MenuGroup";var eL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(zc.div,{...o,ref:n})}));eL.displayName="MenuLabel";var tL="MenuItem",nL="menu.itemSelect",rL=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=$A(tL,e.__scopeMenu),c=GA(tL,e.__scopeMenu),u=Mc(n,a),d=i.useRef(!1);return t.jsx(oL,{...s,ref:u,disabled:r,onClick:Nc(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(nL,{bubbles:!0,cancelable:!0});e.addEventListener(nL,(e=>o?.(e)),{once:!0}),Uc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Nc(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Nc(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||CA.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));rL.displayName=tL;var oL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=GA(tL,r),c=AA(r),u=i.useRef(null),d=Mc(n,u),[h,f]=i.useState(!1),[p,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(NA.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(MR,{asChild:!0,...c,focusable:!o,children:t.jsx(zc.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Nc(e.onPointerMove,PL((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Nc(e.onPointerLeave,PL((e=>l.onItemLeave(e)))),onFocus:Nc(e.onFocus,(()=>f(!0))),onBlur:Nc(e.onBlur,(()=>f(!1)))})})})})),iL=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(fL,{scope:e.__scopeMenu,checked:r,children:t.jsx(rL,{role:"menuitemcheckbox","aria-checked":EL(r)?"mixed":r,...i,ref:n,"data-state":jL(r),onSelect:Nc(i.onSelect,(()=>o?.(!!EL(r)||!r)),{checkForDefaultPrevented:!1})})})}));iL.displayName="MenuCheckboxItem";var sL="MenuRadioGroup",[aL,lL]=MA(sL,{value:void 0,onValueChange:()=>{}}),cL=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Bc(o);return t.jsx(aL,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(ZA,{...i,ref:n})})}));cL.displayName=sL;var uL="MenuRadioItem",dL=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=lL(uL,e.__scopeMenu),s=r===i.value;return t.jsx(fL,{scope:e.__scopeMenu,checked:s,children:t.jsx(rL,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":jL(s),onSelect:Nc(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));dL.displayName=uL;var hL="MenuItemIndicator",[fL,pL]=MA(hL,{checked:!1}),mL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=pL(hL,r);return t.jsx(ou,{present:o||EL(s.checked)||!0===s.checked,children:t.jsx(zc.span,{...i,ref:n,"data-state":jL(s.checked)})})}));mL.displayName=hL;var gL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(zc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));gL.displayName="MenuSeparator";var vL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=RA(r);return t.jsx(mP,{...i,...o,ref:n})}));vL.displayName="MenuArrow";var[yL,bL]=MA("MenuSub"),xL="MenuSubTrigger",wL=i.forwardRef(((e,n)=>{const r=IA(xL,e.__scopeMenu),o=$A(xL,e.__scopeMenu),s=bL(xL,e.__scopeMenu),a=GA(xL,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},h=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>h),[h]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(zA,{asChild:!0,...d,children:t.jsx(oL,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":kL(r.open),...e,ref:_c(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Nc(e.onPointerMove,PL((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),h()}),100))}))),onPointerLeave:Nc(e.onPointerLeave,PL((e=>{h();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Nc(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||jA[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));wL.displayName=xL;var SL="MenuSubContent",CL=i.forwardRef(((e,n)=>{const r=VA(HA,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=IA(HA,e.__scopeMenu),l=$A(HA,e.__scopeMenu),c=bL(SL,e.__scopeMenu),u=i.useRef(null),d=Mc(n,u);return t.jsx(NA.Provider,{scope:e.__scopeMenu,children:t.jsx(ou,{present:o||a.open,children:t.jsx(NA.Slot,{scope:e.__scopeMenu,children:t.jsx(JA,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Nc(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Nc(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Nc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=PA[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function kL(e){return e?"open":"closed"}function EL(e){return"indeterminate"===e}function jL(e){return EL(e)?"indeterminate":e?"checked":"unchecked"}function PL(e){return t=>"mouse"===t.pointerType?e(t):void 0}CL.displayName=SL;var TL=qA,NL=zA,DL=KA,_L=YA,ML=ZA,OL=eL,RL=rL,AL=iL,LL=cL,IL=dL,FL=mL,$L=gL,qL=vL,zL=wL,UL=CL,BL="DropdownMenu",[VL,KL]=Oc(BL,[OA]),HL=OA(),[WL,GL]=VL(BL),YL=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=HL(n),d=i.useRef(null),[h=!1,f]=su({prop:s,defaultProp:a,onChange:l});return t.jsx(WL,{scope:n,triggerId:eC(),triggerRef:d,contentId:eC(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(TL,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};YL.displayName=BL;var QL="DropdownMenuTrigger",XL=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=GL(QL,r),a=HL(r);return t.jsx(NL,{asChild:!0,...a,children:t.jsx(zc.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:_c(n,s.triggerRef),onPointerDown:Nc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Nc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));XL.displayName=QL;var JL=e=>{const{__scopeDropdownMenu:n,...r}=e,o=HL(n);return t.jsx(DL,{...o,...r})};JL.displayName="DropdownMenuPortal";var ZL="DropdownMenuContent",eI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=GL(ZL,r),a=HL(r),l=i.useRef(!1);return t.jsx(_L,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Nc(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Nc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.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)"}})}));eI.displayName=ZL;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(ML,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var tI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(OL,{...i,...o,ref:n})}));tI.displayName="DropdownMenuLabel";var nI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(RL,{...i,...o,ref:n})}));nI.displayName="DropdownMenuItem";var rI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(AL,{...i,...o,ref:n})}));rI.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(LL,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var oI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(IL,{...i,...o,ref:n})}));oI.displayName="DropdownMenuRadioItem";var iI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(FL,{...i,...o,ref:n})}));iI.displayName="DropdownMenuItemIndicator";var sI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx($L,{...i,...o,ref:n})}));sI.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(qL,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var aI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(zL,{...i,...o,ref:n})}));aI.displayName="DropdownMenuSubTrigger";var lI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=HL(r);return t.jsx(UL,{...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)"}})}));lI.displayName="DropdownMenuSubContent";var cI=JL,uI=eI,dI=tI,hI=nI,fI=rI,pI=oI,mI=iI,gI=sI,vI=aI,yI=lI;const bI=YL,xI=XL;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(vI,{ref:i,className:Th("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(cd,{className:"ml-auto"})]}))).displayName=vI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(yI,{ref:r,className:Th("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=yI.displayName;const wI=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(cI,{children:t.jsx(uI,{ref:o,sideOffset:n,className:Th("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})})));wI.displayName=uI.displayName;const SI=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(hI,{ref:o,className:Th("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})));SI.displayName=hI.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(fI,{ref:i,className:Th("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(mI,{children:t.jsx(sd,{className:"h-4 w-4"})})}),n]}))).displayName=fI.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(pI,{ref:o,className:Th("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(mI,{children:t.jsx(pd,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=pI.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(dI,{ref:o,className:Th("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=dI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(gI,{ref:r,className:Th("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=gI.displayName;const CI=({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(sd,{className:"w-4 h-4 text-emerald-500"})}:{className:"w-6 h-6 flex items-center justify-center",children:t.jsx(Cd,{className:Th("w-4 h-4",r?"text-[var(--reach-primary)]":"text-gray-600")})}),t.jsx("span",{className:Th("text-sm font-medium",r?"text-gray-900":"text-gray-400"),children:e})]}),kI=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4",children:[!l&&t.jsxs(iw,{onClick:n,disabled:s,variant:"secondary",className:Th("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(iw,{onClick:u,variant:"secondary",className:Th("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(iw,{onClick:r,disabled:a,className:Th("flex items-center gap-2 bg-red",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),EI="reach-styles-module__header___CzneX",jI="reach-styles-module__title___8ostO",PI="reach-styles-module__description___xR5d4",TI="reach-styles-module__content___XXeK2",NI="reach-styles-module__footer___35Xil",DI=Zu("reach-styles-module__base___ANlIr",{variants:{variant:{default:"reach-styles-module__default___S2tp4",destructive:"reach-styles-module__destructive___a6Swz",outline:"reach-styles-module__outline___INmdX",secondary:"reach-styles-module__secondary___Ym15V"}},defaultVariants:{variant:"default"}}),_I=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Th(DI({variant:n}),e),...r})));_I.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(EI,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(jI,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(PI,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(TI,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Th(NI,e),...n}))).displayName="CardFooter";const MI=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ja("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var OI=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(OI||{}),RI=i.forwardRef(((e,n)=>t.jsx(zc.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));RI.displayName="Label";var AI=RI;const LI=Zu("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),II=i.forwardRef((({className:e,...n},r)=>t.jsx(AI,{ref:r,className:Th(LI(),e),...n})));II.displayName=AI.displayName;const FI=()=>t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsx("div",{className:"space-y-8",children:t.jsxs("div",{className:"bg-white rounded-xl border shadow-sm p-6",children:[t.jsx("h3",{className:"text-lg font-medium mb-4",children:"Using Dynamic Content"}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://reach-static-assets.s3.us-east-2.amazonaws.com/email-sms/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx(aw,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(xd,{}),selected:!0})]})]})})]}),$I=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),t.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),qI={all:["stripo"],token:()=>[...qI.all,"token"],templates:()=>[...qI.all,"templates"],demoTemplate:()=>[...qI.templates(),"demo"]},zI=async()=>(await Ja("/stripo/token")).data,UI=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await Ja(`/stripo/template/${e}`)).data)(e),...Wa}),BI=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(Fx,{textColor:"white",color:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),VI="UiEditorScript",KI="Reach_ZoneScript",HI=e=>{const t=document.getElementById(KI);return new Promise(((n,r)=>{const o=()=>{if(window.UIEditor){const e=document.getElementById(VI);e&&e.remove()}const t=document.createElement("script");t.id=VI,t.type="module",t.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",t.onload=()=>{window.UIEditor?window.UIEditor&&(window.UIEditor.initEditor(e.container,{metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:async t=>{try{t(e.token)}catch(n){}},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),n(void 0)):r(new Error("UIEditor not found after script load"))},t.onerror=e=>{r(e)},e.container.appendChild(t)};if(t)o();else{const t=document.createElement("script");t.id=KI,t.src="https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.6/zone.min.js",t.onload=o,t.onerror=e=>{r(e)},e.container.appendChild(t)}}))},WI=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(null),{data:c,isLoading:u}=UI(e.id),{data:d,isLoading:h,invalidateToken:f}=(()=>{const e=ne();return{...ue({queryKey:qI.token(),queryFn:zI,...Wa}),invalidateToken:()=>e.invalidateQueries({queryKey:qI.token()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=iA();return n.useEffect((()=>{if(o&&window.UIEditor&&c?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(c.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:c.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||m(!0)}))}}),[o,l,i,r,c,y,a]),n.useEffect((()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),f(),r(!1),i(!1),m(!1),v(!1))}),[p,g,r,i,f]),n.useEffect((()=>{d?.token&&l.current&&c&&HI({emailId:c.communicationGroupId,html:c.html||"<div></div>",css:c.css||"",container:l.current,token:d.token,businessId:d.businessId,mergeFields:d.mergeFields||[]}).catch((e=>{}))}),[d,c]),n.useEffect((()=>{p&&g&&r(!1)}),[p,g,r]),t.jsx("div",u||h||!d||!c?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(Fx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(BI,{containerRef:l,stripoDialogDimensions:s,showSaving:o})})},GI=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},YI=({automation:e})=>{const r=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[o,i]=n.useState(r()??null),[s,a]=n.useState(!1),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(null),[p,m]=n.useState(null),[g,v]=n.useState(!1),[y,b]=n.useState(!1),[x,w]=n.useState(null),[S,C]=n.useState(null),[k,E]=n.useState(null),[j,P]=n.useState(!1),{refetchAutomation:T}=Vx(e.id),[N,D]=n.useState(!1),_=GI(x,500),M=GI(S,500),{channelSenders:O}=tA(),{channelAccounts:R}=MI(),{getCommunicationGroup:A}=rA(),{createCommunicationForAutomation:L}=oA(e.id,e),{updateCommunicationGroup:I}=iA(),{updateChannelSender:F}=nA(),{updateAutomation:$}=Wx(e.id),[q,z]=n.useState({width:0,height:0}),[U,B]=n.useState({width:0,height:0}),V=n.useRef(null);if(n.useEffect((()=>{const e=()=>{V.current&&B({width:V.current.offsetWidth,height:V.current.offsetHeight})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[V]),n.useEffect((()=>{const e=()=>{z({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{l&&u&&p&&!s&&(a(!0),o?I({groupId:o,params:{email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}}}):L({email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}},{onSuccess:e=>{i(e.id)}}),a(!1))}),[l,u,h,p,e.action_data,I,$,r,o,s,L]),n.useEffect((()=>{o&&A(o,{onSuccess:e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body);const t=O?.channel_senders?.find((t=>t.id===e.email_channel_sender_id));t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}})}),[r,A,e.action_data,e,o,O?.channel_senders]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.channel_senders?.filter((e=>e.channel_sender_metadata.userPart));if(e?.[0]){const t=e[0];c(t.id),t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}}P(!0)}}),[j,O?.channel_senders,o,O]),n.useEffect((()=>{if(l){const e=O?.channel_senders?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(_){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:_}}})}}),[_,O?.channel_senders,l,F]),n.useEffect((()=>{if(M){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M))return void E("Please enter a valid email address");E(null)}if(M){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.channel_senders,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{m(e.email_html_body)}}),T())}),[g,o,A,T]),!R||!O)return t.jsx("div",{children:t.jsx(Fx,{text:["Loading..."]})});const K=O.channel_senders?.filter((e=>e.channel_sender_metadata.userPart)),H=K?.map((e=>{const t=R.channel_accounts?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case OI.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case OI.TWILLIO:return null;default:throw hw(t.channel_account_metadata.type,OI)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(lE,{open:N,onOpenChange:D,children:t.jsx(dE,{className:"min-w-[50vw] min-h-[50vh]",children:t.jsx(FI,{})})}),t.jsx(lE,{open:g,onOpenChange:v,children:t.jsx(dE,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(GP,{title:"Click to learn more about email template ",onClick:()=>D(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(WI,{automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i,showStripoEditor:g})})]})})}),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(II,{children:"From Email"}),t.jsxs(tR,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(rR,{children:t.jsx(nR,{placeholder:"Select email",children:l?H?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(sR,{children:H?.map((e=>t.jsx(aR,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(II,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(GP,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(tN,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(II,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(GP,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(tN,{placeholder:"Enter reply to email",value:S??"",onChange:e=>C(e.target.value),disabled:!l}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(II,{children:"Subject"}),t.jsx(tN,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(II,{children:"Preview Text"}),t.jsx(GP,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(tN,{placeholder:"Enter preview text",value:h??"",onChange:e=>f(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(iw,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(H?.length??0),children:"Edit"}),0===(H?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx($I,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1",ref:V,children:t.jsx(cA,{html:p??"",height:U.height,width:U.width})})]})]})]})},QI=async()=>(await Ja("/me")).data,XI=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Th("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm 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:r,...n})));XI.displayName="Textarea";const JI=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(!1),s=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(""),[c,u]=n.useState(null),[d,h]=n.useState(!1),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(s()??null),[b,x]=n.useState(!1),[w,S]=n.useState(!1),{channelSenders:C}=tA(),{data:k,isLoading:E}={...ue({queryKey:["me"],queryFn:QI,...Wa})},{channelAccounts:j}=MI(),{createCommunicationForAutomation:P}=oA(e.id,e),{updateCommunicationGroup:T}=iA(),{getCommunicationGroup:N}=rA(),{updateAutomation:D}=Wx(e.id),{getMergeFields:_,isGetting:M}=sA(),O=n.useRef(null),R=e=>A?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??A?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===c||null===m||o||(i(!0),v?T({groupId:v,params:{sms_channel_sender_id:c,sms_message_body:m}}):P({sms_channel_sender_id:c,sms_message_body:m},{onSuccess:e=>{y(e.id)}}),i(!1))}),[c,m,o,e.action_data,v,P,D,T]),n.useEffect((()=>{v&&N(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body)}})}),[e.action_data,v,N]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));e?.[0]&&u(e[0].id),x(!0)}}),[C,b]),n.useEffect((()=>{f||!k?.name||d||(h(!0),p(k.name),m?.includes(k.name)||g(`${k.name}:\n${m??""}`))}),[f,k?.name,d,m]),!j||!C||M||E)return t.jsx("div",{children:t.jsx(Fx,{text:["Loading..."]})});const A=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));return t.jsxs("div",{children:[t.jsx(lE,{open:w,onOpenChange:S,children:t.jsx(dE,{children:t.jsxs("div",{className:"",children:[t.jsx(XI,{ref:O,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value.slice(0,1600-(f?.length||0)))},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(tR,{value:a,onValueChange:e=>{const t=O.current,n=m||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);g(i),l(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(rR,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(sR,{children:_?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(aR,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(GP,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(m&&m.length>1400?m.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[m?m.length:0,"/",1600-(f?.length||0)," ","characters"]})]})})}),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(II,{children:"From Number"}),t.jsxs(tR,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(rR,{children:t.jsx(nR,{placeholder:"Select number",children:c?R(c):"Select number"})}),t.jsx(sR,{children:A?.map((e=>t.jsx(aR,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(II,{children:"Company Name"}),t.jsx(GP,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(tN,{placeholder:"Enter company name",value:f??"",onChange:e=>{(e=>{const t=m?.replace(f??"",e??"");p(e),g(t??null)})(e.target.value??null)},disabled:!c})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(iw,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(A?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(dA,{fromPhone:R(c),body:m??""}):t.jsx(lA,{type:"sms"})}):t.jsx($I,{type:"sms"})})]})]})]})},ZI=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Tc(),a="flex items-center gap-2 px-3 py-1.5 rounded-md transition-all duration-200";return t.jsxs("div",{className:"",children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2",children:"Select the channels you want to use in this automation"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(iw,{className:`${a} \n ${e.includes("email")?" border-primary":"bg-white text-black border-gray-200 hover:bg-gray-50"}`,onClick:()=>{e.includes("email")?e.includes("sms")?n(["sms"]):s({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"email"]),o([...r,"email"]))},children:[t.jsx("span",{children:t.jsx(i.EmailIcon,{size:15})}),"Email"]}),t.jsxs(iw,{className:`${a} \n ${e.includes("sms")?" border-primary":"bg-white text-black border-gray-200 hover:bg-gray-50"}`,onClick:()=>{e.includes("sms")?e.includes("email")?n(["email"]):s({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"sms"]),o([...r,"sms"]))},children:[t.jsx("span",{children:t.jsx(i.SmsIcon,{size:15})}),"SMS"]})]})]})},eF=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=rA(),{updateCommunicationGroup:c}=iA(),u=n.useMemo((()=>{const t=e.action_data?.map((e=>e.action_metadata.communication_group_id));if(t&&0!==t.length&&!(t.length>1))return t[0]}),[e]);n.useEffect((()=>{const e=u;if(!e)return i(["email"]),void a(["email"]);l(e,{onSuccess:e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),i(t),a(t)}})}),[e,l,u]),n.useEffect((()=>{const e=u;e&&o&&(o.includes("email")||c({groupId:e,params:{email_channel_sender_id:null}}),o.includes("sms")||c({groupId:e,params:{sms_channel_sender_id:null}}))}),[o,u,c]);const d=e=>{a((t=>t?.includes(e)?t?.filter((t=>t!==e)):[...t||[],e]))};return o&&s?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(_I,{className:"p-4 rounded-xl shadow-none",children:t.jsx(ZI,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(_I,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("email"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Ax.div,{animate:{rotate:s.includes("email")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Email Campaign"})]}),t.jsx(Qh,{children:s.includes("email")&&t.jsx(Ax.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(YI,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(_I,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("sms"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Ax.div,{animate:{rotate:s.includes("sms")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"SMS Campaign"})]}),t.jsx(Qh,{children:s.includes("sms")&&t.jsx(Ax.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(JI,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(Fx,{text:["Loading..."]})})},tF=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=vN({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(Ax.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(Ax.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Ax.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden md:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden sm:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(Ax.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100 sm:col-span-2 lg:col-span-1",children:t.jsxs("div",{className:"grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Ax.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden md:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden sm:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})};function nF(e){return(nF="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 rF(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 oF(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function iF(e){oF(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===nF(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function sF(e,t){oF(2,arguments);var n=iF(e),r=rF(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function aF(e,t){oF(2,arguments);var n=iF(e),r=rF(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 lF={};function cF(){return lF}function uF(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=cF(),d=rF(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=iF(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 dF(e){return oF(1,arguments),uF(e,{weekStartsOn:1})}function hF(e){oF(1,arguments);var t=function(e){oF(1,arguments);var t=iF(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=dF(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=dF(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),dF(n)}function fF(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 pF(e){oF(1,arguments);var t=iF(e);return t.setHours(0,0,0,0),t}function mF(e,t){oF(2,arguments);var n=pF(e),r=pF(t),o=n.getTime()-fF(n),i=r.getTime()-fF(r);return Math.round((o-i)/864e5)}function gF(e,t){return oF(2,arguments),sF(e,7*rF(t))}function vF(e,t){return oF(2,arguments),aF(e,12*rF(t))}function yF(e,t){oF(2,arguments);var n=pF(e),r=pF(t);return n.getTime()===r.getTime()}function bF(e){return oF(1,arguments),e instanceof Date||"object"===nF(e)&&"[object Date]"===Object.prototype.toString.call(e)}function xF(e,t){oF(2,arguments);var n=iF(e),r=iF(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function wF(e){oF(1,arguments);var t=iF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function SF(e){oF(1,arguments);var t=iF(e);return t.setDate(1),t.setHours(0,0,0,0),t}function CF(e){oF(1,arguments);var t=iF(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function kF(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=cF(),d=rF(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=iF(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 EF(e){return oF(1,arguments),kF(e,{weekStartsOn:1})}function jF(e,t){return oF(2,arguments),function(e,t){oF(2,arguments);var n=iF(e).getTime(),r=rF(t);return new Date(n+r)}(e,-rF(t))}function PF(e){oF(1,arguments);var t=iF(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 TF(e){oF(1,arguments);var t=iF(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=PF(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=PF(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function NF(e){oF(1,arguments);var t=iF(e),n=PF(t).getTime()-function(e){oF(1,arguments);var t=TF(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),PF(n)}(t).getTime();return Math.round(n/6048e5)+1}function DF(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=cF(),d=rF(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=iF(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 _F(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=iF(e),d=u.getUTCFullYear(),h=cF(),f=rF(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 m=DF(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=DF(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function MF(e,t){oF(1,arguments);var n=iF(e),r=DF(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=cF(),d=rF(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=_F(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),DF(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function OF(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var RF=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return OF("yy"===t?r%100:r,t.length)},AF=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):OF(n+1,2)},LF=function(e,t){return OF(e.getUTCDate(),t.length)},IF=function(e,t){return OF(e.getUTCHours()%12||12,t.length)},FF=function(e,t){return OF(e.getUTCHours(),t.length)},$F=function(e,t){return OF(e.getUTCMinutes(),t.length)},qF=function(e,t){return OF(e.getUTCSeconds(),t.length)},zF=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return OF(Math.floor(r*Math.pow(10,n-3)),t.length)},UF="midnight",BF="noon",VF="morning",KF="afternoon",HF="evening",WF="night",GF={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 RF(e,t)},Y:function(e,t,n,r){var o=_F(e,r),i=o>0?o:1-o;return"YY"===t?OF(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):OF(i,t.length)},R:function(e,t){return OF(TF(e),t.length)},u:function(e,t){return OF(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 OF(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 OF(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 AF(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 OF(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=MF(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):OF(o,t.length)},I:function(e,t,n){var r=NF(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):OF(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):LF(e,t)},D:function(e,t,n){var r=function(e){oF(1,arguments);var t=iF(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"}):OF(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 OF(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 OF(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 OF(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?BF:0===o?UF: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?HF:o>=12?KF:o>=4?VF:WF,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 IF(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):FF(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):OF(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):OF(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):$F(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):qF(e,t)},S:function(e,t){return zF(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return QF(o);case"XXXX":case"XX":return XF(o);default:return XF(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return QF(o);case"xxxx":case"xx":return XF(o);default:return XF(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+YF(o,":");default:return"GMT"+XF(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+YF(o,":");default:return"GMT"+XF(o,":")}},t:function(e,t,n,r){return OF(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return OF((r._originalDate||e).getTime(),t.length)}};function YF(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+OF(i,2)}function QF(e,t){return e%60==0?(e>0?"-":"+")+OF(Math.abs(e)/60,2):XF(e,t)}function XF(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+OF(Math.floor(o/60),2)+n+OF(o%60,2)}var JF=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"})}},ZF=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"})}},e$={p:ZF,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return JF(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}}",JF(o,t)).replace("{{time}}",ZF(i,t))}},t$=["D","DD"],n$=["YY","YYYY"];function r$(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 o$={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 i$(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 s$={date:i$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:i$({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:i$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},a$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function l$(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 c$={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:l$({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:l$({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:l$({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:l$({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:l$({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 u$(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 d$={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:u$({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:u$({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:u$({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:u$({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:u$({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"})},h$={code:"en-US",formatDistance:function(e,t,n){var r,o=o$[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:s$,formatRelative:function(e,t,n,r){return a$[e]},localize:c$,match:d$,options:{weekStartsOn:0,firstWeekContainsDate:1}},f$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,p$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m$=/^'([^]*?)'?$/,g$=/''/g,v$=/[a-zA-Z]/;function y$(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;oF(2,arguments);var w=String(t),S=cF(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:h$,k=rF(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:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=rF(null!==(f=null!==(p=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==p?p:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var j=iF(e);if(!function(e){if(oF(1,arguments),!bF(e)&&"number"!=typeof e)return!1;var t=iF(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var P=jF(j,fF(j)),T={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(p$).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,e$[t])(e,C.formatLong):e})).join("").match(f$).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(m$);if(!t)return e;return t[1].replace(g$,"'")}(r);var i=GF[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===n$.indexOf(r)||r$(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==t$.indexOf(e)}(r)||r$(r,t,String(e)),i(P,r,C.localize,T);if(o.match(v$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function b$(e){return oF(1,arguments),Math.floor(function(e){return oF(1,arguments),iF(e).getTime()}(e)/1e3)}function x$(e,t){var n,r,o,i,s,a,l,c;oF(1,arguments);var u=cF(),d=rF(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;oF(1,arguments);var u=iF(e),d=u.getFullYear(),h=cF(),f=rF(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 m=uF(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=uF(g,t);return u.getTime()>=m.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),uF(f,t)}function w$(e,t){return oF(1,arguments),function(e,t,n){oF(2,arguments);var r=uF(e,n),o=uF(t,n),i=r.getTime()-fF(r),s=o.getTime()-fF(o);return Math.round((i-s)/6048e5)}(function(e){oF(1,arguments);var t=iF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),SF(e),t)+1}function S$(e,t){oF(2,arguments);var n=iF(e),r=iF(t);return n.getTime()>r.getTime()}function C$(e,t){oF(2,arguments);var n=iF(e),r=iF(t);return n.getTime()<r.getTime()}function k$(e,t){oF(2,arguments);var n=iF(e),r=iF(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function E$(e,t){return oF(2,arguments),sF(e,-rF(t))}function j$(e,t){oF(2,arguments);var n=iF(e),r=rF(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){oF(1,arguments);var t=iF(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 P$(e,t){oF(2,arguments);var n=iF(e),r=rF(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var T$=function(){return T$=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},T$.apply(this,arguments)};function N$(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 D$(e){return"multiple"===e.mode}function _$(e){return"range"===e.mode}function M$(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var O$={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 R$=Object.freeze({__proto__:null,formatCaption:function(e,t){return y$(e,"LLLL y",t)},formatDay:function(e,t){return y$(e,"d",t)},formatMonthCaption:function(e,t){return y$(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return y$(e,"cccccc",t)},formatYearCaption:function(e,t){return y$(e,"yyyy",t)}}),A$=Object.freeze({__proto__:null,labelDay:function(e,t,n){return y$(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 y$(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var L$=n.createContext(void 0);function I$(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:O$,formatters:R$,labels:A$,locale:h$,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=SF(r):t&&(i=new Date(t,0,1)),o?s=wF(o):n&&(s=new Date(n,11,31)),{fromDate:i?pF(i):void 0,toDate:s?pF(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"),(M$(o)||D$(o)||_$(o))&&(r=o.onSelect);var u=T$(T$(T$({},i),o),{captionLayout:c,classNames:T$(T$({},i.classNames),o.classNames),components:T$({},o.components),formatters:T$(T$({},i.formatters),o.formatters),fromDate:a,labels:T$(T$({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:T$(T$({},i.modifiers),o.modifiers),modifiersClassNames:T$(T$({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:T$(T$({},i.styles),o.styles),toDate:l});return t.jsx(L$.Provider,{value:u,children:e.children})}function F$(){var e=n.useContext(L$);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function $$(e){var n=F$();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 q$(e){return t.jsx("svg",T$({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 z$(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=F$(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:q$;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 U$(e){var n,r=F$(),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){oF(2,arguments);var n=iF(e),r=iF(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=SF(o),p=o.getMonth();p<=i.getMonth();p++)h.push(j$(f,p));else for(f=SF(new Date),p=0;p<=11;p++)h.push(j$(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:z$;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=j$(SF(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 B$(e){var n,r=e.displayMonth,o=F$(),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(),m=s.getFullYear(),g=p;g<=m;g++)f.push(P$(CF(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:z$;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=P$(SF(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 V$(){var e=F$(),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&&xF(n,t)<0&&(t=aF(n,-1*(i-1))),r&&xF(t,r)<0&&(t=r),SF(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=SF(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var K$=n.createContext(void 0);function H$(e){var n=F$(),r=V$(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=SF(e),i=xF(SF(aF(o,r)),o),s=[],a=0;a<i;a++){var l=aF(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=SF(e);if(!n)return aF(s,i);if(!(xF(n,e)<o))return aF(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=SF(e);if(!n)return aF(i,-o);if(!(xF(i,n)<=0))return aF(i,-o)}}(o,n),c=function(e){return s.some((function(t){return k$(e,t)}))};return t.jsx(K$.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&C$(e,t)?i(aF(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function W$(){var e=n.useContext(K$);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function G$(e){var n,r=F$(),o=r.classNames,i=r.styles,s=r.components,a=W$().goToMonth,l=function(t){a(aF(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:$$,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(U$,{onChange:l,displayMonth:e.displayMonth}),t.jsx(B$,{onChange:l,displayMonth:e.displayMonth})]})}function Y$(e){return t.jsx("svg",T$({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 Q$(e){return t.jsx("svg",T$({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 X$=n.forwardRef((function(e,n){var r=F$(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=T$(T$({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",T$({},e,{ref:n,type:"button",className:a,style:l}))}));function J$(e){var n,r,o=F$(),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(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:Q$,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:Y$;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(X$,{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(X$,{name:"next-month","aria-label":m,className:g,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 Z$(e){var n=F$().numberOfMonths,r=W$(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return k$(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(J$,{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 eq(e){var n,r,o=F$(),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:$$;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(G$,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(G$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(Z$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Z$,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function tq(e){var n=F$(),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 nq(){var e=F$(),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?dF(new Date):uF(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=sF(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 rq(){var e,n=F$(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:nq;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function oq(e){var n=F$();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var iq=n.createContext(void 0);function sq(e){if(!D$(e.initialProps)){return t.jsx(iq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(aq,{initialProps:e.initialProps,children:e.children})}function aq(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 yF(t,e)}));return Boolean(t&&!n)})),t.jsx(iq.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?N$([],o):[];if(t.selected){var u=c.findIndex((function(t){return yF(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 lq(){var e=n.useContext(iq);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var cq,uq,dq=n.createContext(void 0);function hq(e){if(!_$(e.initialProps)){return t.jsx(dq.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(fq,{initialProps:e.initialProps,children:e.children})}function fq(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],yF(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:E$(s,l-1),before:sF(s,l-1)}),s&&a&&u.disabled.push({after:s,before:sF(s,l-1)}),!s&&a&&u.disabled.push({after:E$(a,l-1),before:sF(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:sF(s,1-c)}),u.disabled.push({after:sF(s,c-1)})),s&&a){var d=c-(mF(a,s)+1);u.disabled.push({before:E$(s,d)}),u.disabled.push({after:sF(a,d)})}!s&&a&&(u.disabled.push({before:sF(a,1-c)}),u.disabled.push({after:sF(a,c-1)}))}return t.jsx(dq.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(yF(o,e)&&yF(r,e))return;if(yF(o,e))return{from:o,to:void 0};if(yF(r,e))return;return S$(r,e)?{from:e,to:o}:{from:r,to:e}}return o?S$(e,o)?{from:o,to:e}:{from:e,to:o}:r?C$(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 pq(){var e=n.useContext(dq);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function mq(e){return Array.isArray(e)?N$([],e):void 0!==e?[e]:[]}(uq=cq||(cq={})).Outside="outside",uq.Disabled="disabled",uq.Selected="selected",uq.Hidden="hidden",uq.Today="today",uq.RangeStart="range_start",uq.RangeEnd="range_end",uq.RangeMiddle="range_middle";var gq=cq.Selected,vq=cq.Disabled,yq=cq.Hidden,bq=cq.Today,xq=cq.RangeEnd,wq=cq.RangeMiddle,Sq=cq.RangeStart,Cq=cq.Outside;var kq=n.createContext(void 0);function Eq(e){var n=F$(),r=function(e,t,n){var r,o=((r={})[gq]=mq(e.selected),r[vq]=mq(e.disabled),r[yq]=mq(e.hidden),r[bq]=[e.today],r[xq]=[],r[wq]=[],r[Sq]=[],r[Cq]=[],r);return e.fromDate&&o[vq].push({before:e.fromDate}),e.toDate&&o[vq].push({after:e.toDate}),D$(e)?o[vq]=o[vq].concat(t.modifiers[vq]):_$(e)&&(o[vq]=o[vq].concat(n.modifiers[vq]),o[Sq]=n.modifiers[Sq],o[wq]=n.modifiers[wq],o[xq]=n.modifiers[xq]),o}(n,lq(),pq()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=mq(e[1])})),t}(n.modifiers),i=T$(T$({},r),o);return t.jsx(kq.Provider,{value:i,children:e.children})}function jq(){var e=n.useContext(kq);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Pq(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(bF(t))return yF(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(bF)}(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?(mF(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),mF(n,i)>=0&&mF(s,n)>=0):s?yF(s,n):!!i&&yF(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=mF(t.before,e)>0,l=mF(t.after,e)<0;return S$(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?mF(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?mF(t.before,e)>0:"function"==typeof t&&t(e)}))}function Tq(e,t,n){var r=Object.keys(t).reduce((function(n,r){return Pq(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!k$(e,n)&&(o.outside=!0),o}function Nq(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:sF,week:gF,month:aF,year:vF,startOfWeek:function(e){return o.ISOWeek?dF(e):uF(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?EF(e):kF(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(oF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==nF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=iF(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(oF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==nF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=iF(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=Tq(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:Nq(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:T$(T$({},a),{count:a.count+1})})}var Dq=n.createContext(void 0);function _q(e){var r=W$(),o=jq(),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=SF(e[0]),i=wF(e[e.length-1]),s=o;s<=i;){var a=Tq(s,t);if(a.disabled||a.hidden)s=sF(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=sF(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=F$(),m=function(e,t){if(s){var n=Nq(s,{moveBy:e,direction:t,context:p,modifiers:o});yF(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(Dq.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function Mq(){var e=n.useContext(Dq);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var Oq=n.createContext(void 0);function Rq(e){if(!M$(e.initialProps)){return t.jsx(Oq.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(Aq,{initialProps:e.initialProps,children:e.children})}function Aq(e){var n=e.initialProps;return t.jsx(Oq.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 Lq(){var e=n.useContext(Oq);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Iq(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(cq).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function Fq(e,r,o){var i,s,a,l=F$(),c=Mq(),u=function(e,t){return Tq(e,jq(),t)}(e,r),d=function(e,t){var n=F$(),r=Lq(),o=lq(),i=pq(),s=Mq(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;M$(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):D$(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):_$(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?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():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=F$(),t=Lq(),n=lq(),r=pq();return M$(e)?t.selected:D$(e)?n.selected:_$(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&yF(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=Iq(l,u).join(" "),m=function(e,t){var n=T$({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=T$(T$({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=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:oq,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&yF(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&yF(c.focusedDay,e),w=T$(T$(T$({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:h,buttonProps:w,divProps:y}}function $q(e){var r=n.useRef(null),o=Fq(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(X$,T$({name:"day",ref:r},o.buttonProps)):t.jsx("div",T$({},o.divProps))}function qq(e){var n=e.number,r=e.dates,o=F$(),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(X$,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function zq(e){var n,r,o,i=F$(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:$q,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:qq;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})},b$(n))}))]})}function Uq(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?EF(t):kF(t,n),o=(null==n?void 0:n.ISOWeek)?dF(e):uF(e,n),i=mF(r,o),s=[],a=0;a<=i;a++)s.push(sF(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){oF(1,arguments);var t=iF(e),n=dF(t).getTime()-hF(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){oF(1,arguments);var n=iF(e),r=uF(n,t).getTime()-x$(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 Bq(e){var n,r,o,i=F$(),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=Uq(SF(e),wF(e),t);if(null==t?void 0:t.useFixedWeeks){var r=w$(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=gF(i,6-r),a=Uq(gF(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}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:rq,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:zq,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:tq;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var Vq="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,Kq=!1,Hq=0;function Wq(){return"react-day-picker-".concat(++Hq)}function Gq(e){var r,o,i=F$(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=W$().displayMonths,d=function(e){var t,r=null!=e?e:Kq?Wq():null,o=n.useState(r),i=o[0],s=o[1];return Vq((function(){null===i&&s(Wq())}),[]),n.useEffect((function(){!1===Kq&&(Kq=!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,m=0===e.displayIndex,g=e.displayIndex===u.length-1,v=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),p=T$(T$({},p),l.caption_start)),g&&(f.push(a.caption_end),p=T$(T$({},p),l.caption_end)),v&&(f.push(a.caption_between),p=T$(T$({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:eq;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Bq,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function Yq(e){var n=F$();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function Qq(e){var r,o,i=e.initialProps,s=F$(),a=Mq(),l=W$(),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=T$(T$({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return T$(T$({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:Yq;return t.jsx("div",T$({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(Gq,{displayIndex:n,displayMonth:e},n)}))})}))}function Xq(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(I$,{initialProps:r,children:t.jsx(H$,{children:t.jsx(Rq,{initialProps:r,children:t.jsx(sq,{initialProps:r,children:t.jsx(hq,{initialProps:r,children:t.jsx(Eq,{children:t.jsx(_q,{children:n})})})})})})})}function Jq(e){return t.jsx(Xq,T$({},e,{children:t.jsx(Qq,{initialProps:e})}))}function Zq({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(Jq,{showOutsideDays:r,className:Th("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:Th(ow({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:Th("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:Th(ow({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(ld,{className:"h-4 w-4"}),IconRight:()=>t.jsx(cd,{className:"h-4 w-4"})},...o})}Zq.displayName="Calendar";const ez=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(CM,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(kM,{asChild:!0,children:t.jsxs(iw,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(dd,{className:"opacity-50"})]})}),t.jsx(EM,{className:"w-[200px] p-0",children:t.jsxs(I_,{children:[t.jsx(F_,{placeholder:r,className:"h-9"}),t.jsxs($_,{children:[t.jsx(q_,{children:o}),t.jsx(z_,{children:e.map((e=>t.jsxs(B_,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(sd,{className:Th("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},tz=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):lT(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(YT(o,"HH:mm")),{updateAutomation:d}=Wx(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=lT(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:h}))<new Date(t.toLocaleString("en-US",{timeZone:h}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:h})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:Yx.ONE_TIME,scheduled_at:s,timezone:h}})}),[o,h,d]),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 ",children:[t.jsxs(CM,{children:[t.jsx(kM,{asChild:!0,children:t.jsxs(iw,{variant:"outline",className:Th("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(id,{className:"mr-2 h-4 w-4"}),o?YT(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(EM,{className:"w-auto p-0",children:t.jsx(Zq,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:Th("flex h-9 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",a&&"border-red-500")}),t.jsx(ez,{data:p,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:h,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=lT(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},nz=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{children:t.jsx(Ax.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full flex justify-center",children:t.jsxs("div",{className:"flex flex-col gap-8 items-center justify-center",children:[t.jsxs("div",{className:"",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(aw,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:Yx.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(aw,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(Qh,{children:"schedule"===i&&t.jsx(Ax.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(tz,{automation:r})})})})]}),r.trigger_metadata.scheduled_at&&t.jsxs(Ax.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"w-80 shrink-0 h-fit p-3 bg-blue-50 rounded-lg border border-blue-100 sticky top-0 backdrop-blur-sm",children:[t.jsx(Ax.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(Ax.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},rz=({automation:e,iconDefinitions:r,loading:o})=>{const i=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),{updateAutomation:s}=Wx(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=rA(),{channelSenders:d}=tA(),{channelAccounts:h}=MI(),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(null),[b,x]=n.useState(null);return n.useEffect((()=>{d&&y(d),h&&x(h)}),[d,h]),n.useEffect((()=>{c?u(c,{onSuccess:e=>{const t=e.email_channel_sender_id,n=e.sms_channel_sender_id,r=v?.channel_senders.find((e=>e.id===t)),o=v?.channel_senders.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.channel_accounts.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case OI.REACH_MANAGED:p({fromEmail:`${t}@${n.channel_account_metadata.baseDomain}.embedreach.com`,fromName:r.channel_sender_metadata.emailFromName,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case OI.TWILLIO:break;default:throw hw(n.channel_account_metadata.type,OI)}}if(o){const t=v?.channel_senders.find((e=>e.id===n));t&&e.sms_message_body&&t.channel_sender_metadata?.from&&g({fromPhone:t.channel_sender_metadata.from,body:e.sms_message_body})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.channel_accounts,v?.channel_senders,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Fx,{text:["Loading..."]})}):f||m?t.jsxs("div",{className:"max-w-8xl mx-auto p-6 gap-4 grid",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx(hA,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(tF,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(_I,{className:"p-4 shadow-sm border-none",children:t.jsx(nz,{automation:e,iconDefinitions:r,updateAutomation:s})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},oz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx(aw,{onClick:()=>a("all"),title:"All patrons",subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(aw,{onClick:()=>a("segments"),title:"Select patrons",subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},iz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,onCreateSegment:s,iconDefinitions:a})=>{const[l,c]=n.useState(!1),[u,d]=n.useState([]),h=r.map((e=>({label:e.name,value:e.id})));return t.jsxs("div",{children:[t.jsx(lE,{open:l,onOpenChange:c,children:t.jsx(dE,{hideCloseButton:!0,children:t.jsx(pR,{iconDefinitions:a,onClose:e=>{"error"===e||!1===e?c(!1):e&&(s(),c(!1))}})})}),t.jsx(IM,{selectedValues:u,setSelectedValues:d,options:h,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:t.jsxs(B_,{onSelect:()=>c(!0),className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]})})]})},sz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,handleCreateSegment:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(iz,{segments:r,allSegments:l?.segments||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),onCreateSegment:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(iw,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(Ax.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"",children:"Don't send to"})]}),t.jsx(Qh,{children:u&&t.jsx(Ax.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(iz,{segments:o,allSegments:l?.segments||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),onCreateSegment:a,iconDefinitions:e})})})]})]})},az=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c,refetchSegments:u}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>uN()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:d}=Wx(r.id),[h,f]=n.useState(r.includeSegmentIds||[]),[p,m]=n.useState(r.excludeSegmentIds||[]),g=1===h.length&&0===p.length&&void 0!==l?.segments?.find((e=>e.type===hN.ALL_USERS&&e.id===h[0])),[v,y]=n.useState(g?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(h)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(p))&&d({include_segments:h,exclude_segments:p})}),[h,p,r.includeSegmentIds,r.excludeSegmentIds,d]);const b=n.useCallback((()=>l?.segments?.find((e=>e.type===hN.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===v&&l){const e=b();e&&f([e.id]),m([])}}),[v,l,b]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){y("all");const e=b();return e&&d({include_segments:[e.id],exclude_segments:[]}),void a(!0)}y(g?"all":"segments"),a(!0)}}),[v,h.length,p.length,l,s,g,b,d,r.includeSegmentIds.length,r.excludeSegmentIds.length]),!c&&l&&s?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(lE,{open:o,onOpenChange:i,children:t.jsx(dE,{className:"max-w-4xl",children:t.jsx(pR,{iconDefinitions:e,onClose:e=>{!1!==e&&"error"!==e&&u(),i(!1)}})})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(Ax.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(oz,{iconDefinitions:e,onSelectionChange:e=>{y(e)},defaultValue:v}),t.jsx(Qh,{mode:"wait",children:"segments"===v&&t.jsx(Ax.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 w-full",children:t.jsx(sz,{iconDefinitions:e,includedSegments:h,excludedSegments:p,handleAddSegment:(e,t)=>{"include"===t?f((t=>[...t,e])):m((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?f((t=>t.filter((t=>t!==e)))):m((t=>t.filter((t=>t!==e))))},handleCreateSegment:()=>{i(!0)},segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(Ax.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg p-8 flex flex-col justify-start h-full shadow-sm",children:t.jsx(tF,{iconDefinitions:e,includeSegments:h,excludeSegments:p,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]})})]}):t.jsx("div",{children:t.jsx(Fx,{text:["Fetching segments","Finishing up"]})})},lz=({title:e,subtitle:n,content:r})=>t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 ",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),cz=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i})=>{const{toast:s}=Tc(),[a,l]=n.useState(0),{automation:c}=Vx(e),[u,d]=n.useState(!1),{updateAutomation:h}=Wx(e),{getCommunicationGroup:f}=rA();if(!c)return t.jsx("div",{children:t.jsx(Fx,{text:["Fetching Automation data","Finishing up"]})});const p=[{id:"audience",title:"Choose Audience",isValid:()=>!!(c&&c.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!c.action_data?.length&&null!==c.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"w-full px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:t.jsx("div",{className:"flex-shrink-0",children:o&&t.jsx("img",{src:o,alt:"Logo",className:"w-6 h-6"})})}),t.jsxs("div",{className:"flex-1 flex flex-col px-6 pt-0",children:[t.jsxs("div",{className:"flex gap-8 flex-1",children:[t.jsxs("nav",{className:"hidden lg:block space-y-0 w-50 self-start",children:[t.jsx("div",{className:"mb-5 mt-4",children:t.jsxs("button",{onClick:()=>i(!1),className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 rounded-full text-gray-700 hover:bg-gray-200 text-sm",children:[t.jsx("span",{children:"←"})," Go back"]})}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Automations"}),t.jsx("p",{className:"text-gray-600 text-sm",children:"Configure your automations"})]}),p.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\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 `,children:t.jsx(CI,{label:e.title,isActive:n===a,isCompleted:e.isValid()})},e.id)))]}),t.jsx("div",{className:"hidden lg:block h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-[calc(100vh-10rem)] overflow-y-auto overflow-visible",children:t.jsx("div",{className:"min-h-full flex items-center justify-center",children:t.jsxs(Qh,{mode:"wait",children:[0===a&&t.jsx(Lx,{className:"w-full max-w-8xl py-8",children:t.jsx(lz,{title:"Choose Audience",content:t.jsx(az,{iconDefinitions:r,automation:c})})},"audience"),1===a&&t.jsx(Lx,{className:"w-full max-w-8xl py-8",children:t.jsx(lz,{title:"Edit Content",content:t.jsx(eF,{automation:c,iconDefinitions:r})})},"content"),2===a&&t.jsx(Lx,{className:"w-full max-w-8xl py-8",children:t.jsx(lz,{title:"Preview and Schedule",content:t.jsx(rz,{automation:c,iconDefinitions:r,loading:u})})},"preview")]})})})})]}),t.jsx("div",{className:"absolute bottom-5 right-5 z-5 bg-white/30 backdrop-blur-xl p-2 rounded-xl border border-gray-200/50 shadow-lg",children:t.jsx(kI,{iconDefinitions:r,handleBack:()=>{l(a-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===a)return{canMove:c.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===a){const e=c.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};const t=e.action_metadata.communication_group_id,n=await new Promise(((e,n)=>{f(t,{onSuccess:t=>{e(t)},onError:()=>{n("Error fetching communication group")}})}));if(!n||!n.sms_channel_sender_id&&!n.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"}}return{canMove:!0,errorMessage:null}})();e?2===a?(d(!0),h({status:Qx.ACTIVE}),i(!1),s({title:"Automation scheduled!"})):l(a+1):s({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},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(c.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===a?"Save as Draft":void 0,thirdOptionOnClick:()=>{h({status:Qx.DRAFT}),i(!1),s({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},uz=({status:e})=>{switch(e){case Qx.DRAFT:return t.jsx(eN,{variant:"secondary",children:"Draft"});case Qx.ACTIVE:return t.jsx(eN,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case Qx.RUNNING:return t.jsx(eN,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case Qx.SCHEDULED:return t.jsx(eN,{variant:"default",className:"bg-purple-500 hover:bg-purple-600",children:"Scheduled"});case Qx.COMPLETED:return t.jsx(eN,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case Qx.FAILED:return t.jsx(eN,{variant:"destructive",children:"Failed"});case Qx.DEACTIVATED:return t.jsx(eN,{variant:"outline",className:"text-gray-500",children:"Deactivated"});default:hw(e,Qx)}},dz=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),hz=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},fz=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=rA(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=aA(),{toast:y}=Tc(),b=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;return n?new Promise(((e,t)=>{u(n,{onSuccess:n=>{switch(r){case"email":e(n.email_channel_sender_id);break;case"sms":e(n.sms_channel_sender_id);break;default:t(new Error(`Unsupported type: ${r}`))}},onError:e=>{t(e||new Error("Error fetching communication group"))}})})):Promise.resolve(null)}),[e.action_data,u,r]);n.useEffect((()=>{(async()=>{try{const e=await b();h(e)}catch(e){h(null)}finally{p(!0)}})()}),[b]),n.useEffect((()=>{v&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[v,r,o,y]),n.useEffect((()=>{g&&(y({title:"Error",description:`Failed to send preview: ${g.message}`,variant:"destructive"}),o(!1))}),[g,y,o]);return f?d?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(tN,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(iw,{onClick:()=>{if(!("email"===r?dz(s):hz(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!d)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);m({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Fx,{text:["Fetching sender id","Finishing up"]})})},pz=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s})=>{const a=pS(),[l,c]=n.useState(!1),[u,d]=n.useState(!1),[h,f]=n.useState(!1),{updateAutomation:p}=Wx(e.id);n.useEffect((()=>{o&&c(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(lE,{open:l,onOpenChange:c,children:t.jsx(dE,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:t.jsx(cz,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:c,logoUrl:s})})}),t.jsx(lE,{open:u,onOpenChange:d,children:t.jsx(dE,{className:"",children:t.jsx(fz,{automation:e,type:"sms",setOpenSendPreviewPopup:d,iconDefinitions:r})})}),t.jsx(lE,{open:h,onOpenChange:f,children:t.jsx(dE,{className:"",children:t.jsx(fz,{automation:e,type:"email",setOpenSendPreviewPopup:f,iconDefinitions:r})})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[i&&t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(iw,{onClick:()=>a(-1),children:"Back"})})}),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(uz,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(bI,{modal:!1,children:[t.jsx(xI,{asChild:!0,children:t.jsxs(iw,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(wI,{children:[(e.status===Qx.DRAFT||e.status===Qx.ACTIVE)&&t.jsx(SI,{onClick:()=>c(!0),children:"Edit"}),e.status===Qx.ACTIVE&&t.jsx(SI,{onClick:()=>{p({status:Qx.DRAFT})},children:"Convert to Draft"}),e.status!==Qx.COMPLETED&&e.status!==Qx.FAILED&&t.jsx(SI,{children:"Cancel"}),t.jsx(SI,{onClick:()=>d(!0),children:"Send Preview SMS"}),t.jsx(SI,{onClick:()=>f(!0),children:"Send Preview Email"})]})]})]}),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:YT(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===Yx.ONE_TIME&&e.trigger_metadata?.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===Yx.ONE_TIME&&e.trigger_metadata?.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:YT(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})};var mz=e=>null!=e;var gz=e=>"function"!=typeof e||e.length?e:e(),vz=e=>Array.isArray(e)?e:e?[e]:[];var yz=$e;var bz,xz=function(e){const[t,n]=De(),r=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=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=De(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(AY){return r(AY,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&Fe((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(AY){r(AY,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),$e((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),$e((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(AY){r(AY,`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(AY){r(AY,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(AY){r(AY,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&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(AY){r(AY,`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(AY){r(AY,`Error getting all values from ${e.name}`)}}})),t}}]},wz=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},Sz=("function"==typeof(bz={_cookies:[globalThis.document,"cookie"],getItem:e=>Sz._cookies[0][Sz._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=Sz.getItem(e);Sz._cookies[0][Sz._cookies[1]]=`${e}=${t}${wz(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Sz});window.dispatchEvent(o)},removeItem:e=>{Sz._cookies[0][Sz._cookies[1]]=`${e}=deleted${wz({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return Sz._cookies[0][Sz._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return Sz._cookies[0][Sz._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(bz.clear=()=>{let e;for(;e=bz.key(0);)bz.removeItem(e)}),bz),Cz=796,kz="bottom",Ez="system",jz=Object.keys(Jn)[0],Pz=Object.keys(tr)[0],Tz=Ve({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function Nz(){return Ke(Tz)}var Dz=Ve(void 0),_z=e=>{const[t,n]=De(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[Ot]){for(let t of e[Ot].keys())e.removeEventListener(t,Wt);delete e[Ot]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(Nz().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(OY){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)}})),Lt(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};Oe((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),Oe((()=>{const e=(Nz().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(Nz().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),$e((()=>{t.disconnect()}))}}));const i=Re((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return ut(Dz.Provider,{value:i,get children(){return e.children}})},Mz=()=>Re((()=>{const e=Ke(Dz);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),Oz=Ve((()=>"dark"));function Rz(){return Ke(Oz)}var Az={"À":"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"},Lz=Object.keys(Az).join("|"),Iz=new RegExp(Lz,"g");var Fz=7,$z=6,qz=5,zz=4,Uz=3,Bz=2,Vz=1,Kz=0;function Hz(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:Vz,!n.accessors){const r=Wz(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=Xz(o),s=Yz(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:Kz,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=Wz(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=Vz?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 Wz(e,t,n){return e=Gz(e,n),(t=Gz(t,n)).length>e.length?Kz:e===t?Fz:(e=e.toLowerCase())===(t=t.toLowerCase())?$z:e.startsWith(t)?qz:e.includes(` ${t}`)?zz:e.includes(t)?Uz:1===t.length?Kz:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?Bz: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 Vz+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return Kz;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return Kz}return i(r-s)}(e,t)}function Gz(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(Iz,(e=>Az[e]))),e}function Yz(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 Qz={maxRanking:1/0,minRanking:-1/0};function Xz(e){return"function"==typeof e?Qz:{...Qz,...e}}var Jz={data:""},Zz=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,eU=/\/\*[^]*?\*\/| +/g,tU=/\n+/g,nU=(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]?nU(s,i):i+"{"+nU(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=nU(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+=nU.p?nU.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},rU={},oU=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+oU(e[n]);return t}return e};function iU(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=oU(e),s=rU[i]||(rU[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!rU[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=Zz.exec(e.replace(eU,""));)t[4]?r.shift():t[3]?(n=t[3].replace(tU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(tU," ").trim();return r[0]})(e);rU[s]=nU(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&rU.g?rU.g:null;return n&&(rU.g=rU[s]),l=rU[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?"":nU(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||Jz),t.g,t.o,t.k);var r}function sU(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=sU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function aU(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=sU(e))&&(r&&(r+=" "),r+=t);return r}function lU(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=De([],{equals:!1}),[l]=[Ue,ze],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 Re((t=>{const n=s(),a=e();if(Le(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 Le((()=>{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 cU(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}iU.bind({g:1}),iU.bind({k:1});var uU=e=>e instanceof Element;function dU(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return dU(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=dU(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function hU(e,t=uU,n=uU){const r=Re(e),o=Re((()=>dU(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function fU(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function pU(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),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),fU((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function mU(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),fU((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var gU=e=>{const t=function(e){return Re((()=>{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 lU(hU((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)pU(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)mU(s,e,t,(()=>o([t])))}})},vU=Symbol("fallback");function yU(e){for(const t of e)t.dispose()}function bU(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>yU(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return yU(o.values()),o.clear(),r.fallback?[Ne((e=>(o.set(vU,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(vU);if(!o.size||s){s?.dispose(),o.delete(vU);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){Ne((s=>{const[a,l]=De(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=De(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 xU(e,t,n,r){const o=()=>{vz(gz(e)).forEach((e=>{e&&vz(gz(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),yz(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function wU(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return $e(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);Oe((t=>{const n=vz(gz(e)).filter(mz);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 SU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function CU(e){const t={};let n;for(;n=SU.exec(e);)t[n[1]]=n[2];return t}function kU(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=CU(e)}else"string"==typeof t&&(t=CU(t));return{...e,...t}}function EU(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function jU(e){return"[object String]"===Object.prototype.toString.call(e)}function PU(e){return t=>`${e()}-${t}`}function TU(e,t){return!!e&&(e===t||e.contains(t))}function NU(e,t=!1){const{activeElement:n}=DU(e);if(!n?.nodeName)return null;if(_U(n)&&n.contentDocument)return NU(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=DU(n).getElementById(e);if(t)return t}}return n}function DU(e){return e?e.ownerDocument||e:document}function _U(e){return"IFRAME"===e.tagName}var MU=(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))(MU||{});function OU(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function RU(){return OU(/^Mac/i)}function AU(){return OU(/^iPhone/i)||OU(/^iPad/i)||RU()&&navigator.maxTouchPoints>1}function LU(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function IU(e){return t=>{for(const n of e)LU(t,n)}}function FU(e){return RU()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function $U(e){if(e)if(function(){if(null==qU){qU=!1;try{document.createElement("div").focus({get preventScroll(){return qU=!0,!0}})}catch(OY){}}return qU}())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 qU=null;var zU=["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'])"],UU=[...zU,'[tabindex]:not([tabindex="-1"]):not([disabled])'],BU=zU.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",VU=UU.join(':not([hidden]):not([tabindex="-1"]),');function KU(e,t){const n=Array.from(e.querySelectorAll(BU)).filter(HU);return t&&HU(e)&&n.unshift(e),n.forEach(((e,t)=>{if(_U(e)&&e.contentDocument){const r=KU(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function HU(e){return WU(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function WU(e){return e.matches(BU)&&GU(e)}function GU(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||GU(e.parentElement,e))}function YU(e){for(;e&&!QU(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function QU(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function XU(){}function JU(e,t){return mt(e,t)}var ZU=new Map,eB=new Set;function tB(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=ZU.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),ZU.delete(t.target)),0===ZU.size)){for(const e of eB)e();eB.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=ZU.get(t.target);n||(n=new Set,ZU.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function nB(e,t){const n=rB(e,t,"left"),r=rB(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 rB(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?tB():document.addEventListener("DOMContentLoaded",tB));var oB={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 iB(e){return t=>(e(t),()=>e(void 0))}function sB(e,t){const[n,r]=De(aB(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||aB(t?.()))})),n}function aB(e){return jU(e)?e:void 0}function lB(e){const[t,n]=gt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return ut(en,mt(n,{get component(){return t.as}}))}var cB=["id","name","validationState","required","disabled","readOnly"];var uB=Ve();function dB(){const e=Ke(uB);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function hB(e){const t=dB(),n=JU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(lB,mt({as:"div"},(()=>t.dataset()),n))}function fB(e){const t=dB(),n=JU({id:t.generateId("error-message")},e),[r,o]=gt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),ut(Ct,{get when(){return r.forceMount||i()},get children(){return ut(lB,mt({as:"div"},(()=>t.dataset()),o))}})}function pB(e){let t;const n=dB(),r=JU({id:n.generateId("label")},e),[o,i]=gt(r,["ref"]),s=sB((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),ut(lB,mt({as:"label",ref(e){const n=cU((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function mB(e,t){Oe(Ie(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}),$e((()=>{n.removeEventListener("reset",t)})))})))}function gB(e){const[t,n]=De(e.defaultValue?.()),r=Re((()=>void 0!==e.value?.())),o=Re((()=>r()?e.value?.():t()));return[o,t=>{Le((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function vB(e){const[t,n]=gB(e);return[()=>t()??!1,n]}var yB=Object.defineProperty,bB=(e,t)=>{for(var n in t)yB(e,n,{get:t[n],enumerable:!0})},xB=Ve();function wB(){return Ke(xB)}function SB(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function CB(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?SB(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 kB(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{CB(e(),t)}));$e((()=>clearTimeout(n)))}))}(e,t);let n=[];Oe((()=>{const r=function(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return DU(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&CB(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function EB(e={}){const[t,n]=function(e){const[t,n]=gB(e);return[()=>t()??[],n]}({value:()=>gz(e.items),onChange:t=>e.onItemsChange?.(t)});kB(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&SB(t,n))return r+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=>ut(xB.Provider,{value:{registerItem:r},get children(){return e.children}})}}function jB(e){const t=function(){const e=wB();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=JU({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function PB(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=jU(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=jU(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(jU(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return jU(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(jU(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=PB({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function TB(e,t=[]){return Re((()=>{const n=PB({dataSource:gz(e.dataSource),getKey:gz(e.getKey),getTextValue:gz(e.getTextValue),getDisabled:gz(e.getDisabled),getSectionChildren:gz(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var NB=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),DB=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function _B(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return NB.has(t)}const t=e.split("-")[0];return DB.has(t)}(e)?"rtl":"ltr"}function MB(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:_B(e)}}var OB=MB(),RB=new Set;function AB(){OB=MB();for(const e of RB)e(OB)}var LB=Ve();function IB(){const e=function(){const[e,t]=De(OB),n=Re((()=>e()));return Fe((()=>{0===RB.size&&window.addEventListener("languagechange",AB),RB.add(t),$e((()=>{RB.delete(t),0===RB.size&&window.removeEventListener("languagechange",AB)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Ke(LB)||e}var FB=new Map;var $B=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function qB(e){return RU()||AU()?e.altKey:e.ctrlKey}function zB(e){return RU()?e.metaKey:e.ctrlKey}function UB(e){return new $B(e)}function BB(e){const t=JU({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=De(!1),[o,i]=De(),s=Re((()=>{const e=gz(t.selectedKeys);return null!=e?UB(e):e})),a=Re((()=>{const e=gz(t.defaultSelectedKeys);return null!=e?UB(e):new $B})),[l,c]=function(e){const[t,n]=gB(e);return[()=>t()??new $B,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=De(gz(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===gz(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d(gz(t.selectionBehavior)??"toggle")})),{selectionMode:()=>gz(t.selectionMode),disallowEmptySelection:()=>gz(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!gz(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 VB(e,t,n){const r=mt({selectOnFocus:()=>"replace"===gz(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=IB();let s={top:0,left:0};xU((()=>gz(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]=De(""),[r,o]=De(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(gz(e.isDisabled))return;const s=gz(e.keyboardDelegate),a=gz(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>gz(r.disallowTypeAhead),keyboardDelegate:()=>gz(r.keyboardDelegate),selectionManager:()=>gz(r.selectionManager)}),l=()=>gz(r.orientation)??"vertical",c=()=>{const e=gz(r.autoFocus);if(!e)return;const n=gz(r.selectionManager),o=gz(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!gz(r.shouldUseVirtualFocus)&&$U(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>gz(r.isVirtualized),()=>gz(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&nB(t,e)}})));return{tabIndex:Re((()=>{if(!gz(r.shouldUseVirtualFocus))return null==gz(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{LU(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=gz(r.selectionManager),s=gz(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!qB(e)&&o.replaceSelection(t))},u=gz(r.keyboardDelegate),d=gz(r.shouldFocusWrap),h=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=h?u.getKeyBelow(h):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=h?u.getKeyAbove(h):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyLeftOf(h):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyRightOf(h):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(h,zB(e));null!=t&&(o.setFocusedKey(t),zB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(h,zB(e));null!=t&&(o.setFocusedKey(t),zB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=h){e.preventDefault();c(u.getKeyPageBelow(h))}break;case"PageUp":if(u.getKeyPageAbove&&null!=h){e.preventDefault();c(u.getKeyPageAbove(h))}break;case"a":zB(e)&&"multiple"===o.selectionMode()&&!0!==gz(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),gz(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!gz(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?VU:BU,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&GU(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&$U(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=gz(r.selectionManager),n=gz(r.keyboardDelegate),i=gz(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!gz(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&($U(n),nB(e,n))}}},onFocusOut:e=>{const t=gz(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function KB(e,t){const n=()=>gz(e.selectionManager),r=()=>gz(e.key),o=()=>gz(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||zB(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>gz(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Re((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Re((()=>gz(e.virtualized)?void 0:r()));return Oe(Ie([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():$U(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||gz(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&gz(e.shouldSelectOnPressUp)&&gz(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(gz(e.shouldSelectOnPressUp)&&!gz(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(qB(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 HB=class{collection;state;constructor(e,t){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!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return 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 $B(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 $B(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 $B([t],t,t):new $B;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new $B;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 $B)}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}},WB=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){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){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.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 GB,YB=e=>"function"==typeof e?e():e,QB=e=>{const t=Re((()=>{const t=YB(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=De(YB(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=YB(e.show);return Le((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),Oe((()=>{const t=YB(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),$e((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},XB="data-kb-top-layer",JB=!1,ZB=[];function eV(e){return ZB.findIndex((t=>t.node===e))}function tV(){return ZB.filter((e=>e.isPointerBlocking))}function nV(){return tV().length>0}function rV(e){const t=eV([...tV()].slice(-1)[0]?.node);return eV(e)<t}var oV={layers:ZB,isTopMostLayer:function(e){return ZB[ZB.length-1].node===e},hasPointerBlockingLayer:nV,isBelowPointerBlockingLayer:rV,addLayer:function(e){ZB.push(e)},removeLayer:function(e){const t=eV(e);t<0||ZB.splice(t,1)},indexOf:eV,find:function(e){return ZB[eV(e)]},assignPointerEventToLayers:function(){for(const{node:e}of ZB)e.style.pointerEvents=rV(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(nV()&&!JB){const t=DU(e);GB=document.body.style.pointerEvents,t.body.style.pointerEvents="none",JB=!0}},restoreBodyPointerEvents:function(e){if(nV())return;const t=DU(e);t.body.style.pointerEvents=GB,0===t.body.style.length&&t.body.removeAttribute("style"),JB=!1}};bB({},{Button:()=>aV,Root:()=>sV});var iV=["button","color","file","image","reset","submit"];function sV(e){let t;const n=JU({type:"button"},e),[r,o]=gt(n,["ref","type","disabled"]),i=sB((()=>t),(()=>"button")),s=Re((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==iV.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return ut(lB,mt({as:"button",ref(e){const n=cU((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 aV=sV,lV=["top","right","bottom","left"],cV=Math.min,uV=Math.max,dV=Math.round,hV=Math.floor,fV=e=>({x:e,y:e}),pV={left:"right",right:"left",bottom:"top",top:"bottom"},mV={start:"end",end:"start"};function gV(e,t,n){return uV(e,cV(t,n))}function vV(e,t){return"function"==typeof e?e(t):e}function yV(e){return e.split("-")[0]}function bV(e){return e.split("-")[1]}function xV(e){return"x"===e?"y":"x"}function wV(e){return"y"===e?"height":"width"}function SV(e){return["top","bottom"].includes(yV(e))?"y":"x"}function CV(e){return xV(SV(e))}function kV(e){return e.replace(/start|end/g,(e=>mV[e]))}function EV(e){return e.replace(/left|right|bottom|top/g,(e=>pV[e]))}function jV(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 PV(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 TV(e,t,n){let{reference:r,floating:o}=e;const i=SV(t),s=CV(t),a=wV(s),l=yV(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(bV(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function NV(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}=vV(t,e),p=jV(f),m=a[h?"floating"===d?"reference":"floating":d],g=PV(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.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},x=PV(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function DV(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _V(e){return lV.some((t=>e[t]>=0))}function MV(e){return AV(e)?(e.nodeName||"").toLowerCase():"#document"}function OV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function RV(e){var t;return null==(t=(AV(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function AV(e){return e instanceof Node||e instanceof OV(e).Node}function LV(e){return e instanceof Element||e instanceof OV(e).Element}function IV(e){return e instanceof HTMLElement||e instanceof OV(e).HTMLElement}function FV(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof OV(e).ShadowRoot)}function $V(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=KV(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function qV(e){return["table","td","th"].includes(MV(e))}function zV(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(OY){return!1}}))}function UV(e){const t=BV(),n=LV(e)?KV(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 BV(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function VV(e){return["html","body","#document"].includes(MV(e))}function KV(e){return OV(e).getComputedStyle(e)}function HV(e){return LV(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function WV(e){if("html"===MV(e))return e;const t=e.assignedSlot||e.parentNode||FV(e)&&e.host||RV(e);return FV(t)?t.host:t}function GV(e){const t=WV(e);return VV(t)?e.ownerDocument?e.ownerDocument.body:e.body:IV(t)&&$V(t)?t:GV(t)}function YV(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=GV(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=OV(o);return i?t.concat(s,s.visualViewport||[],$V(o)?o:[],s.frameElement&&n?YV(s.frameElement):[]):t.concat(o,YV(o,[],n))}function QV(e){const t=KV(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=IV(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=dV(n)!==i||dV(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function XV(e){return LV(e)?e:e.contextElement}function JV(e){const t=XV(e);if(!IV(t))return fV(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=QV(t);let s=(i?dV(n.width):n.width)/r,a=(i?dV(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var ZV=fV(0);function eK(e){const t=OV(e);return BV()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ZV}function tK(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=XV(e);let s=fV(1);t&&(r?LV(r)&&(s=JV(r)):s=JV(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==OV(e))&&t}(i,n,r)?eK(i):fV(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=OV(i),t=r&&LV(r)?OV(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=JV(o),t=o.getBoundingClientRect(),r=KV(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=OV(o),o=n.frameElement}}return PV({width:u,height:d,x:l,y:c})}function nK(e){return tK(RV(e)).left+HV(e).scrollLeft}function rK(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=OV(e),r=RV(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=BV();(!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=RV(e),n=HV(e),r=e.ownerDocument.body,o=uV(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=uV(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nK(e);const a=-n.scrollTop;return"rtl"===KV(r).direction&&(s+=uV(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(RV(e));else if(LV(t))r=function(e,t){const n=tK(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=IV(e)?JV(e):fV(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=eK(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return PV(r)}function oK(e,t){const n=WV(e);return!(n===t||!LV(n)||VV(n))&&("fixed"===KV(n).position||oK(n,t))}function iK(e,t,n){const r=IV(t),o=RV(t),i="fixed"===n,s=tK(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=fV(0);if(r||!r&&!i)if(("body"!==MV(t)||$V(o))&&(a=HV(t)),r){const e=tK(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=nK(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function sK(e){return"static"===KV(e).position}function aK(e,t){return IV(e)&&"fixed"!==KV(e).position?t?t(e):e.offsetParent:null}function lK(e,t){const n=OV(e);if(zV(e))return n;if(!IV(e)){let t=WV(e);for(;t&&!VV(t);){if(LV(t)&&!sK(t))return t;t=WV(t)}return n}let r=aK(e,t);for(;r&&qV(r)&&sK(r);)r=aK(r,t);return r&&VV(r)&&sK(r)&&!UV(r)?n:r||function(e){let t=WV(e);for(;IV(t)&&!VV(t);){if(UV(t))return t;if(zV(t))return null;t=WV(t)}return null}(e)||n}var cK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=RV(r),a=!!t&&zV(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=fV(1);const u=fV(0),d=IV(r);if((d||!d&&!i)&&(("body"!==MV(r)||$V(s))&&(l=HV(r)),IV(r))){const e=tK(r);c=JV(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:RV,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?zV(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=YV(e,[],!1).filter((e=>LV(e)&&"body"!==MV(e))),o=null;const i="fixed"===KV(e).position;let s=i?WV(e):e;for(;LV(s)&&!VV(s);){const t=KV(s),n=UV(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||$V(s)&&!n&&oK(e,s))?r=r.filter((e=>e!==s)):o=t,s=WV(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=rK(t,n,o);return e.top=uV(r.top,e.top),e.right=cV(r.right,e.right),e.bottom=cV(r.bottom,e.bottom),e.left=uV(r.left,e.left),e}),rK(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:lK,getElementRects:async function(e){const t=this.getOffsetParent||lK,n=this.getDimensions,r=await n(e.floating);return{reference:iK(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}=QV(e);return{width:t,height:n}},getScale:JV,isElement:LV,isRTL:function(e){return"rtl"===KV(e).direction}};function uK(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=XV(e),u=o||i?[...c?YV(c):[],...YV(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=RV(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:-hV(u)+"px "+-hV(o.clientWidth-(c+d))+"px "+-hV(o.clientHeight-(u+h))+"px "+-hV(c)+"px",threshold:uV(0,cV(1,l))||1};let p=!0;function m(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(m,{...f,root:o.ownerDocument})}catch(OY){r=new IntersectionObserver(m,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 m=l?tK(e):null;return l&&function t(){const r=tK(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=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 dK=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=yV(n),a=bV(n),l="y"===SV(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=vV(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}}}}},hK=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}=vV(e,t),c={x:n,y:r},u=await NV(t,l),d=SV(yV(o)),h=xV(d);let f=c[h],p=c[d];if(i){f=gV(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=gV(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},fK=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:m=!0,...g}=vV(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=yV(o),y=SV(a),b=yV(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[EV(a)]:function(e){const t=EV(e);return[kV(e),t,kV(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=bV(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[]}}(yV(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(kV)))),i}(a,m,p,x));const C=[a,...w],k=await NV(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=bV(e),o=CV(e),i=wV(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=EV(s)),[s,EV(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var P,T;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(T=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=SV(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:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},pK=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}=vV(e,t),l=await NV(t,a),c=yV(n),u=bV(n),d="y"===SV(n),{width:h,height:f}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=f-l.top-l.bottom,v=h-l.left-l.right,y=cV(f-l[p],g),b=cV(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?cV(b,v):v:w=u||x?cV(y,g):g,x&&!u){const e=uV(l.left,0),t=uV(l.right,0),n=uV(l.top,0),r=uV(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:uV(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:uV(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},mK=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=vV(e,t);switch(r){case"referenceHidden":{const e=DV(await NV(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_V(e)}}}case"escaped":{const e=DV(await NV(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_V(e)}}}default:return{}}}}},gK=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}=vV(e,t)||{};if(null==c)return{};const d=jV(u),h={x:n,y:r},f=CV(o),p=wV(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=cV(d[v],E),P=cV(d[y],E),T=j,N=C-m[p]-P,D=C/2-m[p]/2+k,_=gV(T,D,N),M=!l.arrow&&null!=bV(o)&&D!==_&&i.reference[p]/2-(D<T?j:P)-m[p]/2<0,O=M?D<T?D-T:D-N:0;return{[f]:h[f]+O,data:{[f]:_,centerOffset:D-_-O,...M&&{alignmentOffset:O}},reset:M}}}),vK=(e,t,n)=>{const r={platform:cK,...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}=TV(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,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!=g?g: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}=TV(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},yK=Ve();function bK(){const e=Ke(yK);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var xK=At('<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">'),wK={top:180,right:-90,bottom:0,left:90};function SK(e){const t=bK(),n=JU({size:30},e),[r,o]=gt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=De();return Oe((()=>{const t=e();var r;t&&n((r=t,DU(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return ut(lB,mt({as:"div",ref(e){const n=cU(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return kU({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=xK(),t=e.firstChild;return Me((()=>It(t,"transform",`rotate(${wK[i()]} 15 15) translate(0 2)`))),e}}))}function CK(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=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 kK(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var EK={top:"bottom",right:"left",bottom:"top",left:"right"};var jK=Object.assign((function(e){const t=JU({getAnchorRect:e=>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]=De(),[o,i]=De(),[s,a]=De(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?CK(t):e?e.getBoundingClientRect():CK()}};var e,n},{direction:c}=IB();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[dK((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,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(kK))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(fK({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(hK({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(pK({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(mK({padding:t.detachedPadding})),i&&d.push(gK({element:i,padding:t.arrowPadding}));const h=await vK(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...cK,isRTL:()=>"rtl"===c()}});if(a(h.placement),t.onCurrentPlacementChange?.(h.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=EK[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`}(h.placement,c()));const f=Math.round(h.x),p=Math.round(h.y);let m;if(t.hideWhenDetached&&(m=h.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${p}px, 0)`,visibility:m}),i&&h.middlewareData.arrow){const{x:e,y:t}=h.middlewareData.arrow,n=h.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return Oe((()=>{const e=l(),t=n();if(!e||!t)return;$e(uK(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),ut(yK.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:SK,Context:yK,usePopperContext:bK,Positioner:function(e){const t=bK(),[n,r]=gt(e,["ref","style"]);return ut(lB,mt({as:"div",ref(e){const r=cU(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return kU({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var PK="interactOutside.pointerDownOutside",TK="interactOutside.focusOutside";var NK=Ve();function DK(e){let t;const n=Ke(NK),[r,o]=gt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=XU;const o=()=>DU(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${XB}]`)&&!!TU(o(),r)&&!TU(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=IU([i,a]);r.addEventListener(PK,o,{once:!0});const s=new CustomEvent(PK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||FU(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=IU([s,a]);r.addEventListener(TK,o,{once:!0});const i=new CustomEvent(TK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{gz(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),$e((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>TU(t(),e)))||[...i].some((t=>TU(t,e)))),onPointerDownOutside:e=>{t&&!oV.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||oV.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===MU.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if(gz(e.isDisabled))return;const n=e.ownerDocument?.()??DU();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>DU(t),onEscapeKeyDown:e=>{t&&oV.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;oV.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);oV.assignPointerEventToLayers(),oV.disableBodyPointerEvents(t),$e((()=>{t&&(oV.removeLayer(t),e?.(),oV.assignPointerEventToLayers(),oV.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=oV.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,oV.assignPointerEventToLayers()),t&&oV.disableBodyPointerEvents(e),$e((()=>{oV.restoreBodyPointerEvents(e)}))}),{defer:!0}));return ut(NK.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return ut(lB,mt({as:"div",ref(e){const n=cU((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function _K(e={}){const[t,n]=vB({value:()=>gz(e.open),defaultValue:()=>!!gz(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var MK={};bB(MK,{Description:()=>hB,ErrorMessage:()=>fB,Item:()=>IK,ItemControl:()=>FK,ItemDescription:()=>$K,ItemIndicator:()=>qK,ItemInput:()=>zK,ItemLabel:()=>UK,Label:()=>BK,RadioGroup:()=>KK,Root:()=>VK});var OK=Ve();function RK(){const e=Ke(OK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var AK=Ve();function LK(){const e=Ke(AK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function IK(e){const t=dB(),n=RK(),r=JU({id:`${t.generateId("item")}-${bt()}`},e),[o,i]=gt(r,["value","disabled","onPointerDown"]),[s,a]=De(),[l,c]=De(),[u,d]=De(),[h,f]=De(),[p,m]=De(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{LU(e,o.onPointerDown),p()&&e.preventDefault()},b=Re((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:PU((()=>i.id)),registerInput:iB(a),registerLabel:iB(c),registerDescription:iB(d),setIsFocused:m,setInputRef:f};return ut(AK.Provider,{value:x,get children(){return ut(lB,mt({as:"div",role:"group",onPointerDown:y},b,i))}})}function FK(e){const t=LK(),n=JU({id:t.generateId("control")},e),[r,o]=gt(n,["onClick","onKeyDown"]);return ut(lB,mt({as:"div",onClick:e=>{LU(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{LU(e,r.onKeyDown),e.key===MU.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function $K(e){const t=LK(),n=JU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(lB,mt({as:"div"},(()=>t.dataset()),n))}function qK(e){const t=LK(),n=JU({id:t.generateId("indicator")},e),[r,o]=gt(n,["ref","forceMount"]),[i,s]=De(),{present:a}=QB({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return ut(Ct,{get when(){return a()},get children(){return ut(lB,mt({as:"div",ref(e){const t=cU(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function zK(e){const t=dB(),n=RK(),r=LK(),o=JU({id:r.generateId("input")},e),[i,s]=gt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=De(!1);return Oe(Ie([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),Oe((()=>$e(r.registerInput(s.id)))),ut(lB,mt({as:"input",ref(e){const t=cU(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 kU({...oB},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(LU(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{LU(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{LU(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function UK(e){const t=LK(),n=JU({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),ut(lB,mt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function BK(e){return ut(pB,mt({as:"span"},e))}function VK(e){let t;const n=JU({id:`radiogroup-${bt()}`,orientation:"vertical"},e),[r,o,i]=gt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],cB),[s,a]=gB({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=JU({id:`form-control-${bt()}`},e),[n,r]=De(),[o,i]=De(),[s,a]=De(),[l,c]=De();return{formControlContext:{name:()=>gz(t.name)??gz(t.id),dataset:Re((()=>({"data-valid":"valid"===gz(t.validationState)?"":void 0,"data-invalid":"invalid"===gz(t.validationState)?"":void 0,"data-required":gz(t.required)?"":void 0,"data-disabled":gz(t.disabled)?"":void 0,"data-readonly":gz(t.readOnly)?"":void 0}))),validationState:()=>gz(t.validationState),isRequired:()=>gz(t.required),isDisabled:()=>gz(t.disabled),isReadOnly:()=>gz(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:PU((()=>gz(t.id))),registerLabel:iB(r),registerField:iB(i),registerDescription:iB(a),registerErrorMessage:iB(c)}}}(o);mB((()=>t),(()=>a(r.defaultValue??"")));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 ut(uB.Provider,{value:l,get children(){return ut(OK.Provider,{value:d,get children(){return ut(lB,mt({as:"div",ref(e){const n=cU((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return gz(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(gz(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var KK=Object.assign(VK,{Description:hB,ErrorMessage:fB,Item:IK,ItemControl:FK,ItemDescription:$K,ItemIndicator:qK,ItemInput:zK,ItemLabel:UK,Label:BK}),HK=class{collection;ref;collator;constructor(e,t,n){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){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function WK(e,t,n){const r=function(e){const{locale:t}=IB(),n=Re((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Re((()=>{const r=n();let o;return FB.has(r)&&(o=FB.get(r)),o||(o=new Intl.Collator(t(),e),FB.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return VB({selectionManager:()=>gz(e.selectionManager),keyboardDelegate:Re((()=>{const n=gz(e.keyboardDelegate);return n||new HK(e.collection,t,r)})),autoFocus:()=>gz(e.autoFocus),deferAutoFocus:()=>gz(e.deferAutoFocus),shouldFocusWrap:()=>gz(e.shouldFocusWrap),disallowEmptySelection:()=>gz(e.disallowEmptySelection),selectOnFocus:()=>gz(e.selectOnFocus),disallowTypeAhead:()=>gz(e.disallowTypeAhead),shouldUseVirtualFocus:()=>gz(e.shouldUseVirtualFocus),allowsTabNavigation:()=>gz(e.allowsTabNavigation),isVirtualized:()=>gz(e.isVirtualized),scrollToKey:t=>gz(e.scrollToKey)?.(t),orientation:()=>gz(e.orientation)},t)}var GK="focusScope.autoFocusOnMount",YK="focusScope.autoFocusOnUnmount",QK={bubbles:!1,cancelable:!0},XK={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=EU(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=EU(this.stack,e),this.active()?.resume()}};function JK(e,t){const[n,r]=De(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>DU(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,oB),e},u=()=>{const e=t();return e?KU(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};Oe((()=>{const e=t();if(!e)return;XK.add(o);const n=NU(e);if(!TU(e,n)){const t=new CustomEvent(GK,QK);e.addEventListener(GK,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{$U(d()),NU(e)===n&&$U(e)}),0)}$e((()=>{e.removeEventListener(GK,s),setTimeout((()=>{const r=new CustomEvent(YK,QK);(()=>{const e=t();if(!e)return!1;const n=NU(e);return!!n&&!TU(e,n)&&WU(n)})()&&r.preventDefault(),e.addEventListener(YK,a),e.dispatchEvent(r),r.defaultPrevented||$U(n??l().body),e.removeEventListener(YK,a),XK.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!gz(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${XB}]`)||(TU(r,t)?i=t:$U(i))},s=e=>{const t=e.relatedTarget??NU(r);t?.closest(`[${XB}]`)||TU(r,t)||$U(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!gz(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})();$U(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}),$e((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var ZK="data-live-announcer";function eH(e){Oe((()=>{gz(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${ZK}], [${XB}]`))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=>{const t=tH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),tH.set(e,t+1))};nH.length&&nH[nH.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 nH.push(a),()=>{s.disconnect();for(const e of r){const t=tH.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),tH.delete(e)):tH.set(e,t-1)}a===nH[nH.length-1]?(nH.pop(),nH.length&&nH[nH.length-1].observe()):nH.splice(nH.indexOf(a),1)}}(gz(e.targets),gz(e.root)))}))}var tH=new WeakMap,nH=[];var rH=new Map,oH=e=>{Oe((()=>{const t=YB(e.style)??{},n=YB(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=rH.get(e.key);o?o.activeCount++:rH.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);$e((()=>{const t=rH.get(e.key);if(t)if(1===t.activeCount){rH.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},iH=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},sH=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[aH,lH]=De([]),cH=e=>[e.deltaX,e.deltaY],uH=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],dH=(e,t,n,r)=>{const o=null!==r&&hH(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=iH(o,t),u=c-e-r*l;0===l&&0===u||!sH(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},hH=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},fH=e=>{const t=mt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=bt();let r=[0,0],o=null,i=null;Oe((()=>{YB(t.enabled)&&(lH((e=>[...e,n])),$e((()=>{lH((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!YB(t.enabled)||!YB(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(YB(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===YB(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;oH({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{YB(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else oH({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,aH().indexOf(e)===aH().length-1&&YB(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),$e((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=uH(e),o=null,i=null},a=e=>{const n=e.target,r=YB(t.element),o=cH(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=dH(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!hH(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=YB(t.element),s=e.target;let a;if(2===e.touches.length)a=!YB(t.allowPinchZoom);else{if(null==o||null===i){const t=uH(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=dH(s,o,i,n);a=!n||!hH(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},pH=Ve();function mH(){return Ke(pH)}function gH(){const e=mH();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var vH=Ve();function yH(){const e=Ke(vH);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var bH=Ve();function xH(){const e=Ke(bH);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function wH(e){let t;const n=xH(),r=gH(),o=JU({id:n.generateId(`item-${bt()}`)},e),[i,s]=gt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=De(),[c,u]=De(),[d,h]=De(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};jB({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=KB({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{LU(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||($U(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{LU(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{LU(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(LU(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=Re((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=Re((()=>({"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}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:h,generateId:PU((()=>s.id)),registerLabel:iB(l),registerDescription:iB(u)};return ut(vH.Provider,{value:C,get children(){return ut(lB,mt({as:"div",ref(e){const n=cU((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return IU([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return IU([b,g.onPointerUp])},get onClick(){return IU([i.onClick,g.onClick])},get onKeyDown(){return IU([x,g.onKeyDown])},get onMouseDown(){return IU([i.onMouseDown,g.onMouseDown])},get onFocus(){return IU([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function SH(e){const t=JU({closeOnSelect:!1},e),[n,r]=gt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=vB({value:()=>gz(e.isSelected),defaultValue:()=>!!gz(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{gz(e.isReadOnly)||gz(e.isDisabled)||n(t)},toggle:()=>{gz(e.isReadOnly)||gz(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return ut(wH,mt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var CH=Ve();function kH(){return Ke(CH)}var EH={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>EH.next("ltr"===e?"rtl":"ltr",t)},jH=e=>"horizontal"===e?"ArrowDown":"ArrowRight",PH=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function TH(e){const t=xH(),n=gH(),r=kH(),{direction:o}=IB(),i=JU({id:t.generateId("trigger")},e),[s,a]=gt(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=sB((()=>n.triggerRef()),(()=>"button")),u=Re((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));Oe(Ie((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.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 Oe((()=>$e(n.registerTriggerId(s.id)))),ut(sV,mt({ref(e){const t=cU(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 Re((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{LU(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{LU(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{LU(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(LU(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case jH(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=YU(e);for(;e&&n&&e!==t&&n!==t;)nB(n,e),n=YU(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case PH(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case EH.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case EH.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{LU(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 NH=Ve();function DH(){return Ke(NH)}function _H(e){let t;const n=xH(),r=gH(),o=kH(),i=DH(),{direction:s}=IB(),a=JU({id:n.generateId(`content-${bt()}`)},e),[l,c]=gt(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=WK({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));JK({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},p=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};Oe((()=>$e(r.registerContentId(l.id))));const m={ref:cU((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:IU([l.onKeyDown,h.onKeyDown,e=>{if(TU(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case EH.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case EH.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:IU([l.onMouseDown,h.onMouseDown]),onFocusIn:IU([l.onFocusIn,h.onFocusIn]),onFocusOut:IU([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{LU(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(LU(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;TU(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return ut(Ct,{get when(){return r.contentPresent()},get children(){return ut(Ct,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return ut(lB,mt({as:"div"},(()=>r.dataset()),m,c))},get children(){return ut(jK.Positioner,{get children(){return ut(DK,mt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return kU({"--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()),m,c))}})}})}})}function MH(e){let t;const n=xH(),r=gH(),[o,i]=gt(e,["ref"]);return fH({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),ut(_H,mt({ref(e){const n=cU((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var OH=Ve();function RH(e){const t=JU({id:xH().generateId(`group-${bt()}`)},e),[n,r]=De(),o={generateId:PU((()=>t.id)),registerLabelId:iB(r)};return ut(OH.Provider,{value:o,get children(){return ut(lB,mt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function AH(e){const t=function(){const e=Ke(OH);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=JU({id:t.generateId("label")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),ut(lB,mt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function LH(e){const t=gH();return ut(lB,mt({as:"span","aria-hidden":"true"},(()=>t.dataset()),JU({children:"▼"},e)))}function IH(e){return ut(wH,mt({role:"menuitem",closeOnSelect:!0},e))}function FH(e){const t=yH(),n=JU({id:t.generateId("description")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),ut(lB,mt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function $H(e){const t=yH(),n=JU({id:t.generateId("indicator")},e),[r,o]=gt(n,["forceMount"]);return ut(Ct,{get when(){return r.forceMount||t.isChecked()},get children(){return ut(lB,mt({as:"div"},(()=>t.dataset()),o))}})}function qH(e){const t=yH(),n=JU({id:t.generateId("label")},e),[r,o]=gt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),ut(lB,mt({as:"div",ref(e){const n=cU(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function zH(e){const t=gH();return ut(Ct,{get when(){return t.contentPresent()},get children(){return ut(Zt,e)}})}var UH=Ve();function BH(e){const t=JU({id:xH().generateId(`radiogroup-${bt()}`)},e),[n,r]=gt(t,["value","defaultValue","onChange","disabled"]),[o,i]=gB({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return ut(UH.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return ut(RH,r)}})}function VH(e){const t=function(){const e=Ke(UH);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=JU({closeOnSelect:!1},e),[r,o]=gt(n,["value","onSelect"]);return ut(wH,mt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function KH(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 HH(e){const t=xH(),n=wB(),r=mH(),o=kH(),i=DH(),s=JU({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=gt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=De(),[p,m]=De(),[g,v]=De(),[y,b]=De(),[x,w]=De(!0),[S,C]=De(l.placement),[k,E]=De([]),[j,P]=De([]),{DomCollectionProvider:T}=EB({items:j,onItemsChange:P}),N=_K({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:D}=QB({show:()=>t.forceMount()||N.isOpen(),element:()=>y()??null}),_=function(e){const t=BB(e),n=TB({dataSource:()=>gz(e.dataSource),getKey:()=>gz(e.getKey),getTextValue:()=>gz(e.getTextValue),getDisabled:()=>gz(e.getDisabled),getSectionChildren:()=>gz(e.getSectionChildren),factory:t=>new WB(e.filter?e.filter(t):t)},[()=>e.filter]),r=new HB(n,t);return _e((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:j}),M=e=>{w(e),N.open()},O=(e=!1)=>{N.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&($U(e),_.selectionManager().setFocused(!0),_.selectionManager().setFocusedKey(void 0))},A=()=>{null!=i?setTimeout((()=>R())):R()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&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};eH({isDisabled:()=>!(null==r&&N.isOpen()&&t.isModal()),targets:()=>[y(),...k()].filter(Boolean)}),Oe((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);$e((()=>{t()}))})),Oe((()=>{void 0===r&&o?.registerMenu(t.value(),[y(),...k()])})),Oe((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):O())})),Oe((()=>{void 0===r&&void 0!==o&&N.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":N.isOpen()?"":void 0,"data-closed":N.isOpen()?void 0:""}))),isOpen:N.isOpen,contentPresent:D,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>_,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),N.toggle()},focusContent:A,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||A()},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=r?.registerNestedMenu(e);return()=>{E((t=>EU(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:iB(f),registerContentId:iB(m)};return ut(T,{get children(){return ut(pH.Provider,{value:I,get children(){return ut(Ct,{when:void 0===i,get fallback(){return l.children},get children(){return ut(jK,mt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function WH(e){const{direction:t}=IB();return ut(HH,mt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var GH=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function YH(e){const t=gH(),n=xH(),[r,o]=gt(e,["onFocusOutside","onKeyDown"]),{direction:i}=IB();return ut(_H,mt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;TU(t.triggerRef(),n)||t.close()},onKeyDown:e=>{LU(e,r.onKeyDown);const o=TU(e.currentTarget,e.target),s=GH(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),$U(t.triggerRef()))}},o))}var QH=["Enter"," "],XH=(e,t)=>"ltr"===e?[...QH,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...QH,"horizontal"===t?"ArrowLeft":"ArrowUp"];function JH(e){let t;const n=xH(),r=gH(),o=JU({id:n.generateId(`sub-trigger-${bt()}`)},e),[i,s]=gt(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}=IB(),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=KB({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{LU(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{LU(e,i.onKeyDown),e.repeat||i.disabled||XH(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 Oe((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");$e(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),Oe(Ie((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{$e((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),Oe((()=>$e(r.registerTriggerId(i.id)))),$e((()=>{l()})),ut(lB,mt({as:"div",ref(e){const n=cU((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 Re((()=>!!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 IU([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return IU([i.onPointerUp,h.onPointerUp])},get onClick(){return IU([f,h.onClick])},get onKeyDown(){return IU([p,h.onKeyDown])},get onMouseDown(){return IU([i.onMouseDown,h.onMouseDown])},get onFocus(){return IU([i.onFocus,h.onFocus])},onPointerMove:e=>{if(LU(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),$U(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(LU(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:KH(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function ZH(e){const t=kH(),n=JU({id:`menu-${bt()}`,modal:!0},e),[r,o]=gt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=_K({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:PU((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return ut(bH.Provider,{value:s,get children(){return ut(HH,mt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function eW(e){let t;const n=JU({orientation:"horizontal"},e),[r,o]=gt(n,["ref","orientation"]),i=sB((()=>t),(()=>"hr"));return ut(lB,mt({as:"hr",ref(e){const n=cU((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))}bB({},{Root:()=>eW,Separator:()=>tW});var tW=eW,nW={};function rW(e){const t=xH(),n=gH(),[r,o]=gt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return ut(MH,mt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||$U(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function oW(e){return ut(ZH,JU({id:`dropdownmenu-${bt()}`},e))}bB(nW,{Arrow:()=>SK,CheckboxItem:()=>SH,Content:()=>rW,DropdownMenu:()=>iW,Group:()=>RH,GroupLabel:()=>AH,Icon:()=>LH,Item:()=>IH,ItemDescription:()=>FH,ItemIndicator:()=>$H,ItemLabel:()=>qH,Portal:()=>zH,RadioGroup:()=>BH,RadioItem:()=>VH,Root:()=>oW,Separator:()=>eW,Sub:()=>WH,SubContent:()=>YH,SubTrigger:()=>JH,Trigger:()=>TH});var iW=Object.assign(oW,{Arrow:SK,CheckboxItem:SH,Content:rW,Group:RH,GroupLabel:AH,Icon:LH,Item:IH,ItemDescription:FH,ItemIndicator:$H,ItemLabel:qH,Portal:zH,RadioGroup:BH,RadioItem:VH,Separator:eW,Sub:WH,SubContent:YH,SubTrigger:JH,Trigger:TH}),sW={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"}},aW=At('<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>'),lW=At('<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>'),cW=At('<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>'),uW=At('<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>'),dW=At('<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>'),hW=At('<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>'),fW=At('<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>'),pW=At('<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>'),mW=At('<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">'),gW=At('<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">'),vW=At('<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>'),yW=At('<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>'),bW=At('<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>'),xW=At('<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>'),wW=At('<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>'),SW=At('<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>'),CW=At('<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>'),kW=At('<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>'),EW=At('<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>'),jW=At('<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>'),PW=At('<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>'),TW=At('<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>'),NW=At('<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 DW(){return aW()}function _W(){return lW()}function MW(){return cW()}function OW(){return uW()}function RW(){return dW()}function AW(){return(e=dW()).style.setProperty("transform","rotate(90deg)"),e;var e}function LW(){return(e=dW()).style.setProperty("transform","rotate(-90deg)"),e;var e}function IW(){return hW()}function FW(){return fW()}function $W(){return pW()}function qW(){return mW()}function zW(){return gW()}function UW(){return vW()}function BW(){return yW()}function VW(){return bW()}function KW(){return xW()}function HW(e){return t=wW(),n=t.firstChild,Me((()=>It(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function WW(){return SW()}function GW(){return CW()}function YW(e){return[ut(Ct,{get when(){return e.checked},get children(){var t=wW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),ut(Ct,{get when(){return!e.checked},get children(){var t=kW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function QW(){return EW()}function XW(){return jW()}function JW(){return PW()}function ZW(){return TW()}function eG(){const e=bt();return t=NW(),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,m=(p=(f=d.nextSibling).nextSibling).firstChild,v=(g=p.nextSibling).firstChild,x=(b=(y=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,P=(j=k.nextSibling).firstChild,D=(N=(T=j.nextSibling).nextSibling).firstChild,M=(_=N.nextSibling).firstChild,A=(R=(O=_.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,V=(B=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(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,ge=(me=fe.nextSibling).firstChild,Ae=(Re=(Oe=(Me=(_e=(De=(Ne=(Te=(Pe=(je=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ye=(ve=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,It(n,"id",`a-${e}`),It(r,"fill",`url(#a-${e})`),It(i,"id",`am-${e}`),It(s,"id",`b-${e}`),It(a,"filter",`url(#am-${e})`),It(l,"mask",`url(#b-${e})`),It(u,"id",`ah-${e}`),It(d,"id",`k-${e}`),It(h,"filter",`url(#ah-${e})`),It(f,"mask",`url(#k-${e})`),It(m,"id",`ae-${e}`),It(g,"id",`j-${e}`),It(v,"filter",`url(#ae-${e})`),It(y,"mask",`url(#j-${e})`),It(x,"id",`ai-${e}`),It(w,"id",`i-${e}`),It(S,"filter",`url(#ai-${e})`),It(C,"mask",`url(#i-${e})`),It(E,"id",`aj-${e}`),It(j,"id",`h-${e}`),It(P,"filter",`url(#aj-${e})`),It(T,"mask",`url(#h-${e})`),It(D,"id",`ag-${e}`),It(_,"id",`g-${e}`),It(M,"filter",`url(#ag-${e})`),It(O,"mask",`url(#g-${e})`),It(A,"id",`af-${e}`),It(L,"id",`f-${e}`),It(I,"filter",`url(#af-${e})`),It(F,"mask",`url(#f-${e})`),It($,"id",`m-${e}`),It(q,"fill",`url(#m-${e})`),It(U,"id",`ak-${e}`),It(B,"id",`e-${e}`),It(V,"filter",`url(#ak-${e})`),It(K,"mask",`url(#e-${e})`),It(H,"id",`n-${e}`),It(W,"fill",`url(#n-${e})`),It(G,"id",`r-${e}`),It(Y,"fill",`url(#r-${e})`),It(Q,"id",`s-${e}`),It(X,"fill",`url(#s-${e})`),It(J,"id",`q-${e}`),It(Z,"fill",`url(#q-${e})`),It(ee,"id",`p-${e}`),It(te,"fill",`url(#p-${e})`),It(ne,"id",`o-${e}`),It(re,"fill",`url(#o-${e})`),It(oe,"id",`l-${e}`),It(ie,"fill",`url(#l-${e})`),It(ae,"id",`al-${e}`),It(le,"id",`d-${e}`),It(ce,"filter",`url(#al-${e})`),It(ue,"mask",`url(#d-${e})`),It(de,"id",`u-${e}`),It(he,"fill",`url(#u-${e})`),It(pe,"id",`ad-${e}`),It(me,"id",`c-${e}`),It(ge,"filter",`url(#ad-${e})`),It(ve,"mask",`url(#c-${e})`),It(ye,"id",`t-${e}`),It(be,"fill",`url(#t-${e})`),It(xe,"id",`v-${e}`),It(we,"stroke",`url(#v-${e})`),It(Se,"id",`aa-${e}`),It(Ce,"stroke",`url(#aa-${e})`),It(ke,"id",`w-${e}`),It(Ee,"stroke",`url(#w-${e})`),It(je,"id",`ac-${e}`),It(Pe,"stroke",`url(#ac-${e})`),It(Te,"id",`ab-${e}`),It(Ne,"stroke",`url(#ab-${e})`),It(De,"id",`y-${e}`),It(_e,"stroke",`url(#y-${e})`),It(Me,"id",`x-${e}`),It(Oe,"stroke",`url(#x-${e})`),It(Re,"id",`z-${e}`),It(Ae,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x,w,S,C,k,E,j,P,T,N,D,_,M,O,R,A,L,I,F,$,q,z,U,B,V,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be,xe,we,Se,Ce,ke,Ee,je,Pe,Te,Ne,De,_e,Me,Oe,Re,Ae}var tG=At('<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>'),nG=At('<button title="Copy object to clipboard">'),rG=At('<button title="Remove all items"aria-label="Remove all items">'),oG=At('<button title="Delete item"aria-label="Delete item">'),iG=At('<button title="Toggle value"aria-label="Toggle value">'),sG=At('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),aG=At("<div>"),lG=At("<div><button> <span></span> <span> "),cG=At("<input>"),uG=At("<span>"),dG=At("<div><span>:"),hG=At("<div><div><button> [<!>...<!>]");var fG=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n)));return o=tG(),Me((()=>Ft(o,aU(r().expander,n`
|
|
44
|
+
transform: rotate(${e.expanded?90:0}deg);
|
|
45
|
+
`,e.expanded&&n`
|
|
46
|
+
& svg {
|
|
47
|
+
top: -1px;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
`)))),o;var o},pG=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n))),[o,i]=De("NoCopy");return $t(s=nG(),"click","NoCopy"===o()?()=>{navigator.clipboard.writeText(Hn(e.value)).then((()=>{i("SuccessCopy"),setTimeout((()=>{i("NoCopy")}),1500)}),(e=>{i("ErrorCopy"),setTimeout((()=>{i("NoCopy")}),1500)}))}:void 0,!0),Ut(s,ut(kt,{get children(){return[ut(Et,{get when(){return"NoCopy"===o()},get children(){return ut(VW,{})}}),ut(Et,{get when(){return"SuccessCopy"===o()},get children(){return ut(HW,{get theme(){return t()}})}}),ut(Et,{get when(){return"ErrorCopy"===o()},get children(){return ut(WW,{})}})]}})),Me((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&&Ft(s,e.e=t),n!==e.t&&It(s,"aria-label",e.t=n),e}),{e:void 0,t:void 0}),s;var s},mG=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n))),o=Nz().client;return(i=rG()).$$click=()=>{const t=or(e.activeQuery.state.data,e.dataPath,[]);o.setQueryData(e.activeQuery.queryKey,t)},Ut(i,ut(GW,{})),Me((()=>Ft(i,r().actionButton))),i;var i},gG=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n))),o=Nz().client;return(i=oG()).$$click=()=>{const t=ir(e.activeQuery.state.data,e.dataPath);o.setQueryData(e.activeQuery.queryKey,t)},Ut(i,ut(_W,{})),Me((()=>Ft(i,aU(r().actionButton)))),i;var i},vG=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n))),o=Nz().client;return(i=iG()).$$click=()=>{const t=or(e.activeQuery.state.data,e.dataPath,!e.value);o.setQueryData(e.activeQuery.queryKey,t)},Ut(i,ut(YW,{get theme(){return t()},get checked(){return e.value}})),Me((()=>Ft(i,aU(r().actionButton,n`
|
|
50
|
+
width: ${sW.size[3.5]};
|
|
51
|
+
height: ${sW.size[3.5]};
|
|
52
|
+
`)))),i;var i};function yG(e){return Symbol.iterator in e}function bG(e){const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?SG(n):wG(n))),o=Nz().client,[i,s]=De((e.defaultExpanded||[]).includes(e.label)),[a,l]=De([]),c=Re((()=>Array.isArray(e.value)?e.value.map(((e,t)=>({label:t.toString(),value:e}))):null!==e.value&&"object"==typeof e.value&&yG(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}))):[])),u=Re((()=>Array.isArray(e.value)?"array":null!==e.value&&"object"==typeof e.value&&yG(e.value)&&"function"==typeof e.value[Symbol.iterator]?"Iterable":"object"==typeof e.value&&null!==e.value?"object":typeof e.value)),d=Re((()=>function(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n+=t;return r}(c(),100))),h=e.dataPath??[];return Ut(f=aG(),ut(Ct,{get when(){return d().length},get children(){return[(t=lG(),n=t.firstChild,o=n.firstChild,f=o.nextSibling,p=f.nextSibling.nextSibling,m=p.firstChild,n.$$click=()=>s((e=>!e)),Ut(n,ut(fG,{get expanded(){return i()}}),o),Ut(f,(()=>e.label)),Ut(p,(()=>"iterable"===String(u()).toLowerCase()?"(Iterable) ":""),m),Ut(p,(()=>c().length),m),Ut(p,(()=>c().length>1?"items":"item"),null),Ut(t,ut(Ct,{get when(){return e.editable},get children(){var t=aG();return Ut(t,ut(pG,{get value(){return e.value}}),null),Ut(t,ut(Ct,{get when(){return e.itemsDeletable&&void 0!==e.activeQuery},get children(){return ut(gG,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Ut(t,ut(Ct,{get when(){return"array"===u()&&void 0!==e.activeQuery},get children(){return ut(mG,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Ut(t,ut(Ct,{get when(){return Re((()=>!!e.onEdit))()&&!Kn(e.value).meta},get children(){var t=sG();return t.$$click=()=>{e.onEdit?.()},Ut(t,ut(KW,{})),Me((()=>Ft(t,r().actionButton))),t}}),null),Me((()=>Ft(t,r().actions))),t}}),null),Me((e=>{var o=r().expanderButtonContainer,i=r().expanderButton,s=r().info;return o!==e.e&&Ft(t,e.e=o),i!==e.t&&Ft(n,e.t=i),s!==e.a&&Ft(p,e.a=s),e}),{e:void 0,t:void 0,a:void 0}),t),ut(Ct,{get when(){return i()},get children(){return[ut(Ct,{get when(){return 1===d().length},get children(){var t=aG();return Ut(t,ut(bU,{get each(){return c()},by:e=>e.label,children:t=>ut(bG,{get defaultExpanded(){return e.defaultExpanded},get label(){return t().label},get value(){return t().value},get editable(){return e.editable},get dataPath(){return[...h,t().label]},get activeQuery(){return e.activeQuery},get itemsDeletable(){return"array"===u()||"Iterable"===u()||"object"===u()}})})),Me((()=>Ft(t,r().subEntry))),t}}),ut(Ct,{get when(){return d().length>1},get children(){var t=aG();return Ut(t,ut(St,{get each(){return d()},children:(t,n)=>{return o=hG(),d=(u=(c=(s=(i=o.firstChild).firstChild).firstChild).nextSibling).nextSibling.nextSibling,s.$$click=()=>l((e=>e.includes(n)?e.filter((e=>e!==n)):[...e,n])),Ut(s,ut(fG,{get expanded(){return a().includes(n)}}),c),Ut(s,100*n,u),Ut(s,100*n+100-1,d),Ut(i,ut(Ct,{get when(){return a().includes(n)},get children(){var n=aG();return Ut(n,ut(bU,{get each(){return t()},by:e=>e.label,children:t=>ut(bG,{get defaultExpanded(){return e.defaultExpanded},get label(){return t().label},get value(){return t().value},get editable(){return e.editable},get dataPath(){return[...h,t().label]},get activeQuery(){return e.activeQuery}})})),Me((()=>Ft(n,r().subEntry))),n}}),null),Me((e=>{var t=r().entry,n=r().expanderButton;return t!==e.e&&Ft(i,e.e=t),n!==e.t&&Ft(s,e.t=n),e}),{e:void 0,t:void 0}),o;var o,i,s,c,u,d}})),Me((()=>Ft(t,r().subEntry))),t}})]}})];var t,n,o,f,p,m}}),null),Ut(f,ut(Ct,{get when(){return 0===d().length},get children(){var t=dG(),n=t.firstChild;return Ut(n,(()=>e.label),n.firstChild),Ut(t,ut(Ct,{get when(){return Re((()=>!(!e.editable||void 0===e.activeQuery)))()&&("string"===u()||"number"===u()||"boolean"===u())},get fallback(){return Ut(t=uG(),(()=>Yn(e.value))),Me((()=>Ft(t,r().value))),t;var t},get children(){return[ut(Ct,{get when(){return Re((()=>!(!e.editable||void 0===e.activeQuery)))()&&("string"===u()||"number"===u())},get children(){var t=cG();return t.addEventListener("change",(t=>{const n=or(e.activeQuery.state.data,h,"number"===u()?t.target.valueAsNumber:t.target.value);o.setQueryData(e.activeQuery.queryKey,n)})),Me((e=>{var n="number"===u()?"number":"text",o=aU(r().value,r().editableInput);return n!==e.e&&It(t,"type",e.e=n),o!==e.t&&Ft(t,e.t=o),e}),{e:void 0,t:void 0}),Me((()=>t.value=e.value)),t}}),ut(Ct,{get when(){return"boolean"===u()},get children(){var t=uG();return Ut(t,ut(vG,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),Ut(t,(()=>Yn(e.value)),null),Me((()=>Ft(t,aU(r().value,r().actions,r().editableInput)))),t}})]}}),null),Ut(t,ut(Ct,{get when(){return e.editable&&e.itemsDeletable&&void 0!==e.activeQuery},get children(){return ut(gG,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Me((e=>{var o=r().row,i=r().label;return o!==e.e&&Ft(t,e.e=o),i!==e.t&&Ft(n,e.t=i),e}),{e:void 0,t:void 0}),t}}),null),Me((()=>Ft(f,r().entry))),f;var f}var xG=(e,t)=>{const{colors:n,font:r,size:o,border:i}=sW,s=(t,n)=>"light"===e?t:n;return{entry:t`
|
|
53
|
+
& * {
|
|
54
|
+
font-size: ${r.size.xs};
|
|
55
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
56
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
57
|
+
}
|
|
58
|
+
position: relative;
|
|
59
|
+
outline: none;
|
|
60
|
+
word-break: break-word;
|
|
61
|
+
`,subEntry:t`
|
|
62
|
+
margin: 0 0 0 0.5em;
|
|
63
|
+
padding-left: 0.75em;
|
|
64
|
+
border-left: 2px solid ${s(n.gray[300],n.darkGray[400])};
|
|
65
|
+
/* outline: 1px solid ${n.teal[400]}; */
|
|
66
|
+
`,expander:t`
|
|
67
|
+
& path {
|
|
68
|
+
stroke: ${n.gray[400]};
|
|
69
|
+
}
|
|
70
|
+
& svg {
|
|
71
|
+
width: ${o[3]};
|
|
72
|
+
height: ${o[3]};
|
|
73
|
+
}
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
transition: all 0.1s ease;
|
|
77
|
+
/* outline: 1px solid ${n.blue[400]}; */
|
|
78
|
+
`,expanderButtonContainer:t`
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
line-height: ${o[4]};
|
|
82
|
+
min-height: ${o[4]};
|
|
83
|
+
gap: ${o[2]};
|
|
84
|
+
`,expanderButton:t`
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
color: inherit;
|
|
87
|
+
font: inherit;
|
|
88
|
+
outline: inherit;
|
|
89
|
+
height: ${o[5]};
|
|
90
|
+
background: transparent;
|
|
91
|
+
border: none;
|
|
92
|
+
padding: 0;
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: ${o[1]};
|
|
96
|
+
position: relative;
|
|
97
|
+
/* outline: 1px solid ${n.green[400]}; */
|
|
98
|
+
|
|
99
|
+
&:focus-visible {
|
|
100
|
+
border-radius: ${i.radius.xs};
|
|
101
|
+
outline: 2px solid ${n.blue[800]};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
& svg {
|
|
105
|
+
position: relative;
|
|
106
|
+
left: 1px;
|
|
107
|
+
}
|
|
108
|
+
`,info:t`
|
|
109
|
+
color: ${s(n.gray[500],n.gray[500])};
|
|
110
|
+
font-size: ${r.size.xs};
|
|
111
|
+
margin-left: ${o[1]};
|
|
112
|
+
/* outline: 1px solid ${n.yellow[400]}; */
|
|
113
|
+
`,label:t`
|
|
114
|
+
color: ${s(n.gray[700],n.gray[300])};
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
`,value:t`
|
|
117
|
+
color: ${s(n.purple[600],n.purple[400])};
|
|
118
|
+
flex-grow: 1;
|
|
119
|
+
`,actions:t`
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
gap: ${o[2]};
|
|
122
|
+
align-items: center;
|
|
123
|
+
`,row:t`
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
gap: ${o[2]};
|
|
126
|
+
width: 100%;
|
|
127
|
+
margin: ${o[.25]} 0px;
|
|
128
|
+
line-height: ${o[4.5]};
|
|
129
|
+
align-items: center;
|
|
130
|
+
`,editableInput:t`
|
|
131
|
+
border: none;
|
|
132
|
+
padding: ${o[.5]} ${o[1]} ${o[.5]} ${o[1.5]};
|
|
133
|
+
flex-grow: 1;
|
|
134
|
+
border-radius: ${i.radius.xs};
|
|
135
|
+
background-color: ${s(n.gray[200],n.darkGray[500])};
|
|
136
|
+
|
|
137
|
+
&:hover {
|
|
138
|
+
background-color: ${s(n.gray[300],n.darkGray[600])};
|
|
139
|
+
}
|
|
140
|
+
`,actionButton:t`
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
color: ${s(n.gray[500],n.gray[500])};
|
|
143
|
+
border: none;
|
|
144
|
+
display: inline-flex;
|
|
145
|
+
padding: 0px;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
width: ${o[3]};
|
|
150
|
+
height: ${o[3]};
|
|
151
|
+
position: relative;
|
|
152
|
+
z-index: 1;
|
|
153
|
+
|
|
154
|
+
&:hover svg {
|
|
155
|
+
color: ${s(n.gray[600],n.gray[400])};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:focus-visible {
|
|
159
|
+
border-radius: ${i.radius.xs};
|
|
160
|
+
outline: 2px solid ${n.blue[800]};
|
|
161
|
+
outline-offset: 2px;
|
|
162
|
+
}
|
|
163
|
+
`}},wG=e=>xG("light",e),SG=e=>xG("dark",e);Lt(["click"]);var CG=At('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),kG=At("<div>"),EG=At('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),jG=At("<select name=tsqd-queries-filter-sort>"),PG=At("<select name=tsqd-mutations-filter-sort>"),TG=At("<span>Asc"),NG=At("<span>Desc"),DG=At('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),_G=At("<div>Settings"),MG=At("<span>Position"),OG=At("<span>Top"),RG=At("<span>Bottom"),AG=At("<span>Left"),LG=At("<span>Right"),IG=At("<span>Theme"),FG=At("<span>Light"),$G=At("<span>Dark"),qG=At("<span>System"),zG=At("<div><div class=tsqd-queries-container>"),UG=At("<div><div class=tsqd-mutations-container>"),BG=At('<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>'),VG=At("<option>Sort by "),KG=At("<div class=tsqd-query-disabled-indicator>disabled"),HG=At("<button><div></div><code class=tsqd-query-hash>"),WG=At("<div role=tooltip id=tsqd-status-tooltip>"),GG=At("<span>"),YG=At("<button><span></span><span>"),QG=At("<button><span></span> Error"),XG=At('<div><span></span>Trigger Error<select><option value=""disabled selected>'),JG=At('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),ZG=At("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),eY=At('<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">'),tY=At("<option>"),nY=At('<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">'),[rY,oY]=De(null),[iY,sY]=De(null),[aY,lY]=De(0),[cY,uY]=De(!1),dY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n))),o=Mz(),i=Re((()=>Nz().buttonPosition||"bottom-right")),s=Re((()=>"true"===e.localStore.open||"false"!==e.localStore.open&&(Nz().initialIsOpen||false))),a=Re((()=>e.localStore.position||Nz().position||kz));let l;Oe((()=>{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`)})),Fe((()=>{const e=()=>{const e=l.parentElement,t=getComputedStyle(e).fontSize;e.style.setProperty("--tsqd-font-size",t)};e(),window.addEventListener("focus",e),$e((()=>{window.removeEventListener("focus",e)}))}));const c=Re((()=>e.localStore.pip_open??"false"));return[ut(Ct,{get when(){return Re((()=>!!o().pipWindow))()&&"true"==c()},get children(){return ut(Zt,{get mount(){return o().pipWindow?.document.body},get children(){return ut(hY,{get children(){return ut(mY,e)}})}})}}),(u=kG(),"function"==typeof l?zt(l,u):l=u,Ut(u,ut(gU,{name:"tsqd-panel-transition",get children(){return ut(Ct,{get when(){return Re((()=>!(!s()||o().pipWindow)))()&&"false"==c()},get children(){return ut(pY,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),Ut(u,ut(gU,{name:"tsqd-button-transition",get children(){return ut(Ct,{get when(){return!s()},get children(){var t=CG(),n=t.firstChild,o=n.nextSibling;return Ut(n,ut(eG,{})),o.$$click=()=>e.setLocalStore("open","true"),Ut(o,ut(eG,{})),Me((()=>Ft(t,aU(r().devtoolsBtn,r()[`devtoolsBtn-position-${i()}`],"tsqd-open-btn-container")))),t}})}}),null),Me((()=>Ft(u,aU(n`
|
|
164
|
+
& .tsqd-panel-transition-exit-active,
|
|
165
|
+
& .tsqd-panel-transition-enter-active {
|
|
166
|
+
transition:
|
|
167
|
+
opacity 0.3s,
|
|
168
|
+
transform 0.3s;
|
|
69
169
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@keyframes fadeIn {
|
|
75
|
-
from {
|
|
76
|
-
opacity: 0;
|
|
77
|
-
transform: translateY(5px);
|
|
170
|
+
|
|
171
|
+
& .tsqd-panel-transition-exit-to,
|
|
172
|
+
& .tsqd-panel-transition-enter {
|
|
173
|
+
${"top"===a()||"bottom"===a()?"transform: translateY(var(--tsqd-panel-height));":"transform: translateX(var(--tsqd-panel-width));"}
|
|
78
174
|
}
|
|
79
|
-
|
|
175
|
+
|
|
176
|
+
& .tsqd-button-transition-exit-active,
|
|
177
|
+
& .tsqd-button-transition-enter-active {
|
|
178
|
+
transition:
|
|
179
|
+
opacity 0.3s,
|
|
180
|
+
transform 0.3s;
|
|
80
181
|
opacity: 1;
|
|
81
|
-
transform: translateY(0);
|
|
82
182
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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"})});
|
|
183
|
+
|
|
184
|
+
& .tsqd-button-transition-exit-to,
|
|
185
|
+
& .tsqd-button-transition-enter {
|
|
186
|
+
transform: ${"relative"===i()?"none;":"top-left"===i()?"translateX(-72px);":"top-right"===i()?"translateX(72px);":"translateY(72px);"};
|
|
187
|
+
opacity: 0;
|
|
188
|
+
}
|
|
189
|
+
`,"tsqd-transitions-container")))),u)];var u},hY=e=>{const t=Mz(),n=Rz(),r=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,o=Re((()=>"dark"===n()?_Y(r):DY(r)));return Oe((()=>{const e=t().pipWindow,n=()=>{e&&lY(e.innerWidth)};e&&(e.addEventListener("resize",n),n()),$e((()=>{e&&e.removeEventListener("resize",n)}))})),(i=kG()).style.setProperty("--tsqd-font-size","16px"),i.style.setProperty("max-height","100vh"),i.style.setProperty("height","100vh"),i.style.setProperty("width","100vw"),Ut(i,(()=>e.children)),Me((()=>Ft(i,aU(o().panel,(()=>{const{colors:e}=sW,t=(e,t)=>"dark"===n()?t:e;return aY()<Cz?r`
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
background-color: ${t(e.gray[300],e.gray[600])};
|
|
192
|
+
`:r`
|
|
193
|
+
flex-direction: row;
|
|
194
|
+
background-color: ${t(e.gray[200],e.darkGray[900])};
|
|
195
|
+
`})(),{[r`
|
|
196
|
+
min-width: min-content;
|
|
197
|
+
`]:aY()<700},"tsqd-main-panel")))),i;var i},fY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n)));let o;Fe((()=>{wU(o,(({width:e},t)=>{t===o&&lY(e)}))}));return i=kG(),"function"==typeof o?zt(o,i):o=i,i.style.setProperty("--tsqd-font-size","16px"),Ut(i,(()=>e.children)),Me((()=>Ft(i,aU(r().parentPanel,(()=>{const{colors:e}=sW,r=(e,n)=>"dark"===t()?n:e;return aY()<Cz?n`
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
background-color: ${r(e.gray[300],e.gray[600])};
|
|
200
|
+
`:n`
|
|
201
|
+
flex-direction: row;
|
|
202
|
+
background-color: ${r(e.gray[200],e.darkGray[900])};
|
|
203
|
+
`})(),{[n`
|
|
204
|
+
min-width: min-content;
|
|
205
|
+
`]:aY()<700},"tsqd-main-panel")))),i;var i},pY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n))),[o,i]=De(!1),s=Re((()=>e.localStore.position||Nz().position||kz)),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=nr(3.5),h=nr(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,oY(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;Fe((()=>{wU(l,(({width:e},t)=>{t===l&&lY(e)}))})),Oe((()=>{const t=l.parentElement?.parentElement?.parentElement;if(!t)return;const n=`${"padding"}${(r=e.localStore.position||kz).charAt(0).toUpperCase()+r.slice(1)}`;var r;const o="left"===e.localStore.position||"right"===e.localStore.position,i=(({padding:e,paddingTop:t,paddingBottom:n,paddingLeft:r,paddingRight:o})=>({padding:e,paddingTop:t,paddingBottom:n,paddingLeft:r,paddingRight:o}))(t.style);t.style[n]=`${o?e.localStore.width:e.localStore.height}px`,$e((()=>{Object.entries(i).forEach((([e,n])=>{t.style[e]=n}))}))}));return c=EG(),d=(u=c.firstChild).nextSibling,"function"==typeof l?zt(l,c):l=c,u.$$mousedown=a,d.$$click=()=>e.setLocalStore("open","false"),Ut(d,ut(MW,{})),Ut(c,ut(mY,e),null),Me((o=>{var i=aU(r().panel,r()[`panel-position-${s()}`],(()=>{const{colors:e}=sW,r=(e,n)=>"dark"===t()?n:e;return aY()<Cz?n`
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
background-color: ${r(e.gray[300],e.gray[600])};
|
|
208
|
+
`:n`
|
|
209
|
+
flex-direction: row;
|
|
210
|
+
background-color: ${r(e.gray[200],e.darkGray[900])};
|
|
211
|
+
`})(),{[n`
|
|
212
|
+
min-width: min-content;
|
|
213
|
+
`]:aY()<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=aU(r().dragHandle,r()[`dragHandle-position-${s()}`],"tsqd-drag-handle"),f=aU(r().closeBtn,r()[`closeBtn-position-${s()}`],"tsqd-minimize-btn");return i!==o.e&&Ft(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&&Ft(u,o.o=h),f!==o.i&&Ft(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},mY=e=>{let t;kY(),PY();const n=Rz(),r=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,o=Re((()=>"dark"===n()?_Y(r):DY(r))),i=Mz(),[s,a]=De("queries"),l=Re((()=>e.localStore.sort||jz)),c=Re((()=>Number(e.localStore.sortOrder)||1)),u=Re((()=>e.localStore.mutationSort||Pz)),d=Re((()=>Number(e.localStore.mutationSortOrder)||1)),h=Re((()=>Jn[l()])),f=Re((()=>tr[u()])),p=Re((()=>Nz().onlineManager)),m=Re((()=>Nz().client.getQueryCache())),g=Re((()=>Nz().client.getMutationCache())),v=EY((e=>e().getAll().length),!1),y=Re(Ie((()=>[v(),e.localStore.filter,l(),c()]),(()=>{const t=m().getAll(),n=e.localStore.filter?t.filter((t=>Hz(t.queryHash,e.localStore.filter||"").passed)):[...t];return h()?n.sort(((e,t)=>h()(e,t)*c())):n}))),b=TY((e=>e().getAll().length),!1),x=Re(Ie((()=>[b(),e.localStore.mutationFilter,u(),d()]),(()=>{const t=g().getAll(),n=e.localStore.mutationFilter?t.filter((t=>Hz(`${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}))),w=t=>{e.setLocalStore("position",t)},S=e=>{const n=getComputedStyle(t).getPropertyValue("--tsqd-font-size");e.style.setProperty("--tsqd-font-size",n)};return[(k=BG(),E=k.firstChild,j=E.firstChild,P=j.firstChild,T=P.firstChild,N=T.nextSibling,D=N.firstChild,_=E.nextSibling,M=_.firstChild,O=M.firstChild,R=O.firstChild,A=O.nextSibling,L=A.nextSibling,I=M.nextSibling,F=I.firstChild,$=F.nextSibling,"function"==typeof t?zt(t,k):t=k,P.$$click=()=>{i().pipWindow||e.showPanelViewOnly?e.onClose&&e.onClose():e.setLocalStore("open","false")},Ut(N,(()=>Nz().queryFlavor),D),Ut(N,(()=>Nz().version),null),Ut(j,ut(MK.Root,{get class(){return aU(o().viewToggle)},get value(){return s()},onChange:e=>{a(e),oY(null),sY(null)},get children(){return[ut(MK.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[ut(MK.ItemInput,{}),ut(MK.ItemControl,{get children(){return ut(MK.ItemIndicator,{})}}),ut(MK.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),ut(MK.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[ut(MK.ItemInput,{}),ut(MK.ItemControl,{get children(){return ut(MK.ItemIndicator,{})}}),ut(MK.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),Ut(E,ut(Ct,{get when(){return"queries"===s()},get children(){return ut(yY,{})}}),null),Ut(E,ut(Ct,{get when(){return"mutations"===s()},get children(){return ut(bY,{})}}),null),Ut(O,ut(DW,{}),R),R.$$input=t=>{"queries"===s()?e.setLocalStore("filter",t.currentTarget.value):e.setLocalStore("mutationFilter",t.currentTarget.value)},Ut(A,ut(Ct,{get when(){return"queries"===s()},get children(){var t=jG();return t.addEventListener("change",(t=>{e.setLocalStore("sort",t.currentTarget.value)})),Ut(t,(()=>Object.keys(Jn).map((e=>{return(t=VG()).value=e,Ut(t,e,null),t;var t})))),Me((()=>t.value=l())),t}}),null),Ut(A,ut(Ct,{get when(){return"mutations"===s()},get children(){var t=PG();return t.addEventListener("change",(t=>{e.setLocalStore("mutationSort",t.currentTarget.value)})),Ut(t,(()=>Object.keys(tr).map((e=>{return(t=VG()).value=e,Ut(t,e,null),t;var t})))),Me((()=>t.value=u())),t}}),null),Ut(A,ut(MW,{}),null),L.$$click=()=>{"queries"===s()?e.setLocalStore("sortOrder",String(-1*c())):e.setLocalStore("mutationSortOrder",String(-1*d()))},Ut(L,ut(Ct,{get when(){return 1===("queries"===s()?c():d())},get children(){return[TG(),ut(OW,{})]}}),null),Ut(L,ut(Ct,{get when(){return-1===("queries"===s()?c():d())},get children(){return[NG(),ut(RW,{})]}}),null),F.$$click=()=>{"queries"===s()?m().clear():g().clear()},Ut(F,ut(_W,{})),$.$$click=()=>{cY()?(p().setOnline(!0),uY(!1)):(p().setOnline(!1),uY(!0))},Ut($,(C=Re((()=>!!cY())),()=>C()?ut(zW,{}):ut(qW,{}))),Ut(I,ut(Ct,{get when(){return Re((()=>!i().pipWindow))()&&!i().disabled},get children(){var t=DG();return t.$$click=()=>{i().requestPipWindow(Number(window.innerWidth),Number(e.localStore.height??500))},Ut(t,ut(BW,{})),Me((()=>Ft(t,aU(o().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip")))),t}}),null),Ut(I,ut(nW.Root,{gutter:4,get children(){return[ut(nW.Trigger,{get class(){return aU(o().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return ut(UW,{})}}),ut(nW.Portal,{ref:e=>S(e),get mount(){return Re((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return ut(nW.Content,{get class(){return aU(o().settingsMenu,"tsqd-settings-menu")},get children(){return[(t=_G(),Me((()=>Ft(t,aU(o().settingsMenuHeader,"tsqd-settings-menu-header")))),t),ut(Ct,{get when(){return!e.showPanelViewOnly},get children(){return ut(nW.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[ut(nW.SubTrigger,{get class(){return aU(o().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[MG(),ut(MW,{})]}}),ut(nW.Portal,{ref:e=>S(e),get mount(){return Re((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return ut(nW.SubContent,{get class(){return aU(o().settingsMenu,"tsqd-settings-submenu")},get children(){return[ut(nW.Item,{onSelect:()=>{w("top")},as:"button",get class(){return aU(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[OG(),ut(OW,{})]}}),ut(nW.Item,{onSelect:()=>{w("bottom")},as:"button",get class(){return aU(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[RG(),ut(RW,{})]}}),ut(nW.Item,{onSelect:()=>{w("left")},as:"button",get class(){return aU(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[AG(),ut(AW,{})]}}),ut(nW.Item,{onSelect:()=>{w("right")},as:"button",get class(){return aU(o().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[LG(),ut(LW,{})]}})]}})}})]}})}}),ut(nW.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[ut(nW.SubTrigger,{get class(){return aU(o().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[IG(),ut(MW,{})]}}),ut(nW.Portal,{ref:e=>S(e),get mount(){return Re((()=>!!i().pipWindow))()?i().pipWindow.document.body:document.body},get children(){return ut(nW.SubContent,{get class(){return aU(o().settingsMenu,"tsqd-settings-submenu")},get children(){return[ut(nW.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return aU(o().settingsSubButton,"light"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[FG(),ut(IW,{})]}}),ut(nW.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return aU(o().settingsSubButton,"dark"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[$G(),ut(FW,{})]}}),ut(nW.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return aU(o().settingsSubButton,"system"===e.localStore.theme_preference&&o().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[qG(),ut($W,{})]}})]}})}})]}})];var t}})}})]}}),null),Ut(k,ut(Ct,{get when(){return"queries"===s()},get children(){var e=zG();return Ut(e.firstChild,ut(bU,{by:e=>e.queryHash,get each(){return y()},children:e=>ut(gY,{get query(){return e()}})})),Me((()=>Ft(e,aU(o().overflowQueryContainer,"tsqd-queries-overflow-container")))),e}}),null),Ut(k,ut(Ct,{get when(){return"mutations"===s()},get children(){var e=UG();return Ut(e.firstChild,ut(bU,{by:e=>e.mutationId,get each(){return x()},children:e=>ut(vY,{get mutation(){return e()}})})),Me((()=>Ft(e,aU(o().overflowQueryContainer,"tsqd-mutations-overflow-container")))),e}}),null),Me((e=>{var t=aU(o().queriesContainer,aY()<Cz&&(rY()||iY())&&r`
|
|
214
|
+
height: 50%;
|
|
215
|
+
max-height: 50%;
|
|
216
|
+
`,aY()<Cz&&!(rY()||iY())&&r`
|
|
217
|
+
height: 100%;
|
|
218
|
+
max-height: 100%;
|
|
219
|
+
`,"tsqd-queries-container"),n=aU(o().row,"tsqd-header"),i=o().logoAndToggleContainer,a=aU(o().logo,"tsqd-text-logo-container"),l=aU(o().tanstackLogo,"tsqd-text-logo-tanstack"),u=aU(o().queryFlavorLogo,"tsqd-text-logo-query-flavor"),h=aU(o().row,"tsqd-filters-actions-container"),f=aU(o().filtersContainer,"tsqd-filters-container"),p=aU(o().filterInput,"tsqd-query-filter-textfield-container"),m=aU("tsqd-query-filter-textfield"),g=aU(o().filterSelect,"tsqd-query-filter-sort-container"),v="Sort order "+(-1===("queries"===s()?c():d())?"descending":"ascending"),y=-1===("queries"===s()?c():d()),b=aU(o().actionsContainer,"tsqd-actions-container"),x=aU(o().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),w=`Clear ${s()} cache`,S=aU(o().actionsBtn,cY()&&o().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),C=cY()?"Unset offline mocking behavior":"Mock offline behavior",D=cY(),q=cY()?"Unset offline mocking behavior":"Mock offline behavior";return t!==e.e&&Ft(k,e.e=t),n!==e.t&&Ft(E,e.t=n),i!==e.a&&Ft(j,e.a=i),a!==e.o&&Ft(P,e.o=a),l!==e.i&&Ft(T,e.i=l),u!==e.n&&Ft(N,e.n=u),h!==e.s&&Ft(_,e.s=h),f!==e.h&&Ft(M,e.h=f),p!==e.r&&Ft(O,e.r=p),m!==e.d&&Ft(R,e.d=m),g!==e.l&&Ft(A,e.l=g),v!==e.u&&It(L,"aria-label",e.u=v),y!==e.c&&It(L,"aria-pressed",e.c=y),b!==e.w&&Ft(I,e.w=b),x!==e.m&&Ft(F,e.m=x),w!==e.f&&It(F,"title",e.f=w),S!==e.y&&Ft($,e.y=S),C!==e.g&&It($,"aria-label",e.g=C),D!==e.p&&It($,"aria-pressed",e.p=D),q!==e.b&&It($,"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}),Me((()=>R.value="queries"===s()?e.localStore.filter||"":e.localStore.mutationFilter||"")),k),ut(Ct,{get when(){return Re((()=>"queries"===s()))()&&rY()},get children(){return ut(wY,{})}}),ut(Ct,{get when(){return Re((()=>"mutations"===s()))()&&iY()},get children(){return ut(SY,{})}})];var C,k,E,j,P,T,N,D,_,M,O,R,A,L,I,F,$},gY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n))),{colors:o,alpha:i}=sW,s=(e,n)=>"dark"===t()?n:e,a=EY((t=>t().find({queryKey:e.query.queryKey})?.state),!0,(t=>t.query.queryHash===e.query.queryHash)),l=EY((t=>t().find({queryKey:e.query.queryKey})?.isDisabled()??!1),!0,(t=>t.query.queryHash===e.query.queryHash)),c=EY((t=>t().find({queryKey:e.query.queryKey})?.isStale()??!1),!0,(t=>t.query.queryHash===e.query.queryHash)),u=EY((t=>t().find({queryKey:e.query.queryKey})?.getObserversCount()??0),!0,(t=>t.query.queryHash===e.query.queryHash)),d=Re((()=>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 ut(Ct,{get when(){return a()},get children(){var t=HG(),a=t.firstChild,c=a.nextSibling;return t.$$click=()=>oY(e.query.queryHash===rY()?null:e.query.queryHash),Ut(a,u),Ut(c,(()=>e.query.queryHash)),Ut(t,ut(Ct,{get when(){return l()},get children(){return KG()}}),null),Me((l=>{var c=aU(r().queryRow,rY()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),u=`Query key ${e.query.queryHash}`,h=aU("gray"===d()?n`
|
|
220
|
+
background-color: ${s(o[d()][200],o[d()][700])};
|
|
221
|
+
color: ${s(o[d()][700],o[d()][300])};
|
|
222
|
+
`:n`
|
|
223
|
+
background-color: ${s(o[d()][200]+i[80],o[d()][900])};
|
|
224
|
+
color: ${s(o[d()][800],o[d()][300])};
|
|
225
|
+
`,"tsqd-query-observer-count");return c!==l.e&&Ft(t,l.e=c),u!==l.t&&It(t,"aria-label",l.t=u),h!==l.a&&Ft(a,l.a=h),l}),{e:void 0,t:void 0,a:void 0}),t}})},vY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n))),{colors:o,alpha:i}=sW,s=(e,n)=>"dark"===t()?n:e,a=TY((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return n?.state})),l=TY((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return!!n&&n.state.isPaused})),c=TY((t=>{const n=t().getAll().find((t=>t.mutationId===e.mutation.mutationId));return n?n.state.status:"idle"})),u=Re((()=>Gn({isPaused:l(),status:c()})));return ut(Ct,{get when(){return a()},get children(){var t=HG(),a=t.firstChild,l=a.nextSibling;return t.$$click=()=>{sY(e.mutation.mutationId===iY()?null:e.mutation.mutationId)},Ut(a,ut(Ct,{get when(){return"purple"===u()},get children(){return ut(ZW,{})}}),null),Ut(a,ut(Ct,{get when(){return"green"===u()},get children(){return ut(QW,{})}}),null),Ut(a,ut(Ct,{get when(){return"red"===u()},get children(){return ut(JW,{})}}),null),Ut(a,ut(Ct,{get when(){return"yellow"===u()},get children(){return ut(XW,{})}}),null),Ut(l,ut(Ct,{get when(){return e.mutation.options.mutationKey},get children(){return[Re((()=>JSON.stringify(e.mutation.options.mutationKey)))," -"," "]}}),null),Ut(l,(()=>new Date(e.mutation.state.submittedAt).toLocaleString()),null),Me((l=>{var c=aU(r().queryRow,iY()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),d=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,h=aU("gray"===u()?n`
|
|
226
|
+
background-color: ${s(o[u()][200],o[u()][700])};
|
|
227
|
+
color: ${s(o[u()][700],o[u()][300])};
|
|
228
|
+
`:n`
|
|
229
|
+
background-color: ${s(o[u()][200]+i[80],o[u()][900])};
|
|
230
|
+
color: ${s(o[u()][800],o[u()][300])};
|
|
231
|
+
`,"tsqd-query-observer-count");return c!==l.e&&Ft(t,l.e=c),d!==l.t&&It(t,"aria-label",l.t=d),h!==l.a&&Ft(a,l.a=h),l}),{e:void 0,t:void 0,a:void 0}),t}})},yY=()=>{const e=EY((e=>e().getAll().filter((e=>"stale"===Wn(e))).length)),t=EY((e=>e().getAll().filter((e=>"fresh"===Wn(e))).length)),n=EY((e=>e().getAll().filter((e=>"fetching"===Wn(e))).length)),r=EY((e=>e().getAll().filter((e=>"paused"===Wn(e))).length)),o=EY((e=>e().getAll().filter((e=>"inactive"===Wn(e))).length)),i=Rz(),s=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,a=Re((()=>"dark"===i()?_Y(s):DY(s)));return Ut(l=kG(),ut(xY,{label:"Fresh",color:"green",get count(){return t()}}),null),Ut(l,ut(xY,{label:"Fetching",color:"blue",get count(){return n()}}),null),Ut(l,ut(xY,{label:"Paused",color:"purple",get count(){return r()}}),null),Ut(l,ut(xY,{label:"Stale",color:"yellow",get count(){return e()}}),null),Ut(l,ut(xY,{label:"Inactive",color:"gray",get count(){return o()}}),null),Me((()=>Ft(l,aU(a().queryStatusContainer,"tsqd-query-status-container")))),l;var l},bY=()=>{const e=TY((e=>e().getAll().filter((e=>"green"===Gn({isPaused:e.state.isPaused,status:e.state.status}))).length)),t=TY((e=>e().getAll().filter((e=>"yellow"===Gn({isPaused:e.state.isPaused,status:e.state.status}))).length)),n=TY((e=>e().getAll().filter((e=>"purple"===Gn({isPaused:e.state.isPaused,status:e.state.status}))).length)),r=TY((e=>e().getAll().filter((e=>"red"===Gn({isPaused:e.state.isPaused,status:e.state.status}))).length)),o=Rz(),i=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,s=Re((()=>"dark"===o()?_Y(i):DY(i)));return Ut(a=kG(),ut(xY,{label:"Paused",color:"purple",get count(){return n()}}),null),Ut(a,ut(xY,{label:"Pending",color:"yellow",get count(){return t()}}),null),Ut(a,ut(xY,{label:"Success",color:"green",get count(){return e()}}),null),Ut(a,ut(xY,{label:"Error",color:"red",get count(){return r()}}),null),Me((()=>Ft(a,aU(s().queryStatusContainer,"tsqd-query-status-container")))),a;var a},xY=e=>{const t=Rz(),n=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,r=Re((()=>"dark"===t()?_Y(n):DY(n))),{colors:o,alpha:i}=sW,s=(e,n)=>"dark"===t()?n:e;let a;const[l,c]=De(!1),[u,d]=De(!1),h=Re((()=>!(rY()&&aY()<1024&&aY()>Cz)&&!(aY()<Cz)));return f=YG(),m=(p=f.firstChild).nextSibling,"function"==typeof a?zt(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))),qt(f,mt({get disabled(){return h()},get class(){return aU(r().queryStatusTag,!h()&&n`
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
&:hover {
|
|
234
|
+
background: ${s(o.gray[200],o.darkGray[400])}${i[80]};
|
|
235
|
+
}
|
|
236
|
+
`,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},(()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{})),!1,!0),Ut(f,ut(Ct,{get when(){return Re((()=>!h()))()&&(l()||u())},get children(){var t=WG();return Ut(t,(()=>e.label)),Me((()=>Ft(t,aU(r().statusTooltip,"tsqd-query-status-tooltip")))),t}}),p),Ut(f,ut(Ct,{get when(){return h()},get children(){var t=GG();return Ut(t,(()=>e.label)),Me((()=>Ft(t,aU(r().queryStatusTagLabel,"tsqd-query-status-tag-label")))),t}}),m),Ut(m,(()=>e.count)),Me((t=>{var i=aU(n`
|
|
237
|
+
width: ${sW.size[1.5]};
|
|
238
|
+
height: ${sW.size[1.5]};
|
|
239
|
+
border-radius: ${sW.border.radius.full};
|
|
240
|
+
background-color: ${sW.colors[e.color][500]};
|
|
241
|
+
`,"tsqd-query-status-tag-dot"),a=aU(r().queryStatusCount,e.count>0&&"gray"!==e.color&&n`
|
|
242
|
+
background-color: ${s(o[e.color][100],o[e.color][900])};
|
|
243
|
+
color: ${s(o[e.color][700],o[e.color][300])};
|
|
244
|
+
`,"tsqd-query-status-tag-count");return i!==t.e&&Ft(p,t.e=i),a!==t.t&&Ft(m,t.t=a),t}),{e:void 0,t:void 0}),f;var f,p,m},wY=()=>{const e=Rz(),t=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,n=Re((()=>"dark"===e()?_Y(t):DY(t))),{colors:r}=sW,o=(t,n)=>"dark"===e()?n:t,i=Nz().client,[s,a]=De(!1),[l,c]=De("view"),[u,d]=De(!1),h=Re((()=>Nz().errorTypes||[])),f=EY((e=>e().getAll().find((e=>e.queryHash===rY()))),!1),p=EY((e=>e().getAll().find((e=>e.queryHash===rY()))),!1),m=EY((e=>e().getAll().find((e=>e.queryHash===rY()))?.state),!1),g=EY((e=>e().getAll().find((e=>e.queryHash===rY()))?.state.data),!1),v=EY((e=>{const t=e().getAll().find((e=>e.queryHash===rY()));return t?Wn(t):"inactive"})),y=EY((e=>{const t=e().getAll().find((e=>e.queryHash===rY()));return t?t.state.status:"pending"})),b=EY((e=>e().getAll().find((e=>e.queryHash===rY()))?.getObserversCount()??0)),x=Re((()=>{return"fresh"===(e=v())?"green":"stale"===e?"yellow":"paused"===e?"purple":"inactive"===e?"gray":"blue";var e})),w=()=>{const e=f()?.fetch();e?.catch((()=>{}))},S=e=>{const t=e?.initializer(f())??new Error("Unknown error from devtools"),n=f().options;f().setState({status:"error",error:t,fetchMeta:{...f().state.fetchMeta,__previousQueryOptions:n}})};Oe((()=>{"fetching"!==v()&&a(!1)}));return ut(Ct,{get when(){return Re((()=>!!f()))()&&m()},get children(){var e=eY(),C=e.firstChild,k=C.nextSibling,E=k.firstChild,j=E.firstChild,P=j.nextSibling,T=E.nextSibling,N=T.firstChild.nextSibling,D=T.nextSibling.firstChild.nextSibling,_=k.nextSibling,M=_.nextSibling,O=M.firstChild,R=O.firstChild,A=O.nextSibling,L=A.firstChild,I=A.nextSibling,F=I.firstChild,$=I.nextSibling,q=$.firstChild,z=$.nextSibling,U=z.firstChild,B=U.nextSibling,V=M.nextSibling,K=V.nextSibling,H=K.nextSibling;return Ut(j.firstChild,(()=>Yn(f().queryKey,!0))),Ut(P,v),Ut(N,b),Ut(D,(()=>new Date(m().dataUpdatedAt).toLocaleTimeString())),O.$$click=w,A.$$click=()=>i.invalidateQueries(f()),I.$$click=()=>i.resetQueries(f()),$.$$click=()=>{i.removeQueries(f()),oY(null)},z.$$click=()=>{if(void 0===f()?.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}})}},Ut(z,(()=>"pending"===y()?"Restore":"Trigger"),B),Ut(M,ut(Ct,{get when(){return 0===h().length||"error"===y()},get children(){var e=QG(),n=e.firstChild,s=n.nextSibling;return e.$$click=()=>{f().state.error?i.resetQueries(f()):S()},Ut(e,(()=>"error"===y()?"Restore":"Trigger"),s),Me((i=>{var s=aU(t`
|
|
245
|
+
color: ${o(r.red[500],r.red[400])};
|
|
246
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),a="pending"===y(),l=t`
|
|
247
|
+
background-color: ${o(r.red[500],r.red[400])};
|
|
248
|
+
`;return s!==i.e&&Ft(e,i.e=s),a!==i.t&&(e.disabled=i.t=a),l!==i.a&&Ft(n,i.a=l),i}),{e:void 0,t:void 0,a:void 0}),e}}),null),Ut(M,ut(Ct,{get when(){return!(0===h().length||"error"===y())},get children(){var e=XG(),r=e.firstChild,o=r.nextSibling.nextSibling;return o.addEventListener("change",(e=>{const t=h().find((t=>t.name===e.currentTarget.value));S(t)})),Ut(o,ut(wt,{get each(){return h()},children:e=>{return Ut(t=tY(),(()=>e.name)),Me((()=>t.value=e.name)),t;var t}}),null),Ut(e,ut(MW,{}),null),Me((i=>{var s=aU(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),a=t`
|
|
249
|
+
background-color: ${sW.colors.red[400]};
|
|
250
|
+
`,l="pending"===y();return s!==i.e&&Ft(e,i.e=s),a!==i.t&&Ft(r,i.t=a),l!==i.a&&(o.disabled=i.a=l),i}),{e:void 0,t:void 0,a:void 0}),e}}),null),Ut(V,(()=>"view"===l()?"Explorer":"Editor"),null),Ut(e,ut(Ct,{get when(){return"view"===l()},get children(){var e=JG();return Ut(e,ut(bG,{label:"Data",defaultExpanded:["Data"],get value(){return g()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return f()}})),Me((t=>null!=(t=sW.size[2])?e.style.setProperty("padding",t):e.style.removeProperty("padding"))),e}}),K),Ut(e,ut(Ct,{get when(){return"edit"===l()},get children(){var e=ZG(),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))),Ut(a,(()=>u()?"Invalid Value":"")),h.$$click=()=>c("view"),Me((c=>{var d=aU(n().devtoolsEditForm,"tsqd-query-details-data-editor"),f=n().devtoolsEditTextarea,m=u(),g=n().devtoolsEditFormActions,v=n().devtoolsEditFormError,y=n().devtoolsEditFormActionContainer,b=aU(n().devtoolsEditFormAction,t`
|
|
251
|
+
color: ${o(r.gray[600],r.gray[300])};
|
|
252
|
+
`),x=aU(n().devtoolsEditFormAction,t`
|
|
253
|
+
color: ${o(r.blue[600],r.blue[400])};
|
|
254
|
+
`);return d!==c.e&&Ft(e,c.e=d),f!==c.t&&Ft(i,c.t=f),m!==c.a&&It(i,"data-error",c.a=m),g!==c.o&&Ft(s,c.o=g),v!==c.i&&Ft(a,c.i=v),y!==c.n&&Ft(l,c.n=y),b!==c.s&&Ft(h,c.s=b),x!==c.h&&Ft(p,c.h=x),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}),Me((()=>i.value=JSON.stringify(g(),null,2))),e}}),K),Ut(H,ut(bG,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return p()}})),Me((i=>{var a=aU(n().detailsContainer,"tsqd-query-details-container"),l=aU(n().detailsHeader,"tsqd-query-details-header"),c=aU(n().detailsBody,"tsqd-query-details-summary-container"),u=aU(n().queryDetailsStatus,"gray"===x()?t`
|
|
255
|
+
background-color: ${o(r[x()][200],r[x()][700])};
|
|
256
|
+
color: ${o(r[x()][700],r[x()][300])};
|
|
257
|
+
border-color: ${o(r[x()][400],r[x()][600])};
|
|
258
|
+
`:t`
|
|
259
|
+
background-color: ${o(r[x()][100],r[x()][900])};
|
|
260
|
+
color: ${o(r[x()][700],r[x()][300])};
|
|
261
|
+
border-color: ${o(r[x()][400],r[x()][600])};
|
|
262
|
+
`),d=aU(n().detailsHeader,"tsqd-query-details-header"),h=aU(n().actionsBody,"tsqd-query-details-actions-container"),f=aU(t`
|
|
263
|
+
color: ${o(r.blue[600],r.blue[400])};
|
|
264
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),p="fetching"===v(),m=t`
|
|
265
|
+
background-color: ${o(r.blue[600],r.blue[400])};
|
|
266
|
+
`,g=aU(t`
|
|
267
|
+
color: ${o(r.yellow[600],r.yellow[400])};
|
|
268
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),b="pending"===y(),w=t`
|
|
269
|
+
background-color: ${o(r.yellow[600],r.yellow[400])};
|
|
270
|
+
`,S=aU(t`
|
|
271
|
+
color: ${o(r.gray[600],r.gray[300])};
|
|
272
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),E="pending"===y(),j=t`
|
|
273
|
+
background-color: ${o(r.gray[600],r.gray[400])};
|
|
274
|
+
`,T=aU(t`
|
|
275
|
+
color: ${o(r.pink[500],r.pink[400])};
|
|
276
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),N="fetching"===v(),D=t`
|
|
277
|
+
background-color: ${o(r.pink[500],r.pink[400])};
|
|
278
|
+
`,B=aU(t`
|
|
279
|
+
color: ${o(r.cyan[500],r.cyan[400])};
|
|
280
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),W=s(),G=t`
|
|
281
|
+
background-color: ${o(r.cyan[500],r.cyan[400])};
|
|
282
|
+
`,Y=aU(n().detailsHeader,"tsqd-query-details-header"),Q=aU(n().detailsHeader,"tsqd-query-details-header"),X=sW.size[2];return a!==i.e&&Ft(e,i.e=a),l!==i.t&&Ft(C,i.t=l),c!==i.a&&Ft(k,i.a=c),u!==i.o&&Ft(P,i.o=u),d!==i.i&&Ft(_,i.i=d),h!==i.n&&Ft(M,i.n=h),f!==i.s&&Ft(O,i.s=f),p!==i.h&&(O.disabled=i.h=p),m!==i.r&&Ft(R,i.r=m),g!==i.d&&Ft(A,i.d=g),b!==i.l&&(A.disabled=i.l=b),w!==i.u&&Ft(L,i.u=w),S!==i.c&&Ft(I,i.c=S),E!==i.w&&(I.disabled=i.w=E),j!==i.m&&Ft(F,i.m=j),T!==i.f&&Ft($,i.f=T),N!==i.y&&($.disabled=i.y=N),D!==i.g&&Ft(q,i.g=D),B!==i.p&&Ft(z,i.p=B),W!==i.b&&(z.disabled=i.b=W),G!==i.T&&Ft(U,i.T=G),Y!==i.A&&Ft(V,i.A=Y),Q!==i.O&&Ft(K,i.O=Q),X!==i.I&&(null!=(i.I=X)?H.style.setProperty("padding",X):H.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}})},SY=()=>{const e=Rz(),t=Nz().shadowDOMTarget?iU.bind({target:Nz().shadowDOMTarget}):iU,n=Re((()=>"dark"===e()?_Y(t):DY(t))),{colors:r}=sW,o=(t,n)=>"dark"===e()?n:t,i=TY((e=>{const t=e().getAll().find((e=>e.mutationId===iY()));return!!t&&t.state.isPaused})),s=TY((e=>{const t=e().getAll().find((e=>e.mutationId===iY()));return t?t.state.status:"idle"})),a=Re((()=>Gn({isPaused:i(),status:s()}))),l=TY((e=>e().getAll().find((e=>e.mutationId===iY()))),!1);return ut(Ct,{get when(){return l()},get children(){var e=nY(),i=e.firstChild,c=i.nextSibling,u=c.firstChild,d=u.firstChild,h=d.nextSibling,f=u.nextSibling.firstChild.nextSibling,p=c.nextSibling,m=p.nextSibling,g=m.nextSibling,v=g.nextSibling,y=v.nextSibling,b=y.nextSibling,x=b.nextSibling,w=x.nextSibling;return Ut(d.firstChild,ut(Ct,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Yn(l().options.mutationKey,!0)}})),Ut(h,ut(Ct,{get when(){return"purple"===a()},children:"pending"}),null),Ut(h,ut(Ct,{get when(){return"purple"!==a()},get children(){return s()}}),null),Ut(f,(()=>new Date(l().state.submittedAt).toLocaleTimeString())),Ut(m,ut(bG,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),Ut(v,ut(bG,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),Ut(b,ut(bG,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),Ut(w,ut(bG,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),Me((s=>{var l=aU(n().detailsContainer,"tsqd-query-details-container"),u=aU(n().detailsHeader,"tsqd-query-details-header"),d=aU(n().detailsBody,"tsqd-query-details-summary-container"),f=aU(n().queryDetailsStatus,"gray"===a()?t`
|
|
283
|
+
background-color: ${o(r[a()][200],r[a()][700])};
|
|
284
|
+
color: ${o(r[a()][700],r[a()][300])};
|
|
285
|
+
border-color: ${o(r[a()][400],r[a()][600])};
|
|
286
|
+
`:t`
|
|
287
|
+
background-color: ${o(r[a()][100],r[a()][900])};
|
|
288
|
+
color: ${o(r[a()][700],r[a()][300])};
|
|
289
|
+
border-color: ${o(r[a()][400],r[a()][600])};
|
|
290
|
+
`),S=aU(n().detailsHeader,"tsqd-query-details-header"),C=sW.size[2],k=aU(n().detailsHeader,"tsqd-query-details-header"),E=sW.size[2],j=aU(n().detailsHeader,"tsqd-query-details-header"),P=sW.size[2],T=aU(n().detailsHeader,"tsqd-query-details-header"),N=sW.size[2];return l!==s.e&&Ft(e,s.e=l),u!==s.t&&Ft(i,s.t=u),d!==s.a&&Ft(c,s.a=d),f!==s.o&&Ft(h,s.o=f),S!==s.i&&Ft(p,s.i=S),C!==s.n&&(null!=(s.n=C)?m.style.setProperty("padding",C):m.style.removeProperty("padding")),k!==s.s&&Ft(g,s.s=k),E!==s.h&&(null!=(s.h=E)?v.style.setProperty("padding",E):v.style.removeProperty("padding")),j!==s.r&&Ft(y,s.r=j),P!==s.d&&(null!=(s.d=P)?b.style.setProperty("padding",P):b.style.removeProperty("padding")),T!==s.l&&Ft(x,s.l=T),N!==s.u&&(null!=(s.u=N)?w.style.setProperty("padding",N):w.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}})},CY=new Map,kY=()=>{const e=Re((()=>Nz().client.getQueryCache())),t=e().subscribe((t=>{var n;n=()=>{for(const[n,r]of CY.entries())r.shouldUpdate(t)&&r.setter(n(e))},Je(n,!1)}));return $e((()=>{CY.clear(),t()})),t},EY=(e,t=!0,n=()=>!0)=>{const r=Re((()=>Nz().client.getQueryCache())),[o,i]=De(e(r),t?void 0:{equals:!1});return Oe((()=>{i(e(r))})),CY.set(e,{setter:i,shouldUpdate:n}),$e((()=>{CY.delete(e)})),o},jY=new Map,PY=()=>{const e=Re((()=>Nz().client.getMutationCache())),t=e().subscribe((()=>{for(const[t,n]of jY.entries())queueMicrotask((()=>{n(t(e))}))}));return $e((()=>{jY.clear(),t()})),t},TY=(e,t=!0)=>{const n=Re((()=>Nz().client.getMutationCache())),[r,o]=De(e(n),t?void 0:{equals:!1});return Oe((()=>{o(e(n))})),jY.set(e,o),$e((()=>{jY.delete(e)})),r},NY=(e,t)=>{const{colors:n,font:r,size:o,alpha:i,shadow:s,border:a}=sW,l=(t,n)=>"light"===e?t:n;return{devtoolsBtn:t`
|
|
291
|
+
z-index: 100000;
|
|
292
|
+
position: fixed;
|
|
293
|
+
padding: 4px;
|
|
294
|
+
text-align: left;
|
|
295
|
+
|
|
296
|
+
display: flex;
|
|
297
|
+
align-items: center;
|
|
298
|
+
justify-content: center;
|
|
299
|
+
border-radius: 9999px;
|
|
300
|
+
box-shadow: ${s.md()};
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
|
|
303
|
+
& div {
|
|
304
|
+
position: absolute;
|
|
305
|
+
top: -8px;
|
|
306
|
+
left: -8px;
|
|
307
|
+
right: -8px;
|
|
308
|
+
bottom: -8px;
|
|
309
|
+
border-radius: 9999px;
|
|
310
|
+
|
|
311
|
+
& svg {
|
|
312
|
+
position: absolute;
|
|
313
|
+
width: 100%;
|
|
314
|
+
height: 100%;
|
|
315
|
+
}
|
|
316
|
+
filter: blur(6px) saturate(1.2) contrast(1.1);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&:focus-within {
|
|
320
|
+
outline-offset: 2px;
|
|
321
|
+
outline: 3px solid ${n.green[600]};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
& button {
|
|
325
|
+
position: relative;
|
|
326
|
+
z-index: 1;
|
|
327
|
+
padding: 0;
|
|
328
|
+
border-radius: 9999px;
|
|
329
|
+
background-color: transparent;
|
|
330
|
+
border: none;
|
|
331
|
+
height: 40px;
|
|
332
|
+
display: flex;
|
|
333
|
+
width: 40px;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
outline: none;
|
|
337
|
+
& svg {
|
|
338
|
+
position: absolute;
|
|
339
|
+
width: 100%;
|
|
340
|
+
height: 100%;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
`,panel:t`
|
|
344
|
+
position: fixed;
|
|
345
|
+
z-index: 9999;
|
|
346
|
+
display: flex;
|
|
347
|
+
gap: ${sW.size[.5]};
|
|
348
|
+
& * {
|
|
349
|
+
box-sizing: border-box;
|
|
350
|
+
text-transform: none;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
& *::-webkit-scrollbar {
|
|
354
|
+
width: 7px;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
& *::-webkit-scrollbar-track {
|
|
358
|
+
background: transparent;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
& *::-webkit-scrollbar-thumb {
|
|
362
|
+
background: ${l(n.gray[300],n.darkGray[200])};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
366
|
+
background: ${l(n.gray[400],n.darkGray[300])};
|
|
367
|
+
}
|
|
368
|
+
`,parentPanel:t`
|
|
369
|
+
z-index: 9999;
|
|
370
|
+
display: flex;
|
|
371
|
+
height: 100%;
|
|
372
|
+
gap: ${sW.size[.5]};
|
|
373
|
+
& * {
|
|
374
|
+
box-sizing: border-box;
|
|
375
|
+
text-transform: none;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
& *::-webkit-scrollbar {
|
|
379
|
+
width: 7px;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
& *::-webkit-scrollbar-track {
|
|
383
|
+
background: transparent;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
& *::-webkit-scrollbar-thumb {
|
|
387
|
+
background: ${l(n.gray[300],n.darkGray[200])};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
391
|
+
background: ${l(n.gray[400],n.darkGray[300])};
|
|
392
|
+
}
|
|
393
|
+
`,"devtoolsBtn-position-bottom-right":t`
|
|
394
|
+
bottom: 12px;
|
|
395
|
+
right: 12px;
|
|
396
|
+
`,"devtoolsBtn-position-bottom-left":t`
|
|
397
|
+
bottom: 12px;
|
|
398
|
+
left: 12px;
|
|
399
|
+
`,"devtoolsBtn-position-top-left":t`
|
|
400
|
+
top: 12px;
|
|
401
|
+
left: 12px;
|
|
402
|
+
`,"devtoolsBtn-position-top-right":t`
|
|
403
|
+
top: 12px;
|
|
404
|
+
right: 12px;
|
|
405
|
+
`,"devtoolsBtn-position-relative":t`
|
|
406
|
+
position: relative;
|
|
407
|
+
`,"panel-position-top":t`
|
|
408
|
+
top: 0;
|
|
409
|
+
right: 0;
|
|
410
|
+
left: 0;
|
|
411
|
+
max-height: 90%;
|
|
412
|
+
min-height: ${o[14]};
|
|
413
|
+
border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
414
|
+
`,"panel-position-bottom":t`
|
|
415
|
+
bottom: 0;
|
|
416
|
+
right: 0;
|
|
417
|
+
left: 0;
|
|
418
|
+
max-height: 90%;
|
|
419
|
+
min-height: ${o[14]};
|
|
420
|
+
border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
421
|
+
`,"panel-position-right":t`
|
|
422
|
+
bottom: 0;
|
|
423
|
+
right: 0;
|
|
424
|
+
top: 0;
|
|
425
|
+
border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
426
|
+
max-width: 90%;
|
|
427
|
+
`,"panel-position-left":t`
|
|
428
|
+
bottom: 0;
|
|
429
|
+
left: 0;
|
|
430
|
+
top: 0;
|
|
431
|
+
border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
432
|
+
max-width: 90%;
|
|
433
|
+
`,closeBtn:t`
|
|
434
|
+
position: absolute;
|
|
435
|
+
cursor: pointer;
|
|
436
|
+
z-index: 5;
|
|
437
|
+
display: flex;
|
|
438
|
+
align-items: center;
|
|
439
|
+
justify-content: center;
|
|
440
|
+
outline: none;
|
|
441
|
+
background-color: ${l(n.gray[50],n.darkGray[700])};
|
|
442
|
+
&:hover {
|
|
443
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
444
|
+
}
|
|
445
|
+
&:focus-visible {
|
|
446
|
+
outline: 2px solid ${n.blue[600]};
|
|
447
|
+
}
|
|
448
|
+
& svg {
|
|
449
|
+
color: ${l(n.gray[600],n.gray[400])};
|
|
450
|
+
width: ${o[2]};
|
|
451
|
+
height: ${o[2]};
|
|
452
|
+
}
|
|
453
|
+
`,"closeBtn-position-top":t`
|
|
454
|
+
bottom: 0;
|
|
455
|
+
right: ${o[2]};
|
|
456
|
+
transform: translate(0, 100%);
|
|
457
|
+
border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
458
|
+
border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
459
|
+
border-top: none;
|
|
460
|
+
border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
461
|
+
border-radius: 0px 0px ${a.radius.sm} ${a.radius.sm};
|
|
462
|
+
padding: ${o[.5]} ${o[1.5]} ${o[1]} ${o[1.5]};
|
|
463
|
+
|
|
464
|
+
&::after {
|
|
465
|
+
content: ' ';
|
|
466
|
+
position: absolute;
|
|
467
|
+
bottom: 100%;
|
|
468
|
+
left: -${o[2.5]};
|
|
469
|
+
height: ${o[1.5]};
|
|
470
|
+
width: calc(100% + ${o[5]});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
& svg {
|
|
474
|
+
transform: rotate(180deg);
|
|
475
|
+
}
|
|
476
|
+
`,"closeBtn-position-bottom":t`
|
|
477
|
+
top: 0;
|
|
478
|
+
right: ${o[2]};
|
|
479
|
+
transform: translate(0, -100%);
|
|
480
|
+
border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
481
|
+
border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
482
|
+
border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
483
|
+
border-bottom: none;
|
|
484
|
+
border-radius: ${a.radius.sm} ${a.radius.sm} 0px 0px;
|
|
485
|
+
padding: ${o[1]} ${o[1.5]} ${o[.5]} ${o[1.5]};
|
|
486
|
+
|
|
487
|
+
&::after {
|
|
488
|
+
content: ' ';
|
|
489
|
+
position: absolute;
|
|
490
|
+
top: 100%;
|
|
491
|
+
left: -${o[2.5]};
|
|
492
|
+
height: ${o[1.5]};
|
|
493
|
+
width: calc(100% + ${o[5]});
|
|
494
|
+
}
|
|
495
|
+
`,"closeBtn-position-right":t`
|
|
496
|
+
bottom: ${o[2]};
|
|
497
|
+
left: 0;
|
|
498
|
+
transform: translate(-100%, 0);
|
|
499
|
+
border-right: none;
|
|
500
|
+
border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
501
|
+
border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
502
|
+
border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
503
|
+
border-radius: ${a.radius.sm} 0px 0px ${a.radius.sm};
|
|
504
|
+
padding: ${o[1.5]} ${o[.5]} ${o[1.5]} ${o[1]};
|
|
505
|
+
|
|
506
|
+
&::after {
|
|
507
|
+
content: ' ';
|
|
508
|
+
position: absolute;
|
|
509
|
+
left: 100%;
|
|
510
|
+
height: calc(100% + ${o[5]});
|
|
511
|
+
width: ${o[1.5]};
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
& svg {
|
|
515
|
+
transform: rotate(-90deg);
|
|
516
|
+
}
|
|
517
|
+
`,"closeBtn-position-left":t`
|
|
518
|
+
bottom: ${o[2]};
|
|
519
|
+
right: 0;
|
|
520
|
+
transform: translate(100%, 0);
|
|
521
|
+
border-left: none;
|
|
522
|
+
border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
523
|
+
border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
524
|
+
border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
|
|
525
|
+
border-radius: 0px ${a.radius.sm} ${a.radius.sm} 0px;
|
|
526
|
+
padding: ${o[1.5]} ${o[1]} ${o[1.5]} ${o[.5]};
|
|
527
|
+
|
|
528
|
+
&::after {
|
|
529
|
+
content: ' ';
|
|
530
|
+
position: absolute;
|
|
531
|
+
right: 100%;
|
|
532
|
+
height: calc(100% + ${o[5]});
|
|
533
|
+
width: ${o[1.5]};
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
& svg {
|
|
537
|
+
transform: rotate(90deg);
|
|
538
|
+
}
|
|
539
|
+
`,queriesContainer:t`
|
|
540
|
+
flex: 1 1 700px;
|
|
541
|
+
background-color: ${l(n.gray[50],n.darkGray[700])};
|
|
542
|
+
display: flex;
|
|
543
|
+
flex-direction: column;
|
|
544
|
+
& * {
|
|
545
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
546
|
+
}
|
|
547
|
+
`,dragHandle:t`
|
|
548
|
+
position: absolute;
|
|
549
|
+
transition: background-color 0.125s ease;
|
|
550
|
+
&:hover {
|
|
551
|
+
background-color: ${n.purple[400]}${l("",i[90])};
|
|
552
|
+
}
|
|
553
|
+
z-index: 4;
|
|
554
|
+
`,"dragHandle-position-top":t`
|
|
555
|
+
bottom: 0;
|
|
556
|
+
width: 100%;
|
|
557
|
+
height: 3px;
|
|
558
|
+
cursor: ns-resize;
|
|
559
|
+
`,"dragHandle-position-bottom":t`
|
|
560
|
+
top: 0;
|
|
561
|
+
width: 100%;
|
|
562
|
+
height: 3px;
|
|
563
|
+
cursor: ns-resize;
|
|
564
|
+
`,"dragHandle-position-right":t`
|
|
565
|
+
left: 0;
|
|
566
|
+
width: 3px;
|
|
567
|
+
height: 100%;
|
|
568
|
+
cursor: ew-resize;
|
|
569
|
+
`,"dragHandle-position-left":t`
|
|
570
|
+
right: 0;
|
|
571
|
+
width: 3px;
|
|
572
|
+
height: 100%;
|
|
573
|
+
cursor: ew-resize;
|
|
574
|
+
`,row:t`
|
|
575
|
+
display: flex;
|
|
576
|
+
justify-content: space-between;
|
|
577
|
+
align-items: center;
|
|
578
|
+
padding: ${sW.size[2]} ${sW.size[2.5]};
|
|
579
|
+
gap: ${sW.size[2.5]};
|
|
580
|
+
border-bottom: ${l(n.gray[300],n.darkGray[500])} 1px solid;
|
|
581
|
+
align-items: center;
|
|
582
|
+
& > button {
|
|
583
|
+
padding: 0;
|
|
584
|
+
background: transparent;
|
|
585
|
+
border: none;
|
|
586
|
+
display: flex;
|
|
587
|
+
gap: ${o[.5]};
|
|
588
|
+
flex-direction: column;
|
|
589
|
+
}
|
|
590
|
+
`,logoAndToggleContainer:t`
|
|
591
|
+
display: flex;
|
|
592
|
+
gap: ${sW.size[3]};
|
|
593
|
+
align-items: center;
|
|
594
|
+
`,logo:t`
|
|
595
|
+
cursor: pointer;
|
|
596
|
+
display: flex;
|
|
597
|
+
flex-direction: column;
|
|
598
|
+
background-color: transparent;
|
|
599
|
+
border: none;
|
|
600
|
+
gap: ${sW.size[.5]};
|
|
601
|
+
padding: 0px;
|
|
602
|
+
&:hover {
|
|
603
|
+
opacity: 0.7;
|
|
604
|
+
}
|
|
605
|
+
&:focus-visible {
|
|
606
|
+
outline-offset: 4px;
|
|
607
|
+
border-radius: ${a.radius.xs};
|
|
608
|
+
outline: 2px solid ${n.blue[800]};
|
|
609
|
+
}
|
|
610
|
+
`,tanstackLogo:t`
|
|
611
|
+
font-size: ${r.size.md};
|
|
612
|
+
font-weight: ${r.weight.bold};
|
|
613
|
+
line-height: ${r.lineHeight.xs};
|
|
614
|
+
white-space: nowrap;
|
|
615
|
+
color: ${l(n.gray[600],n.gray[300])};
|
|
616
|
+
`,queryFlavorLogo:t`
|
|
617
|
+
font-weight: ${r.weight.semibold};
|
|
618
|
+
font-size: ${r.size.xs};
|
|
619
|
+
background: linear-gradient(
|
|
620
|
+
to right,
|
|
621
|
+
${l("#ea4037, #ff9b11","#dd524b, #e9a03b")}
|
|
622
|
+
);
|
|
623
|
+
background-clip: text;
|
|
624
|
+
-webkit-background-clip: text;
|
|
625
|
+
line-height: 1;
|
|
626
|
+
-webkit-text-fill-color: transparent;
|
|
627
|
+
white-space: nowrap;
|
|
628
|
+
`,queryStatusContainer:t`
|
|
629
|
+
display: flex;
|
|
630
|
+
gap: ${sW.size[2]};
|
|
631
|
+
height: min-content;
|
|
632
|
+
`,queryStatusTag:t`
|
|
633
|
+
display: flex;
|
|
634
|
+
gap: ${sW.size[1.5]};
|
|
635
|
+
box-sizing: border-box;
|
|
636
|
+
height: ${sW.size[6.5]};
|
|
637
|
+
background: ${l(n.gray[50],n.darkGray[500])};
|
|
638
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
639
|
+
border-radius: ${sW.border.radius.sm};
|
|
640
|
+
font-size: ${r.size.sm};
|
|
641
|
+
padding: ${sW.size[1]};
|
|
642
|
+
padding-left: ${sW.size[1.5]};
|
|
643
|
+
align-items: center;
|
|
644
|
+
font-weight: ${r.weight.medium};
|
|
645
|
+
border: ${l("1px solid "+n.gray[300],"1px solid transparent")};
|
|
646
|
+
user-select: none;
|
|
647
|
+
position: relative;
|
|
648
|
+
&:focus-visible {
|
|
649
|
+
outline-offset: 2px;
|
|
650
|
+
outline: 2px solid ${n.blue[800]};
|
|
651
|
+
}
|
|
652
|
+
`,queryStatusTagLabel:t`
|
|
653
|
+
font-size: ${r.size.xs};
|
|
654
|
+
`,queryStatusCount:t`
|
|
655
|
+
font-size: ${r.size.xs};
|
|
656
|
+
padding: 0 5px;
|
|
657
|
+
display: flex;
|
|
658
|
+
align-items: center;
|
|
659
|
+
justify-content: center;
|
|
660
|
+
color: ${l(n.gray[500],n.gray[400])};
|
|
661
|
+
background-color: ${l(n.gray[200],n.darkGray[300])};
|
|
662
|
+
border-radius: 2px;
|
|
663
|
+
font-variant-numeric: tabular-nums;
|
|
664
|
+
height: ${sW.size[4.5]};
|
|
665
|
+
`,statusTooltip:t`
|
|
666
|
+
position: absolute;
|
|
667
|
+
z-index: 1;
|
|
668
|
+
background-color: ${l(n.gray[50],n.darkGray[500])};
|
|
669
|
+
top: 100%;
|
|
670
|
+
left: 50%;
|
|
671
|
+
transform: translate(-50%, calc(${sW.size[2]}));
|
|
672
|
+
padding: ${sW.size[.5]} ${sW.size[2]};
|
|
673
|
+
border-radius: ${sW.border.radius.sm};
|
|
674
|
+
font-size: ${r.size.xs};
|
|
675
|
+
border: 1px solid ${l(n.gray[400],n.gray[600])};
|
|
676
|
+
color: ${l(n.gray[600],n.gray[300])};
|
|
677
|
+
|
|
678
|
+
&::before {
|
|
679
|
+
top: 0px;
|
|
680
|
+
content: ' ';
|
|
681
|
+
display: block;
|
|
682
|
+
left: 50%;
|
|
683
|
+
transform: translate(-50%, -100%);
|
|
684
|
+
position: absolute;
|
|
685
|
+
border-color: transparent transparent
|
|
686
|
+
${l(n.gray[400],n.gray[600])} transparent;
|
|
687
|
+
border-style: solid;
|
|
688
|
+
border-width: 7px;
|
|
689
|
+
/* transform: rotate(180deg); */
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
&::after {
|
|
693
|
+
top: 0px;
|
|
694
|
+
content: ' ';
|
|
695
|
+
display: block;
|
|
696
|
+
left: 50%;
|
|
697
|
+
transform: translate(-50%, calc(-100% + 2px));
|
|
698
|
+
position: absolute;
|
|
699
|
+
border-color: transparent transparent
|
|
700
|
+
${l(n.gray[100],n.darkGray[500])} transparent;
|
|
701
|
+
border-style: solid;
|
|
702
|
+
border-width: 7px;
|
|
703
|
+
}
|
|
704
|
+
`,filtersContainer:t`
|
|
705
|
+
display: flex;
|
|
706
|
+
gap: ${sW.size[2]};
|
|
707
|
+
& > button {
|
|
708
|
+
cursor: pointer;
|
|
709
|
+
padding: ${sW.size[.5]} ${sW.size[1.5]} ${sW.size[.5]}
|
|
710
|
+
${sW.size[2]};
|
|
711
|
+
border-radius: ${sW.border.radius.sm};
|
|
712
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
713
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
714
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
715
|
+
font-size: ${r.size.xs};
|
|
716
|
+
display: flex;
|
|
717
|
+
align-items: center;
|
|
718
|
+
line-height: ${r.lineHeight.sm};
|
|
719
|
+
gap: ${sW.size[1.5]};
|
|
720
|
+
max-width: 160px;
|
|
721
|
+
&:focus-visible {
|
|
722
|
+
outline-offset: 2px;
|
|
723
|
+
border-radius: ${a.radius.xs};
|
|
724
|
+
outline: 2px solid ${n.blue[800]};
|
|
725
|
+
}
|
|
726
|
+
& svg {
|
|
727
|
+
width: ${sW.size[3]};
|
|
728
|
+
height: ${sW.size[3]};
|
|
729
|
+
color: ${l(n.gray[500],n.gray[400])};
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
`,filterInput:t`
|
|
733
|
+
padding: ${o[.5]} ${o[2]};
|
|
734
|
+
border-radius: ${sW.border.radius.sm};
|
|
735
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
736
|
+
display: flex;
|
|
737
|
+
box-sizing: content-box;
|
|
738
|
+
align-items: center;
|
|
739
|
+
gap: ${sW.size[1.5]};
|
|
740
|
+
max-width: 160px;
|
|
741
|
+
min-width: 100px;
|
|
742
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
743
|
+
height: min-content;
|
|
744
|
+
color: ${l(n.gray[600],n.gray[400])};
|
|
745
|
+
& > svg {
|
|
746
|
+
width: ${o[3]};
|
|
747
|
+
height: ${o[3]};
|
|
748
|
+
}
|
|
749
|
+
& input {
|
|
750
|
+
font-size: ${r.size.xs};
|
|
751
|
+
width: 100%;
|
|
752
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
753
|
+
border: none;
|
|
754
|
+
padding: 0;
|
|
755
|
+
line-height: ${r.lineHeight.sm};
|
|
756
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
757
|
+
&::placeholder {
|
|
758
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
759
|
+
}
|
|
760
|
+
&:focus {
|
|
761
|
+
outline: none;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
&:focus-within {
|
|
766
|
+
outline-offset: 2px;
|
|
767
|
+
border-radius: ${a.radius.xs};
|
|
768
|
+
outline: 2px solid ${n.blue[800]};
|
|
769
|
+
}
|
|
770
|
+
`,filterSelect:t`
|
|
771
|
+
padding: ${sW.size[.5]} ${sW.size[2]};
|
|
772
|
+
border-radius: ${sW.border.radius.sm};
|
|
773
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
774
|
+
display: flex;
|
|
775
|
+
align-items: center;
|
|
776
|
+
gap: ${sW.size[1.5]};
|
|
777
|
+
box-sizing: content-box;
|
|
778
|
+
max-width: 160px;
|
|
779
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
780
|
+
height: min-content;
|
|
781
|
+
& > svg {
|
|
782
|
+
color: ${l(n.gray[600],n.gray[400])};
|
|
783
|
+
width: ${sW.size[2]};
|
|
784
|
+
height: ${sW.size[2]};
|
|
785
|
+
}
|
|
786
|
+
& > select {
|
|
787
|
+
appearance: none;
|
|
788
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
789
|
+
min-width: 100px;
|
|
790
|
+
line-height: ${r.lineHeight.sm};
|
|
791
|
+
font-size: ${r.size.xs};
|
|
792
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
793
|
+
border: none;
|
|
794
|
+
&:focus {
|
|
795
|
+
outline: none;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
&:focus-within {
|
|
799
|
+
outline-offset: 2px;
|
|
800
|
+
border-radius: ${a.radius.xs};
|
|
801
|
+
outline: 2px solid ${n.blue[800]};
|
|
802
|
+
}
|
|
803
|
+
`,actionsContainer:t`
|
|
804
|
+
display: flex;
|
|
805
|
+
gap: ${sW.size[2]};
|
|
806
|
+
`,actionsBtn:t`
|
|
807
|
+
border-radius: ${sW.border.radius.sm};
|
|
808
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
809
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
810
|
+
width: ${sW.size[6.5]};
|
|
811
|
+
height: ${sW.size[6.5]};
|
|
812
|
+
justify-content: center;
|
|
813
|
+
display: flex;
|
|
814
|
+
align-items: center;
|
|
815
|
+
gap: ${sW.size[1.5]};
|
|
816
|
+
max-width: 160px;
|
|
817
|
+
cursor: pointer;
|
|
818
|
+
padding: 0;
|
|
819
|
+
&:hover {
|
|
820
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
821
|
+
}
|
|
822
|
+
& svg {
|
|
823
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
824
|
+
width: ${sW.size[3]};
|
|
825
|
+
height: ${sW.size[3]};
|
|
826
|
+
}
|
|
827
|
+
&:focus-visible {
|
|
828
|
+
outline-offset: 2px;
|
|
829
|
+
border-radius: ${a.radius.xs};
|
|
830
|
+
outline: 2px solid ${n.blue[800]};
|
|
831
|
+
}
|
|
832
|
+
`,actionsBtnOffline:t`
|
|
833
|
+
& svg {
|
|
834
|
+
stroke: ${l(n.yellow[700],n.yellow[500])};
|
|
835
|
+
fill: ${l(n.yellow[700],n.yellow[500])};
|
|
836
|
+
}
|
|
837
|
+
`,overflowQueryContainer:t`
|
|
838
|
+
flex: 1;
|
|
839
|
+
overflow-y: auto;
|
|
840
|
+
& > div {
|
|
841
|
+
display: flex;
|
|
842
|
+
flex-direction: column;
|
|
843
|
+
}
|
|
844
|
+
`,queryRow:t`
|
|
845
|
+
display: flex;
|
|
846
|
+
align-items: center;
|
|
847
|
+
padding: 0;
|
|
848
|
+
border: none;
|
|
849
|
+
cursor: pointer;
|
|
850
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
851
|
+
background-color: ${l(n.gray[50],n.darkGray[700])};
|
|
852
|
+
line-height: 1;
|
|
853
|
+
&:focus {
|
|
854
|
+
outline: none;
|
|
855
|
+
}
|
|
856
|
+
&:focus-visible {
|
|
857
|
+
outline-offset: -2px;
|
|
858
|
+
border-radius: ${a.radius.xs};
|
|
859
|
+
outline: 2px solid ${n.blue[800]};
|
|
860
|
+
}
|
|
861
|
+
&:hover .tsqd-query-hash {
|
|
862
|
+
background-color: ${l(n.gray[200],n.darkGray[600])};
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
& .tsqd-query-observer-count {
|
|
866
|
+
padding: 0 ${sW.size[1]};
|
|
867
|
+
user-select: none;
|
|
868
|
+
min-width: ${sW.size[6.5]};
|
|
869
|
+
align-self: stretch;
|
|
870
|
+
display: flex;
|
|
871
|
+
align-items: center;
|
|
872
|
+
justify-content: center;
|
|
873
|
+
font-size: ${r.size.xs};
|
|
874
|
+
font-weight: ${r.weight.medium};
|
|
875
|
+
border-bottom-width: 1px;
|
|
876
|
+
border-bottom-style: solid;
|
|
877
|
+
border-bottom: 1px solid ${l(n.gray[300],n.darkGray[700])};
|
|
878
|
+
}
|
|
879
|
+
& .tsqd-query-hash {
|
|
880
|
+
user-select: text;
|
|
881
|
+
font-size: ${r.size.xs};
|
|
882
|
+
display: flex;
|
|
883
|
+
align-items: center;
|
|
884
|
+
min-height: ${sW.size[6]};
|
|
885
|
+
flex: 1;
|
|
886
|
+
padding: ${sW.size[1]} ${sW.size[2]};
|
|
887
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
888
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
889
|
+
border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
890
|
+
text-align: left;
|
|
891
|
+
text-overflow: clip;
|
|
892
|
+
word-break: break-word;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
& .tsqd-query-disabled-indicator {
|
|
896
|
+
align-self: stretch;
|
|
897
|
+
display: flex;
|
|
898
|
+
align-items: center;
|
|
899
|
+
padding: 0 ${sW.size[2]};
|
|
900
|
+
color: ${l(n.gray[800],n.gray[300])};
|
|
901
|
+
background-color: ${l(n.gray[300],n.darkGray[600])};
|
|
902
|
+
border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
903
|
+
font-size: ${r.size.xs};
|
|
904
|
+
}
|
|
905
|
+
`,selectedQueryRow:t`
|
|
906
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
907
|
+
`,detailsContainer:t`
|
|
908
|
+
flex: 1 1 700px;
|
|
909
|
+
background-color: ${l(n.gray[50],n.darkGray[700])};
|
|
910
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
911
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
912
|
+
display: flex;
|
|
913
|
+
flex-direction: column;
|
|
914
|
+
overflow-y: auto;
|
|
915
|
+
display: flex;
|
|
916
|
+
text-align: left;
|
|
917
|
+
`,detailsHeader:t`
|
|
918
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
919
|
+
position: sticky;
|
|
920
|
+
top: 0;
|
|
921
|
+
z-index: 2;
|
|
922
|
+
background-color: ${l(n.gray[200],n.darkGray[600])};
|
|
923
|
+
padding: ${sW.size[1.5]} ${sW.size[2]};
|
|
924
|
+
font-weight: ${r.weight.medium};
|
|
925
|
+
font-size: ${r.size.xs};
|
|
926
|
+
line-height: ${r.lineHeight.xs};
|
|
927
|
+
text-align: left;
|
|
928
|
+
`,detailsBody:t`
|
|
929
|
+
margin: ${sW.size[1.5]} 0px ${sW.size[2]} 0px;
|
|
930
|
+
& > div {
|
|
931
|
+
display: flex;
|
|
932
|
+
align-items: stretch;
|
|
933
|
+
padding: 0 ${sW.size[2]};
|
|
934
|
+
line-height: ${r.lineHeight.sm};
|
|
935
|
+
justify-content: space-between;
|
|
936
|
+
& > span {
|
|
937
|
+
font-size: ${r.size.xs};
|
|
938
|
+
}
|
|
939
|
+
& > span:nth-child(2) {
|
|
940
|
+
font-variant-numeric: tabular-nums;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
& > div:first-child {
|
|
945
|
+
margin-bottom: ${sW.size[1.5]};
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
& code {
|
|
949
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
950
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
951
|
+
margin: 0;
|
|
952
|
+
font-size: ${r.size.xs};
|
|
953
|
+
line-height: ${r.lineHeight.xs};
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
& pre {
|
|
957
|
+
margin: 0;
|
|
958
|
+
display: flex;
|
|
959
|
+
align-items: center;
|
|
960
|
+
}
|
|
961
|
+
`,queryDetailsStatus:t`
|
|
962
|
+
border: 1px solid ${n.darkGray[200]};
|
|
963
|
+
border-radius: ${sW.border.radius.sm};
|
|
964
|
+
font-weight: ${r.weight.medium};
|
|
965
|
+
padding: ${sW.size[1]} ${sW.size[2.5]};
|
|
966
|
+
`,actionsBody:t`
|
|
967
|
+
flex-wrap: wrap;
|
|
968
|
+
margin: ${sW.size[2]} 0px ${sW.size[2]} 0px;
|
|
969
|
+
display: flex;
|
|
970
|
+
gap: ${sW.size[2]};
|
|
971
|
+
padding: 0px ${sW.size[2]};
|
|
972
|
+
& > button {
|
|
973
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
974
|
+
font-size: ${r.size.xs};
|
|
975
|
+
padding: ${sW.size[1]} ${sW.size[2]};
|
|
976
|
+
display: flex;
|
|
977
|
+
border-radius: ${sW.border.radius.sm};
|
|
978
|
+
background-color: ${l(n.gray[100],n.darkGray[600])};
|
|
979
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
980
|
+
align-items: center;
|
|
981
|
+
gap: ${sW.size[2]};
|
|
982
|
+
font-weight: ${r.weight.medium};
|
|
983
|
+
line-height: ${r.lineHeight.xs};
|
|
984
|
+
cursor: pointer;
|
|
985
|
+
&:focus-visible {
|
|
986
|
+
outline-offset: 2px;
|
|
987
|
+
border-radius: ${a.radius.xs};
|
|
988
|
+
outline: 2px solid ${n.blue[800]};
|
|
989
|
+
}
|
|
990
|
+
&:hover {
|
|
991
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
&:disabled {
|
|
995
|
+
opacity: 0.6;
|
|
996
|
+
cursor: not-allowed;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
& > span {
|
|
1000
|
+
width: ${o[1.5]};
|
|
1001
|
+
height: ${o[1.5]};
|
|
1002
|
+
border-radius: ${sW.border.radius.full};
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
`,actionsSelect:t`
|
|
1006
|
+
font-size: ${r.size.xs};
|
|
1007
|
+
padding: ${sW.size[.5]} ${sW.size[2]};
|
|
1008
|
+
display: flex;
|
|
1009
|
+
border-radius: ${sW.border.radius.sm};
|
|
1010
|
+
overflow: hidden;
|
|
1011
|
+
background-color: ${l(n.gray[100],n.darkGray[600])};
|
|
1012
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
1013
|
+
align-items: center;
|
|
1014
|
+
gap: ${sW.size[2]};
|
|
1015
|
+
font-weight: ${r.weight.medium};
|
|
1016
|
+
line-height: ${r.lineHeight.sm};
|
|
1017
|
+
color: ${l(n.red[500],n.red[400])};
|
|
1018
|
+
cursor: pointer;
|
|
1019
|
+
position: relative;
|
|
1020
|
+
&:hover {
|
|
1021
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
1022
|
+
}
|
|
1023
|
+
& > span {
|
|
1024
|
+
width: ${o[1.5]};
|
|
1025
|
+
height: ${o[1.5]};
|
|
1026
|
+
border-radius: ${sW.border.radius.full};
|
|
1027
|
+
}
|
|
1028
|
+
&:focus-within {
|
|
1029
|
+
outline-offset: 2px;
|
|
1030
|
+
border-radius: ${a.radius.xs};
|
|
1031
|
+
outline: 2px solid ${n.blue[800]};
|
|
1032
|
+
}
|
|
1033
|
+
& select {
|
|
1034
|
+
position: absolute;
|
|
1035
|
+
top: 0;
|
|
1036
|
+
left: 0;
|
|
1037
|
+
width: 100%;
|
|
1038
|
+
height: 100%;
|
|
1039
|
+
appearance: none;
|
|
1040
|
+
background-color: transparent;
|
|
1041
|
+
border: none;
|
|
1042
|
+
color: transparent;
|
|
1043
|
+
outline: none;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
& svg path {
|
|
1047
|
+
stroke: ${sW.colors.red[400]};
|
|
1048
|
+
}
|
|
1049
|
+
& svg {
|
|
1050
|
+
width: ${sW.size[2]};
|
|
1051
|
+
height: ${sW.size[2]};
|
|
1052
|
+
}
|
|
1053
|
+
`,settingsMenu:t`
|
|
1054
|
+
display: flex;
|
|
1055
|
+
& * {
|
|
1056
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
1057
|
+
}
|
|
1058
|
+
flex-direction: column;
|
|
1059
|
+
gap: ${o[.5]};
|
|
1060
|
+
border-radius: ${sW.border.radius.sm};
|
|
1061
|
+
border: 1px solid ${l(n.gray[300],n.gray[700])};
|
|
1062
|
+
background-color: ${l(n.gray[50],n.darkGray[600])};
|
|
1063
|
+
font-size: ${r.size.xs};
|
|
1064
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
1065
|
+
z-index: 99999;
|
|
1066
|
+
min-width: 120px;
|
|
1067
|
+
padding: ${o[.5]};
|
|
1068
|
+
`,settingsSubTrigger:t`
|
|
1069
|
+
display: flex;
|
|
1070
|
+
align-items: center;
|
|
1071
|
+
justify-content: space-between;
|
|
1072
|
+
border-radius: ${sW.border.radius.xs};
|
|
1073
|
+
padding: ${sW.size[1]} ${sW.size[1]};
|
|
1074
|
+
cursor: pointer;
|
|
1075
|
+
background-color: transparent;
|
|
1076
|
+
border: none;
|
|
1077
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
1078
|
+
& svg {
|
|
1079
|
+
color: ${l(n.gray[600],n.gray[400])};
|
|
1080
|
+
transform: rotate(-90deg);
|
|
1081
|
+
width: ${sW.size[2]};
|
|
1082
|
+
height: ${sW.size[2]};
|
|
1083
|
+
}
|
|
1084
|
+
&:hover {
|
|
1085
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
1086
|
+
}
|
|
1087
|
+
&:focus-visible {
|
|
1088
|
+
outline-offset: 2px;
|
|
1089
|
+
outline: 2px solid ${n.blue[800]};
|
|
1090
|
+
}
|
|
1091
|
+
&.data-disabled {
|
|
1092
|
+
opacity: 0.6;
|
|
1093
|
+
cursor: not-allowed;
|
|
1094
|
+
}
|
|
1095
|
+
`,settingsMenuHeader:t`
|
|
1096
|
+
padding: ${sW.size[1]} ${sW.size[1]};
|
|
1097
|
+
font-weight: ${r.weight.medium};
|
|
1098
|
+
border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
1099
|
+
color: ${l(n.gray[500],n.gray[400])};
|
|
1100
|
+
font-size: ${r.size.xs};
|
|
1101
|
+
`,settingsSubButton:t`
|
|
1102
|
+
display: flex;
|
|
1103
|
+
align-items: center;
|
|
1104
|
+
justify-content: space-between;
|
|
1105
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
1106
|
+
font-size: ${r.size.xs};
|
|
1107
|
+
border-radius: ${sW.border.radius.xs};
|
|
1108
|
+
padding: ${sW.size[1]} ${sW.size[1]};
|
|
1109
|
+
cursor: pointer;
|
|
1110
|
+
background-color: transparent;
|
|
1111
|
+
border: none;
|
|
1112
|
+
& svg {
|
|
1113
|
+
color: ${l(n.gray[600],n.gray[400])};
|
|
1114
|
+
}
|
|
1115
|
+
&:hover {
|
|
1116
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
1117
|
+
}
|
|
1118
|
+
&:focus-visible {
|
|
1119
|
+
outline-offset: 2px;
|
|
1120
|
+
outline: 2px solid ${n.blue[800]};
|
|
1121
|
+
}
|
|
1122
|
+
`,themeSelectedButton:t`
|
|
1123
|
+
background-color: ${l(n.purple[100],n.purple[900])};
|
|
1124
|
+
color: ${l(n.purple[700],n.purple[300])};
|
|
1125
|
+
& svg {
|
|
1126
|
+
color: ${l(n.purple[700],n.purple[300])};
|
|
1127
|
+
}
|
|
1128
|
+
&:hover {
|
|
1129
|
+
background-color: ${l(n.purple[100],n.purple[900])};
|
|
1130
|
+
}
|
|
1131
|
+
`,viewToggle:t`
|
|
1132
|
+
border-radius: ${sW.border.radius.sm};
|
|
1133
|
+
background-color: ${l(n.gray[200],n.darkGray[600])};
|
|
1134
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
1135
|
+
display: flex;
|
|
1136
|
+
padding: 0;
|
|
1137
|
+
font-size: ${r.size.xs};
|
|
1138
|
+
color: ${l(n.gray[700],n.gray[300])};
|
|
1139
|
+
overflow: hidden;
|
|
1140
|
+
|
|
1141
|
+
&:has(:focus-visible) {
|
|
1142
|
+
outline: 2px solid ${n.blue[800]};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
& .tsqd-radio-toggle {
|
|
1146
|
+
opacity: 0.5;
|
|
1147
|
+
display: flex;
|
|
1148
|
+
& label {
|
|
1149
|
+
display: flex;
|
|
1150
|
+
align-items: center;
|
|
1151
|
+
cursor: pointer;
|
|
1152
|
+
line-height: ${r.lineHeight.md};
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
& label:hover {
|
|
1156
|
+
background-color: ${l(n.gray[100],n.darkGray[500])};
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
& > [data-checked] {
|
|
1161
|
+
opacity: 1;
|
|
1162
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
1163
|
+
& label:hover {
|
|
1164
|
+
background-color: ${l(n.gray[100],n.darkGray[400])};
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
& .tsqd-radio-toggle:first-child {
|
|
1169
|
+
& label {
|
|
1170
|
+
padding: 0 ${sW.size[1.5]} 0 ${sW.size[2]};
|
|
1171
|
+
}
|
|
1172
|
+
border-right: 1px solid ${l(n.gray[300],n.darkGray[200])};
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
& .tsqd-radio-toggle:nth-child(2) {
|
|
1176
|
+
& label {
|
|
1177
|
+
padding: 0 ${sW.size[2]} 0 ${sW.size[1.5]};
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
`,devtoolsEditForm:t`
|
|
1181
|
+
padding: ${o[2]};
|
|
1182
|
+
& > [data-error='true'] {
|
|
1183
|
+
outline: 2px solid ${l(n.red[200],n.red[800])};
|
|
1184
|
+
outline-offset: 2px;
|
|
1185
|
+
border-radius: ${a.radius.xs};
|
|
1186
|
+
}
|
|
1187
|
+
`,devtoolsEditTextarea:t`
|
|
1188
|
+
width: 100%;
|
|
1189
|
+
max-height: 500px;
|
|
1190
|
+
font-family: 'Fira Code', monospace;
|
|
1191
|
+
font-size: ${r.size.xs};
|
|
1192
|
+
border-radius: ${a.radius.sm};
|
|
1193
|
+
field-sizing: content;
|
|
1194
|
+
padding: ${o[2]};
|
|
1195
|
+
background-color: ${l(n.gray[100],n.darkGray[800])};
|
|
1196
|
+
color: ${l(n.gray[900],n.gray[100])};
|
|
1197
|
+
border: 1px solid ${l(n.gray[200],n.gray[700])};
|
|
1198
|
+
resize: none;
|
|
1199
|
+
&:focus {
|
|
1200
|
+
outline-offset: 2px;
|
|
1201
|
+
border-radius: ${a.radius.xs};
|
|
1202
|
+
outline: 2px solid ${l(n.blue[200],n.blue[800])};
|
|
1203
|
+
}
|
|
1204
|
+
`,devtoolsEditFormActions:t`
|
|
1205
|
+
display: flex;
|
|
1206
|
+
justify-content: space-between;
|
|
1207
|
+
gap: ${o[2]};
|
|
1208
|
+
align-items: center;
|
|
1209
|
+
padding-top: ${o[1]};
|
|
1210
|
+
font-size: ${r.size.xs};
|
|
1211
|
+
`,devtoolsEditFormError:t`
|
|
1212
|
+
color: ${l(n.red[700],n.red[500])};
|
|
1213
|
+
`,devtoolsEditFormActionContainer:t`
|
|
1214
|
+
display: flex;
|
|
1215
|
+
gap: ${o[2]};
|
|
1216
|
+
`,devtoolsEditFormAction:t`
|
|
1217
|
+
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
1218
|
+
font-size: ${r.size.xs};
|
|
1219
|
+
padding: ${o[1]} ${sW.size[2]};
|
|
1220
|
+
display: flex;
|
|
1221
|
+
border-radius: ${a.radius.sm};
|
|
1222
|
+
background-color: ${l(n.gray[100],n.darkGray[600])};
|
|
1223
|
+
border: 1px solid ${l(n.gray[300],n.darkGray[400])};
|
|
1224
|
+
align-items: center;
|
|
1225
|
+
gap: ${o[2]};
|
|
1226
|
+
font-weight: ${r.weight.medium};
|
|
1227
|
+
line-height: ${r.lineHeight.xs};
|
|
1228
|
+
cursor: pointer;
|
|
1229
|
+
&:focus-visible {
|
|
1230
|
+
outline-offset: 2px;
|
|
1231
|
+
border-radius: ${a.radius.xs};
|
|
1232
|
+
outline: 2px solid ${n.blue[800]};
|
|
1233
|
+
}
|
|
1234
|
+
&:hover {
|
|
1235
|
+
background-color: ${l(n.gray[200],n.darkGray[500])};
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
&:disabled {
|
|
1239
|
+
opacity: 0.6;
|
|
1240
|
+
cursor: not-allowed;
|
|
1241
|
+
}
|
|
1242
|
+
`}},DY=e=>NY("light",e),_Y=e=>NY("dark",e);Lt(["click","mousedown","input"]);const MY=Object.freeze(Object.defineProperty({__proto__:null,default:e=>{const[t,n]=xz({prefix:"TanstackQueryDevtools"}),r=rr(),o=Re((()=>{const e=t.theme_preference||Ez;return"system"!==e?e:r()}));return ut(Tz.Provider,{value:e,get children(){return ut(_z,{localStore:t,setLocalStore:n,get children(){return ut(Oz.Provider,{value:o,get children(){return ut(dY,{localStore:t,setLocalStore:n})}})}})}})}},Symbol.toStringTag,{value:"Module"}));Symbol;e.CreateAutomationModal=yw,e.Engage=({iconDefinitions:e})=>{const n=Jx(e);return t.jsx(mN,{iconDefinitionsPassed:n})},e.ReachProvider=({authToken:e,tenantExternalId:r,language:o,children:i})=>{const[s]=n.useState((()=>(e&&(Ga=e),new G({defaultOptions:{queries:{retry:(e,t)=>!(t instanceof Error&&"Unauthorized"===t.message)&&e<3,...Wa}}}))));return t.jsxs(re,{client:s,children:[t.jsx(Ba,{clientSideID:"67a3c277012e1f09c67de499",context:{kind:"user",key:r||"anonymous",custom:{businessId:r}},options:{streaming:!1},timeout:2,reactOptions:{useCamelCaseFlagKeys:!1,sendEventsOnFlagRead:!0},children:t.jsx(bc,{initialLanguage:o,children:t.jsx(il,{children:t.jsxs(tl,{children:[i,t.jsx(Lh,{})]})})})}),t.jsx(lr,{})]})},e.SegmentBuilder=pR,e.ViewAutomationModal=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s})=>{const a=function(){let{matches:e}=i.useContext(lS),t=e[e.length-1];return t?t.params:{}}(),[l]=GS(),c=r||a.automationId||l.get("automationId"),u=n||l.get("autoOpenEditPopup"),d="true"===l.get("showBackButton")||o,h=Jx(e),{automation:f,isFetching:p,isLoading:m,fetchError:g}=Vx(c||"");return c?f||!p&&!m?g?t.jsxs("div",{children:["Error: ",g.message]}):f?t.jsxs("div",{className:uw,children:[t.jsx(pz,{automation:f,iconDefinitions:h,autoOpenEditPopup:u,showBackButton:d,logoUrl:s}),t.jsx("div",{className:"pt-4",children:t.jsxs(XR,{defaultValue:"content",children:[t.jsxs(JR,{children:[t.jsx(ZR,{value:"content",children:"Content"}),t.jsx(ZR,{value:"recipients",children:"Recipients"})]}),t.jsx(eA,{value:"recipients",children:t.jsx(pA,{automationId:c,iconDefinitions:h})}),t.jsx(eA,{value:"content",children:t.jsx(fA,{automationId:c,iconDefinitions:h})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:uw,children:t.jsx(Fx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|